@ -115,8 +115,16 @@
< el -table -column prop = "isMeetRohsRequirement" header -align = " center " align = "center" label = "符合RoHS" width = "170" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "isAhGrade" header -align = " center " align = "center" label = "AH属性" width = "140" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "hsfSupplierClassification" header -align = " center " align = "center" label = "HSF供应商等级" width = "220" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "hsfApprover" header -align = " center " align = "center" label = "HSF审批人" width = "240" :show-overflow-tooltip ="true" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "relatedPeople" header -align = " center " align = "center" label = "Inform Related people" width = "200" :show-overflow-tooltip ="true" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "hsfApproverName" header -align = " center " align = "center" label = "HSF审批人" width = "240" :show-overflow-tooltip ="true" >
< template slot -scope = " scope " >
< span > { { scope . row . hsfApproverName || scope . row . hsfApprover || '' } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "relatedPeopleName" header -align = " center " align = "center" label = "Inform Related people" width = "200" :show-overflow-tooltip ="true" >
< template slot -scope = " scope " >
< span > { { scope . row . relatedPeopleName || scope . row . relatedPeople || '' } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "isSameMaterialDiffSize" header -align = " center " align = "center" label = "同材不同规格" width = "220" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "ifsPartNo" header -align = " center " align = "center" label = "IFS编号" width = "150" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "remark" header -align = " center " align = "center" label = "备注" width = "220" :show-overflow-tooltip ="true" > < / e l - t a b l e - c o l u m n >
@ -442,13 +450,13 @@
< span style = "cursor: pointer" v-if ="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="openHsfApproverChooseModal"><a herf="#" > HSF审批人 / HSF Approver < / a > < / span >
< span v -else slot = "label" > HSF审批人 / HSF Approver < / span >
< el -input
v - model = "modalData.hsfApprover"
v - model = "modalData.hsfApproverName "
readonly
: disabled = "isRohsFieldDisabled('hsfApprover')"
style = "width: 396px"
placeholder = "请选择人员"
@ focus = "openHsfApproverChooseModal" >
< span slot = "suffix" v-show ="modalData.hsfApprover && !isRohsFieldDisabled('hsfApprover')" @click.stop="clearHsfApproverSelection" >
< span slot = "suffix" v-show ="modalData.hsfApproverName && !isRohsFieldDisabled('hsfApprover')" @click.stop="clearHsfApproverSelection" >
< i class = "el-icon-circle-close" style = "margin-left: 5px;cursor: pointer;" > < / i >
< / span >
< / e l - i n p u t >
@ -457,13 +465,13 @@
< span style = "cursor: pointer" v-if ="!isRohsFieldDisabled('relatedPeople')" slot="label" @click="openRelatedPeopleChooseModal"><a herf="#" > Inform Related people < / a > < / span >
< span v -else slot = "label" > Inform Related people < / span >
< el -input
v - model = "modalData.relatedPeople"
v - model = "modalData.relatedPeopleName "
readonly
: disabled = "isRohsFieldDisabled('relatedPeople')"
style = "width: 396px"
placeholder = "请从HSF审批人中选择"
@ focus = "openRelatedPeopleChooseModal" >
< span slot = "suffix" v-show ="modalData.relatedPeople && !isRohsFieldDisabled('relatedPeople')" @click.stop="clearRelatedPeopleSelection" >
< span slot = "suffix" v-show ="modalData.relatedPeopleName && !isRohsFieldDisabled('relatedPeople')" @click.stop="clearRelatedPeopleSelection" >
< i class = "el-icon-circle-close" style = "margin-left: 5px;cursor: pointer;" > < / i >
< / span >
< / e l - i n p u t >
@ -975,8 +983,8 @@
< el -form -item label = "Fiber报告信息/Fiber Information" style = "display: block;" > < el -input type = "textarea" :rows ="3" : value = "currentRow.fiberInformation || ''" disabled resize = "none" style = "width: 804px;height: 30px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
< / e l - f o r m >
< el -form :inline ="true" label -position = " top " :model ="currentRow" style = "margin-top: 45px" >
< el -form -item label = "HSF审批人/HSF Approver" > < el -input : value = "currentRow.hsfApprover || ''" disabled style = "width: 396px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
< el -form -item label = "Inform Related people" > < el -input : value = "currentRow.relatedPeople || ''" disabled style = "width: 396px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
< el -form -item label = "HSF审批人/HSF Approver" > < el -input : value = "currentRow.hsfApproverName || currentRow.hsfApprover || ''" disabled style = "width: 396px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
< el -form -item label = "Inform Related people" > < el -input : value = "currentRow.relatedPeopleName || currentRow.relatedPeople || ''" disabled style = "width: 396px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
< / e l - f o r m >
< el -form v-if ="shouldShowHsfStandard(currentRow.endCustomer)" :inline="true" label-position="top" :model="currentRow" style="margin-top: 0px" >
< el -form -item label = "HSF标准/HSF Standard" style = "display: block;" > < el -input type = "textarea" :rows ="3" : value = "currentRow.hsfStandard || ''" disabled resize = "none" style = "width: 804px;height: 30px" > < / e l - i n p u t > < / e l - f o r m - i t e m >
@ -1326,8 +1334,10 @@ export default {
fiberInformation : '' ,
hsfStandard : '' ,
hsfApprover : '' ,
hsfApproverList : [ ] ,
hsfApproverName : '' ,
hsfApproverCodeList : [ ] ,
relatedPeople : '' ,
relatedPeopleName : '' ,
buNo : '' ,
validUntilValue : 0 ,
validUntil : '' ,
@ -1642,7 +1652,7 @@ export default {
materialClassify : 'materialClassifyList' ,
qualificationDocumentsNeeded : 'qualificationDocumentsNeededList' ,
testReportIncludingItems : 'testReportIncludingItemsList' ,
hsfApprover : 'hsfApproverList'
hsfApprover : 'hsfApproverCode List'
}
const mappedField = fieldMapping [ fieldId ]
if ( mappedField ) {
@ -1757,55 +1767,88 @@ export default {
}
this . applyHsfStandardDefaultByCustomer ( formData )
} ,
resolveOperatorNameById ( operatorId ) {
const normalizedId = String ( operatorId || '' ) . trim ( )
if ( ! normalizedId ) {
return ''
}
const option = ( this . hsfApproverOptionList || [ ] ) . find ( item => String ( item . operatorId || '' ) . trim ( ) === normalizedId ) ||
( this . relatedPeopleOptionList || [ ] ) . find ( item => String ( item . operatorId || '' ) . trim ( ) === normalizedId )
return option ? String ( option . operatorName || '' ) . trim ( ) : normalizedId
} ,
resolveOperatorIdByCodeOrName ( operatorValue ) {
const normalizedValue = String ( operatorValue || '' ) . trim ( )
if ( ! normalizedValue ) {
return ''
}
const option = ( this . hsfApproverOptionList || [ ] ) . find ( item => String ( item . operatorId || '' ) . trim ( ) === normalizedValue ) ||
( this . hsfApproverOptionList || [ ] ) . find ( item => String ( item . operatorName || '' ) . trim ( ) === normalizedValue ) ||
( this . relatedPeopleOptionList || [ ] ) . find ( item => String ( item . operatorId || '' ) . trim ( ) === normalizedValue ) ||
( this . relatedPeopleOptionList || [ ] ) . find ( item => String ( item . operatorName || '' ) . trim ( ) === normalizedValue )
return option ? String ( option . operatorId || '' ) . trim ( ) : normalizedValue
} ,
syncHsfApproverFields ( ) {
const sourceList = Array . isArray ( this . modalData . hsfApproverList )
? this . modalData . hsfApproverList
const sourceList = Array . isArray ( this . modalData . hsfApproverCode List )
? this . modalData . hsfApproverCode List
: [ ]
const uniqueList = [ ]
const uniqueCode List = [ ]
const seen = new Set ( )
sourceList . forEach ( item => {
const value = String ( item || '' ) . trim ( )
const value = this . resolveOperatorIdByCodeOrName ( item )
if ( ! value || seen . has ( value ) ) {
return
}
seen . add ( value )
uniqueList . push ( value )
uniqueCode List . push ( value )
} )
this . $set ( this . modalData , 'hsfApproverList' , uniqueList )
this . $set ( this . modalData , 'hsfApprover' , uniqueList . join ( ';' ) )
this . buildRelatedPeopleOptions ( uniqueList )
const relatedPeople = String ( this . modalData . relatedPeople || '' ) . trim ( )
if ( relatedPeople && ! uniqueList . includes ( relatedPeople ) ) {
this . $set ( this . modalData , 'hsfApproverCodeList' , uniqueCodeList )
this . $set ( this . modalData , 'hsfApprover' , uniqueCodeList . join ( ';' ) )
this . $set ( this . modalData , 'hsfApproverName' , uniqueCodeList . map ( item => this . resolveOperatorNameById ( item ) ) . join ( ';' ) )
this . buildRelatedPeopleOptions ( uniqueCodeList )
const relatedPeopleCode = this . resolveOperatorIdByCodeOrName ( this . modalData . relatedPeople )
if ( relatedPeopleCode && ! uniqueCodeList . includes ( relatedPeopleCode ) ) {
this . $set ( this . modalData , 'relatedPeople' , '' )
this . $set ( this . modalData , 'relatedPeopleName' , '' )
return
}
if ( relatedPeopleCode ) {
this . $set ( this . modalData , 'relatedPeople' , relatedPeopleCode )
this . $set ( this . modalData , 'relatedPeopleName' , this . resolveOperatorNameById ( relatedPeopleCode ) )
}
} ,
buildRelatedPeopleOptions ( selectedNames ) {
const normalizedNames = ( Array . isArray ( selectedNames ) ? selectedNames : ( this . modalData . hsfApproverList || [ ] ) )
. map ( item => String ( item || '' ) . trim ( ) )
buildRelatedPeopleOptions ( selectedOperatorId s ) {
const normalizedId s = ( Array . isArray ( selectedOperatorIds ) ? selectedOperatorId s : ( this . modalData . hsfApproverCode List || [ ] ) )
. map ( item => this . resolveOperatorIdByCodeOrName ( item ) )
. filter ( item => ! ! item )
const selectedSet = new Set ( normalizedName s )
const selectedSet = new Set ( normalizedId s )
let optionList = ( this . hsfApproverOptionList || [ ] )
. filter ( item => selectedSet . has ( String ( item . operatorName || '' ) . trim ( ) ) )
. filter ( item => selectedSet . has ( String ( item . operatorId || '' ) . trim ( ) ) )
. map ( item => ( {
operatorId : item . operatorId ,
operatorName : item . operatorName
} ) )
const existingName Set = new Set ( optionList . map ( item => String ( item . operatorName || '' ) . trim ( ) ) )
normalizedName s . forEach ( name => {
if ( existingName Set . has ( name ) ) {
const existingId Set = new Set ( optionList . map ( item => String ( item . operatorId || '' ) . trim ( ) ) )
normalizedId s . forEach ( operatorId => {
if ( existingId Set . has ( operatorId ) ) {
return
}
optionList . push ( {
operatorId : name ,
operatorName : name
operatorId : operatorId ,
operatorName : this . resolveOperatorNameById ( operatorId )
} )
existingName Set . add ( name )
existingId Set . add ( operatorId )
} )
this . relatedPeopleOptionList = optionList
this . filterRelatedPeopleOptions ( )
const selectedRelatedPeople = String ( this . modalData . relatedPeople || '' ) . trim ( )
if ( selectedRelatedPeople && ! optionList . some ( item => String ( item . operatorName || '' ) . trim ( ) === selectedRelatedPeople ) ) {
const selectedRelatedPeopleCode = this . resolveOperatorIdByCodeOrName ( this . modalData . relatedPeople )
const selectedRelatedPeopleRow = optionList . find ( item => String ( item . operatorId || '' ) . trim ( ) === selectedRelatedPeopleCode )
if ( ! selectedRelatedPeopleRow ) {
this . $set ( this . modalData , 'relatedPeople' , '' )
this . $set ( this . modalData , 'relatedPeopleName' , '' )
} else {
this . $set ( this . modalData , 'relatedPeople' , selectedRelatedPeopleCode )
this . $set ( this . modalData , 'relatedPeopleName' , String ( selectedRelatedPeopleRow . operatorName || '' ) . trim ( ) )
}
} ,
normalizeHsfApproverOptionList ( rows ) {
@ -1870,12 +1913,12 @@ export default {
operatorName : ''
}
this . filterHsfApproverOptions ( )
const selectedName Set = new Set (
( this . modalData . hsfApproverList || [ ] )
const selectedOperator Set = new Set (
( this . modalData . hsfApproverCode List || [ ] )
. map ( item => String ( item || '' ) . trim ( ) )
. filter ( item => ! ! item )
)
const selectedRows = ( this . hsfApproverOptionList || [ ] ) . filter ( item => selectedName Set . has ( item . operatorName ) )
const selectedRows = ( this . hsfApproverOptionList || [ ] ) . filter ( item => selectedOperator Set . has ( String ( item . operatorId || '' ) . trim ( ) ) )
this . hsfApproverSelectionCache = JSON . parse ( JSON . stringify ( selectedRows ) )
this . $nextTick ( ( ) => {
if ( ! this . $refs . hsfApproverTable ) {
@ -1899,26 +1942,26 @@ export default {
}
} ,
saveHsfApproverChooseModal ( ) {
const selectedNam es = ( this . hsfApproverSelectionCache || [ ] )
. map ( item => String ( item . operatorName || '' ) . trim ( ) )
const selectedCod es = ( this . hsfApproverSelectionCache || [ ] )
. map ( item => String ( item . operatorId || '' ) . trim ( ) )
. filter ( item => ! ! item )
this . $set ( this . modalData , 'hsfApproverList' , selectedNam es )
this . $set ( this . modalData , 'hsfApproverCode List' , selectedCod es )
this . syncHsfApproverFields ( )
this . hsfApproverFlag = false
} ,
clearHsfApproverSelection ( ) {
this . $set ( this . modalData , 'hsfApproverList' , [ ] )
this . $set ( this . modalData , 'hsfApproverCode List' , [ ] )
this . syncHsfApproverFields ( )
} ,
openRelatedPeopleChooseModal ( ) {
if ( this . isRohsFieldDisabled ( 'relatedPeople' ) ) {
return
}
if ( ! this . modalData || ! Array . isArray ( this . modalData . hsfApproverList ) || this . modalData . hsfApproverList . length === 0 ) {
if ( ! this . modalData || ! Array . isArray ( this . modalData . hsfApproverCode List ) || this . modalData . hsfApproverCode List . length === 0 ) {
this . $message . warning ( '请先选择HSF审批人' )
return
}
this . buildRelatedPeopleOptions ( this . modalData . hsfApproverList )
this . buildRelatedPeopleOptions ( this . modalData . hsfApproverCode List )
if ( ! this . relatedPeopleOptionList || this . relatedPeopleOptionList . length === 0 ) {
this . $message . warning ( '未查询到可选Inform Related people' )
return
@ -1931,8 +1974,8 @@ export default {
operatorName : ''
}
this . filterRelatedPeopleOptions ( )
const relatedPeople = String ( this . modalData . relatedPeople || '' ) . trim ( )
const selectedRow = ( this . relatedPeopleOptionList || [ ] ) . find ( item => String ( item . operatorName || '' ) . trim ( ) === relatedPeople ) || null
const relatedPeopleCode = String ( this . modalData . relatedPeople || '' ) . trim ( )
const selectedRow = ( this . relatedPeopleOptionList || [ ] ) . find ( item => String ( item . operatorId || '' ) . trim ( ) === relatedPeopleCod e ) || null
this . relatedPeopleSelection = selectedRow
this . $nextTick ( ( ) => {
if ( ! this . $refs . relatedPeopleTable ) {
@ -1954,12 +1997,15 @@ export default {
}
} ,
saveRelatedPeopleChooseModal ( ) {
const selectedCode = this . relatedPeopleSelection ? String ( this . relatedPeopleSelection . operatorId || '' ) . trim ( ) : ''
const selectedName = this . relatedPeopleSelection ? String ( this . relatedPeopleSelection . operatorName || '' ) . trim ( ) : ''
this . $set ( this . modalData , 'relatedPeople' , selectedName )
this . $set ( this . modalData , 'relatedPeople' , selectedCode )
this . $set ( this . modalData , 'relatedPeopleName' , selectedName )
this . relatedPeopleFlag = false
} ,
clearRelatedPeopleSelection ( ) {
this . $set ( this . modalData , 'relatedPeople' , '' )
this . $set ( this . modalData , 'relatedPeopleName' , '' )
this . relatedPeopleSelection = null
if ( this . $refs . relatedPeopleTable ) {
this . $refs . relatedPeopleTable . setCurrentRow ( null )
@ -1984,9 +2030,11 @@ export default {
operatorId : '' ,
operatorName : ''
}
this . $set ( this . modalData , 'hsfApproverList' , [ ] )
this . $set ( this . modalData , 'hsfApproverCode List' , [ ] )
this . $set ( this . modalData , 'hsfApprover' , '' )
this . $set ( this . modalData , 'hsfApproverName' , '' )
this . $set ( this . modalData , 'relatedPeople' , '' )
this . $set ( this . modalData , 'relatedPeopleName' , '' )
} ,
loadHsfApproverByCurrentProcess ( forceSelectAll = false ) {
if ( ! this . modalData || ! this . modalData . site ) {
@ -2020,8 +2068,8 @@ export default {
this . filterHsfApproverOptions ( )
this . hsfApproverSelectionCache = [ ]
if ( forceSelectAll ) {
const defaultSelectedNam es = this . hsfApproverOptionList . map ( item => item . operatorName ) . filter ( item => item )
this . $set ( this . modalData , 'hsfApproverList' , defaultSelectedNam es )
const defaultSelectedCod es = this . hsfApproverOptionList . map ( item => item . operatorId ) . filter ( item => item )
this . $set ( this . modalData , 'hsfApproverCode List' , defaultSelectedCod es )
}
this . syncHsfApproverFields ( )
} else {
@ -2257,7 +2305,7 @@ export default {
if ( ! target ) {
return
}
const fields = [ 'nodeId' , 'nodeName' , 'currentApprover' , 'applicantName' , 'pmName' , 'npdEngineerName' , 'technicalPlanName' , 'buyerName' , 'endCustomerName' , 'projectName' , 'commGroup1Desc' , 'commGroup2Desc' , 'commGroup3Desc' ]
const fields = [ 'nodeId' , 'nodeName' , 'currentApprover' , 'applicantName' , 'pmName' , 'npdEngineerName' , 'technicalPlanName' , 'buyerName' , 'endCustomerName' , 'projectName' , 'commGroup1Desc' , 'commGroup2Desc' , 'commGroup3Desc' , 'hsfApproverName' , 'relatedPeopleName' ]
fields . forEach ( field => {
const value = target [ field ] || fallbackData [ field ] || ''
this . $set ( target , field , value )
@ -2349,6 +2397,8 @@ export default {
commGroup1Desc : '' ,
commGroup2Desc : '' ,
commGroup3Desc : '' ,
hsfApproverName : '' ,
relatedPeopleName : '' ,
... item
}
} )
@ -2422,6 +2472,8 @@ export default {
row . expiredDate = this . normalizeDateOnly ( row . expiredDate )
row . expiryDate = this . normalizeDateOnly ( row . expiryDate )
row . validUntilDisplay = this . getValidUntilDisplay ( row . validUntilValue , row . validUntil )
row . hsfApproverName = row . hsfApproverName || row . hsfApprover || ''
row . relatedPeopleName = row . relatedPeopleName || row . relatedPeople || ''
return row
} )
} else {
@ -2528,7 +2580,7 @@ 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 , 'hsfApproverCode List' , 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 ) )
@ -2609,8 +2661,10 @@ export default {
fiberInformation : '' ,
hsfStandard : '' ,
hsfApprover : '' ,
hsfApproverList : [ ] ,
hsfApproverName : '' ,
hsfApproverCodeList : [ ] ,
relatedPeople : '' ,
relatedPeopleName : '' ,
buNo : '' ,
validUntilValue : 0 ,
validUntil : '' ,