Browse Source

修复测试反馈bug -zzx

zouzexu 9 months ago
parent
commit
ca9710b105

+ 12 - 12
src/views/operationManage/comboManage/checkoutCode.vue

@@ -2,7 +2,7 @@
   <div class="orderManage app-container">
     <div class="search">
       <div>
-        <el-input v-model="query.id" size="small" placeholder="请输入激活ID" class="item-width-200"></el-input>
+        <el-input v-model="query.id" size="small" placeholder="请输入完整激活ID" class="item-width-200"></el-input>
         <el-input v-model="query.serialNumber" size="small" placeholder="请输入激活码" class="item-width-200 ml10"></el-input>
         <el-input v-model="query.phone" size="small" placeholder="请输入激活手机号" class="item-width-200 ml10"></el-input>
         <el-date-picker v-model="date" size="small" value-format="yyyy-MM-dd" class="item-width-350 ml10"
@@ -74,12 +74,15 @@
       </el-table-column>
       <el-table-column prop="activationDay" align="center" label="时间段/天数" show-overflow-tooltip>
         <template slot-scope="scope">
-          {{ scope.row.activationDay||'--' }}
+          <span v-if="scope.row.activationType == 1">{{ timeFormat(scope.row.startTime) }}至{{ timeFormat(scope.row.endTime) }}</span>
+          <span v-else>
+          {{ scope.row.activationDay}}
+          </span>
         </template>
       </el-table-column>
       <el-table-column prop="startTime" align="center" label="创建时间" show-overflow-tooltip>
         <template slot-scope="scope">
-          {{ timeFormat(scope.row.targetStartTime) }}
+          {{ timeFormat(scope.row.createTime) }}
         </template>
       </el-table-column>
       <el-table-column align="center" label="状态" show-overflow-tooltip>
@@ -93,11 +96,15 @@
           <span>--</span>
         </template>
       </el-table-column>
-      <el-table-column prop="phone" align="center" label="激活手机号" show-overflow-tooltip>
+      <el-table-column align="center" label="激活手机号" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ scope.row.phone|| '--' }}
+        </template>
       </el-table-column>
       <el-table-column align="center" label="激活时间" show-overflow-tooltip>
         <template slot-scope="scope">
-          {{ timeFormat(scope.row.useTime) }}
+          <span v-if="scope.row.phone==null">--</span>
+          <span v-else>{{ timeFormat(scope.row.useTime) }}</span>
         </template>
       </el-table-column>
       <el-table-column prop="address" align="center" label="操作">
@@ -170,13 +177,6 @@ export default {
     };
   },
   watch: {
-    // query: {
-    //   handler: debounce(function(val) {
-    //     this.getList()
-
-    //   }),
-    //   deep:true
-    // },
     date(val) {
       if (val) {
         this.query.startTime = Date.parse(val[0]);

+ 38 - 28
src/views/operationManage/comboManage/vipActivation.vue

@@ -15,7 +15,7 @@
           class="item-width-200 ml10"
         ></el-input>
         <el-input
-          v-model="query.groupPlanNameType"
+          v-model="query.planningName"
           size="small"
           placeholder="请输入产品策划名称"
           class="item-width-200 ml10"
@@ -222,7 +222,7 @@
       >
       </el-pagination>
     </div>
-    <el-dialog title="生成激活码" :visible.sync="vipDialogVisible" width="50%">
+    <el-dialog title="生成激活码" :visible.sync="vipDialogVisible" :before-close="closeVipDialog" width="50%">
       <el-descriptions class="margin-top" :column="3" border>
         <el-descriptions-item>
           <template slot="label"> 计费号 </template>
@@ -315,7 +315,7 @@
         >
           注:会员有效期为用户使用激活码后会员生效时间。时间段为用户使用激活码后仅在对应时间段内拥有会员权益;天数为用户使用激活码后对应天数内拥有会员权益。时间段激活码无法叠加使用,天数激活码可叠加使用累计天数。
         </div>
-        <el-form-item label="激活码数量:" prop="totalTicket">
+        <el-form-item label="激活码数量:">
           <el-input
             v-model="setQuery.totalTicket"
             class="item-width-100"
@@ -335,7 +335,7 @@
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="vipDialogVisible = false">取 消</el-button>
+        <el-button @click="activationCancel('setQuery')">取 消</el-button>
         <el-button
           type="primary"
           :loading="updataLoading"
@@ -419,9 +419,12 @@ export default {
         validDay: [
           { required: true, message: "请输入激活码有效期", trigger: "blur" },
         ],
-        vipSetmenu: [
+        selectType: [
           { required: true, message: "请选择会员套餐", trigger: "change" },
         ],
+        activationType: [
+          { required: true, message: "请选择有效期", trigger: "change" },
+        ],
         endTime: [
           {
             required: true,
@@ -429,12 +432,7 @@ export default {
             trigger: "change",
           },
         ],
-        totalTicket: [
-          { required: true, message: "请输入激活码数量", trigger: "blur" },
-        ],
-        startString: [
-          { required: true, message: "请输入激活码开头", trigger: "blur" },
-        ],
+        startString: [{ required: true, message: "请输入激活码开头", trigger: "blur" },],
       },
       vipDialogVisible: false,
 
@@ -454,13 +452,6 @@ export default {
     };
   },
   watch: {
-    // query: {
-    //   handler: debounce(function(val) {
-    //     this.getList()
-
-    //   }),
-    //   deep:true
-    // },
     date(val) {
       if (val) {
         this.setQuery.startTime = new Date(val[0]).getTime();
@@ -473,12 +464,22 @@ export default {
   },
   filters: {},
   methods: {
+    // 重置表单
+    activationCancel(){
+      this.$refs["setQuery"].resetFields();
+      this.vipDialogVisible = false;
+    },
+    closeVipDialog(done){
+      this.$refs["setQuery"].resetFields();
+      done()
+    },
     //  生成弹窗
     gotoGenerating(item) {
       this.get_setmealList();
       this.vipDialogVisible = true;
       this.codeData = item;
       this.setQuery.groupOrderNo = item.orderNo;
+      this.setQuery.totalTicket=item.orderNum      
     },
 
     // 套餐选择
@@ -488,35 +489,45 @@ export default {
       this.setQuery.planningName = label;
     },
 
-    // 提交生成
+    // 提交生成逻辑处理
     vipsubmitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           delete this.setQuery.selectType;
+          if(this.setQuery.totalTicket!=''){
+            if( this.codeData.orderNum>this.setQuery.totalTicket){
+            this.$message.error("激活码数量必须大于订购数量");
+            return
+          }
+          }
           this.updataLoading = true;
           if (this.setQuery.activationType == "时间段") {
             this.setQuery.activationType = 1;
           } else {
             this.setQuery.activationType = 2;
           }
-      console.log(this.setQuery.activationType, "-----type");
-          generateCode(this.setQuery).then((res) => {
+          this.submit_generateCode()
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+
+    // 提交接口调用
+    submit_generateCode(){
+      generateCode(this.setQuery).then((res) => {
             this.updataLoading = false;
             if (res.state == "Success") {
               this.vipDialogVisible = false;
+              this.getList();
               this.setQuery.validDay = "";
               this.setQuery.activationType = "";
               this.date = "";
               this.setQuery.totalTicket = "";
               setQuery.startString = "";
-              this.getList();
             }
           });
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
     },
 
     // 查看激活码
@@ -536,7 +547,6 @@ export default {
       this.loading = false;
         if (res.state == "Success") {
           this.optionsList = res.content.records;
-          this.total = res.content.total;
         }
       });
     },