From 9ab2eb4c24906c9d5f16af0b3f3d85456c3e98ff Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 24 Oct 2023 17:59:40 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E8=B0=83=E5=B9=B4=E5=BA=A6=E5=88=B6?= =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E8=AE=A1=E5=88=92=E4=B8=A4=E4=B8=AA=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workCenter.js | 42 ++++- src/common/lang/workCenter/en.js | 5 +- src/common/lang/workCenter/zh.js | 5 +- src/components/selection/UserSelectModal.vue | 2 +- .../RevisionPlanActivelyReportFlow.vue | 169 +++++++++++++----- .../modules/ContactEnterSendTaskForm.vue | 42 ++++- .../modules/ContactEnterSendTaskModal.vue | 35 +++- .../modules/ContactEnterStandardForm.vue | 42 ++++- .../modules/EngineerInitForm.vue | 35 +++- .../modules/OnlyTableForm.vue | 10 +- .../RevisionPlanStandardizationInitFlow.vue | 130 ++++++++++---- .../modules/BaseInfoTableModal.vue | 116 +++++++++++- .../modules/ContactSelectApproverBaseInfo.vue | 64 +++++-- .../modules/EngineerInitBaseInfo.vue | 80 +++++++-- .../modules/LeaderApproveSentBaseInfo.vue | 64 +++++-- .../modules/TableBaseInfo.vue | 26 +++ .../PlanApprovalChangeFlow.vue | 3 + 17 files changed, 711 insertions(+), 159 deletions(-) diff --git a/src/api/workCenter.js b/src/api/workCenter.js index 586f3292..c12c32d4 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -29,13 +29,29 @@ const getEnStandardNo = (params) => postAction('/process/es/initChange/getStanda // 根据流程id获取流程信息 const getProcessDataById = (params) => getAction('/process/center/handle', params) +// 年度制修订计划(各部门主动上报) +// 发起 +const activelyReportApproval = (params) => postAction('/process/es/annualReport/start', params) +// 保存 +const activelyReportSave = (params) => postAction('', params) +// 转办 +const activelyReportTurnTo = (params) => postAction('', params) +// 同意 +const activelyReportAgree = (params) => postAction('', params) +// 拒绝 +const activelyReportReject = (params) => postAction('', params) + // 年度制修订计划(标准化发起) -// 批量设置联络人 -const standardizationInitBatchSetContact = (params) => getAction('', params) -// 批量设置审批人 -const standardizationInitBatchSetApprover = (params) => getAction('', params) -// 批量设置主起草人 -const standardizationInitBatchSetDrafter = (params) => getAction('', params) +// 发起 +const standardizationInitApproval = (params) => postAction('', params) +// 保存 +const standardizationInitSave = (params) => postAction('', params) +// 转办 +const standardizationInitTurnTo = (params) => postAction('', params) +// 同意 +const standardizationInitAgree = (params) => postAction('', params) +// 拒绝 +const standardizationInitReject = (params) => postAction('', params) // 流程中心 // 待办-转办 @@ -58,9 +74,17 @@ export { getEnStandardNo, getProcessDataById, - standardizationInitBatchSetContact, - standardizationInitBatchSetApprover, - standardizationInitBatchSetDrafter, + activelyReportApproval, + activelyReportSave, + activelyReportTurnTo, + activelyReportAgree, + activelyReportReject, + + standardizationInitApproval, + standardizationInitSave, + standardizationInitTurnTo, + standardizationInitAgree, + standardizationInitReject, toDoTurnTo, compulsoryWithdrawal diff --git a/src/common/lang/workCenter/en.js b/src/common/lang/workCenter/en.js index ce7f8379..3ebd6a3d 100644 --- a/src/common/lang/workCenter/en.js +++ b/src/common/lang/workCenter/en.js @@ -99,7 +99,10 @@ module.exports = { batchSetApprover: '批量设置审批人', approver: '审批人', batchSetDrafter: '批量设置主起草人', - drafter: '主起草人' + drafter: '主起草人', + pleaseSelectContact: '请选择联络人', + pleaseSelectApprover: '请选择审批人', + pleaseSelectDrafter: '请选择主起草人' }, // 企标制修订流程 enStandardRevision: { diff --git a/src/common/lang/workCenter/zh.js b/src/common/lang/workCenter/zh.js index ed6580a8..ae99648a 100644 --- a/src/common/lang/workCenter/zh.js +++ b/src/common/lang/workCenter/zh.js @@ -99,7 +99,10 @@ module.exports = { batchSetApprover: '批量设置审批人', approver: '审批人', batchSetDrafter: '批量设置主起草人', - drafter: '主起草人' + drafter: '主起草人', + pleaseSelectContact: '请选择联络人', + pleaseSelectApprover: '请选择审批人', + pleaseSelectDrafter: '请选择主起草人' }, // 企标制修订流程 enStandardRevision: { diff --git a/src/components/selection/UserSelectModal.vue b/src/components/selection/UserSelectModal.vue index d8ab48f8..14f8dde5 100644 --- a/src/components/selection/UserSelectModal.vue +++ b/src/components/selection/UserSelectModal.vue @@ -307,8 +307,8 @@ export default { this.$message.warning(this.$t('docTool.split.pleaseSelectUser')) return } - this.$emit('change', this.selectedRowKeys.join(',')) this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(',')) + this.$emit('change', this.selectedRowKeys.join(',')) this.close() }, handleCancel () { diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue index 2996434f..5f25d400 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue @@ -14,7 +14,7 @@ -
+
{{ $t('processInformation') }}
@@ -24,7 +24,7 @@ @@ -34,7 +34,7 @@ @@ -45,7 +45,7 @@ @@ -65,19 +65,19 @@
{{ $t('basicServiceInformation') }}
- + - + - + - + - + - + - +
{{ $t('processApprovalInformation') }}
@@ -97,9 +97,9 @@
-
+
- +
@@ -151,6 +151,13 @@ import ProcessDetailList from '../../../components/ProcessDetailList' import ContactEnterStandardForm from './modules/ContactEnterStandardForm' import OnlyTableForm from './modules/OnlyTableForm' import UserSelectModal from '@/components/selection/UserSelectModal' +import { + activelyReportApproval, + activelyReportSave, + activelyReportTurnTo, + activelyReportAgree, + activelyReportReject +} from '@/api/workCenter' const personData = [ { @@ -217,6 +224,10 @@ export default { computed: { pageTitle () { return this.$t('flowCenter') + this.$route.meta.title + }, + // 流程信息不能编辑 + processInfoDisabled () { + return this.currentNode !== 1 } }, mounted () { @@ -278,7 +289,7 @@ export default { validateTrigger: 'blur' } }, - currentNode: 3, + currentNode: 1, approvalInfoForm: this.$form.createForm(this), // 审批信息表单 personnelInfoData: [], // 人员信息数据 url: { @@ -295,15 +306,6 @@ export default { // 有任意一项填了即可 // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() - // 业务基本信息 - let ruleForm = {} - if ([1, 2, 3].includes(this.currentNode)) { - // 业务基本信息中有表单 - ruleForm = this.$refs.basicInfoFormRef.formInline - } - if ([2, 3, 5].includes(this.currentNode)) { - // 业务基础信息中有可编辑表格 todo: 看后端要什么格式 - } // 流程审批信息 const approvalInfoForm = this.approvalInfoForm.getFieldsValue() // 人员信息的数据, 处理成对象 @@ -315,12 +317,20 @@ export default { } } // 需要传给后端的 + let param = {} // 业务基本信息 - if (this.$refs.basicInfoFormRef) { - + 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: 看后端要什么格式 + } } else { // 需要外层信息至少填了一项 - const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj } + param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag) { // 提示至少填写一项 @@ -328,14 +338,17 @@ export default { return } } + this.loading = true // 保存到草稿 - // enterprisePlanApprovalSave(arr).then(res => { - // if (res.success) { - // this.$message.success(res.message) - // } else { - // this.$message.warning(res.message) - // } - // }) + activelyReportSave(param).then(res => { + if (res.success) { + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) }, // 节点一时候的提交,发起变更 handleStart () { @@ -353,9 +366,26 @@ export default { this.$message.warning(this.$t('pleaseEnterPersonnelInfo')) return } + // 流程信息校验 this.processInfoForm.validateFields((err, values) => { + // 流程审批信息校验 this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { - + // 需要校验业务基本信息中的表单 + this.$refs.baseInfoFormRef.getDataValidate(data => { + if (!err && !approvalErr && data) { + this.loading = true + const param = {} // 需要给后端的参数 + activelyReportApproval(param).then(res => { + if (res.success) { + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + } + }) }) }) }, @@ -373,29 +403,70 @@ export default { const param = Object.assign({}, values) param.userId = userIds param.taskId = this.$route.query.taskId - // enterprisePlanApprovalTurnTo(param).then(res => { - // if (res.success) { - // this.$message.success(res.message) - // } else { - // this.$message.warning(res.message) - // } - // }).finally(() => { - // this.loading = false - // }) + activelyReportTurnTo(param).then(res => { + if (res.success) { + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) } }) }, - // 提交 + // 提交(节点2,3,5有提交) handleSubmit () { - + if (this.loading) return + // 流程审批信息校验 + this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { + this.$refs.baseInfoFormRef.getDataValidate(data => { + if (approvalErr && data) { + // 节点2,3有表单和表格,节点4只有表格 + // param = + } + }) + }) }, - // 同意 + // 同意(节点4,6有同意) handleAgree () { - + if (this.loading) return + this.approvalInfoForm.validateFields((err, values) => { + if (!err) { + this.loading = true + const param = Object.assign({}, values) + param.taskId = this.$route.query.taskId + activelyReportAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + } + }) }, - // 驳回 + // 驳回(节点4,6有驳回) handleReject () { - + if (this.loading) return + this.approvalInfoForm.validateFields((err, values) => { + if (!err) { + this.loading = true + const param = Object.assign({}, values) + param.taskId = this.$route.query.taskId + activelyReportReject(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 9c38066f..112fe06c 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue @@ -120,13 +120,53 @@ export default { } ] }, - modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标 + modalType: '', // 是在新增还是在编辑,编辑的时候放正在编辑的下标 + data: undefined } }, methods: { // 选择用户得到用户名 userSelectNameChange (value, fieldName) { this.formInline[fieldName + '_dictText'] = value + }, + // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 + initData (data) { + this.data = data + // 给表单赋值 + // this.formInline = + // 给表格赋值 + // this.$nextTick(() => { + // this.$refs.tableRef.dataSource = + // }) + }, + // 外层要获取数据 + getData () { + // 把数据抛出 + const data = {} + data.formInline = this.formInline + data.dataSource = this.$refs.tableRef.dataSource + return data + }, + // 外层获取数据要过校验,返回false表示没有通过校验 + getDataValidate (callback) { + // 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人 + this.$refs.ruleForm.validate(result => { + if (result) { + if (this.$refs.tableRef.dataSource && this.$refs.tableRef.dataSource.length > 0) { + const data = {} + data.formInline = this.formInline + data.dataSource = this.$refs.tableRef.dataSource + callback(data) + } else { + this.$message.warning(this.$t('addAtLeastOneRowOfData')) + const data = false + callback(data) + } + } else { + const data = false + callback(data) + } + }) } } } diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskModal.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskModal.vue index 0b1c4793..4d948c1a 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskModal.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskModal.vue @@ -25,8 +25,9 @@ - {{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }} + {{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}
@@ -494,6 +495,21 @@ type="radio" />
+ +
+
+ * + + {{ $t('workCenter.enterpriseInitChangePlan.suitUnit') }} + +
+ + + +
@@ -509,7 +525,7 @@