chenrui hai 6 meses
pai
achega
a1e75c05f1

+ 18 - 30
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -328,33 +328,6 @@ export default {
     showThreeStock () {
       this.showStockCol = true
     },
-    // 有发货经销商时,查询
-    reSearchTable () {
-      // 查询参数
-      const params = {
-        salesBillSn: this.salesBillSn,
-        showStock: this.showStock,
-        warehouseSn: this.warehouseSn,
-        promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
-      }
-      salesDetailAllList(params).then(res => {
-        if (res.status == 200) {
-          res.data.forEach(item => {
-            this.chooseList.forEach(con => {
-              if (con.id === item.id) {
-                item.transferDealerStockQty = con.transferDealerStockQty
-              }
-            })
-          })
-          if (this.transferQty || this.transferQty == 0) {
-            res.data = res.data.filter(item => {
-              return item.transferDealerStockQty == this.transferQty
-            })
-          }
-          this.dataSource = res.data
-        }
-      })
-    },
     // 查询表格数据
     async searchTable () {
       this.dataSource = []
@@ -425,9 +398,24 @@ export default {
           }
         }
       }
-      // 赋值
-      this.dataSource = listData
-
+      // 发货经销商时 查询
+      if (this.chooseList && this.chooseList.length) {
+        this.dataSource = this.chooseList
+        if (this.transferQty) {
+          this.dataSource = listData.filter(item => {
+            if (this.transferQty == '0') { // 不满足
+              return item.transferDealerStockQty <= 0
+            } else if (this.transferQty == '1') { // 满足
+              return item.transferDealerStockQty > 0
+            } else { // 未入库
+              return item.transferDealerStockQty == '--'
+            }
+          })
+        }
+      } else {
+        // 赋值
+        this.dataSource = listData
+      }
       // 格式化数据
       let f = 0
       let str = ''

+ 3 - 6
src/views/salesManagement/salesQueryNew/detail.vue

@@ -129,7 +129,7 @@
                   <a-col flex="260px" v-if="$route.params.pageType!='salesNewDetailAudit'">
                     <a-form-item label="发货经销商库存">
                       <v-select
-                        code="SALES_BILL_ORDER_TYPE"
+                        code="STOCK_LABEL"
                         id="purchaseOrder-basicInfo-transferQty"
                         v-model="transferQty"
                         allowClear
@@ -434,6 +434,7 @@ export default {
     //  重置
     resetSearchForm () {
       this.warehouseSn = undefined
+      this.transferQty = undefined
       this.promoFlag = undefined
       setTimeout(() => {
         this.searchTable()
@@ -441,11 +442,7 @@ export default {
     },
     // 查询数据
     searchTable () {
-      if (this.chooseDealerList && this.chooseDealerList.length) {
-        this.$refs.productList.reSearchTable()
-      } else {
-        this.$refs.productList.searchTable()
-      }
+     this.$refs.productList.searchTable()
     },
     // 查询第三方库存
     getThreeStock () {