diff --git a/src/views/modules/eam/eamProjectInfo.vue b/src/views/modules/eam/eamProjectInfo.vue
index 6ec426e..6d31ae9 100644
--- a/src/views/modules/eam/eamProjectInfo.vue
+++ b/src/views/modules/eam/eamProjectInfo.vue
@@ -393,7 +393,7 @@
-
+
料号状态
@@ -406,7 +406,7 @@
-
+
分类
@@ -417,7 +417,7 @@
-
+
优先级
@@ -1253,9 +1253,18 @@ import {updateColumnSize} from "../../../api/table";
let buDescText = this.normalizeBuText(this.currentModalBuDesc)
return buNoText === '04-MHM' || buNoText.indexOf('ANTENNA') > -1 || buDescText.indexOf('ANTENNA') > -1 || buDescText.indexOf('天线') > -1
},
+ isHardtagBu () {
+ let buNoText = this.normalizeBuText(this.currentModalBuNo)
+ let buDescText = this.normalizeBuText(this.currentModalBuDesc)
+ return buNoText.indexOf('02-Hardtag') > -1 || buNoText.indexOf('HARDTAG') > -1 || buDescText.indexOf('HARDTAG') > -1 || buDescText.indexOf('硬标') > -1
+ },
isAlphaOrAntennaBu () {
return this.isAlphaBu || this.isAntennaBu
},
+ // Alpha / 天线 / 硬标三个事业部,分类字段不要求手工选择。
+ isDryWetTypeOptionalBu () {
+ return this.isAlphaOrAntennaBu || this.isHardtagBu
+ },
},
components: {
Chooselist,
@@ -3832,7 +3841,7 @@ import {updateColumnSize} from "../../../api/table";
projectCategory:'',
testPartNo:'',
partDesc:'',
- dry_wet_type: 'Dry',
+ dry_wet_type: '',
projectNo: '',
projectDesc:'',
projectCloseDate:'',
@@ -4072,6 +4081,10 @@ import {updateColumnSize} from "../../../api/table";
this.$message.warning('请输入PjM!')
return
}
+ // Alpha / 天线 / 硬标 BU 分类非必填,未选时默认回填 Dry,避免后端接收空值。
+ if (this.isDryWetTypeOptionalBu && (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null)) {
+ this.modalData.dry_wet_type = ''
+ }
if (this.isAlphaOrAntennaBu) {
if (this.modalData.qcEngineer === '' || this.modalData.qcEngineer == null) {
this.$message.warning('请输入QC!')
@@ -4189,7 +4202,7 @@ import {updateColumnSize} from "../../../api/table";
testPartNo: 'P000000',
partDesc: '无物料',
partType: 'Active',
- dry_wet_type: this.modalData.dry_wet_type || 'Dry',
+ dry_wet_type: this.modalData.dry_wet_type ,
remark: this.modalData.remark,
}
eamProjectInfoSave(this.modalData).then(({data}) => {
@@ -4271,7 +4284,7 @@ import {updateColumnSize} from "../../../api/table";
testPartNo: 'P000000',
partDesc: '无物料',
partType: 'Active',
- dry_wet_type: this.modalData.dry_wet_type || 'Dry',
+ dry_wet_type: this.modalData.dry_wet_type ,
remark: this.modalData.remark,
}
eamProjectInfoSave(this.modalData).then(({data}) => {
@@ -4354,7 +4367,7 @@ import {updateColumnSize} from "../../../api/table";
buildDate : this.modalData.projectCreationDate,
priority: this.modalData.priority,
partType: this.modalData.partType,
- dry_wet_type: this.modalData.dry_wet_type || 'Dry',
+ dry_wet_type: this.modalData.dry_wet_type ,
testPartNo: 'P000000',
partDesc: '无物料',
status: this.modalData.status,
@@ -4444,7 +4457,7 @@ import {updateColumnSize} from "../../../api/table";
this.$message.warning('请选择料号状态!')
return
}
- if (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null) {
+ if (!this.isDryWetTypeOptionalBu && (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null)) {
this.$message.warning('请选择分类!')
return
}
@@ -4480,7 +4493,7 @@ import {updateColumnSize} from "../../../api/table";
this.$message.warning('请选择料号状态!')
return
}
- if (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null) {
+ if (!this.isDryWetTypeOptionalBu && (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null)) {
this.$message.warning('请选择分类!')
return
}
@@ -4861,7 +4874,7 @@ import {updateColumnSize} from "../../../api/table";
projectCreationDate: row.projectCreationDate,
status: '草稿',
partType: 'Active',
- dry_wet_type: 'Dry',
+ dry_wet_type: '',
remark: row.remark,
// active: row.active,
createBy: this.$store.state.user.name,
diff --git a/src/views/modules/eam/eamProjectInfoForUploads.vue b/src/views/modules/eam/eamProjectInfoForUploads.vue
index 4089611..945a883 100644
--- a/src/views/modules/eam/eamProjectInfoForUploads.vue
+++ b/src/views/modules/eam/eamProjectInfoForUploads.vue
@@ -1773,6 +1773,8 @@ export default {
copyDialog: false,
documentCopySelection: [],
copyDocumentList: [],
+ // keep-alive 页面首次进入会先后触发 created/activated,这里用于避免首屏重复查一次
+ skipFirstActivatedDataLoad: true,
};
},
created() {
@@ -1794,7 +1796,9 @@ export default {
this.getDataList()
},
activated() {
- if (this.$route.query.flag) {
+ if (this.skipFirstActivatedDataLoad) {
+ this.skipFirstActivatedDataLoad = false
+ } else if (this.$route.query.flag) {
this.getDataList()
}
this.$store.commit("sift/commitSearchFunction",this.queryProjectUploadsDocumentList)
@@ -1838,6 +1842,51 @@ export default {
}
})
},
+ getNameAfterDash (userText) {
+ if (userText === null || userText === undefined || userText === '') {
+ return ''
+ }
+ const splitValues = String(userText).split('-')
+ if (splitValues.length < 2) {
+ return ''
+ }
+ return splitValues[1]
+ },
+ resolveProjectLeaderByResponsibleDepartment (row) {
+ if (!row) {
+ return ''
+ }
+ const responsibleDepartment = row.responsibleDepartment
+ // 统一责任部门与人员字段的映射,避免不同查询分支遗漏新角色导致显示和筛选不一致
+ if (responsibleDepartment === 'R001') return this.getNameAfterDash(row.projectManager)
+ if (responsibleDepartment === 'R002') return this.getNameAfterDash(row.projectOwner)
+ if (responsibleDepartment === 'R004') return this.getNameAfterDash(row.engineer)
+ if (responsibleDepartment === 'R005') return this.getNameAfterDash(row.cQualityEngineer1)
+ if (responsibleDepartment === 'R007') return this.getNameAfterDash(row.cQualityEngineer2)
+ if (responsibleDepartment === 'R008') return this.getNameAfterDash(row.cQualityEngineer3)
+ if (responsibleDepartment === 'R009') return this.getNameAfterDash(row.cManufactureEngineer)
+ if (responsibleDepartment === 'R011') return this.getNameAfterDash(row.cQualityEngineer4)
+ if (responsibleDepartment === 'R012') return this.getNameAfterDash(row.docEngineer)
+ if (responsibleDepartment === 'R013') return this.getNameAfterDash(row.cQualityEngineer5)
+ if (responsibleDepartment === 'R014') return this.getNameAfterDash(row.cQualityEngineer6)
+ if (responsibleDepartment === 'R015') return this.getNameAfterDash(row.ipqcHardTag)
+ if (responsibleDepartment === 'R016') return this.getNameAfterDash(row.cQualityEngineer7)
+ if (responsibleDepartment === 'R017') return this.getNameAfterDash(row.docEngineer2)
+ if (responsibleDepartment === 'RQC') return this.getNameAfterDash(row.qcEngineer)
+ if (responsibleDepartment === 'RPE') return this.getNameAfterDash(row.peEngineer)
+ if (responsibleDepartment === 'REE') return this.getNameAfterDash(row.eeEngineer)
+ if (responsibleDepartment === 'RSQEME') return this.getNameAfterDash(row.sqemeEngineer)
+ if (responsibleDepartment === 'RSQEEE') return this.getNameAfterDash(row.sqeeeEngineer)
+ return ''
+ },
+ applyProjectLeaderForList (list) {
+ if (!Array.isArray(list) || list.length === 0) {
+ return
+ }
+ for (let i = 0; i < list.length; i++) {
+ list[i].projectLeader = this.resolveProjectLeaderByResponsibleDepartment(list[i])
+ }
+ },
// 获取用户的bu
getSiteAndBuByUserName () {
let tempData = {
@@ -1887,51 +1936,7 @@ export default {
}
});
- for (let i = 0; i < this.exportList.length; i++) {
- if (this.exportList[i].responsibleDepartment === 'R001') {
- this.exportList[i].projectLeader = this.exportList[i].projectManager.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R002') {
- this.exportList[i].projectLeader = this.exportList[i].projectOwner.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R004') {
- this.exportList[i].projectLeader = this.exportList[i].engineer.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R005') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer1.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R007') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer2.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R008') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer3.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R009') {
- this.exportList[i].projectLeader = this.exportList[i].cManufactureEngineer.split("-")[1];
- } else if (this.exportList[i].responsibleDepartment === 'R011') {
- if (this.exportList[i].cQualityEngineer4 !== null && this.exportList[i].cQualityEngineer4 !== '') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer4.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R012') {
- if (this.exportList[i].docEngineer !== null && this.exportList[i].docEngineer !== '') {
- this.exportList[i].projectLeader = this.exportList[i].docEngineer.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R013') {
- if (this.exportList[i].cQualityEngineer5 !== null && this.exportList[i].cQualityEngineer5 !== '') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer5.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R014') {
- if (this.exportList[i].cQualityEngineer6 !== null && this.exportList[i].cQualityEngineer6 !== '') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer6.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R015') {
- if (this.exportList[i].ipqcHardTag !== null && this.exportList[i].ipqcHardTag !== '') {
- this.exportList[i].projectLeader = this.exportList[i].ipqcHardTag.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R016') {
- if (this.exportList[i].cQualityEngineer7 !== null && this.exportList[i].cQualityEngineer7 !== '') {
- this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer7.split("-")[1];
- }
- } else if (this.exportList[i].responsibleDepartment === 'R017') {
- if (this.exportList[i].docEngineer2 !== null && this.exportList[i].docEngineer2 !== '') {
- this.exportList[i].projectLeader = this.exportList[i].docEngineer2.split("-")[1];
- }
- }
- }
+ this.applyProjectLeaderForList(this.exportList)
})
return this.exportList
},
@@ -1963,8 +1968,10 @@ export default {
this.searchData.limit = this.pageSize % 10 === 0 ? this.pageSize : 20
this.searchData.page = this.pageIndex
+ this.dataListLoading = true
+ let requestPromise = null
if (this.$route.query.flag === '2') {
- searchProjectOverUploadsDocumentList(this.searchData).then(({data}) => {
+ requestPromise = searchProjectOverUploadsDocumentList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.allPersonnelInfoList = data.list
@@ -2015,71 +2022,13 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split('-')[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001'){
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R002'){
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R004'){
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R005'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R007'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R008'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R009'){
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013'){
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R014'){
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015'){
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016'){
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R017'){
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
}
// 获取全部人员信息用于下拉框
this.getAllPersonnelList()
})
}else if(this.$route.query.flag === '1') {
- searchProjectUploadsDocumentList(this.searchData).then(({data}) => {
+ requestPromise = searchProjectUploadsDocumentList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.allPersonnelInfoList = data.list
@@ -2130,72 +2079,13 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split("-")[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001'){
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R002'){
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R004'){
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R005'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R007'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R008'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R009'){
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013') {
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R014') {
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015') {
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016') {
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- }
- else if(this.dataList[i].responsibleDepartment === 'R017'){
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
}
// 获取全部人员信息用于下拉框
this.getAllPersonnelList()
})
}else {
- searchAllProjectUploadsDocumentList(this.searchData).then(({data}) => {
+ requestPromise = searchAllProjectUploadsDocumentList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.allDataList = data.list
let pjmList = []
@@ -2256,65 +2146,7 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split("-")[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001') {
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R002') {
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R004') {
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R005') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R007') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R008') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R009') {
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013'){
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R014'){
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015'){
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016'){
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R017'){
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
} else {
this.$route.query.flag = '1'
}
@@ -2323,6 +2155,13 @@ export default {
}
})
}
+ if (requestPromise) {
+ requestPromise.finally(() => {
+ this.dataListLoading = false
+ })
+ } else {
+ this.dataListLoading = false
+ }
},
queryProjectUploadsDocumentList (params) {
@@ -2337,8 +2176,10 @@ export default {
} else {
params = this.searchData
}
+ this.dataListLoading = true
+ let requestPromise = null
if (this.$route.query.flag === '2') {
- queryProjectOverUploadsDocumentList(params).then(({data}) => {
+ requestPromise = queryProjectOverUploadsDocumentList(params).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.allPersonnelInfoList = data.list
@@ -2389,71 +2230,13 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split("-")[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001'){
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R002'){
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R004'){
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R005'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R007'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R008'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R009'){
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013'){
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- }else if(this.dataList[i].responsibleDepartment === 'R014'){
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015'){
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016'){
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R017') {
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
}
// 获取全部人员信息用于下拉框
this.getAllPersonnelList()
})
}else if(this.$route.query.flag === '1') {
- queryProjectUploadsDocumentList(params).then(({data}) => {
+ requestPromise = queryProjectUploadsDocumentList(params).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.allPersonnelInfoList = data.list
@@ -2504,71 +2287,13 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split("-")[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001'){
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R002'){
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R004'){
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R005'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R007'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R008'){
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R009'){
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013') {
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R014') {
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015') {
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016') {
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R017') {
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
}
// 获取全部人员信息用于下拉框
this.getAllPersonnelList()
})
}else {
- queryAllProjectUploadsDocumentList(params).then(({data}) => {
+ requestPromise = queryAllProjectUploadsDocumentList(params).then(({data}) => {
if (data.code === 0) {
this.allDataList = data.list
let pjmList = []
@@ -2629,65 +2354,7 @@ export default {
item.cQualityEngineer7Name = item.cQualityEngineer7.split("-")[1]
}
})
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].responsibleDepartment === 'R001') {
- this.dataList[i].projectLeader = this.dataList[i].projectManager.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R002') {
- this.dataList[i].projectLeader = this.dataList[i].projectOwner.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R004') {
- this.dataList[i].projectLeader = this.dataList[i].engineer.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R005') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer1.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R007') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer2.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R008') {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer3.split("-")[1]
- } else if (this.dataList[i].responsibleDepartment === 'R009') {
- this.dataList[i].projectLeader = this.dataList[i].cManufactureEngineer.split("-")[1]
- } else if(this.dataList[i].responsibleDepartment === 'R012'){
- if (this.dataList[i].docEngineer === null || this.dataList[i].docEngineer === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R011'){
- if (this.dataList[i].cQualityEngineer4 === null || this.dataList[i].cQualityEngineer4 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R013'){
- if (this.dataList[i].cQualityEngineer5 === null || this.dataList[i].cQualityEngineer5 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R014'){
- if (this.dataList[i].cQualityEngineer6 === null || this.dataList[i].cQualityEngineer6 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R015'){
- if (this.dataList[i].ipqcHardTag === null || this.dataList[i].ipqcHardTag === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R016'){
- if (this.dataList[i].cQualityEngineer7 === null || this.dataList[i].cQualityEngineer7 === ''){
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(this.dataList[i].responsibleDepartment === 'R017') {
- if (this.dataList[i].docEngineer2 === null || this.dataList[i].docEngineer2 === '') {
- this.dataList[i].projectLeader = ''
- } else {
- this.dataList[i].projectLeader = this.dataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(this.dataList)
} else {
this.$route.query.flag = '1'
}
@@ -2697,6 +2364,13 @@ export default {
}
})
}
+ if (requestPromise) {
+ requestPromise.finally(() => {
+ this.dataListLoading = false
+ })
+ } else {
+ this.dataListLoading = false
+ }
},
// 获取全部人员信息用于下拉框
@@ -2712,65 +2386,7 @@ export default {
const finalPartNosMap = new Map();
const projectProjectLeadersMap = new Map();
- for (let i = 0; i < allPersonnelInfoDataList.length; i++) {
- if (allPersonnelInfoDataList[i].responsibleDepartment === 'R001'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].projectManager.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R002'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].projectOwner.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R004'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].engineer.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R005'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer1.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R007'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer2.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R008'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer3.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R009'){
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cManufactureEngineer.split("-")[1]
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R012'){
- if (allPersonnelInfoDataList[i].docEngineer === null || allPersonnelInfoDataList[i].docEngineer === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].docEngineer.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R011'){
- if (allPersonnelInfoDataList[i].cQualityEngineer4 === null || allPersonnelInfoDataList[i].cQualityEngineer4 === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer4.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R013'){
- if (allPersonnelInfoDataList[i].cQualityEngineer5 === null || allPersonnelInfoDataList[i].cQualityEngineer5 === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer5.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R014'){
- if (allPersonnelInfoDataList[i].cQualityEngineer6 === null || allPersonnelInfoDataList[i].cQualityEngineer6 === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer6.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R015'){
- if (allPersonnelInfoDataList[i].ipqcHardTag === null || allPersonnelInfoDataList[i].ipqcHardTag === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].ipqcHardTag.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R016'){
- if (allPersonnelInfoDataList[i].cQualityEngineer7 === null || allPersonnelInfoDataList[i].cQualityEngineer7 === ''){
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].cQualityEngineer7.split("-")[1]
- }
- } else if(allPersonnelInfoDataList[i].responsibleDepartment === 'R017') {
- if (allPersonnelInfoDataList[i].docEngineer2 === null || allPersonnelInfoDataList[i].docEngineer2 === '') {
- allPersonnelInfoDataList[i].projectLeader = ''
- } else {
- allPersonnelInfoDataList[i].projectLeader = allPersonnelInfoDataList[i].docEngineer2.split("-")[1]
- }
- }
- }
+ this.applyProjectLeaderForList(allPersonnelInfoDataList)
allPersonnelInfoDataList.forEach((item) => {
// Handle project owners