6 Commits 431c76f63f ... db22b6bcd6

Author SHA1 Message Date
  maotao db22b6bcd6 Merge branch 'develop' of http://git.dashitech.com/seimin/itsm-wx-handle into new-itsm-wx-handle 2 months ago
  maotao 3adb6f0cbf 修改用户信息修复 2 months ago
  seimin 375e7b0eb5 巡检 2 months ago
  maotao 6362e2d734 Merge branch 'new-itsm-wx-handle' of http://git.dashitech.com/seimin/itsm-wx-handle into new-itsm-wx-handle 2 months ago
  maotao 1b1eb756eb 巡检点绑定开发 2 months ago
  seimin 66fe1fe48a 暂提 2 months ago

+ 1 - 0
App.vue

@@ -10,6 +10,7 @@
10 10
 		onHide: function() {
11 11
 			uni.setStorageSync('repairData','')
12 12
 			uni.setStorageSync('rapidRepNext','')
13
+			uni.removeStorageSync('pollingCode')
13 14
 			console.log('App Hide')
14 15
 		}
15 16
 	}

+ 7 - 0
http/api.js

@@ -245,6 +245,13 @@ export function api_inspectionNode(data){
245 245
 }
246 246
 
247 247
 /**
248
+ * 修改巡检点
249
+ */
250
+export function api_inspectionNodeEdit(data){
251
+  return post("/data/updData/inspectionNode", data);
252
+}
253
+
254
+/**
248 255
  * 获取巡检执行列表-数量
249 256
  */
250 257
 export function api_listCount(data){

+ 18 - 0
pages.json

@@ -299,6 +299,24 @@
299 299
 	     },
300 300
 	     "enablePullDownRefresh": true
301 301
 	   }
302
+	 },
303
+	 {
304
+	   "path": "pages/setPolling/setPolling",
305
+	   "style": {
306
+	     "h5": {
307
+	       "titleNView": false
308
+	     },
309
+	     "enablePullDownRefresh": true
310
+	   }
311
+	 },
312
+	 {
313
+	   "path": "pages/setPolling/selectPolling",
314
+	   "style": {
315
+	     "h5": {
316
+	       "titleNView": false
317
+	     },
318
+	     "enablePullDownRefresh": true
319
+	   }
302 320
 	 }
303 321
   ],
304 322
   "globalStyle": {

+ 23 - 6
pages/buildIncident/buildIncident.vue

@@ -267,7 +267,7 @@
267 267
   }
268 268
 
269 269
   // 获取故障来源列表
270
-  function getSources(){
270
+  function getSources(sourceValue){
271 271
     uni.showLoading({
272 272
       title: "加载中",
273 273
       mask: true,
@@ -284,9 +284,13 @@
284 284
         value: v.id,
285 285
         key: v.value,
286 286
       }));
287
-      let discover = dataInfo.sourceList.find(v => v.key === 'leader');
288
-      if(discover){
289
-        incidentData.source = discover.value;
287
+      if(sourceValue){
288
+        incidentData.source = sourceValue;
289
+      }else{
290
+        let discover = dataInfo.sourceList.find(v => v.key === 'leader');
291
+        if(discover){
292
+          incidentData.source = discover.value;
293
+        }
290 294
       }
291 295
     })
292 296
   }
@@ -440,7 +444,20 @@
440 444
 
441 445
   onLoad((option) => {
442 446
     handlerStore.clearHandlerData();
443
-    if(incidentBuildStore.incidentBuild.data){
447
+    if(option.type == 'inspection'){
448
+      Object.assign(
449
+        incidentData,
450
+        incidentBuildStore.incidentBuild.data,
451
+        {
452
+          priority: incidentBuildStore.incidentBuild.data.priority ? incidentBuildStore.incidentBuild.data.priority.id : (incidentBuildStore.incidentBuild.data.category ? (incidentBuildStore.incidentBuild.data.category.priority ? incidentBuildStore.incidentBuild.data.category.priority.id : undefined) : undefined),
453
+          description: incidentBuildStore.incidentBuild.data.description || (incidentBuildStore.incidentBuild.data.category ? incidentBuildStore.incidentBuild.data.category.mutiCategory : undefined),
454
+        },
455
+      );
456
+    	if(incidentData.category && incidentData.category.id && !incidentBuildStore.incidentBuild.data.priority){
457
+    		getPriorityData()
458
+    	}
459
+      getSources(incidentBuildStore.incidentBuild.data.source);
460
+    }else if(incidentBuildStore.incidentBuild.data){
444 461
       Object.assign(
445 462
         incidentData,
446 463
         incidentBuildStore.incidentBuild.data,
@@ -460,9 +477,9 @@
460 477
 			if(incidentData.category && incidentData.category.id){
461 478
 				getPriorityData()
462 479
 			}
480
+      getSources();
463 481
     }
464 482
     getBranchs();
465
-    getSources();
466 483
     getPrioritys();
467 484
   })
468 485
 </script>

+ 75 - 2
pages/inspection/inspectionExecute/inspectionExecute.vue

@@ -11,7 +11,7 @@
11 11
     <view class="body" v-if="dataInfo.list.length">
12 12
       <view class="body_item" v-for="data in dataInfo.list" :key="data.id">
13 13
         <view class="body_item_head ellipsis-multiline">
14
-          {{ data.inspectionDTO?.inspectionFormDTO?.name }}-{{ data.inspectionNodeDTO?.name }}-{{ data.batchNo }}
14
+          <text class="sign" v-if="data.status.value == 2" :class="{signRed: data.exception == 1}">{{data.exception == 1 ? '异常' : '正常'}}</text>{{ data.inspectionDTO?.inspectionFormDTO?.name }}-{{ data.inspectionNodeDTO?.name }}-{{ data.batchNo }}
15 15
         </view>
16 16
 
17 17
         <view class="body_item_content">
@@ -33,6 +33,7 @@
33 33
         <view class="body_item_foot">
34 34
           <view class="btns pt0">
35 35
             <button v-if="data.status.value === '1'" @click.stop="toInspectionValue(data)" type="default" class="primaryButton btn">执行</button>
36
+            <button v-if="data.status.value === '2' && data.exception == 1 && !data.incidentId && data.inspectionDTO.inspectionFormDTO.showOrder == 1" @click.stop="toBuildIncident(data)" type="default" class="primaryButton btn">生成维修单</button>
36 37
           </view>
37 38
         </view>
38 39
       </view>
@@ -54,7 +55,7 @@
54 55
   import { ref, reactive, computed } from 'vue'
55 56
   import { onLoad, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
56 57
   import { SM } from "@/http/http.js"
57
-  import { api_getDictionary, api_inspectionTask, api_listCount, api_scanCode, api_scanNodeCode } from "@/http/api.js"
58
+  import { api_getDictionary, api_inspectionTask, api_listCount, api_scanCode, api_scanNodeCode, api_listAttachment } from "@/http/api.js"
58 59
   import { filterFormatDate } from '@/filters/filterFormatDate.js'
59 60
   import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
60 61
   import { computedStateStyle } from '@/filters/computedStateStyle.js'
@@ -67,6 +68,7 @@
67 68
   import { useInspectionListSearchStore } from '@/stores/inspectionListSearch'
68 69
   import { useInspectionValueStore } from '@/stores/inspectionValue'
69 70
   import { useSetTabbar } from '@/share/useSetTabbar.js'
71
+  import { useIncidentBuildStore } from '@/stores/incidentBuild'
70 72
 
71 73
   useSetTitle();
72 74
   const loginUserStore = useLoginUserStore();
@@ -79,6 +81,7 @@
79 81
   const { currentLogOverTime }  = computedCurrentLogOverTime();
80 82
   const { makePhoneCall }  = useMakePhoneCall();
81 83
   const { setTabbar }  = useSetTabbar();
84
+  const incidentBuildStore = useIncidentBuildStore();
82 85
 
83 86
   // 主题颜色
84 87
   const primaryColor = ref(defaultColor)
@@ -90,6 +93,9 @@
90 93
   const computedSynergetic = computed(() => (synergetic) => {
91 94
     return (synergetic && synergetic.length) ? synergetic.map(v => v.name).join(',') : ''
92 95
   })
96
+  
97
+  // 故障来源列表
98
+  const defaultSourceValue = ref();
93 99
 
94 100
   // 数据
95 101
   const dataInfo = reactive({
@@ -162,6 +168,64 @@
162 168
       uni.hideLoading();
163 169
     });
164 170
   }
171
+  
172
+  // 获取故障来源列表
173
+  function getSources(){
174
+    let postData = {
175
+      "key": 'incident_source',
176
+      "type": "list",
177
+    };
178
+    api_getDictionary(postData).then(res => {
179
+      res = res || [];
180
+      let discover = res.find(v => v.value === 'inspection');
181
+      if(discover){
182
+        defaultSourceValue.value = discover.id;
183
+      }
184
+    })
185
+  }
186
+  
187
+  // 新建事件
188
+  async function toBuildIncident(res){
189
+  	incidentBuildStore.clearIncidentBuildData();
190
+   let imgObj = res.inspectionFormValuesList.find(v => v.inspectionFormItemDTO.type.value == 7);
191
+   let repairImgList = [];
192
+   if(imgObj){
193
+     let result = await api_listAttachment('inspection', res.id);
194
+     result.data = result.data || [];
195
+     result.data = result.data.filter(v => v.recordId == imgObj.itemId);
196
+     result.data = result.data.map(v => ({
197
+       url: location.origin + "/file" + v.relativeFilePath,
198
+       path: location.origin + "/file" + v.relativeFilePath,
199
+       size: v.size,
200
+       name: v.name,
201
+       extname: v.suffix,
202
+     }))
203
+     repairImgList = result.data;
204
+   }
205
+   
206
+   console.log(repairImgList, 'repairImgList')
207
+   
208
+   let incidentData = {
209
+     place: res.inspectionNodeDTO.floorDTO,
210
+     houseNumber: res.inspectionNodeDTO.address,
211
+     source: defaultSourceValue.value,
212
+     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
213
+     requester: loginUserStore.loginUser.user,
214
+     branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
215
+     contacts: loginUserStore.loginUser.user.name,
216
+     contactsInformation: loginUserStore.loginUser.user.phone,
217
+     category: res.inspectionDTO.inspectionFormDTO.categoryDTO,
218
+     department: res.inspectionDTO.inspectionFormDTO.repairDeptDTO,
219
+     priority: res.inspectionDTO.inspectionFormDTO.priorityDTO,
220
+     repairImgList,
221
+     inspectionTaskId: res.id,
222
+   }
223
+   console.log(incidentData, 'incidentData')
224
+   incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
225
+   uni.navigateTo({
226
+     url: `/pages/buildIncident/buildIncident?type=inspection`
227
+   })
228
+  }
165 229
 
166 230
   // 巡检项
167 231
   function toInspectionValue(data){
@@ -334,6 +398,7 @@
334 398
   }
335 399
 
336 400
   onLoad((option) => {
401
+    getSources();
337 402
     for(let i = 0; i<7; i++){
338 403
     	setTabbar(i)
339 404
     }
@@ -431,6 +496,14 @@ page{
431 496
         text-align: left;
432 497
         margin: 24rpx;
433 498
         font-size: 30rpx;
499
+        .sign{
500
+          margin-right: 16rpx;
501
+          font-weight: bold;
502
+          color: #49B856;
503
+          &.signRed{
504
+            color: #FF0000;
505
+          }
506
+        }
434 507
       }
435 508
       .body_item_content{
436 509
         border-top: 1rpx solid #D8D8D8;

+ 67 - 2
pages/inspection/inspectionScanning/inspectionScanning.vue

@@ -9,7 +9,7 @@
9 9
     <view class="body" v-if="dataInfo.list.length">
10 10
       <view class="body_item" v-for="data in dataInfo.list" :key="data.id">
11 11
         <view class="body_item_head ellipsis-multiline">
12
-          <text class="sign" v-if="dataInfo.tabActiveId == 1" :class="{signRed: data.exception == 1}">{{data.exception == 1 ? '异常' : '正常'}}</text>{{ data.inspectionDTO?.inspectionFormDTO?.name }}-{{ data.inspectionNodeDTO?.name }}-{{ data.batchNo }}
12
+          <text class="sign" v-if="data.status.value == 2" :class="{signRed: data.exception == 1}">{{data.exception == 1 ? '异常' : '正常'}}</text>{{ data.inspectionDTO?.inspectionFormDTO?.name }}-{{ data.inspectionNodeDTO?.name }}-{{ data.batchNo }}
13 13
         </view>
14 14
 
15 15
         <view class="body_item_content">
@@ -31,6 +31,7 @@
31 31
         <view class="body_item_foot">
32 32
           <view class="btns pt0">
33 33
             <button v-if="data.status.value === '1' && dataInfo.tabActiveId === 0" @click.stop="toInspectionValue(data)" type="default" class="primaryButton btn">执行</button>
34
+            <button v-if="data.status.value === '2' && data.exception == 1 && !data.incidentId && data.inspectionDTO.inspectionFormDTO.showOrder == 1" @click.stop="toBuildIncident(data)" type="default" class="primaryButton btn">生成维修单</button>
34 35
           </view>
35 36
         </view>
36 37
       </view>
@@ -46,7 +47,7 @@
46 47
   import { ref, reactive, computed } from 'vue'
47 48
   import { onLoad, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
48 49
   import { SM } from "@/http/http.js"
49
-  import { api_getDictionary, api_inspectionTask, api_listCount, api_scanCode, api_inspectionNode } from "@/http/api.js"
50
+  import { api_getDictionary, api_inspectionTask, api_listCount, api_scanCode, api_inspectionNode, api_listAttachment } from "@/http/api.js"
50 51
   import { filterFormatDate } from '@/filters/filterFormatDate.js'
51 52
   import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
52 53
   import { computedStateStyle } from '@/filters/computedStateStyle.js'
@@ -59,6 +60,7 @@
59 60
   import { useInspectionListSearchStore } from '@/stores/inspectionListSearch'
60 61
   import { useInspectionValueStore } from '@/stores/inspectionValue'
61 62
   import { useSetTabbar } from '@/share/useSetTabbar.js'
63
+  import { useIncidentBuildStore } from '@/stores/incidentBuild'
62 64
 
63 65
   useSetTitle();
64 66
   const loginUserStore = useLoginUserStore();
@@ -71,10 +73,14 @@
71 73
   const { currentLogOverTime }  = computedCurrentLogOverTime();
72 74
   const { makePhoneCall }  = useMakePhoneCall();
73 75
   const { setTabbar }  = useSetTabbar();
76
+  const incidentBuildStore = useIncidentBuildStore();
74 77
 
75 78
   // 主题颜色
76 79
   const primaryColor = ref(defaultColor)
77 80
   
81
+  // 故障来源列表
82
+  const defaultSourceValue = ref();
83
+  
78 84
   // 数据
79 85
   const dataInfo = reactive({
80 86
     tabs: [{id: 0, name: '巡检工单', value: 'todo', num: ''}, {id: 1, name: '历史工单', value: '', num: ''}],
@@ -88,6 +94,64 @@
88 94
     inspectionNodeName: '',
89 95
   })
90 96
   
97
+  // 获取故障来源列表
98
+  function getSources(){
99
+    let postData = {
100
+      "key": 'incident_source',
101
+      "type": "list",
102
+    };
103
+    api_getDictionary(postData).then(res => {
104
+      res = res || [];
105
+      let discover = res.find(v => v.value === 'inspection');
106
+      if(discover){
107
+        defaultSourceValue.value = discover.id;
108
+      }
109
+    })
110
+  }
111
+  
112
+  // 新建事件
113
+  async function toBuildIncident(res){
114
+  	incidentBuildStore.clearIncidentBuildData();
115
+   let imgObj = res.inspectionFormValuesList.find(v => v.inspectionFormItemDTO.type.value == 7);
116
+   let repairImgList = [];
117
+   if(imgObj){
118
+     let result = await api_listAttachment('inspection', res.id);
119
+     result.data = result.data || [];
120
+     result.data = result.data.filter(v => v.recordId == imgObj.itemId);
121
+     result.data = result.data.map(v => ({
122
+       url: location.origin + "/file" + v.relativeFilePath,
123
+       path: location.origin + "/file" + v.relativeFilePath,
124
+       size: v.size,
125
+       name: v.name,
126
+       extname: v.suffix,
127
+     }))
128
+     repairImgList = result.data;
129
+   }
130
+   
131
+   console.log(repairImgList, 'repairImgList')
132
+   
133
+   let incidentData = {
134
+     place: res.inspectionNodeDTO.floorDTO,
135
+     houseNumber: res.inspectionNodeDTO.address,
136
+     source: defaultSourceValue.value,
137
+     description: res.inspectionFormValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
138
+     requester: loginUserStore.loginUser.user,
139
+     branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
140
+     contacts: loginUserStore.loginUser.user.name,
141
+     contactsInformation: loginUserStore.loginUser.user.phone,
142
+     category: res.inspectionDTO.inspectionFormDTO.categoryDTO,
143
+     department: res.inspectionDTO.inspectionFormDTO.repairDeptDTO,
144
+     priority: res.inspectionDTO.inspectionFormDTO.priorityDTO,
145
+     repairImgList,
146
+     inspectionTaskId: res.id,
147
+   }
148
+   console.log(incidentData, 'incidentData')
149
+   incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
150
+   uni.navigateTo({
151
+     url: `/pages/buildIncident/buildIncident?type=inspection`
152
+   })
153
+  }
154
+  
91 155
   // 巡检项
92 156
   function toInspectionValue(data){
93 157
     uni.showLoading({
@@ -206,6 +270,7 @@
206 270
   }
207 271
   
208 272
   onLoad((option) => {
273
+    getSources();
209 274
     dataInfo.inspectionNodeCode = option.inspectionNodeCode;
210 275
     dataInfo.inspectionNodeNewCode = option.inspectionNodeNewCode;
211 276
     dataInfo.inspectionNodeName = option.inspectionNodeName;

+ 134 - 5
pages/inspection/inspectionValue/inspectionValue.vue

@@ -72,7 +72,7 @@
72 72
   import DsFilePicker from '@/components/DsFilePicker.vue';
73 73
   import { ref, reactive, nextTick } from 'vue'
74 74
   import { onLoad } from '@dcloudio/uni-app'
75
-  import { api_addModel } from "@/http/api.js"
75
+  import { api_addModel, api_getDictionary } from "@/http/api.js"
76 76
   import { defaultColor } from '@/static/js/theme.js'
77 77
   import { useSetTitle } from '@/share/useSetTitle.js'
78 78
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
@@ -80,17 +80,22 @@
80 80
   import { useLoginUserStore } from '@/stores/loginUser'
81 81
   import { useInspectionValueStore } from '@/stores/inspectionValue'
82 82
   import { forIn } from 'lodash-es';
83
+  import { useIncidentBuildStore } from '@/stores/incidentBuild'
83 84
 
84 85
   useSetTitle();
85 86
   const loginUserStore = useLoginUserStore();
86 87
   const { goBack }  = useGoBack();
87 88
   const inspectionValueStore = useInspectionValueStore();
89
+  const incidentBuildStore = useIncidentBuildStore();
88 90
 
89 91
   // 主题颜色
90 92
   const primaryColor = ref(defaultColor)
91 93
 
92 94
   // 所有页码数据
93 95
   const formPageList = reactive([]);
96
+  
97
+  // 故障来源列表
98
+  const defaultSourceValue = ref();
94 99
 
95 100
   // 表单
96 101
   const baseForm = ref()
@@ -132,6 +137,61 @@
132 137
   function changeForm(){
133 138
     handleData(true);
134 139
   }
140
+  
141
+  // 跳转巡检列表
142
+  function toInspectionExecute(){
143
+    inspectionValueStore.clearInspectionValueData();
144
+    uni.reLaunch({
145
+      url: `/pages/inspection/inspectionExecute/inspectionExecute`
146
+    })
147
+  }
148
+  
149
+  // 获取故障来源列表
150
+  function getSources(){
151
+    let postData = {
152
+      "key": 'incident_source',
153
+      "type": "list",
154
+    };
155
+    api_getDictionary(postData).then(res => {
156
+      res = res || [];
157
+      let discover = res.find(v => v.value === 'inspection');
158
+      if(discover){
159
+        defaultSourceValue.value = discover.id;
160
+      }
161
+    })
162
+  }
163
+  
164
+  // 跳转新建事件
165
+  function toBuildIncident(res){
166
+    let imgList = Object.values(itemRefs.value);
167
+    let repairImgList = [];
168
+    if(imgList.length){
169
+      repairImgList = imgList[0].baseFormData.handlerImgList;
170
+    }
171
+
172
+    let incidentData = {
173
+      place: res.inspectionNode.floorDTO,
174
+      houseNumber: res.inspectionNode.address,
175
+      source: defaultSourceValue.value,
176
+      description: res.inspectionValuesList.filter(v => v.exception == 1).map(v => `${v.name}填写值为${v.valuex}`).join(';'),
177
+      requester: loginUserStore.loginUser.user,
178
+      branch: loginUserStore.loginUser.user.currentHospital.parent ? loginUserStore.loginUser.user.currentHospital.parent.id : loginUserStore.loginUser.user.currentHospital.id,
179
+      contacts: loginUserStore.loginUser.user.name,
180
+      contactsInformation: loginUserStore.loginUser.user.phone,
181
+      category: res.inspectionForm.categoryDTO,
182
+      department: res.inspectionForm.repairDeptDTO,
183
+      priority: res.inspectionForm.priorityDTO,
184
+      repairImgList,
185
+      inspectionTaskId: res.id,
186
+    }
187
+    console.log(repairImgList, 'repairImgList')
188
+    console.log(incidentData, 'incidentData')
189
+    incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
190
+    inspectionValueStore.clearInspectionValueData();
191
+    uni.navigateTo({
192
+      url: `/pages/buildIncident/buildIncident?type=inspection`
193
+    })
194
+  }
135 195
 
136 196
   // 保存
137 197
   function submit(){
@@ -194,10 +254,75 @@
194 254
             Object.values(itemRefs.value).forEach(v => {
195 255
               v && v.uploadFn();
196 256
             })
197
-            inspectionValueStore.clearInspectionValueData();
198
-            uni.reLaunch({
199
-              url: `/pages/inspection/inspectionExecute/inspectionExecute`
200
-            })
257
+
258
+            if(res.exception){
259
+              // 异常
260
+              if(res.inspectionForm.createOrder == 1){
261
+                // 是否自动生成维修单
262
+                uni.showModal({
263
+                	title: '提示',
264
+                	content: `巡检提交成功,您巡检有产生异常;系统自动生成工单:${res.incidentSign}`,
265
+                  showCancel: false,
266
+                  confirmText: '返回巡检列表',
267
+                	success: (res) => {
268
+                		if (res.confirm) {
269
+                      toInspectionExecute();
270
+                		}
271
+                	}
272
+                });
273
+              } else if(res.inspectionForm.showOrder == 1){
274
+                // 是否显示生成维修单
275
+                uni.showModal({
276
+                	title: '提示',
277
+                	content: '巡检提交成功,您巡检有产生异常,是否生成维修单',
278
+                  confirmText: '生成维修单',
279
+                  cancelText: '返回巡检列表',
280
+                	success: (result) => {
281
+                		if (result.confirm) {
282
+                			toBuildIncident(res);
283
+                		} else if (result.cancel) {
284
+                			toInspectionExecute();
285
+                		}
286
+                	}
287
+                });
288
+              } else {
289
+                uni.showToast({
290
+                  icon: 'none',
291
+                  title: "巡检提交成功,有异常",
292
+                  duration: 2000,
293
+                  mask: true,
294
+                })
295
+                setTimeout(() => {
296
+                  toInspectionExecute();
297
+                }, 2000)
298
+              }
299
+            }else{
300
+              // 无异常
301
+              uni.showToast({
302
+                icon: 'none',
303
+                title: "巡检提交成功,无异常",
304
+                duration: 2000,
305
+                mask: true,
306
+              })
307
+              setTimeout(() => {
308
+                toInspectionExecute();
309
+              }, 2000)
310
+            }
311
+          } else if(res.status == 555){
312
+            // 自动生成维修单失败
313
+            uni.showModal({
314
+            	title: '提示',
315
+            	content: '巡检提交成功,您巡检有产生异常;系统自动生成工单失败,请手动建单',
316
+              confirmText: '生成维修单',
317
+              cancelText: '返回巡检列表',
318
+            	success: (result) => {
319
+            		if (result.confirm) {
320
+            			toBuildIncident(res);
321
+            		} else if (result.cancel) {
322
+            			toInspectionExecute();
323
+            		}
324
+            	}
325
+            });
201 326
           } else {
202 327
             uni.showToast({
203 328
               icon: 'none',
@@ -334,6 +459,7 @@
334 459
   }
335 460
 
336 461
   onLoad((option) => {
462
+    getSources();
337 463
     inspectionExecuteId.value = +option.inspectionExecuteId;
338 464
     // 巡检项
339 465
     if(inspectionValueStore.inspectionValue.data){
@@ -352,6 +478,9 @@
352 478
     margin-top: 8rpx;
353 479
   }
354 480
 }
481
+::v-deep .uni-modal__btn_primary{
482
+  color: $uni-primary!important;
483
+}
355 484
 .inspectionValue{
356 485
   height: 100%;
357 486
   display: flex;

+ 20 - 0
pages/my/my.vue

@@ -45,6 +45,9 @@
45 45
         </view>
46 46
       </view>
47 47
     </scroll-view>
48
+		<view class="new-btn">
49
+			<button @click="addPolling" v-if="bindingPolling" type="default" class="primaryButton"><text class="icon-style newicon newicon-bangding"></text>巡检点绑定</button>
50
+		</view>
48 51
     <view class="foot_common_btns">
49 52
 			<button @click="myRepair" type="default" class="primaryButton btn"><text class="icon-style newicon newicon-ziyuan-baoxiu1"></text>我的报修</button>
50 53
       <button @click="toBuildIncident" type="default" class="primaryButton btn"><text class="newicon newicon-xinjian2"></text>新建事件</button>
@@ -76,6 +79,9 @@
76 79
   // 主题颜色
77 80
   const primaryColor = ref(defaultColor)
78 81
   
82
+	// 巡检点绑定权限
83
+	const bindingPolling = ref(false)
84
+	
79 85
   // 数据
80 86
   const dataInfo = reactive({
81 87
     todo: 0,
@@ -132,6 +138,13 @@
132 138
     })
133 139
   }
134 140
   
141
+	// 巡检点绑定
142
+	function addPolling(){
143
+		uni.navigateTo({
144
+		  url: `/pages/setPolling/setPolling`
145
+		})
146
+	}
147
+	
135 148
 	// 知识库
136 149
 	function myRepair(){
137 150
 		// repositorySearchStore.clearRepositoryListSearchData()
@@ -165,6 +178,10 @@
165 178
   }
166 179
   
167 180
   onLoad((option) => {
181
+		let menu = loginUserStore.loginUser.menu.find(v => v.link === 'wxPperation')
182
+		if(menu && menu.childrens && menu.childrens.length>0){
183
+			bindingPolling.value = menu.childrens.some(v => v.link === 'bindingPolling')
184
+		}
168 185
     for(let i = 0; i<7; i++){
169 186
     	setTabbar(i)
170 187
     }
@@ -257,5 +274,8 @@ page{
257 274
 		position: relative;
258 275
 		left: -6rpx;
259 276
 	}
277
+	.new-btn{
278
+		padding: 0 24rpx;
279
+	}
260 280
 }
261 281
 </style>

+ 2 - 1
pages/myRepair/myRepair.vue

@@ -684,7 +684,8 @@
684 684
 				id:dataForm.dept
685 685
 			},
686 686
 			commonDept:commonDeptData.value,
687
-			commonDeptDTO:arr
687
+			commonDeptDTO:arr,
688
+			upType: "changeDept"
688 689
 		}
689 690
 		api_userSave({
690 691
 		  user: postData,

+ 2 - 1
pages/repair/config.vue

@@ -157,7 +157,8 @@
157 157
 				id:dataForm.dept
158 158
 			},
159 159
 			commonDept:commonDeptData.value,
160
-			commonDeptDTO:arr
160
+			commonDeptDTO:arr,
161
+			upType: "changeDept"
161 162
 		}
162 163
 		api_userSave({
163 164
 		  user: postData,

+ 172 - 0
pages/setPolling/selectPolling.vue

@@ -0,0 +1,172 @@
1
+<template>
2
+  <view class="consumableList">
3
+    <view class="head">
4
+      <uni-search-bar v-model="dataInfo.keyWord" :placeholder="placeHolder" bgColor="#F8F8F8" @input="search" cancelButton="none" focus :radius="18" />
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" :class="dataInfo.index == index ? 'activeClass' :''" v-for="(data, index) in dataInfo.list" :key="data.id" @click="clickItem(data,index)">
8
+        {{data.name}}
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBackPage" type="default" class="primaryButton btn">确定</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { debounce } from 'lodash-es'
22
+  import { ref, reactive} from 'vue'
23
+  import { onLoad } from '@dcloudio/uni-app'
24
+  import { api_inspectionNode } from "@/http/api.js"
25
+  import { defaultColor } from '@/static/js/theme.js'
26
+  import { useSetTitle } from '@/share/useSetTitle.js'
27
+  import { useLoginUserStore } from '@/stores/loginUser'
28
+  import { useIncidentBuildStore } from '@/stores/incidentBuild'
29
+  import { useGoBack } from '@/share/useGoBack.js'
30
+  
31
+  useSetTitle();
32
+  const loginUserStore = useLoginUserStore();
33
+  const incidentBuildStore = useIncidentBuildStore();
34
+  const { goBack }  = useGoBack();
35
+  
36
+  // 主题颜色
37
+  const primaryColor = ref(defaultColor)
38
+  
39
+  const placeHolder = ref('请搜索巡检点');
40
+  
41
+	const entranceType = ref(null);
42
+	
43
+	// 院区id
44
+	const branchId = ref(null);
45
+	
46
+  // 数据
47
+  const dataInfo = reactive({
48
+    list: [],//工单列表
49
+    idx: 0,//页码
50
+    hasMore: true,//是否有更多数据
51
+    incidentData: {},//事件对象
52
+    keyWord: '',//搜索的关键词
53
+		item:null,
54
+		index:null
55
+  })
56
+  
57
+  // 搜索
58
+  const search = debounce(getList.bind(null, 0), 500);
59
+
60
+  // 获取列表信息
61
+  function getList(idx){
62
+    if(dataInfo.keyWord.trim() === ''){
63
+      dataInfo.list = [];
64
+      return;
65
+    }
66
+    
67
+    uni.showLoading({
68
+      title: "加载中",
69
+      mask: true,
70
+    });
71
+
72
+    let postData = {
73
+      idx: dataInfo.idx,
74
+      sum: 9999,
75
+      inspectionNode: {
76
+				hosId: loginUserStore.loginUser.user.currentHospital.id,
77
+				name: dataInfo.keyWord
78
+      }
79
+    }
80
+    api_inspectionNode(postData).then(res => {
81
+      uni.hideLoading();
82
+      if(res.status == 200){
83
+        let list = res.list || [];
84
+        if(list.length){
85
+          dataInfo.hasMore = true;
86
+          dataInfo.list = list;
87
+        }else{
88
+          dataInfo.hasMore = false;
89
+        }
90
+      }else{
91
+        uni.showToast({
92
+          icon: 'none',
93
+          title: res.msg || '请求数据失败!'
94
+        });
95
+      }
96
+    })
97
+  }
98
+  
99
+	function goBackPage(){
100
+		if(!dataInfo.item){
101
+			uni.showToast({
102
+			  icon: 'none',
103
+			  title: '请选择巡检点!'
104
+			});
105
+			return
106
+		}
107
+		let data = JSON.stringify(dataInfo.item)
108
+		uni.navigateTo({
109
+		  url: '/pages/setPolling/setPolling?data=' + data
110
+		})
111
+	}
112
+	
113
+  // 点击
114
+  function clickItem(data,index){
115
+		dataInfo.index = index
116
+		dataInfo.item = data;
117
+		console.log(444,dataInfo.item)
118
+  }
119
+  
120
+  onLoad((option) => {
121
+    getList(0);
122
+  })
123
+</script>
124
+
125
+<style lang="scss" scoped>
126
+.consumableList{
127
+  display: flex;
128
+  flex-direction: column;
129
+  justify-content: space-between;
130
+  .head{
131
+    height: 88rpx;
132
+    display: flex;
133
+    align-items: center;
134
+    justify-content: center;
135
+    padding: 0 24rpx;
136
+    position: fixed;
137
+    z-index: 99;
138
+    width: 100%;
139
+    box-sizing: border-box;
140
+    background: linear-gradient( 90deg, #58CF66 0%, #DDE9FC 100%);
141
+  }
142
+  .body{
143
+    margin-bottom: 140rpx;
144
+    margin-top: 88rpx;
145
+    font-size: 26rpx;
146
+    .body_item{
147
+      border-bottom: 1rpx solid #DEDEDE;
148
+      padding: 24rpx;
149
+    }
150
+		.activeClass{
151
+			color: #49b856;
152
+		}
153
+  }
154
+  .zanwu{
155
+    margin-bottom: 140rpx;
156
+    margin-top: 88rpx;
157
+    display: flex;
158
+    justify-content: center;
159
+    .newicon-zanwu{
160
+      font-size: 256rpx;
161
+      color: #D6D6D6;
162
+      margin-top: 140rpx;
163
+    }
164
+  }
165
+  .foot_common_btns{
166
+    position: fixed;
167
+    left: 0;
168
+    bottom: 0;
169
+    background-color: #fff;
170
+  }
171
+}
172
+</style>

+ 270 - 0
pages/setPolling/setPolling.vue

@@ -0,0 +1,270 @@
1
+<template>
2
+	<view class="handler">
3
+		<view class="body">
4
+			<view class="scan-box">
5
+				<view class="scan">
6
+					<text class="newicon newicon-saoma icon" @click="scanCodes"></text>
7
+				</view>
8
+			</view>
9
+			<view class="container">
10
+				<view class="weight-class">可以通过扫一扫功能设置“巡检点”,扫描二维码后设置或选择巡检点。</view>
11
+				<view class="weight-tip">查询巡检点结果:{{dataInfo.pollingData}}</view>
12
+				<view class="weight-tip" v-if="dataInfo.newPollingData">选择巡检点为:<text class="red">{{dataInfo.newPollingData.name}}</text></view>
13
+			</view>
14
+		</view>
15
+		<view class="foot_common_btns">
16
+			<button v-if="dataInfo.type" @click="replace" type="default" class="primaryButton btn">选择巡检点</button>
17
+			<button v-if="dataInfo.newPollingData" @click="save" type="default" class="primaryButton btn">保存</button>
18
+		</view>
19
+		<uni-popup ref="alertDialog" type="dialog" :mask-click="false">
20
+			<view class="popup-content">
21
+				<view class="tip">提示</view>
22
+				<view class="content">{{dataInfo.content}}</view>
23
+			</view>
24
+			<view class="btn-box">
25
+				<view @click="close" class="btn-item-50 color-close">取消</view>
26
+				<view @click="dialogConfirm" class="btn-item-50 color">确认</view>
27
+			</view>
28
+		</uni-popup>
29
+	</view>
30
+</template>
31
+
32
+<script setup>
33
+	import { SM } from "@/http/http.js"
34
+  import { ref, reactive, computed } from 'vue'
35
+  import { onLoad, onUnload } from '@dcloudio/uni-app'
36
+  import { api_inspectionNode, api_inspectionNodeEdit } from "@/http/api.js"
37
+  import { defaultColor } from '@/static/js/theme.js'
38
+  import { useSetTitle } from '@/share/useSetTitle.js'
39
+  import { useGoBack } from '@/share/useGoBack.js'
40
+  import { useLoginUserStore } from '@/stores/loginUser'
41
+	import { post } from "@/http/http.js"
42
+	import { join } from "lodash-es"
43
+  useSetTitle();
44
+  const loginUserStore = useLoginUserStore();
45
+  const { goBack }  = useGoBack();
46
+	
47
+  // 主题颜色
48
+  const primaryColor = ref(defaultColor)
49
+	
50
+	const alertDialog = ref(null)
51
+	
52
+  // 数据
53
+  const dataInfo = reactive({
54
+		pollingData:'无',
55
+		pollingId:null,
56
+		newPollingData:null,
57
+		content:'',
58
+		type:false,
59
+		bindingPolling:false
60
+  })
61
+	
62
+	// 清空数据
63
+	function setInfoData(){
64
+		dataInfo.pollingData = '无'
65
+		dataInfo.pollingId = null
66
+		dataInfo.newPollingData = null
67
+		dataInfo.content = ''
68
+		dataInfo.type = false
69
+		dataInfo.bindingPolling = false
70
+		uni.removeStorageSync('pollingCode')
71
+	}
72
+	
73
+	// 选择巡检点
74
+	function replace(){
75
+		// let data = {
76
+		// 	code: 'inspection|$|703f3569-b80e-48df-aafd-5fcef36c96f0',
77
+		// 	pollingData: '1东',
78
+		// 	pollingId: 1,
79
+		// }
80
+		// uni.setStorageSync('pollingCode',JSON.stringify(data))
81
+		uni.navigateTo({
82
+		  url: `/pages/setPolling/selectPolling`
83
+		})
84
+	}
85
+	
86
+	// 保存
87
+	function save(){
88
+		setTimeout(_=>{
89
+			alertDialog.value.open()
90
+		},100)
91
+	}
92
+	
93
+	// 提交
94
+	function dialogConfirm(){
95
+		let data = JSON.parse(uni.getStorageSync('pollingCode'))
96
+		let query = {
97
+			inspectionNode:{
98
+				updateInspectionNodeCode: 1,
99
+				id: data.pollingId,
100
+				updateId: dataInfo.newPollingData.id,
101
+				code: data.code
102
+			}
103
+		}
104
+		uni.showLoading({
105
+		  title: "加载中",
106
+		  mask: true,
107
+		});
108
+		api_inspectionNodeEdit(query).then((result) => {
109
+		    if (result.status == 200) {
110
+					uni.hideLoading();
111
+		      uni.showToast({
112
+		        icon: 'none',
113
+		        title: result.msg
114
+		      });
115
+					alertDialog.value.close()
116
+					setTimeout(_=>{
117
+						setInfoData()
118
+					},1000)
119
+		    } else {
120
+					uni.showToast({
121
+					  icon: 'none',
122
+					  title: result.msg
123
+					});
124
+		    }
125
+		  });
126
+	}
127
+	
128
+	// 关闭
129
+	function close(){
130
+		alertDialog.value.close()
131
+	}
132
+	
133
+	// 扫码
134
+	function scanCodes(){
135
+		uni.showLoading({
136
+		  title: "加载中",
137
+		  mask: true,
138
+		});
139
+
140
+		SM().then((res) => {
141
+			let query = {
142
+				idx: 0,
143
+				sum: 1,
144
+				inspectionNode:{
145
+					code:res
146
+				}
147
+			}
148
+			api_inspectionNode(query).then((res2) => {
149
+			  uni.hideLoading();
150
+			  if (res2.status == 200) {
151
+					if(res2.list.length>0){
152
+						dataInfo.pollingData = res2.list[0].name
153
+						dataInfo.pollingId = res2.list[0].id
154
+					}
155
+					let data = {
156
+						code: res,
157
+						pollingData: dataInfo.pollingData,
158
+						pollingId: dataInfo.pollingId,
159
+					}
160
+					uni.setStorageSync('pollingCode',JSON.stringify(data))
161
+					dataInfo.type = true
162
+			  } else {
163
+			    uni.showToast({
164
+			      icon: 'none',
165
+			      title: res2.msg || '请求数据失败!'
166
+			    });
167
+			  }
168
+			});
169
+		})
170
+	}
171
+	
172
+  onLoad((option) => {
173
+		if(option && option.data){
174
+			let data = JSON.parse(option.data)
175
+			dataInfo.newPollingData = data
176
+			console.log(998,data)
177
+		}
178
+		if(uni.getStorageSync('pollingCode')){
179
+			let data = JSON.parse(uni.getStorageSync('pollingCode'))
180
+			dataInfo.pollingData = data.pollingData
181
+			dataInfo.pollingId = data.pollingId
182
+			dataInfo.content = `二维码绑定为“${dataInfo.newPollingData.name}”,原“${dataInfo.pollingData}”二维码被清空,您确认绑定吗?`
183
+		}
184
+  })
185
+	
186
+	onUnload(()=>{
187
+		setInfoData()
188
+	})
189
+</script>
190
+
191
+<style>
192
+	>>> .uni-popup .uni-popup__wrapper{
193
+		background-color: #fff !important;
194
+		width: 90%;
195
+		border-radius: 10rpx;
196
+	}
197
+	>>> .uni-popup__info{
198
+		color: #333 !important;
199
+	}
200
+	>>>.uni-button-color{
201
+		color: #49B856 !important;
202
+	}
203
+</style>
204
+<style lang="scss" scoped>
205
+.handler{
206
+  height: 89vh;
207
+	.body{
208
+		height: 100%;
209
+		padding: 0 30rpx;
210
+		.scan-box{
211
+			padding: 40rpx 0 ;
212
+			display: flex;
213
+			justify-content: center;
214
+			.scan{
215
+				width: 150rpx;
216
+				height: 150rpx;
217
+				border-radius: 50%;
218
+				text-align: center;
219
+				line-height: 150rpx;
220
+				background: linear-gradient( 300deg, #6BBF76 0%, #46B491 100%);
221
+				.icon{
222
+					color: #fff;
223
+				}
224
+			}
225
+		}
226
+		.container{
227
+			text-align: center;
228
+			.weight-class{
229
+				font-size: 38rpx;
230
+				font-weight: 600;
231
+				margin-bottom: 20rpx;
232
+			}
233
+			.weight-tip{
234
+				font-size: 32rpx;
235
+				margin-bottom: 20rpx;
236
+			}
237
+		}
238
+	}
239
+	.popup-content{
240
+		padding: 20rpx;
241
+		text-align: center;
242
+		.tip{
243
+			font-size: 32rpx;
244
+			color: #333;
245
+			margin-bottom: 20rpx;
246
+		}
247
+		.content{
248
+			color: #6C6C6C;
249
+			padding: 20rpx;
250
+		}
251
+	}
252
+	.btn-box{
253
+		display: flex;
254
+		border-top: 1px solid #E3E3E3;
255
+		.btn-item-50{
256
+			flex: 1;
257
+			height: 90rpx;
258
+			line-height: 90rpx;
259
+			text-align: center;
260
+		}
261
+		.color-close{
262
+			color: #606266;
263
+		}
264
+		.color{
265
+			color: #49B856;
266
+			border-left: 1px solid #E3E3E3;
267
+		}
268
+	}
269
+}
270
+</style>

+ 26 - 3
static/font/demo_index.html

@@ -55,6 +55,12 @@
55 55
           <ul class="icon_lists dib-box">
56 56
           
57 57
             <li class="dib">
58
+              <span class="icon newicon">&#xe68b;</span>
59
+                <div class="name">绑定</div>
60
+                <div class="code-name">&amp;#xe68b;</div>
61
+              </li>
62
+          
63
+            <li class="dib">
58 64
               <span class="icon newicon">&#xe633;</span>
59 65
                 <div class="name">右箭头</div>
60 66
                 <div class="code-name">&amp;#xe633;</div>
@@ -246,9 +252,9 @@
246 252
 <pre><code class="language-css"
247 253
 >@font-face {
248 254
   font-family: 'newicon';
249
-  src: url('iconfont.woff2?t=1721874329610') format('woff2'),
250
-       url('iconfont.woff?t=1721874329610') format('woff'),
251
-       url('iconfont.ttf?t=1721874329610') format('truetype');
255
+  src: url('iconfont.woff2?t=1741933729857') format('woff2'),
256
+       url('iconfont.woff?t=1741933729857') format('woff'),
257
+       url('iconfont.ttf?t=1741933729857') format('truetype');
252 258
 }
253 259
 </code></pre>
254 260
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -275,6 +281,15 @@
275 281
         <ul class="icon_lists dib-box">
276 282
           
277 283
           <li class="dib">
284
+            <span class="icon newicon newicon-bangding"></span>
285
+            <div class="name">
286
+              绑定
287
+            </div>
288
+            <div class="code-name">.newicon-bangding
289
+            </div>
290
+          </li>
291
+          
292
+          <li class="dib">
278 293
             <span class="icon newicon newicon-youjiantou"></span>
279 294
             <div class="name">
280 295
               右箭头
@@ -564,6 +579,14 @@
564 579
           
565 580
             <li class="dib">
566 581
                 <svg class="icon svg-icon" aria-hidden="true">
582
+                  <use xlink:href="#newicon-bangding"></use>
583
+                </svg>
584
+                <div class="name">绑定</div>
585
+                <div class="code-name">#newicon-bangding</div>
586
+            </li>
587
+          
588
+            <li class="dib">
589
+                <svg class="icon svg-icon" aria-hidden="true">
567 590
                   <use xlink:href="#newicon-youjiantou"></use>
568 591
                 </svg>
569 592
                 <div class="name">右箭头</div>

+ 7 - 3
static/font/iconfont.css

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "newicon"; /* Project id 4304860 */
3
-  src: url('iconfont.woff2?t=1721874329610') format('woff2'),
4
-       url('iconfont.woff?t=1721874329610') format('woff'),
5
-       url('iconfont.ttf?t=1721874329610') format('truetype');
3
+  src: url('iconfont.woff2?t=1741933729857') format('woff2'),
4
+       url('iconfont.woff?t=1741933729857') format('woff'),
5
+       url('iconfont.ttf?t=1741933729857') format('truetype');
6 6
 }
7 7
 
8 8
 .newicon {
@@ -13,6 +13,10 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.newicon-bangding:before {
17
+  content: "\e68b";
18
+}
19
+
16 20
 .newicon-youjiantou:before {
17 21
   content: "\e633";
18 22
 }

File diff suppressed because it is too large
+ 1 - 1
static/font/iconfont.js


+ 7 - 0
static/font/iconfont.json

@@ -6,6 +6,13 @@
6 6
   "description": "",
7 7
   "glyphs": [
8 8
     {
9
+      "icon_id": "5039564",
10
+      "name": "绑定",
11
+      "font_class": "bangding",
12
+      "unicode": "e68b",
13
+      "unicode_decimal": 59019
14
+    },
15
+    {
9 16
       "icon_id": "9021524",
10 17
       "name": "右箭头",
11 18
       "font_class": "youjiantou",

BIN
static/font/iconfont.ttf


BIN
static/font/iconfont.woff


BIN
static/font/iconfont.woff2