From 45a679c82c005d2ae9d4671e5b135b11674f8f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=89=E6=BA=90?= <1976974459@qq.com> Date: Thu, 28 Sep 2023 17:30:36 +0800 Subject: [PATCH] =?UTF-8?q?2023-09-28=20plm=E6=8A=A5=E4=BB=B7=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quotation/quotationInformation.js | 6 + .../quotation/quotation_upload_file.vue | 48 ++++-- .../modules/quotation/requestForQuote.vue | 154 ++++++++++++++++-- 3 files changed, 173 insertions(+), 35 deletions(-) diff --git a/src/api/quotation/quotationInformation.js b/src/api/quotation/quotationInformation.js index 9f07981..d8797a3 100644 --- a/src/api/quotation/quotationInformation.js +++ b/src/api/quotation/quotationInformation.js @@ -78,3 +78,9 @@ export const saveCustomerResponse = data => createAPI(`/plm/quotationInformation * @returns {*} */ export const getProjectPartList = data => createAPI(`/plm/quotationInformation/getProjectPartList`,'post',data) +/** + * 检查报价进度 + * @param data + * @returns {*} + */ +export const checkQuotationStatus = data => createAPI(`/plm/quotationInformation/checkQuotationStatus`,'post',data) diff --git a/src/views/modules/quotation/quotation_upload_file.vue b/src/views/modules/quotation/quotation_upload_file.vue index a4b17aa..8402928 100644 --- a/src/views/modules/quotation/quotation_upload_file.vue +++ b/src/views/modules/quotation/quotation_upload_file.vue @@ -5,7 +5,14 @@ - + + + + @@ -56,7 +63,9 @@ export default { quotationNo: '', fileRemark: '', folder: '', + options: [] }, + options: [], dataListLoading: false, } }, @@ -65,6 +74,7 @@ export default { init(currentRow) { // 初始化参数 this.pageData = JSON.parse(JSON.stringify(currentRow)) + this.options = this.pageData.options this.folder = this.pageData.folder // 打开页面 this.visible = true @@ -73,38 +83,42 @@ export default { beforeUploadHandle(file) {}, /*选择上传文件时*/ onChange(file){ - this.fileList.push(file); + this.fileList.push(file) }, /*关闭modal*/ closeDialog(){ - this.fileList = []; + this.fileList = [] // 刷新报工的页面 - this.$emit('refreshPageTables'); + this.$emit('refreshPageTables') //关闭当前的页面 - this.visible = false; + this.visible = false }, /*保修当前的数据*/ saveUploadFile(){ - let remark = this.pageData.fileRemark; - if(null == remark || remark == undefined){ + let remark = this.pageData.fileRemark + if(remark == null || remark == undefined){ remark = '' } /*判断文件是否上传*/ - if(null == this.fileList || 0 === this.fileList.length){ - this.$message.error("请先上传文件!"); - return false; + if(this.fileList == null || this.fileList.length === 0){ + this.$message.error("请先上传文件!") + return false } - const formData = new FormData(); + if(this.pageData.quotationNo === '' || this.pageData.quotationNo == null){ + this.$message.error("请选择申请单号!") + return false + } + const formData = new FormData() //片接文件 - formData.append("file", this.fileList[0].raw); - formData.append("folder", this.folder); - formData.append("orderRef1", this.pageData.site); - formData.append("orderRef2", this.pageData.quotationNo); - formData.append("fileRemark", remark); + formData.append("file", this.fileList[0].raw) + formData.append("folder", this.folder) + formData.append("orderRef1", this.pageData.site) + formData.append("orderRef2", this.pageData.quotationNo) + formData.append("fileRemark", remark) uploadFile(formData).then(({data}) => { if (data.code === 0) { this.$message.success(data.msg) - //清空文件上传记录 + // 清空文件上传记录 this.$refs.uploadFile.clearFiles() this.pageData.fileRemark = '' this.fileList = [] diff --git a/src/views/modules/quotation/requestForQuote.vue b/src/views/modules/quotation/requestForQuote.vue index 22cac8b..0ca07ca 100644 --- a/src/views/modules/quotation/requestForQuote.vue +++ b/src/views/modules/quotation/requestForQuote.vue @@ -231,7 +231,7 @@ @@ -405,7 +405,7 @@ - 录入报价结果 + 录入报价结果 提交客户报价 客户回复 @@ -513,6 +513,7 @@ saveSubmitResult, // 保存提交结果 saveCustomerResponse, // 保存客户回复 getProjectPartList, // 获取产品列表 + checkQuotationStatus // 检查报价进度 } from '@/api/quotation/quotationInformation.js' import Chooselist from '@/views/modules/common/Chooselist' import quotationUploadFile from "./quotation_upload_file" @@ -637,7 +638,8 @@ actualityQuotationDate: '', quotationResultInformation: '', updateBy: this.$store.state.user.name, - quotationResultStatus: '' + quotationResultStatus: '', + fileContentList: [] }, submitResultData: { site: this.$store.state.user.site, @@ -1662,7 +1664,7 @@ * @param row */ quotationClickRow (row) { - this.$refs.quotationTable.toggleRowSelection(row); + // this.$refs.quotationTable.toggleRowSelection(row) this.quotationCurrentRow = JSON.parse(JSON.stringify(row)) this.quotationDetailData = row }, @@ -1677,24 +1679,72 @@ // ======== 报价结果相关方法 ======== /** - * 录入报价结果 + * 封装录入方法 */ - quotationResultModal () { + packQuotationResultModal () { + // 重置对象 this.enterResultData = { site: this.$store.state.user.site, - // quotationNo: this.quotationCurrentRow.quotationNo, quotationNo: '', actualityQuotationDate: '', quotationResultInformation: '', quotationResultStatus: 'E', + fileContentList: [], updateBy: this.$store.state.user.name } - this.quotationSelections.forEach(val => { - this.enterResultData.quotationNo += ';' + val.quotationNo + // 获得选中的报价号 + if (this.quotationSelections.length > 0) { + this.quotationSelections.forEach(val => { + this.enterResultData.quotationNo += ';' + val.quotationNo + }) + this.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1) + } else { + 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.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1) this.enterResultModalFlag = true }, + /** + * 录入报价结果 + */ + quotationResultModal () { + // 如果有选中报价单 + if (this.quotationSelections != null && this.quotationSelections.length > 0) { + let tempData = { + currentStatus: 'C', + informationList: this.quotationSelections, + } + // 检查报价单状态 + checkQuotationStatus(tempData).then(({data}) => { + 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.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } else { // 没有选中报价单,则根据当前点击行报价单操作 + this.packQuotationResultModal() + } + }, /** * 保存报价结果 */ @@ -1752,10 +1802,11 @@ }) } }, + /** - * 提交客户报价 + * 封装提交方法 */ - submitQuotationModal () { + packSubmitQuotationModal () { this.submitResultData = { site: this.$store.state.user.site, quotationNo: this.quotationCurrentRow.quotationNo, @@ -1766,6 +1817,36 @@ } this.submitResultModalFlag = true }, + /** + * 提交客户报价 + */ + submitQuotationModal () { + // 如果有选中报价单 + if (this.quotationSelections != null && this.quotationSelections.length > 0) { + let tempData = { + currentStatus: 'E', + informationList: this.quotationSelections, + } + // 检查报价单状态 + checkQuotationStatus(tempData).then(({data}) => { + 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.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } else { // 没有选中报价单,则根据当前点击行报价单操作 + this.packSubmitQuotationModal() + } + }, /** * 保存提交结果 */ @@ -1796,10 +1877,11 @@ } }) }, + /** - * 客户回复 + * 封装回复方法 */ - customerResponseModal () { + packCustomerResponseModal () { this.customerResponseData = { site: this.$store.state.user.site, quotationNo: this.quotationCurrentRow.quotationNo, @@ -1812,6 +1894,36 @@ } this.customerResponseModalFlag = true }, + /** + * 客户回复 + */ + customerResponseModal () { + // 如果有选中报价单 + if (this.quotationSelections != null && this.quotationSelections.length > 0) { + let tempData = { + currentStatus: 'S', + informationList: this.quotationSelections, + } + // 检查报价单状态 + checkQuotationStatus(tempData).then(({data}) => { + 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.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } else { // 没有选中报价单,则根据当前点击行报价单操作 + this.packCustomerResponseModal() + } + }, /** * 保存客户回复 */ @@ -1858,9 +1970,9 @@ } getFileContentList(currentData).then(({data}) => { if (data && data.code === 0) { - this.fileContentList = data.rows; + this.fileContentList = data.rows } else { - this.fileContentList = []; + this.fileContentList = [] } }) }, @@ -1872,10 +1984,16 @@ titleCon: '报价附件上传', site: this.$store.state.user.site, createBy: this.$store.state.user.name, - quotationNo: this.enterResultData.quotationNo, + quotationNo: '', fileRemark: '', folder: 'quotationFile', - }; + options: [] + } + let num = 0 + let arr = this.enterResultData.quotationNo.split(';') + arr.forEach(val => { + currentData.options.push({key: num++, value: val}) + }) //打开组件 去做新增业务 this.$nextTick(() => { this.$refs.quotationUploadFile.init(currentData);