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

机构验证问题

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