Commit 64ec0e9e by qinjianhui

feat: 获取订单详细信息bug修改

parent a6517e1c
......@@ -95,7 +95,7 @@ export function cancelOrderWithReasonApi(
reason: string,
) {
return axios.post<never, BaseRespData<void>>('factory/podOrder/cancelOrders', {
ids,
podOrderIds:ids,
reason,
})
}
......
......@@ -706,14 +706,14 @@
<template #top>
<div class="table-list flex-1 overflow-hidden">
<TableView
ref="mainTableRef"
ref="tableRef"
highlight-current-row
:paginated-data="tableData"
:columns="mainColumns"
serial-numberable
selectionable
@selection-change="handleMainSelectionChange"
@row-click="handleMainRowClick"
@row-click="handleRowClick"
/>
</div>
<ElPagination
......@@ -732,7 +732,7 @@
<el-tabs
v-model="activeTab"
class="tabs-wrapper"
@tab-click="handleSubTabClick"
@tab-click="handleTabClick"
>
<el-tab-pane name="product" label="包含商品">
<div class="sub-table-wrapper">
......@@ -1062,12 +1062,11 @@ const pickerOptions = {
const activeTab = ref<'product' | 'log'>('product')
const productList = ref<ProductListData[]>([])
const currentRow = ref<FactoryOrderNewListData | null>(null)
const skipCurrentRowWatch = ref(false)
const selectedRowIds = ref<(number | string)[]>([])
const selectedRows = ref<FactoryOrderNewListData[]>([])
const cardSelectedIds = ref<(number | string)[]>([])
const logList = ref<LogListData[]>([])
const mainTableRef = ref()
const tableRef = ref()
const mainColumns = [
{
prop: 'factoryOrderNumber',
......@@ -1261,7 +1260,7 @@ const {
).then(async (res) => {
const { records } = res.data
await nextTick(() => {
mainTableRef.value.setCurrentRow(records[0])
tableRef.value.setCurrentRow(records[0])
currentRow.value = (records as never)[0]
})
return res.data
......@@ -1275,7 +1274,7 @@ const {
).then(async (res) => {
const { records } = res.data
await nextTick(() => {
mainTableRef.value.setCurrentRow(records[0])
tableRef.value.setCurrentRow(records[0])
currentRow.value = (records as never)[0]
})
return res.data
......@@ -1325,6 +1324,8 @@ const refreshCurrentView = () => {
return
}
refreshTableList()
// 刷新左侧状态数
loadStatusTreeCounts()
}
const handleStatusNodeClick = (node: StatusTreeNode) => {
if (status.value === node.status) return
......@@ -1368,7 +1369,7 @@ const handleMainSelectionChange = (rows: FactoryOrderNewListData[]) => {
const handleCardSelectionChange = (items: { id: number | string }[]) => {
cardSelectedIds.value = items.map((i) => i.id)
}
const loadSubTables = async (tabName?: 'product' | 'log') => {
const getOrderDetailsById = async (tabName?: 'product' | 'log') => {
if (!currentRow.value) {
productList.value = []
logList.value = []
......@@ -1384,7 +1385,6 @@ const loadSubTables = async (tabName?: 'product' | 'log') => {
? await getSuspendDetailApi(id)
: await getFactoryOrderNewDetailApi(id)
productList.value = productRes.data || []
return
} else {
logList.value = []
const logRes = isSuspend
......@@ -1399,24 +1399,21 @@ const loadSubTables = async (tabName?: 'product' | 'log') => {
watch(currentRow, (row) => {
if (!row) return
if (!isTableLayout.value) return
if (skipCurrentRowWatch.value) {
skipCurrentRowWatch.value = false
return
}
void loadSubTables()
void getOrderDetailsById()
})
const handleMainRowClick = (row: FactoryOrderNewListData) => {
skipCurrentRowWatch.value = true
const handleRowClick = (row: FactoryOrderNewListData) => {
currentRow.value = row
productList.value = []
logList.value = []
void loadSubTables()
selectedRowIds.value = []
selectedRows.value = []
cardSelectedIds.value = []
}
const handleSubTabClick = (tab: TabsPaneContext) => {
const handleTabClick = (tab: TabsPaneContext) => {
if (!currentRow.value) return
const name = tab?.props?.name as 'product' | 'log' | undefined
void loadSubTables(name)
void getOrderDetailsById(name)
}
const handleConfirmOrder = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment