Browse Source

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 years ago
parent
commit
c9117a41d9

+ 8 - 0
src/components/procurement/market.vue

@@ -39,6 +39,9 @@
       systemType: {
         type: String
       },
+      marketParams:{  //进口查询参数
+        type: Object
+      }
     },
     data(){
       return {
@@ -108,6 +111,11 @@
           this.$delete(params,'marketDate')
         }
         if (this.systemType == 'JK') {
+          // if(this.marketParams){
+          //   params = {
+          //     ...this.marketParams
+          //   }
+          // }
           getMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
             this.data = res.data.data.records
             this.page.total = res.data.data.total

+ 96 - 33
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -213,7 +213,7 @@
                          icon="el-icon-plus"
                          size="small"
                          :disabled="goodsDisable"
-                         @click="marketDialog = true"
+                         @click="openMarketDialog"
               >导入明细
               </el-button>
             </template>
@@ -245,6 +245,7 @@
       :close-on-press-escape="false"
       v-dialog-drag>
       <market-detail
+        :marketParams="marketParams"
         @closeFun="!marketDialog"
         @importMarket="importMarket"
         @close="closeMarkeDialog"
@@ -294,6 +295,7 @@ export default {
       marketDialog: false,
       customerContact: customerContact,
       contactsForm: {},
+      marketParams:{},
       contactsData: [],
       currencyDic:[],
       storageIdDic: [],
@@ -524,11 +526,23 @@ export default {
           } else {
             item.actualQuantity = item.orderQuantity;
           }
-
-          //查询库存
-          getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
-            this.creditList = res.data
-          })
+          // this.checkCntrNoList(item)
+            getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
+              this.creditList = res.data
+              this.storageList = this.creditList.map(item =>{
+                let params ={
+                  storageId:item.storageId,
+                  stockName:item.stockName
+                }
+                return params
+              })
+              this.cntrNoList = this.creditList.map(item =>{
+                let params ={
+                  cntrNo:item.cntrNo,
+                }
+                return params
+              })
+            })
           delete item.orderQuantity
           delete item.id
         })
@@ -594,39 +608,58 @@ export default {
     //提单号带出合同号
     bingOut(row) {
       getListOrgOrderNo(row.billNo,this.form.storageId).then(res => {
-        // if (res.data) {
-        //   this.contractDic = res.data;
-        //   row.contractNumber = res.data[0].orderNo
-        // }
+        if (res.data) {
+          this.contractDic = res.data;
+          row.contractNumber = res.data[0].orderNo
+        }
       }).catch(() => {
         row.contractNumber = ''
       })
       this.sumOrderNo(row);
       this.selectInventory(row)
     },
+    // //查询 箱号 仓库list
+    // checkCntrNoList(item){
+    //   getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
+    //     this.form.creditList = res.data
+    //     this.form.storageList = this.creditList.map(item =>{
+    //       let params ={
+    //         storageId:item.storageId,
+    //         stockName:item.stockName
+    //       }
+    //       return params
+    //     })
+    //     item.cntrNoList = this.creditList.map(item =>{
+    //       let params ={
+    //         cntrNo:item.cntrNo,
+    //       }
+    //       return params
+    //     })
+    //   })
+    // },
     //选择箱号  或者 仓库
-    selectCntrNoList(row){
-      if(row.cntrNo && !this.form.storageId){
-        this.storageList =   this.cntrNoList.map(item =>{
-          if(item.cntrNo == row.cntrNo){
-            let params = {
-              storageId:item.storageId,
-              stockName:item.stockName
+    selectCntrNoList(){
+      this.contactsData.forEach(item =>{
+        if(item.cntrNo && !this.form.storageId){
+          this.storageList =   this.creditList.map(i =>{
+            if(i.cntrNo == item.cntrNo){
+              let params = {
+                storageId:i.storageId,
+                stockName:i.stockName
+              }
+              return params
             }
-             return params
-          }
-        })
-      }else if(!row.cntrNo && this.form.storageId){
-        this.cntrNoList =   this.storageList.map(item =>{
-          if(item.storageId == row.storageId){
-            return item.cntrNo
-          }
-        })
-      }else{
-         this.selectInventory(row)
-      }
-      console.log(  this.storageList)
-      console.log(  this.cntrNoList)
+          })
+        }else if(!item.cntrNo && this.form.storageId){
+          this.cntrNoList =   this.creditList.map(i =>{
+            if(i.storageId == item.storageId){
+              return i.cntrNo
+            }
+          })
+        }else{
+          this.selectInventory(item)
+        }
+      })
     },
     //查询库存
     selectInventory(row) {
@@ -773,7 +806,17 @@ export default {
             confirmGoods(this.form).then(res => {
               if (res.data.success) {
                 this.$message.success("发货成功!")
-                this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
+                this.form = res.data.data;
+                this.oldForm = Object.assign({}, res.data.data);
+                this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false;
+                if (this.form.deliveryItemsList) {
+                  this.contactsData = this.form.deliveryItemsList
+                  this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
+                }
+                if (this.form.deliveryFilesList) {
+                  this.upLoadData = this.form.deliveryFilesList
+                  this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
+                }
               }
             })
           }).finally(() => {
@@ -790,7 +833,17 @@ export default {
             cancelGoods(this.form).then(res => {
               if (res.data.success) {
                 this.$message.success("撤销成功!")
-                this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
+                this.form = res.data.data;
+                this.oldForm = Object.assign({}, res.data.data);
+                this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false;
+                if (this.form.deliveryItemsList) {
+                  this.contactsData = this.form.deliveryItemsList
+                  this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
+                }
+                if (this.form.deliveryFilesList) {
+                  this.upLoadData = this.form.deliveryFilesList
+                  this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
+                }
               }
             })
           }).finally(() => {
@@ -853,6 +906,16 @@ export default {
         }
       });
     },
+    //打开导入销售
+    openMarketDialog(){
+      this.marketDialog = true
+      if(this.contactsData.length !=0){
+        this.marketParams = {
+          billNo:this.contactsData[0].billNo,
+          contractNumber:this.contactsData[0].contractNumber
+        }
+      }
+    },
     //上传文件保存
     upLoadSave(row, done, loading) {
       this.upLoadData.push(row)