Commit 1cccad9e authored by jingnan's avatar jingnan 👀

合并产品【12542】单个签审任务处理选中驳回后完成任务会触发审批对象里的表单校验,实际不需要<2>

parent 59353bf0
......@@ -766,6 +766,7 @@ export default {
},
// 路由切换
routeSelect(val) {
this.clearApprovalFormValidateStatus()
this.getBizForm(val)
},
// 获取业务表单
......@@ -779,19 +780,21 @@ export default {
finishTask(flag, params, callback, errCallBack) {
this.$nextTick(function() {
const validateArray = []
// 审批对象表单
this.approvalObject.forEach(item => {
const refCom = this.$refs[item.refKey]
if (!refCom || !refCom[0]) return
const vm = refCom[0]
if (vm.hasOwnProperty('validate')) {
validateArray.push(vm.validate())
} else if (vm.$refs.asCom && vm.$refs.asCom.hasOwnProperty('validate')) {
validateArray.push(vm.$refs.asCom.validate())
} else if (vm.$refs.asCom && vm.$refs.asCom.$refs && vm.$refs.asCom.$refs.deeForm && vm.$refs.asCom.$refs.deeForm.hasOwnProperty('validate')) {
validateArray.push(vm.$refs.asCom.$refs.deeForm.validate())
}
})
// 审批对象表单,路由选择驳回的情况下不校验审批对象表单
if (params.routerSelect !== 'reject') {
this.approvalObject.forEach(item => {
const refCom = this.$refs[item.refKey]
if (!refCom || !refCom[0]) return
const vm = refCom[0]
if (vm.hasOwnProperty('validate')) {
validateArray.push(vm.validate())
} else if (vm.$refs.asCom && vm.$refs.asCom.hasOwnProperty('validate')) {
validateArray.push(vm.$refs.asCom.validate())
} else if (vm.$refs.asCom && vm.$refs.asCom.$refs && vm.$refs.asCom.$refs.deeForm && vm.$refs.asCom.$refs.deeForm.hasOwnProperty('validate')) {
validateArray.push(vm.$refs.asCom.$refs.deeForm.validate())
}
})
}
// 任务处理
this.dynamicComponents.forEach(item => {
if (this.$refs.hasOwnProperty(item.configName)) {
......@@ -868,6 +871,21 @@ export default {
})
}
})
},
// 清理审批表单校验状态
clearApprovalFormValidateStatus() {
this.approvalObject.forEach(item => {
const refCom = this.$refs[item.refKey]
if (!refCom || !refCom[0]) return
const vm = refCom[0]
if (vm.hasOwnProperty('clearValidate')) {
vm.clearValidate()
} else if (vm.$refs.asCom && vm.$refs.asCom.hasOwnProperty('clearValidate')) {
vm.$refs.asCom.clearValidate()
} else if (vm.$refs.asCom && vm.$refs.asCom.$refs && vm.$refs.asCom.$refs.deeForm && vm.$refs.asCom.$refs.deeForm.hasOwnProperty('clearValidate')) {
vm.$refs.asCom.$refs.deeForm.clearValidate()
}
})
}
},
filter: {}
......
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