Kaynağa Gözat

修改生产前准备

695593266@qq.com 4 ay önce
ebeveyn
işleme
9e92abb6e8

+ 17 - 7
src/views/productionPlan/components/auxiliaryMaterial.vue

@@ -309,7 +309,7 @@
       </div>
       <div slot="footer">
         <el-button plain @click="cancel">取消</el-button>
-        <!-- <el-button type="primary" @click="confirm">确定</el-button> -->
+        <el-button type="primary" @click="confirm('齐套')">确定</el-button>
       </div>
     </ele-modal>
 
@@ -332,7 +332,8 @@
     findAssistMaterialInfoByPlanId,
     bomVersionList,
     listBomType,
-    getProductKitting
+    getProductKitting,
+    updatePreRelease
   } from '@/api/productionPlan/index.js';
   import factoryAdd from './factoryAdd';
   import stockDetailDialog from './stockDetailDialog.vue';
@@ -488,7 +489,8 @@
             return time.getTime() > today.getTime();
           }
         },
-        startTime: []
+        startTime: [],
+        preData: null
       };
     },
     watch: {
@@ -784,9 +786,10 @@
       success() {
         this.bomVChange(this.formInline.bomId);
       },
-      async open(itemData) {
+      async open(itemData, preData) {
         this.visible = true;
         this.planInfo = itemData;
+        this.preData = preData;
 
         await this.getFindAssistMaterialInfoByPlanId(itemData);
         await this.getBomData(itemData);
@@ -995,10 +998,17 @@
       onSubmit() {
         this.getKitting();
         this.attributeChange(this.formInline.attributeType);
+      },
+      confirm(statusStr) {
+        this.preData.statusStr = statusStr;
+        this.updatePreRelease(this.preData);
+      },
+
+      updatePreRelease(item) {
+        updatePreRelease(item);
+        this.$emit('success');
+        this.visible = false;
       }
-      // confirm() {
-      //   this.visible = false;
-      // },
       // async merge() {
       //   this.reload({ planIds: this.ids, productType: 1, merge: 2 });
       // },

+ 18 - 7
src/views/productionPlan/components/checkProductionPreparations.vue

@@ -7,7 +7,7 @@
     row-key="code"
     custom-class="ele-dialog-form"
     title="生产前准备"
-    @closed="onClose"
+    :before-close="onClose"
     append-to-body
     :maxable="true"
   >
@@ -229,7 +229,10 @@
     </ele-modal>
 
     <kitting-complete ref="kittingCompleteRef"></kitting-complete>
-    <auxiliary-material ref="auxiliaryMaterialRef"></auxiliary-material>
+    <auxiliary-material
+      ref="auxiliaryMaterialRef"
+      @success="updateStatus"
+    ></auxiliary-material>
   </ele-modal>
 </template>
 
@@ -520,14 +523,14 @@
         this.visible = true;
         this.itemData = item;
         this.preReleaseList = [];
-        if (item.preRelease.length) {
-          this.preReleaseList = item.preRelease;
-        } else {
+        // if (item.preRelease.length) {
+        //   this.preReleaseList = item.preRelease;
+        // } else {
           if (item.id && this.type == 'plan') {
             this.completenessCheck(item.id);
           } else if (this.type == 'order') {
             this.completenessCheck(item.productionPlanId, item.id);
-          }
+          // }
         }
       },
 
@@ -535,6 +538,7 @@
 
       onClose() {
         this.visible = false;
+        this.$emit('update');
       },
 
       handleClose() {
@@ -615,7 +619,8 @@
           const list = [this.itemData];
           this.$refs.kittingCompleteRef.open(list);
         } else if (item.preType == '2') {
-          this.$refs.auxiliaryMaterialRef.open(this.itemData);
+          const data = this.preReleaseList.find((it) => it.preType == 2);
+          this.$refs.auxiliaryMaterialRef.open(this.itemData, data);
         }
       },
 
@@ -711,6 +716,12 @@
         });
       },
 
+      updateStatus() {
+        const index = this.preReleaseList.findIndex((it) => it.preType == 2);
+
+        this.$set(this.preReleaseList[index], 'statusStr', '齐套');
+      },
+
       async batchConfirm() {
         const valid = await this.$refs.form.validate().catch(() => false);
         if (!valid) return;