染尘落幕 6 dagar sedan
förälder
incheckning
815790771a

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

@@ -19,7 +19,7 @@ export enum questionApi {
   REPORTDATA = '/chengyun/event/front/V1/openApi/reportData',
 
   // 获取网格员
-  GETAREA_GRID_PERSON = '/pc/ystlsystemservice/areaGrid/getAreaGrid'
+  GETAREA_GRID_PERSON = '/ystlsystemservice/areaGrid/getAreaGrid'
 
   
 }

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

@@ -16,6 +16,7 @@ export interface AddQuestionReportDataReq {
   longitude?: string
   // 负责人
   chargerName:string
+  chargerCode:string
   /**
    * 联系人姓名
    */

+ 2 - 2
src/config/proxy.ts

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

+ 17 - 18
src/subPages/pages/reportProblems/index.vue

@@ -24,16 +24,23 @@ const rules = ref({
   contactPerson: [{ required: true, message: '请输入联系人' }],
   contactPhone: [{ required: true, message: '请输入联系人电话' }],
   questionContent: [{ required: true, message: '请输入内容' }],
-  addrName: [{ required: true, message: '请输入所在地' }],
+  addrName: [{ required: true, message: '请选择所在地' }],
 })
 
 /** 上报问题 */
+const personData = ref([])
 const addressList = ref([])
-const handleAddressFinish = async(value) => {
+const handleAddressFinish = async(value:any) => {
+  formData.value.chargerName = ''
+  formData.value.chargerCode = ''
   formData.value.addrName = value.selectedOptions[value.tabIndex].areaName
   addressList.value = value
   const { data } = await getPerson({parentCode:value.value})
-  console.log('data==',data)
+  personData.value = data
+  rangePerson.value = data.map((item:any) => ({
+    text: item.areaName,
+    value: item.areaName,
+  }))
 }
 const submit = async () => {
   console.log(`output->formData.value`,formData.value)
@@ -61,9 +68,11 @@ const submit = async () => {
     showNotify('请选择所在地')
     return
   }
-
+  formData.value.chargerCode = personData.value.find(
+    item => item.areaName === formData.value.chargerName
+  )?.areaCode || '' // 添加兜底处理
   console.log('formData.value',formData.value)
-  return
+  
   const { data } = await addQuestionReportData({
     ...formData.value,
     personList:formData.value.person1+','+formData.value.person2,
@@ -83,7 +92,7 @@ const submit = async () => {
     formData.value = {}
     data.districtCode = '330205'
     data.districtName = '江北区'
-    reportCY(data)
+    // reportCY(data)
   }
 
 }
@@ -175,17 +184,7 @@ onMounted(async () => {
   } else {
     range.value = []
   }
-//  负责人下拉
-   rangePerson.value = [{
-     text: '张三',
-     value: '张三',
-   }, {
-    text: '李四',
-     value: '李四',
-    }, {
-     text: '王五',
-     value: '王五',
-   }]
+
 
 })
 </script>
@@ -215,7 +214,7 @@ onMounted(async () => {
           </uni-forms-item>
           <!-- 问题所在地 -->
           <uni-forms-item label="所在地" required name="addrName">
-            <uni-easyinput v-model="formData.addrName" placeholder="请输入所在地" @focus="hanleSelectArea"></uni-easyinput>
+            <uni-easyinput v-model="formData.addrName" placeholder="请选择所在地" @focus="hanleSelectArea"></uni-easyinput>
             <GridAddress v-model="areaShow" @finish="handleAddressFinish"></GridAddress>
           </uni-forms-item>
           <!-- 负责人下拉 -->