695593266@qq.com hai 6 meses
pai
achega
0a87f319c9

+ 35 - 5
src/views/productionPlan/components/checkProductionPreparations.vue

@@ -36,14 +36,17 @@
         <span v-if="row.statusStr == '缺料'" style="color: red">{{
           row.statusStr
         }}</span>
+        <span v-else-if="row.statusStr == '不齐套'" style="color: orange">{{
+          row.statusStr
+        }}</span>
         <span v-else style="color: green">{{ row.statusStr }}</span>
       </template>
 
-      <template v-slot:action="{ row }">
+      <template v-slot:action="{ row, $index }">
         <el-link
           type="primary"
           :underline="false"
-          @click="kittingComplete(row)"
+          @click="kittingComplete(row, $index)"
         >
           齐套检查
         </el-link>
@@ -178,6 +181,7 @@
     },
 
     created() {
+      console.log(this.$store.state.user.info, '用户信息');
       this.getGs();
     },
 
@@ -288,20 +292,46 @@
       handleClose() {
         this.dialogVisible = false;
       },
-      kittingComplete(item) {
+      kittingComplete(item, index) {
         if (item.preType == '5' || item.preType == '6') {
           this.$confirm('是否确认齐套?', '提示', {
             confirmButtonText: '齐套',
             cancelButtonText: '不齐套',
             type: 'warning'
           })
-            .then(() => {})
-            .catch(() => {});
+            .then(() => {
+              // approveDate: null;
+              // approveId: '';
+              // approveName: '';
+              item.approveDate = this.getNowDate();
+              item.statusStr = '齐套';
+              this.$forceUpdate();
+            })
+            .catch(() => {
+              item.approveDate = this.getNowDate();
+              item.statusStr = '不齐套';
+              this.$forceUpdate();
+            });
         } else {
           const list = [this.itemData];
           this.$refs.kittingCompleteRef.open(list);
         }
       },
+
+      getNowDate() {
+        const now = new Date();
+        const year = now.getFullYear();
+        const month = String(now.getMonth() + 1).padStart(2, '0');
+        const day = String(now.getDate()).padStart(2, '0');
+        const hour = String(now.getHours()).padStart(2, '0');
+        const minute = String(now.getMinutes()).padStart(2, '0');
+        const second = String(now.getSeconds()).padStart(2, '0');
+
+        const currentTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+
+        return currentTime;
+      },
+
       taskAssignment() {
         this.dialogVisible = true;
       },