diff --git a/src/api/quotation/quotationInformation.js b/src/api/quotation/quotationInformation.js index d8797a3..61d7360 100644 --- a/src/api/quotation/quotationInformation.js +++ b/src/api/quotation/quotationInformation.js @@ -84,3 +84,9 @@ export const getProjectPartList = data => createAPI(`/plm/quotationInformation/g * @returns {*} */ export const checkQuotationStatus = data => createAPI(`/plm/quotationInformation/checkQuotationStatus`,'post',data) +/** + * 获取项目信息 + * @param data + * @returns {*} + */ +export const getProjectInformation = data => createAPI(`/plm/quotationInformation/getProjectInformation`,'post',data) diff --git a/src/views/modules/quotation/requestForQuote.vue b/src/views/modules/quotation/requestForQuote.vue index 0ca07ca..6260ed8 100644 --- a/src/views/modules/quotation/requestForQuote.vue +++ b/src/views/modules/quotation/requestForQuote.vue @@ -376,9 +376,9 @@ - + - + - + 录入报价结果 提交客户报价 @@ -489,13 +489,135 @@ + + + + + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+
+ + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+
+ + +
+ + + +
+
+
+ + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+
+ + +
+ + + +
+
+
+ + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+
+
+
- + @@ -513,7 +635,8 @@ saveSubmitResult, // 保存提交结果 saveCustomerResponse, // 保存客户回复 getProjectPartList, // 获取产品列表 - checkQuotationStatus // 检查报价进度 + checkQuotationStatus, // 检查报价进度 + getProjectInformation // 获取项目信息 } from '@/api/quotation/quotationInformation.js' import Chooselist from '@/views/modules/common/Chooselist' import quotationUploadFile from "./quotation_upload_file" @@ -610,6 +733,7 @@ confirmResults: '', confirmBy: '', confirmInformation: '', + quotationResultStatus: '', createDate: '', createBy: '', updateDate: '', @@ -665,6 +789,19 @@ testPartNo: '', partName: '' }, + projectInformationData: { + projectId: '', + projectName: '', + projectType: '', + projectSourceDesc: '', + priorityDesc: '', + status: '', + projectDesc: '', + projectManagerName: '', + projectOwnerName: '', + userRoleName: '', + remark: '' + }, // ======== 数据列表 ======== dataList: [], fileContentList: [], @@ -1355,6 +1492,8 @@ refreshCurrentTabTable () { if (this.activeTable === 'quotation_result') { this.getQuotationResult() + } else if (this.activeTable === 'project_information') { + this.getProjectInformation() } }, @@ -1402,6 +1541,23 @@ // 附件列表 this.getFileContentData() }, + /** + * 获取项目信息 + */ + getProjectInformation () { + let tempData = { + site: this.$store.state.user.site, + projectId: this.quotationCurrentRow.projectId + } + // 报价结果对象 + getProjectInformation(tempData).then(({data}) => { + if (data && data.code === 0) { + this.projectInformationData = data.rows[0] + } else { + this.projectInformationData = {} + } + }) + }, // ======== 新增/编辑模态框 ======== /** @@ -1440,6 +1596,7 @@ confirmResults: '', confirmBy: '', confirmInformation: '', + quotationResultStatus: 'C', createBy: this.$store.state.user.name } this.modalDisableFlag = false @@ -1482,6 +1639,7 @@ confirmResults: row.confirmResults, confirmBy: row.confirmBy, confirmInformation: row.confirmInformation, + quotationResultStatus: row.quotationResultStatus, updateBy: this.$store.state.user.name } this.modalDisableFlag = true @@ -1518,7 +1676,7 @@ /** * 确认多选产品 */ - confirmProjectPart(){ + confirmProjectPart () { if(this.projectPartListSelections.length === 0){ this.$message.warning('请勾选产品!') return @@ -1702,17 +1860,7 @@ this.enterResultData.quotationNo = this.quotationCurrentRow.quotationNo } // 获得这些报价号的全部附件 - let currentData = { - orderRef1: this.$store.state.user.site, - orderRef2: this.enterResultData.quotationNo - } - getFileContentList(currentData).then(({data}) => { - if (data && data.code === 0) { - this.enterResultData.fileContentList = data.rows - } else { - this.enterResultData.fileContentList = [] - } - }) + this.getFileContentList() this.enterResultModalFlag = true }, /** @@ -1730,10 +1878,8 @@ if (data && data.code === 0) { if (data.flag === 1) { // 状态一致 this.packQuotationResultModal() - } else if (data.flag === 2) { // 状态不同 - this.$message.warning('进度有误,请再次点击选中行!') - } else { - this.$message.warning('请选择进度一致的报价单进行操作!') + } else { // 状态不同 + this.$message.warning('选中的报价单进度有误,请确认!') } } else { this.$alert(data.msg, '错误', { @@ -1765,7 +1911,7 @@ }).then(() => { saveQuotationResult(this.enterResultData).then(({data}) => { if (data && data.code === 0) { - this.getQuotationResult() + this.getDataList() this.enterResultModalFlag = false this.$message({ message: '操作成功', @@ -1785,7 +1931,7 @@ } else { saveQuotationResult(this.enterResultData).then(({data}) => { if (data && data.code === 0) { - this.getQuotationResult() + this.getDataList() this.enterResultModalFlag = false this.$message({ message: '操作成功', @@ -1809,12 +1955,21 @@ packSubmitQuotationModal () { this.submitResultData = { site: this.$store.state.user.site, - quotationNo: this.quotationCurrentRow.quotationNo, + quotationNo: '', actualityQuotationDate: '', quotationResultInformation: '', quotationResultStatus: 'S', updateBy: this.$store.state.user.name } + // 获得选中的报价号 + if (this.quotationSelections.length > 0) { + this.quotationSelections.forEach(val => { + this.submitResultData.quotationNo += ';' + val.quotationNo + }) + this.submitResultData.quotationNo = this.submitResultData.quotationNo.substring(1) + } else { + this.submitResultData.quotationNo = this.quotationCurrentRow.quotationNo + } this.submitResultModalFlag = true }, /** @@ -1832,10 +1987,8 @@ if (data && data.code === 0) { if (data.flag === 1) { // 状态一致 this.packSubmitQuotationModal() - } else if (data.flag === 2) { // 状态不同 - this.$message.warning('进度有误,请再次点击选中行!') - } else { - this.$message.warning('请选择进度一致的报价单进行操作!') + } else { // 状态不同 + this.$message.warning('选中的报价单进度有误,请确认!') } } else { this.$alert(data.msg, '错误', { @@ -1859,23 +2012,50 @@ this.$message.warning('请选择提交方式!') return } - saveSubmitResult(this.submitResultData).then(({data}) => { - if (data && data.code === 0) { - this.getQuotationResult() - this.submitResultModalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { + if (this.quotationSelections.length > 1) { + this.$confirm(`是否提交多条客户报价?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + saveSubmitResult(this.submitResultData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.submitResultModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) + }).catch(() => { + }) + } else { + saveSubmitResult(this.submitResultData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.submitResultModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } }, /** @@ -1884,7 +2064,7 @@ packCustomerResponseModal () { this.customerResponseData = { site: this.$store.state.user.site, - quotationNo: this.quotationCurrentRow.quotationNo, + quotationNo: '', actualityReplyDate: '', confirmResults: '', confirmBy: '', @@ -1892,6 +2072,15 @@ quotationResultStatus: 'R', updateBy: this.$store.state.user.name } + // 获得选中的报价号 + if (this.quotationSelections.length > 0) { + this.quotationSelections.forEach(val => { + this.customerResponseData.quotationNo += ';' + val.quotationNo + }) + this.customerResponseData.quotationNo = this.customerResponseData.quotationNo.substring(1) + } else { + this.customerResponseData.quotationNo = this.quotationCurrentRow.quotationNo + } this.customerResponseModalFlag = true }, /** @@ -1909,10 +2098,8 @@ if (data && data.code === 0) { if (data.flag === 1) { // 状态一致 this.packCustomerResponseModal() - } else if (data.flag === 2) { // 状态不同 - this.$message.warning('进度有误,请再次点击选中行!') - } else { - this.$message.warning('请选择进度一致的报价单进行操作!') + } else { // 状态不同 + this.$message.warning('选中的报价单进度有误,请确认!') } } else { this.$alert(data.msg, '错误', { @@ -1940,23 +2127,50 @@ this.$message.warning('请填写客户确认人!') return } - saveCustomerResponse(this.customerResponseData).then(({data}) => { - if (data && data.code === 0) { - this.getQuotationResult() - this.customerResponseModalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { + if (this.quotationSelections.length > 1) { + this.$confirm(`是否提交多条客户回复?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + saveCustomerResponse(this.customerResponseData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.customerResponseModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) + }).catch(() => { + }) + } else { + saveCustomerResponse(this.customerResponseData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.customerResponseModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } }, // ======== 报价单附件的相关方法 ======== @@ -1976,6 +2190,22 @@ } }) }, + /** + * 获得这些报价号的全部附件 + */ + getFileContentList () { + let currentData = { + orderRef1: this.$store.state.user.site, + orderRef2: this.enterResultData.quotationNo + } + getFileContentList(currentData).then(({data}) => { + if (data && data.code === 0) { + this.enterResultData.fileContentList = data.rows + } else { + this.enterResultData.fileContentList = [] + } + }) + }, /** * 上传文件 */ @@ -2011,7 +2241,7 @@ }).then(() => { deleteQuotationFile(row).then(({data}) => { if (data && data.code === 0) { - this.getFileContentData(); + this.getFileContentList(); this.$message({ message: '操作成功', type: 'success',