seimin недель назад: 2
Родитель
Сommit
66fe1fe48a

+ 20 - 1
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" @click.stop="toBuildIncident(data)" type="default" class="primaryButton btn">生成维修单</button>
36 37
           </view>
37 38
         </view>
38 39
       </view>
@@ -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)
@@ -162,6 +165,14 @@
162 165
       uni.hideLoading();
163 166
     });
164 167
   }
168
+  
169
+  // 新建事件
170
+  function toBuildIncident(data){
171
+  	incidentBuildStore.clearIncidentBuildData();
172
+    uni.navigateTo({
173
+      url: '/pages/buildIncident/buildIncident'
174
+    })
175
+  }
165 176
 
166 177
   // 巡检项
167 178
   function toInspectionValue(data){
@@ -431,6 +442,14 @@ page{
431 442
         text-align: left;
432 443
         margin: 24rpx;
433 444
         font-size: 30rpx;
445
+        .sign{
446
+          margin-right: 16rpx;
447
+          font-weight: bold;
448
+          color: #49B856;
449
+          &.signRed{
450
+            color: #FF0000;
451
+          }
452
+        }
434 453
       }
435 454
       .body_item_content{
436 455
         border-top: 1rpx solid #D8D8D8;

+ 1 - 1
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">

+ 32 - 4
pages/inspection/inspectionValue/inspectionValue.vue

@@ -194,10 +194,38 @@
194 194
             Object.values(itemRefs.value).forEach(v => {
195 195
               v && v.uploadFn();
196 196
             })
197
-            inspectionValueStore.clearInspectionValueData();
198
-            uni.reLaunch({
199
-              url: `/pages/inspection/inspectionExecute/inspectionExecute`
200
-            })
197
+
198
+            if(res.exception){
199
+              // 异常
200
+              if(true){
201
+                uni.showToast({
202
+                  icon: 'none',
203
+                  title: "巡检提交成功,有异常",
204
+                  duration: 2000,
205
+                  mask: true,
206
+                })
207
+                setTimeout(() => {
208
+                  inspectionValueStore.clearInspectionValueData();
209
+                  uni.reLaunch({
210
+                    url: `/pages/inspection/inspectionExecute/inspectionExecute`
211
+                  })
212
+                }, 2000)
213
+              }
214
+            }else{
215
+              // 无异常
216
+              uni.showToast({
217
+                icon: 'none',
218
+                title: "巡检提交成功,无异常",
219
+                duration: 2000,
220
+                mask: true,
221
+              })
222
+              setTimeout(() => {
223
+                inspectionValueStore.clearInspectionValueData();
224
+                uni.reLaunch({
225
+                  url: `/pages/inspection/inspectionExecute/inspectionExecute`
226
+                })
227
+              }, 2000)
228
+            }
201 229
           } else {
202 230
             uni.showToast({
203 231
               icon: 'none',