Sfoglia il codice sorgente

已有数据再次参照

jbb 2 anni fa
parent
commit
1c692ab508

+ 13 - 5
src/views/packing-list/packinglist-fabrics/addFabricDrawer.vue

@@ -607,10 +607,13 @@ export default {
       console.log('打开参照发运明细 弹框')
       this.$refs.referShipDetailsModal.referShipDetailsModVis = true
       this.$refs.referShipDetailsModal.getReferenceList()
+      if(this.addFabricData.length !== 0){
+      this.$refs.referShipDetailsModal.fatherFactory = this.addFabric.garmentFactory
+      }
     },
     getFabricData(rows,token) {
-      this.addFabric = {}
-      this.addFabricData = []
+      // this.addFabric = {}
+      // this.addFabricData = []
       var rowsId = [],
          group = []
       rows.map(item => {rowsId.push(item.id),group.push(item.groupId)} )
@@ -619,7 +622,8 @@ export default {
       getShippingDetailId({ids:ids,groupIds:groupId}).then(res => {
           if (res.success) {
             var data = res.result
-            this.addFabric ={
+            if(this.addFabricData.length == 0){
+               this.addFabric ={
               // id:data.id,
               // orderNumber:data.orderNumber,
               documentNo:data.documentNo,
@@ -635,7 +639,12 @@ export default {
               customer : data.customer,
               customerAbbreviation : data.customerAbbreviation
             }
-            this.addFabricData = data.syPackingListFabricItem 
+            }else {
+              data.syPackingListFabricItem.map(item =>{
+                item.isAdd = 1
+              })
+            }
+            this.addFabricData = this.addFabricData.concat(data.syPackingListFabricItem )
             this.addFabricData.map(item =>{
               item.inventoryQuantity = 0
               item.meter = 0
@@ -643,7 +652,6 @@ export default {
               if(item.excessQuantity < 0){
                 item.excessQuantity = 0
               }
-              // item.planLotNumber = item.orderNumber()
               if(item.manualYarnFlag == 0){
                  this.manualYarnDisabled = true
               }else {

+ 8 - 2
src/views/packing-list/packinglist-fabrics/referShipDetailsModal.vue

@@ -118,6 +118,7 @@ export default {
     return {
       headers: {},
       config:null,
+      fatherFactory:'',
       selectedRowKeys: [], // 勾选航
       selectedRows:[],
       loading: false, // 表格加载
@@ -374,10 +375,11 @@ export default {
       } else{
         this.$emit('callback', this.selectedRows);
         this.referShipDetailsModVis = false;
-        var msg = "选中记录后,会清除编辑的内容。";
-        this.$message.info(msg);        
+        // var msg = "选中记录后,会清除编辑的内容。";
+        // this.$message.info(msg);        
         this.selectedRowKeys = [];
         this.selectedRows = []
+        this.fatherFactory = ''
       }
     },
     close() {
@@ -401,6 +403,10 @@ export default {
         this.$message.info('必须选择相同成衣工厂,请重新选择!');        
         this.selectedRowKeys = []
         this.selectedRows = []
+      }else if(this.fatherFactory!=='' && garmentFactoryArr[0] !== this.fatherFactory){
+         this.$message.info('必须与已有列表成衣工厂相同,请重新选择!');        
+        this.selectedRowKeys = []
+        this.selectedRows = []
       }else{
         this.selectedRowKeys = keys
         this.selectedRows = rows