ソースを参照

未调试完成,待修改

染尘落幕 2 週間 前
コミット
c82289fd2e

+ 16 - 0
.hbuilderx/launch.json

@@ -0,0 +1,16 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
+    ]
+}

+ 12 - 1
src/api/questionReqort/index.ts

@@ -16,7 +16,11 @@ export enum questionApi {
    */
   QUESTION_TYPE_LIST = '/bTKnowledgeTypes/getPage',
   // 城运事件上报接口
-  REPORTDATA = '/chengyun/event/front/V1/openApi/reportData'
+  REPORTDATA = '/chengyun/event/front/V1/openApi/reportData',
+
+  // 获取网格员
+  GETAREA_GRID_PERSON = '/pc/ystlsystemservice/areaGrid/getAreaGrid'
+
   
 }
 
@@ -24,6 +28,13 @@ export enum questionApi {
 export const addQuestionReportData = (data: AddQuestionReportDataReq) => {
   return service.post<ApiResponse<boolean>>(questionApi.ADD_QUESTION_REPORT_DATA, data)
 }
+
+// 获取网格员
+export const getPerson = (params:{parentCode:string}) => {
+  return service.get(questionApi.GETAREA_GRID_PERSON,{params})
+}
+
+
 // 城运-事件上报
 export const REPORTDATA = (data:any) => {
   return service.post(questionApi.REPORTDATA, data)

+ 6 - 0
src/api/questionReqort/types.ts

@@ -14,10 +14,13 @@ export interface AddQuestionReportDataReq {
    * 经度
    */
   longitude?: string
+  // 负责人
+  chargerName:string
   /**
    * 联系人姓名
    */
   contactPerson: string
+  contactPersonPhone: string
   /**
    * 问题内容
    */
@@ -30,6 +33,9 @@ export interface AddQuestionReportDataReq {
    * 问题类型
    */
   questionType?: string
+
+  person1?:string
+  person2?:string
 }
 
 /** 上报问题列表req */

+ 6 - 0
src/config/proxy.ts

@@ -8,6 +8,12 @@ const proxy: Record<string, string | ProxyOptions> = {
   //   changeOrigin: true,
   //   rewrite: (path) => path.replace(/^\/api/, ''),
   // },
+  '/api/pc': {
+    target: 'https://10.68.191.169:9080',
+    changeOrigin: true,
+    secure: false,
+    rewrite: (path) => path.replace(/^\/api\/pc/, 'api/'),
+  },
   '/api/chengyun': {
     target: 'http://10.68.191.64:30002',
     changeOrigin: true,

+ 60 - 16
src/subPages/pages/reportProblems/index.vue

@@ -1,5 +1,5 @@
 <script lang="ts" setup>
-import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData } from '@/api/questionReqort'
+import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData,getPerson } from '@/api/questionReqort'
 import { AddQuestionReportDataReq, QuestionListRes, QuestionType, QuestionTypeListRes } from '@/api/questionReqort/types'
 import { onMounted, ref } from 'vue'
 import GridAddress from '@/components/address/gridAddress/index.vue'
@@ -11,30 +11,40 @@ const active = ref(0)
 
 const formData = ref<AddQuestionReportDataReq & { location?: string }>({})
 const range = ref<{ text: string; value: string }[]>([])
+const rangePerson = ref([]) as any
+
+const changeQuestionType = (e:any) => {
+  formData.value = {};
+  formData.value.questionType = e;
+}
+
 const rules = ref({
   questionType: [{ required: true, message: '请选择类型' }],
-  questionTitle: [{ required: true, message: '请输入标题' }],
+  // questionTitle: [{ required: true, message: '请输入标题' }],
   contactPerson: [{ required: true, message: '请输入联系人' }],
+  contactPhone: [{ required: true, message: '请输入联系人电话' }],
   questionContent: [{ required: true, message: '请输入内容' }],
   addrName: [{ required: true, message: '请输入所在地' }],
 })
 
 /** 上报问题 */
 const addressList = ref([])
-const handleAddressFinish = (value) => {
+const handleAddressFinish = async(value) => {
   formData.value.addrName = value.selectedOptions[value.tabIndex].areaName
   addressList.value = value
+  const { data } = await getPerson({parentCode:value.value})
+  console.log('data==',data)
 }
 const submit = async () => {
   console.log(`output->formData.value`,formData.value)
   if (!formData.value.questionType) {
-    showNotify('请选择类型')
-    return
-  }
-  if (!formData.value.questionTitle) {
-    showNotify('请输入标题')
+    showNotify('请选择问题类型')
     return
   }
+  // if (!formData.value.questionTitle) {
+  //   showNotify('请输入标题')
+  //   return
+  // }
   if (!formData.value.questionContent) {
     showNotify('请输入内容')
     return
@@ -43,12 +53,20 @@ const submit = async () => {
     showNotify('请输入联系人姓名')
     return
   }
+  if (!formData.value.contactPhone) {
+    showNotify('请输入联系人电话')
+    return
+  }
   if (!addressList.value || addressList.value.length === 0) {
     showNotify('请选择所在地')
     return
   }
+
+  console.log('formData.value',formData.value)
+  return
   const { data } = await addQuestionReportData({
     ...formData.value,
+    personList:formData.value.person1+','+formData.value.person2,
     streetCode: addressList.value.selectedOptions[1] ? addressList.value.selectedOptions[1].areaCode : '',
     streetName: addressList.value.selectedOptions[1] ? addressList.value.selectedOptions[1].areaName : '',
     communityCode: addressList.value.selectedOptions[2] ? addressList.value.selectedOptions[2].areaCode : '',
@@ -75,7 +93,7 @@ const reportCY = async (params:any) => {
   const { data } = await REPORTDATA({
     data:{
       otherTaskNum:params.uuid.replace(/-/g,''),
-      eventTitle:params.questionTitle,
+      // eventTitle:params.questionTitle,
       eventDesc:params.questionContent,
       eventTypeCode:'109000',
       eventTypeName:'民事纠纷',
@@ -141,6 +159,7 @@ const hanleSelectArea = () => {
 }
 
 onMounted(async () => {
+  // 问题类型下拉
   const { data } = await getQuestionTypeList({
     page: 1,
     limit: 9999,
@@ -156,6 +175,18 @@ onMounted(async () => {
   } else {
     range.value = []
   }
+//  负责人下拉
+   rangePerson.value = [{
+     text: '张三',
+     value: '张三',
+   }, {
+    text: '李四',
+     value: '李四',
+    }, {
+     text: '王五',
+     value: '王五',
+   }]
+
 })
 </script>
 
@@ -165,25 +196,39 @@ onMounted(async () => {
       <view class="tab-container">
         <uni-forms ref="questionReportFormRef" :modelValue="formData" :rules="rules" label-align="right" label-width="80">
           <uni-forms-item label="问题类型" required name="questionType">
-            <uni-data-select v-model="formData.questionType" :localdata="range"></uni-data-select>
+            <uni-data-select v-model="formData.questionType" :localdata="range" @change="changeQuestionType"></uni-data-select>
           </uni-forms-item>
           <!-- 问题标题 -->
-          <uni-forms-item label="问题标题" required name="questionTitle">
+          <!-- <uni-forms-item label="问题标题" required name="questionTitle">
             <uni-easyinput v-model="formData.questionTitle" placeholder="请输入标题"></uni-easyinput>
+          </uni-forms-item> -->
+          <!-- 当事人 -->
+          <uni-forms-item v-if="formData.questionType=='矛盾纠纷'" label="当事人1" required name="person1">
+            <uni-easyinput v-model="formData.person1" placeholder="请输入当事人"></uni-easyinput>
+          </uni-forms-item>
+          <uni-forms-item v-if="formData.questionType=='矛盾纠纷'" label="当事人2" required name="person2">
+            <uni-easyinput v-model="formData.person2" placeholder="请输入当事人"></uni-easyinput>
           </uni-forms-item>
           <!-- 问题内容 -->
-          <uni-forms-item label="问题内容" required name="questionContent">
-            <uni-easyinput v-model="formData.questionContent" :maxlength="-1" type="textarea" placeholder="请输入内容"></uni-easyinput>
+          <uni-forms-item label="问题描述" required name="questionContent">
+            <uni-easyinput v-model="formData.questionContent" :maxlength="-1" type="textarea" placeholder="请输入问题描述"></uni-easyinput>
           </uni-forms-item>
           <!-- 问题所在地 -->
           <uni-forms-item label="所在地" required name="addrName">
             <uni-easyinput v-model="formData.addrName" placeholder="请输入所在地" @focus="hanleSelectArea"></uni-easyinput>
             <GridAddress v-model="areaShow" @finish="handleAddressFinish"></GridAddress>
           </uni-forms-item>
+          <!-- 负责人下拉 -->
+          <uni-forms-item label="负责人" required name="person">
+            <uni-data-select v-model="formData.chargerName" :localdata="rangePerson"></uni-data-select>
+          </uni-forms-item>
           <!-- 联系人姓名 -->
           <uni-forms-item label="联系人姓名" required name="contactPerson">
             <uni-easyinput v-model="formData.contactPerson" placeholder="联系人姓名"></uni-easyinput>
           </uni-forms-item>
+          <uni-forms-item label="联系人电话" required name="contactPhone">
+            <uni-easyinput v-model="formData.contactPhone" placeholder="联系人电话"></uni-easyinput>
+          </uni-forms-item>
         </uni-forms>
         <van-button class="w-full mb-3" type="primary" @click="submit">提交</van-button>
       </view>
@@ -193,7 +238,7 @@ onMounted(async () => {
         <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="questList">
           <view v-for="item in list" :key="item.uuid" class="list-item-style">
             <view class="top">
-              <view class="title">{{ item.questionTitle }}</view>
+              <view class="title">{{ item.questionContent }}</view>
               <van-button plain hairline size="mini" type="primary" @click="handleGoDetail(item)">查看详情</van-button>
             </view>
             <view>定位:{{ item.addrName }}</view>
@@ -203,8 +248,7 @@ onMounted(async () => {
                 class="max-w-[100px] text-ellipsis overflow-hidden text-nowrap !block !leading-[25px]"
                 color="#CFFECE"
                 text-color="black"
-                >{{ item.questionType }}</van-tag
-              >
+                >{{ item.questionType }}</van-tag>
               <van-tag v-if="item?.status === 0" color="red">未解答</van-tag>
               <van-tag v-if="item?.status === 1" color="green">已解答</van-tag>
             </view>

+ 1 - 1
src/utils/request/index.ts

@@ -14,7 +14,7 @@ service.interceptors.request.use((requestConfig) => {
   handleToken(requestConfig)
    // 新增固定请求头
    Object.assign(requestConfig.headers, {
-    userKey: '17472789470e818D2kC74GzXBFU473'
+    userKey: '17472789470e818D2kC74GzXBFU473',
   });
   return requestConfig
 })