diff --git a/src/views/modules/eam/eamProjectInfo.vue b/src/views/modules/eam/eamProjectInfo.vue index 1f04d75..f7c1600 100644 --- a/src/views/modules/eam/eamProjectInfo.vue +++ b/src/views/modules/eam/eamProjectInfo.vue @@ -872,6 +872,7 @@ import {searchBusinessInfo7} from "../../../api/factory/site"; flag:'', bu: '', buNo: '', + buDesc: '', site: this.$store.state.user.site, projectId: '', projectNo: '', @@ -2612,15 +2613,95 @@ import {searchBusinessInfo7} from "../../../api/factory/site"; // return // } if (this.modalData.flag === '1') { - if (new Date(this.modalData.needDate).getTime() < new Date().getTime()) { - this.$confirm('预计完成日期小于当前日期,确定继续保存?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + console.log(this.userBuList) + // 遍历userBuList + this.userBuList.forEach((item) => { + if (this.modalData.bu === item.buNo) { + this.modalData.buDesc = item.buDesc + } + }) + this.$confirm('项目 ' + this.modalData.projectNo + '-' + this.modalData.projectDesc + ' 的BU为:' + this.modalData.buDesc + ',是否确认继续保存?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + if (new Date(this.modalData.needDate).getTime() < new Date().getTime()) { + this.$confirm('预计完成日期小于当前日期,确定继续保存?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.modalData.status = '草稿' + let inData = { + projectId: null, + projectNo: this.modalData.projectNo, + projectDesc: this.modalData.projectDesc, + projectCategory: this.modalData.projectCategory, + projectCloseDate: this.modalData.projectCloseDate, + needDate: this.modalData.needDate, + cProjectRegion: this.modalData.cProjectRegion, + projectManager: this.modalData.projectManager, + projectOwner: this.modalData.projectOwner, + engineer: this.modalData.engineer, + cQualityEngineer1: this.modalData.cQualityEngineer1, + cQualityEngineer2: this.modalData.cQualityEngineer2, + cQualityEngineer3: this.modalData.cQualityEngineer3, + cManufactureEngineer: this.modalData.cManufactureEngineer, + docEngineer: this.modalData.docEngineer, + projectCreationDate: this.modalData.projectCreationDate, + createDate: this.modalData.createDate, + createBy: this.modalData.createBy, + updateBy: this.modalData.updateBy, + site: this.modalData.site, + bu: this.modalData.bu, + customerNo: this.modalData.customerNo, + customerDesc: this.modalData.customerDesc, + status: this.modalData.status, + active: this.modalData.active, + closeDate: this.modalData.projectCloseDate, + buildDate: this.modalData.projectCreationDate, + priority: this.modalData.priority, + testPartNo: 'P000000', + partDesc: '无物料', + } + eamProjectInfoSave(this.modalData).then(({data}) => { + if (data && data.code === '0') { + eamProjectInfoSearch(this.searchData).then(({data}) => { + if (data && data.code === 0) { + inData.projectId = data.page.list[0].projectId + eamProjectPartInfoSave(inData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.modalFlag = false + EventBus.$emit('updateProjectPartInfo') + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + }, + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } + }) + } + }) + }).catch(() => { + // 如果点击取消提示已取消操作 + this.$message({ + type: 'info', + message: '已取消操作' + }) + }) + } else { this.modalData.status = '草稿' let inData = { - projectId : null, + projectId: null, projectNo: this.modalData.projectNo, projectDesc: this.modalData.projectDesc, projectCategory: this.modalData.projectCategory, @@ -2645,8 +2726,8 @@ import {searchBusinessInfo7} from "../../../api/factory/site"; customerDesc: this.modalData.customerDesc, status: this.modalData.status, active: this.modalData.active, - closeDate : this.modalData.projectCloseDate, - buildDate : this.modalData.projectCreationDate, + closeDate: this.modalData.projectCloseDate, + buildDate: this.modalData.projectCreationDate, priority: this.modalData.priority, testPartNo: 'P000000', partDesc: '无物料', @@ -2676,82 +2757,20 @@ import {searchBusinessInfo7} from "../../../api/factory/site"; }) } }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } }) - }).catch(() => { - // 如果点击取消提示已取消操作 - this.$message({ - type: 'info', - message: '已取消操作' - }) - }) - } - else { - this.modalData.status = '草稿' - let inData = { - projectId : null, - projectNo: this.modalData.projectNo, - projectDesc: this.modalData.projectDesc, - projectCategory: this.modalData.projectCategory, - projectCloseDate: this.modalData.projectCloseDate, - needDate: this.modalData.needDate, - cProjectRegion: this.modalData.cProjectRegion, - projectManager: this.modalData.projectManager, - projectOwner: this.modalData.projectOwner, - engineer: this.modalData.engineer, - cQualityEngineer1: this.modalData.cQualityEngineer1, - cQualityEngineer2: this.modalData.cQualityEngineer2, - cQualityEngineer3: this.modalData.cQualityEngineer3, - cManufactureEngineer: this.modalData.cManufactureEngineer, - docEngineer: this.modalData.docEngineer, - projectCreationDate: this.modalData.projectCreationDate, - createDate: this.modalData.createDate, - createBy: this.modalData.createBy, - updateBy: this.modalData.updateBy, - site: this.modalData.site, - bu: this.modalData.bu, - customerNo: this.modalData.customerNo, - customerDesc: this.modalData.customerDesc, - status: this.modalData.status, - active: this.modalData.active, - closeDate : this.modalData.projectCloseDate, - buildDate : this.modalData.projectCreationDate, - priority: this.modalData.priority, - testPartNo: 'P000000', - partDesc: '无物料', } - eamProjectInfoSave(this.modalData).then(({data}) => { - if (data && data.code === '0') { - eamProjectInfoSearch(this.searchData).then(({data}) => { - if (data && data.code === 0) { - inData.projectId = data.page.list[0].projectId - eamProjectPartInfoSave(inData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - EventBus.$emit('updateProjectPartInfo') - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - }, - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - } - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } + }).catch(() => { + // 如果点击取消提示已取消操作 + this.$message({ + type: 'info', + message: '已取消操作' }) - } + }) } else if (this.modalData.flag === '2'){ let inData = { projectId : this.modalData.projectId, diff --git a/src/views/modules/eam/eamProjectInfoForConfirm.vue b/src/views/modules/eam/eamProjectInfoForConfirm.vue index 4647b34..91a6ab5 100644 --- a/src/views/modules/eam/eamProjectInfoForConfirm.vue +++ b/src/views/modules/eam/eamProjectInfoForConfirm.vue @@ -829,7 +829,6 @@ export default { // 获取数据列表 getDataList () { - console.log(this.$route.query.flag) this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex if (this.$route.query.flag === '4') { @@ -871,19 +870,32 @@ export default { }else { searchAllConfirmProgressList(this.searchData).then(({data}) => { if (data.code === 0) { - this.dataList = data.page.list - this.pageIndex = data.page.currPage - this.pageSize = data.page.pageSize - this.totalPage = data.page.totalCount - this.dataList.forEach((item) => { - item.projectManagerName = item.projectManager.split('-')[1] - item.projectOwnerName = item.projectOwner.split('-')[1] - item.engineerName = item.engineer.split('-')[1] - item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1] - item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1] - item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1] - item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1] + let pjmList = [] + // 遍历data.page.list + data.list.forEach((item) => { + if (!pjmList.includes(item.projectOwner.split('-')[0])) { + pjmList.push(item.projectOwner.split('-')[0]) + } }) + console.log(pjmList) + console.log(this.$store.state.user.name) + if (pjmList.includes(this.$store.state.user.name)) { + this.dataList = data.page.list + this.pageIndex = data.page.currPage + this.pageSize = data.page.pageSize + this.totalPage = data.page.totalCount + this.dataList.forEach((item) => { + item.projectManagerName = item.projectManager.split('-')[1] + item.projectOwnerName = item.projectOwner.split('-')[1] + item.engineerName = item.engineer.split('-')[1] + item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1] + item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1] + item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1] + item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1] + }) + } + } else { + this.$route.query.flag = '3' } }) } diff --git a/src/views/modules/eam/eamProjectInfoForUploads.vue b/src/views/modules/eam/eamProjectInfoForUploads.vue index 6865fff..a44d3ec 100644 --- a/src/views/modules/eam/eamProjectInfoForUploads.vue +++ b/src/views/modules/eam/eamProjectInfoForUploads.vue @@ -75,6 +75,21 @@ 查询 + + {{ "导出" }} + @@ -153,8 +168,14 @@ export default { components: {UploadFileList1}, data() { return { + // 导出 + exportData: [], + exportName: '待上传文件' + this.dayjs().format('YYYYMMDDHHmmss'), + exportHeader: ['待上传文件'], + exportFooter: [], folder: '', dataList: [], + allDataList: [], fileList: [], confirmProgressList: [], projectPartDocumentList: [], @@ -961,6 +982,59 @@ export default { }) }, + //导出excel + async createExportData() { + this.getDataList() + this.allDataList.forEach((item) => { + item.projectManagerName = item.projectManager.split('-')[1] + item.projectOwnerName = item.projectOwner.split('-')[1] + item.engineerName = item.engineer.split('-')[1] + item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1] + item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1] + item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1] + item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1] + }) + for (let i = 0; i < this.allDataList.length; i++) { + if (this.allDataList[i].responsibleDepartment === 'R001') { + this.allDataList[i].projectLeader = this.allDataList[i].projectManager.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R002') { + this.allDataList[i].projectLeader = this.allDataList[i].projectOwner.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R004') { + this.allDataList[i].projectLeader = this.allDataList[i].engineer.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R005') { + this.allDataList[i].projectLeader = this.allDataList[i].cQualityEngineer1.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R007') { + this.allDataList[i].projectLeader = this.allDataList[i].cQualityEngineer2.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R008') { + this.allDataList[i].projectLeader = this.allDataList[i].cQualityEngineer3.split("-")[1] + } else if (this.allDataList[i].responsibleDepartment === 'R009') { + this.allDataList[i].projectLeader = this.allDataList[i].cManufactureEngineer.split("-")[1] + } + } + this.exportList = this.allDataList + return this.exportList + }, + + startDownload() { + }, + + finishDownload() { + }, + + fields () { + let json = "{" + this.columnProjectAllDocumentList.forEach((item, index) => { + if (index == this.columnProjectAllDocumentList.length - 1) { + json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + } else { + json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," + } + }) + json += "}" + let s = eval("(" + json + ")") + return s + }, + // 获取数据列表 getDataList () { this.searchData.limit = this.pageSize @@ -1038,6 +1112,7 @@ export default { }else { searchAllProjectUploadsDocumentList(this.searchData).then(({data}) => { if (data.code === 0) { + this.allDataList = data.list let pjmList = [] // 遍历data.page.list data.list.forEach((item) => { @@ -1045,8 +1120,6 @@ export default { pjmList.push(item.projectOwner.split('-')[0]) } }) - console.log(pjmList) - console.log(this.$store.state.user.name) if (pjmList.includes(this.$store.state.user.name)){ this.warnFlag = true this.dataList = data.page.list