|
@@ -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;
|
|
|
}
|
|
|
});
|
|
|
},
|