@@ -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) {