Browse Source

添加盲票商品规则调整

lsx 2 years ago
parent
commit
16d52e4f2a

+ 2 - 2
src/views/business/ticket/components/AwardForm.vue

@@ -44,7 +44,7 @@
           </el-table-column>
 
           <el-table-column label="操作" align="center">
-            <template slot-scope="scope">
+            <template>
               <el-button
                 size="mini"
                 type="text"
@@ -64,7 +64,7 @@
             添加商品<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="goods">商品</el-dropdown-item>
+            <el-dropdown-item command="ticketGoods">商品</el-dropdown-item>
             <el-dropdown-item command="coupon">券</el-dropdown-item>
             <el-dropdown-item command="coupon_pkg">券包</el-dropdown-item>
 <!--            <el-dropdown-item command="coin">盲豆</el-dropdown-item>-->

+ 16 - 10
src/views/business/ticket/components/GoodsAdd.vue

@@ -137,6 +137,10 @@ export default {
       type: String,
       default: '',
     },
+    ticket : {
+      type: String,
+      default: '',
+    }
   },
   data() {
     return {
@@ -161,15 +165,8 @@ export default {
     getGoodsList() {
       this.loading = true;
 
-      getGoodsList(
-        "pageNum=" +
-        this.pageParams.pageNum +
-        "&pageSize=" +
-        this.pageParams.pageSize +
-        "&",
-        {
+      let data = {
           title: this.goodsTitle,
-          exchangeShow: 2,
           status: "on",
           minValue: this.queryParams.minValue ? accMul(this.queryParams.minValue, 100) : this.queryParams.minValue,
           maxValue: this.queryParams.maxValue ? accMul(this.queryParams.maxValue, 100) : this.queryParams.maxValue,
@@ -177,8 +174,17 @@ export default {
           maxExchange:this.queryParams.maxExchange,
           minCost: this.queryParams.minCost ? accMul(this.queryParams.minCost, 100) : this.queryParams.minCost,
           maxCost: this.queryParams.maxCost ? accMul(this.queryParams.maxCost, 100) : this.queryParams.maxCost,
-        }
-      ).then((res) => {
+      }
+      if(this.ticket == "ticketGoods") {
+        data.exchangeShow = 2
+      }
+
+      getGoodsList(
+        "pageNum=" +
+        this.pageParams.pageNum +
+        "&pageSize=" +
+        this.pageParams.pageSize +
+        "&",data).then((res) => {
         this.goodsList = res.rows.map((item) => {
           return {
             ...item,

+ 11 - 1
src/views/business/ticket/create.vue

@@ -176,7 +176,9 @@
     </div>
 
     <!-- 添加商品 -->
-    <goods-add :dialog-visible="goodsTableVisible" @close="close" :iconic="iconic" @confirmGoodsForm="confirmGoodsForm" @confirmGoods="confirmGoods" v-if="goodsTableVisible" />
+    <goods-add :dialog-visible="goodsTableVisible" @close="close" ticket="goods" :iconic="iconic" @confirmGoodsForm="confirmGoodsForm" @confirmGoods="confirmGoods" v-if="goodsTableVisible" />
+    <!-- 添加盲票商品 -->
+    <goods-add :dialog-visible="goodsTableVisible2" @close="close" ticket="ticketGoods" :iconic="iconic" @confirmGoodsForm="confirmGoodsForm" @confirmGoods="confirmGoods" v-if="goodsTableVisible2" />
     <!-- 添加券 -->
     <coupon-add :dialog-visible="couponTableVisible" :iconic="iconic" @close="close" @confirmCouponForm="confirmCouponForm" @confirmCoupon="confirmCoupon" v-if="couponTableVisible" />
     <!-- 添加券包 -->
@@ -326,6 +328,7 @@ export default {
       //关联商品列表
       goodsList: [],
       goodsTableVisible: false, // 添加商品弹框
+      goodsTableVisible2: false, // 添加盲票商品弹框
       couponTitle: "", // 券名称
       couponTableVisible: false, // 添加卡券弹框
       couponPkgTableVisible: false, // 添加券包弹框
@@ -545,6 +548,7 @@ export default {
     // 关闭弹框
     close() {
       this.goodsTableVisible = false;
+      this.goodsTableVisible2 = false;
       this.couponTableVisible = false;
       this.couponPkgTableVisible = false;
       this.coinTableVisible = false;
@@ -567,6 +571,9 @@ export default {
         this.couponPkgTableVisible = true;
       } else if (e == "coin") {
         this.coinTableVisible = true;
+      }else if(e == "ticketGoods") {
+        this.iconic = 'goods'
+        this.goodsTableVisible2 = true;
       }
     },
     goodsCommand(e) {
@@ -579,6 +586,9 @@ export default {
       } else if (e == "coupon_pkg") {
         this.iconic = 'couponPkgForm'
         this.couponPkgTableVisible = true;
+      }else if (e == "ticketGoods") {
+        this.iconic = 'goodsForm'
+        this.goodsTableVisible2 = true;
       }
     },
     // 确认选中商品