From eb61d10504541386301256a2bc6d38ce7ff2e8e2 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 10 Jul 2024 09:46:59 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E6=96=B0=E6=B3=95=E8=A7=84=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/enums/commonEnums.js | 2 +- .../NewRegulationIntroductionProcess.vue | 65 ++++++++++--------- .../modules/BaseInfoForm.vue | 30 ++++----- 3 files changed, 50 insertions(+), 47 deletions(-) diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 477171c..577dc21 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -143,7 +143,7 @@ export const IsReadOnlyEnums = { // 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中 export const ProcessKey = { // 新法规导入流程 - NEW_REGULATIONS_IMPORT: { text: '', value: '' }, + NEW_REGULATIONS_IMPORT: { text: 'new_standard_import', value: 'new_standard_import' }, // 标准解读流程 STANDARD_INTERPRETATION_PROCESS: { text: 'standard_interpret', value: 'standard_interpret' }, // 法规符合性排查流程 diff --git a/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue b/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue index 122b361..4b116ad 100644 --- a/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue +++ b/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue @@ -27,7 +27,7 @@ + v-decorator="['processName', validatorRules.processName]" /> @@ -41,7 +41,7 @@ style="width: 100%" :disabled="disabled" value-format="YYYY-MM-DD" - v-decorator="['dueTime']" /> + v-decorator="['processDueDate']" /> @@ -55,7 +55,7 @@ :maxLength="500" :rows="4" :disabled="disabled" - v-decorator="['prcMes']" /> + v-decorator="['processDescription']" /> @@ -79,11 +79,11 @@ + v-decorator="['handleText', validatorRules.handleText]" /> - + @@ -249,13 +249,13 @@ export default { }, validatorRules: { // 流程名称 - prcName: { + processName: { rules: [ { required: true, message: this.$t('pleaseEnter') + this.$t('processName') } ], validateTrigger: 'blur' }, - commitText: { + handleText: { rules: [ { required: false, message: this.$t('pleaseEnter') + this.$t('remarks') } ], @@ -286,19 +286,19 @@ export default { this.$nextTick(() => { if (type === 'todo') { // 初始化流程信息 - this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes')) + this.processInfoForm.setFieldsValue(pick(this.model.common, 'processName', 'processDueDate', 'processDescription')) } // 有草稿json按草稿进来的回显 if (this.model.infoJsonStr) { // 初始化流程信息 const prcObj = Object.assign({}, this.model) - prcObj.dueTime = this.model.processDueDate - prcObj.prcMes = this.model.processDescription - this.processInfoForm.setFieldsValue(pick(prcObj, 'prcName', 'dueTime', 'prcMes')) + prcObj.processDueDate = this.model.processDueDate + prcObj.processDescription = this.model.processDescription + this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription')) // 初始化流程审批信息 - prcObj.commitText = this.model.handleText - prcObj.commitFile = this.model.handleFile - this.approvalInfoForm.setFieldsValue(pick(prcObj, 'commitText', 'commitFile')) + 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 // 如果是节点1的保存回显人员信息 if (this.currentNode === 1) { @@ -323,9 +323,9 @@ export default { }, // 业务基本信息组件中获取到流程名称改变后的值 processNameChange (value) { - const param = { prcName: value } + const param = { processName: value } this.$nextTick(() => { - this.processInfoForm.setFieldsValue(pick(param, 'prcName')) + this.processInfoForm.setFieldsValue(pick(param, 'processName')) }) }, // 保存 @@ -353,14 +353,9 @@ export default { const paramObj = {} // 流程信息 paramObj.basicProcessInfoDTO = Object.assign({}, processInfoForm) - paramObj.basicProcessInfoDTO.processName = paramObj.basicProcessInfoDTO.prcName - paramObj.basicProcessInfoDTO.processDueDate = paramObj.basicProcessInfoDTO.dueTime - paramObj.basicProcessInfoDTO.processDescription = paramObj.basicProcessInfoDTO.prcMes paramObj.basicProcessInfoDTO.processInstanceId = this.$route.query.processInstanceId // 流程审批信息 paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm) - paramObj.basicTaskInfoDTO.handleText = paramObj.basicTaskInfoDTO.commitText - paramObj.basicTaskInfoDTO.handleFile = paramObj.basicTaskInfoDTO.commitFile paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId // 草稿id if (this.model.infoJsonStr) { @@ -390,6 +385,7 @@ export default { this.processInfoForm.validateFields((err, values) => { // 流程审批信息的校验 this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => { + // 获取业务信息businessInfoDTO const data = await this.$refs.baseInfoRef.getDataValidate() if (!err && !approvalErr && data) { // 人员信息的数据, 处理成对象 @@ -400,13 +396,20 @@ export default { } this.loading = true const paramObj = {} // 需要传给后端的数据 - paramObj.common = { ...values, ...approvalValues } + // 流程信息 + paramObj.basicProcessInfoDTO = values + // 流程审批信息 + paramObj.basicTaskInfoDTO = approvalValues // 草稿id if (this.model.infoJsonStr) { - paramObj.common.draftId = this.model.id + paramObj.draftId = this.model.id } - paramObj.flowUser = personnelObj - paramObj.data = data.formInline + // 人员信息 + paramObj.userInfoMap = personnelObj + // 业务信息 + paramObj.businessInfoDTO = data + // JSON字符串 + paramObj.infoJsonStr = JSON.stringify(paramObj) let func if (this.$route.query.taskId) { // 有taskId说明是驳回的提交 @@ -459,9 +462,9 @@ export default { // 同意 handleAgree () { if (this.loading) return - this.validatorRules.commitText.rules[0].required = false - if (!this.approvalInfoForm.getFieldValue('commitText')) { - this.approvalInfoForm.setFieldsValue({ commitText: '同意' }) + this.validatorRules.handleText.rules[0].required = false + if (!this.approvalInfoForm.getFieldValue('handleText')) { + this.approvalInfoForm.setFieldsValue({ handleText: '同意' }) } this.approvalInfoForm.validateFields((err, values) => { if (!err) { @@ -484,8 +487,8 @@ export default { // 驳回 handleReject () { if (this.loading) return - this.validatorRules.commitText.rules[0].required = true - if (!this.approvalInfoForm.getFieldValue('commitText')) { + this.validatorRules.handleText.rules[0].required = true + if (!this.approvalInfoForm.getFieldValue('handleText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) this.switchValue = 'base' } @@ -505,7 +508,7 @@ export default { this.loading = false } }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + this.validatorRules.handleText.rules[0].required = false }) } }) diff --git a/src/views/workCenter/newRegulationIntroductionProcess/modules/BaseInfoForm.vue b/src/views/workCenter/newRegulationIntroductionProcess/modules/BaseInfoForm.vue index 69a142b..06d4a1f 100644 --- a/src/views/workCenter/newRegulationIntroductionProcess/modules/BaseInfoForm.vue +++ b/src/views/workCenter/newRegulationIntroductionProcess/modules/BaseInfoForm.vue @@ -82,9 +82,9 @@ {{ $t('workCenter.newRegulationImportProcess.stageWeAreIn') }} - + - + @@ -151,11 +151,11 @@ {{ $t('workCenter.newRegulationImportProcess.briefDescription') }} - + + v-model="formInline.requireBriefDesc" :rows="4" /> @@ -210,7 +210,7 @@ export default { } ], // 所处阶段 - stageWeAreIn: [ + eventPhase: [ { required: true, message: this.$t('workCenter.newRegulationImportProcess.stageWeAreIn') + this.$t('cannotEmpty'), @@ -226,7 +226,7 @@ export default { } ], // 抄送人员 - ccPerson: [ + copyUser: [ { required: true, message: this.$t('workCenter.newRegulationImportProcess.ccPerson') + this.$t('cannotEmpty'), @@ -242,7 +242,7 @@ export default { this.getCountryOption() }, methods: { - // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 + // 拿到外面传进来的businessInfoDTO initData (data) { // 给表单赋值 this.formInline = Object.assign({}, data) @@ -250,17 +250,17 @@ export default { }, // 外层要获取数据 getData () { - // 把数据抛出 - const data = {} - data.formInline = this.formInline + // 组合businessInfoDTO,抛出 + const data = Object.assign({}, this.formInline) return data }, // 外层获取数据要过校验,返回false表示没有通过校验 async getDataValidate () { + // 内部校验完成后抛出businessInfoDTO需要的格式数据,抛出 let data = {} await this.$refs.ruleForm.validate(valid => { if (valid) { - data.formInline = this.formInline + data = Object.assign({}, this.formInline) } else { data = false }