Przeglądaj źródła

取整样调整;

yijing 1 rok temu
rodzic
commit
f559f1d42c

+ 15 - 11
src/views/inspectionPlan/components/edit.vue

@@ -548,16 +548,14 @@ export default {
         if (this.baseForm.isUnpack != null && this.baseForm.isUnpack != undefined && this.baseForm.isUnpack != '') {
           //拆包
           if (this.baseForm.isUnpack == 1) {
-            await this.updatePackingList(packingList);
-            // await this.handleUnpackCase(packingList);
+            await this.handleUnpackCase(packingList);
           } else if (this.baseForm.isUnpack == 0) {
             await this.updatePackingList(packingList);
           }
         } else {
           console.log(this.isCheck, 'this.isCheck')
           if (!this.isCheck) {
-            await this.updatePackingList(packingList);
-            // await this.handleUnpackCase(packingList);
+            await this.handleUnpackCase(packingList);
           } else {
             await this.updatePackingList(packingList);
           }
@@ -661,7 +659,7 @@ export default {
       }
     },
     //取样方式选择
-    handleSampleNumber(val) {
+    async handleSampleNumber(val) {
       console.log(val, 'val');
       this.conditionType = val;
       //清空样品清单列表
@@ -669,11 +667,17 @@ export default {
       const dataS = this.$refs.table12.getData();
       //取整样
       if (val == 1) {
-        this.sampleList = dataS;
-        this.formData.portion = dataS.length;
-        this.$refs.table12.toggleAllSelection();
-        this.activeName = '2';
-        this.$message.success('取样成功!');
+        if (this.selectedList.length == 0) {
+          this.$message.warning('请先选择样品!');
+        } else {
+          for (let i = 0; i < this.selectedList.length; i++) {
+            this.selectedList[i].sampleCode = await this.getSampleCode();
+          }
+          this.sampleList = this.selectedList;
+          this.formData.portion = this.selectedList.length;
+          this.activeName = '2';
+          this.$message.success('取样成功!');
+        }
       } else if (val == 2) {
         this.formData.sampleUnit = dataS[0].measureUnit;
 
@@ -730,7 +734,7 @@ export default {
       }
     },
     getCategoryInfo(val) {
-      this.baseForm.isUnpack = val.categoryWms.isUnpack;
+      // this.baseForm.isUnpack = val.categoryWms.isUnpack;
 
       this.isConsumable = val.category.isConsumable;
     },

+ 0 - 3
src/views/inspectionWork/components/QualityContentTabs.vue

@@ -414,9 +414,6 @@ export default {
       //取整样
       let data = this.$refs.sourceTable.getData()
       if (val == 1) {
-        console.log(data, 'data12345678901234567890123456789012345678901234567890123456789')
-        this.formData.portion = data.length
-        this.$refs.sourceTable.toggleAllSelection();
         this.activeName = '2'
         this.$emit('handleSample1', val, data)
       } else if (val == 2) {

+ 2 - 1
src/views/inspectionWork/edit.vue

@@ -371,7 +371,8 @@ export default {
     handleSample1(val, data) {
       this.sampleList = []
       if (val == 1) {
-        this.sampleList = data
+        //取整样=勾选数据
+        this.sampleList = this.selectedList;
         this.$message.success('取样成功!');
       } else if (val == 2) {
         console.log(data, 'datadatadatadataxiaoyang')