String(item || '').trim())
+ .filter(item => !!item)
+ const selectedSet = new Set(normalizedNames)
+ let optionList = (this.hsfApproverOptionList || [])
+ .filter(item => selectedSet.has(String(item.operatorName || '').trim()))
+ .map(item => ({
+ operatorId: item.operatorId,
+ operatorName: item.operatorName
+ }))
+ const existingNameSet = new Set(optionList.map(item => String(item.operatorName || '').trim()))
+ normalizedNames.forEach(name => {
+ if (existingNameSet.has(name)) {
+ return
+ }
+ optionList.push({
+ operatorId: name,
+ operatorName: name
+ })
+ existingNameSet.add(name)
+ })
+ this.relatedPeopleOptionList = optionList
+ this.filterRelatedPeopleOptions()
+ const selectedRelatedPeople = String(this.modalData.relatedPeople || '').trim()
+ if (selectedRelatedPeople && !optionList.some(item => String(item.operatorName || '').trim() === selectedRelatedPeople)) {
this.$set(this.modalData, 'relatedPeople', '')
}
},
@@ -1601,6 +1671,17 @@ export default {
return matchOperatorId && matchOperatorName
})
},
+ filterRelatedPeopleOptions () {
+ const operatorIdKeyword = String(this.relatedPeopleSearchData.operatorId || '').trim().toUpperCase()
+ const operatorNameKeyword = String(this.relatedPeopleSearchData.operatorName || '').trim().toUpperCase()
+ this.relatedPeopleDisplayList = (this.relatedPeopleOptionList || []).filter(item => {
+ const operatorId = String(item.operatorId || '').toUpperCase()
+ const operatorName = String(item.operatorName || '').toUpperCase()
+ const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
+ const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
+ return matchOperatorId && matchOperatorName
+ })
+ },
openHsfApproverChooseModal () {
if (this.isRohsFieldDisabled('hsfApprover')) {
return
@@ -1663,6 +1744,61 @@ export default {
this.$set(this.modalData, 'hsfApproverList', [])
this.syncHsfApproverFields()
},
+ openRelatedPeopleChooseModal () {
+ if (this.isRohsFieldDisabled('relatedPeople')) {
+ return
+ }
+ if (!this.modalData || !Array.isArray(this.modalData.hsfApproverList) || this.modalData.hsfApproverList.length === 0) {
+ this.$message.warning('请先选择HSF审批人')
+ return
+ }
+ this.buildRelatedPeopleOptions(this.modalData.hsfApproverList)
+ if (!this.relatedPeopleOptionList || this.relatedPeopleOptionList.length === 0) {
+ this.$message.warning('未查询到可选Inform Related people')
+ return
+ }
+ this.relatedPeopleFlag = true
+ },
+ openRelatedPeopleDialog () {
+ this.relatedPeopleSearchData = {
+ operatorId: '',
+ operatorName: ''
+ }
+ this.filterRelatedPeopleOptions()
+ const relatedPeople = String(this.modalData.relatedPeople || '').trim()
+ const selectedRow = (this.relatedPeopleOptionList || []).find(item => String(item.operatorName || '').trim() === relatedPeople) || null
+ this.relatedPeopleSelection = selectedRow
+ this.$nextTick(() => {
+ if (!this.$refs.relatedPeopleTable) {
+ return
+ }
+ this.$refs.relatedPeopleTable.setCurrentRow(selectedRow || null)
+ })
+ },
+ closeRelatedPeopleDialog () {
+ this.relatedPeopleSelection = null
+ },
+ handleRelatedPeopleCurrentChange (row) {
+ this.relatedPeopleSelection = row || null
+ },
+ handleRelatedPeopleTableClick (row) {
+ this.relatedPeopleSelection = row || null
+ if (this.$refs.relatedPeopleTable) {
+ this.$refs.relatedPeopleTable.setCurrentRow(row)
+ }
+ },
+ saveRelatedPeopleChooseModal () {
+ const selectedName = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorName || '').trim() : ''
+ this.$set(this.modalData, 'relatedPeople', selectedName)
+ this.relatedPeopleFlag = false
+ },
+ clearRelatedPeopleSelection () {
+ this.$set(this.modalData, 'relatedPeople', '')
+ this.relatedPeopleSelection = null
+ if (this.$refs.relatedPeopleTable) {
+ this.$refs.relatedPeopleTable.setCurrentRow(null)
+ }
+ },
clearHsfApproverFields (clearBuNo = false) {
if (clearBuNo) {
this.$set(this.modalData, 'buNo', '')
@@ -1670,10 +1806,18 @@ export default {
this.hsfApproverOptionList = []
this.hsfApproverDisplayList = []
this.hsfApproverSelectionCache = []
+ this.relatedPeopleOptionList = []
+ this.relatedPeopleDisplayList = []
+ this.relatedPeopleSelection = null
+ this.relatedPeopleFlag = false
this.hsfApproverSearchData = {
operatorId: '',
operatorName: ''
}
+ this.relatedPeopleSearchData = {
+ operatorId: '',
+ operatorName: ''
+ }
this.$set(this.modalData, 'hsfApproverList', [])
this.$set(this.modalData, 'hsfApprover', '')
this.$set(this.modalData, 'relatedPeople', '')
@@ -2183,6 +2327,14 @@ export default {
operatorName: ''
}
this.hsfApproverFlag = false
+ this.relatedPeopleOptionList = []
+ this.relatedPeopleDisplayList = []
+ this.relatedPeopleSelection = null
+ this.relatedPeopleSearchData = {
+ operatorId: '',
+ operatorName: ''
+ }
+ this.relatedPeopleFlag = false
this.plmRohsAuthorityArr = []
this.nodeAuthorityLoaded = !row
this.isEditMode = !!row
@@ -2207,6 +2359,7 @@ export default {
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.process || '')
+ this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
this.$set(this.modalData, 'validUntilValue', this.normalizeValidUntilValue(this.modalData.validUntilValue))
this.syncHsfApproverFields()
this.fillDisplayFields(this.modalData, row || {})
@@ -2288,7 +2441,7 @@ export default {
validUntilValue: 0,
validUntil: '',
isMeetRohsRequirement: '',
- isAhGrade: '',
+ isAhGrade: 'N',
hsfSupplierClassification: '',
materialDesc: '',
npdRemark: '',
@@ -2312,6 +2465,7 @@ export default {
this.$message.warning('当前状态不允许保存')
return
}
+ this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
this.normalizeHsfStandardByCustomer(this.modalData)
this.syncHsfApproverFields()
if (!this.validateValidUntilPair()) {
@@ -2382,6 +2536,7 @@ export default {
this.$message.warning('单据主键信息缺失,无法提交审批')
return
}
+ this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
this.normalizeHsfStandardByCustomer(this.modalData)
this.syncHsfApproverFields()
if (!this.validateValidUntilPair()) {