From 751a4a2c11323fbce1dda436a25422bab69e46f1 Mon Sep 17 00:00:00 2001 From: danshihao Date: Fri, 1 Dec 2023 10:11:38 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=81=E6=A0=87=E7=A8=BD=E6=9F=A5?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workCenter.js | 20 ++- src/enums/commonEnums.js | 8 +- .../EnterpriseStandardInspectionPlanFlow.vue | 5 + .../EnterpriseStandardInspectionProcess.vue | 13 +- .../modules/InspectionProcessReportModal.vue | 3 +- ...erpriseStandardInspectionRectification.vue | 111 +++++++-------- .../modules/BaseInfoForm.vue | 130 +++++++++--------- .../InspectionExtensionRequestProcess.vue | 18 ++- .../modules/ExtensionRequestTableModal.vue | 4 +- 9 files changed, 173 insertions(+), 139 deletions(-) diff --git a/src/api/workCenter.js b/src/api/workCenter.js index e95b7251..d9de7bb2 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -282,6 +282,18 @@ const addInspectExtensionTable = (params) => postAction('/esinspectdelayapply/pr // 延期申请流程表-编辑 const editInspectExtensionTable = (params) => postAction('/esinspectdelayapply/processEsInspectDelayApply/edit', params) +/* 企标稽查整改 */ +// 详情信息 +const getInspectRectifyDetail = (params) => getAction('/process/esInspectRectifyFlow/queryDetailByProjectId', params) +// 审批 +const approvalInspectRectify = (params) => postAction('/process/esInspectRectifyFlow/flowApproval', params) +// 转办 +const transferInspectRectify = (params) => getAction('/process/esInspectRectifyFlow/flowTransfer', params) +// 保存 +const saveInspectRectify = (params) => postAction('/process/esInspectRectifyFlow/flowSave', params) +// 企标稽查整改业务数据 +const getInspectRectifyDataById = (params) => getAction('/esinspectreport/processEsInspectRectify/queryByProjectId', params) + export { getProcessNodeList, @@ -423,5 +435,11 @@ export { transferInspectExtension, saveInspectExtension, addInspectExtensionTable, - editInspectExtensionTable + editInspectExtensionTable, + + getInspectRectifyDetail, + approvalInspectRectify, + transferInspectRectify, + saveInspectRectify, + getInspectRectifyDataById } diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 9d23b554..aca53861 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -198,7 +198,7 @@ export const ProcessKey = { // 稽查延期申请流程 INSPECTION_EXTENSION_REQUEST_PROCESS: { text: 'inspect_delay_apply_process', value: 'inspect_delay_apply_process' }, // 企标稽查整改 - ES_INSPECTION_RECTIFICATION: { text: 'inspect_plan', value: 'inspect_process' } + ES_INSPECTION_RECTIFICATION: { text: 'inspect_rectify', value: 'inspect_rectify' } } // 标准性质 @@ -285,9 +285,9 @@ export const InspectionExtensionRequestProcess = new EsEnums({ // 企标稽查整改 export const EsInspectionRectification = new EsEnums({ - uploadRectificationResult: { text: '整改负责人上传整改结果', value: '1', btn: 7 }, - directorLeaderApproval: { text: '负责人主管级领导审批', value: '2', btn: 27 }, - directorToExamine: { text: '稽查负责人审核', value: '3', btn: 6 } + uploadRectificationResult: { text: '整改负责人上传整改结果', value: 'responsible_start', btn: 7 }, + directorLeaderApproval: { text: '负责人主管级领导审批', value: 'leader_approval', btn: 27 }, + directorToExamine: { text: '稽查负责人审核', value: 'responsible_approval', btn: 6 } }) // 项目评估结果类型 diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue index 653cb133..938edf7a 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue @@ -479,6 +479,11 @@ export default { */ handleReject () { if (this.loading) return + // 驳回需要填写备注 + if (!this.approvalInfoForm.getFieldValue('commitText')) { + this.$message.warning(this.$t('pleaseEnterRemarks')) + return + } this.loading = true this.getPageParams().then(res => { res.map.pass = false diff --git a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue index c73c673d..aa97c015 100644 --- a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue +++ b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue @@ -108,7 +108,7 @@ import ProcessDetailList from '@comp/ProcessDetailList' import InspectionProcessTable from '@views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessTable' import UserSelectModal from '@comp/selection/UserSelectModal' -import { EsInspectionPlan, EsInspectionProcess, ProcessKey } from '@/enums/commonEnums' +import { EsInspectionProcess, ProcessKey } from '@/enums/commonEnums' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' import { approvalInspectProcess, @@ -196,7 +196,7 @@ export default { this.projectId = projectId this.btn = EsInspectionProcess.propertyOfValue('btn', this.currentNode) || 0 // 如果有nodeId,但是匹配不到任何节点,就是是增加的审批节点 - if (nodeId && !EsInspectionPlan.keyOfValue(nodeId)) { + if (nodeId && !EsInspectionProcess.keyOfValue(nodeId)) { // 审批和同意按钮 this.btn = 24 } @@ -240,7 +240,6 @@ export default { if (res.success) { const data = res.result || {} const processAll = data.processAll || {} - const map = data.map || {} const processApprovalRecord = data.processApprovalRecord || {} this.info = data // 页面回显 @@ -249,9 +248,6 @@ export default { dueTime: processAll.dueTime, prcMes: processAll.prcMes }) - this.countersignForm && this.countersignForm.setFieldsValue({ - pass: this.convertPass(map.pass) - }) this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({ commitText: processApprovalRecord.commitText, commitFile: processApprovalRecord.commitFile @@ -433,6 +429,11 @@ export default { */ handleReject () { if (this.loading) return + // 驳回需要填写备注 + if (!this.approvalInfoForm.getFieldValue('commitText')) { + this.$message.warning(this.$t('pleaseEnterRemarks')) + return + } this.loading = true this.getPageParams().then(res => { res.map.pass = false diff --git a/src/views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessReportModal.vue b/src/views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessReportModal.vue index 7ee6772f..7737b1fb 100644 --- a/src/views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessReportModal.vue +++ b/src/views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessReportModal.vue @@ -176,7 +176,8 @@ export default { }) } /** 赋值给当前对应的表单文件 */ - this.form.attachment = attIdList.join(',') + this.$set(this.form, 'attachment', attIdList.join(',')) + // this.form.attachment = attIdList.join(',') }, // 正则替换小数点 limitNumber (value) { diff --git a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue index 0fe21bea..93b227c0 100644 --- a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue +++ b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue @@ -76,7 +76,7 @@
- + @@ -108,7 +108,10 @@ import PersonnelInfo from '@comp/PersonnelInfo' import BaseInfoForm from '@views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm' import UserSelectModal from '@comp/selection/UserSelectModal' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' -import { getInspectPlanDetail, getInspectPlanProjectId } from '@api/workCenter' +import { + approvalInspectRectify, getInspectRectifyDataById, + getInspectRectifyDetail, saveInspectRectify, transferInspectRectify +} from '@api/workCenter' import { EsInspectionRectification, ProcessKey } from '@/enums/commonEnums' export default { @@ -136,9 +139,12 @@ export default { xs: { span: 24 }, sm: { span: 22 } }, + // 流程key + processKey: ProcessKey.ES_INSPECTION_RECTIFICATION.value, // 当前流程信息 EsInspectionRectification, info: {}, + formInfo: {}, currentNode: '', currentNodeName: '', // 项目id @@ -175,7 +181,7 @@ export default { }, // 节点标题 nodeTitle () { - return this.$route.query.taskName || EsInspectionRectification.initiate.text + return this.$route.query.taskName || EsInspectionRectification.uploadRectificationResult.text }, processDisabled () { return this.currentNode !== EsInspectionRectification.uploadRectificationResult.value @@ -184,52 +190,45 @@ export default { created () { const { projectId, nodeId, taskName } = this.$route.query // 发起、草稿进来没有nodeId,就默认发起节点 - this.currentNode = nodeId || EsInspectionRectification.initiate.value - this.currentNodeName = taskName || EsInspectionRectification.initiate.text + this.currentNode = nodeId || EsInspectionRectification.uploadRectificationResult.value + this.currentNodeName = taskName || EsInspectionRectification.uploadRectificationResult.text this.projectId = projectId - this.btn = EsInspectionRectification.propertyOfValue('btn', this.currentNode) + this.btn = EsInspectionRectification.propertyOfValue('btn', this.currentNode) || 0 + // 如果有nodeId,但是匹配不到任何节点,就是是增加的审批节点 + if (nodeId && !EsInspectionRectification.keyOfValue(nodeId)) { + // 审批和同意按钮 + this.btn = 24 + } // 查询人员信息 - this.getPersonInfoStructure(ProcessKey.ES_INSPECTION_RECTIFICATION.value, () => { - this.initPersonInfoData(this.currentNode === EsInspectionRectification.initiate.value) + this.getPersonInfoStructure(this.processKey, () => { + this.initPersonInfoData(this.currentNode === EsInspectionRectification.uploadRectificationResult.value) + }) + getInspectRectifyDataById({ projectId }).then(res => { + if (res.success) { + const data = res.result || {} + this.formInfo = data + this.$refs.baseInfoForm.initData(data) + } }) // 如果是待办进来,就获取详情数据 if (this.$route.query.projectId) { this.loadPage() - return } - // 如果是新建进来,就获取项目id - this.getProjectId() }, methods: { - /** - * 获取项目id - */ - getProjectId () { - this.loading = true - // 否则就是创建一个新的流程 - getInspectPlanProjectId().then(res => { - if (res) { - this.projectId = res + '' - } - }).finally(() => { - this.loading = false - }) - }, /** * 获取页面详情 */ loadPage () { const { projectId, taskId } = this.$route.query - this.btn = EsInspectionRectification.propertyOfValue('btn', this.currentNode) this.loading = true - getInspectPlanDetail({ + getInspectRectifyDetail({ projectId, taskId }).then(res => { if (res.success) { const data = res.result || {} const processAll = data.processAll || {} - const map = data.map || {} const processApprovalRecord = data.processApprovalRecord || {} this.info = data // 页面回显 @@ -238,9 +237,6 @@ export default { dueTime: processAll.dueTime, prcMes: processAll.prcMes }) - this.countersignForm && this.countersignForm.setFieldsValue({ - pass: this.convertPass(map.pass) - }) this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({ commitText: processApprovalRecord.commitText, commitFile: processApprovalRecord.commitFile @@ -267,27 +263,22 @@ export default { personnelObj[key] = personnelObj[key].split(',') } } - // 通过表格中的所属部门人员获取稽查征求意见对象 - const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity) - personnelObj.opinionFillList = Array.from(new Set(userList)) } return personnelObj }, // 获取页面参数 async getPageParams (isValidate = true) { - if (this.$refs.inspectionPlanTable.dataSource.length === 0) { - this.$message.warning(this.$t('addAtLeastOneRowOfData')) - throw new Error('base') - } const params = {} // 收集所有表单信息 let formDataList = [] if (isValidate) { formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm) + formDataList[2] = await this.$refs.baseInfoForm.getDataValidate() } else { formDataList = [ this.processInfoForm.getFieldsValue(), - this.approvalInfoForm.getFieldsValue() + this.approvalInfoForm.getFieldsValue(), + this.$refs.baseInfoForm.getData() ] } // 收集人员信息 @@ -296,6 +287,14 @@ export default { throw new Error('user') } + // 自动发起特殊流程,单独把人员信息存一份 + params.userInfo = this.$refs.personnelInfo.stepsData.map(item => { + return { + id: item.id, + linkUserIds: item.linkUserIds + } + }) + // 开始处理信息 // 流程信息 params.processAll = Object.assign({}, this.info.processAll, formDataList[0], { @@ -310,6 +309,11 @@ export default { params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], { projectId: this.projectId }) + + // 流程业务信息 + params.processEsInspectRectify = Object.assign({}, formDataList[2], { + id: this.formInfo.id + }) return params }, /** @@ -328,7 +332,7 @@ export default { taskId: this.$route.query.taskId, userId } - Promise.resolve(params).then(res => { + transferInspectRectify(params).then(res => { if (res.success) { this.$message.success(res.message) this.goBack() @@ -344,10 +348,10 @@ export default { */ handleSave () { if (this.loading) return - this.loading = true + // this.loading = true this.getPageParams(false).then(res => { console.log(res) - return Promise.resolve(res) + return saveInspectRectify(res) }).then(res => { if (res.success) { this.$message.success(res.message) @@ -366,19 +370,11 @@ export default { */ handleSubmit () { if (this.loading) return - this.loading = true - let fn - switch (this.currentNode) { - case EsInspectionRectification.uploadRectificationResult.value: - fn = Promise.resolve - break - default: - fn = Promise.resolve - break - } + // this.loading = true this.getPageParams().then(res => { console.log(res) - return fn && fn(res) + res.map.pass = true + return approvalInspectRectify(res) }).then(res => { if (res.success) { this.$message.success(res.message) @@ -400,7 +396,7 @@ export default { this.loading = true this.getPageParams().then(res => { res.map.pass = true - return Promise.resolve(res) + return approvalInspectRectify(res) }).then(res => { if (res.success) { this.$message.success(res.message) @@ -419,10 +415,15 @@ export default { */ handleReject () { if (this.loading) return + // 驳回需要填写备注 + if (!this.approvalInfoForm.getFieldValue('commitText')) { + this.$message.warning(this.$t('pleaseEnterRemarks')) + return + } this.loading = true this.getPageParams().then(res => { res.map.pass = false - return Promise.resolve(res) + return approvalInspectRectify(res) }).then(res => { if (res.success) { this.$message.success(res.message) diff --git a/src/views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm.vue b/src/views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm.vue index fe226191..d745415c 100644 --- a/src/views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm.vue +++ b/src/views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm.vue @@ -1,7 +1,7 @@