From 8522657df37745eb6b6cc10651e8a7475cbad818 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 10 Oct 2025 10:08:27 +0800 Subject: [PATCH] =?UTF-8?q?2025-10-10=20=E9=A2=86=E6=96=99=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=AE=A1=E7=90=86=E7=9A=84=E6=9D=90=E6=96=99=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../soIssueNotify/searchIssureNotify.vue | 283 +++++++++++++++++- 1 file changed, 277 insertions(+), 6 deletions(-) diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue index b22ec15..70170e5 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue @@ -176,6 +176,7 @@ 批量编辑 + 新增 批量保存 - {{scope.row[scope.column.property]}} + {{calculateQtyToIssue(scope.row)}} @@ -934,6 +935,56 @@ + + + + + 材料 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 取消 + + + + @@ -973,9 +1024,13 @@ import { getOutboundDetail2, // 获取出库明细 } from "@/api/qc/outbound_notification.js" + import Chooselist from '@/views/modules/common/Chooselist_eam' + import {verifyData} from "@/api/chooselist/chooselist.js" export default { - + components: { + Chooselist, + }, data() { return { height:200, @@ -996,6 +1051,21 @@ username:this.$store.state.user.name, }, closeModalFlag:false, + addMaterialModalFlag: false, + newMaterialData: { + componentPartNo: '', + partDesc: '', + issueType: '替代料', + orderNo: '', + itemNo: '', + remark: '', + componentScrap: 0, + firstInspectionQty: 0, + standardDosage: 0, + bomSeqNo: '', + warehouseId: '' + }, + orderOptions: [], searchData: { page: 1, limit: 100, @@ -1494,6 +1564,57 @@ status: true, fixed: '', columnWidth: 80 + },{ + userId: this.$store.state.user.name, + functionId: 701002, + serialNumber: '701002Table3ComponentScrap', + tableId: "701002Table3", + tableName: "申请单材料明细表", + columnProp: "componentScrap", + headerAlign: "center", + align: "right", + columnLabel: "调机量", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + },{ + userId: this.$store.state.user.name, + functionId: 701002, + serialNumber: '701002Table3FirstInspectionQty', + tableId: "701002Table3", + tableName: "申请单材料明细表", + columnProp: "firstInspectionQty", + headerAlign: "center", + align: "right", + columnLabel: "首检量", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + },{ + userId: this.$store.state.user.name, + functionId: 701002, + serialNumber: '701002Table3StandardDosage', + tableId: "701002Table3", + tableName: "申请单材料明细表", + columnProp: "standardDosage", + headerAlign: "center", + align: "right", + columnLabel: "标准用量", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, @@ -1596,7 +1717,6 @@ status: true, fixed: '', columnWidth: 80 - }, ], columnList4:[ @@ -2595,7 +2715,6 @@ //区分请求成功和失败的状况 if (data && data.code == 0) { this.dataList3 = data.rows - } else { this.dataList3 = []; } @@ -2814,7 +2933,7 @@ }, -//申请单主表新增方法 + //申请单主表新增方法 //新增领料申请单模态框 createNotifyModal(){ let inData={ @@ -3425,11 +3544,13 @@ this.pp_pageIndex = 1 this.searchPartModel() }, + // 当前页 工单分页信息 pp_currentChangeHandle(val) { this.pp_pageIndex = val this.searchPartModel() }, + // 选择物料 choosePart(row) { // 关闭选择模态框 @@ -3442,7 +3563,8 @@ this.$message.success('选择物料成功,数据已填入表单'); }, -//下达申请单方法 + + //下达申请单方法 async xiadaNotifyModel(row){ // 设置当前行为要下达的行 this.currentRow = JSON.parse(JSON.stringify(row)); @@ -3546,6 +3668,155 @@ } return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中'; }, + + // 计算申请数量 + calculateQtyToIssue(row) { + const componentScrap = parseFloat(row.componentScrap) || 0; + const firstInspectionQty = parseFloat(row.firstInspectionQty) || 0; + const standardDosage = parseFloat(row.standardDosage) || 0; + return (componentScrap + firstInspectionQty + standardDosage).toFixed(2); + }, + + // 打开新增材料模态框 + addMaterialModal() { + if (!this.currentRow || !this.currentRow.notifyNo) { + this.$alert('请先选择一条主表记录!', '提示', { + confirmButtonText: '确定' + }); + return false; + } + + if (!this.isEditableStatus()) { + this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能新增材料。', '提示', { + confirmButtonText: '确定' + }); + return false; + } + + // 重置表单数据 + this.newMaterialData = { + componentPartNo: '', + partDesc: '', + issueType: '替代料', + orderNo: '', + itemNo: '', // 申请单序号,将在选择生产订单时自动填充 + remark: '', + componentScrap: 0, + firstInspectionQty: 0, + standardDosage: 0, + bomSeqNo: '', + warehouseId: '' + }; + // 加载生产订单选项 + this.loadOrderOptions(); + this.addMaterialModalFlag = true; + }, + + // 加载生产订单选项 + loadOrderOptions() { + // 从申请单明细中获取生产订单列表 + this.orderOptions = this.dataList2.map(item => ({ + orderNo: item.sOOrderNo, + itemNo: item.itemNo // 添加申请单序号 + })); + }, + + // 生产订单选择变化时的处理 + onOrderNoChange(selectedOrderNo) { + if (selectedOrderNo) { + // 根据选择的生产订单,从申请单明细中找到对应的申请单序号 + const selectedOrder = this.dataList2.find(item => item.sOOrderNo === selectedOrderNo); + if (selectedOrder) { + this.newMaterialData.itemNo = selectedOrder.itemNo; + } + } else { + this.newMaterialData.itemNo = ''; + } + }, + + // 保存新增材料 + saveNewMaterial() { + // 验证必填字段 + if (!this.newMaterialData.componentPartNo) { + this.$message.error('请选择材料编码') + return; + } + if (!this.newMaterialData.orderNo) { + this.$message.error('请选择生产订单') + return; + } + + // 计算申请数量 + const qtyToIssue = this.calculateQtyToIssue(this.newMaterialData) + + // 构建保存数据 + const saveData = { + ...this.newMaterialData, + site: this.currentRow.site, + notifyNo: this.currentRow.notifyNo, + qtyToIssue: qtyToIssue, + } + saveSOIssueNotifyOrderMateria(saveData).then(({data}) => { + if (data && data.code === 0) { + // 刷新材料明细列表 + this.getNotifyMaterialList(); + this.addMaterialModalFlag = false + this.$message.success('操作成功') + } else { + this.$message.error(data.msg) + } + }) + }, + + // 获取下一个申请单序号 + getNextItemNo() { + if (this.dataList3.length === 0) { + return 1; + } + const maxItemNo = Math.max(...this.dataList3.map(item => item.itemNo || 0)); + return maxItemNo + 1; + }, + + // 获取基础数据列表S + getBaseList (val, type) { + this.tagNo = val + this.tagType = type + this.$nextTick(() => { + let strVal = '' + if (val === 508) { + strVal = this.newMaterialData.componentPartNo + this.$refs.baseList.init(val, strVal) + } + }) + }, + + // 列表方法的回调 + getBaseData (val) { + if (this.tagNo === 508) { + this.newMaterialData.componentPartNo = val.PartNo + this.newMaterialData.partDesc = val.PartDescription + this.newMaterialData.warehouseId = val.outbound_warehouse_id + } + }, + + // 输入校验 + partBlur (tagNo) { + let tempData = { + tagno: tagNo, + conditionSql: " and PartNo = '" + this.newMaterialData.componentPartNo + "'" + " and site = '" + this.newMaterialData.site + "'" + } + verifyData(tempData).then(({data}) => { + if (data && data.code === 0) { + if (data.baseListData.length > 0) { + this.newMaterialData.componentPartNo = data.baseListData[0].PartNo + this.newMaterialData.partDesc = data.baseListData[0].PartDescription + } else { + this.newMaterialData.partDesc = '' + } + } + }) + }, + }, }