From cc8f2945bce958414088372c79c82f802c9a1353 Mon Sep 17 00:00:00 2001 From: danshihao Date: Tue, 12 Dec 2023 19:10:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=81=E6=A0=87=E7=A8=BD=E6=9F=A5?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E6=84=8F=E8=A7=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseStandardInspectionPlanFlow.vue | 24 +++++++++++++++++++ .../modules/InspectionPlanTable.vue | 12 +++++++++- .../modules/WriteOpinionModal.vue | 6 ++--- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue index 3daabb36..c48629b7 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue @@ -427,6 +427,30 @@ export default { */ handleSubmit () { if (this.loading) return + // 节点2,验证所有数据意见是否都已填写 + if (this.currentNode === EsInspectionPlan.fillInComments.value) { + // 当前登录用户,查找意见为空的数据 + const currentUserName = this.$store.getters.userInfo.username + const opinionHasEmpty = this.$refs.inspectionPlanTable.dataSource.find(item => { + // 自己的数据就不用填写意见 + if (item.createBy === currentUserName) { + return false + } + // 如果意见字段为空,或者没有意见数据,就是没填的数据 + if (!item.processEsInspectPlanOpinionList || !item.processEsInspectPlanOpinionList.length) { + return true + } + // 如果有意见信息,从中找自己的数据,没找到自己的数据,就是没填的数据 + const selfOpinionData = item.processEsInspectPlanOpinionList.find(childItem => { + return childItem.createBy === currentUserName + }) + return !selfOpinionData + }) + if (opinionHasEmpty) { + this.$message.warning(this.$t('pleaseCompleteTableInfo')) + return + } + } // 有taskId说明已经发起过,调审批接口,否则调发起接口 if (this.$route.query.taskId) { this.handleAgree(true) diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue index b0f14a97..671d1d43 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue @@ -48,7 +48,7 @@ @@ -238,6 +238,10 @@ export default { } }, computed: { + // 当前登录用户名 + currentUserName () { + return this.$store.getters.userInfo.username + }, // 是否显示表格操作按钮 hasTableOperator () { const arr = [ @@ -267,6 +271,12 @@ export default { this.filters.taskId = this.$route.query.taskId }, methods: { + // 是否显示意见 + isShowOpinion (record) { + const list = record.processEsInspectPlanOpinionList || [] + // 意见列表是否有当前用户的意见 + return !!(list.find(item => item.createBy === this.currentUserName)) + }, getCheckboxProps (record) { const obj = { props: { disabled: false } } // 第二个节点,只有自己的才能勾选删除 diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue index 67f7cf3c..4f797d9b 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue @@ -18,6 +18,7 @@ rowKey="id" ref="table" size="middle" + :scroll="{x:'100%'}" bordered> @@ -115,9 +116,8 @@ export default { show (record, disabled) { // 是否禁用表单 this.disabled = disabled - if (disabled) { - this.formData.opinion = (record.processEsInspectPlanOpinionList.find(item => item.createBy === this.$store.getters.userInfo.username) || {}).opinion - } + const list = record.processEsInspectPlanOpinionList || [] + this.formData.opinion = (list.find(item => item.createBy === this.$store.getters.userInfo.username) || {}).opinion this.dataSource = [record] this.model = Object.assign({}, record) this.visible = true