chenrui hace 4 años
padre
commit
ca2163a407

+ 4 - 10
src/views/CouponCenter/AddCouponModal.vue

@@ -66,7 +66,7 @@
                   满<a-input-number
                     v-model="form.limitAmount"
                     :disabled="takeCount > 0"
-                    :min="form.subAmount"
+                    :min="1"
                     :max="999999"
                     placeholder="限额数值"
                     class="input-number-ms" />元使用
@@ -85,7 +85,7 @@
                   <a-input-number
                     v-model="form.limitAmount"
                     :disabled="takeCount > 0"
-                    :min="form.subAmount"
+                    :min="1"
                     :max="999999"
                     placeholder="限额数值"
                     class="input-number-ls" />
@@ -304,7 +304,7 @@
     </a-form-model>
 
     <!-- 选择网点 -->
-    <choose-outlets :openOutletsModal="openOutletsModal" :storeList="form.couponStoreList" @choose="outletsChange" @close="closeChooseOutlets" />
+    <choose-outlets :openOutletsModal="openOutletsModal" :storeList="form.couponStoreList" @close="closeChooseOutlets" />
   </a-modal>
 </template>
 
@@ -417,13 +417,11 @@ export default {
     },
     //  有效期  固定日期  change
     validDateChange (date, dateString) {
-      console.log(date, dateString, this.form.timeRange)
       this.form.startTime = dateString[0]
       this.form.endTime = dateString[1]
     },
     //  保存
     onSubmit () {
-      console.log(this.form, '表单数据')
       this.$refs.ruleForms.validate(valid => {
         if (valid) {
           const formData = JSON.parse(JSON.stringify(this.form))
@@ -514,11 +512,6 @@ export default {
       }
       this.form.couponScopeList = data.scopeValueList //  适用洗车类型
       this.form.couponStoreList = data.couponStoreList //  适用洗车网点
-      console.log('------赋值后的表单', this.form)
-    },
-    // 选择网点  change
-    outletsChange (val) {
-      console.log(val)
     },
     // 获取适用洗车类型列表
     getItemQuery () {
@@ -570,6 +563,7 @@ export default {
       this.form.validType = 'NONE'
       this.form.scopeType = 'ITEM'
       this.isLimit = '0'
+      this.takeCount = ''
     }
   },
   watch: {

+ 0 - 1
src/views/CouponCenter/ChooseOutlets.vue

@@ -50,7 +50,6 @@ export default {
   methods: {
     //  查询
     onSearch (value) {
-      console.log(value)
       if (value) {
         this.getStoreQuery(value)
       } else {

+ 12 - 12
src/views/CouponCenter/CreateCoupons.vue

@@ -126,10 +126,10 @@ export default {
     //  删除
     del (row) {
       const _this = this
-      if (row.takeCount == 0) {
-        this.$confirm({
-          title: '数据删除后无法恢复, 确认删除吗?',
-          onOk: () => {
+      this.$confirm({
+        title: '数据删除后无法恢复, 确认删除吗?',
+        onOk: () => {
+          if (row.takeCount == 0) {
             couponDel({ 'id': row.id }).then(res => {
               if (res.status == 200) {
                 _this.$refs.table.refresh()
@@ -138,15 +138,15 @@ export default {
                 _this.$message.error(res.message)
               }
             })
-          },
-          onCancel: () => {
-            this.$message.info('取消删除')
+          } else if (row.takeCount > 0) {
+            // 废除优惠卷
+            _this.changeStatus(row, -1)
           }
-        })
-      } else if (row.takeCount > 0) {
-        // 废除优惠卷
-        this.changeStatus(row, -1)
-      }
+        },
+        onCancel: () => {
+          this.$message.info('取消删除')
+        }
+      })
     },
     // 启用停用
     changeStatus (row, flag) {

+ 25 - 12
src/views/CouponCenter/DetailsCouponModal.vue

@@ -1,5 +1,7 @@
 <template>
   <div class="DetailsCoupon">
+    <!-- 数据字典 -->
+    <v-select v-show="false" ref="couponType" placeholder="优惠券类型" code="COUPON_TYPE"></v-select>
     <a-modal
       class="DetailsCouponModal"
       title="查看详情"
@@ -8,10 +10,9 @@
       :destroyOnClose="true"
       @cancel="isShow=false"
       v-model="isShow">
-      <v-select v-show="false" ref="couponType" placeholder="优惠券类型" code="COUPON_TYPE"></v-select>
       <a-row :gutter="20" v-if="couponInfo">
         <a-col :span="24">
-          <div class="c-title">
+          <div class="c-title frist-t">
             基本信息
             <a-divider type="vertical" class="bold-divider" />
           </div>
@@ -58,16 +59,16 @@
           <p class="item-label">持卡会员:</p>
           <p class="item-main" v-if="couponInfo.cardholderCouponLimit.isLimit == '0'">不限</p>
           <p class="item-main" v-if="couponInfo.cardholderCouponLimit.isLimit == '1'">
-            <strong>{{ couponInfo.cardholderCouponLimit.limitCount }}</strong>份/每
-            <strong>{{ couponInfo.cardholderCouponLimit.limitCondition == 'monthly' ? '自然月' : '' }}</strong>
+            <strong>{{ couponInfo.cardholderCouponLimit.limitCondition == 'monthly' ? '自然月' : '' }}</strong>限制领取
+            <strong>{{ couponInfo.cardholderCouponLimit.limitCount }}</strong>
           </p>
         </a-col>
         <a-col :span="12" class="item-cont">
           <p class="item-label">未持卡会员:</p>
           <p class="item-main" v-if="couponInfo.normalCouponLimit.isLimit == '0'">不限</p>
           <p class="item-main" v-if="couponInfo.normalCouponLimit.isLimit == '1'">
-            <strong>{{ couponInfo.normalCouponLimit.limitCount }}</strong>份/每
-            <strong>{{ couponInfo.normalCouponLimit.limitCondition == 'monthly' ? '自然月' : '' }}</strong>
+            每<strong>{{ couponInfo.normalCouponLimit.limitCondition == 'monthly' ? '自然月' : '' }}</strong>限制领取
+            <strong>{{ couponInfo.normalCouponLimit.limitCount }}</strong>
           </p>
         </a-col>
         <a-col :span="12" class="item-cont">
@@ -78,9 +79,7 @@
             <strong>{{ couponInfo.startTimeGmt8Ymd }}</strong> ~
             <strong>{{ couponInfo.endTimeGmt8Ymd }}</strong>
           </p>
-          <p class="item-main" v-if="couponInfo.validType == 'RELATIVE'">
-            领取后<strong>{{ couponInfo.validDate }}</strong>天内有效
-          </p>
+          <p class="item-main" v-if="couponInfo.validType == 'RELATIVE'">{{ couponInfo.validDateStr }}</p>
         </a-col>
         <a-col :span="12" class="item-cont">
           <p class="item-label">适用洗车类型:</p>
@@ -89,7 +88,17 @@
           </p>
         </a-col>
         <a-col :span="12" class="item-cont">
-          <p class="item-label">适用洗车网点:</p>
+          <div class="item-label">
+            <a-tooltip
+              placement="right"
+              arrow-point-at-center
+              title="已设置的适用洗车网点再次修改(尤其是减少使用网点)后,在【优惠券统计】中会保留原适用洗车网点的统计数据。"
+            >
+              <span style="display: inline-block;">适用洗车网点</span>
+              <a-icon :style="{ fontSize: '17px', color: '#1890ff', verticalAlign: 'sub', display: 'inlineBlock', margin: '0 3px' }" type="question-circle" />
+              <span style="display: inline-block;">:</span>
+            </a-tooltip>
+          </div>
           <div class="item-main flex-sp">
             <strong>{{ couponInfo.isStoreLimit == '1' ? '部分' : '全部' }}</strong>
             <p v-if="couponInfo.isStoreLimit == '1'">
@@ -148,7 +157,7 @@ export default {
       couponFind({ id: id }).then(res => {
         if (res.status == 200) {
           this.couponInfo = res.data
-          this.couponInfo.couponTypeName = this.$refs.couponType.getNameByCode(this.couponInfo.couponType)
+          this.couponInfo.couponTypeName = this.$refs.couponType.getNameByCode(res.data.couponType)
         }
       })
     }
@@ -180,6 +189,7 @@ export default {
     }
     .c-title {
       padding: 0 0 10px;
+      margin-top: 40px;
       margin-bottom: 20px;
       border-bottom: 1px solid #e8e8e8;
       .bold-divider {
@@ -187,12 +197,15 @@ export default {
         background-color: #1890ff;
       }
     }
+    .frist-t{
+      margin-top: 20px;
+    }
     .item-cont{
       margin-bottom: 24px;
       display: flex;
       align-items: center;
       .item-label{
-        width: 115px;
+        width: 121px;
         font-size: 14px;
         color: rgba(0, 0, 0, 0.85);
         flex-shrink: 0;