Ver Fonte

套餐管理新增分期优惠券开关、月数、优惠券三个字段

xdd há 3 meses atrás
pai
commit
2d00c12a5f

+ 11 - 1
src/api/store/storeCouponIssue.js

@@ -1,5 +1,15 @@
 import request from '@/utils/request'
 
+
+// 查询可用套餐优惠券列表
+export function listAllAvailable(query) {
+  return request({
+    url: '/store/storeCouponIssue/listAllAvailable',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询优惠券领取列表
 export function listStoreCouponIssue(query) {
   return request({
@@ -50,4 +60,4 @@ export function exportStoreCouponIssue(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 59 - 12
src/views/store/storeProductPackage/index.vue

@@ -119,7 +119,7 @@
               <el-tag prop="payType" v-for="(item, index) in storePayTypeOptions"    v-if="scope.row.payType==item.dictValue">{{item.dictLabel}}</el-tag>
           </template>
       </el-table-column>
-    
+
       <el-table-column label="限购次数" align="center" prop="limitCount" />
       <el-table-column label="排序" align="center" prop="sort" />
       <!-- <el-table-column label="所属部门" align="center" prop="deptName" /> -->
@@ -262,7 +262,7 @@
                 </el-col>
               </el-row>
         </el-form-item>
-        
+
         <el-form-item label="原价" prop="money">
           <el-input-number v-model="form.money" :precision="2"  :min="0.00" placeholder="请输入原价" />
         </el-form-item>
@@ -285,6 +285,26 @@
                 <el-radio :label="item.dictValue" v-for="item in statusOptions" >{{item.dictLabel}}</el-radio>
               </el-radio-group>
         </el-form-item>
+        <el-form-item label="分期赠送优惠券" prop="icgEnable">
+          <el-radio-group v-model="icgEnableModel">
+            <el-radio :label="item.dictValue" v-for="item in icgEnableOptions" >{{item.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="优惠券" prop="icgCouponsId" v-if="form.icgEnable==1">
+          <el-select v-model="form.icgCouponsId" filterable multiple placeholder="请选择">
+            <el-option
+              v-for="item in icgCouponsOptions"
+              :key="item.couponId"
+              :label="item.couponName"
+              :value="item.couponId">
+              <span style="float: left">{{ item.couponName }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">id:{{item.id}},剩余{{ item.remainCount }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="发放月数" prop="icgMonth" v-if="form.icgEnable==1">
+          <el-input-number v-model="form.icgMonth" placeholder="月数"/>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -304,13 +324,14 @@ import Editor from '@/components/Editor/wang';
 import productAttrValueSelect from "../components/productAttrValueSelect";
 import Material from '@/components/Material'
 import singleImg from '@/components/Material/single'
+import {listAllAvailable} from "../../../api/store/storeCouponIssue";
 export default {
   name: "StoreProductPackage",
-  components: { 
+  components: {
     Editor,
     productAttrValueSelect,
     Material,
-    singleImg, 
+    singleImg,
   },
   watch: {
     imageArr: function(val) {
@@ -322,11 +343,13 @@ export default {
   },
   data() {
     return {
+      icgCouponsOptions:[],
       statusOptions:[],
       cateOptions:[],
       photoArr:[],
       imageArr:[],
       storePayTypeOptions:[],
+      icgEnableOptions: [],
       totalMoney:0.00,
       products:[],
       product:{
@@ -401,12 +424,12 @@ export default {
         limitCount: [
           { required: true, message: "限购次数不能为空" }
         ],
-        
+
       }
     };
   },
   created() {
-    
+
     this.getDicts("common_status").then((response) => {
       this.statusOptions = response.data;
     });
@@ -417,9 +440,30 @@ export default {
     this.getDicts("store_pay_type").then((response) => {
       this.storePayTypeOptions = response.data;
     });
+
+    this.getDicts('coupon_installment_switch').then(response=>{
+      this.icgEnableOptions = response.data;
+    })
     this.getList();
+
+    this.loadStoreCouponList();
+  },
+  computed:{
+    icgEnableModel: {
+      get(){
+        return this.form.icgEnable?.toString();
+      },
+      set(newVal){
+        this.form.icgEnable = newVal;
+      }
+    }
   },
   methods: {
+    loadStoreCouponList(){
+      listAllAvailable().then(response=>{
+        this.icgCouponsOptions=response.data;
+      })
+    },
     handleProductCountChange(row){
       row.money=row.count*row.price;
       this.$forceUpdate();
@@ -454,7 +498,7 @@ export default {
       // setTimeout(() => {
       //   this.$refs.product.getData(1);
       // }, 200);
-      
+
     },
     handleAvatarSuccess(res, file) {
         if(res.code==200){
@@ -505,7 +549,10 @@ export default {
         limitCount:0,
         cateId:"0",
         status:"1",
+        icgEnable: "0",
         productList:null,
+        icgCouponsId: [],
+        icgMonth: 0
       };
       this.products=[];
       this.photoArr=[];
@@ -536,7 +583,7 @@ export default {
       setTimeout(() => {
         this.$refs.myeditor.setText("");
       }, 200);
-     
+
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -589,7 +636,7 @@ export default {
               if (response.code === 200) {
                 this.msgSuccess("修改成功");
                 this.open = false;
-                this.getList(); 
+                this.getList();
               }
             });
           } else {
@@ -667,7 +714,7 @@ export default {
                       this.getList();
                     }
                 });
-           } 
+           }
          }
       });
 
@@ -694,7 +741,7 @@ export default {
     max-width: 200px;
     text-align: left;
     .goods-title{
-      
+
       overflow:hidden;
       white-space: nowrap;
       text-overflow: ellipsis;
@@ -702,4 +749,4 @@ export default {
     }
   }
 }
-</style>
+</style>