From 84f8b7a48716f70f9db306d0268211dc62234107 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 21 Jan 2026 09:38:15 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-21=20=E9=A2=86=E6=96=99=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=AE=A1=E7=90=86=E3=80=81=E6=94=B6=E8=B4=A7=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5=E3=80=81=E6=8B=A3?= =?UTF-8?q?=E8=B4=A7=E5=87=BA=E5=BA=93=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=9C=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=90=8E=E8=A6=81=E8=87=AA=E5=8A=A8=E6=9F=A5=E5=87=BA?= =?UTF-8?q?=E5=B9=B6=E5=AE=9A=E4=BD=8D=E5=88=B0=E8=BF=99=E4=B8=AA=E6=96=B0?= =?UTF-8?q?=E5=8D=95=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../soIssueNotify/searchIssureNotify.vue | 19 ++++++++-- src/views/modules/qc/inboundNotification.vue | 36 ++++++++++++++++++- src/views/modules/qc/outboundNotification.vue | 36 ++++++++++++++++++- 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue index 08b0b0b..eeaed5e 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue @@ -3139,6 +3139,7 @@ } createNotify(inData).then(({data})=>{ if (data.code === 0) { + const newNotifyNo = data.notifyNo // 获取新创建的单据号 this.$message({ message: '操作成功', type: 'success', @@ -3146,8 +3147,22 @@ onClose: () => {} }) this.createNotifyFlag = false - // 刷新主表数据 - this.searchTable() + // 清空搜索条件中的单据号,设置为新单据号以便精确查询 + this.searchData.notifyNo = newNotifyNo + // 刷新主表数据并定位到新单据 + this.searchTable().then(() => { + const foundRow = this.dataList.find(item => item.notifyNo === newNotifyNo) + if (foundRow) { + this.currentRow = JSON.parse(JSON.stringify(foundRow)) + this.$nextTick(() => { + this.$refs.mainTable.setCurrentRow(foundRow) + // 刷新子表数据 + this.refreshCurrentTabTable() + }) + } + // 清空搜索条件中的单据号,恢复正常查询 + this.searchData.notifyNo = '' + }) }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/inboundNotification.vue b/src/views/modules/qc/inboundNotification.vue index 615038b..52c097b 100644 --- a/src/views/modules/qc/inboundNotification.vue +++ b/src/views/modules/qc/inboundNotification.vue @@ -1388,9 +1388,43 @@ if (this.modalData.flag === '1') { // 新增 saveInboundNotification(this.modalData).then(({data}) => { if (data && data.code === 0) { - this.getDataList() + const newOrderNo = data.orderNo // 获取新创建的单据号 this.modalFlag = false this.$message.success('操作成功') + // 清空搜索条件,设置为新单据号以便精确查询 + this.searchData.orderNo = newOrderNo + this.searchData.orderStatusList = [] // 清空状态筛选以确保能找到新单据 + // 刷新列表并定位到新单据 + this.searchData.limit = this.pageSize + this.searchData.page = 1 + this.pageIndex = 1 + this.searchData.orderStatus = '' + this.searchLoading = true + searchInboundNotification(this.searchData).then(({data: listData}) => { + if (listData.code === 0) { + this.dataList = listData.page.list + this.pageIndex = listData.page.currPage + this.pageSize = listData.page.pageSize + this.totalPage = listData.page.totalCount + // 找到新创建的单据并定位 + const foundRow = this.dataList.find(item => item.orderNo === newOrderNo) + if (foundRow) { + this.currentRow = JSON.parse(JSON.stringify(foundRow)) + this.$nextTick(() => { + this.$refs.inboundTable.setCurrentRow(foundRow) + this.refreshCurrentTabTable() + }) + } else if (this.dataList.length > 0) { + this.$refs.inboundTable.setCurrentRow(this.dataList[0]) + this.inboundClickRow(this.dataList[0]) + } + } + // 恢复搜索条件 + this.searchData.orderNo = '' + this.searchData.orderStatusList = ['草稿'] + }).finally(() => { + this.searchLoading = false + }) } else { this.$message.error(data.msg) } diff --git a/src/views/modules/qc/outboundNotification.vue b/src/views/modules/qc/outboundNotification.vue index 2cfcb31..e2f0a76 100644 --- a/src/views/modules/qc/outboundNotification.vue +++ b/src/views/modules/qc/outboundNotification.vue @@ -1322,9 +1322,43 @@ if (this.modalData.flag === '1') { // 新增 saveOutboundNotification(this.modalData).then(({data}) => { if (data && data.code === 0) { - this.getDataList() + const newOrderNo = data.orderNo // 获取新创建的单据号 this.modalFlag = false this.$message.success('操作成功') + // 清空搜索条件,设置为新单据号以便精确查询 + this.searchData.orderNo = newOrderNo + this.searchData.orderStatusList = [] // 清空状态筛选以确保能找到新单据 + // 刷新列表并定位到新单据 + this.searchData.limit = this.pageSize + this.searchData.page = 1 + this.pageIndex = 1 + this.searchData.orderStatus = '' + this.searchLoading = true + searchOutboundNotification(this.searchData).then(({data: listData}) => { + if (listData.code === 0) { + this.dataList = listData.page.list + this.pageIndex = listData.page.currPage + this.pageSize = listData.page.pageSize + this.totalPage = listData.page.totalCount + // 找到新创建的单据并定位 + const foundRow = this.dataList.find(item => item.orderNo === newOrderNo) + if (foundRow) { + this.currentRow = JSON.parse(JSON.stringify(foundRow)) + this.$nextTick(() => { + this.$refs.outboundTable.setCurrentRow(foundRow) + this.refreshCurrentTabTable() + }) + } else if (this.dataList.length > 0) { + this.$refs.outboundTable.setCurrentRow(this.dataList[0]) + this.inboundClickRow(this.dataList[0]) + } + } + // 恢复搜索条件 + this.searchData.orderNo = '' + this.searchData.orderStatusList = ['草稿'] + }).finally(() => { + this.searchLoading = false + }) } else { this.$message.error(data.msg) }