运行图 绘图 生成计划 增加计划 代码调整
This commit is contained in:
parent
ebcd6b9bd9
commit
c8986b3a4e
@ -71,7 +71,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
if (serviceNumberList.includes(value)) {
|
if (serviceNumberList.includes(value)) {
|
||||||
return callback(new Error('该服务号已存在'));
|
// new Error('该服务号已存在')
|
||||||
|
return callback();
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
@ -91,7 +92,8 @@ export default {
|
|||||||
this.formModel.serviceNumber = newValue;
|
this.formModel.serviceNumber = newValue;
|
||||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
if (serviceNumberList.includes(value)) {
|
if (serviceNumberList.includes(value)) {
|
||||||
return callback(new Error('该服务号已存在'));
|
// new Error('该服务号已存在')
|
||||||
|
return callback();
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,8 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
serviceNumber:[
|
serviceNumber:[
|
||||||
{required: true, validator: this.validateServiceNumber, trigger: 'blur'},
|
{required: true, validator: this.validateServiceNumber, trigger: 'blur'},
|
||||||
{required: true, validator: this.validateServiceNumber, trigger: 'change'}
|
// {required: true, validator: this.validateServiceNumber, trigger: 'change'}
|
||||||
|
{required: true, validator: this.validateServiceNo, trigger: 'change'}
|
||||||
],
|
],
|
||||||
beginTime: [
|
beginTime: [
|
||||||
{ required: true, message: '请填写开始时间', trigger: 'blur' }
|
{ required: true, message: '请填写开始时间', trigger: 'blur' }
|
||||||
@ -138,14 +139,17 @@ export default {
|
|||||||
if (typeof value == 'string' && value.trim().length == 0) {
|
if (typeof value == 'string' && value.trim().length == 0) {
|
||||||
return callback(new Error('请填写服务号'));
|
return callback(new Error('请填写服务号'));
|
||||||
} else {
|
} else {
|
||||||
const newValue = parseInt(value);
|
let newValue = parseInt(value);
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
if (newValue.toString() != value) {
|
if (newValue > 0 & newValue < 9) {
|
||||||
this.formModel.serviceNumber = newValue;
|
newValue = '00' + newValue;
|
||||||
|
} else if (newValue > 10 & newValue < 99) {
|
||||||
|
newValue = '0' + newValue;
|
||||||
}
|
}
|
||||||
|
this.formModel.serviceNumber = newValue;
|
||||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
if (serviceNumberList.includes(value)) {
|
if (serviceNumberList.includes(value)) {
|
||||||
return callback(new Error('该服务号已存在,请重新填写'));
|
return callback(new Error('该服务号已存在'));
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
@ -155,6 +159,18 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
validateServiceNo(rule, value, callback) {
|
||||||
|
if (typeof value == 'string' && value.trim().length == 0) {
|
||||||
|
return callback(new Error('请填写服务号'));
|
||||||
|
} else {
|
||||||
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
|
if (serviceNumberList.includes(value)) {
|
||||||
|
return callback(new Error('该服务号已存在'));
|
||||||
|
} else {
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
validateRunningRouting(rule, value, callback) {
|
validateRunningRouting(rule, value, callback) {
|
||||||
if (value.trim().length == 0) {
|
if (value.trim().length == 0) {
|
||||||
return callback(new Error('请选择环路'));
|
return callback(new Error('请选择环路'));
|
||||||
|
@ -77,7 +77,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
if (serviceNumberList.includes(value)) {
|
if (serviceNumberList.includes(value)) {
|
||||||
return callback(new Error('该服务号已存在'));
|
// new Error('该服务号已存在');
|
||||||
|
return callback();
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
@ -97,7 +98,8 @@ export default {
|
|||||||
this.formModel.serviceNumber = newValue;
|
this.formModel.serviceNumber = newValue;
|
||||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||||
if (serviceNumberList.includes(value)) {
|
if (serviceNumberList.includes(value)) {
|
||||||
return callback(new Error('该服务号已存在'));
|
// new Error('该服务号已存在')
|
||||||
|
return callback();
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user