Commit 47e87ad4 authored by honghy's avatar honghy Committed by wux

【后台-会员等级-新增/修改】“等级规则有效期”要限制当设置小于当前日期时不允许保存成功

parent 00d4ae63
......@@ -184,7 +184,7 @@ export default {
name: [
{
required: true,
message: this.$t("请输入名称"),
message: this.$t("必填,限制50字符"),
trigger: "blur",
max: 50
}
......@@ -250,7 +250,7 @@ export default {
description : [
{
required: true,
message: this.$t("请输入等级"),
message: this.$t("必填,限制200字符"),
trigger: "blur",
max: 200
}
......@@ -341,6 +341,17 @@ export default {
},
//保存并启用
handleEnableIntegralRule(){
var now = new Date();
var nowMidnight = new Date(now.getFullYear(), now.getMonth(), now.getDate());
var specificDate = new Date(this.queryParams.startTime);
if(specificDate<nowMidnight) {
this.$modal.msgWarning('等级规则日期大于等于当前日期')
return false
}
if(this.queryParams.startTime>this.queryParams.endTime) {
this.$modal.msgWarning('等级规则日期开始时间不能大于结束时间')
return false
}
this.$refs["queryForm"].validate((valid) => {
if (valid) {
let params = deepClone(this.queryParams)
......@@ -357,6 +368,17 @@ export default {
},
//编辑更新等级规则
handleUpdatedMemberLevel(){
var now = new Date();
var nowMidnight = new Date(now.getFullYear(), now.getMonth(), now.getDate());
var specificDate = new Date(this.queryParams.startTime);
if(specificDate<nowMidnight) {
this.$modal.msgWarning('等级规则日期大于等于当前日期')
return false
}
if(this.queryParams.startTime>this.queryParams.endTime) {
this.$modal.msgWarning('等级规则日期开始时间不能大于结束时间')
return false
}
this.$refs["queryForm"].validate((valid) => {
if (valid) {
let params = deepClone(this.queryParams)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment