Quellcode durchsuchen

购买获取的优惠券下发方式只能为医院运营

lighter vor 11 Monaten
Ursprung
Commit
c349997e89
1 geänderte Dateien mit 17 neuen und 2 gelöschten Zeilen
  1. 17 2
      src/views/clinic/CouponManage.vue

+ 17 - 2
src/views/clinic/CouponManage.vue

@@ -231,7 +231,11 @@
     <div class="edit-coupon-line">
       <div class="edit-coupon-line_label"><span class="required">*</span>用户获取:</div>
       <div>
-        <el-select v-model="newCoupon.gainWay" style="width: 180px">
+        <el-select
+            v-model="newCoupon.gainWay"
+            @change="onGainWayChange"
+            style="width: 180px"
+        >
           <el-option label="免费获取" value="FREE"></el-option>
           <el-option label="购买获取" value="PURCHASE"></el-option>
         </el-select>
@@ -296,7 +300,11 @@
     <div class="edit-coupon-line">
       <div class="edit-coupon-line_label"><span class="required">*</span>下发方式:</div>
       <div>
-        <el-select v-model="newCoupon.type" style="width: 180px">
+        <el-select
+            v-model="newCoupon.type"
+            style="width: 180px"
+            :disabled="newCoupon.gainWay === 'PURCHASE'"
+        >
           <el-option label="系统赠送" value="SYSTEM_PROVIDE"></el-option>
           <el-option label="医院运营" value="SALESMAN_OPERATION"></el-option>
         </el-select>
@@ -362,6 +370,13 @@ function createNewCoupon() {
     availableChargeName: ''
   }
 }
+
+function onGainWayChange(val) {
+  if (val === 'PURCHASE') {
+    newCoupon.value.type = 'SALESMAN_OPERATION'
+  }
+}
+
 function saveNewCoupon() {
   insertNewCoupon(newCoupon.value).then(res => {
     xcMessage.success(res)