应征入伍保留学籍申请表附件删除
This commit is contained in:
@@ -728,7 +728,8 @@ export default {
|
||||
variables: {
|
||||
variables: {},
|
||||
approvalOpinion: '', // 必须初始化,避免 null 报错
|
||||
approvalResult: ''
|
||||
approvalResult: '',
|
||||
targetNodeName: ''
|
||||
},
|
||||
penaltyNumber: '',
|
||||
letterServiceContent: '',
|
||||
@@ -1014,26 +1015,9 @@ export default {
|
||||
this.taskForm.variables = res.data.formData
|
||||
|
||||
|
||||
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
||||
if (this.taskForm.variables == null) {
|
||||
// 情况1:variables 为 null → 初始化完整结构(包含原有 variables 嵌套和 approvalOpinion)
|
||||
this.taskForm.variables = {
|
||||
variables: {}, // 保留原有的嵌套 variables 结构(后端可能依赖)
|
||||
approvalOpinion: '', // 初始化审批意见为空白
|
||||
approvalResult: ''
|
||||
}
|
||||
} else {
|
||||
// 情况2:variables 已存在 → 保留原有字段,补充 approvalOpinion(无则添加,有则保留原值)
|
||||
this.taskForm.variables = {
|
||||
...this.taskForm.variables, // 展开原有所有字段(如 variables、其他自定义字段)
|
||||
approvalOpinion: this.taskForm.variables.approvalOpinion || '', // 兜底:若原有未定义则设为空白
|
||||
approvalResult: this.taskForm.variables.approvalOpinion || ''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
||||
this.initApproval()
|
||||
|
||||
this.formKeyExist = res.data.formKeyExist
|
||||
})
|
||||
}
|
||||
@@ -1172,10 +1156,33 @@ export default {
|
||||
returnList(this.taskForm).then((res) => {
|
||||
this.returnTaskList = res.data
|
||||
this.taskForm.variables = null
|
||||
|
||||
|
||||
if (this.category == 'enlistmentReserve') {
|
||||
// 过滤returnTaskList,保留documentation在flowRecordList的taskName中存在的项
|
||||
this.returnTaskList = this.returnTaskList.filter(returnTask => {
|
||||
// 检查flowRecordList中是否有项的taskName等于当前returnTask的documentation
|
||||
return this.flowRecordList.some(record => record.taskName === returnTask.documentation)
|
||||
})
|
||||
console.log(this.flowRecordList);
|
||||
|
||||
}
|
||||
this.initApproval()
|
||||
})
|
||||
},
|
||||
/** 提交退回任务 */
|
||||
taskReturn() {
|
||||
// 入伍保留学籍审核状态和意见
|
||||
if (this.category == 'enlistmentReserve') {
|
||||
this.taskForm.variables.approvalResult = 3
|
||||
this.taskForm.variables.approvalOpinion = this.taskForm.comment
|
||||
this.returnTaskList.forEach(element => {
|
||||
if (element.id == this.taskForm.targetKey) {
|
||||
this.taskForm.variables.targetNodeName = element.documentation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.$refs['taskForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
returnTask(this.taskForm).then((res) => {
|
||||
@@ -1240,6 +1247,27 @@ export default {
|
||||
fileUpload() {
|
||||
download.resource(this.pdfURL)
|
||||
},
|
||||
// 初始化入伍保留学籍申请审核意见参数
|
||||
initApproval() {
|
||||
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
||||
if (this.taskForm.variables == null) {
|
||||
// 情况1:variables 为 null → 初始化完整结构(包含原有 variables 嵌套和 approvalOpinion)
|
||||
this.taskForm.variables = {
|
||||
variables: {}, // 保留原有的嵌套 variables 结构(后端可能依赖)
|
||||
approvalOpinion: '', // 初始化审批意见为空白
|
||||
approvalResult: '', // 审批状态
|
||||
targetNodeName: '' // 审批节点
|
||||
}
|
||||
} else {
|
||||
// 情况2:variables 已存在 → 保留原有字段,补充 approvalOpinion(无则添加,有则保留原值)
|
||||
this.taskForm.variables = {
|
||||
...this.taskForm.variables, // 展开原有所有字段(如 variables、其他自定义字段)
|
||||
approvalOpinion: this.taskForm.variables.approvalOpinion || '', // 兜底:若原有未定义则设为空白
|
||||
approvalResult: this.taskForm.variables.approvalResult || '',
|
||||
targetNodeName: this.taskForm.variables.targetNodeName || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user