update 流程完善
This commit is contained in:
+19
-24
@@ -349,6 +349,25 @@ export default {
|
|||||||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||||||
throw new Error('base')
|
throw new Error('base')
|
||||||
}
|
}
|
||||||
|
// 节点2,验证所有数据意见是否都已填写
|
||||||
|
if (isValidate && this.currentNode === EsInspectionPlan.fillInComments.value) {
|
||||||
|
// 当前登录用户,查找意见为空的数据
|
||||||
|
const currentUserName = this.$store.getters.userInfo.username
|
||||||
|
const opinionHasEmpty = this.$refs.inspectionPlanTable.dataSource.some(item => {
|
||||||
|
// 自己的数据就不用填写意见
|
||||||
|
if (item.createBy === currentUserName) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 如果没有意见内容,就是有没填的
|
||||||
|
if (!item.processEsInspectPlanOpinion || !item.processEsInspectPlanOpinion.opinion) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (opinionHasEmpty) {
|
||||||
|
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
|
||||||
|
throw new Error('base')
|
||||||
|
}
|
||||||
|
}
|
||||||
const params = {}
|
const params = {}
|
||||||
// 业务表信息
|
// 业务表信息
|
||||||
params.processEsInspectPlanList = this.$refs.inspectionPlanTable.dataSource.map(item => {
|
params.processEsInspectPlanList = this.$refs.inspectionPlanTable.dataSource.map(item => {
|
||||||
@@ -466,30 +485,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
handleSubmit () {
|
handleSubmit () {
|
||||||
if (this.loading) return
|
if (this.loading) return
|
||||||
// 节点2,验证所有数据意见是否都已填写
|
|
||||||
if (this.currentNode === EsInspectionPlan.fillInComments.value) {
|
|
||||||
// 当前登录用户,查找意见为空的数据
|
|
||||||
const currentUserName = this.$store.getters.userInfo.username
|
|
||||||
const opinionHasEmpty = this.$refs.inspectionPlanTable.dataSource.find(item => {
|
|
||||||
// 自己的数据就不用填写意见
|
|
||||||
if (item.createBy === currentUserName) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 如果意见字段为空,或者没有意见数据,就是没填的数据
|
|
||||||
if (!item.processEsInspectPlanOpinionList || !item.processEsInspectPlanOpinionList.length) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 如果有意见信息,从中找自己的数据,没找到自己的数据,就是没填的数据
|
|
||||||
const selfOpinionData = item.processEsInspectPlanOpinionList.find(childItem => {
|
|
||||||
return childItem.createBy === currentUserName
|
|
||||||
})
|
|
||||||
return !selfOpinionData
|
|
||||||
})
|
|
||||||
if (opinionHasEmpty) {
|
|
||||||
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 有taskId说明已经发起过,调审批接口,否则调发起接口
|
// 有taskId说明已经发起过,调审批接口,否则调发起接口
|
||||||
if (this.$route.query.taskId) {
|
if (this.$route.query.taskId) {
|
||||||
this.handleAgree(true)
|
this.handleAgree(true)
|
||||||
|
|||||||
@@ -356,6 +356,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 是否显示意见
|
// 是否显示意见
|
||||||
isShowOpinion (record) {
|
isShowOpinion (record) {
|
||||||
|
if (record.processEsInspectPlanOpinion && record.processEsInspectPlanOpinion.opinion) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
const list = record.processEsInspectPlanOpinionList || []
|
const list = record.processEsInspectPlanOpinionList || []
|
||||||
// 意见列表是否有当前用户的意见
|
// 意见列表是否有当前用户的意见
|
||||||
return !!(list.find(item => item.createBy === this.currentUserName))
|
return !!(list.find(item => item.createBy === this.currentUserName))
|
||||||
|
|||||||
Reference in New Issue
Block a user