From 39bb7afd200811e2c023fcbb13e765d5bc7cc88e Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 31 Oct 2023 11:02:29 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E8=81=94=E8=B0=83=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E5=88=B6=E4=BF=AE=E8=AE=A2=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workCenter.js | 18 ++-- .../RevisionPlanActivelyReportFlow.vue | 93 +++++++++++++++---- .../modules/ContactEnterSendTaskForm.vue | 34 +++---- .../modules/EngineerInitForm.vue | 6 +- .../RevisionPlanStandardizationInitFlow.vue | 69 ++++++++++---- .../modules/EngineerInitBaseInfo.vue | 14 ++- 6 files changed, 165 insertions(+), 69 deletions(-) diff --git a/src/api/workCenter.js b/src/api/workCenter.js index fcdc4043..223f1526 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -31,25 +31,25 @@ const getProcessDataById = (taskId, params) => getAction(`/process/es/initChange // 发起 const activelyReportApproval = (params) => postAction('/process/es/annualReport/start', params) // 保存 -const activelyReportSave = (params) => postAction('', params) +const activelyReportSave = (params) => postAction('/process/es/annualReport/save', params) // 转办 -const activelyReportTurnTo = (params) => postAction('', params) +const activelyReportTurnTo = (params) => postAction('/process/es/annualReport/transfer', params) // 同意 -const activelyReportAgree = (params) => postAction('', params) +const activelyReportAgree = (params) => postAction('/process/es/annualReport/agree', params) // 拒绝 -const activelyReportReject = (params) => postAction('', params) +const activelyReportReject = (params) => postAction('/process/es/annualReport/reject', params) // 年度制修订计划(标准化发起) // 发起 -const standardizationInitApproval = (params) => postAction('', params) +const standardizationInitApproval = (params) => postAction('/process/es/annualInit/start', params) // 保存 -const standardizationInitSave = (params) => postAction('', params) +const standardizationInitSave = (params) => postAction('/process/es/annualInit/save', params) // 转办 -const standardizationInitTurnTo = (params) => postAction('', params) +const standardizationInitTurnTo = (params) => postAction('/process/es/annualInit/transfer', params) // 同意 -const standardizationInitAgree = (params) => postAction('', params) +const standardizationInitAgree = (params) => postAction('/process/es/annualInit/agree', params) // 拒绝 -const standardizationInitReject = (params) => postAction('', params) +const standardizationInitReject = (params) => postAction('/process/es/annualInit/reject', params) // 企标更改流程 // 保存 diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue index 5f25d400..ff8f7d8d 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue @@ -26,7 +26,7 @@ @change="event => event.target.value = event.target.value.trim()" :disabled="disabled || processInfoDisabled" :maxLength="50" - v-decorator="['processName', validatorRules.processName]" /> + v-decorator="['prcName', validatorRules.prcName]" /> @@ -36,7 +36,7 @@ style="width: 100%" :disabled="disabled || processInfoDisabled" value-format="YYYY-MM-DD" - v-decorator="['expirationDate']" /> + v-decorator="['dueTime']" /> @@ -46,7 +46,7 @@ :maxLength="500" :rows="4" :disabled="disabled || processInfoDisabled" - v-decorator="['processExplain']" /> + v-decorator="['prcMes']" /> @@ -56,7 +56,7 @@ :maxLength="500" :rows="4" disabled - v-decorator="['revisionPlanDesc']" /> + v-decorator="['processDescription']" /> @@ -87,11 +87,11 @@ + v-decorator="['commitText', validatorRules.commitText]" /> - + @@ -158,20 +158,25 @@ import { activelyReportAgree, activelyReportReject } from '@/api/workCenter' +import Vue from 'vue' +import { USER_INFO } from '@/store/mutation-types' const personData = [ { id: 1, nodeName: '标准化工程师发起', nodeRoleName: '发起人', - canChoose: false + canChoose: false, + userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')', + fieldName: 'standardEngineer' }, { id: 2, nodeName: '各部门联络人填写/下发任务', nodeRoleName: '各部门联络人', canChoose: true, - chooseType: 'checkbox' + chooseType: 'checkbox', + fieldName: 'contactUserList' }, { id: 3, @@ -269,7 +274,7 @@ export default { onlyLook: false, validatorRules: { // 流程名称 - processName: { + prcName: { rules: [ { required: true, @@ -279,7 +284,7 @@ export default { validateTrigger: 'blur' }, // 备注 - remarks: { + commitText: { rules: [ { required: false, @@ -318,15 +323,43 @@ export default { } // 需要传给后端的 let param = {} + param.common = { ...processInfoForm, ...approvalInfoForm } + param.flowUser = personnelObj // 业务基本信息 if (this.$refs.baseInfoFormRef) { - // 业务基本信息 - let ruleForm = this.$refs.baseInfoFormRef.getData() - if ([1, 2, 3].includes(this.currentNode)) { - // 业务基本信息中有表单 - } - if ([2, 3, 5].includes(this.currentNode)) { - // 业务基础信息中有可编辑表格 todo: 看后端要什么格式 + const ruleForm = this.$refs.baseInfoFormRef.getData() + if (this.currentNode === 1) { + // 只有表单 + param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } + const flag = Object.values(param).some(v => !!v || v === 0) + if (!flag) { + // 提示至少填写一项 + this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) + return + } + param.dataList = [ruleForm.formInline] + } else if ([2, 3].includes(this.currentNode)) { + // 业务基本信息有表单也有表格 + param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } + const flag = Object.values(param).some(v => !!v || v === 0) + if (!flag || ruleForm.dataSource.length <= 0) { + // 提示至少填写一项 + this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) + return + } + param.dataList = ruleForm.dataSource.map(item => { + return { ...item, ...ruleForm.formInline } + }) + } else if (this.currentNode === 5) { + param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj } + const flag = Object.values(param).some(v => !!v || v === 0) + if (!flag || ruleForm.dataSource.length <= 0) { + // 提示至少填写一项 + this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) + return + } + // 业务基础信息中只有表格 + param.dataList = ruleForm.dataSource } } else { // 需要外层信息至少填了一项 @@ -361,6 +394,8 @@ export default { personnelObj[item.fieldName] = item.user } } + // 发起人,标准化工程师设置为当前登录人 + personnelObj.standardEngineer = Vue.ls.get(USER_INFO).id // 校验是否填了所有能填的人员信息 if (!Object.values(personnelObj).every(v => !!v)) { this.$message.warning(this.$t('pleaseEnterPersonnelInfo')) @@ -375,6 +410,8 @@ export default { if (!err && !approvalErr && data) { this.loading = true const param = {} // 需要给后端的参数 + param.common = { ...values, ...approvalValues, ...data.formInline } + param.flowUser = personnelObj activelyReportApproval(param).then(res => { if (res.success) { this.$message.success(res.message) @@ -422,8 +459,28 @@ export default { this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { this.$refs.baseInfoFormRef.getDataValidate(data => { if (approvalErr && data) { + this.loading = true + const param = {} // 传给后端的参数 // 节点2,3有表单和表格,节点4只有表格 - // param = + if ([2, 3].includes(this.currentNode)) { + // 业务基本信息有表单也有表格 + param.common = approvalValues + param.dataList = data.dataSource.map(item => { + return { ...item, ...data.formInline } + }) + } else if (this.currentNode === 5) { + param.common = approvalValues + param.dataList = data.dataSource + } + activelyReportAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) } }) }) diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue index 112fe06c..d881197a 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue @@ -11,19 +11,19 @@ {{ $t('workCenter.revisionPlanActivelyReport.whetherToSendAContact') }} - - - + + + {{ $t('yes') }} - + {{ $t('not') }} -