Browse Source

盲票创建之后奖级数量不变

DELL 3 years ago
parent
commit
74dadaa0fd

+ 8 - 4
src/views/business/ticket/components/AwardsList.vue

@@ -110,6 +110,10 @@ export default {
       type: Array,
       default: () => []
     },
+    id: {
+      type: [String,Number],
+      default: false,
+    },
   },
   data() {
     return {
@@ -214,7 +218,7 @@ export default {
       }
       this.$emit('input', this.awardsList)
       this.$emit('close')
-      if (this.ticketType != 'offline') {
+      if (this.ticketType != 'offline' && this.id == 0) {
         this.getQuantity();
       }
     },
@@ -233,7 +237,7 @@ export default {
     handleChangeAll(e, item) {
       this.$set(item, "quantity", e);
       this.$forceUpdate();
-      if (this.ticketType != 'offline') {
+      if (this.ticketType != 'offline' && this.id == 0) {
         this.getQuantity();
       }
     },
@@ -242,7 +246,7 @@ export default {
     handleChange(e, index) {
       this.prizeIndex = index;
       this.$forceUpdate();
-      if (this.ticketType != 'offline') {
+      if (this.ticketType != 'offline' && this.id == 0) {
         this.getQuantity();
       }
     },
@@ -253,7 +257,7 @@ export default {
       let list = item.prizeList;
       list.splice(index, 1);
       this.$set(item, "prizeList", list);
-      if (this.ticketType != 'offline') {
+      if (this.ticketType != 'offline' && this.id == 0) {
         this.getQuantity();
       }
     },

+ 2 - 1
src/views/business/ticket/create.vue

@@ -146,7 +146,7 @@
       <!-- 奖级设置 -->
 
       <!-- 奖级列表 -->
-      <awards-list ref="awards" v-model="awardsList" @handleCommand="handleCommand" @close="close" />
+      <awards-list ref="awards" :id="ids" v-model="awardsList" @handleCommand="handleCommand" @close="close" />
       <!-- 保存 -->
       <div class="save-btn">
         <el-button size="small" @click="back"> 取 消 </el-button>
@@ -194,6 +194,7 @@ export default {
     return {
       loading: false,
       id: this.$route.query.id,
+      ids: this.$route.query.id?this.$route.query.id:0,
       form: {
         type: "online", //盲票类型
         title: "", // 盲票名称