Commit 64ec0e9e by qinjianhui

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

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