|
|
@ -1322,9 +1322,43 @@ |
|
|
if (this.modalData.flag === '1') { // 新增 |
|
|
if (this.modalData.flag === '1') { // 新增 |
|
|
saveOutboundNotification(this.modalData).then(({data}) => { |
|
|
saveOutboundNotification(this.modalData).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.getDataList() |
|
|
|
|
|
|
|
|
const newOrderNo = data.orderNo // 获取新创建的单据号 |
|
|
this.modalFlag = false |
|
|
this.modalFlag = false |
|
|
this.$message.success('操作成功') |
|
|
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 { |
|
|
} else { |
|
|
this.$message.error(data.msg) |
|
|
this.$message.error(data.msg) |
|
|
} |
|
|
} |
|
|
|