lilei 3 年 前
コミット
099361b62c

+ 14 - 6
src/views/salesManagement/salesReturn/queryPart.vue

@@ -84,13 +84,13 @@ export default {
   name: 'QueryPart',
   components: { STable, VSelect, rangeDate },
   props: {
-    buyerSn: {
-      type: [Number, String],
-      default: ''
-    },
+    // buyerSn: {
+    //   type: [Number, String],
+    //   default: ''
+    // },
     newLoading: Boolean,
-    grabFlag: [Number, String],
-    priceType: [Number, String]
+    grabFlag: [Number, String]
+    // priceType: [Number, String]
   },
   data () {
     return {
@@ -102,6 +102,8 @@ export default {
         productName: '', // 产品名称
         productCode: '' //  产品编码
       },
+      buyerSn: '',
+      priceType: '',
       disabled: false, //  查询、重置按钮是否可操作
       columns: [],
       // 加载数据方法 必须为 Promise 对象
@@ -191,6 +193,12 @@ export default {
       this.queryParam.productCode = ''
       this.$refs.table.refresh(true)
     },
+    pageInit (buyerSn, priceType) {
+      console.log(buyerSn, priceType)
+      this.buyerSn = buyerSn
+      this.priceType = priceType
+      this.resetSearchForm()
+    },
     refreshData () {
       if (this.listData.length > 0) {
         this.$refs.table.refresh(true)

+ 1 - 3
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -28,8 +28,6 @@
         <!-- 查询配件列表 -->
         <queryPart
           ref="queryPart"
-          :buyerSn="$route.params.buyerSn"
-          :priceType="ordeDetail&&ordeDetail.priceType||''"
           grabFlag="0"
           :newLoading="isInster"
           @add="saveProduct"></queryPart>
@@ -375,6 +373,7 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
       })
     },
     // 打折
@@ -558,7 +557,6 @@ export default {
       this.getWarehouseCascade()
       if (!this.disabled) {
         this.resetForm()
-        this.$refs.queryPart.resetSearchForm()
       }
     }
   },

+ 2 - 2
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -26,7 +26,7 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- 查询配件列表 -->
-        <queryPart ref="queryPart" :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
+        <queryPart ref="queryPart" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
@@ -360,6 +360,7 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
       })
     },
     // 打折
@@ -544,7 +545,6 @@ export default {
       this.getWarehouseCascade()
       if (!this.disabled) {
         this.resetForm()
-        this.$refs.queryPart.resetSearchForm()
       }
     }
   },