ソースを参照

创建盲票优惠券新增使用范围

DELL 3 年 前
コミット
f2d0206f94
1 ファイル変更7 行追加3 行削除
  1. 7 3
      src/views/business/coupon/add.vue

+ 7 - 3
src/views/business/coupon/add.vue

@@ -61,7 +61,9 @@
           <el-form-item v-else label="使用范围:" prop="useArea">
             <el-radio-group v-model="addData.useArea" :disabled="readonly">
               <el-radio :label="0">所有盲票</el-radio>
-              <!-- <el-radio :label="1">指定盲票</el-radio> -->
+              <el-radio :label="3">线上盲票</el-radio>
+              <el-radio :label="4">线下盲票</el-radio>
+              <el-radio :label="1">指定盲票</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-form>
@@ -113,6 +115,7 @@ import SelectTicket from './components/selectTicket'
 import { publicFileGetUrl } from '@/api/common'
 import { getCouponDetail, addCoupon } from '@/api/business/coupon'
 import { accDiv, accMul } from '@/utils/util'
+import {addData} from "../../../api/system/dict/data";
 export default {
   name: 'CouponAdd',
   components: {
@@ -126,7 +129,7 @@ export default {
       readonly: this.$route.name === 'View',
       addData: {
         ticketBoxList:[],
-        useArea: 2,
+        useArea: 5,
         dueDays: 90,
         type: 2
       },
@@ -176,7 +179,7 @@ export default {
   methods: {
     update() {
       if (this.addData.type == 1) {
-        if(this.addData.useArea !== 0) {
+        if(this.addData.useArea !== 0 && this.addData.useArea !== 1 && this.addData.useArea !== 2) {
           this.$message({
             message: '请选择使用范围!',
             type: 'warning'
@@ -197,6 +200,7 @@ export default {
           this.addIng = true
           if(this.addData.useArea === 1) {
             this.addData.boxIds = this.addData.ticketBoxList.map(item => { return item.boxId }).toString()
+            console.log(this.addData)
           }
           const { discount, minOrderAmt, ...rest } = this.addData
           addCoupon({...rest, ...{ discount: accMul(discount, 100), minOrderAmt: accMul(minOrderAmt, 100),}}).then(res => {