update 强制撤回

This commit is contained in:
danshihao
2024-01-18 18:44:04 +08:00
parent 27f0c5cca8
commit 68fb13622a
5 changed files with 137 additions and 94 deletions
@@ -312,25 +312,6 @@ export default {
loadPage () {
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
// 获取业务数据
getPermissionApplyDataById({ projectId: this.projectId }).then(res => {
if (res.success) {
const data = res.result || {}
const list = data.lawsEnterpriseStandardList || []
// 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据
this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list)
this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list)
// 保存并回显表单信息
this.info = cloneDeep(data)
this.formInfo = data
this.baseInfoForm.setFieldsValue({
expirationDate: data.expirationDate,
userDictText: data.userDictText,
standardNumbers: data.standardNumbers,
applyDetail: data.applyDetail
})
}
})
// 获取流程数据
getPermissionApplyDetail({
projectId,
@@ -354,13 +335,49 @@ export default {
// 草稿状态回显
if (draftId) {
const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}')
console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo)
const infoJson = JSON.parse(data.infoJsonStr || '{}')
console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson)
// 节点1 回显人员信息
if (this.isInitiate) {
this.draftInitPersonInfo(personInfo)
this.draftInitPersonInfo(infoJson.personInfo)
}
// 回显业务信息(需要等后端调整)
// 回显业务信息,如果有标识属性就是强制撤回
if (Object.hasOwnProperty.call(infoJson, 'revocation')) {
const data = infoJson.draftData
const list = data.lawsEnterpriseStandardList || []
// 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据
this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list)
this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list)
// 保存并回显表单信息
this.info = cloneDeep(data)
this.formInfo = data
this.baseInfoForm.setFieldsValue({
expirationDate: data.expirationDate,
userDictText: data.userDictText,
standardNumbers: data.standardNumbers,
applyDetail: data.applyDetail
})
}
} else {
// 非草稿获取业务数据
getPermissionApplyDataById({ projectId: this.projectId }).then(res => {
if (res.success) {
const data = res.result || {}
const list = data.lawsEnterpriseStandardList || []
// 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据
this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list)
this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list)
// 保存并回显表单信息
this.info = cloneDeep(data)
this.formInfo = data
this.baseInfoForm.setFieldsValue({
expirationDate: data.expirationDate,
userDictText: data.userDictText,
standardNumbers: data.standardNumbers,
applyDetail: data.applyDetail
})
}
})
}
}
}).finally(() => {
@@ -466,6 +483,14 @@ export default {
params.processEsPermissionApply.standardNumbers = this.$refs.baseInfoTable.getStandardNumbers()
params.processEsPermissionApply.userId = this.$store.getters.userInfo.id
}
// 保存草稿信息
params.infoJsonStr = JSON.stringify({
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj(),
// 业务数据,用于强制撤回后回显
draftData: params.processEsPermissionApply
})
return params
},
/**
@@ -502,13 +527,6 @@ export default {
if (this.loading) return
this.loading = true
this.getPageParams(false).then(res => {
// 保存草稿信息
res.infoJsonStr = JSON.stringify({
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj()
// 业务数据(需要等后端调整)
// draftData:
})
// 1待办 2草稿
res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1
console.log(res)