[update] 新法规导入流程-保存
This commit is contained in:
+20
-18
@@ -129,10 +129,13 @@ import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import pick from 'lodash.pick'
|
||||
import { NewRegulationsImportNodes, ProcessKey } from '../../../enums/commonEnums'
|
||||
import {
|
||||
newRegulationImportAgree, newRegulationImportApproval,
|
||||
newRegulationImportAgree,
|
||||
newRegulationImportApproval,
|
||||
newRegulationImportGetDataById,
|
||||
newRegulationImportGetDataDraft, newRegulationImportReject,
|
||||
newRegulationImportSave, newRegulationImportTurnTo
|
||||
newRegulationImportReject,
|
||||
newRegulationImportSave,
|
||||
newRegulationImportTurnTo,
|
||||
getDataDraft
|
||||
} from '../../../api/workCenter'
|
||||
|
||||
export default {
|
||||
@@ -214,6 +217,7 @@ export default {
|
||||
currentNodeName: '',
|
||||
currentNodeId: NewRegulationsImportNodes.initiated.value, // 当前节点id
|
||||
model: {},
|
||||
draftModel: {}, // 草稿Json转化的对象
|
||||
processInfoForm: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
@@ -277,7 +281,7 @@ export default {
|
||||
func = newRegulationImportGetDataById
|
||||
params = param.taskId
|
||||
} else {
|
||||
func = newRegulationImportGetDataDraft
|
||||
func = getDataDraft
|
||||
params = param
|
||||
}
|
||||
func(params).then(res => {
|
||||
@@ -290,23 +294,19 @@ export default {
|
||||
}
|
||||
// 有草稿json按草稿进来的回显
|
||||
if (this.model.infoJsonStr) {
|
||||
this.draftModel = JSON.parse(this.model.infoJsonStr)
|
||||
console.log('=========draftModel', this.draftModel)
|
||||
// 初始化流程信息
|
||||
const prcObj = Object.assign({}, this.model)
|
||||
prcObj.processDueDate = this.model.processDueDate
|
||||
prcObj.processDescription = this.model.processDescription
|
||||
this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription'))
|
||||
this.processInfoForm.setFieldsValue(pick(this.draftModel.basicProcessInfoDTO, 'processName', 'processDueDate', 'processDescription'))
|
||||
// 初始化流程审批信息
|
||||
prcObj.handleText = this.model.handleText
|
||||
prcObj.handleFile = this.model.handleFile
|
||||
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'handleText', 'handleFile'))
|
||||
this.model.data = JSON.parse(this.model.infoJsonStr).data
|
||||
this.approvalInfoForm.setFieldsValue(pick(this.draftModel.basicTaskInfoDTO, 'handleText', 'handleFile'))
|
||||
// 如果是节点1的保存回显人员信息
|
||||
if (this.currentNode === 1) {
|
||||
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj)
|
||||
this.draftInitPersonInfo(this.draftModel.userInfoMap)
|
||||
}
|
||||
}
|
||||
if (this.$refs.baseInfoRef) {
|
||||
this.$refs.baseInfoRef.initData(this.model.businessInfoDTO)
|
||||
this.$refs.baseInfoRef.initData(this.draftModel.businessInfoDTO || this.model.businessInfoDTO)
|
||||
}
|
||||
})
|
||||
// 初始化业务基本信息中组件内容
|
||||
@@ -342,6 +342,7 @@ export default {
|
||||
const personnelObj = this.$refs.personnelInfo.getDataObj()
|
||||
// 业务基本信息
|
||||
const baseInfo = this.$refs.baseInfoRef.getData()
|
||||
// 判断是否每一项都没填
|
||||
const param = { ...processInfoForm, ...baseInfo.formInline, ...approvalInfoForm, ...personnelObj }
|
||||
const flag = Object.values(param).some(v => !!v || v === 0)
|
||||
if (!flag) {
|
||||
@@ -361,11 +362,12 @@ export default {
|
||||
if (this.model.infoJsonStr) {
|
||||
paramObj.draftId = this.model.id
|
||||
}
|
||||
// 业务信息
|
||||
paramObj.businessInfoDTO = baseInfo
|
||||
// 人员信息
|
||||
paramObj.userInfoMap = personnelObj
|
||||
// 业务基本信息和人员信息
|
||||
paramObj.infoJsonStr = JSON.stringify({
|
||||
data: baseInfo.formInline,
|
||||
personnelObj: personnelObj
|
||||
})
|
||||
paramObj.infoJsonStr = JSON.stringify(paramObj)
|
||||
this.loading = true
|
||||
// 保存到草稿
|
||||
newRegulationImportSave(paramObj).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user