diff --git a/src/views/modules/inquiry/inquiryApplication.vue b/src/views/modules/inquiry/inquiryApplication.vue index 74d35c0..a35a2f4 100644 --- a/src/views/modules/inquiry/inquiryApplication.vue +++ b/src/views/modules/inquiry/inquiryApplication.vue @@ -157,13 +157,13 @@ fixed="right" header-align="center" align="center" - width="120" + width="140" label="操作"> @@ -182,7 +182,7 @@ - @@ -250,7 +250,7 @@ - + @@ -309,11 +309,11 @@ - - + @@ -460,6 +460,7 @@ import DictDataSelect from "../sys/dict-data-select.vue"; import {queryCustomerList} from "@/api/customer/customer"; import {verifyData} from "@/api/part/partInformation"; import {EventBus} from "../../../main"; +import {partInformationSearch} from "../../../api/part/partInformation"; export default { computed: { @@ -1489,7 +1490,7 @@ export default { customerInquiryNo: '', status: 'C', priorityLevel: '', - requestDate: '', + requestDate: new Date(), requiredCompletionDate: '', remark: '', createBy: this.$store.state.user.name @@ -1560,10 +1561,6 @@ export default { }) return } - if (this.modalData.customerInquiryNo === '' || this.modalData.customerInquiryNo == null) { - this.$message.warning('请输入客户询价号!') - return - } if (this.modalData.priorityLevel === '' || this.modalData.priorityLevel == null) { this.$message.warning('请选择优先等级!') return @@ -2351,6 +2348,33 @@ export default { this.$refs.quotationUpload.init(currentData) }) }, + + openSaveDataDialog(){ + if (this.modalData.title === '询价新增') { + let rfqNos = []; + this.dataList.forEach((item) => { + // 如果item.rfqNo为XJ开头 + if (item.rfqNo.startsWith('XJ')) { + // 解析数字部分 + const numPart = parseInt(item.rfqNo.replace('XJ', ''), 10); + if (!isNaN(numPart)) { + rfqNos.push(numPart); + } + } + }); + if (rfqNos.length === 0) { + // 如果没有XJ开头的rfqNo + this.modalData.rfqNo = 'XJ00000001'; + } else { + // 取到最大的XJ开头的rfqNo + let maxRfqNo = Math.max(...rfqNos); + + // 生成新的rfqNo,确保有9位数,前面补零 + maxRfqNo += 1; // 增加最大值 + this.modalData.rfqNo = 'XJ' + String(maxRfqNo).padStart(8, '0'); + } + } + }, // 保存弹框关闭事件 closeSaveDataDialog() { this.modalData = { @@ -2377,6 +2401,42 @@ export default { } this.modalFlag = false }, + openInquiryPartSaveDataDialog() { + if (this.inquiryPartModalData.title === '询价产品新增') { + let partNos = []; + this.inquiryPartModalData.queryType = 'TP'; + this.inquiryPartModalData.userName = this.$store.state.user.name; + this.inquiryPartModalData.limit = -1; + this.inquiryPartModalData.page = 1; + this.inquiryPartModalData.buNo = ''; + partInformationSearch(this.inquiryPartModalData).then(({data}) => { + if (data && data.code === 0) { + data.page.list.forEach((item) => { + // 如果item.partNo为TP开头 + if (item.partNo.startsWith('TP')) { + // 解析数字部分 + const numPart = parseInt(item.partNo.replace('TP', ''), 10); + if (!isNaN(numPart)) { + partNos.push(numPart); + } + } + }); + + if (partNos.length === 0) { + // 如果没有TP开头的partNo + this.inquiryPartModalData.partNo = 'TP00000001'; + } else { + // 取到最大的TP开头的partNo + let maxPartNo = Math.max(...partNos); + + // 生成新的partNo,确保有9位数,前面补零 + maxPartNo += 1; // 增加最大值 + this.inquiryPartModalData.partNo = 'TP' + String(maxPartNo).padStart(8, '0'); + } + } + }); + } + }, closeInquiryPartSaveDataDialog() { this.inquiryPartModalData = { title: '', diff --git a/src/views/modules/quote/index.vue b/src/views/modules/quote/index.vue index 0266887..3390ce2 100644 --- a/src/views/modules/quote/index.vue +++ b/src/views/modules/quote/index.vue @@ -149,41 +149,6 @@ export default { fixed: '', columnWidth: 120 }, - { - userId: this.$store.state.user.name, - functionId: 5011, - serialNumber: '5011Table1ProjectNo', - tableId: '5011Table1', - tableName: '报价信息表', - columnProp: 'projectNo', - headerAlign: 'center', - align: 'left', - columnLabel: '项目编码', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 200 - }, { - userId: this.$store.state.user.name, - functionId: 5011, - serialNumber: '5011Table1ProjectDesc', - tableId: '5011Table1', - tableName: '报价信息表', - columnProp: 'projectDesc', - headerAlign: 'center', - align: 'left', - columnLabel: '项目名称', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 200 - }, { userId: this.$store.state.user.name, functionId: 5011, @@ -868,19 +833,6 @@ export default { - - - - 项目编码 - - - - - - - - - diff --git a/src/views/modules/quote/quotes.vue b/src/views/modules/quote/quotes.vue index 2a970c7..4e09f82 100644 --- a/src/views/modules/quote/quotes.vue +++ b/src/views/modules/quote/quotes.vue @@ -2,6 +2,8 @@ import DictDataSelect from "../sys/dict-data-select.vue"; import {queryQuotationInformationByPage} from "@/api/quote/quotationInformation"; import {batchSaveQuote} from "@/api/quote/quote"; +import {getSiteAndBuByUserName} from "../../../api/qc/qc"; +import {searchInquiryDetailHeaderInfo} from "../../../api/inquiry/inquiryDetail"; export default { name: "quotes", @@ -15,30 +17,33 @@ export default { type:[String,Number], default: '76vh' }, - queryStatus:{ - type:String, - default: '下达' - }, }, data(){ return{ - no:1, - size:50, - total:0, + pageIndex: 1, + pageSize: 50, + totalPage: 0, + userBuList:[], queryForm: { - customerNo:'', - quotationBatchNo:'', - customerDesc:'', - partNo:'', - partDesc:'', - startDate:null, - endDate:null, - quotationItemNo:undefined, - projectNo:'', - projectDesc:'', - quoterName:'', - priorityLevel:'', - quotationStatus:'', + site: this.$store.state.user.site, + customerNo: '', + customerDesc: '', + id: '', + rfqNo: '', + bu: '', + requestStartDate: '', + requestEndDate: '', + requiredCompletionStartDate: '', + requiredCompletionEndDate: '', + status: '', + quoterName: '', + requesterName: '', + priorityLevel: '', + partNo: '', + partDesc: '', + page: 1, + limit: 10, + menuId: this.$route.meta.menuId, }, dataList:[], queryLoading:false, @@ -46,31 +51,32 @@ export default { columns:[ { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1QuotationNo', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1BuDesc', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'quotationNo', + columnProp: 'buDesc', headerAlign: 'center', align: 'center', - columnLabel: '申请单号', + columnLabel: 'BU', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 - }, { + columnWidth: 80 + }, + { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1QuotationBatchNo', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1rfqNo', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'quotationBatchNo', + columnProp: 'rfqNo', headerAlign: 'center', align: 'center', - columnLabel: '申请批次号', + columnLabel: '询价单号', columnHidden: false, columnImage: false, columnSortable: false, @@ -78,29 +84,12 @@ export default { status: true, fixed: '', columnWidth: 120 - }, { - userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1QuotationItemNo', - tableId: '5012Table1', - tableName: '询价信息表', - columnProp: 'quotationItemNo', - headerAlign: 'center', - align: 'right', - columnLabel: '序号', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 60 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1CustomerNo', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1CustomerNo', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'customerNo', headerAlign: 'center', @@ -116,9 +105,9 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1CustomerDesc', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1CustomerDesc', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'customerDesc', headerAlign: 'center', @@ -134,14 +123,14 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1ProjectId', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1RequestDate', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'projectNo', + columnProp: 'requestDate', headerAlign: 'center', align: 'center', - columnLabel: '项目编码', + columnLabel: '询价日期', columnHidden: false, columnImage: false, columnSortable: false, @@ -152,32 +141,32 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1ProjectDesc', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1RequesterName', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'projectDesc', + columnProp: 'requesterName', headerAlign: 'center', align: 'left', - columnLabel: '项目名称', + columnLabel: 'PjM', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 80 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1ProjectManagerName', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1QuoterName', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'projectManagerName', + columnProp: 'quoterName', headerAlign: 'center', align: 'left', - columnLabel: 'PM/Sales', + columnLabel: '报价专员', columnHidden: false, columnImage: false, columnSortable: false, @@ -188,135 +177,189 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1ProjectOwnerName', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1RequiredCompletionDate', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'projectOwnerName', + columnProp: 'requiredCompletionDate', headerAlign: 'center', - align: 'left', - columnLabel: 'PjM', + align: 'center', + columnLabel: '要求报价日期', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1QuoterName', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1CustomerInquiryNo', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'quoterName', + columnProp: 'customerInquiryNo', headerAlign: 'center', - align: 'left', - columnLabel: '报价专员', + align: 'center', + columnLabel: '客户询价单号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1TestPartNo', - tableId: '5012Table1', - tableName: '询价信息表', - columnProp: 'testPartNo', + functionId: 102001, + serialNumber: '102001Table2PartNo', + tableId: '102001Table2', + tableName: '询价产品表', + columnProp: 'partNo', headerAlign: 'center', align: 'left', - columnLabel: '项目料号', + columnLabel: '产品编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1PartDesc', - tableId: '5012Table1', - tableName: '询价信息表', + functionId: 102001, + serialNumber: '102001Table2PartDesc', + tableId: '102001Table2', + tableName: '询价产品表', columnProp: 'partDesc', headerAlign: 'center', align: 'left', - columnLabel: '物料描述', + columnLabel: '产品描述', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 100 + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1PriorityLevel', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1Status', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'priorityLevel', + columnProp: 'status', headerAlign: 'center', align: 'center', - columnLabel: '优先等级', + columnLabel: '状态', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 100 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1RequiredCompletionDate', - tableId: '5012Table1', - tableName: '询价信息表', - columnProp: 'requiredCompletionDate', + functionId: 102001, + serialNumber: '102001Table2InquiryQty', + tableId: '102001Table2', + tableName: '询价产品表', + columnProp: 'inquiryQty', + headerAlign: 'center', + align: 'right', + columnLabel: '询价数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table2Unit', + tableId: '102001Table2', + tableName: '询价产品表', + columnProp: 'umName', headerAlign: 'center', align: 'center', - columnLabel: '要求完成日期', + columnLabel: '计量单位', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table2CodeNo', + tableId: '102001Table2', + tableName: '询价产品表', + columnProp: 'codeNo', + headerAlign: 'center', + align: 'left', + columnLabel: '属性模版', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1quotationStatus', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1PriorityLevel', + tableId: '102001Table1', tableName: '询价信息表', - columnProp: 'quotationStatus', + columnProp: 'priorityLevel', headerAlign: 'center', align: 'center', - columnLabel: '状态', + columnLabel: '优先等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 100 + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table2Remark', + tableId: '102001Table2', + tableName: '询价产品表', + columnProp: 'remark', + headerAlign: 'center', + align: 'left', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1CreateDate', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1CreateDate', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'createDate', headerAlign: 'center', @@ -332,9 +375,9 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1CreateBy', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1CreateBy', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'createBy', headerAlign: 'center', @@ -350,9 +393,9 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1UpdateDate', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1UpdateDate', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'updateDate', headerAlign: 'center', @@ -368,9 +411,9 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 5012, - serialNumber: '5012Table1UpdateBy', - tableId: '5012Table1', + functionId: 102001, + serialNumber: '102001Table1UpdateBy', + tableId: '102001Table1', tableName: '询价信息表', columnProp: 'updateBy', headerAlign: 'center', @@ -389,23 +432,30 @@ export default { } }, methods:{ - handleQuery(){ - let params = { - ...this.queryForm, - quotationStatus:this.queryStatus, - no: this.no, - size: this.size, - createBy: this.$store.state.user.name, + + // 获取用户的bu + getSiteAndBuByUserName() { + let tempData = { + username: this.$store.state.user.name, } + getSiteAndBuByUserName(tempData).then(({data}) => { + if (data.code === 0) { + this.userBuList = data.rows + } + }) + }, + + handleQuery(){ + this.queryForm.limit = this.pageSize + this.queryForm.page = this.pageIndex + this.queryForm.status = 'B' this.queryLoading = true - queryQuotationInformationByPage(params).then(({data})=>{ + searchInquiryDetailHeaderInfo(this.queryForm).then(({data})=>{ if (data && data.code === 0){ - this.dataList = data.rows.map((item)=>{ - item.projectManagerName = item.projectManager.split('-')[1] - item.projectOwnerName = item.projectOwner.split('-')[1] - return item - }) - this.total = data.total + this.dataList = data.page.list + this.pageIndex = data.page.currPage + this.pageSize = data.page.pageSize + this.totalPage = data.page.totalCount }else { this.$message.warning(data.msg); } @@ -416,11 +466,12 @@ export default { }) }, handleSizeChange(val){ - this.size = val + this.pageSize = val + this.pageIndex = 1 this.handleQuery(); }, handlePageChange(val){ - this.no = val + this.pageIndex = val this.handleQuery(); }, handleSelectionChange(val) { @@ -467,72 +518,72 @@ export default {