From 907ef552270274d4457eb050ecae943610f6964a Mon Sep 17 00:00:00 2001 From: Yangzz <9704.yyds@163.com> Date: Thu, 14 Aug 2025 15:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E7=94=B3=E8=AF=B7=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/orderIssure/soIssueNotify.js | 5 +- .../soIssueNotify/searchIssureNotify.vue | 330 ++++++++++++------ 2 files changed, 230 insertions(+), 105 deletions(-) diff --git a/src/api/orderIssure/soIssueNotify.js b/src/api/orderIssure/soIssueNotify.js index 67891c0..7a4ad46 100644 --- a/src/api/orderIssure/soIssueNotify.js +++ b/src/api/orderIssure/soIssueNotify.js @@ -6,8 +6,9 @@ export const createNotify = data => createAPI(`/orderIssure/issureNotify/createN export const getNotifyNoDetail = data => createAPI(`/orderIssure/issureNotify/getNotifyNoDetail`,'post',data) -export const getSOScheduledRoutingListForIssure= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssure`,'post',data) export const getSOSBOMForIssure= data => createAPI(`/orderIssure/issureNotify/getSOSBOMForIssure`,'post',data) +export const getSOScheduledRoutingListForIssure= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssure`,'post',data) +export const getSOScheduledRoutingListForIssureByPaging= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssureByPaging`,'post',data) export const saveSOIssueNotifyOrderList= data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderList`,'post',data) export const saveMaterialDetail= data => createAPI(`/orderIssure/issureNotify/saveMaterialDetail`,'post',data) @@ -29,6 +30,7 @@ export const searchSumNotifyMaterialList= data => createAPI(`/orderIssure/issure export const updateNotifyBu= data => createAPI(`/orderIssure/issureNotify/updateNotifyBu`,'post',data) export const getPartList= data => createAPI(`/orderIssure/issureNotify/getPartList`,'post',data) +export const getPartListByPaging= data => createAPI(`/orderIssure/issureNotify/getPartListByPaging`,'post',data) export const checkPartStock= data => createAPI(`/orderIssure/issureNotify/checkPartStock`,'post',data) export const deleteNotifySOSPlus= data => createAPI(`/orderIssure/issureNotify/deleteNotifySOSPlus`,'post',data) export const updateNotifyStatus= data => createAPI(`/orderIssure/issureNotify/updateNotifyStatus`,'post',data) @@ -46,4 +48,5 @@ export const updateNotifyBatchConfirmStatus= data => createAPI(`/orderIssure/iss export const getSiteAndBuByUserName = data => createAPI(`/orderIssure/issureNotify/getSiteAndBuByUserName`,'post',data) export const getEamWorkShop = data => createAPI(`/orderIssure/issureNotify/getEamWorkShop`,'post',data) +export const saveIssueNoOrderDetail = data => createAPI(`/orderIssure/issureNotify/saveIssueNoOrderDetail`,'post',data) diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue index 58bcc4a..82e528a 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue @@ -374,40 +374,38 @@ - - + - + - + - + - - 查询 + + 查询 + + + + + 关闭 @@ -530,6 +547,15 @@ + + 关闭 @@ -545,7 +571,7 @@ - + @@ -620,7 +646,7 @@ - + BOM物料 非BOM物料 @@ -776,8 +802,8 @@ @@ -785,8 +811,8 @@ @@ -799,7 +825,7 @@ 物料编码 物料编码 - + @@ -834,7 +860,7 @@ - 保存 + 保存 关闭 @@ -857,8 +883,8 @@ , searchNotifyLogClose , getSiteAndBuByUserName , createNotify - , getSOScheduledRoutingListForIssure - , getPartList + , getSOScheduledRoutingListForIssureByPaging + , getPartListByPaging } from "@/api/orderIssure/soIssueNotify.js" import { searchShopOrderByPaging @@ -872,6 +898,7 @@ getTableDefaultListLanguage, getTableUserListLanguage, } from "@/api/table.js" + import {saveIssueNoOrderDetail} from "../../../../api/orderIssure/soIssueNotify"; export default { @@ -928,6 +955,14 @@ co_pageIndex: 1, co_pageSize: 100, co_totalPage: 0, + //派工单分页 + ss_pageIndex: 1, + ss_pageSize: 100, + ss_totalPage: 0, + //非BOM物料分页 + pp_pageIndex: 1, + pp_pageSize: 100, + pp_totalPage: 0, dataListLoading: false, currentRow:'', columnList1:[ @@ -1822,6 +1857,8 @@ }, chooseSOSModalFlag: false, chooseSOSData: { + page: 1, + limit: 100, orderno: '', seqno: '', sResourceid: '', @@ -1857,6 +1894,8 @@ chooseSOSList: [], choosePartModalFlag: false, choosePartData: { + page: 1, + limit: 100, site: '', sourceBu: '', partNo: '', @@ -2204,6 +2243,7 @@ this.getTableUserColumn(this.$route.meta.menuId+'table6',6) }, methods: { + saveIssueNoOrderDetail, // 动态列开始 获取 用户保存的 格式列 async getTableUserColumn(tableId, columnId) { let queryTableUser = { @@ -2554,11 +2594,11 @@ // 清除所有数据,设置默认值 this.orderDetailData = { - orderno: '', - seqno: '', + orderNo: '', + seqNo: '', operationNo: '', locationNo: '', - qtyrequired: '', + qtyRequired: '', issureQty: 0, partDesc: '', partNo: '', @@ -2573,6 +2613,7 @@ this.saveOrderDetailFlag = true }, + //编辑派工单明细 editOrderDetail(){ // 检查是否选择了明细行 @@ -2583,11 +2624,33 @@ return false } - // 这里应该实现编辑逻辑 - this.$message.warning('编辑功能待实现'); }, - saveOrderDetail(){ + + saveIssueNoOrderDetail(){ // 数据验证 + // 非BOM物料时,只校验领取数量和要求发料时间 + if (this.orderDetailData.materialType === 'BOM物料') { + if (!this.orderDetailData.orderNo ) { + this.$alert('请选择工单或者派工单!', '提示', { + confirmButtonText: '确定' + }) + return false + } + if (!this.orderDetailData.itemNo) { + this.$alert('请选择工序!', '提示', { + confirmButtonText: '确定' + }) + return false + } + //校验如果是BOM物料的话,领料数量不能大于工单数量 + if (this.orderDetailData.issureQty > this.orderDetailData.qtyRequired){ + this.$alert('领取数量不可大于工单/派工数量!', '提示', { + confirmButtonText: '确定' + }) + return false + } + } + if (!this.orderDetailData.needDate) { this.$alert('请选择要求发料时间!', '提示', { confirmButtonText: '确定' @@ -2602,53 +2665,74 @@ return false } + // 构建API请求参数 let inData = { site: this.currentRow.site, bu: this.currentRow.bu, notifyNo: this.currentRow.notifyNo, - orderno: this.orderDetailData.orderNo, - seqno: this.orderDetailData.seqNo, - operationNo: this.orderDetailData.operationNo, - locationNo: this.orderDetailData.locationNo, - qtyrequired: this.orderDetailData.qtyRequired, + materialType: this.orderDetailData.materialType, + sOOrderNo: this.orderDetailData.orderNo, + seqNo: this.orderDetailData.seqNo, + fGPartNo: this.orderDetailData.partNo, + opsItemNo: this.orderDetailData.itemNo, issureQty: this.orderDetailData.issureQty, + needDate: this.orderDetailData.needDate, + outWorkOrderFlag: 'N', + username: this.$store.state.user.name, + // 扩展字段 + itemDesc: this.orderDetailData.itemDesc, partDesc: this.orderDetailData.partDesc, - partNo: this.orderDetailData.partNo, resourceDesc: this.orderDetailData.resourceDesc, resourceId: this.orderDetailData.resourceId, - itemDesc: this.orderDetailData.itemDesc, - itemNo: this.orderDetailData.itemNo, workCenterNo: this.orderDetailData.workCenterNo, - needDate: this.orderDetailData.needDate, - username: this.$store.state.user.name, + qtyrequired: this.orderDetailData.qtyRequired } - // 这里应该调用相应的API来保存派工单数据 - // 由于没有具体的API,我们先模拟成功 - this.$message.success('保存成功') - this.saveOrderDetailFlag = false + // 调用API保存派工单数据 + saveIssueNoOrderDetail(inData).then(({data}) => { + if (data && data.code === 0) { + this.$message({ + message: '保存成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) - // 刷新当前标签页数据 - this.refreshCurrentTabTable() + // 关闭模态框 + this.saveOrderDetailFlag = false - // 清空表单数据 - this.orderDetailData = { - orderno: '', - seqno: '', - operationNo: '', - locationNo: '', - qtyrequired: '', - issureQty: 0, - partDesc: '', - partNo: '', - resourceId: '', - resourceDesc: '', - itemDesc: '', - itemNo: 0, - workCenterNo: '', - needDate: '', - materialType: 'BOM物料' - } + // 刷新当前标签页数据 + this.refreshCurrentTabTable() + + // 清空表单数据 + this.orderDetailData = { + orderNo: '', + seqNo: '', + operationNo: '', + locationNo: '', + qtyRequired: '', + issureQty: 0, + partDesc: '', + partNo: '', + resourceId: '', + resourceDesc: '', + itemDesc: '', + itemNo: 0, + workCenterNo: '', + needDate: '', + materialType: 'BOM物料' + } + } else { + this.$alert(data.msg || '保存失败', '错误', { + confirmButtonText: '确定' + }) + } + }).catch(error => { + console.error('保存派工单明细失败:', error) + this.$alert('保存失败,请稍后重试', '错误', { + confirmButtonText: '确定' + }) + }) }, @@ -2689,9 +2773,6 @@ return '' }, - - - onMaterialTypeChange(value) { // 清空相关字段 this.orderDetailData.orderNo = ''; @@ -2709,27 +2790,7 @@ this.orderDetailData.issureQty = 0; }, - - - - searchSOSRouting() { - // 调用API查询派工单信息 - this.$message.warning('正在查询派工单信息...'); - - getSOScheduledRoutingListForIssure(this.chooseSOSData).then(({data}) => { - if (data.code === 0) { - this.chooseSOSList = data.rows; - if (this.chooseSOSList.length === 0) { - this.$message.warning('未查询到符合条件的派工单'); - } - } else { - this.$message.error(data.msg || '查询失败'); - } - }).catch(error => { - console.error('查询派工单失败:', error); - this.$message.error('查询失败,请稍后重试'); - }); - }, +//派工单选择部分 openChooseSOSModal() { // 检查是否选择了主表行 if (!this.currentRow || !this.currentRow.notifyNo) { @@ -2739,37 +2800,77 @@ return false } + this.ss_totalPage= 0; + // 初始化选择派工单数据 this.chooseSOSData = { + page: 1, + limit: 100, site: this.currentRow.site, bu: this.currentRow.bu, - orderno: '', - seqno: '', + orderNo: '', + seqNo: '', sResourceid: '', startDate: this.dayjs().format('YYYY-MM-DD'), endDate: this.dayjs().format('YYYY-MM-DD'), } - // 清空选择列表 this.chooseSOSList = [] - // 打开选择模态框 this.chooseSOSModalFlag = true }, + searchSOSRouting() { + this.chooseSOSData.limit = this.ss_pageSize + this.chooseSOSData.page = this.ss_pageIndex + // 调用API查询派工单信息 + getSOScheduledRoutingListForIssureByPaging(this.chooseSOSData).then(({data}) => { + if (data.code === 0) { + this.chooseSOSList = data.page.list; + if (this.chooseSOSList.length === 0) { + this.$message.warning('未查询到符合条件的派工单'); + } + this.ss_pageIndex = data.page.currPage + this.ss_pageSize = data.page.pageSize + this.ss_totalPage = data.page.totalCount + } else { + // 清空选择列表 + this.chooseSOSList = [] + this.$message.error(data.msg || '查询失败'); + } + }).catch(error => { + // 清空选择列表 + this.chooseSOSList = [] + console.error('查询派工单失败:', error); + this.$message.error('查询失败,请稍后重试'); + }); + }, + // 每页数 工单分页信息 + ss_sizeChangeHandle(val) { + this.ss_pageSize = val + this.ss_pageIndex = 1 + this.searchSOSRouting() + }, + // 当前页 工单分页信息 + ss_currentChangeHandle(val) { + this.ss_pageIndex = val + this.searchSOSRouting() + }, chooseSOS(row) { // 关闭选择模态框 this.chooseSOSModalFlag = false // 将选择的数据填入到保存派工单模态框中 - this.orderDetailData.orderNo = row.orderno || row.orderNo || ''; - this.orderDetailData.seqNo = row.seqno || row.seqNo || ''; - this.orderDetailData.operationNo = row.operationNo || row.operation || ''; - this.orderDetailData.locationNo = row.sResourceid || row.locationNo || ''; - this.orderDetailData.qtyRequired = row.qtyrequired || row.qtyToIssue || ''; + this.orderDetailData.orderNo = row.orderno || ''; + this.orderDetailData.seqNo = row.seqno || ''; + this.orderDetailData.itemNo = row.itemno || ''; + this.orderDetailData.itemDesc = row.itemDesc || ''; + this.orderDetailData.resourceId = row.sResourceid || ''; + this.orderDetailData.resourceDesc = row.resourceDesc || ''; + this.orderDetailData.qtyRequired = row.qtyrequired || ''; this.orderDetailData.partDesc = row.partDesc || ''; - this.orderDetailData.partNo = row.partNo || row.fGPartNo || ''; - this.orderDetailData.workCenterNo = row.workCenterNo || ''; - this.orderDetailData.needDate = row.startDate || this.dayjs().format('YYYY-MM-DD HH:mm:ss'); + this.orderDetailData.partNo = row.partNo || ''; + this.orderDetailData.workCenterNo = row.sWorkcenterno || ''; + this.orderDetailData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm:ss'); // 根据物料类型设置 if (row.issueType === '非BOM物料') { @@ -2792,7 +2893,7 @@ }) return false } - + this.co_totalPage= 0; // 初始化选择工单数据 this.chooseOrderData = { page: 1, @@ -2881,7 +2982,8 @@ // 清空选择列表 this.chooseOperationList = [] - + // + this.searchOperation(); // 打开选择模态框 this.chooseOperationModalFlag = true }, @@ -2939,7 +3041,7 @@ // 清空选择列表 this.chooseResourceList = [] - + this.searchResource(); // 打开选择模态框 this.chooseResourceModalFlag = true }, @@ -3000,26 +3102,46 @@ // 打开选择模态框 this.choosePartModalFlag = true + this.searchPartModel() }, // 查询物料信息 searchPartModel() { + this.choosePartData.limit = this.pp_pageSize + this.choosePartData.page = this.pp_pageIndex // 调用API查询物料信息 - this.$message.warning('正在查询物料信息...'); - - getPartList(this.choosePartData).then(({data}) => { + getPartListByPaging(this.choosePartData).then(({data}) => { if (data.code === 0) { - this.choosePartList = data.rows; + this.choosePartList = data.page.list; if (this.choosePartList.length === 0) { this.$message.warning('未查询到符合条件的物料'); } + this.pp_pageIndex = data.page.currPage + this.pp_pageSize = data.page.pageSize + this.pp_totalPage = data.page.totalCount } else { + // 清空选择列表 + this.choosePartList = [] this.$message.error(data.msg || '查询失败'); } }).catch(error => { + // 清空选择列表 + this.choosePartList = [] console.error('查询物料失败:', error); this.$message.error('查询失败,请稍后重试'); }); }, + + // 每页数 工单分页信息 + pp_sizeChangeHandle(val) { + this.pp_pageSize = val + this.pp_pageIndex = 1 + this.searchPartModel() + }, + // 当前页 工单分页信息 + pp_currentChangeHandle(val) { + this.pp_pageIndex = val + this.searchPartModel() + }, // 选择物料 choosePart(row) { // 关闭选择模态框