|
|
@ -331,26 +331,16 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px"> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="loadHsfApproverByCurrentProject(!isEditMode)"><a herf="#">HSF审批人/HSF Approver</a></span> |
|
|
|
|
|
|
|
|
<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> |
|
|
<span v-else slot="label">HSF审批人/HSF Approver</span> |
|
|
<el-select |
|
|
|
|
|
class="rohs-multiple-ellipsis" |
|
|
|
|
|
v-model="modalData.hsfApproverList" |
|
|
|
|
|
multiple |
|
|
|
|
|
:title="getMultipleSelectTitle(modalData.hsfApproverList)" |
|
|
|
|
|
clearable |
|
|
|
|
|
filterable |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="modalData.hsfApprover" |
|
|
|
|
|
readonly |
|
|
:disabled="isRohsFieldDisabled('hsfApprover')" |
|
|
:disabled="isRohsFieldDisabled('hsfApprover')" |
|
|
style="width: 420px" |
|
|
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> |
|
|
|
|
|
|
|
|
placeholder="请选择人员" |
|
|
|
|
|
@focus="openHsfApproverChooseModal"> |
|
|
|
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-form :inline="true" label-position="top" :model="modalData"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData"> |
|
|
@ -570,6 +560,23 @@ |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog width="530px" title="HSF审批人" :close-on-click-modal="false" :visible.sync="hsfApproverFlag"> |
|
|
|
|
|
<el-transfer |
|
|
|
|
|
v-model="hsfApproverTransferList" |
|
|
|
|
|
class="rq" |
|
|
|
|
|
filterable |
|
|
|
|
|
:props="hsfApproverOperatorProp" |
|
|
|
|
|
:data="hsfApproverOptionList" |
|
|
|
|
|
:titles="['未选择', '已选择']"> |
|
|
|
|
|
</el-transfer> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<div style="margin-top: 5px"> |
|
|
|
|
|
<el-button type="primary" @click="saveHsfApproverChooseModal">确定</el-button> |
|
|
|
|
|
<el-button type="primary" @click="hsfApproverFlag = false">取消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px"> |
|
|
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px"> |
|
|
<el-form label-position="top"> |
|
|
<el-form label-position="top"> |
|
|
<el-form-item label="驳回意见/Reject Opinion"> |
|
|
<el-form-item label="驳回意见/Reject Opinion"> |
|
|
@ -1068,6 +1075,12 @@ export default { |
|
|
nodeOptions: [], |
|
|
nodeOptions: [], |
|
|
projectList: [], |
|
|
projectList: [], |
|
|
hsfApproverOptionList: [], |
|
|
hsfApproverOptionList: [], |
|
|
|
|
|
hsfApproverTransferList: [], |
|
|
|
|
|
hsfApproverFlag: false, |
|
|
|
|
|
hsfApproverOperatorProp: { |
|
|
|
|
|
key: 'operatorId', |
|
|
|
|
|
label: 'operatorName' |
|
|
|
|
|
}, |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
approvalList: [], |
|
|
approvalList: [], |
|
|
plmRohsAuthorityArr: [], |
|
|
plmRohsAuthorityArr: [], |
|
|
@ -1322,24 +1335,74 @@ export default { |
|
|
this.$set(this.modalData, 'relatedPeople', '') |
|
|
this.$set(this.modalData, 'relatedPeople', '') |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
mapHsfApproverNamesToIds (nameList, optionList = this.hsfApproverOptionList) { |
|
|
|
|
|
if (!Array.isArray(nameList) || !Array.isArray(optionList) || optionList.length === 0) { |
|
|
|
|
|
return [] |
|
|
|
|
|
} |
|
|
|
|
|
const nameMap = new Map() |
|
|
|
|
|
optionList.forEach(item => { |
|
|
|
|
|
if (item && item.operatorName && item.operatorId && !nameMap.has(item.operatorName)) { |
|
|
|
|
|
nameMap.set(item.operatorName, item.operatorId) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return nameList |
|
|
|
|
|
.map(name => nameMap.get(name)) |
|
|
|
|
|
.filter(id => !!id) |
|
|
|
|
|
}, |
|
|
|
|
|
mapHsfApproverIdsToNames (idList, optionList = this.hsfApproverOptionList) { |
|
|
|
|
|
if (!Array.isArray(idList) || !Array.isArray(optionList) || optionList.length === 0) { |
|
|
|
|
|
return [] |
|
|
|
|
|
} |
|
|
|
|
|
const idMap = new Map() |
|
|
|
|
|
optionList.forEach(item => { |
|
|
|
|
|
if (item && item.operatorId && item.operatorName) { |
|
|
|
|
|
idMap.set(item.operatorId, item.operatorName) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return idList |
|
|
|
|
|
.map(id => idMap.get(id)) |
|
|
|
|
|
.filter(name => !!name) |
|
|
|
|
|
}, |
|
|
|
|
|
openHsfApproverChooseModal () { |
|
|
|
|
|
if (this.isRohsFieldDisabled('hsfApprover')) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.modalData || !this.modalData.projectId) { |
|
|
|
|
|
this.$message.warning('请先选择项目编码') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.loadHsfApproverByCurrentProject(false).then(() => { |
|
|
|
|
|
this.hsfApproverTransferList = this.mapHsfApproverNamesToIds(this.modalData.hsfApproverList) |
|
|
|
|
|
if (!this.hsfApproverOptionList || this.hsfApproverOptionList.length === 0) { |
|
|
|
|
|
this.$message.warning('未查询到可选HSF审批人') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.hsfApproverFlag = true |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
saveHsfApproverChooseModal () { |
|
|
|
|
|
const selectedNames = this.mapHsfApproverIdsToNames(this.hsfApproverTransferList) |
|
|
|
|
|
this.$set(this.modalData, 'hsfApproverList', selectedNames) |
|
|
|
|
|
this.syncHsfApproverFields() |
|
|
|
|
|
this.hsfApproverFlag = false |
|
|
|
|
|
}, |
|
|
clearHsfApproverFields (clearBuNo = false) { |
|
|
clearHsfApproverFields (clearBuNo = false) { |
|
|
if (clearBuNo) { |
|
|
if (clearBuNo) { |
|
|
this.$set(this.modalData, 'buNo', '') |
|
|
this.$set(this.modalData, 'buNo', '') |
|
|
} |
|
|
} |
|
|
this.hsfApproverOptionList = [] |
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
this.$set(this.modalData, 'hsfApproverList', []) |
|
|
this.$set(this.modalData, 'hsfApproverList', []) |
|
|
this.$set(this.modalData, 'hsfApprover', '') |
|
|
this.$set(this.modalData, 'hsfApprover', '') |
|
|
this.$set(this.modalData, 'relatedPeople', '') |
|
|
this.$set(this.modalData, 'relatedPeople', '') |
|
|
}, |
|
|
}, |
|
|
handleHsfApproverChange (val) { |
|
|
|
|
|
this.$set(this.modalData, 'hsfApproverList', Array.isArray(val) ? val : []) |
|
|
|
|
|
this.syncHsfApproverFields() |
|
|
|
|
|
}, |
|
|
|
|
|
loadHsfApproverByCurrentProject (forceSelectAll = false) { |
|
|
loadHsfApproverByCurrentProject (forceSelectAll = false) { |
|
|
if (!this.modalData || !this.modalData.site || !this.modalData.projectId) { |
|
|
if (!this.modalData || !this.modalData.site || !this.modalData.projectId) { |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.$message.warning('请先选择项目编码') |
|
|
this.$message.warning('请先选择项目编码') |
|
|
} |
|
|
} |
|
|
|
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.clearHsfApproverFields(false) |
|
|
this.clearHsfApproverFields(false) |
|
|
} |
|
|
} |
|
|
@ -1350,6 +1413,8 @@ export default { |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.$message.warning('当前项目未维护BU,无法查询HSF审批人') |
|
|
this.$message.warning('当前项目未维护BU,无法查询HSF审批人') |
|
|
} |
|
|
} |
|
|
|
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.clearHsfApproverFields(false) |
|
|
this.clearHsfApproverFields(false) |
|
|
} |
|
|
} |
|
|
@ -1363,19 +1428,24 @@ export default { |
|
|
return api.searchBmUser(params).then(({data}) => { |
|
|
return api.searchBmUser(params).then(({data}) => { |
|
|
if (data && data.code === 0 && Array.isArray(data.rows)) { |
|
|
if (data && data.code === 0 && Array.isArray(data.rows)) { |
|
|
this.hsfApproverOptionList = data.rows |
|
|
this.hsfApproverOptionList = data.rows |
|
|
const allApprovers = data.rows.map(item => item.operatorName).filter(item => item) |
|
|
|
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.$set(this.modalData, 'hsfApproverList', allApprovers) |
|
|
|
|
|
|
|
|
const defaultSelectedIds = data.rows.map(item => item.operatorId).filter(item => item) |
|
|
|
|
|
this.hsfApproverTransferList = defaultSelectedIds |
|
|
|
|
|
this.$set(this.modalData, 'hsfApproverList', this.mapHsfApproverIdsToNames(defaultSelectedIds, data.rows)) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.hsfApproverTransferList = this.mapHsfApproverNamesToIds(this.modalData.hsfApproverList, data.rows) |
|
|
} |
|
|
} |
|
|
this.syncHsfApproverFields() |
|
|
this.syncHsfApproverFields() |
|
|
} else { |
|
|
} else { |
|
|
this.hsfApproverOptionList = [] |
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.clearHsfApproverFields(false) |
|
|
this.clearHsfApproverFields(false) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.hsfApproverOptionList = [] |
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
if (forceSelectAll) { |
|
|
if (forceSelectAll) { |
|
|
this.clearHsfApproverFields(false) |
|
|
this.clearHsfApproverFields(false) |
|
|
} |
|
|
} |
|
|
@ -1721,6 +1791,8 @@ export default { |
|
|
this.projectMaterialSelections = [] |
|
|
this.projectMaterialSelections = [] |
|
|
this.materialSelections = [] |
|
|
this.materialSelections = [] |
|
|
this.hsfApproverOptionList = [] |
|
|
this.hsfApproverOptionList = [] |
|
|
|
|
|
this.hsfApproverTransferList = [] |
|
|
|
|
|
this.hsfApproverFlag = false |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.plmRohsAuthorityArr = [] |
|
|
this.nodeAuthorityLoaded = !row |
|
|
this.nodeAuthorityLoaded = !row |
|
|
this.isEditMode = !!row |
|
|
this.isEditMode = !!row |
|
|
|