diff --git a/src/api/quotation/quotationInformation.js b/src/api/quotation/quotationInformation.js index c709b8d..9f07981 100644 --- a/src/api/quotation/quotationInformation.js +++ b/src/api/quotation/quotationInformation.js @@ -42,3 +42,39 @@ export const quotationResultSearch = data => createAPI(`/plm/quotationInformatio * @returns {*} */ export const uploadFile = data => createAPI(`/plm/quotationInformation/uploadFile`,'post',data) +/** + * 文件删除 + * @param data + * @returns {*} + */ +export const deleteQuotationFile = data => createAPI(`/plm/quotationInformation/deleteQuotationFile`,'post',data) +/** + * 保存报价结果 + * @param data + * @returns {*} + */ +export const saveQuotationResult = data => createAPI(`/plm/quotationInformation/saveQuotationResult`,'post',data) +/** + * 文件下载 + * @param data + * @returns {*} + */ +export const downLoadQuotationFile = data => createAPI(`/plm/quotationInformation/downLoadQuotationFile?id=`+data.id,'post','download') +/** + * 保存提交结果 + * @param data + * @returns {*} + */ +export const saveSubmitResult = data => createAPI(`/plm/quotationInformation/saveSubmitResult`,'post',data) +/** + * 保存客户回复 + * @param data + * @returns {*} + */ +export const saveCustomerResponse = data => createAPI(`/plm/quotationInformation/saveCustomerResponse`,'post',data) +/** + * 获取产品列表 + * @param data + * @returns {*} + */ +export const getProjectPartList = data => createAPI(`/plm/quotationInformation/getProjectPartList`,'post',data) diff --git a/src/views/modules/quotation/quotation_upload_file.vue b/src/views/modules/quotation/quotation_upload_file.vue index f21093d..a4b17aa 100644 --- a/src/views/modules/quotation/quotation_upload_file.vue +++ b/src/views/modules/quotation/quotation_upload_file.vue @@ -98,9 +98,9 @@ export default { //片接文件 formData.append("file", this.fileList[0].raw); formData.append("folder", this.folder); - formData.append("site", this.pageData.site); - formData.append("objectID", this.pageData.quotationNo); - formData.append("remark", remark); + 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) diff --git a/src/views/modules/quotation/requestForQuote.vue b/src/views/modules/quotation/requestForQuote.vue index 50844e4..412f430 100644 --- a/src/views/modules/quotation/requestForQuote.vue +++ b/src/views/modules/quotation/requestForQuote.vue @@ -2,6 +2,7 @@
+ @@ -15,7 +16,7 @@ - + - + + + +
+ + + + + +
+ - - - - - 客户 @@ -167,9 +173,9 @@ - - 产品 - + + 产品 + @@ -213,8 +219,9 @@ 关闭 - - + + + @@ -231,7 +238,7 @@ @@ -257,14 +264,121 @@ width="100" label="操作"> - 保存 - 关闭 + 保存 + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + +
+ + + + + + + + + 查询 + + + + + + + + + +
+ + 确认 + 关闭
@@ -296,11 +410,11 @@ - + - 录入报价结果 - 提交客户报价 - 客户回复 + 录入报价结果 + 提交客户报价 + 客户回复 @@ -309,7 +423,7 @@ - + @@ -356,15 +470,15 @@ - + - + - + - - + + @@ -376,9 +490,9 @@ - + - + @@ -399,9 +513,15 @@ quotationInformationDelete, // 报价信息删除 getFileContentList, // 获取报价单附件列表 quotationResultSearch, // 获取报价结果对象 + deleteQuotationFile, // 文件删除 + downLoadQuotationFile, // 文件下载 + saveQuotationResult, // 保存报价结果 + saveSubmitResult, // 保存提交结果 + saveCustomerResponse, // 保存客户回复 + getProjectPartList, // 获取产品列表 } from '@/api/quotation/quotationInformation.js' import Chooselist from '@/views/modules/common/Chooselist' - import quotationUploadFile from "./quotation_upload_file"; + import quotationUploadFile from "./quotation_upload_file" export default { components: { Chooselist, @@ -439,6 +559,7 @@ pageIndex: 1, pageSize: 50, totalPage: 0, + selectedDataNum: 0, // 条件查询 searchData: { site: this.$store.state.user.site, @@ -446,7 +567,7 @@ customerDesc: '', trackerName: '', testPartNo: '', - testPartDesc: '', + partName: '', quotationStatus: '', startDate: '', endDate: '', @@ -477,7 +598,7 @@ quoterName: '', quotationStatus: '', testPartNo: '', - testPartDesc: '', + partName: '', priorityLevel: '', requiredCompletionDate: '', remark: '', @@ -513,19 +634,45 @@ confirmResults: '', actualityReplyDate: '', confirmBy: '', - confirmInformation: '' + confirmInformation: '', + quotationResultStatus: '', }, enterResultData: { site: this.$store.state.user.site, quotationNo: '', actualityQuotationDate: '', quotationResultInformation: '', - fileContentList: [], updateBy: this.$store.state.user.name, + quotationResultStatus: '' + }, + submitResultData: { + site: this.$store.state.user.site, + quotationNo: '', + actualitySubmissionDate: '', + submissionMethod: '', + submissionRemark: '', + updateBy: this.$store.state.user.name, + quotationResultStatus: '' + }, + customerResponseData: { + site: this.$store.state.user.site, + quotationNo: '', + actualityReplyDate: '', + confirmResults: '', + confirmBy: '', + confirmInformation: '', + updateBy: this.$store.state.user.name, + quotationResultStatus: '' + }, + projectPartData: { + site: this.$store.state.user.site, + testPartNo: '', + partName: '' }, // ======== 数据列表 ======== dataList: [], fileContentList: [], + projectPartList: [], // ======== 列表表头 ======== columnList: [ { @@ -816,26 +963,44 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 140 }, { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table2OrderRef3', + serialNumber: '102001Table2FileRemark', tableId: '102001Table2', tableName: '文件信息表', - columnProp: 'orderRef3', + columnProp: 'fileRemark', headerAlign: 'center', align: 'center', - columnLabel: '文件描述', + columnLabel: '备注', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 240 }, + // { + // userId: this.$store.state.user.name, + // functionId: 102001, + // serialNumber: '102001Table2OrderRef3', + // tableId: '102001Table2', + // tableName: '文件信息表', + // columnProp: 'orderRef3', + // headerAlign: 'center', + // align: 'center', + // columnLabel: '文件描述', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 120 + // }, { userId: this.$store.state.user.name, functionId: 102001, @@ -852,7 +1017,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 140 }, { userId: this.$store.state.user.name, @@ -870,25 +1035,117 @@ sortLv: 0, status: true, fixed: '', + columnWidth: 140 + } + ], + projectPartDetailList: [ + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3CustomerNo', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'customerNo', + headerAlign: 'center', + align: 'center', + columnLabel: '客户编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3CustomerDesc', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'customerDesc', + headerAlign: 'center', + align: 'center', + columnLabel: '客户名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', columnWidth: 120 }, { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table2FileRemark', - tableId: '102001Table2', - tableName: '文件信息表', - columnProp: 'fileRemark', + serialNumber: '102001Table3ProjectName', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'projectId', headerAlign: 'center', align: 'center', - columnLabel: '备注', + columnLabel: '项目编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3ProjectId', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'projectName', + headerAlign: 'center', + align: 'center', + columnLabel: '项目名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 180 + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3TestPartNo', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'testPartNo', + headerAlign: 'center', + align: 'center', + columnLabel: '产品编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3PartName', + tableId: '102001Table3', + tableName: '项目物料表', + columnProp: 'partName', + headerAlign: 'center', + align: 'center', + columnLabel: '产品名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 } ], // ======== 必填规则 ======== @@ -921,7 +1178,7 @@ trigger: 'change' } ], - testPartDesc: [ + partName: [ { required: true, message: ' ', @@ -959,14 +1216,57 @@ } ] }, + submitResultRules: { + actualitySubmissionDate: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + submissionMethod: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ] + }, + customerResponseRules: { + actualityReplyDate: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + confirmResults: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + confirmBy: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ] + }, // ======== 复选数据集 ======== quotationSelections: [], + projectPartListSelections: [], // ======== 选中的当前行数据 ======== quotationCurrentRow: {}, // ======== 模态框开关控制 ======== modalFlag: false, modalDisableFlag: false, - quotationResultModalFlag: false + enterResultModalFlag: false, + submitResultModalFlag: false, + customerResponseModalFlag: false, + projectPartModelFlag: false } }, mounted () { @@ -999,7 +1299,33 @@ this.getDataList() }, - // ======== 列表选择相关方法 ======== + // ======== 复选框操作相关方法 ======== + /** + * 选中一行 + * @param row + */ + projectPartClickRow (row) { + this.$refs.projectPartTable.toggleRowSelection(row); + }, + /** + * 多选 + * @param val + */ + selectionProjectPart (val) { + this.projectPartListSelections = val + }, + /** + * 获取唯一值,一般都为 id + * @param row + * @returns {*} + */ + getRowKeys (row) { + return row.testPartNo; + }, + /** + * 未知 + * @returns {boolean} + */ selectFlag () { return true; }, @@ -1021,10 +1347,10 @@ */ changeCurrentRow (row, oldRow) { // 判断是否是获取焦点的事件 - if(row){ - this.quotationCurrentRow = JSON.parse(JSON.stringify(row)); + if (row) { + this.quotationCurrentRow = JSON.parse(JSON.stringify(row)) //刷新当前页表 - this.refreshCurrentTabTable(); + this.refreshCurrentTabTable() } }, /** @@ -1071,16 +1397,16 @@ // 报价结果对象 quotationResultSearch(tempData).then(({data}) => { if (data && data.code === 0) { - this.quotationResultData = data.rows[0]; + this.quotationResultData = data.rows[0] } else { - this.quotationResultData = {}; + this.quotationResultData = {} } }) // 附件列表 this.getFileContentData() }, - // ======== 新增模态框 ======== + // ======== 新增/编辑模态框 ======== /** * 报价信息新增模态框 */ @@ -1100,7 +1426,7 @@ quoterName: '', quotationStatus: '草稿', testPartNo: '', - testPartDesc: '', + partName: '', priorityLevel: '', requiredCompletionDate: '', remark: '', @@ -1122,8 +1448,6 @@ this.modalDisableFlag = false this.modalFlag = true }, - - // ======== 编辑模态框 ======== /** * 报价信息编辑模态框 * @param row @@ -1144,7 +1468,7 @@ quoterName: row.quoterName, quotationStatus: row.quotationStatus, testPartNo: row.testPartNo, - testPartDesc: row.testPartDesc, + partName: row.partName, priorityLevel: row.priorityLevel, requiredCompletionDate: row.requiredCompletionDate, remark: row.remark, @@ -1167,45 +1491,51 @@ this.modalFlag = true }, - // ======== 删除方法 ======== + // ======== 新增/编辑/删除方法 ======== /** - * 报价信息删除 + * 获取产品列表 */ - delModal () { - if(this.quotationSelections.length === 0){ - this.$message.warning('请勾选要删除的报价信息!') - return - } - this.$confirm(`是否删除这 `+ this.quotationSelections.length +` 条报价信息?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let tempData = { - informationList: this.quotationSelections + getProjectPartList () { + // 先清空缓存选中 + this.$nextTick(() => this.$refs.projectPartTable.clearSelection()) + // 拿到选中的产品编号 + let projectPartList = this.modalData.testPartNo.split(';') + // 查询所有产品 + getProjectPartList(this.projectPartData).then(({data}) => { + if (data && data.code === 0) { + this.projectPartList = data.rows + this.projectPartList.forEach (val => { + // 回显选中的产品 + if (projectPartList.includes(val.testPartNo)) { + this.$nextTick(() => this.$refs.projectPartTable.toggleRowSelection(val, true)) + } + }) + this.projectPartModelFlag = true + }else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } - quotationInformationDelete(tempData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.quotationSelections = [] - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }).catch(() => { }) }, - - // ======== 新增/编辑方法 ======== + /** + * 确认多选产品 + */ + confirmProjectPart(){ + if(this.projectPartListSelections.length === 0){ + this.$message.warning('请勾选产品!') + return + } + this.modalData.testPartNo = '' + this.modalData.partName = '' + for (let i = 0; i < this.projectPartListSelections.length; i++) { + this.modalData.testPartNo = this.modalData.testPartNo + ";" + this.projectPartListSelections[i].testPartNo + this.modalData.partName = this.modalData.partName + ";" + this.projectPartListSelections[i].partName + } + this.modalData.testPartNo = this.modalData.testPartNo.substring(1) + this.modalData.partName = this.modalData.partName.substring(1) + this.projectPartModelFlag = false + }, /** * 客户信息新增/编辑 */ @@ -1246,7 +1576,7 @@ this.$message.warning('请选择产品编码!') return } - if (this.modalData.testPartDesc === '' || this.modalData.testPartDesc == null) { + if (this.modalData.partName === '' || this.modalData.partName == null) { this.$message.warning('请选择产品名称!') return } @@ -1258,7 +1588,7 @@ this.$message.warning('请输入要求完成日期!') return } - if(this.modalData.flag === '1'){ + if (this.modalData.flag === '1') { quotationInformationSave(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -1267,8 +1597,7 @@ message: '操作成功', type: 'success', duration: 1500, - onClose: () => { - } + onClose: () => {} }) } else { this.$alert(data.msg, '错误', { @@ -1276,11 +1605,45 @@ }) } }) - }else { + } else { quotationInformationEdit(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList() this.modalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } + }, + /** + * 报价信息删除 + */ + delModal () { + if(this.quotationSelections.length === 0){ + this.$message.warning('请勾选要删除的报价信息!') + return + } + this.$confirm(`是否删除这 `+ this.quotationSelections.length +` 条报价信息?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + informationList: this.quotationSelections + } + quotationInformationDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.quotationSelections = [] this.$message({ message: '操作成功', type: 'success', @@ -1294,20 +1657,19 @@ }) } }) - } + }).catch(() => { + }) }, - // ======== 列表单机选中方法 ======== + // ======== 列表操作方法 ======== /** * 单机选中客户信息 * @param row */ quotationClickRow (row) { - this.quotationCurrentRow = JSON.parse(JSON.stringify(row)); - this.quotationDetailData = row; + this.quotationCurrentRow = JSON.parse(JSON.stringify(row)) + this.quotationDetailData = row }, - - // ======== 列表复选方法 ======== /** * 复选客户信息 * @param val @@ -1323,25 +1685,143 @@ quotationResultModal () { this.enterResultData = { site: this.$store.state.user.site, - quotationNo: this.quotationCurrentRow.quotationNo, + // quotationNo: this.quotationCurrentRow.quotationNo, + quotationNo: '', actualityQuotationDate: '', quotationResultInformation: '', - fileContentList: [], - updateBy: this.$store.state.user.name, + quotationResultStatus: 'E', + updateBy: this.$store.state.user.name + } + this.quotationSelections.forEach(val => { + this.enterResultData.quotationNo += val.quotationNo + ';' + }) + this.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1) + console.log() + this.enterResultModalFlag = true + }, + /** + * 保存报价结果 + */ + saveQuotationResult () { + if (this.enterResultData.actualityQuotationDate === '' || this.enterResultData.actualityQuotationDate == null) { + this.$message.warning('请选择实际报价日期!') + return + } + if (this.enterResultData.quotationResultInformation === '' || this.enterResultData.quotationResultInformation == null) { + this.$message.warning('请填写报价结果信息!') + return } - this.quotationResultModalFlag = true + saveQuotationResult(this.enterResultData).then(({data}) => { + if (data && data.code === 0) { + this.getQuotationResult() + this.enterResultModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }, /** * 提交客户报价 */ submitQuotationModal () { - + this.submitResultData = { + site: this.$store.state.user.site, + quotationNo: this.quotationCurrentRow.quotationNo, + actualityQuotationDate: '', + quotationResultInformation: '', + quotationResultStatus: 'S', + updateBy: this.$store.state.user.name + } + this.submitResultModalFlag = true + }, + /** + * 保存提交结果 + */ + saveSubmitResult () { + if (this.submitResultData.actualitySubmissionDate === '' || this.submitResultData.actualitySubmissionDate == null) { + this.$message.warning('请选择实际提交客户日期!') + return + } + if (this.submitResultData.submissionMethod === '' || this.submitResultData.submissionMethod == null) { + 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: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }, /** * 客户回复 */ customerResponseModal () { - + this.customerResponseData = { + site: this.$store.state.user.site, + quotationNo: this.quotationCurrentRow.quotationNo, + actualityReplyDate: '', + confirmResults: '', + confirmBy: '', + confirmInformation: '', + quotationResultStatus: 'R', + updateBy: this.$store.state.user.name + } + this.customerResponseModalFlag = true + }, + /** + * 保存客户回复 + */ + saveCustomerResponse () { + if (this.customerResponseData.actualityReplyDate === '' || this.customerResponseData.actualityReplyDate == null) { + this.$message.warning('请选择实际回复日期!') + return + } + if (this.customerResponseData.confirmResults === '' || this.customerResponseData.confirmResults == null) { + this.$message.warning('请选择客户确认结果!') + return + } + if (this.customerResponseData.confirmBy === '' || this.customerResponseData.confirmBy == null) { + 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: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }, // ======== 报价单附件的相关方法 ======== @@ -1378,6 +1858,55 @@ this.$refs.quotationUploadFile.init(currentData); }) }, + /** + * 文件删除 + * @param row + */ + deleteFile (row) { + this.$confirm('确定要删除此文件?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteQuotationFile(row).then(({data}) => { + if (data && data.code === 0) { + this.getFileContentData(); + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + /** + * 文件下载 + * @param row + */ + downloadFile (row) { + downLoadQuotationFile(row).then(({data}) => { + // 不限制文件下载类型 + const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) + // 下载文件名称 + const fileName = row.fileName + // a标签下载 + const linkNode = document.createElement('a') + linkNode.download = fileName // a标签的download属性规定下载文件的名称 + linkNode.style.display = 'none' + linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL + document.body.appendChild(linkNode) + linkNode.click() // 模拟在按钮上的一次鼠标单击 + URL.revokeObjectURL(linkNode.href) // 释放URL 对象 + document.body.removeChild(linkNode) + }) + }, // ======== chooseList相关方法 ======== /** @@ -1408,11 +1937,6 @@ strVal = this.modalData.projectId } } - if (val === 105) { - if(type === 1) { - strVal = this.modalData.testPartNo - } - } this.$refs.baseList.init(val, strVal) }) }, @@ -1443,12 +1967,6 @@ this.modalData.projectName = val.project_name } } - if (this.tagNo === 105) { - if(this.tagNo1 === 1) { - this.modalData.testPartNo = val.test_part_no - this.modalData.testPartDesc = val.part_desc - } - } }, // ======== 导出相关方法 ========