diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js index 6f5cd86..1dab74b 100644 --- a/src/api/part/partInformation.js +++ b/src/api/part/partInformation.js @@ -60,5 +60,6 @@ export const getPartAgent = data => createAPI(`/plm/partInformation/getPartAgent * @returns {*} */ export const searchPartList = (data) => createAPI(`/plm/partInformation/searchPartList`,'get',data); +export const searchPart = (data) => createAPI(`/plm/partInformation/searchPart`,'get',data); diff --git a/src/api/part/toolHeader.js b/src/api/part/toolHeader.js index f081808..8b08bfc 100644 --- a/src/api/part/toolHeader.js +++ b/src/api/part/toolHeader.js @@ -6,3 +6,4 @@ import { createAPI } from "@/utils/httpRequest.js"; * @returns {*} */ export const searchToolHeader = data => createAPI(`/plm/toolHeader/searchToolHeader`,'get',data); +export const searchTool = data => createAPI(`/plm/toolHeader/searchTool`,'get',data); diff --git a/src/api/project/project.js b/src/api/project/project.js index b679112..e2a6b53 100644 --- a/src/api/project/project.js +++ b/src/api/project/project.js @@ -30,6 +30,7 @@ export const saveProjectContactList= data => createAPI(`/project/saveProjectCont export const deleteProjectInfo= data => createAPI(`/project/deleteProjectInfo`,'post',data) export const getProjectInfoPartList= data => createAPI(`/project/getProjectInfoPartList`,'post',data) export const getProjectPartList= data => createAPI(`/project/getProjectPartList`,'get',data) +export const getProjectPart= data => createAPI(`/project/getProjectPart`,'get',data) export const saveProjectPart= data => createAPI(`/project/saveProjectPart`,'post',data) export const deleteProjectPartWithId= data => createAPI(`/project/deleteProjectPartWithId`,'post',data) export const getPlmToolPurchaseRequestDataByProject= data => createAPI(`/project/getPlmToolPurchaseRequestDataByProject`,'post',data) diff --git a/src/views/modules/quotation/sellForQuotation.vue b/src/views/modules/quotation/sellForQuotation.vue index 42ad806..6aca28b 100644 --- a/src/views/modules/quotation/sellForQuotation.vue +++ b/src/views/modules/quotation/sellForQuotation.vue @@ -306,7 +306,7 @@ - 销售员 + 销售员 @@ -779,8 +779,8 @@ export default { this.insertData.projectId=row.projectId;//项目编码 this.insertData.projectName=row.projectName;//项目名称 this.insertData.tracker=row.tracker;//跟单员 + this.insertData.trackerName=row.trackerName; this.insertData.quoter=row.quoter;//销售编号 - this.insertData.quoterName=row.quoterName;//销售员 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 bd7ee3e..54d5e45 100644 --- a/src/views/modules/quotation/sellForQuotation/quotationDetail.vue +++ b/src/views/modules/quotation/sellForQuotation/quotationDetail.vue @@ -256,7 +256,7 @@ 删除 - - - - + + + + - - - - - + + + + + @@ -291,7 +291,7 @@ 从其他报价单复制 删 除 - - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -336,25 +335,25 @@ + :data="quotationToolFormTable.quotationToolList" height="400" stripe border> - + - - - - - - - + + + + + + + @@ -630,13 +629,13 @@ - 重 置 + 搜 索 - @@ -649,15 +648,15 @@ - - 工序编码 - + + - - 工序名称 - + +
+ +
@@ -871,13 +870,13 @@ - 重 置 + 查 询
- @@ -899,12 +898,12 @@ - + - + @@ -1011,7 +1010,6 @@ - @@ -1113,10 +1111,10 @@ import { quotationDetailList, } from '@/api/quotation/quotationHeader.js'; import {searchUmInformationList,} from '@/api/part/umInformation.js'; -import {searchToolHeader,} from '@/api/part/toolHeader.js'; +import {searchToolHeader,searchTool} from '@/api/part/toolHeader.js'; import {searchWorkCenter,} from '@/api/part/workCenter.js'; -import {searchPartList,} from '@/api/part/partInformation.js'; -import {getProjectPartList} from '@/api/project/project.js'; +import {searchPartList,searchPart} from '@/api/part/partInformation.js'; +import {getProjectPartList,getProjectPart} from '@/api/project/project.js'; import { queryOperationList, // 查询工序列表 } from '@/api/part/routingManagement.js' @@ -1126,6 +1124,78 @@ export default { props: ['quotationHeader'], name: "quotationDetail", data() { + // 后台校验 + // 产品编码校验 + const validateProductNo = (rule, value, callback) =>{ + if (value === '' || value === null || value === undefined){ + callback(new Error(' ')) + return + } + this.projectPartData.testPartNo = value + getProjectPart(this.projectPartData).then(({data})=>{ + if (data === 200){ + if (data.data.length === 1){ + callback() + return + } + } + this.projectPartData.testPartNo = undefined; + callback(new Error(" ")) + }).catch((error)=>{ + this.projectPartData.testPartNo = undefined + callback(new Error(' ')) + }) + }; + // 校验材料 + const validatePartNo = (rule, value, callback) =>{ + if (value === '' || value === null || value === undefined){ + callback(new Error(' ')) + return + } + if (value === '*'){ + callback(); + return; + } + this.partData.partNo = value + searchPart(this.partData).then(({data})=>{ + if (data.code === 200) { + if (data.data.length === 1){ + callback() + return + } + } + this.partData.partNo = null; + callback(new Error(' ')) + }).catch((error)=>{ + this.partData.partNo = null; + callback(new Error(' ')) + }) + }; + // 校验工具编号 + const validateToolNo = (rule, value, callback) => { + if (value === '' || value === null || value === undefined){ + callback(new Error(' ')) + return + } + if (value === '*'){ + callback(); + return; + } + this.toolHeader.toolNo = value; + searchTool(this.toolHeader).then(({data})=>{ + if (data.code === 200) { + if (data.data.length === 1){ + callback() + return + } + } + this.toolHeader.toolNo = null; + callback(new Error(' ')) + }).catch((error)=>{ + this.toolHeader.toolNo = null; + callback(new Error(' ')) + }) + }; return { // ===============================================集合 ================================== tableData: [],// 报价详情 @@ -1265,7 +1335,7 @@ export default { quotationRoutingId:undefined,//主键 quotationDetailId:undefined,//外键 site:this.$store.state.user.site,//工厂编码 - itemNo:undefined,//序号 + itemNo:0,//序号 quotationRoutingNo:undefined,//报价工序编码 quotationRoutingDesc:undefined,//报价工序名称 machiningCenterNo:undefined,//加工中心编码 @@ -1295,19 +1365,21 @@ export default { }, // 工具列表筛选对象 toolHeader:{ + site:this.$store.state.user.site, toolNo:undefined,// 编号 toolDescription:undefined,// 描述 }, // 材料列表筛选对象 partData:{ + site:this.$store.state.user.site, partNo:undefined,// 编号 partDesc:undefined, }, // 项目物料筛选列表 projectPartData:{ site:this.$store.state.user.site, - projectId:undefined,// 项目编号 - projectName:undefined,// 项目名称 + testPartNo:undefined,// 项目编号 + partName:undefined,// 项目名称 }, // 其他报价明细搜索条件 otherDetail:{ @@ -1349,6 +1421,7 @@ export default { productNo: [ {required: true, message: ' ', trigger: 'change'}, {required: true, message: ' ', trigger: 'blur'}, + {required: true,validator:validateProductNo,trigger: 'blur'}, ], productDesc: [ {required: true, message: ' ', trigger: 'change'}, @@ -1375,6 +1448,7 @@ export default { toolNo: [ {required: true, message: ' ', trigger: 'change', label: "工具编号"}, {required: true, message: ' ', trigger: 'blur'}, + {required: true, validator:validateToolNo, trigger: 'blur'}, ], toolDescription: [ {required: true, message: ' ', trigger: 'change'}, @@ -1438,7 +1512,7 @@ export default { {required: true, message: ' ', trigger: 'change'}, {required: true, message: ' ', trigger: 'blur'}, ], - quotationRoutingDesc: [ + itemNo: [ {required: true, message: ' ', trigger: 'change'}, {required: true, message: ' ', trigger: 'blur'}, ], @@ -1496,6 +1570,7 @@ export default { quotationPartNo:[ {required: true, message: ' ', trigger: 'change'}, {required: true, message: ' ', trigger: 'blur'}, + {required: true,validator:validatePartNo, trigger: 'blur'}, ], quotationPartDesc:[ {required: true, message: ' ', trigger: 'change'}, @@ -1525,7 +1600,6 @@ export default { // =========================================参数列表================================= // 报价明细 参数列表 quotationDetailColumns: [ - {label: "productNo", value: "产品编码"}, {label: "productDesc", value: "产品名称"}, {label: "quotationDetailQuantity", value: "报价数量"}, {label: "internalInquiryNo", value: "内部询价单号"}, @@ -1725,12 +1799,12 @@ export default { // ===============================================新增================================================ // 新增 报价明细 insertQuotationDetailBtn() { - this.insertQuotationDetailLoading = true; this.$refs['insertQuotationDetailForm'].validate((validate, objects) => { if (validate) { + this.insertQuotationDetailLoading = true; insertQuotationDetail(this.insertQuotationDetail).then(({data}) => { this.insertQuotationDetailLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.quotationLeadIntoDetailFlag = false; // 保存成功后 if (this.insertQuotationDetailData.flag) { @@ -1772,7 +1846,7 @@ export default { insertQuotationToolData(){ saveQuotationTool(this.quotationTool).then(({data}) => { this.saveQuotationToolLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.initQuotationToolData(); this.$message.success(data.msg); this.saveQuotationToolFlag = false;// 关闭弹框 @@ -1787,7 +1861,7 @@ export default { batchInsertQuotationToolData(batchInsertQuotationToolList){ batchInsertQuotationTool(batchInsertQuotationToolList).then(({data})=>{ this.saveBatchLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initQuotationToolData(); this.otherQuotationDetailDialogFlag = false; this.saveQuotationToolFlag = false; @@ -1806,7 +1880,7 @@ export default { type: 'warning' }).then(() => { deleteQuotationTool(row).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationToolData(); this.$message.success(data.msg); }else { @@ -1827,7 +1901,7 @@ export default { type: 'warning' }).then(() => { batchDeleteQuotationTool(this.selectionQuotationToolList).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationToolData(); this.$message.success(data.msg); }else { @@ -1844,7 +1918,7 @@ export default { type: 'warning' }).then(() => { deleteQuotationRouting(row).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationRoutingData(); this.$message.success(data.msg); }else { @@ -1865,7 +1939,7 @@ export default { type: 'warning' }).then(() => { batchDeleteQuotationRouting(this.selectionQuotationRoutingList).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationRoutingData(); this.$message.success(data.msg); }else { @@ -1882,7 +1956,7 @@ export default { type: 'warning' }).then(() => { deleteQuotationPart(row).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationPart(); this.$message.success(data.msg); }else { @@ -1903,7 +1977,7 @@ export default { type: 'warning' }).then(() => { batchDeleteQuotationPart(this.selectionQuotationPartList).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initQuotationPart(); this.$message.success(data.msg); }else { @@ -1920,7 +1994,7 @@ export default { type: 'warning' }).then(() => { deleteQuotationDetail(row).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.initData(); this.$message.success(data.msg); }else { @@ -1967,7 +2041,7 @@ export default { this.editQuotationDetailLoading = true; updateQuotationDetail(params).then(({data}) => { this.editQuotationDetailLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.quotationDetailFlag = false; this.initData(); this.$message.success(data.msg); @@ -2037,7 +2111,7 @@ export default { this.saveQuotationRoutingLoading = true; insertQuotationRouting(this.quotationRouting).then(({data})=>{ this.saveQuotationRoutingLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initQuotationRoutingData(); this.$message.success(data.msg); this.quotationRoutingDialogFlag = false; @@ -2052,7 +2126,7 @@ export default { batchInsertQuotationRoutingData(quotationRoutingList){ batchInsertQuotationRouting(quotationRoutingList).then(({data})=>{ this.saveBatchLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initQuotationRoutingData(); this.$message.success(data.msg); this.otherQuotationDetailDialogFlag = false; @@ -2080,7 +2154,7 @@ export default { batchInsertQuotationPartData(quotationPrtList){ batchInsertQuotationPart(quotationPrtList).then(({data})=>{ this.saveBatchLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initQuotationPart(); this.$message.success(data.msg); this.otherQuotationDetailDialogFlag = false; @@ -2096,7 +2170,7 @@ export default { insertQuotationPartData(){ insertQuotationPart(this.quotationPart).then(({data})=>{ this.saveQuotationPartLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initQuotationPart(); this.$message.success(data.msg); this.quotationPartDialogFlag = false; @@ -2159,7 +2233,7 @@ export default { batchInsertQuotationDetailData(quotationDetailList){ batchInsertQuotationDetail(quotationDetailList).then(({data})=>{ this.saveBatchLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.initData(); this.otherQuotationDetailDialogFlag = false; this.$message.success(data.msg); @@ -2203,7 +2277,7 @@ export default { this.initQuotationDetailLoading = true; searchQuotationDetailPageByHeaderId(params).then(({data}) => { this.initQuotationDetailLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.tableData = data.data.records; this.total = data.data.total; }else { @@ -2224,13 +2298,8 @@ export default { }, // 获取工具列表 initToolHeader(){ - this.toolHeader.toolNo = undefined; - this.toolHeader.toolDescription = undefined; - let params = { - site:this.$store.state.user.site, - }; - searchToolHeader(params).then(({data})=>{ - if (data.code == 200) { + searchToolHeader(this.toolHeader).then(({data})=>{ + if (data.code === 200) { this.toolHeaderList = data.data; this.toolHeaderList = this.toolHeaderList.map(item =>{ let utilObj = { @@ -2249,7 +2318,7 @@ export default { site:this.$store.state.user.site, }; searchUmInformationList(params).then(({data})=>{ - if (data.code == 200) { + if (data.code === 200) { this.umInformationList = data.data; this.umInformationList = this.umInformationList.map(item=>{ let utilObj = { @@ -2270,7 +2339,7 @@ export default { this.initQuotationRoutingLoading = true; searchQuotationRoutingByDetailId(params).then(({data})=>{ this.initQuotationRoutingLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.quotationRoutingFormTable.quotationRoutingList = data.data; // 计算价格 let list = this.quotationRoutingFormTable.quotationRoutingList; @@ -2297,7 +2366,7 @@ export default { this.initQuotationPartLoading = true; searchQuotationPart(params).then(({data})=>{ this.initQuotationPartLoading = false; - if (data.code == 200){ + if (data.code === 200){ this.quotationPartFormTable.quotationPartList = data.data; this.computeQuotationPartCost();// 计算材料 } @@ -2313,7 +2382,7 @@ export default { this.initQuotationToolLoading = true; searchQuotationTool(params).then(({data}) => { this.initQuotationToolLoading = false; - if (data.code == 200) { + if (data.code === 200) { this.quotationToolFormTable.quotationToolList = data.data; this.computeQuotationToolCost();// 计算工具价格 } @@ -2327,20 +2396,15 @@ export default { site:this.$store.state.user.site, }; searchWorkCenter(params).then(({data})=>{ - if (data.code == 200) { + if (data.code === 200) { this.workCenterList = data.data; } }) }, // 查询 材料信息 initPartList(){ - this.partData.partNo = undefined; - this.partData.partDesc = undefined; - let params = { - site:this.$store.state.user.site - }; - searchPartList(params).then(({data})=>{ - if (data.code == 200) { + searchPartList(this.partData).then(({data})=>{ + if (data.code === 200) { this.partList = data.data; } }) @@ -2355,7 +2419,7 @@ export default { internalInquiryNo:this.otherDetail.internalInquiryNo, }; searchQuotationDetail(params).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.otherQuotationDetailList = data.data; } }) @@ -2370,7 +2434,7 @@ export default { internalInquiryNo:this.otherDetail.internalInquiryNo, } quotationDetailList(params).then(({data})=>{ - if (data.code == 200){ + if (data.code === 200){ this.otherQuotationDetailList = data.data; } }) @@ -2539,7 +2603,7 @@ export default { quotationRoutingId:undefined,//主键 quotationDetailId:undefined,//外键 site:this.$store.state.user.site,//工厂编码 - itemNo:undefined,//序号 + itemNo:0,//序号 quotationRoutingNo:undefined,//报价工序编码 quotationRoutingDesc:undefined,//报价工序名称 machiningCenterNo:undefined,//加工中心编码 @@ -2803,7 +2867,7 @@ export default { for (let i = 0; i < labels.length; i++) { let quotationToolColumn = labels[i]; if (quotationToolColumn.label === filed) { - this.$message.warning(quotationToolColumn.value+"填写不正确"); + this.$message.warning(quotationToolColumn.value+"为空或填写不正确"); return } } @@ -2818,7 +2882,7 @@ export default { for (let i = 0; i < labels.length; i++) { let quotationToolColumn = labels[i]; if (quotationToolColumn.label === filed) { - this.$message.warning(tableName+"存在:"+quotationToolColumn.value+"填写不正确"); + this.$message.warning(tableName+"存在:"+quotationToolColumn.value+"为空或填写不正确"); return } } @@ -2865,6 +2929,11 @@ export default { break } }, + changeRegValue(value){ + if (value < 0){ + this.quotationRouting.itemNo = 0 + } + }, }, created() { // 创建时 父组件值绑定zi