提交 9e1dcf8f 编写于 作者: guangjun.yang's avatar guangjun.yang

机构验证问题

上级 77ef2fcd
......@@ -275,9 +275,6 @@ export default {
}
};
let checkOrgNameList = (rule, value, callback) => {
};
return {
curmbFirst: "教培项目",
curmbSecond: "项目组件",
......@@ -441,6 +438,26 @@ export default {
}
});
},
checkOrgNameList() {
let nameList = this.formData.organizationNameList;
for(let i = 0; i < nameList.length; i ++) {
if(!nameList[i]) {
this.$message.error('发起机构列表中不能为空');
return false;
}
}
for(let i = 0; i < nameList.length - 1; i ++) {
for(let j = i + 1; j < nameList.length; j ++) {
if(nameList[i] == nameList[j]) {
this.$message.error('发起机构列表中不能重复');
return false;
}
}
}
return true;
},
submitForm(formName) {
let flag = null;
this.$refs[formName].validate(valid => {
......@@ -723,6 +740,7 @@ export default {
complete(type) {
//1是暂存,2是完成
if (type == 2) {
if(!this.checkOrgNameList()) return;
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
} else {
......
......@@ -40,7 +40,7 @@
</el-col>
</el-form-item>
<el-form-item label="发起机构名称:">
<!-- <el-form-item label="发起机构名称:" prop="organizationName"> -->
<!-- <el-form-item label="发起机构名称:" prop="organizationNameList"> -->
<el-col :span="13" v-for="(item, index) in formData.organizationNameList" :key="index">
<el-input
size="small"
......@@ -1008,6 +1008,19 @@ export default {
callback(new Error(`请输入0~100正整数`));
}
};
let checkOrgListName = (rule, value, callback) => {
console.log(rule, value, callback);
// const val = parseFloat(value);
// const isInteger = Number.isInteger(val);
// // if((isInteger && val > 0) || checkNeedRule(val)){
// if (!value || (isInteger && val >= 0 && val <= 100)) {
// callback();
// } else {
// callback(new Error(`请输入0~100正整数`));
// }
};
return {
idTypeValue: 1,
idTypeProject: "",
......@@ -1312,15 +1325,18 @@ export default {
},
{ validator: checkProjectStr, trigger: "blur" }
],
organizationName: [
{ required: true, message: "请填写发起机构名称", trigger: "blur" },
{
min: 1,
max: 16,
message: "超过12个最大字数限制,请精简字数或使用简称",
trigger: "blur"
}
],
// organizationName: [
// { required: true, message: "请填写发起机构名称", trigger: "blur" },
// {
// min: 1,
// max: 16,
// message: "超过12个最大字数限制,请精简字数或使用简称",
// trigger: "blur"
// }
// ],
// organizationNameList: [
// { validator: checkOrgListName, trigger: "blur" }
// ],
duringTime: [
{
required: true,
......@@ -1428,6 +1444,26 @@ export default {
}
}
},
checkOrgNameList() {
let nameList = this.formData.organizationNameList;
for(let i = 0; i < nameList.length; i ++) {
if(!nameList[i]) {
this.$message.error('发起机构列表中不能为空');
return false;
}
}
for(let i = 0; i < nameList.length - 1; i ++) {
for(let j = i + 1; j < nameList.length; j ++) {
if(nameList[i] == nameList[j]) {
this.$message.error('发起机构列表中不能重复');
return false;
}
}
}
return true;
},
//表单校验
submitForm(formName) {
let flag = null;
......@@ -1983,6 +2019,7 @@ export default {
nextStep() {
if (this.active == 0) {
let formName = "formData";
if(!this.checkOrgNameList()) return;
let removeState = this.submitForm(formName);
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
......@@ -2831,7 +2868,6 @@ export default {
idList,
this.changedOrganization2
);
//debugger;
if (intersect.length > 0) {
//选中
//this.$refs.multipleOrganization.toggleRowSelection(row);
......@@ -2986,7 +3022,6 @@ export default {
this.changedPerson,
differenceScope
);
// debugger;
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
}
......@@ -3057,7 +3092,6 @@ export default {
idList,
this.changedPerson2
);
// debugger;
if (intersect.length > 0) {
//选中
//this.$refs.multiplePerson.toggleRowSelection(row);
......@@ -3217,7 +3251,6 @@ export default {
idList,
this.changedEcology2
);
// debugger;
if (intersect.length > 0) {
//选中
} else if (intersect2.length > 0) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册