[update] 修改企标流程人员校验在基本信息校验之后

This commit is contained in:
lideqin
2024-01-17 16:45:23 +08:00
parent 8dc6eda311
commit b599f18337
9 changed files with 56 additions and 60 deletions
@@ -505,12 +505,6 @@ export default {
// 节点一时候的提交,发起变更
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息校验
@@ -518,6 +512,12 @@ export default {
// 需要校验业务基本信息中的表单
const data = await this.$refs.baseInfoFormRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const param = {} // 需要给后端的参数
param.common = { ...values, ...approvalValues, ...data.formInline }
@@ -409,16 +409,16 @@ export default {
// 节点一时候的提交,发起变更
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
const data = this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
const param = {} // 传给后端的数据
param.common = { ...values, ...approvalValues }
param.dataList = data.dataSource
@@ -361,18 +361,18 @@ export default {
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
@@ -373,18 +373,18 @@ export default {
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues }
@@ -816,13 +816,6 @@ export default {
// 节点一时候的提交,发起立项变更申请,有taskId就是驳回后的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
// 校验是否填了所有能填的人员信息
if (!personnelObj) {
this.switchValue = 'user'
return
}
console.log(this.formInline)
this.processInfoForm.validateFields((err, values) => {
this.$refs.ruleForm.validate(valid => {
@@ -834,7 +827,6 @@ export default {
// 是立项
this.$refs.approvalBaseInfo.$refs.ruleForm.validate(approvalBaseValid => {
if (valid && approvalBaseValid && !err && !approvalErr) {
this.loading = true
const param = Object.assign({}, this.formInline, this.$refs.approvalBaseInfo.formInline)
// 企标体系处理成逗号分隔
param.enStandardSystem = param.enStandardSystem.map(item => item.value).join(',')
@@ -848,7 +840,6 @@ export default {
this.formInline.projectType === ProjectType.WORK_TERMINATE.value) {
// 是变更-完成时间 或者 变更-工作终止变更
if (valid && !err && !approvalErr && this.$refs.changeBaseInfo && this.$refs.changeBaseInfo.dataSource.length > 0) {
this.loading = true
arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...this.formInline } })
haveErr = false
} else if (valid && !err && !approvalErr && this.$refs.changeBaseInfo) {
@@ -863,7 +854,6 @@ export default {
// 是变更-责任部门变更
this.$refs.changeBaseInfo.$refs.ruleForm.validate(changeBaseValid => {
if (valid && changeBaseValid && !err && !approvalErr) {
this.loading = true
const param = Object.assign({}, this.formInline, this.$refs.changeBaseInfo.formInline)
arr.push(param)
haveErr = false
@@ -875,14 +865,12 @@ export default {
// 是变更-合并
this.$refs.changeBaseInfo.$refs.ruleForm.validate(changeBaseValid => {
if (valid && changeBaseValid && !err && !approvalErr) {
this.loading = true
const changeBaseInfo = this.$refs.changeBaseInfo.formInline
if (changeBaseInfo.projectTypeOne !== changeBaseInfo.projectTypeTwo) {
// 合并时候的两个计划需要限定修订+修订,或者制定+制定
this.$message.warning(this.$t('workCenter.enterpriseInitChangePlan.pleaseSelectTwoSameProjectTypePlan'))
return
}
this.loading = true
const param = Object.assign({}, this.formInline, this.$refs.changeBaseInfo.formInline)
// 企标体系处理成逗号分隔
param.enStandardSystem = param.enStandardSystem.map(item => item.value).join(',')
@@ -897,6 +885,14 @@ export default {
this.switchValue = 'base'
return
}
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
// 校验是否填了所有能填的人员信息
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues } // 流程信息和流程审批信息
param.dataList = arr
@@ -418,18 +418,18 @@ export default {
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
@@ -520,16 +520,16 @@ export default {
// 节点一时候的提交,发起变更
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues }
@@ -363,18 +363,18 @@ export default {
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
@@ -361,18 +361,18 @@ export default {
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }