lsx 2 anos atrás
pai
commit
66fa0253af
1 arquivos alterados com 6 adições e 4 exclusões
  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 || [];