From 2a0d0eb2bf13303ea593efce6bc72869e4776e6a Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 13 May 2026 15:43:49 +0800 Subject: [PATCH] =?UTF-8?q?2026-05-13=20RoHs=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rohs/rohs.js | 3 + src/views/modules/rohs/rohsRecord.vue | 177 ++++++++++++++++++-------- 2 files changed, 126 insertions(+), 54 deletions(-) diff --git a/src/api/rohs/rohs.js b/src/api/rohs/rohs.js index f1b9852..d41465c 100644 --- a/src/api/rohs/rohs.js +++ b/src/api/rohs/rohs.js @@ -30,5 +30,8 @@ export const getRohsApprovalList = data => createAPI(`/rohs/approvalList`, 'post // 查询按钮控制信息 export const getRohsButtonCondition = data => createAPI(`/rohs/buttonCondition`, 'post', data); +// 获取节点字段权限(复用工程变更接口) +export const getRohsNodeAuthority = data => createAPI(`/plm/changeManagement/getNodeAuthority`, 'post', data); + // 导出 export const exportRohs = params => createAPI(`/rohs/export`, 'get', params); diff --git a/src/views/modules/rohs/rohsRecord.vue b/src/views/modules/rohs/rohsRecord.vue index 84b84ce..9b76f65 100644 --- a/src/views/modules/rohs/rohsRecord.vue +++ b/src/views/modules/rohs/rohsRecord.vue @@ -110,72 +110,75 @@
- 申请人/Applicant - + 申请人/Applicant + 申请人/Applicant + - + - + - + - + - + - + - + - 最终客户/End Customer + 最终客户/End Customer 最终客户/End Customer - + - PM人员/PM - + PM人员/PM + PM人员/PM + - 项目编码/Project ID + 项目编码/Project ID 项目编码/Project ID - + - + - + - 商品组1 / Comm Group 1 - + 商品组1 / Comm Group 1 + 商品组1 / Comm Group 1 + - + @@ -183,12 +186,13 @@ - 商品组2 / Comm Group 2 - + 商品组2 / Comm Group 2 + 商品组2 / Comm Group 2 + - + @@ -196,12 +200,13 @@ - 商品组3 / Comm Group 3 - + 商品组3 / Comm Group 3 + 商品组3 / Comm Group 3 + - + @@ -209,26 +214,27 @@ - NPD工程师/NPD Engineer - + NPD工程师/NPD Engineer + NPD工程师/NPD Engineer + - + - + - + - + - + 上传附件 @@ -236,27 +242,29 @@ - 技术计划/Technical Plan - + 技术计划/Technical Plan + 技术计划/Technical Plan + - 采购/Buyer - + 采购/Buyer + 采购/Buyer + - + - + - +
@@ -267,30 +275,30 @@
- + - + - + - + - + - + A类 B类 C类 @@ -299,12 +307,12 @@ - + - +
@@ -315,7 +323,7 @@
- + @@ -323,12 +331,12 @@ - + - + @@ -363,8 +371,8 @@
- 新增材料 - 删除材料 + 新增材料 + 删除材料 { + if (data && data.code === 0 && data.rows) { + this.plmRohsAuthorityArr = data.rows.plm_rohs || [] + this.plmRohsMaterialAuthorityArr = data.rows.plm_rohs_material || [] + } else { + this.plmRohsAuthorityArr = [] + this.plmRohsMaterialAuthorityArr = [] + } + }).catch(() => { + this.plmRohsAuthorityArr = [] + this.plmRohsMaterialAuthorityArr = [] + }) + }, + rohsFieldFlag (fieldId) { + if (!this.plmRohsAuthorityArr || this.plmRohsAuthorityArr.length === 0) { + return 'N' + } + let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId) + return target ? target.updateFlag : 'N' + }, + rohsMaterialFieldFlag (fieldId) { + if (!this.plmRohsMaterialAuthorityArr || this.plmRohsMaterialAuthorityArr.length === 0) { + return 'N' + } + let target = this.plmRohsMaterialAuthorityArr.find(item => item.fieldId === fieldId) + return target ? target.updateFlag : 'N' + }, + isRohsFieldDisabled (fieldId) { + return this.showModalFlag || this.rohsFieldFlag(fieldId) === 'N' + }, + canEditRohsMaterial () { + return !this.showModalFlag && this.rohsMaterialFieldFlag('testPartNo') !== 'N' + }, materialDialogHeaderCellStyle () { return { whiteSpace: 'nowrap', @@ -1312,6 +1366,8 @@ export default { this.projectMaterialDialogFlag = false this.projectMaterialSelections = [] this.materialSelections = [] + this.plmRohsAuthorityArr = [] + this.plmRohsMaterialAuthorityArr = [] this.projectMaterialPageIndex = 1 this.projectMaterialTotal = 0 this.projectMaterialList = [] @@ -1341,7 +1397,10 @@ export default { this.$set(this.modalData, 'tpProcessControl', 'N') this.$set(this.modalData, 'csProcessControl', 'N') this.loadModalButtonCondition() + this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : (row.stepId !== null && row.stepId !== undefined ? row.stepId : 10)) } + }).catch(() => { + this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10) }) } else { this.modalTitle = 'RoHs 新增' @@ -1417,6 +1476,7 @@ export default { tpProcessControl: 'N', csProcessControl: 'N' } + this.loadNodeAuthority(this.modalData.site, this.modalData.stepId) } }, // 表单提交 @@ -1544,6 +1604,10 @@ export default { }) }, openProjectMaterialDialog () { + if (!this.canEditRohsMaterial()) { + this.$message.warning('当前节点无材料编辑权限') + return + } if (!this.modalData.projectId) { this.$message.warning('请先选择项目编码') return @@ -1608,6 +1672,10 @@ export default { this.searchProjectMaterialList() }, confirmProjectMaterialSelection () { + if (!this.canEditRohsMaterial()) { + this.$message.warning('当前节点无材料编辑权限') + return + } if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) { this.$message.warning('请至少选择一条项目物料') return @@ -1707,7 +1775,8 @@ export default { }) }, removeSelectedMaterialRows () { - if (this.showModalFlag) { + if (!this.canEditRohsMaterial()) { + this.$message.warning('当前节点无材料编辑权限') return } if (!this.materialSelections || this.materialSelections.length === 0) {