2 Revīzijas 78d8d1b24b ... c7807c3f00

Autors SHA1 Ziņojums Datums
  闪电 c7807c3f00 Merge branch 'master' of http://39.164.159.226:3000/hnsh-smart-steward/smart-steward-mobile 2 nedēļas atpakaļ
  闪电 d67ce0e1fa fix 2 nedēļas atpakaļ

+ 1 - 0
package.json

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

+ 7 - 4
pnpm-lock.yaml

@@ -211,6 +211,9 @@ importers:
211 211
       autoprefixer:
212 212
         specifier: ^10.4.20
213 213
         version: 10.4.21(postcss@8.5.6)
214
+      baseline-browser-mapping:
215
+        specifier: ^2.9.19
216
+        version: 2.9.19
214 217
       cross-env:
215 218
         specifier: ^10.0.0
216 219
         version: 10.0.0
@@ -2889,8 +2892,8 @@ packages:
2889 2892
     resolution: {integrity: sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==}
2890 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 2897
     hasBin: true
2895 2898
 
2896 2899
   binary-extensions@2.3.0:
@@ -10402,7 +10405,7 @@ snapshots:
10402 10405
 
10403 10406
   base64url@3.0.1: {}
10404 10407
 
10405
-  baseline-browser-mapping@2.8.15: {}
10408
+  baseline-browser-mapping@2.9.19: {}
10406 10409
 
10407 10410
   binary-extensions@2.3.0: {}
10408 10411
 
@@ -10460,7 +10463,7 @@ snapshots:
10460 10463
 
10461 10464
   browserslist@4.26.3:
10462 10465
     dependencies:
10463
-      baseline-browser-mapping: 2.8.15
10466
+      baseline-browser-mapping: 2.9.19
10464 10467
       caniuse-lite: 1.0.30001749
10465 10468
       electron-to-chromium: 1.5.234
10466 10469
       node-releases: 2.0.23

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

@@ -130,7 +130,7 @@ function toggleScore(taskIndex: number, score: number | null) {
130 130
 
131 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 134
   try {
135 135
     // 获取当前数据
136 136
     const logs = []
@@ -153,11 +153,13 @@ async function saveCheckLog({ index }: { index: number }) {
153 153
 
154 154
       // 做一些判断,比如必填项
155 155
       if (item.hasPhoto === 2 && !item.photoUrl?.length) {
156
-        throw new Error('请上传照片')
156
+        // throw new Error('请上传照片')
157
+        // return
157 158
       }
158 159
 
159 160
       if (item.hasInput === 1 && !item.inputItem) {
160
-        throw new Error('请输入内容')
161
+        // throw new Error('请输入内容')
162
+        // return
161 163
       }
162 164
 
163 165
       if (logInfo.result === 2) {
@@ -169,6 +171,7 @@ async function saveCheckLog({ index }: { index: number }) {
169 171
       //   })
170 172
       //   return
171 173
       // }
174
+        // return
172 175
       }
173 176
 
174 177
       logs.push(logInfo)
@@ -181,6 +184,13 @@ async function saveCheckLog({ index }: { index: number }) {
181 184
       //   title: '提交成功',
182 185
       //   icon: 'success',
183 186
       // })
187
+      if (isSubmit) {
188
+        // 回到详情页
189
+        uni.navigateBack({
190
+          delta: 1,
191
+        })
192
+      }
193
+
184 194
       lastIndex.value = index
185 195
       currentCheckList.value = checkSubItems.value[index]?.items || []
186 196
     }
@@ -205,13 +215,29 @@ async function saveCheckLog({ index }: { index: number }) {
205 215
 
206 216
 // 提交任务
207 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 241
     }).catch(() => {
216 242
       uni.showToast({
217 243
         title: '提交失败',
@@ -260,6 +286,20 @@ function init() {
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 303
 onMounted(async () => {
264 304
   await init()
265 305
 })
@@ -295,10 +335,10 @@ onMounted(async () => {
295 335
             <text class="task-text">
296 336
               {{ task.itemName }}
297 337
               <wd-icon
298
-                v-if="task?.icon"
299
-                :name="task?.icon"
338
+                v-if="task?.checkDescription"
339
+                name="help-circle"
300 340
                 size="32rpx"
301
-                @click="() => (popShow.centerShow = true)"
341
+                @click="helpClick(task)"
302 342
               />
303 343
             </text>
304 344
           </view>
@@ -333,8 +373,7 @@ onMounted(async () => {
333 373
           <view v-if="task.hasPhoto > 0 || (task?.images?.length > 0)" class="image-upload-container">
334 374
             <!-- 上传按钮 -->
335 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 377
               @tap="chooseImage(+index)"
339 378
             >
340 379
               <view class="btn-content">
@@ -389,6 +428,9 @@ onMounted(async () => {
389 428
               <text class="link-text" @tap="toggleTaskStatus(task)">{{ task.formOperationIssue ? '点击查看异常' : '点击填写异常(未满分必填)' }}</text>
390 429
             </view>
391 430
           </view>
431
+          <wd-divider color="#EEEEEE" />
432
+          <!-- 分割线 -->
433
+          <!-- <view class="my-4 border-b border-gray-300" /> -->
392 434
         </view>
393 435
       </view>
394 436
     </scroll-view>
@@ -406,10 +448,27 @@ onMounted(async () => {
406 448
       <button class="btn" @click="submitTasks">
407 449
         提交
408 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 453
       </button>
412 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 472
   </view>
414 473
 </template>
415 474
 
@@ -468,6 +527,7 @@ onMounted(async () => {
468 527
   // 任务项
469 528
   .task-item {
470 529
     margin-bottom: 40rpx;
530
+    padding-right: 20px;
471 531
 
472 532
     // 任务描述
473 533
     .task-description {
@@ -608,6 +668,35 @@ onMounted(async () => {
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 701
     .uploaded-images {
613 702
       display: flex;
@@ -815,4 +904,26 @@ onMounted(async () => {
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 929
 </style>

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

@@ -454,11 +454,12 @@ onMounted(async () => {
454 454
           <view class="guide-value flex items-center justify-between">
455 455
             {{ taskInfo.executorName || '-' }}
456 456
             <wd-select-picker
457
+              v-if="buttons.transfer"
457 458
               v-model="value"
458 459
               title="选择转交人"
459 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 464
               </wd-button>
464 465
             </wd-select-picker>
@@ -474,6 +475,7 @@ onMounted(async () => {
474 475
               v-model="planTimeValue"
475 476
               type="datetime"
476 477
               title="选择计划时间"
478
+              style="z-index:101"
477 479
               :min-date="new Date().getTime()"
478 480
               :max-date="new Date(taskInfo.endTime).getTime()"
479 481
               @confirm="handlePlanTimeChange"