Sfoglia il codice sorgente

Merge branch 'new-itsm-wx-handle' of http://git.dashitech.com/seimin/itsm-wx-handle into new-itsm-wx-handle

maotao 2 mesi fa
parent
commit
f8ce814a11

+ 9 - 2
pages/assign/assign.vue

@@ -602,6 +602,11 @@
602
 
602
 
603
   // 获取工作组列表
603
   // 获取工作组列表
604
   function getGroups(){
604
   function getGroups(){
605
+    if(!dutyList.value){
606
+      uni.hideLoading();
607
+      dataInfo.groupList = [];
608
+      return;
609
+    }
605
     uni.showLoading({
610
     uni.showLoading({
606
       title: "加载中",
611
       title: "加载中",
607
       mask: true,
612
       mask: true,
@@ -1453,8 +1458,10 @@
1453
 		};
1458
 		};
1454
 		getFetchDataList("simple/data", "incidentCategoryConfig", postData).then(res => {
1459
 		getFetchDataList("simple/data", "incidentCategoryConfig", postData).then(res => {
1455
 			let item = res.list.find(i=>i.categoryId == dataInfo.incidentData.category.id)
1460
 			let item = res.list.find(i=>i.categoryId == dataInfo.incidentData.category.id)
1456
-			dutyList.value = item.dutyDTO
1457
-			dataInfo.incidentData.duty = dutyList.value.id
1461
+      if(item){
1462
+        dutyList.value = item.dutyDTO;
1463
+        dataInfo.incidentData.duty = dutyList.value.id;
1464
+      }
1458
 			initForm()
1465
 			initForm()
1459
 			console.log(1111,dutyList.value)
1466
 			console.log(1111,dutyList.value)
1460
 		})
1467
 		})

+ 5 - 2
pages/buildIncident/buildIncident.vue

@@ -354,8 +354,10 @@
354
 			},
354
 			},
355
 		};
355
 		};
356
 		getFetchDataList("simple/data", "incidentCategoryConfig", postData).then(res => {
356
 		getFetchDataList("simple/data", "incidentCategoryConfig", postData).then(res => {
357
-			let item = res.list.find(i=>i.categoryId == incidentData.category.id) 
358
-			incidentData.priority = item.priority
357
+			let item = res.list.find(i=>i.categoryId == incidentData.category.id);
358
+      if(item){
359
+        incidentData.priority = item.priority
360
+      }
359
 		})
361
 		})
360
 	}
362
 	}
361
 	
363
 	
@@ -445,6 +447,7 @@
445
   onLoad((option) => {
447
   onLoad((option) => {
446
     handlerStore.clearHandlerData();
448
     handlerStore.clearHandlerData();
447
     if(option.type == 'inspection'){
449
     if(option.type == 'inspection'){
450
+      console.log(incidentBuildStore.incidentBuild.data, 'incidentBuildStore.incidentBuild.data');
448
       Object.assign(
451
       Object.assign(
449
         incidentData,
452
         incidentData,
450
         incidentBuildStore.incidentBuild.data,
453
         incidentBuildStore.incidentBuild.data,

+ 1 - 1
pages/inspection/inspectionExecute/inspectionExecute.vue

@@ -209,7 +209,7 @@
209
      place: res.inspectionNodeDTO.floorDTO,
209
      place: res.inspectionNodeDTO.floorDTO,
210
      houseNumber: res.inspectionNodeDTO.address,
210
      houseNumber: res.inspectionNodeDTO.address,
211
      source: defaultSourceValue.value,
211
      source: defaultSourceValue.value,
212
-     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
212
+     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex ? v.valuex : (v.formItemConfigList ? v.formItemConfigList.map(vv => vv.name).join(',') : '')}`).join(';'),
213
      requester: loginUserStore.loginUser.user,
213
      requester: loginUserStore.loginUser.user,
214
      branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
214
      branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
215
      contacts: loginUserStore.loginUser.user.name,
215
      contacts: loginUserStore.loginUser.user.name,

+ 1 - 1
pages/inspection/inspectionScanning/inspectionScanning.vue

@@ -134,7 +134,7 @@
134
      place: res.inspectionNodeDTO.floorDTO,
134
      place: res.inspectionNodeDTO.floorDTO,
135
      houseNumber: res.inspectionNodeDTO.address,
135
      houseNumber: res.inspectionNodeDTO.address,
136
      source: defaultSourceValue.value,
136
      source: defaultSourceValue.value,
137
-     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
137
+     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex ? v.valuex : (v.formItemConfigList ? v.formItemConfigList.map(vv => vv.name).join(',') : '')}`).join(';'),
138
      requester: loginUserStore.loginUser.user,
138
      requester: loginUserStore.loginUser.user,
139
      branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
139
      branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
140
      contacts: loginUserStore.loginUser.user.name,
140
      contacts: loginUserStore.loginUser.user.name,

+ 43 - 12
pages/inspection/inspectionValue/inspectionValue.vue

@@ -81,25 +81,27 @@
81
   import { useInspectionValueStore } from '@/stores/inspectionValue'
81
   import { useInspectionValueStore } from '@/stores/inspectionValue'
82
   import { forIn } from 'lodash-es';
82
   import { forIn } from 'lodash-es';
83
   import { useIncidentBuildStore } from '@/stores/incidentBuild'
83
   import { useIncidentBuildStore } from '@/stores/incidentBuild'
84
+  import { useUploadFile } from '@/share/useUploadFile.js'
84
 
85
 
85
   useSetTitle();
86
   useSetTitle();
86
   const loginUserStore = useLoginUserStore();
87
   const loginUserStore = useLoginUserStore();
87
   const { goBack }  = useGoBack();
88
   const { goBack }  = useGoBack();
88
   const inspectionValueStore = useInspectionValueStore();
89
   const inspectionValueStore = useInspectionValueStore();
89
   const incidentBuildStore = useIncidentBuildStore();
90
   const incidentBuildStore = useIncidentBuildStore();
91
+  const { uploadFile }  = useUploadFile();
90
 
92
 
91
   // 主题颜色
93
   // 主题颜色
92
   const primaryColor = ref(defaultColor)
94
   const primaryColor = ref(defaultColor)
93
 
95
 
94
   // 所有页码数据
96
   // 所有页码数据
95
   const formPageList = reactive([]);
97
   const formPageList = reactive([]);
96
-  
98
+
97
   // 故障来源列表
99
   // 故障来源列表
98
   const defaultSourceValue = ref();
100
   const defaultSourceValue = ref();
99
 
101
 
100
   // 表单
102
   // 表单
101
   const baseForm = ref()
103
   const baseForm = ref()
102
-  
104
+
103
   // 图片上传ref数组
105
   // 图片上传ref数组
104
   const itemRefs = ref({});
106
   const itemRefs = ref({});
105
 
107
 
@@ -137,7 +139,7 @@
137
   function changeForm(){
139
   function changeForm(){
138
     handleData(true);
140
     handleData(true);
139
   }
141
   }
140
-  
142
+
141
   // 跳转巡检列表
143
   // 跳转巡检列表
142
   function toInspectionExecute(){
144
   function toInspectionExecute(){
143
     inspectionValueStore.clearInspectionValueData();
145
     inspectionValueStore.clearInspectionValueData();
@@ -145,7 +147,7 @@
145
       url: `/pages/inspection/inspectionExecute/inspectionExecute`
147
       url: `/pages/inspection/inspectionExecute/inspectionExecute`
146
     })
148
     })
147
   }
149
   }
148
-  
150
+
149
   // 获取故障来源列表
151
   // 获取故障来源列表
150
   function getSources(){
152
   function getSources(){
151
     let postData = {
153
     let postData = {
@@ -160,20 +162,22 @@
160
       }
162
       }
161
     })
163
     })
162
   }
164
   }
163
-  
165
+
164
   // 跳转新建事件
166
   // 跳转新建事件
165
   function toBuildIncident(res){
167
   function toBuildIncident(res){
166
-    let imgList = Object.values(itemRefs.value);
168
+    let imgList = Object.values(itemRefs.value).filter(Boolean);
167
     let repairImgList = [];
169
     let repairImgList = [];
168
     if(imgList.length){
170
     if(imgList.length){
169
-      repairImgList = imgList[0].baseFormData.handlerImgList;
171
+      let firstOne = baseFormData.find(v => v.type == '7');
172
+      let index = imgList.findIndex(v => v.extra == firstOne.id);
173
+      repairImgList = index > -1 ? imgList[index].baseFormData.handlerImgList : [];
170
     }
174
     }
171
 
175
 
172
     let incidentData = {
176
     let incidentData = {
173
       place: res.inspectionNode.floorDTO,
177
       place: res.inspectionNode.floorDTO,
174
       houseNumber: res.inspectionNode.address,
178
       houseNumber: res.inspectionNode.address,
175
       source: defaultSourceValue.value,
179
       source: defaultSourceValue.value,
176
-      description: res.inspectionValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
180
+      description: res.inspectionValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex ? v.valuex : (v.formItemConfigList ? v.formItemConfigList.map(vv => vv.name).join(',') : '')}`).join(';'),
177
       requester: loginUserStore.loginUser.user,
181
       requester: loginUserStore.loginUser.user,
178
       branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
182
       branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
179
       contacts: loginUserStore.loginUser.user.name,
183
       contacts: loginUserStore.loginUser.user.name,
@@ -182,7 +186,7 @@
182
       department: res.inspectionForm.repairDeptDTO,
186
       department: res.inspectionForm.repairDeptDTO,
183
       priority: res.inspectionForm.priorityDTO,
187
       priority: res.inspectionForm.priorityDTO,
184
       repairImgList,
188
       repairImgList,
185
-      inspectionTaskId: res.id,
189
+      inspectionTaskId: inspectionExecuteId.value,
186
     }
190
     }
187
     console.log(repairImgList, 'repairImgList')
191
     console.log(repairImgList, 'repairImgList')
188
     console.log(incidentData, 'incidentData')
192
     console.log(incidentData, 'incidentData')
@@ -193,6 +197,11 @@
193
     })
197
     })
194
   }
198
   }
195
 
199
 
200
+  // 报修图片
201
+  function repairOrderImg(imgObj, incidentId){
202
+    return uploadFile(imgObj, 'wechatRequesterIncident', incidentId, incidentId)
203
+  }
204
+
196
   // 保存
205
   // 保存
197
   function submit(){
206
   function submit(){
198
     console.log(itemRefs.value);
207
     console.log(itemRefs.value);
@@ -209,7 +218,7 @@
209
         })
218
         })
210
       }
219
       }
211
     })
220
     })
212
-    
221
+
213
     nextTick(() => {
222
     nextTick(() => {
214
       baseForm.value.validate().then(res => {
223
       baseForm.value.validate().then(res => {
215
         console.log('success', res);
224
         console.log('success', res);
@@ -218,9 +227,19 @@
218
           mask: true,
227
           mask: true,
219
         });
228
         });
220
         console.log(formValues);
229
         console.log(formValues);
230
+
231
+        let imgList = Object.values(itemRefs.value).filter(Boolean);
232
+        let repairImgList = [];
233
+        if(imgList.length){
234
+          let firstOne = baseFormData.find(v => v.type == '7');
235
+          let index = imgList.findIndex(v => v.extra == firstOne.id);
236
+          repairImgList = index > -1 ? imgList[index].baseFormData.handlerImgList : [];
237
+        }
238
+
221
         let postData = {
239
         let postData = {
222
           account: loginUserStore.loginUser.user.account,
240
           account: loginUserStore.loginUser.user.account,
223
           valuesList: [],
241
           valuesList: [],
242
+          inspectionPhotos: repairImgList.length ? repairImgList : undefined,
224
         };
243
         };
225
         // baseFormData
244
         // baseFormData
226
         for(let key in formValues){
245
         for(let key in formValues){
@@ -270,6 +289,15 @@
270
                 		}
289
                 		}
271
                 	}
290
                 	}
272
                 });
291
                 });
292
+
293
+                // 上传图片到故障工单
294
+                let requestList = [];
295
+                repairImgList.map((imgObj) => {
296
+                  let repairOrderImg$ = repairOrderImg(imgObj, res.incidentId);
297
+                  requestList.push(repairOrderImg$);
298
+                })
299
+
300
+                Promise.all(requestList).then(resList => {})
273
               } else if(res.inspectionForm.showOrder == 1){
301
               } else if(res.inspectionForm.showOrder == 1){
274
                 // 是否显示生成维修单
302
                 // 是否显示生成维修单
275
                 uni.showModal({
303
                 uni.showModal({
@@ -387,15 +415,18 @@
387
 
415
 
388
     // 其他项
416
     // 其他项
389
     if(!isException){
417
     if(!isException){
418
+      console.log(firstPage, 'firstPage')
419
+      console.log(formValues, 'formValues')
420
+      console.log(isException, 'isException')
390
       firstPage.forEach(v => {
421
       firstPage.forEach(v => {
391
         // 下拉,单选
422
         // 下拉,单选
392
         if(v.type === '1' || v.type === '2'){
423
         if(v.type === '1' || v.type === '2'){
393
-          let obj = v.list.find(vv => formValues[v.key] === vv.value);
424
+          let obj = v.list.find(vv => v.value === vv.value);
394
           v.isException = obj ? obj.checkException === 1 : false;
425
           v.isException = obj ? obj.checkException === 1 : false;
395
         } else if(v.type === '3'){
426
         } else if(v.type === '3'){
396
           // 多选
427
           // 多选
397
           v.isException = v.list.some(vv => {
428
           v.isException = v.list.some(vv => {
398
-            if(formValues[v.key].includes(vv.value)){
429
+            if(v.value.includes(vv.value)){
399
               return vv.checkException === 1;
430
               return vv.checkException === 1;
400
             }else{
431
             }else{
401
               return false;
432
               return false;