From a436cc018982220ab3ad21115b22553c73505dc2 Mon Sep 17 00:00:00 2001 From: yuejiayang <146344614+YangLei105@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:03:02 +0800 Subject: [PATCH] =?UTF-8?q?2024.8.9=20=E2=91=A0=E4=BA=A7=E5=93=81=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=94=B6=E9=9B=86-=E9=A1=B9=E7=9B=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BF=9B=E4=B8=80=E6=AD=A5=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E2=91=A1=E4=BB=A3=E5=8A=9E=E4=BA=8B=E5=AE=9C=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------------------ 进一步优化 --- src/api/eam/eamProject.js | 4 +- src/views/modules/common/uploadFileList1.vue | 2 +- .../modules/eam/com_project_proof_record.vue | 15 +- src/views/modules/eam/eamProjectInfo.vue | 221 +++++----- .../modules/eam/eamProjectInfoForConfirm.vue | 2 +- .../modules/eam/eamProjectInfoForUploads.vue | 2 +- src/views/modules/eam/eamProjectPartInfo.vue | 399 +++++++++++------- 7 files changed, 371 insertions(+), 274 deletions(-) diff --git a/src/api/eam/eamProject.js b/src/api/eam/eamProject.js index f93d378..84f6159 100644 --- a/src/api/eam/eamProject.js +++ b/src/api/eam/eamProject.js @@ -5,14 +5,16 @@ export const eamProjectInfoSave= data => createAPI(`/pms/eamProject/eamProjectIn export const eamProjectInfoEdit= data => createAPI(`/pms/eamProject/eamProjectInfoEdit`,'post',data) export const eamProjectInfoDelete= data => createAPI(`/pms/eamProject/eamProjectInfoDelete`,'post',data) export const saveFormalPartNo= data => createAPI(`/pms/eamProject/saveFormalPartNo`,'post',data) +export const getFinalPartDesc= data => createAPI(`/pms/eamProject/getFinalPartDesc`,'post',data) export const getTestPartNo= data => createAPI(`/pms/eamProject/getTestPartNo`,'post',data) export const eamProjectPartSearch= data => createAPI(`/pms/eamProject/eamProjectPartSearch`,'post',data) export const eamProjectPartInfoSave= data => createAPI(`/pms/eamProject/eamProjectPartInfoSave`,'post',data) export const eamProjectPartInfoEdit= data => createAPI(`/pms/eamProject/eamProjectPartInfoEdit`,'post',data) -export const saveNewProjectPart= data => createAPI(`/pms/eamProject/saveNewProjectPart`,'post',data) +export const eamProjectPartInfoDelete= data => createAPI(`/pms/eamProject/eamProjectPartInfoDelete`,'post',data) export const searchConfirmatorList= data => createAPI(`/pms/eamProject/searchConfirmatorList`,'post',data) export const saveProductionValidationDocumentConfirmator= data => createAPI(`/pms/eamProject/saveProductionValidationDocumentConfirmator`,'post',data) export const saveProductionValidationDocument= data => createAPI(`/pms/eamProject/saveProductionValidationDocument`,'post',data) +export const deleteConfirmatorInformation= data => createAPI(`/pms/eamProject/deleteConfirmatorInformation`,'post',data) export const deleteDocumentInformation= data => createAPI(`/pms/eamProject/deleteDocumentInformation`,'post',data) export const checkProductionValidationDocument= data => createAPI(`/pms/eamProject/checkProductionValidationDocument`,'post',data) export const checkConfirmationRecord= data => createAPI(`/pms/eamProject/checkConfirmationRecord`,'post',data) diff --git a/src/views/modules/common/uploadFileList1.vue b/src/views/modules/common/uploadFileList1.vue index ecfee70..0c7990b 100644 --- a/src/views/modules/common/uploadFileList1.vue +++ b/src/views/modules/common/uploadFileList1.vue @@ -252,7 +252,7 @@ export default { this.fileName = ''; this.noType = ''; EventBus.$emit('updateAgencyMatterForUploads'); - EventBus.$emit('updateProjectPartInfo'); + EventBus.$emit('updateProjectPartDocumentInfo'); // this.$emit('get-document-list'); // this.$emit('get-proof-document'); } else { diff --git a/src/views/modules/eam/com_project_proof_record.vue b/src/views/modules/eam/com_project_proof_record.vue index cdfb36f..e231c4e 100644 --- a/src/views/modules/eam/com_project_proof_record.vue +++ b/src/views/modules/eam/com_project_proof_record.vue @@ -3,13 +3,13 @@
-
+

打样记录

- + 上传其他文档 { //区分请求成功和失败的状况 if (data && data.code === 0) { - this.$message({ - message: '新增成功', - type: 'success' - }) this.documentListVisible = false //刷新表格 this.refreshCurrentTabTable() diff --git a/src/views/modules/eam/eamProjectInfo.vue b/src/views/modules/eam/eamProjectInfo.vue index 36cdd06..afbd50a 100644 --- a/src/views/modules/eam/eamProjectInfo.vue +++ b/src/views/modules/eam/eamProjectInfo.vue @@ -74,13 +74,13 @@ - 查询 - 新增 + 查询 + 新增 @@ -153,9 +153,12 @@ - + + + + - + @@ -654,6 +657,7 @@ { - if (data && data.code === '0') { - this.getDataList() - this.modalFlag=false - EventBus.$emit('updateProjectPartInfo') - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {}, + this.$confirm('预计完成日期小于当前日期,确定继续保存?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.modalData.status = '草稿' + eamProjectInfoSave(this.modalData).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'){ if (new Date(this.modalData.needDate).getTime() < new Date().getTime()) { - this.$message.warning('预计完成日期不能小于当前日期!') - return - } - eamProjectInfoEdit(this.modalData).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: '确定' + this.$confirm('预计完成日期小于当前日期,确定继续保存?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + eamProjectInfoEdit(this.modalData).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 if (this.modalData.flag === '3') { if (this.modalData.testPartNo === '' || this.modalData.testPartNo == null) { this.$message.warning('请输入项目料号!') @@ -2694,6 +2652,7 @@ import {EventBus} from "../../../main"; FQCRowDblclick (row) { this.modalData.cQualityEngineer3 = row.username + '-' + row.userDisplay this.modalData.cQualityEngineer3Name = this.modalData.cQualityEngineer3.split('-')[1] // 截取用户名 + this.FQCFlag = false }, MFGRowDblclick (row) { this.modalData.cManufactureEngineer = row.username + '-' + row.userDisplay @@ -2837,6 +2796,32 @@ import {EventBus} from "../../../main"; this.$router.push({ path: 'eam-eamProjectPartInfo', query: { testPartNo: row.testPartNo }}) }, + deletePartModal (row) { + this.$confirm(`是否删除这个项目料号信息?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + eamProjectPartInfoDelete(row).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + EventBus.$emit('updateProjectPartInfo') + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + // 动态列开始 获取 用户保存的 格式列 async getTableUserColumn(tableId, columnId) { let queryTableUser = { diff --git a/src/views/modules/eam/eamProjectInfoForConfirm.vue b/src/views/modules/eam/eamProjectInfoForConfirm.vue index a8e3d12..d8bd4c6 100644 --- a/src/views/modules/eam/eamProjectInfoForConfirm.vue +++ b/src/views/modules/eam/eamProjectInfoForConfirm.vue @@ -787,7 +787,7 @@ export default { status: '进行中', }, { - status: '已结案', + status: '已量产', } ], }; diff --git a/src/views/modules/eam/eamProjectInfoForUploads.vue b/src/views/modules/eam/eamProjectInfoForUploads.vue index dc49c5e..2ff7733 100644 --- a/src/views/modules/eam/eamProjectInfoForUploads.vue +++ b/src/views/modules/eam/eamProjectInfoForUploads.vue @@ -901,7 +901,7 @@ export default { status: '进行中', }, { - status: '已结案', + status: '已量产', } ], }; diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue index b2532c0..733c9de 100644 --- a/src/views/modules/eam/eamProjectPartInfo.vue +++ b/src/views/modules/eam/eamProjectPartInfo.vue @@ -80,12 +80,12 @@ - 查询 + 查询 @@ -134,19 +133,24 @@ layout="total, sizes, prev, pager, next, jumper"> - + + + + + + + + + - + - - - - - + + @@ -154,18 +158,17 @@ - - - - + - + - + - - + + @@ -174,18 +177,18 @@ - + - 文档清单定义 - 上传其他文档 + 文档清单定义 + 上传其他文档 - 选择生产确认文档 + 选择生产确认文档 @@ -263,12 +266,12 @@ -
+

文档清单

+ style="width: 100%;margin-top: -5px;" + :height="this.height + 95"> @@ -276,12 +279,12 @@
-
+

推送人员清单

+ style="width: 100%;margin-top: -5px;" + :height="this.height + 95"> @@ -298,8 +301,8 @@ fixed="left" label="操作"> @@ -536,13 +539,13 @@
- + - + @@ -552,23 +555,29 @@ + + + + + + - + - + 点击选择文件 - + + style="width: 100%;margin-top: 25px;margin-left: 0px;"> - + { this.getDataList(); }); + EventBus.$on('updateProjectPartDocumentInfo', () => { + this.getProofDocument() + }); }, @@ -2283,14 +2297,14 @@ import {EventBus} from "../../../main"; item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1] item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1] }) - console.log(this.totalPage) // 判断是否全部存在数据 if (this.totalPage > 0) { // 设置选中行 - this.$refs.mainTable.setCurrentRow(this.dataList[0]) + this.$refs.mainTable.setCurrentRow(this.dataList[this.dataListIndex]) // 加载当前的页签的table this.refreshCurrentTabTable() - this.proofingClickRow(this.dataList[0]) + this.proofingClickRow(this.dataList[this.dataListIndex]) + this.dataListIndex = 0 } } }) @@ -2314,10 +2328,11 @@ import {EventBus} from "../../../main"; // 判断是否全部存在数据 if (this.totalPage > 0) { // 设置选中行 - this.$refs.mainTable.setCurrentRow(this.dataList[0]) + this.$refs.mainTable.setCurrentRow(this.dataList[this.dataListIndex]) // 加载当前的页签的table this.refreshCurrentTabTable() - this.proofingClickRow(this.dataList[0]) + this.proofingClickRow(this.dataList[this.dataListIndex]) + this.dataListIndex = 0 } } }) @@ -2430,6 +2445,7 @@ import {EventBus} from "../../../main"; createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, } + this.getFinalPartDesc() this.formalPartNoFlag = true }, addProofRecord (row) { @@ -2532,6 +2548,11 @@ import {EventBus} from "../../../main"; } this.newProjectDocument(inData) EventBus.$emit('updateProjectInfo') + this.dataList.forEach((item) => { + if (item.projectPartId === row.projectPartId) { + this.dataListIndex = this.dataList.indexOf(item) + } + }) this.getDataList() this.$message({ message: '操作成功', @@ -2558,9 +2579,9 @@ import {EventBus} from "../../../main"; }); } if (row.status === '进行中') { - this.modalData.status = '已结案' + this.modalData.status = '已量产' this.modalData.closeDate = new Date() - this.$confirm(`是否确认结案?`, '提示', { + this.$confirm(`是否确认转量产?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -2617,34 +2638,107 @@ import {EventBus} from "../../../main"; projectDocumentSave(inData).then(({data}) => { //区分请求成功和失败的状况 if (data && data.code === 0) { - this.$message({ - message: '新增成功', - type: 'success' - }) this.documentListVisible = false //刷新表格 this.refreshCurrentTabTable() } }) }, - saveFormalPartNo (){ - saveFormalPartNo(this.modalData).then(({data}) => { - if (data && data.code === '0') { - this.getDataList() - this.formalPartNoFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { + + getFinalPartDesc(){ + return new Promise((resolve, reject) => { + let inData = { + site: this.modalData.site, + buNo: this.modalData.bu.split('_')[1], + finalPartNo: this.modalData.finalPartNo, + } + getFinalPartDesc(inData).then(({data}) => { + console.log(data) + if (data && data.code === 0) { + if (data.data !== null) { + this.modalData.finalPartDesc = data.data.finalPartDesc + this.finalPartFlag = false + } else { + this.modalData.finalPartDesc = '' + this.finalPartFlag = true + } + } else { + this.modalData.finalPartDesc = '' + } + resolve(); // 在操作成功时解析Promise + }).catch(error => { + this.modalData.finalPartDesc = ''; + reject(error); // 如果发生错误,拒绝Promise + }); + }); + }, + + async saveFormalPartNo() { + try { + await this.getFinalPartDesc(); + } catch (error) { + // 处理getFinalPartDesc方法中的错误 + console.error("Error in getFinalPartDesc:", error); + this.$message({ + message: '获取料号描述时发生错误,请重试', + type: 'error' + }); + } + if (this.modalData.finalPartNo === '' || this.modalData.finalPartNo === null || this.modalData.finalPartNo === undefined) { + this.$message({ + message: '请输入ERP正式料号', + type: 'warning' + }) + return + } + if (this.finalPartFlag) { + this.$confirm('ERP正式料号不存在,是否继续保存?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + saveFormalPartNo(this.modalData).then(({data}) => { + if (data && data.code === '0') { + this.getDataList() + this.formalPartNoFlag = false + 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 { + saveFormalPartNo(this.modalData).then(({data}) => { + if (data && data.code === '0') { + this.getDataList() + this.formalPartNoFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } }, closeClear () { this.modalData.bu = '' @@ -2690,7 +2784,8 @@ import {EventBus} from "../../../main"; uploadFile () { this.isEditable = false; this.fileList = [] - this.otherDocumentCurrentRow.proofingId= -1 + this.proofingCurrentRow.proofingId= -1 + this.proofingCurrentRow.proofingNo = '*' this.uploadDialog = true //打开组件 去做新增业务 // this.$nextTick(() => { @@ -3098,75 +3193,95 @@ import {EventBus} from "../../../main"; }) }, saveProductionValidationDocument() { - let confirmatorPromises = this.projectAllDocumentConfirmatorList.map(item => { - let inData = { - site: this.proofingCurrentRow.site, - projectId: this.proofingCurrentRow.projectId, - projectNo: this.proofingCurrentRow.projectNo, - orderRef1: this.proofingCurrentRow.projectId, - orderRef2: this.proofingCurrentRow.projectPartId, - userid: item.userid, - itemNo: this.projectAllDocumentConfirmatorList.indexOf(item) + 1, - wantedConfirmDate: new Date(this.modalData.wantedConfirmDate.getTime() + 8 * 60 * 60 * 1000), - createBy: this.$store.state.user.name - }; - return saveProductionValidationDocumentConfirmator(inData); - }); - - Promise.all(confirmatorPromises) - .then(confirmatorResults => { - let allConfirmatorSuccess = confirmatorResults.every(result => result.data && result.data.code === 0); - if (allConfirmatorSuccess) { + if (this.selectedDocumentItems.length === 0) { + this.$message({ + message: '请选择文档', + type: 'warning', + duration: 2000 + }) + return + }else { + this.$confirm('是否确认新增生产文档并向确认人员推送信息?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let confirmatorPromises = this.projectAllDocumentConfirmatorList.map(item => { let inData = { site: this.proofingCurrentRow.site, - orderRef1: this.proofingCurrentRow.projectId, - orderRef2: this.proofingCurrentRow.projectPartId, projectId: this.proofingCurrentRow.projectId, projectNo: this.proofingCurrentRow.projectNo, - projectPartId: this.proofingCurrentRow.projectPartId, - testPartNo: this.proofingCurrentRow.testPartNo, - selectedDocumentItems: this.selectedDocumentItems, - } - let saveDocumentPromises = this.handleDocumentSave(inData); - saveDocumentPromises - .then(confirmDelete => { - if (confirmDelete === 'false') { - this.confirmationPrompted = false; - this.$message({ - message: '已取消操作', - type: 'info' - }); - return; + orderRef1: this.proofingCurrentRow.projectId, + orderRef2: this.proofingCurrentRow.projectPartId, + userid: item.userid, + itemNo: this.projectAllDocumentConfirmatorList.indexOf(item) + 1, + wantedConfirmDate: new Date(this.modalData.wantedConfirmDate.getTime() + 8 * 60 * 60 * 1000), + createBy: this.$store.state.user.name + }; + return saveProductionValidationDocumentConfirmator(inData); + }); + + Promise.all(confirmatorPromises) + .then(confirmatorResults => { + let allConfirmatorSuccess = confirmatorResults.every(result => result.data && result.data.code === 0); + if (allConfirmatorSuccess) { + let inData = { + site: this.proofingCurrentRow.site, + orderRef1: this.proofingCurrentRow.projectId, + orderRef2: this.proofingCurrentRow.projectPartId, + projectId: this.proofingCurrentRow.projectId, + projectNo: this.proofingCurrentRow.projectNo, + projectPartId: this.proofingCurrentRow.projectPartId, + testPartNo: this.proofingCurrentRow.testPartNo, + selectedDocumentItems: this.selectedDocumentItems, } + let saveDocumentPromises = this.handleDocumentSave(inData); + saveDocumentPromises + .then(confirmDelete => { + if (confirmDelete === 'false') { + this.confirmationPrompted = false; + this.$message({ + message: '已取消操作', + type: 'info' + }); + return; + } + this.$message({ + message: '新增成功', + type: 'success' + }); + this.projectProductionValidationDocumentVisible = false; + this.confirmationPrompted = false; + this.confirmatorSendMailHandle(inData) + }) + .catch(error => { + console.error('保存文档出错:', error); + this.$message({ + message: '新增失败,请检查文档', + type: 'error' + }); + }); + } else { this.$message({ - message: '新增成功', - type: 'success' - }); - this.projectProductionValidationDocumentVisible = false; - this.confirmationPrompted = false; - this.confirmatorSendMailHandle(inData) - }) - .catch(error => { - console.error('保存文档出错:', error); - this.$message({ - message: '新增失败,请检查文档', - type: 'error' + message: '已取消操作', + type: 'info' }); + } + }) + .catch(error => { + console.error('保存确认人员出错:', error); + this.$message({ + message: '新增失败,请检查确认人员', + type: 'error' }); - } else { - this.$message({ - message: '新增失败,请检查确认人员', - type: 'error' }); - } - }) - .catch(error => { - console.error('保存确认人员出错:', error); + }).catch(() => { this.$message({ - message: '新增失败,请检查确认人员', - type: 'error' + type: 'info', + message: '已取消操作' }); }); + } }, handleDocumentSave(inData) {