|
@@ -280,23 +280,27 @@
|
|
|
></el-radio>
|
|
|
</el-radio-group>
|
|
|
<div v-if="setQuery.activationType == '时间段'">
|
|
|
- <el-date-picker
|
|
|
- v-model="date"
|
|
|
- type="daterange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
+ <el-form-item prop="startTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="date"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
<div v-if="setQuery.activationType == '天数'">
|
|
|
- <el-input
|
|
|
- v-model="setQuery.activationDay"
|
|
|
- onkeyup="this.value=this.value.replace(/\D/g,'')"
|
|
|
- onafterpaste="this.value=this.value.replace(/\D/g,'')"
|
|
|
- class="item-width-100"
|
|
|
- ></el-input>
|
|
|
- 天
|
|
|
+ <el-form-item prop="activationDay">
|
|
|
+ <el-input
|
|
|
+ v-model="setQuery.activationDay"
|
|
|
+ onkeyup="this.value=this.value.replace(/\D/g,'')"
|
|
|
+ onafterpaste="this.value=this.value.replace(/\D/g,'')"
|
|
|
+ class="item-width-100"
|
|
|
+ ></el-input>
|
|
|
+ 天
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<div
|
|
@@ -315,6 +319,7 @@
|
|
|
onkeyup="this.value=this.value.replace(/\D/g,'')"
|
|
|
onafterpaste="this.value=this.value.replace(/\D/g,'')"
|
|
|
class="item-width-100"
|
|
|
+ @blur="totalTicketChange"
|
|
|
></el-input>
|
|
|
<span style="color: red; font-size: 12px; margin-left: 10px"
|
|
|
>注:默认为订购数量,激活码数量必须大于订购数量,输入数字须为整数</span
|
|
@@ -436,6 +441,20 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
+ activationDay: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入天数",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ startTime: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择会员有效期",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
startString: [
|
|
|
{ required: true, message: "请输入激活码开头", trigger: "blur" },
|
|
|
],
|
|
@@ -495,17 +514,20 @@ export default {
|
|
|
this.setQuery.planningName = label;
|
|
|
},
|
|
|
|
|
|
+ // 判断激活套餐是否大于于订购数量
|
|
|
+ totalTicketChange() {
|
|
|
+ if (Math.trunc(this.codeData.orderNum) > this.setQuery.totalTicket) {
|
|
|
+ this.$message.error("激活码数量必须大于订购数量");
|
|
|
+ this.setQuery.totalTicket = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 提交生成逻辑处理
|
|
|
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;
|
|
@@ -514,7 +536,6 @@ export default {
|
|
|
}
|
|
|
this.submit_generateCode();
|
|
|
} else {
|
|
|
- console.log("error submit!!");
|
|
|
return false;
|
|
|
}
|
|
|
});
|