Commit d49f01a7 by wusiyi

feat: 工厂订单new新增全部tab下的状态筛选 #1006853

parent ff5bc346
......@@ -6,6 +6,7 @@ export interface StatusTreeNode {
}
export interface SearchForm {
status?: string
platform?: string
craftCode?: string | string[]
thirdSkuCode?: string
......
......@@ -6,6 +6,7 @@ export interface StatusTreeNode {
}
export interface SearchForm {
status?: string
platform?: string
craftCode?: string | string[]
thirdSkuCode?: string
......
......@@ -49,6 +49,23 @@
:inline="true"
label-width="70px"
>
<ElFormItem v-if="status === 'ALL'" label="状态">
<ElTreeSelect
v-model="searchForm.status"
:data="statusTreeChildren"
:props="{
value: 'status',
label: 'statusName',
children: 'children',
}"
node-key="status"
placeholder="请选择"
clearable
filterable
check-strictly
style="width: 140px"
/>
</ElFormItem>
<ElFormItem label="平台">
<ElSelect
v-model="searchForm.platform"
......@@ -673,8 +690,8 @@
<div v-if="isCardLayout" :key="status" class="card-content">
<CardLayout
ref="cardLayoutRef"
:status="status"
:query-payload="getQueryPayload()"
:status="listQueryStatus"
:query-payload="getListQueryPayload()"
@selection-change="handleCardSelectionChange"
@view-detail="handleViewDetail"
/>
......@@ -1093,11 +1110,41 @@ const {
onClearTableState: () => {},
onRefreshCurrentView: () => {},
})
// 查询状态树
const statusTreeChildren = computed(() => {
const tree = statusTree.value?.[0]?.children
if (!tree) return []
tree.forEach((item) => {
if (item.status === 'PICKING') item.children = []
})
return tree.filter(
(item) =>
item.status !== 'AWAITING_RESTOCK' && item.status !== 'BATCH_MANAGE',
)
})
getFactoryOrderSearchVisibilityContext = () => ({
status: status.value,
status: searchForm.value.status ?? status.value,
isCardLayout: isCardLayout.value,
})
// 全部状态下列表/导出请求status参数
const listQueryStatus = computed(() => {
if (status.value === 'ALL' && searchForm.value.status) {
return searchForm.value.status
}
return status.value
})
const getListQueryPayload = () => {
const payload = { ...getQueryPayload() }
if (status.value === 'ALL' && searchForm.value.status) {
payload.status = searchForm.value.status
} else {
delete payload.status
}
return payload
}
const {
subLoading,
activeTab,
......@@ -1123,10 +1170,10 @@ const {
handleTabClick,
handleMainTableSortChange,
} = useOrderListAndDetail({
status,
status: listQueryStatus,
isCardLayout,
isTableLayout,
getQueryPayload,
getQueryPayload: getListQueryPayload,
getListPageAcceptedSubStatus,
suspendedSubTab,
})
......@@ -1171,7 +1218,7 @@ const submitExportForm = async () => {
try {
await exportFactoryOrderInfo({
...params,
...(resourceType === 2 ? getQueryPayload() : {}),
...(resourceType === 2 ? getListQueryPayload() : {}),
} as ExportParams)
ElMessage.success('请求成功,请稍后到右上角[我的下载]中查看')
exportVisible.value = false
......
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