订单增加状态搜索
This commit is contained in:
@@ -213,6 +213,7 @@ function submit(skipConfirm) {
|
||||
orderId: q.orderId || undefined,
|
||||
orgOrderId: q.orgOrderId || undefined,
|
||||
transferOrderId: q.transferOrderId || undefined,
|
||||
orderStatuses: Array.isArray(q.orderStatuses) && q.orderStatuses.length ? q.orderStatuses : undefined,
|
||||
batchSize: 100
|
||||
}).then(res => {
|
||||
const asyncTaskId = res.data?.asyncTaskId || res.data
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:search-columns="searchColumns"
|
||||
:default-params="defaultParams"
|
||||
:query="queryList"
|
||||
row-key="orderId"
|
||||
:auto-load="false"
|
||||
selection
|
||||
search-action-align="center"
|
||||
:search-per-row="4"
|
||||
:page-sizes="[100, 200, 300, 400]"
|
||||
:page-size="100"
|
||||
@@ -83,6 +83,31 @@
|
||||
<template #col-country="{ row }">
|
||||
{{ row.countryName || '-' }} ({{ row.country || '-' }})
|
||||
</template>
|
||||
<template #search-orderStatuses="{ model }">
|
||||
<el-select
|
||||
v-model="model.orderStatuses"
|
||||
multiple
|
||||
clearable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
>
|
||||
<template #header>
|
||||
<el-checkbox
|
||||
:model-value="isAllOrderStatusSelected(model)"
|
||||
:indeterminate="isOrderStatusIndeterminate(model)"
|
||||
@change="(checked) => toggleAllOrderStatus(model, checked)"
|
||||
>全选</el-checkbox>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="opt in orderStatusOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #col-orderStatus="{ row }">
|
||||
{{ orderStatusLabel(row.orderStatus) }}
|
||||
</template>
|
||||
@@ -130,6 +155,27 @@ const syncFloat = ref(null)
|
||||
/** 比对回填搜索模式:走专用转单号接口,不影响普通列表 */
|
||||
const transferFillMode = ref(false)
|
||||
|
||||
const orderStatusMap = {
|
||||
0: '预报订单',
|
||||
1: '确认订单',
|
||||
2: '已中转',
|
||||
3: '已收货',
|
||||
4: '已装箱',
|
||||
5: '已出库',
|
||||
6: '转运中',
|
||||
7: '已上网',
|
||||
8: '已签收',
|
||||
9: '已退件',
|
||||
10: '已删除',
|
||||
11: '已复核'
|
||||
}
|
||||
|
||||
const orderStatusOptions = Object.keys(orderStatusMap).map(k => ({ label: orderStatusMap[k], value: Number(k) }))
|
||||
|
||||
const defaultParams = {
|
||||
orderStatuses: [3, 4, 5, 6, 7, 8, 11]
|
||||
}
|
||||
|
||||
const searchColumns = [
|
||||
{
|
||||
// 客户名称或客户代码混合录入,一行一个
|
||||
@@ -164,7 +210,20 @@ const searchColumns = [
|
||||
clearable: true,
|
||||
defaultTime: [new Date(2000, 0, 1, 0, 0, 0), new Date(2000, 0, 1, 23, 59, 59)]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '订单状态',
|
||||
prop: 'orderStatuses',
|
||||
component: 'select',
|
||||
options: orderStatusOptions,
|
||||
placeholder: '请选择',
|
||||
props: {
|
||||
multiple: true,
|
||||
clearable: true,
|
||||
collapseTags: true,
|
||||
collapseTagsTooltip: true
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
const columns = [
|
||||
@@ -186,21 +245,6 @@ const columns = [
|
||||
// { label: '操作', prop: 'action', align: 'center', width: 120, fixed: 'right', slot: 'action', showInToolbar: false }
|
||||
]
|
||||
|
||||
const orderStatusMap = {
|
||||
0: '预报订单',
|
||||
1: '确认订单',
|
||||
2: '已中转',
|
||||
3: '已收货',
|
||||
4: '已装箱',
|
||||
5: '已出库',
|
||||
6: '转运中',
|
||||
7: '已上网',
|
||||
8: '已签收',
|
||||
9: '已退件',
|
||||
10: '已删除',
|
||||
11: '已复核'
|
||||
}
|
||||
|
||||
const syncFloatVisible = computed(() => {
|
||||
const p = syncFloat.value
|
||||
return !!(p && (p.loading || p.finished))
|
||||
@@ -220,6 +264,30 @@ const syncFloatSummary = computed(() => {
|
||||
})
|
||||
const syncFloatTooltip = computed(() => syncFloat.value?.message || '点击查看详情')
|
||||
|
||||
|
||||
const orderStatusAllValues = computed(() => orderStatusOptions.map(o => o.value))
|
||||
|
||||
function selectedOrderStatuses(model) {
|
||||
return Array.isArray(model?.orderStatuses) ? model.orderStatuses : []
|
||||
}
|
||||
|
||||
function isAllOrderStatusSelected(model) {
|
||||
const selected = selectedOrderStatuses(model)
|
||||
const all = orderStatusAllValues.value
|
||||
return all.length > 0 && selected.length === all.length
|
||||
}
|
||||
|
||||
function isOrderStatusIndeterminate(model) {
|
||||
const selected = selectedOrderStatuses(model)
|
||||
const all = orderStatusAllValues.value
|
||||
return selected.length > 0 && selected.length < all.length
|
||||
}
|
||||
|
||||
function toggleAllOrderStatus(model, checked) {
|
||||
if (!model) return
|
||||
model.orderStatuses = checked ? [...orderStatusAllValues.value] : []
|
||||
}
|
||||
|
||||
function orderStatusLabel(status) {
|
||||
if (status === null || status === undefined || status === '') return '-'
|
||||
const key = Number(status)
|
||||
|
||||
Reference in New Issue
Block a user