Browse Source

2026-05-15

RoHs功能优化
master
fengyuan_yang 4 weeks ago
parent
commit
6cbfec203e
  1. 3
      src/api/rohs/rohs.js
  2. 190
      src/views/modules/rohs/rohsRecord.vue

3
src/api/rohs/rohs.js

@ -33,5 +33,8 @@ export const getRohsButtonCondition = data => createAPI(`/rohs/buttonCondition`,
// 获取节点字段权限(复用工程变更接口)
export const getRohsNodeAuthority = data => createAPI(`/plm/changeManagement/getNodeAuthority`, 'post', data);
// 查询BM角色人员(复用技术参数卡接口)
export const searchBmUser = data => createAPI(`/technicalSpecification/searchBMUser`, 'post', data);
// 导出
export const exportRohs = params => createAPI(`/rohs/export`, 'get', params);

190
src/views/modules/rohs/rohsRecord.vue

@ -71,6 +71,8 @@
<el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS" width="170"></el-table-column>
<el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性" width="140"></el-table-column>
<el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级" width="220"></el-table-column>
<el-table-column prop="hsfApprover" header-align="center" align="center" label="HSF审批人" width="240" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="relatedPeople" header-align="center" align="center" label="Inform Related people" width="200" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格" width="220"></el-table-column>
<el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号" width="150"></el-table-column>
<el-table-column prop="remark" header-align="center" align="center" label="备注" width="220" :show-overflow-tooltip="true"></el-table-column>
@ -310,7 +312,48 @@
<el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" :disabled="isRohsFieldDisabled('fiberInformation')" resize="none" style="width: 802px;height: 30px"></el-input>
</el-form-item>
</el-form>
<el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px">
<el-form-item>
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="loadHsfApproverByCurrentProject(!isEditMode)"><a herf="#">HSF审批人/HSF Approver</a></span>
<span v-else slot="label">HSF审批人/HSF Approver</span>
<el-select
v-model="modalData.hsfApproverList"
multiple
collapse-tags
clearable
filterable
:disabled="isRohsFieldDisabled('hsfApprover')"
style="width: 420px"
placeholder="点击标签查询并默认全选"
@change="handleHsfApproverChange">
<el-option
v-for="item in hsfApproverOptionList"
:key="item.operatorId"
:label="item.operatorName"
:value="item.operatorName">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData">
<el-form-item label="Inform Related people">
<el-select
v-model="modalData.relatedPeople"
clearable
filterable
:disabled="isRohsFieldDisabled('relatedPeople')"
style="width: 420px"
placeholder="请从HSF审批人中选择">
<el-option
v-for="item in (modalData.hsfApproverList || [])"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 0px">
<el-form-item label="HSF标准/HSF Standard" style="display: block;">
<el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" :disabled="isRohsFieldDisabled('hsfStandard')" resize="none" style="width: 802px;height: 30px"></el-input>
</el-form-item>
@ -672,6 +715,12 @@
<el-form-item label="材料属性是否是AH/Is AH Grade"><el-input :value="displayYesNo(currentRow.isAhGrade)" disabled style="width: 180px"></el-input></el-form-item>
<el-form-item label="HSF供应商等级/Supplier Class"><el-input :value="currentRow.hsfSupplierClassification || ''" disabled style="width: 180px"></el-input></el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item label="HSF审批人/HSF Approver"><el-input :value="currentRow.hsfApprover || ''" disabled style="width: 420px"></el-input></el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item label="Inform Related people"><el-input :value="currentRow.relatedPeople || ''" disabled style="width: 420px"></el-input></el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item label="Fiber报告信息/Fiber Information" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.fiberInformation || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input></el-form-item>
</el-form>
@ -966,6 +1015,7 @@ export default {
projectMaterialTotal: 0,
projectMaterialLoading: false,
projectList: [],
hsfApproverOptionList: [],
fileList: [],
approvalList: [],
plmRohsAuthorityArr: [],
@ -1021,6 +1071,10 @@ export default {
expiredDate: '',
fiberInformation: '',
hsfStandard: '',
hsfApprover: '',
hsfApproverList: [],
relatedPeople: '',
buNo: '',
validUntil: '',
isMeetRohsRequirement: '',
isAhGrade: '',
@ -1103,7 +1157,8 @@ export default {
const fieldMapping = {
materialClassify: 'materialClassifyList',
qualificationDocumentsNeeded: 'qualificationDocumentsNeededList',
testReportIncludingItems: 'testReportIncludingItemsList'
testReportIncludingItems: 'testReportIncludingItemsList',
hsfApprover: 'hsfApproverList'
}
const mappedField = fieldMapping[fieldId]
if (mappedField) {
@ -1166,6 +1221,101 @@ export default {
this.$set(formData, 'hsfStandard', '')
}
},
syncHsfApproverFields () {
const list = Array.isArray(this.modalData.hsfApproverList)
? this.modalData.hsfApproverList.filter(item => item && item.trim())
: []
this.$set(this.modalData, 'hsfApproverList', list)
this.$set(this.modalData, 'hsfApprover', list.join(';'))
if (!list.includes(this.modalData.relatedPeople)) {
this.$set(this.modalData, 'relatedPeople', '')
}
},
clearHsfApproverFields (clearBuNo = false) {
if (clearBuNo) {
this.$set(this.modalData, 'buNo', '')
}
this.hsfApproverOptionList = []
this.$set(this.modalData, 'hsfApproverList', [])
this.$set(this.modalData, 'hsfApprover', '')
this.$set(this.modalData, 'relatedPeople', '')
},
handleHsfApproverChange (val) {
this.$set(this.modalData, 'hsfApproverList', Array.isArray(val) ? val : [])
this.syncHsfApproverFields()
},
loadHsfApproverByCurrentProject (forceSelectAll = false) {
if (!this.modalData || !this.modalData.site || !this.modalData.projectId) {
if (forceSelectAll) {
this.$message.warning('请先选择项目编码')
}
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
return Promise.resolve()
}
const queryByBu = (buNo) => {
if (!buNo) {
if (forceSelectAll) {
this.$message.warning('当前项目未维护BU,无法查询HSF审批人')
}
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
return Promise.resolve()
}
const params = {
site: this.modalData.site,
buNo: buNo,
roleNo: 'R015'
}
return api.searchBmUser(params).then(({data}) => {
if (data && data.code === 0 && Array.isArray(data.rows)) {
this.hsfApproverOptionList = data.rows
const allApprovers = data.rows.map(item => item.operatorName).filter(item => item)
if (forceSelectAll) {
this.$set(this.modalData, 'hsfApproverList', allApprovers)
}
this.syncHsfApproverFields()
} else {
this.hsfApproverOptionList = []
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
}
}).catch(() => {
this.hsfApproverOptionList = []
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
})
}
if (this.modalData.buNo) {
return queryByBu(this.modalData.buNo)
}
const projectParams = {
site: this.modalData.site,
projectId: this.modalData.projectId
}
if (this.modalData.endCustomer) {
projectParams.customerId = this.modalData.endCustomer
}
return queryProjectByCustomer(projectParams).then(({data}) => {
if (data && data.code === 0 && data.rows && data.rows.length === 1) {
const project = data.rows[0]
this.$set(this.modalData, 'buNo', project.buNo || project.bu_no || '')
return queryByBu(this.modalData.buNo)
} else {
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
}
}).catch(() => {
if (forceSelectAll) {
this.clearHsfApproverFields(false)
}
})
},
isCurrentApprover () {
return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2))
},
@ -1418,6 +1568,7 @@ export default {
this.projectMaterialDialogFlag = false
this.projectMaterialSelections = []
this.materialSelections = []
this.hsfApproverOptionList = []
this.plmRohsAuthorityArr = []
this.nodeAuthorityLoaded = !row
this.isEditMode = !!row
@ -1441,6 +1592,9 @@ export default {
this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
this.$set(this.modalData, 'hsfApproverList', this.modalData.hsfApprover ? this.modalData.hsfApprover.split(';').filter(item => item) : [])
this.$set(this.modalData, 'buNo', this.modalData.buNo || '')
this.syncHsfApproverFields()
this.fillDisplayFields(this.modalData, row || {})
//
this.$set(this.modalData, 'endCustomerFlag', true)
@ -1450,6 +1604,7 @@ export default {
this.$set(this.modalData, 'tpProcessControl', 'N')
this.$set(this.modalData, 'csProcessControl', 'N')
this.loadModalButtonCondition()
this.loadHsfApproverByCurrentProject(false)
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(() => {
@ -1512,6 +1667,10 @@ export default {
expiredDate: '',
fiberInformation: '',
hsfStandard: '',
hsfApprover: '',
hsfApproverList: [],
relatedPeople: '',
buNo: '',
validUntil: '',
isMeetRohsRequirement: '',
isAhGrade: '',
@ -1539,6 +1698,7 @@ export default {
return
}
this.normalizeHsfStandardByCustomer(this.modalData)
this.syncHsfApproverFields()
this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
@ -1605,6 +1765,7 @@ export default {
return
}
this.normalizeHsfStandardByCustomer(this.modalData)
this.syncHsfApproverFields()
if (!this.nodeAuthorityLoaded) {
this.$message.warning('节点权限加载中,请稍后重试')
return
@ -1920,7 +2081,9 @@ export default {
this.modalData.endCustomerName = val.Customer_desc
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.buNo = ''
this.$set(this.modalData, 'materialList', [])
this.clearHsfApproverFields(false)
}
}
if (this.tagNo === 103) {
@ -1960,8 +2123,10 @@ export default {
this.modalData.endCustomerName = ''
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.buNo = ''
this.modalData.projectIdFlag = true
this.$set(this.modalData, 'materialList', [])
this.clearHsfApproverFields(false)
return
}
let params = {
@ -1978,27 +2143,35 @@ export default {
this.modalData.endCustomerName = ''
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.buNo = ''
this.modalData.projectIdFlag = true
this.$set(this.modalData, 'materialList', [])
this.clearHsfApproverFields(false)
}
} else {
this.modalData.endCustomerName = ''
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.buNo = ''
this.modalData.projectIdFlag = true
this.$set(this.modalData, 'materialList', [])
this.clearHsfApproverFields(false)
}
}).catch((error) => {
this.modalData.endCustomerName = ''
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.buNo = ''
this.modalData.projectIdFlag = true
this.$set(this.modalData, 'materialList', [])
this.clearHsfApproverFields(false)
})
},
handleQueryProjectByCustomer() {
if (!this.modalData.projectId) {
this.modalData.projectName = ''
this.modalData.buNo = ''
this.clearHsfApproverFields(false)
return
}
let params = {
@ -2013,20 +2186,30 @@ export default {
if (data.rows && data.rows.length === 1) {
const project = data.rows[0]
this.modalData.projectName = project.projectName || project.Project_name || ''
this.modalData.buNo = project.buNo || project.bu_no || ''
const forceSelectAll = !this.isEditMode
this.loadHsfApproverByCurrentProject(forceSelectAll)
} else {
this.modalData.projectName = ''
this.modalData.buNo = ''
this.clearHsfApproverFields(false)
}
} else {
this.modalData.projectName = ''
this.modalData.buNo = ''
this.clearHsfApproverFields(false)
}
}).catch((error) => {
this.modalData.projectName = ''
this.modalData.buNo = ''
this.clearHsfApproverFields(false)
})
},
projectClickRow(row) {
const oldProjectId = this.modalData.projectId
this.modalData.projectId = row.projectId
this.modalData.projectName = row.projectName
this.modalData.buNo = row.buNo || row.bu_no || ''
if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
// do nothing
} else {
@ -2036,6 +2219,7 @@ export default {
if (oldProjectId && oldProjectId !== row.projectId) {
this.$set(this.modalData, 'materialList', [])
}
this.loadHsfApproverByCurrentProject(!this.isEditMode)
this.chooseProjectListFlag = false
},
searchProjectInfoList() {
@ -2055,6 +2239,8 @@ export default {
this.modalData.projectName = rows[0].projectName
this.modalData.endCustomer = rows[0].customerId
this.modalData.endCustomerName = rows[0].customerName
this.modalData.buNo = rows[0].buNo || rows[0].bu_no || ''
this.loadHsfApproverByCurrentProject(!this.isEditMode)
}
} else {
this.projectList = []

Loading…
Cancel
Save