Преглед изворни кода

(Voucher Management) Set charger type selection to allow both
https://dev.wormwood.com.sg/zentao/task-view-310.html

(Voucher Management) Manual issue does not require
https://dev.wormwood.com.sg/zentao/task-view-311.html

vbea пре 1 година
родитељ
комит
f600885245
2 измењених фајлова са 21 додато и 5 уклоњено
  1. 0 3
      Strides-Admin/src/api/apiBase.js
  2. 21 2
      Strides-Admin/src/views/voucher/detail.vue

+ 0 - 3
Strides-Admin/src/api/apiBase.js

@@ -22,9 +22,6 @@ const apiBase = {
   getUserOptions(data) {
     return get(prefix + "user-select", data)
   },
-  getUserTypeOptions() {
-    return get(prefix + "user-type-select")
-  },
   getCountryList() {
     return get(prefix + "country-select")
   }

+ 21 - 2
Strides-Admin/src/views/voucher/detail.vue

@@ -81,7 +81,8 @@
           <el-form-item
             label="Points Value:"
             prop="purchasePoints"
-            class="flex1">
+            class="flex1"
+            v-if="form.redemptionMethod != 'Manual Issue'">
             <el-input
               class="add-text"
               v-model="form.purchasePoints"
@@ -90,6 +91,14 @@
               max="999999"
               maxlength="6"/>
           </el-form-item>
+          <el-form-item
+            label="Points Value:"
+            class="flex1"
+            v-else>
+            <el-input
+              class="add-text"
+              disabled/>
+          </el-form-item>
         </div>
         <div class="flexr">
           <el-form-item
@@ -283,6 +292,7 @@
 import api from '../../http/api/voucher.js';
 import site from '../../http/api/site'
 import settings from '../../settings.js'
+import apiBase from '@/api/apiBase.js';
 export default {
   data() {
     return {
@@ -370,6 +380,11 @@ export default {
           trigger: "change",
           message: "Please select country"
         },
+        chargeType: {
+          required: true,
+          trigger: "change",
+          message: "Please select charge type"
+        },
         sitePks: {
           required: true,
           trigger: "change",
@@ -447,6 +462,7 @@ export default {
         this.options.country = []
       }).finally(() => {
         this.getWeekOptions();
+        this.getChargeTypeOptions();
         this.getRedemTypeOptions();
         this.getVoucherTypeOptions();
         this.getAllSite();
@@ -519,7 +535,7 @@ export default {
       });
     },
     getChargeTypeOptions() {
-      site.getChargeTypeList().then(res => {
+      apiBase.getChargerTypeOptions().then(res => {
         if (res.data) {
           this.options.charge = res.data
         } else {
@@ -606,6 +622,9 @@ export default {
             this.form.timePeriodStart = this.form.timePeriod[0]
             this.form.timePeriodEnd = this.form.timePeriod[1]
           }
+          if (this.form.redemptionMethod == 'Manual Issue') {
+            this.form.purchasePoints = "";
+          }
           this.isEdit ? this.updateVoucher() : this.createVoucher();
         }
       });