Browse Source

Merge branch 'dev' of mangpiao/mp-ui-pc into test

lsx 2 years ago
parent
commit
7846bff66f
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/views/business/goods/add.vue

+ 6 - 4
src/views/business/goods/add.vue

@@ -373,7 +373,6 @@ export default {
     this.getGoodsCategoryItems()
     this.getSupplierItems()
     this.getGoodsTagItems()
-    this.getCouponList()
     if (this.id) {
       getGoodsDetail(this.id).then(res => {
         const {
@@ -436,7 +435,10 @@ export default {
             this.$refs.spec.setSkuList(skuList)
           })
         }
+        this.getCouponList(refId)
       })
+    }else {
+      this.getCouponList()
     }
   },
   methods: {
@@ -458,14 +460,14 @@ export default {
       }
     },
     // 获取采购优惠券下拉列表
-    getCouponList() {
+    getCouponList(refId) {
       let data = {
         type: 4,
         status: "on",
         isExcludePurchaseCoupon: true,
       }
-      if(this.addData.goodsId) {
-        data.couponId = this.addData.refId
+      if(refId) {
+        data.couponId = refId
       }
       getCouponAllList(data).then(response => {
         this.CouponList = response.rows || [];