|
|
@ -969,7 +969,6 @@ export default { |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
approvalList: [], |
|
|
approvalList: [], |
|
|
plmRohsAuthorityArr: [], |
|
|
plmRohsAuthorityArr: [], |
|
|
plmRohsMaterialAuthorityArr: [], |
|
|
|
|
|
nodeAuthorityLoaded: false, |
|
|
nodeAuthorityLoaded: false, |
|
|
modalTitle: 'RoHs 新增', |
|
|
modalTitle: 'RoHs 新增', |
|
|
activeName: 'basicInfo', |
|
|
activeName: 'basicInfo', |
|
|
@ -1059,7 +1058,6 @@ export default { |
|
|
loadNodeAuthority (site, stepId) { |
|
|
loadNodeAuthority (site, stepId) { |
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) { |
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) { |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsMaterialAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
this.nodeAuthorityLoaded = true |
|
|
return Promise.resolve() |
|
|
return Promise.resolve() |
|
|
} |
|
|
} |
|
|
@ -1072,15 +1070,12 @@ export default { |
|
|
return api.getRohsNodeAuthority(params).then(({data}) => { |
|
|
return api.getRohsNodeAuthority(params).then(({data}) => { |
|
|
if (data && data.code === 0 && data.rows) { |
|
|
if (data && data.code === 0 && data.rows) { |
|
|
this.plmRohsAuthorityArr = data.rows.plm_rohs || [] |
|
|
this.plmRohsAuthorityArr = data.rows.plm_rohs || [] |
|
|
this.plmRohsMaterialAuthorityArr = data.rows.plm_rohs_material || [] |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsMaterialAuthorityArr = [] |
|
|
|
|
|
} |
|
|
} |
|
|
this.nodeAuthorityLoaded = true |
|
|
this.nodeAuthorityLoaded = true |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsMaterialAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
this.nodeAuthorityLoaded = true |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
@ -1091,18 +1086,11 @@ export default { |
|
|
let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId) |
|
|
let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId) |
|
|
return target ? target.updateFlag : 'N' |
|
|
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) { |
|
|
isRohsFieldDisabled (fieldId) { |
|
|
return this.showModalFlag || this.rohsFieldFlag(fieldId) === 'N' |
|
|
return this.showModalFlag || this.rohsFieldFlag(fieldId) === 'N' |
|
|
}, |
|
|
}, |
|
|
canEditRohsMaterial () { |
|
|
canEditRohsMaterial () { |
|
|
return !this.showModalFlag && this.rohsMaterialFieldFlag('testPartNo') !== 'N' |
|
|
|
|
|
|
|
|
return !this.showModalFlag |
|
|
}, |
|
|
}, |
|
|
getRohsSubmitFieldValue (fieldId) { |
|
|
getRohsSubmitFieldValue (fieldId) { |
|
|
const fieldMapping = { |
|
|
const fieldMapping = { |
|
|
@ -1140,22 +1128,6 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const requiredMaterialFields = (this.plmRohsMaterialAuthorityArr || []).filter(item => item.required === 'Y') |
|
|
|
|
|
if (requiredMaterialFields.length > 0) { |
|
|
|
|
|
const materialList = Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [] |
|
|
|
|
|
if (materialList.length === 0) { |
|
|
|
|
|
this.$message.warning('材料信息不能为空!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
for (let i = 0; i < requiredMaterialFields.length; i++) { |
|
|
|
|
|
const fieldConfig = requiredMaterialFields[i] |
|
|
|
|
|
const valid = materialList.every(item => !this.isSubmitFieldEmpty(item[fieldConfig.fieldId])) |
|
|
|
|
|
if (!valid) { |
|
|
|
|
|
this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true |
|
|
return true |
|
|
}, |
|
|
}, |
|
|
materialDialogHeaderCellStyle () { |
|
|
materialDialogHeaderCellStyle () { |
|
|
@ -1426,7 +1398,6 @@ export default { |
|
|
this.projectMaterialSelections = [] |
|
|
this.projectMaterialSelections = [] |
|
|
this.materialSelections = [] |
|
|
this.materialSelections = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsMaterialAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = false |
|
|
this.nodeAuthorityLoaded = false |
|
|
this.projectMaterialPageIndex = 1 |
|
|
this.projectMaterialPageIndex = 1 |
|
|
this.projectMaterialTotal = 0 |
|
|
this.projectMaterialTotal = 0 |
|
|
@ -1618,10 +1589,17 @@ export default { |
|
|
if (!this.validateSubmitRequiredFields()) { |
|
|
if (!this.validateSubmitRequiredFields()) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
const submitMaterialList = this.normalizeMaterialListForSave(this.modalData.materialList || []) |
|
|
this.submitLoading = true |
|
|
this.submitLoading = true |
|
|
let params = { |
|
|
let params = { |
|
|
|
|
|
...this.modalData, |
|
|
site: this.modalData.site, |
|
|
site: this.modalData.site, |
|
|
referenceNo: this.modalData.referenceNo, |
|
|
referenceNo: this.modalData.referenceNo, |
|
|
|
|
|
materialClassify: (this.modalData.materialClassifyList || []).join(';'), |
|
|
|
|
|
qualificationDocumentsNeeded: (this.modalData.qualificationDocumentsNeededList || []).join(';'), |
|
|
|
|
|
testReportIncludingItems: (this.modalData.testReportIncludingItemsList || []).join(';'), |
|
|
|
|
|
materialList: submitMaterialList, |
|
|
|
|
|
ifsPartNo: submitMaterialList.length > 0 ? submitMaterialList[0].testPartNo : '', |
|
|
nodeConclusion: nodeConclusion, |
|
|
nodeConclusion: nodeConclusion, |
|
|
rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '', |
|
|
rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '', |
|
|
menuId: this.menuId, |
|
|
menuId: this.menuId, |
|
|
@ -1672,7 +1650,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
openProjectMaterialDialog () { |
|
|
openProjectMaterialDialog () { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
this.$message.warning('当前节点无材料编辑权限') |
|
|
|
|
|
|
|
|
this.$message.warning('当前状态不允许编辑材料') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (!this.modalData.projectId) { |
|
|
if (!this.modalData.projectId) { |
|
|
@ -1740,7 +1718,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
confirmProjectMaterialSelection () { |
|
|
confirmProjectMaterialSelection () { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
this.$message.warning('当前节点无材料编辑权限') |
|
|
|
|
|
|
|
|
this.$message.warning('当前状态不允许编辑材料') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) { |
|
|
if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) { |
|
|
@ -1843,7 +1821,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
removeSelectedMaterialRows () { |
|
|
removeSelectedMaterialRows () { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
if (!this.canEditRohsMaterial()) { |
|
|
this.$message.warning('当前节点无材料编辑权限') |
|
|
|
|
|
|
|
|
this.$message.warning('当前状态不允许编辑材料') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (!this.materialSelections || this.materialSelections.length === 0) { |
|
|
if (!this.materialSelections || this.materialSelections.length === 0) { |
|
|
|