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

隐藏关联奖级、1. 去掉“奖品数量”设置、奖级数量可设置

DELL пре 3 година
родитељ
комит
a085663fdd

+ 49 - 38
src/views/business/ticket/components/AwardsList.vue

@@ -4,12 +4,12 @@
         <div class="prize-top">
           <div>奖级名称:{{ item.name }}</div>
           <div>奖级:{{ item.sort }}</div>
+<!--          <div>-->
+<!--            关联奖级:<el-select v-model="item.awardsLabel" style="width: 120px;">-->
+<!--            <el-option v-for="(item,index) in awardsLabelList"  :label="item.dictLabel" :value="item.dictLabel" :key="index"/>-->
+<!--          </el-select>-->
+<!--          </div>-->
           <div>
-            关联奖级:<el-select v-model="item.awardsLabel" style="width: 120px;">
-            <el-option v-for="(item,index) in awardsLabelList"  :label="item.dictLabel" :value="item.dictLabel" :key="index"/>
-          </el-select>
-          </div>
-          <div v-if="ticketType == 'offline'">
             奖级数量:
             <el-input-number
               v-model="item.quantity"
@@ -20,7 +20,18 @@
               :disabled="item.isEdit"
             ></el-input-number>
           </div>
-          <div v-else>奖级数量:{{ item.quantity }}</div>
+<!--          <div v-if="ticketType == 'offline'">-->
+<!--            奖级数量:-->
+<!--            <el-input-number-->
+<!--              v-model="item.quantity"-->
+<!--              controls-position="right"-->
+<!--              @change="handleChangeAll($event, item)"-->
+<!--              :min="0"-->
+<!--              size="small"-->
+<!--              :disabled="item.isEdit"-->
+<!--            ></el-input-number>-->
+<!--          </div>-->
+<!--          <div v-else>奖级数量:{{ item.quantity }}</div>-->
         </div>
         <div class="prize-table">
           <el-table :data="item.prizeList" class="el-table">
@@ -60,19 +71,19 @@
                  <span v-else>--</span>
               </template>
             </el-table-column>
-            <el-table-column label="奖品数量" prop="quantity" v-if="ticketType != 'offline'" align="center">
-              <template slot-scope="scope">
-                <div>
-                  <el-input-number
-                    v-model="scope.row.quantity"
-                    controls-position="right"
-                    @change="handleChange($event, index)"
-                    :min="1"
-                    size="small"
-                  ></el-input-number>
-                </div>
-              </template>
-            </el-table-column>
+<!--            <el-table-column label="奖品数量" prop="quantity" v-if="ticketType != 'offline'" align="center">-->
+<!--              <template slot-scope="scope">-->
+<!--                <div>-->
+<!--                  <el-input-number-->
+<!--                    v-model="scope.row.quantity"-->
+<!--                    controls-position="right"-->
+<!--                    @change="handleChange($event, index)"-->
+<!--                    :min="1"-->
+<!--                    size="small"-->
+<!--                  ></el-input-number>-->
+<!--                </div>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
             <el-table-column label="已兑数量" prop="cashedQty" align="center" v-if="boxId" />
             <el-table-column label="排序" prop="sortWeight" align="center">
               <template slot-scope="scope">
@@ -232,9 +243,9 @@ export default {
       }
       this.$emit('input', this.awardsList)
       this.$emit('close')
-      if (this.ticketType != 'offline' && this.id == 0) {
-        this.getQuantity();
-      }
+      // if (this.ticketType != 'offline' && this.id == 0) {
+      //   this.getQuantity();
+      // }
     },
 
     changetype(e) {
@@ -251,18 +262,18 @@ export default {
     handleChangeAll(e, item) {
       this.$set(item, "quantity", e);
       this.$forceUpdate();
-      if (this.ticketType != 'offline' && this.id == 0) {
-        this.getQuantity();
-      }
+      // if (this.ticketType != 'offline' && this.id == 0) {
+      //   this.getQuantity();
+      // }
     },
 
     // 改变奖品数量
     handleChange(e, index) {
       this.prizeIndex = index;
       this.$forceUpdate();
-      if (this.ticketType != 'offline' && this.id == 0) {
-        this.getQuantity();
-      }
+      // if (this.ticketType != 'offline' && this.id == 0) {
+      //   this.getQuantity();
+      // }
     },
 
     // 奖级商品删除
@@ -271,19 +282,19 @@ export default {
       let list = item.prizeList;
       list.splice(index, 1);
       this.$set(item, "prizeList", list);
-      if (this.ticketType != 'offline' && this.id == 0) {
-        this.getQuantity();
-      }
+      // if (this.ticketType != 'offline' && this.id == 0) {
+      //   this.getQuantity();
+      // }
     },
 
     // 计算奖级数量
-    getQuantity() {
-      let num = 0;
-        this.awardsList[this.prizeIndex].prizeList.forEach((item) => {
-          num += item.quantity;
-        });
-        this.awardsList[this.prizeIndex].quantity = num;
-    },
+    // getQuantity() {
+    //   let num = 0;
+    //     this.awardsList[this.prizeIndex].prizeList.forEach((item) => {
+    //       num += item.quantity;
+    //     });
+    //     this.awardsList[this.prizeIndex].quantity = num;
+    // },
   },
 };
 </script>

+ 1 - 1
src/views/business/ticket/components/CoinAdd.vue

@@ -63,7 +63,7 @@ export default {
         prizeType: "coin",
         quantity: 1,
         title: `盲豆 x${this.coinForm.quantity}`,
-        picUrl: publicFileGetUrl + "md.jpeg",
+        picUrl: publicFileGetUrl + "md.png",
         coinValue: this.coinForm.quantity,
         sortWeight: 100
       };

+ 11 - 9
src/views/business/ticket/create.vue

@@ -394,9 +394,11 @@ export default {
               // (item.prizeType = JSON.parse(item.prizeType).value);
               (item.prizeType = 'goods');
           });
-          this.$nextTick(() => {
-            this.$refs.awardFrom.add(goodsList)
-          })
+          if(this.$refs.awardFrom.add()){
+            this.$nextTick(() => {
+              this.$refs.awardFrom.add(goodsList)
+            })
+          }
           // this.goodsList = goodsList
         }
       })
@@ -482,12 +484,12 @@ export default {
             return item.quantity != 0;
           });
 
-          for (let i = 0; i < filterArr2.length; i++) {
-            if(filterArr2[i].awardsLabel == "" || filterArr2[i].awardsLabel == undefined){
-              this.$message.error("关联奖级不能为空");
-              return
-            }
-          }
+          // for (let i = 0; i < filterArr2.length; i++) {
+          //   if(filterArr2[i].awardsLabel == "" || filterArr2[i].awardsLabel == undefined){
+          //     this.$message.error("关联奖级不能为空");
+          //     return
+          //   }
+          // }
           if (this.form.type == "offline") {
             this.form.originPrice = null
             for (let i = 0; i < filterArr2.length; i++) {

+ 6 - 6
src/views/business/ticket/detail.vue

@@ -119,7 +119,7 @@
            <div class="prize-top">
              <div>奖级名称:{{ item.name }}</div>
              <div>奖级:{{ item.sort }}</div>
-             <div>关联奖级:{{ item.awardsLabel || '-' }}</div>
+<!--             <div>关联奖级:{{ item.awardsLabel || '-' }}</div>-->
              <div>奖级数量:{{ item.quantity }}</div>
            </div>
            <div class="prize-table">
@@ -160,11 +160,11 @@
                   <span v-else>--</span>
                 </template>
               </el-table-column>
-               <el-table-column v-if="info && info.type && info.type.value == 'online'" label="奖品数量" prop="quantity" align="center">
-                 <template slot-scope="{ row }">
-                   <div>{{ row.quantity }}</div>
-                 </template>
-               </el-table-column>
+<!--               <el-table-column v-if="info && info.type && info.type.value == 'online'" label="奖品数量" prop="quantity" align="center">-->
+<!--                 <template slot-scope="{ row }">-->
+<!--                   <div>{{ row.quantity }}</div>-->
+<!--                 </template>-->
+<!--               </el-table-column>-->
                <el-table-column label="已兑数量" prop="cashedQty" align="center" />
                <el-table-column label="排序" prop="sortWeight" align="center">
                  <template slot-scope="{ row }">