Browse Source

新增优惠劵

Joe 4 years ago
parent
commit
240ab6e6dc

+ 8 - 6
src/components/SelectDay/index.vue

@@ -62,10 +62,7 @@ export default {
   name: "SelectDay",
   data() {
     return {
-      // type: 3,
       updateForm: {},
-      // collectClickDay: [],
-      // collectClickCalendar: [],
       timeSelect: [
         ,
         ["周天", "周一", "周二", "周三", "周四", "周五", "周六"],
@@ -120,7 +117,10 @@ export default {
     // },
     type: {
       required: true,
-      type: Number
+      type: String,
+      default() {
+        return "0"
+      }
     },
     pageSizes: {
       type: Array,
@@ -168,7 +168,8 @@ export default {
         if(val == null ){
           val = []
         }
-        console.log(val)
+        val = [...val]
+        console.log(val);
         this.$emit("update:day", val);
       },
     },
@@ -184,7 +185,8 @@ export default {
         if( val == null ){
           val = []
         }
-        console.log(val)
+        val = [...val]
+        console.log(val);
         this.$emit("update:cycle", val);
       },
     },

+ 33 - 11
src/views/coupon/Coupon_CreateCoupon.vue

@@ -309,11 +309,25 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item
-          label="此优惠券可用时间控制"
-          prop="isMarketFlag"
+          label="有效期内可用时间控制"
+          prop="isMarketFlag2"
           v-if="createForm.couponType == 1 || createForm.couponType == 2"
         >
-
+          <el-radio-group v-model="createForm.availableControl" @change="availableControlChange">
+            <el-radio label="0">有效期内一直都可用</el-radio>
+            <el-radio label="1">有效期内每周指定日</el-radio>
+            <el-radio label="2">有效期内每月指定日</el-radio>
+            <el-radio label="3">有效期内固定指定日</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          label="可用时间选择"
+          prop="isMarketFlag1"
+          v-if="createForm.availableControl == 1 || createForm.availableControl == 2 || createForm.availableControl == 3"
+        >
+          <div>
+            <select-day :type="createForm.availableControl" :day.sync="createForm.appointedDaysList" :cycle.sync="createForm.cycleDaysList"></select-day>
+          </div>
         </el-form-item>
         <el-form-item
           label="优惠券的核销方"
@@ -429,6 +443,7 @@ import {
 } from "@/api/station/manage";
 import { listGun } from "@/api/station/gun";
 import { listPrice } from "@/api/station/price";
+import SelectDay from "@/components/SelectDay";
 
 import { addInfo, verificationList, listInfo, updateInfo, changeCouponStatus } from "@/api/coupon";
 import { updateDept } from "@/api/system/dept";
@@ -461,19 +476,18 @@ export default {
         isCardFlag: "1",
         isGradeFlag: "1",
         isMarketFlag: "1",
+        availableControl:"0",
+        appointedDaysList:[], 
+        cycleDaysList:[]
+
       },
       couponList: [],
       oilNameList: [],
       allVerificationList: [
       ],
-      equipmentList: [],
-      // 油枪复选
-      allGunList: [],
-      // 已选的油枪
-      checkedGunList: [],
-      //设备状态
-      deviceStatusOptions: [],
-      //设备类型
+      day:[],
+      cycle:[],
+
       deviceTypeOptions: [],
       stationOptions: [],
       // 弹出层标题
@@ -530,7 +544,15 @@ export default {
       return;
     },
   },
+  components: {
+    'SelectDay': SelectDay
+  },
   methods: {
+    availableControlChange(){
+      this.createForm.appointedDaysList = [];
+      this.createForm.cycleDaysList = [];
+      this.createForm = {...this.createForm}
+    },
     handleMoveLabel(direction, row){
       console.log(row)
       if(this.createForm.verificationList == null) {

+ 0 - 1
src/views/coupon/Coupon_CreateGetWay.vue

@@ -427,7 +427,6 @@ export default {
       couponEnabledFlag: "1",
       
       pageStatus: 4,
-      // 油站设备管理表格数据
       createForm: {
         issueType:'1',
         discountThresholdAmt:0,