mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
improve order display
This commit is contained in:
@@ -8,12 +8,14 @@ import { objectsToCSV } from '@/Utils'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { format } from 'date-fns'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { List } from 'linqts'
|
||||
import { NButton, NCard, NCheckbox, NDivider, NEmpty, NFlex, NSelect, NSpin, useMessage } from 'naive-ui'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
|
||||
type OrderFilterSettings = {
|
||||
type?: GoodsTypes
|
||||
status?: PointOrderStatus
|
||||
customer?: number
|
||||
onlyRequireShippingInfo: boolean
|
||||
}
|
||||
|
||||
@@ -34,6 +36,7 @@ const filteredOrders = computed(() => {
|
||||
if (filterSettings.value.type != undefined && o.type !== filterSettings.value.type) return false
|
||||
if (filterSettings.value.status != undefined && o.status !== filterSettings.value.status) return false
|
||||
if (filterSettings.value.onlyRequireShippingInfo && o.trackingNumber) return false
|
||||
if (filterSettings.value.customer && o.customer.userId != filterSettings.value.customer) return false
|
||||
return true
|
||||
})
|
||||
})
|
||||
@@ -142,6 +145,19 @@ onMounted(async () => {
|
||||
clearable
|
||||
style="width: 150px"
|
||||
/>
|
||||
|
||||
<NSelect
|
||||
v-model:value="filterSettings.customer"
|
||||
:options="
|
||||
new List(orders)
|
||||
.DistinctBy((s) => s.customer.userId)
|
||||
.Select((s) => ({ label: s.customer.name, value: s.customer.userId }))
|
||||
.ToArray()
|
||||
"
|
||||
placeholder="用户"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
/>
|
||||
<NCheckbox v-model:checked="filterSettings.onlyRequireShippingInfo" label="仅包含未填写快递单号的订单" />
|
||||
</NFlex>
|
||||
</NCard>
|
||||
|
||||
Reference in New Issue
Block a user