From d741a10af8b2144e163b9a6988d34a8537b81417 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 26 Nov 2025 16:17:32 +0800 Subject: [PATCH] =?UTF-8?q?2025-11-25=20=E9=A2=86=E6=96=99=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=AE=A1=E7=90=86=201=E3=80=81=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=EF=BC=9A=E5=BE=85=E7=A1=AE=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=AD=9B=E9=80=89=E4=B8=AD=E4=B9=9F=E9=9C=80?= =?UTF-8?q?=E8=A6=81=20=20=201.1=20=E8=8D=89=E7=A8=BF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=82=B9=E5=87=BB"=E6=8F=90=E4=BA=A4"=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E7=8A=B6=E6=80=81=E6=94=B9=E4=B8=BA=E5=BE=85=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=20=20=201.2=20=E5=BE=85=E7=A1=AE=E8=AE=A4=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=82=B9=E5=87=BB"=E4=B8=8B=E8=BE=BE"=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E7=8A=B6=E6=80=81=E6=94=B9=E4=B8=BA=E5=BE=85?= =?UTF-8?q?=E5=87=BA=E5=BA=93=202=E3=80=81=E4=B8=BB=E8=A1=A8SOIssueNotifyH?= =?UTF-8?q?eader=E5=A2=9E=E5=8A=A0=E8=BD=A6=E9=97=B4=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=88=B0work=5Fcenter=5Fno=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E6=9F=A5=E8=AF=A2=E5=92=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E5=B1=95=E7=A4=BA=E8=AF=A5=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E9=9D=9E=E5=BF=85=E5=A1=AB=203=E3=80=81=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=8E=92=E5=BA=8F=E6=8C=89=E7=85=A7=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=80=92=E6=8E=92desc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/orderIssure/soIssueNotify.js | 3 +- .../soIssueNotify/searchIssureNotify.vue | 173 +++++++++++++----- 2 files changed, 131 insertions(+), 45 deletions(-) diff --git a/src/api/orderIssure/soIssueNotify.js b/src/api/orderIssure/soIssueNotify.js index 2c7daf6..6eeab13 100644 --- a/src/api/orderIssure/soIssueNotify.js +++ b/src/api/orderIssure/soIssueNotify.js @@ -55,4 +55,5 @@ export const updateNotifyDetail = data => createAPI(`/orderIssure/issureNotify/u export const saveSOIssueNotifyOrderMateria = data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderMateria`,'post',data) -export const getBomAlternativeParts = data => createAPI(`/orderIssure/issureNotify/getBomAlternativeParts`,'post',data) \ No newline at end of file +export const getBomAlternativeParts = data => createAPI(`/orderIssure/issureNotify/getBomAlternativeParts`,'post',data) +export const getWorkCenterList = data => createAPI(`/orderIssure/issureNotify/getWorkCenterList`,'post',data) diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue index 82ca429..c73d959 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue @@ -11,6 +11,7 @@ + @@ -104,13 +105,16 @@ @@ -129,7 +133,7 @@ - {{'新增'}} + {{'新增'}} - - + - - - + + + + + + + + + + + - + + + - + 保存 关闭 @@ -1060,7 +1081,8 @@ , deleteNotify, updateNotifyDetail, saveSOIssueNotifyOrderMateria, - getBomAlternativeParts + getBomAlternativeParts, + getWorkCenterList } from "@/api/orderIssure/soIssueNotify.js" import { searchShopOrderByPaging @@ -1096,6 +1118,7 @@ dataList5: [], dataList6: [], userBuList:[], + workCenterList: [], createNotifyFlag: false, saveOrderDetailFlag: false, closeData:{ @@ -1148,6 +1171,7 @@ userDisplay: '', remark: '', planIssueDate: '', + workCenterNo: '' }, pageIndex: 1, pageSize: 100, @@ -2556,7 +2580,7 @@ if (!this.currentRow || !this.currentRow.status) { return false; } - return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中'; + return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认'; } }, mounted () { @@ -2566,6 +2590,7 @@ }, created () { + this.getSiteAndBuByUserName() this.searchTable() }, @@ -2573,7 +2598,7 @@ // 批量编辑模态框 editBatchModel() { - if (this.currentRow.status !== '草稿' && this.currentRow.status !== '编辑中') { + if (this.currentRow.status !== '草稿' && this.currentRow.status !== '编辑中' && this.currentRow.status !== '待确认') { this.$message.warning('该类型单据不能编辑!') return } @@ -2927,7 +2952,7 @@ deleteNotifySOSPlus(row){ // 检查当前状态是否允许编辑 if (!this.isEditableStatusComputed) { - this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能删除明细。', '提示', { + this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能删除明细。', '提示', { confirmButtonText: '确定' }) return false @@ -2956,34 +2981,62 @@ }) }, - //申请单主表新增方法 //新增领料申请单模态框 createNotifyModal(){ - let inData={ - username:this.$store.state.user.name + this.notifyData = { + site: '', + bu: this.userBuList[0].buNo, + notifyNo: '', + notifyDate: '', + enteredDate: '', + userName: this.$store.state.user.name, + userDisplay: '', + remark: '', + planIssueDate: '', + workCenterNo: '' + } + this.createNotifyFlag = true + }, + + getSiteAndBuByUserName() { + let inData = { + username: this.$store.state.user.name } getSiteAndBuByUserName(inData).then(({data}) =>{ if (data && data.code === 0) { - this.userBuList=data.rows + this.userBuList = data.rows if (this.userBuList.length > 0) { - this.notifyData.bu = this.userBuList[0].buNo + this.getWorkCenterList() } } }) - this.createNotifyFlag=true }, + + // 查加工中心 + getWorkCenterList() { + let inData = { + site: this.userBuList[0].buNo.split('_')[0], + buNo: this.userBuList[0].buNo.split('_')[1] + } + getWorkCenterList(inData).then(({data}) =>{ + if (data && data.code === 0) { + this.workCenterList = data.rows + } + }) + }, + //保存领料申请单 - saveNotify(){ + saveNotify() { let buValue = this.notifyData.bu let site = buValue.split('_')[0] let bu = buValue.split('_')[1] - - let inData={ + let inData = { site: site, bu: bu, - userName:this.$store.state.user.name, - remark: this.notifyData.remark + userName: this.$store.state.user.name, + remark: this.notifyData.remark, + workCenterNo: this.notifyData.workCenterNo, } createNotify(inData).then(({data})=>{ if (data.code === 0) { @@ -2996,18 +3049,6 @@ this.createNotifyFlag = false // 刷新主表数据 this.searchTable() - // 清空表单数据 - this.notifyData = { - site: '', - bu: '', - notifyNo: '', - notifyDate: '', - enteredDate: '', - userName: this.$store.state.user.name, - userDisplay: '', - remark: '', - planIssueDate: '', - } }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -3028,7 +3069,7 @@ // 检查当前状态是否允许编辑 if (!this.isEditableStatusComputed) { - this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能新增明细。', '提示', { + this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增明细。', '提示', { confirmButtonText: '确定' }) return false @@ -3596,6 +3637,50 @@ this.$message.success('选择物料成功,数据已填入表单'); }, + //提交申请单方法 + async submitNotifyModel(row){ + // 设置当前行为要提交的行 + this.currentRow = JSON.parse(JSON.stringify(row)); + + // 先刷新子表数据,确保获取最新数据 + await this.refreshAllSubTables(); + + console.log('申请单明细数据:', this.dataList2); + console.log('材料明细数据:', this.dataList3); + + if(this.dataList2.length==0 || this.dataList3.length==0){ + this.$alert('没有明细记录无法提交!', '提示', { + confirmButtonText: '确定' + }) + return false + } + + // 调用更新状态接口,将状态改为"待确认" + let inData = { + site: row.site, + notifyNo: row.notifyNo, + status: '待确认', + } + updateNotifyStatus(inData).then(({data})=>{ + if (data.code === 0) { + //刷新主表数据 + this.searchTable().then(() => { // 等刷新完成 + const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo); + if (foundRow) { + this.currentRow = JSON.parse(JSON.stringify(foundRow)); + this.$nextTick(() => { + this.$refs.mainTable.setCurrentRow(foundRow); + }); + } + }); + this.$message.success('提交成功') + }else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, //下达申请单方法 async xiadaNotifyModel(row){ // 设置当前行为要下达的行 @@ -3698,7 +3783,7 @@ if (!this.currentRow || !this.currentRow.status) { return false; } - return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中'; + return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认'; }, // 计算申请数量 @@ -3728,7 +3813,7 @@ } if (!this.isEditableStatus()) { - this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能新增材料。', '提示', { + this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增材料。', '提示', { confirmButtonText: '确定' }); return false;