2 次代码提交 78d8d1b24b ... c7807c3f00

作者 SHA1 备注 提交日期
  闪电 c7807c3f00 Merge branch 'master' of http://39.164.159.226:3000/hnsh-smart-steward/smart-steward-mobile 2 周之前
  闪电 d67ce0e1fa fix 2 周之前
共有 4 个文件被更改,包括 137 次插入20 次删除
  1. 1 0
      package.json
  2. 7 4
      pnpm-lock.yaml
  3. 126 15
      src/pages/schedule/details/deal/inspection.vue
  4. 3 1
      src/pages/schedule/details/index.vue

+ 1 - 0
package.json

165
     "@vue/runtime-core": "^3.4.21",
165
     "@vue/runtime-core": "^3.4.21",
166
     "@vue/tsconfig": "^0.1.3",
166
     "@vue/tsconfig": "^0.1.3",
167
     "autoprefixer": "^10.4.20",
167
     "autoprefixer": "^10.4.20",
168
+    "baseline-browser-mapping": "^2.9.19",
168
     "cross-env": "^10.0.0",
169
     "cross-env": "^10.0.0",
169
     "eslint": "^9.31.0",
170
     "eslint": "^9.31.0",
170
     "eslint-config-prettier": "^10.1.8",
171
     "eslint-config-prettier": "^10.1.8",

+ 7 - 4
pnpm-lock.yaml

211
       autoprefixer:
211
       autoprefixer:
212
         specifier: ^10.4.20
212
         specifier: ^10.4.20
213
         version: 10.4.21(postcss@8.5.6)
213
         version: 10.4.21(postcss@8.5.6)
214
+      baseline-browser-mapping:
215
+        specifier: ^2.9.19
216
+        version: 2.9.19
214
       cross-env:
217
       cross-env:
215
         specifier: ^10.0.0
218
         specifier: ^10.0.0
216
         version: 10.0.0
219
         version: 10.0.0
2889
     resolution: {integrity: sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==}
2892
     resolution: {integrity: sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==}
2890
     engines: {node: '>=6.0.0'}
2893
     engines: {node: '>=6.0.0'}
2891
 
2894
 
2892
-  baseline-browser-mapping@2.8.15:
2893
-    resolution: {integrity: sha512-qsJ8/X+UypqxHXN75M7dF88jNK37dLBRW7LeUzCPz+TNs37G8cfWy9nWzS+LS//g600zrt2le9KuXt0rWfDz5Q==}
2895
+  baseline-browser-mapping@2.9.19:
2896
+    resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==}
2894
     hasBin: true
2897
     hasBin: true
2895
 
2898
 
2896
   binary-extensions@2.3.0:
2899
   binary-extensions@2.3.0:
10402
 
10405
 
10403
   base64url@3.0.1: {}
10406
   base64url@3.0.1: {}
10404
 
10407
 
10405
-  baseline-browser-mapping@2.8.15: {}
10408
+  baseline-browser-mapping@2.9.19: {}
10406
 
10409
 
10407
   binary-extensions@2.3.0: {}
10410
   binary-extensions@2.3.0: {}
10408
 
10411
 
10460
 
10463
 
10461
   browserslist@4.26.3:
10464
   browserslist@4.26.3:
10462
     dependencies:
10465
     dependencies:
10463
-      baseline-browser-mapping: 2.8.15
10466
+      baseline-browser-mapping: 2.9.19
10464
       caniuse-lite: 1.0.30001749
10467
       caniuse-lite: 1.0.30001749
10465
       electron-to-chromium: 1.5.234
10468
       electron-to-chromium: 1.5.234
10466
       node-releases: 2.0.23
10469
       node-releases: 2.0.23

+ 126 - 15
src/pages/schedule/details/deal/inspection.vue

130
 
130
 
131
 const lastIndex = ref(0)
131
 const lastIndex = ref(0)
132
 
132
 
133
-async function saveCheckLog({ index }: { index: number }) {
133
+async function saveCheckLog({ index, isSubmit = false }: { index: number, isSubmit: boolean }) {
134
   try {
134
   try {
135
     // 获取当前数据
135
     // 获取当前数据
136
     const logs = []
136
     const logs = []
153
 
153
 
154
       // 做一些判断,比如必填项
154
       // 做一些判断,比如必填项
155
       if (item.hasPhoto === 2 && !item.photoUrl?.length) {
155
       if (item.hasPhoto === 2 && !item.photoUrl?.length) {
156
-        throw new Error('请上传照片')
156
+        // throw new Error('请上传照片')
157
+        // return
157
       }
158
       }
158
 
159
 
159
       if (item.hasInput === 1 && !item.inputItem) {
160
       if (item.hasInput === 1 && !item.inputItem) {
160
-        throw new Error('请输入内容')
161
+        // throw new Error('请输入内容')
162
+        // return
161
       }
163
       }
162
 
164
 
163
       if (logInfo.result === 2) {
165
       if (logInfo.result === 2) {
169
       //   })
171
       //   })
170
       //   return
172
       //   return
171
       // }
173
       // }
174
+        // return
172
       }
175
       }
173
 
176
 
174
       logs.push(logInfo)
177
       logs.push(logInfo)
181
       //   title: '提交成功',
184
       //   title: '提交成功',
182
       //   icon: 'success',
185
       //   icon: 'success',
183
       // })
186
       // })
187
+      if (isSubmit) {
188
+        // 回到详情页
189
+        uni.navigateBack({
190
+          delta: 1,
191
+        })
192
+      }
193
+
184
       lastIndex.value = index
194
       lastIndex.value = index
185
       currentCheckList.value = checkSubItems.value[index]?.items || []
195
       currentCheckList.value = checkSubItems.value[index]?.items || []
186
     }
196
     }
205
 
215
 
206
 // 提交任务
216
 // 提交任务
207
 function submitTasks() {
217
 function submitTasks() {
208
-  saveCheckLog({ index: activeArea.value }).then(() => {
218
+  saveCheckLog({ index: activeArea.value, isSubmit: false }).then(() => {
209
     // 提交任务
219
     // 提交任务
210
-    handleCheckTask(checkId.value).then(() => {
211
-      uni.showToast({
212
-        title: '提交成功',
213
-        icon: 'success',
214
-      })
220
+    handleCheckTask(checkId.value).then((res: any) => {
221
+      // uni.showToast({
222
+      //   title: '提交成功',
223
+      //   icon: 'success',
224
+      // })
225
+      if (res.code === 200) {
226
+        uni.showToast({
227
+          title: '提交成功',
228
+          icon: 'success',
229
+        })
230
+
231
+        uni.navigateBack({
232
+          delta: 1,
233
+        })
234
+      }
235
+      else {
236
+        uni.showToast({
237
+          title: res.msg || '提交失败',
238
+          icon: 'none',
239
+        })
240
+      }
215
     }).catch(() => {
241
     }).catch(() => {
216
       uni.showToast({
242
       uni.showToast({
217
         title: '提交失败',
243
         title: '提交失败',
260
   })
286
   })
261
 }
287
 }
262
 
288
 
289
+const toastHtml = ref('')
290
+const popupShow = ref({
291
+  centerShow: false,
292
+  bottomShow: false,
293
+})
294
+function helpClick(task: any) {
295
+  toastHtml.value = task.checkDescription
296
+  popupShow.value.centerShow = true
297
+}
298
+function helpClose() {
299
+  toastHtml.value = ''
300
+  popupShow.value.centerShow = false
301
+}
302
+
263
 onMounted(async () => {
303
 onMounted(async () => {
264
   await init()
304
   await init()
265
 })
305
 })
295
             <text class="task-text">
335
             <text class="task-text">
296
               {{ task.itemName }}
336
               {{ task.itemName }}
297
               <wd-icon
337
               <wd-icon
298
-                v-if="task?.icon"
299
-                :name="task?.icon"
338
+                v-if="task?.checkDescription"
339
+                name="help-circle"
300
                 size="32rpx"
340
                 size="32rpx"
301
-                @click="() => (popShow.centerShow = true)"
341
+                @click="helpClick(task)"
302
               />
342
               />
303
             </text>
343
             </text>
304
           </view>
344
           </view>
333
           <view v-if="task.hasPhoto > 0 || (task?.images?.length > 0)" class="image-upload-container">
373
           <view v-if="task.hasPhoto > 0 || (task?.images?.length > 0)" class="image-upload-container">
334
             <!-- 上传按钮 -->
374
             <!-- 上传按钮 -->
335
             <view
375
             <view
336
-              v-if="task.hasPhoto > 0"
337
-              class="upload-btn"
376
+              v-if="task.hasPhoto > 0" :class="[task.hasPhoto === 2 ? 'upload-btn-req' : 'upload-btn']"
338
               @tap="chooseImage(+index)"
377
               @tap="chooseImage(+index)"
339
             >
378
             >
340
               <view class="btn-content">
379
               <view class="btn-content">
389
               <text class="link-text" @tap="toggleTaskStatus(task)">{{ task.formOperationIssue ? '点击查看异常' : '点击填写异常(未满分必填)' }}</text>
428
               <text class="link-text" @tap="toggleTaskStatus(task)">{{ task.formOperationIssue ? '点击查看异常' : '点击填写异常(未满分必填)' }}</text>
390
             </view>
429
             </view>
391
           </view>
430
           </view>
431
+          <wd-divider color="#EEEEEE" />
432
+          <!-- 分割线 -->
433
+          <!-- <view class="my-4 border-b border-gray-300" /> -->
392
         </view>
434
         </view>
393
       </view>
435
       </view>
394
     </scroll-view>
436
     </scroll-view>
406
       <button class="btn" @click="submitTasks">
448
       <button class="btn" @click="submitTasks">
407
         提交
449
         提交
408
       </button>
450
       </button>
409
-      <button class="btn" @click="saveCheckLog({ index: activeArea.value })">
451
+      <button class="btn" @click="saveCheckLog({ index: activeArea.value, isSubmit: true })">
410
         保存
452
         保存
411
       </button>
453
       </button>
412
     </view>
454
     </view>
455
+    <wd-popup
456
+      v-model="popupShow.centerShow"
457
+      custom-style="border-radius:32rpx;"
458
+      @close="helpClose"
459
+    >
460
+      <view class="popup-content">
461
+        <view style="font-size: 36rpx; font-weight: 500; color: #020917">
462
+          说明
463
+        </view>
464
+        <view style="font-size: 32rpx; font-weight: 400; color: #343a45" v-html="toastHtml" />
465
+        <view style="width: 100%">
466
+          <button class="btn" @click="helpClose">
467
+            我 知 道 了
468
+          </button>
469
+        </view>
470
+      </view>
471
+    </wd-popup>
413
   </view>
472
   </view>
414
 </template>
473
 </template>
415
 
474
 
468
   // 任务项
527
   // 任务项
469
   .task-item {
528
   .task-item {
470
     margin-bottom: 40rpx;
529
     margin-bottom: 40rpx;
530
+    padding-right: 20px;
471
 
531
 
472
     // 任务描述
532
     // 任务描述
473
     .task-description {
533
     .task-description {
608
       }
668
       }
609
     }
669
     }
610
 
670
 
671
+    .upload-btn-req {
672
+      width: 140rpx;
673
+      height: 100rpx;
674
+      border: 2rpx dashed red;
675
+      border-radius: 8rpx;
676
+      display: flex;
677
+      align-items: center;
678
+      justify-content: center;
679
+      flex-shrink: 0;
680
+
681
+      .btn-content {
682
+        display: flex;
683
+        flex-direction: column;
684
+        align-items: center;
685
+
686
+        .btn-icon {
687
+          font-size: 40rpx;
688
+          color: red;
689
+          line-height: 40rpx;
690
+        }
691
+
692
+        .btn-text {
693
+          font-size: 24rpx;
694
+          color: red;
695
+          margin-top: 4rpx;
696
+        }
697
+      }
698
+    }
699
+
611
     // 已上传图片
700
     // 已上传图片
612
     .uploaded-images {
701
     .uploaded-images {
613
       display: flex;
702
       display: flex;
815
     }
904
     }
816
   }
905
   }
817
 }
906
 }
907
+
908
+.popup-content {
909
+  width: 600rpx;
910
+  display: flex;
911
+  flex-direction: column;
912
+  justify-content: space-between;
913
+  align-items: center;
914
+  padding: 40rpx;
915
+  box-sizing: border-box;
916
+  gap: 40rpx;
917
+  .btn {
918
+    width: 100%;
919
+    height: 80rpx;
920
+    background-color: #215acd;
921
+    color: white;
922
+    font-size: 32rpx;
923
+    border-radius: 12rpx;
924
+    font-weight: 400;
925
+    border: none;
926
+    outline: none;
927
+  }
928
+}
818
 </style>
929
 </style>

+ 3 - 1
src/pages/schedule/details/index.vue

454
           <view class="guide-value flex items-center justify-between">
454
           <view class="guide-value flex items-center justify-between">
455
             {{ taskInfo.executorName || '-' }}
455
             {{ taskInfo.executorName || '-' }}
456
             <wd-select-picker
456
             <wd-select-picker
457
+              v-if="buttons.transfer"
457
               v-model="value"
458
               v-model="value"
458
               title="选择转交人"
459
               title="选择转交人"
459
               filterable :max="1" use-default-slot :columns="users" style="z-index:101" @confirm="handleTransferTask"
460
               filterable :max="1" use-default-slot :columns="users" style="z-index:101" @confirm="handleTransferTask"
460
             >
461
             >
461
-              <wd-button v-if="buttons.transfer" type="text">
462
+              <wd-button type="text">
462
                 转交
463
                 转交
463
               </wd-button>
464
               </wd-button>
464
             </wd-select-picker>
465
             </wd-select-picker>
474
               v-model="planTimeValue"
475
               v-model="planTimeValue"
475
               type="datetime"
476
               type="datetime"
476
               title="选择计划时间"
477
               title="选择计划时间"
478
+              style="z-index:101"
477
               :min-date="new Date().getTime()"
479
               :min-date="new Date().getTime()"
478
               :max-date="new Date(taskInfo.endTime).getTime()"
480
               :max-date="new Date(taskInfo.endTime).getTime()"
479
               @confirm="handlePlanTimeChange"
481
               @confirm="handlePlanTimeChange"