瀏覽代碼

Merge branch 'feature_20260420_陈列任务识别排面数修改' into uat(dev)

zhujindu 8 小時之前
父節點
當前提交
1d2936314e
共有 1 個文件被更改,包括 89 次插入66 次删除
  1. 89 66
      src/views/historicalVisit/perfectStoreTask.vue

+ 89 - 66
src/views/historicalVisit/perfectStoreTask.vue

@@ -112,15 +112,21 @@
           </el-table-column>
           <el-table-column label="排面数" prop="identifyTheNumberOfCards" align="center" width="80">
             <template slot-scope="scope">
-              <span v-if="!editTableFlag" :class="{ shelfEdit: scope.row.shelfEdit == 1 }"
+              <span
+                v-if="!editTableFlag"
+                :class="{ shelfEdit: scope.row.shelfEdit == 1, identifyTheNumber: true }"
                 >{{ scope.row.identifyTheNumberOfCards }}
               </span>
-              <span v-else-if="!editTableFlag">
+              <span v-else-if="!editTableFlag" class="identifyTheNumber">
                 {{ scope.row.identifyTheNumberOfCards }}
               </span>
               <van-field
                 v-else
-                :class="{ shelfEdit: scope.row.shelfEdit == 1 }"
+                :class="{
+                  shelfEdit: scope.row.shelfEdit == 1,
+                  identifyTheNumber: true,
+                  isEdit: scope.row.identifyTheNumberOfCards > '0',
+                }"
                 v-model="scope.row.identifyTheNumberOfCards"
                 placeholder="请输入排面数"
                 type="digit"
@@ -331,12 +337,13 @@ export default {
       let filteredResults = this.formData.taskPhotoRecognitionResult.filter(
         (val) => val.skuProductCode == row.skuProductCode,
       );
-      if (row.identifyTheNumberOfCards != null && row.identifyTheNumberOfCards !== '') {
-        const original = Number(filteredResults[0]?.identifyTheNumberOfCards || '0');
-        const current = Number(row.identifyTheNumberOfCards);
+      if (row.rawIdentifyNum != null && row.rawIdentifyNum !== '') {
+        const original = Number(filteredResults[0]?.rawIdentifyNum || '0'); //原始值
+        const activeOriginal = Number(filteredResults[0]?.identifyTheNumberOfCards || '0'); //上一次修改后的值
+        const current = Number(row.identifyTheNumberOfCards); //当前输入的值
         if (current < original) {
           this.$toast('排面数不能小于原始值');
-          row.identifyTheNumberOfCards = String(original);
+          row.identifyTheNumberOfCards = String(activeOriginal);
           const existingIndex = this.editCountArr.findIndex(
             (item) => item.skuProductCode === row.skuProductCode,
           );
@@ -344,8 +351,15 @@ export default {
             this.editCountArr.splice(existingIndex, 1);
           }
         } else {
-          const editCount = current - original;
-          if (editCount > 0) {
+          const editCount = current - activeOriginal; //本次修改的值
+          if (editCount === 0) {
+            const existingIndex = this.editCountArr.findIndex(
+              (item) => item.skuProductCode === row.skuProductCode,
+            );
+            if (existingIndex >= 0) {
+              this.editCountArr.splice(existingIndex, 1);
+            }
+          } else {
             const existingIndex = this.editCountArr.findIndex(
               (item) => item.skuProductCode === row.skuProductCode,
             );
@@ -359,13 +373,6 @@ export default {
                 editCount,
               });
             }
-          } else if (editCount === 0) {
-            const existingIndex = this.editCountArr.findIndex(
-              (item) => item.skuProductCode === row.skuProductCode,
-            );
-            if (existingIndex >= 0) {
-              this.editCountArr.splice(existingIndex, 1);
-            }
           }
         }
       } else {
@@ -578,59 +585,45 @@ export default {
     }
   }
   .shelfEdit {
-    color: red;
+    height: 100%;
+    color: #036bf3;
+    .van-field__body {
+      height: 100%;
+    }
     input {
-      color: red;
+      height: 100%;
+      color: #036bf3;
     }
   }
-}
-.identifyResultdialog {
-  width: vw(690) !important;
-  margin-top: 1vh !important;
-  border-radius: 8px !important;
-  font-size: vw(32) !important;
-  height: 70% !important;
-  display: flex;
-  flex-direction: column;
-  .el-dialog__headerbtn {
-    width: vw(44);
-    height: vw(44);
-    background-color: #e1e1e1;
-    border-radius: 50%;
-    margin-top: -3px;
-  }
-  .el-dialog__body {
-    flex: 1;
-    overflow-y: auto;
-  }
-}
-.table-headermd1 {
-  font-size: 14px;
-  text-align: center;
-  position: initial;
-  width: 98% !important;
-  margin: 0 auto;
-  border-right: 0;
-  border-radius: 8px;
-  th {
-    color: #000;
-    font-weight: bold;
+  .identifyTheNumber {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 100%;
   }
-  td {
-    color: #000;
+  .isEdit {
+    border: 1px solid #609de8;
   }
-  .el-table__cell {
-    padding: 6px 0 !important;
-    .cell {
-      padding: 0;
+  .identifyResultdialog {
+    width: vw(690) !important;
+    margin-top: 1vh !important;
+    border-radius: 8px !important;
+    font-size: vw(32) !important;
+    height: 70% !important;
+    display: flex;
+    flex-direction: column;
+    .el-dialog__headerbtn {
+      width: vw(44);
+      height: vw(44);
+      background-color: #e1e1e1;
+      border-radius: 50%;
+      margin-top: -3px;
+    }
+    .el-dialog__body {
+      flex: 1;
+      overflow-y: auto;
     }
   }
-}
-.skuDeatil {
-  width: 100%;
-  margin-top: 10px;
-  background: #fff;
-  border-radius: 6px;
   .table-headermd1 {
     font-size: 14px;
     text-align: center;
@@ -639,7 +632,6 @@ export default {
     margin: 0 auto;
     border-right: 0;
     border-radius: 8px;
-    margin-top: 10px;
     th {
       color: #000;
       font-weight: bold;
@@ -648,14 +640,45 @@ export default {
       color: #000;
     }
     .el-table__cell {
-      padding: 6px 0 !important;
+      padding: 0 !important;
       .cell {
+        height: 100%;
         padding: 0;
       }
     }
   }
-  .table-headermd1 th.el-table__cell {
-    background-color: #f5f5f5;
+  .skuDeatil {
+    width: 100%;
+    margin-top: 10px;
+    background: #fff;
+    border-radius: 6px;
+    .table-headermd1 {
+      font-size: 14px;
+      text-align: center;
+      position: initial;
+      width: 98% !important;
+      margin: 0 auto;
+      border-right: 0;
+      border-radius: 8px;
+      margin-top: 10px;
+      th {
+        color: #000;
+        font-weight: bold;
+      }
+      td {
+        color: #000;
+      }
+      .el-table__cell {
+        padding: 0 !important;
+        .cell {
+          height: 100%;
+          padding: 0;
+        }
+      }
+    }
+    .table-headermd1 th.el-table__cell {
+      background-color: #f5f5f5;
+    }
   }
 }
 .el-table::before {