chenrui 1 anno fa
parent
commit
f6bebaad6c
1 ha cambiato i file con 17 aggiunte e 17 eliminazioni
  1. 17 17
      src/views/salesReturnManagement/custConfirm/setPriceModal.vue

+ 17 - 17
src/views/salesReturnManagement/custConfirm/setPriceModal.vue

@@ -154,21 +154,21 @@ export default {
             return item.productEntity.code.indexOf(this.queryParam.productCode) >= 0 &&
             item.productEntity.name.indexOf(this.queryParam.productName) >= 0
           })
-          let arr  = ret.map(con=>{return con.salesReturnDetailSn})
-          if(arr &&arr.length>0){
-            if(this.salesBillSnList && this.salesBillSnList.length>0){
-              this.salesBillSnList.forEach(item=>{
-                let pot = arr.indexOf(item.salesReturnDetailSn)
-                if(pot!=-1){
-                  if(item.price ||item.price==0){
-                     ret[pot].price = item.price
+          const arr = ret.map(con => { return con.salesReturnDetailSn })
+          if (arr && arr.length > 0) {
+            if (this.salesBillSnList && this.salesBillSnList.length > 0) {
+              this.salesBillSnList.forEach(item => {
+                const pot = arr.indexOf(item.salesReturnDetailSn)
+                if (pot != -1) {
+                  if (item.price || item.price == 0) {
+                    ret[pot].price = item.price
                   }
-                  ret[pot].priceRemark = '抓单('+this.form.salesBillNo+')'   
+                  ret[pot].priceRemark = '抓单(' + this.form.salesBillNo + ')'
                 }
               })
             }
           }
-          
+
           res({
             list: ret,
             count: ret.length
@@ -180,7 +180,7 @@ export default {
       listInfo: null,
       noShowBillSnList: null,
       salesBillSnList: [],
-      salesBillFlag:false //抓单按钮
+      salesBillFlag: false // 抓单按钮
     }
   },
   methods: {
@@ -210,17 +210,18 @@ export default {
         productList: productArr
       }
       grabSalesBill(objInfo).then(res => {
-        if(res.status == 200){
+        if (res.status == 200) {
           const newList = res.data
           const _this = this
           _this.salesBillFlag = true
           if (newList && newList.length > 0) {
             const flag = newList.some(item => Object.keys(item).length > 2)
             if (flag) {
-              this.listInfo = newList.filter(con => Object.keys(con).length > 2)
-              this.openGrabOrderModal =this.isShow?true:false
+              _this.listInfo = newList.filter(con => Object.keys(con).length > 2)
+              _this.openGrabOrderModal = !!_this.isShow
               const noShowList = newList.filter(con => Object.keys(con).length <= 2)
-              this.noShowBillSnList = _this.getNewSalesBillList(noShowList)
+              _this.noShowBillSnList = _this.getNewSalesBillList(noShowList)
+              _this.salesBillSnList = _this.noShowBillSnList ? _this.noShowBillSnList : []
             } else {
               const resultVal = _this.getNewSalesBillList(newList)
               this.salesBillSnList = resultVal
@@ -289,7 +290,6 @@ export default {
         })
         this.form.salesReturnBillDetailList = snList
       }
-
       const params = Object.assign(this.form)
       this.disabled = true
       this.spinning = true
@@ -314,7 +314,6 @@ export default {
     },
     // 取消
     handleCommonCancel () {
-      this.salesBillFlag=false
       this.$emit('cancel')
     },
     // 查询
@@ -347,6 +346,7 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
+        this.salesBillFlag = false
         this.salesBillSnList = null
         this.handleCommonCancel()
       } else {