Browse Source

新建优惠劵(差日期翻译)

Joe 4 years ago
parent
commit
081edbb415
2 changed files with 73 additions and 23 deletions
  1. 60 16
      src/views/coupon/Coupon_CreateCoupon.vue
  2. 13 7
      src/views/coupon/Coupon_CreateIssue.vue

+ 60 - 16
src/views/coupon/Coupon_CreateCoupon.vue

@@ -71,7 +71,54 @@
       </el-form>
       <el-table :data="couponList">
         <af-table-column label="优惠券名称" align="center" prop="couponName" />
-        <af-table-column label="状态" align="center" width="100">
+        <af-table-column label="卡片类型" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 ? '现金劵' + '--面值:' + scope.row.couponAmt + '元' : ''}}
+          {{scope.row.couponType == 2 ? '折扣券' + '--折扣:' + scope.row.couponAmt + '% ' : ''}}
+          {{scope.row.couponType == 3 ? '兑换券' + '--商品:' + scope.row.couponDetails  : ''}}
+          </template>
+        </af-table-column>
+        <af-table-column label="使用门槛" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?  (scope.row.couponThresholdAmt == 0 ? '无门槛':'满' + scope.row.couponThresholdAmt + '元可用') : ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+        <af-table-column label="适用油品" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?  ((scope.row.oilNameList||[]).toString()) : ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="使用状态" align="center">
+          <template slot-scope="scope">
+          {{"共生成了" + scope.row.couponNum + "张,已领取" + scope.row.couponCumulativeNum + '张,已使用'+ scope.row.couponUseNum +'张' }}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="有效期和限制" align="center">
+          <template slot-scope="scope">
+          {{ (scope.row.effectiveTimeType == 1 ? scope.row.effectiveTime[0] + '到' + scope.row.effectiveTime[1]   : '用户领取'+ scope.row.effectiveDayNum +'天内有效' ) + '内有效'}}
+          {{ ',且用户只能在1号领取'}}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="领取限制" align="center">
+          <template slot-scope="scope">
+          {{ "单用户最多持有" + scope.row.couponHoldNum + '张,累计可拥有'+ scope.row.couponReceiveNum +'张' }}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="优惠叠加" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?   ['不',''][scope.row.isCardFlag] + '可用电子卡,' + ['不',''][scope.row.isGradeFlag] + '可用等级优惠,' + ['不',''][scope.row.isMarketFlag] + '可用优惠方案': ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+
+        
+        <af-table-column label="状态" align="center">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.status"
@@ -81,8 +128,6 @@
             ></el-switch>
           </template>
         </af-table-column>
-        <!-- <af-table-column label="面值" align="center" prop="gunNo" /> -->
-        <!-- <af-table-column label="有效期" align="center" prop="deviceFactory" /> -->
         <af-table-column
           label="操作"
           align="center"
@@ -98,13 +143,6 @@
               v-if="scope.row.editFlag"
               >修改</el-button
             >
-            <!-- <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="handleDelete(scope.row)"
-              >删除</el-button
-            > -->
           </template>
         </af-table-column>
       </el-table>
@@ -259,7 +297,7 @@
         </el-form-item>
         <el-form-item label="单人可持有数量" prop="couponHoldNum">
-          单个用户最多
+          单个用户最多
           <input
             type="text"
             class="form-control d-inline"
@@ -528,16 +566,22 @@ export default {
         }
         return !!!this.createForm.verificationList.includes(ele.deptId);
       });
-    },
-    getTodayDateString() {
-      const today = new Date();
-      return;
-    },
+    },    
   },
   components: {
     'SelectDay': SelectDay
   },
   methods: {
+    getTodayDateString(){
+      const date = new Date()
+      let y = date.getFullYear();
+      let m = date.getMonth().toString();
+      let s = date.getDate().toString();
+      m = '' + (m.length == 1 ? '0':'') + m
+      s = '' + (s.length == 1 ? '0':'') + s
+      console.log('' + h + ':' + m +':' + s)
+      return '' + y + ':' + m +':' + s
+    },
     availableControlChange(){
       this.createForm.appointedDaysList = [];
       this.createForm.cycleDaysList = [];

+ 13 - 7
src/views/coupon/Coupon_CreateIssue.vue

@@ -134,8 +134,8 @@
             
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="展示位选择" prop="showId" v-if="createForm.issueType==2">
-          <el-checkbox-group v-model="createForm.showId">
+        <el-form-item label="展示位选择" prop="showIdList" v-if="createForm.issueType==2">
+          <el-checkbox-group v-model="createForm.showIdList">
             <div>
               <el-checkbox label="1">支付成功后的展示位</el-checkbox>
               <el-checkbox label="2" disabled>待定</el-checkbox>
@@ -330,7 +330,7 @@ export default {
       pageStatus: 4,
       createForm: {
         issueName:'',
-        showId: [],
+        showIdList: [],
         availableControl: "0",
         appointedDaysList: [],
         cycleDaysList: [],
@@ -407,10 +407,16 @@ export default {
         return !!!this.createForm.couponIssueRelationList.includes(ele.id);
       });
     },
-    getTodayDateString() {
-      const today = new Date();
-      return;
-    },
+    getTodayDateString(){
+      const date = new Date()
+      let y = date.getFullYear();
+      let m = date.getMonth().toString();
+      let s = date.getDate().toString();
+      m = '' + (m.length == 1 ? '0':'') + m
+      s = '' + (s.length == 1 ? '0':'') + s
+      console.log('' + h + ':' + m +':' + s)
+      return '' + y + ':' + m +':' + s
+    }
   },
   methods: {
     getIssueList(){