From b810781c72be3cf2edbd983fa40249ea67e823ee Mon Sep 17 00:00:00 2001 From: zelian_wu <15576055375@163.com> Date: Mon, 25 Dec 2023 09:03:35 +0800 Subject: [PATCH] =?UTF-8?q?2023-12-25=20plm=E6=8A=A5=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quotation/quotationInformation.js | 6 + .../modules/quotation/requestForQuote.vue | 645 +++++++++++------- .../modules/quotation/sellForQuotation.vue | 5 +- .../sellForQuotation/quotationDetail.vue | 181 +++-- src/views/modules/quotation/toBeQuoted.vue | 2 +- 5 files changed, 536 insertions(+), 303 deletions(-) diff --git a/src/api/quotation/quotationInformation.js b/src/api/quotation/quotationInformation.js index 2d021aa..66ce527 100644 --- a/src/api/quotation/quotationInformation.js +++ b/src/api/quotation/quotationInformation.js @@ -79,6 +79,12 @@ export const saveCustomerResponse = data => createAPI(`/plm/quotationInformation * @returns {*} */ export const getProjectPartList = data => createAPI(`/plm/quotationInformation/getProjectPartList`,'post',data) +/** + * 获取项目列表 + * @param data + * @returns {*} + */ +export const searchProjectInfoList = data => createAPI(`/project/searchProjectInfoList`,'get',data) /** * 检查报价进度 * @param data diff --git a/src/views/modules/quotation/requestForQuote.vue b/src/views/modules/quotation/requestForQuote.vue index 5e3bb65..2fe7e86 100644 --- a/src/views/modules/quotation/requestForQuote.vue +++ b/src/views/modules/quotation/requestForQuote.vue @@ -144,73 +144,178 @@ - - - - 客户 - - - - 跟单员 - - - - - - 项目 - - - - 询价专员 - - - - - + + + + + + 客户编码 + + + + + + + + + + + + + + + + + + + + + + + 跟单员 + + + + + + + + 项目编码 + + + + + + + + + + + + + + + + + + + + + + + + + + + 询价专员 + + + + + + + + + + + + + + + + + + + + 项目物料 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + 查询 + + + + + + + + {{scope.row[item.columnProp]}} + + + + + - + 保存 关闭 + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + @@ -320,59 +425,7 @@ - - - - - - - - - - - - 查询 - - - - - - - - {{scope.row[item.columnProp]}} - - - - - - - 确认 - 关闭 - - + @@ -794,7 +847,8 @@ getProjectPartList, // 获取产品列表 checkQuotationStatus, // 检查询价进度 getProjectInformation, // 获取项目信息 - getCustomerInformation // 获取客户信息 + getCustomerInformation, // 获取客户信息 + searchProjectInfoList,// 查询项目信息 } from '@/api/quotation/quotationInformation.js' import Chooselist from '@/views/modules/common/Chooselist' import quotationUploadFile from "./quotation_upload_file" @@ -856,6 +910,17 @@ }, // 其它 dataListLoading: false, + // 选择项目弹框开关 + chooseProjectListFlag: false, + //项目搜索条件 + searchProjectData:{ + site:this.$store.state.user.site, + projectId:undefined, + projectName:undefined, + customerId:undefined, + }, + // 项目集合 + projectList:[], // 初始页签 activeTable: 'quotation_detail_information', // ======== 数据对象 ======== @@ -875,7 +940,7 @@ quotationStatus: '', testPartNo: '', partName: '', - priorityLevel: '', + priorityLevel: '一般', requiredCompletionDate: '', remark: '', technicalConsiderations: '', @@ -945,7 +1010,8 @@ projectPartData: { site: this.$store.state.user.site, testPartNo: '', - partName: '' + partName: '', + projectId:'', }, projectInformationData: { projectId: '', @@ -1058,7 +1124,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100 + columnWidth: 120 }, { userId: this.$store.state.user.name, @@ -1130,7 +1196,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100 + columnWidth: 160 }, { userId: this.$store.state.user.name, @@ -1427,49 +1493,48 @@ { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3ProjectId', + serialNumber: '102001Table3TestPartNo', tableId: '102001Table3', tableName: '项目物料表', - columnProp: 'projectName', + columnProp: 'testPartNo', headerAlign: 'center', align: 'center', - columnLabel: '项目名称', + columnLabel: '产品编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 150 }, { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3TestPartNo', + serialNumber: '102001Table3PartDesc', tableId: '102001Table3', tableName: '项目物料表', - columnProp: 'testPartNo', + columnProp: 'partDesc', headerAlign: 'center', align: 'center', - columnLabel: '产品编码', + columnLabel: '产品名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 150 - }, - { + columnWidth: 120 + },{ userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3PartName', + serialNumber: '102001Table3PartType', tableId: '102001Table3', tableName: '项目物料表', - columnProp: 'partName', + columnProp: 'partType', headerAlign: 'center', align: 'center', - columnLabel: '产品名称', + columnLabel: '产品类型', columnHidden: false, columnImage: false, columnSortable: false, @@ -1481,54 +1546,40 @@ ], // ======== 必填规则 ======== rules: { + customerNo: [ + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, + ], customerDesc: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ], trackerName: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, + ], + projectId: [ + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ], projectName: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ], quoterName: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ], partName: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ], priorityLevel: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, ], requiredCompletionDate: [ - { - required: true, - message: ' ', - trigger: 'change' - } + {required: true,message: ' ',trigger: 'change'}, + {required: true,message: ' ',trigger: 'blur'}, ] }, enterResultRules: { @@ -1636,7 +1687,10 @@ * @param row */ projectPartClickRow (row) { - this.$refs.projectPartTable.toggleRowSelection(row); + if (this.modalData.flag === '1'){ + this.$refs.projectPartTable.toggleRowSelection(row); + this.confirmProjectPart(); + } }, /** * 多选 @@ -1797,7 +1851,7 @@ quotationStatus: '草稿', testPartNo: '', partName: '', - priorityLevel: '', + priorityLevel: '一般', requiredCompletionDate: '', remark: '', technicalConsiderations: '', @@ -1868,10 +1922,16 @@ * 获取产品列表 */ getProjectPartList () { + if (!this.modalData.projectId){ + this.$message.warning("请选择项目编码!") + return + } // 先清空缓存选中 this.$nextTick(() => this.$refs.projectPartTable.clearSelection()) // 拿到选中的产品编号 let projectPartList = this.modalData.testPartNo.split(';') + // 获得查询 + this.projectPartData.projectId = this.modalData.projectId; // 查询所有产品 getProjectPartList(this.projectPartData).then(({data}) => { if (data && data.code === 0) { @@ -1882,7 +1942,6 @@ this.$nextTick(() => this.$refs.projectPartTable.toggleRowSelection(val, true)) } }) - this.projectPartModelFlag = true }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -1895,7 +1954,11 @@ */ confirmProjectPart () { if(this.projectPartListSelections.length === 0){ - this.$message.warning('请勾选产品!') + // 先清空缓存选中 + this.$nextTick(() => this.$refs.projectPartTable.clearSelection()) + // 拿到选中的产品编号 + this.modalData.testPartNo = '' + this.modalData.partName = '' return } this.modalData.testPartNo = '' @@ -1906,95 +1969,103 @@ } this.modalData.testPartNo = this.modalData.testPartNo.substring(1) this.modalData.partName = this.modalData.partName.substring(1) - this.projectPartModelFlag = false }, /** * 客户信息新增/编辑 */ saveData () { - if (this.modalData.customerNo === '' || this.modalData.customerNo == null) { - this.$message.warning('请选择客户编码!') - return - } - if (this.modalData.customerDesc === '' || this.modalData.customerDesc == null) { - this.$message.warning('请选择客户名称!') - return - } - if (this.modalData.tracker === '' || this.modalData.tracker == null) { - this.$message.warning('请选择跟单员编码!') - return - } - if (this.modalData.trackerName === '' || this.modalData.trackerName == null) { - this.$message.warning('请选择跟单员名称!') - return - } - if (this.modalData.projectId === '' || this.modalData.projectId == null) { - this.$message.warning('请选择项目编码!') - return - } - if (this.modalData.projectName === '' || this.modalData.projectName == null) { - this.$message.warning('请选择项目名称!') - return - } - if (this.modalData.quoter === '' || this.modalData.quoter == null) { - this.$message.warning('请选择询价专员编码!') - return - } - if (this.modalData.quoterName === '' || this.modalData.quoterName == null) { - this.$message.warning('请选择询价专员名称!') - return - } - if (this.modalData.testPartNo === '' || this.modalData.testPartNo == null) { - this.$message.warning('请选择产品编码!') - return - } - if (this.modalData.partName === '' || this.modalData.partName == null) { - this.$message.warning('请选择产品名称!') - return - } - if (this.modalData.priorityLevel === '' || this.modalData.priorityLevel == null) { - this.$message.warning('请选择优先等级!') - return - } - if (this.modalData.requiredCompletionDate === '' || this.modalData.requiredCompletionDate == null) { - this.$message.warning('请输入要求完成日期!') - return - } - if (this.modalData.flag === '1') { - quotationInformationSave(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: '确定' - }) + this.$refs.saveDataForm.validate((valid)=>{ + if (!valid){ + if (this.modalData.customerNo === '' || this.modalData.customerNo == null) { + this.$message.warning('请选择客户编码!') + return } - }) - } else { - quotationInformationEdit(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} + if (this.modalData.customerDesc === '' || this.modalData.customerDesc == null) { + this.$message.warning('请选择客户名称!') + return + } + if (this.modalData.tracker === '' || this.modalData.tracker == null) { + this.$message.warning('请选择跟单员编码!') + return + } + if (this.modalData.trackerName === '' || this.modalData.trackerName == null) { + this.$message.warning('请选择跟单员名称!') + return + } + if (this.modalData.projectId === '' || this.modalData.projectId == null) { + this.$message.warning('请选择项目编码!') + return + } + if (this.modalData.projectName === '' || this.modalData.projectName == null) { + this.$message.warning('请选择项目名称!') + return + } + if (this.modalData.quoter === '' || this.modalData.quoter == null) { + this.$message.warning('请选择询价专员编码!') + return + } + if (this.modalData.quoterName === '' || this.modalData.quoterName == null) { + this.$message.warning('请选择询价专员名称!') + return + } + if (this.modalData.testPartNo === '' || this.modalData.testPartNo == null) { + this.$message.warning('请选择产品编码!') + return + } + if (this.modalData.partName === '' || this.modalData.partName == null) { + this.$message.warning('请选择产品名称!') + return + } + if (this.modalData.priorityLevel === '' || this.modalData.priorityLevel == null) { + this.$message.warning('请选择优先等级!') + return + } + if (this.modalData.requiredCompletionDate === '' || this.modalData.requiredCompletionDate == null) { + this.$message.warning('请输入要求完成日期!') + return + } + }else { + if (this.projectPartListSelections.length === 0){ + this.$message.warning('请选择产品!') + return + } + if (this.modalData.flag === '1') { + quotationInformationSave(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: '确定' + }) + } }) } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' + 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: '确定' + }) + } }) } - }) - } + } + }) }, /** * 询价信息删除 @@ -2539,8 +2610,14 @@ getBaseData (val) { if (this.tagNo === 102) { if(this.tagNo1 === 1) { + if (val.Customer_no === this.modalData.customerNo) { + return + } this.modalData.customerNo = val.Customer_no this.modalData.customerDesc = val.Customer_desc + this.modalData.projectId = '' + this.modalData.projectName = '' + this.projectPartList = []; } } if (this.tagNo === 103) { @@ -2589,15 +2666,81 @@ json += '}' let s = eval('(' + json + ')') return s - } + }, + // 保存弹框关闭事件 + closeSaveDataDialog(){ + this.$refs.saveDataForm.resetFields(); // 先清空缓存选中 + this.$nextTick(() => this.$refs.projectPartTable.clearSelection()) + // 拿到选中的产品编号 + this.modalData.testPartNo = '' + this.modalData.partName = '' + this.projectPartData= { + site: this.$store.state.user.site, + testPartNo: '', + partName: '', + projectId:'', + } + }, + // 保存弹框打开事件 + openSaveDataDialog(){ + if (!this.modalData.projectId){ + this.projectPartList = []; + return + } + this.getProjectPartList() + }, + // 查询searchProjectInfoList + searchProjectInfoList(){ + this.projectList = []; + this.searchProjectData.customerId = this.modalData.customerNo + searchProjectInfoList(this.searchProjectData).then(({data})=>{ + if (data && data.code === 0) { + this.projectList = data.rows + } else { + this.projectList = [] + } + }).catch((error)=>{ + this.$message.error('查询项目信息失败') + }) + }, + closeProjectInfoDialog(){ + this.$refs.closeProjectInfoForm.resetFields(); + this.searchProjectData={ + site:this.$store.state.user.site, + projectId:undefined, + projectName:undefined, + customerId:undefined, + } + }, + projectClickRow(row){ + this.modalData.projectId = row.projectId + this.modalData.projectName = row.projectName + this.getProjectPartList() + this.chooseProjectListFlag = false + }, + checkSelectable(row,index){ + if (this.modalData.flag === '1'){ + return true + }else { + return false + } + }, } } - diff --git a/src/views/modules/quotation/sellForQuotation.vue b/src/views/modules/quotation/sellForQuotation.vue index dffbebd..8f6b453 100644 --- a/src/views/modules/quotation/sellForQuotation.vue +++ b/src/views/modules/quotation/sellForQuotation.vue @@ -210,10 +210,10 @@ - + - + @@ -774,7 +774,6 @@ export default { this.insertData.tracker=row.tracker;//跟单员 this.insertData.trackerName=row.trackerName; this.insertData.quoter=row.quoter;//销售编号 - this.insertData.quotationStatus=row.quotationStatus;//状态 this.insertData.internalInquiryNo=row.quotationNo;//内部询价单号 this.insertData.currency=row.customerCurrency;//内部询价单号 // 关闭弹框 diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail.vue index 69d8256..5936374 100644 --- a/src/views/modules/quotation/sellForQuotation/quotationDetail.vue +++ b/src/views/modules/quotation/sellForQuotation/quotationDetail.vue @@ -35,7 +35,7 @@ + width="120" align="left"> - inputNumberWithReg(value,0)" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> + quotationReg(value,0)" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - @@ -232,7 +231,7 @@ - + @@ -271,7 +270,7 @@ - + {{getUmName(row.umId)}} @@ -359,7 +358,7 @@ - 新 增 + 选择模板 - + - + - + - + - + @@ -449,35 +448,35 @@ - + quotationCostReg(value,0)" v-model="quotationDetailData.adjustPartCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - + quotationCostReg(value,1)" v-model="quotationDetailData.adjustMachineCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + quotationCostReg(value,2)" v-model="quotationDetailData.adjustFabricateCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + quotationCostReg(value,3)" v-model="quotationDetailData.adjustLabourCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + quotationCostReg(value,4)" v-model="quotationDetailData.adjustToolCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> @@ -493,21 +492,21 @@ - + quotationCostReg(value,5)" v-model="quotationDetailData.detailManageCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + quotationCostReg(value,6)" v-model="quotationDetailData.detailOtherCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + @@ -523,14 +522,14 @@ - + quotationCostReg(value,7)" v-model="quotationDetailData.detailProfitRate" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + @@ -546,35 +545,35 @@ - + - + - + quotationCostReg(value,8)" v-model="quotationDetailData.taxRate" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> - + - + @@ -611,14 +610,14 @@ - + - + @@ -627,14 +626,14 @@ - + - + @@ -785,7 +784,7 @@ - inputRule(value,2)" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> + inputRule(value,2)" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> @@ -878,35 +877,35 @@ - + quotationPartReg(value,0)" v-model="quotationPart.unitDosage" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - inputRule(value,1)" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> + quotationPartReg(value,1)" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - + quotationPartReg(value,2)" v-model="quotationPart.transferAmount" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - + quotationPartReg(value,3)" :disabled="quotationPart.quotationPartNo !== '*'" v-model="quotationPart.unitCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> - + @@ -1334,6 +1333,11 @@ + + + + +