Browse Source

bug 修复

lilei 4 years ago
parent
commit
1d1db14eff
1 changed files with 17 additions and 49 deletions
  1. 17 49
      src/views/market/addlotterySetModal.vue

+ 17 - 49
src/views/market/addlotterySetModal.vue

@@ -45,7 +45,7 @@
             <a-form-model-item ref="activeName" label="活动名称" prop="activeName">
               <a-input
                 id="addLottery-time"
-                :disabled="participantsNum>0||state==1"
+                :disabled="participantsNum>0||taskParticipantsNum>0||state==1"
                 v-model="form.activeName"
                 allowClear
                 :maxLength="15"
@@ -55,7 +55,7 @@
           <a-col :span="6">
             <a-form-model-item ref="time" label="活动时间" prop="time">
               <a-range-picker
-                :disabled="participantsNum>0||state==1"
+                :disabled="participantsNum>0||taskParticipantsNum>0||state==1"
                 id="addLottery-time"
                 v-model="form.time"
                 :disabledDate="disabledDate"
@@ -80,7 +80,7 @@
                 id="addLottery-cjRc"
                 style="width: 50%;margin-right: 20px;"
                 v-model="form.peopleLimitCount"
-                :disabled="form.isPeopleLimit==1||state==1"
+                :disabled="form.isPeopleLimit==1||participantsNum>0||taskParticipantsNum>0||state==1"
                 :min="0"
                 :max="999999"
                 :precision="0"
@@ -96,7 +96,7 @@
               每次抽奖需要支付
               <a-input-number
                 id="addLottery-cjgz"
-                :disabled="state==1"
+                :disabled="state==1||participantsNum>0||taskParticipantsNum>0"
                 style="width: 30%;margin-right: 5px;"
                 v-model="form.purchaseTimesGold"
                 :min="1"
@@ -169,9 +169,6 @@
           <a-col span="3">
             奖品描述
           </a-col>
-          <a-col span="3">
-            是否限制中奖
-          </a-col>
           <a-col span="3">
             概率
           </a-col>
@@ -209,7 +206,7 @@
               }"
             >
               <a-select
-                :disabled="participantsNum>0||state==1"
+                :disabled="participantsNum>0||taskParticipantsNum>0||state==1"
                 :id="'jpList-prizeType'+index"
                 style="width: 100%;"
                 v-model="item.prizeType"
@@ -239,7 +236,7 @@
               }"
             >
               <a-input
-                :disabled="participantsNum>0||state==1"
+                :disabled="participantsNum>0||taskParticipantsNum>0||state==1"
                 v-if="item.prizeType !== 'GOLD'"
                 :id="'jpList-name'+index"
                 style="width: 100%;"
@@ -261,38 +258,6 @@
             </a-form-model-item>
           </a-col>
           <a-col span="3">
-            <a-form-model-item
-              :label="''"
-              :required="true"
-              :label-col=" { span: 0 }"
-              :wrapper-col=" { span: 24 }"
-              :prop="'luckyDrawPrizeList.' + index + '.isPrizeLimit'"
-              :rules="{
-                required: true,
-                message: '请选择是否限制中奖',
-                trigger: ['blur','change'],
-              }"
-            >
-              <a-select
-                :id="'jpList-isPrizeLimit'+index"
-                style="width: 100%;"
-                :disabled="participantsNum>0||state==1||item.prizeType == 'NONE'"
-                v-model="item.isPrizeLimit"
-                @change="res => {
-                  item.prizeRate = ''
-                  item.prizeNum = ''
-                }"
-                placeholder="是否限制中奖">
-                <a-select-option :key="0" :value="1">
-                  是
-                </a-select-option>
-                <a-select-option :key="1" :value="0">
-                  否
-                </a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col span="3" v-if="item.isPrizeLimit == 0">
             <a-form-model-item
               :label="''"
               :required="true"
@@ -307,7 +272,7 @@
             >
               <a-input-number
                 style="width: 100%;"
-                :disabled="participantsNum>0||state==1"
+                :disabled="state==1"
                 :id="'jpList-prizeRate'+index"
                 v-model="item.prizeRate"
                 :min="0"
@@ -317,7 +282,7 @@
                 allowClear />
             </a-form-model-item>
           </a-col>
-          <a-col span="3" v-if="item.isPrizeLimit == 0&&item.prizeType!='NONE'">
+          <a-col span="3" v-if="item.prizeType!='NONE'">
             <a-form-model-item
               :label="''"
               :required="true"
@@ -332,10 +297,10 @@
             >
               <a-input-number
                 style="width: 100%;"
-                :disabled="participantsNum>0||state==1"
+                :disabled="state==1"
                 :id="'jpList-prizeNum'+index"
                 v-model="item.prizeNum"
-                :min="1"
+                :min="0"
                 :max="999999"
                 :precision="0"
                 placeholder="请输入奖品数量"
@@ -351,7 +316,7 @@
             >
               <Upload
                 :ref="'prizeImage'+index"
-                :disabled="participantsNum>0||state==1"
+                :disabled="participantsNum>0||taskParticipantsNum>0||state==1"
                 :id="'jpList-prizeImage'+index"
                 v-model="item.prizeImage"
                 :fileSize="0.25"
@@ -363,7 +328,7 @@
         </a-row>
         <div v-if="form.luckyDrawPrizeList.length" style="height: 1px;background-color: #eee;margin-bottom: 20px;" ></div>
         <a-row :gutter="48" v-if="form.luckyDrawPrizeList.length">
-          <a-col :span="12">
+          <!-- <a-col :span="12">
             <div class="form-item">
               <div style="margin-right: 10px;">中奖限制:</div>
               <a-select
@@ -408,7 +373,7 @@
                 {{ item.winPrizeLimitCodeDictValue.split('XXX')[1] }}
               </a-form-model-item>
             </div>
-          </a-col>
+          </a-col> -->
           <a-col :span="12">
             <div class="form-item">
               <div style="margin-right: 10px;">赠送抽奖次数规则:</div>
@@ -500,6 +465,7 @@ export default {
       wrapperCol: {},
 	    state: 0, // 活动状态
       participantsNum: 0, // 抽奖参与人数
+      taskParticipantsNum: 0,
       form: {
         activeName: '', // 活动名称
         time: [],
@@ -629,7 +595,7 @@ export default {
           this.$message.info(res.message)
           this.cansel()
         } else {
-          this.$message.warning(res.message)
+          // this.$message.warning(res.message)
         }
         this.loading = false
       })
@@ -639,6 +605,7 @@ export default {
       getLuckyDrawDetail({ id: id }).then(res => {
         if (res.status == 200) {
           this.participantsNum = res.data.participantsNum
+          this.taskParticipantsNum = res.data.taskParticipantsNum
 		      this.state = res.data.state
           this.titleText = this.state == 1 ? '查看活动' : '编辑活动'
           if (this.state == 1) {
@@ -697,6 +664,7 @@ export default {
     cansel () {
       this.isShow = false
       this.participantsNum = 0
+      this.taskParticipantsNum = 0
       this.state = 0
       this.form.isPeopleLimit = false
       this.form.luckyDrawPrizeList = []