feat(client): show actionable customs count on sidebar
This commit is contained in:
@@ -46,6 +46,7 @@ function harness(t, orders, getDetail = async id => detail(id)) {
|
||||
vue: { ...vue, onMounted() {} },
|
||||
'../utils/customsDocumentsReader': reader,
|
||||
'../api/customs': customsApi,
|
||||
'../store/customsPending': { useCustomsPendingStore: () => ({ refresh: async () => {} }) },
|
||||
}))
|
||||
t.after(() => scope.stop())
|
||||
return { view, store, calls, pageCalls }
|
||||
|
||||
@@ -8,6 +8,9 @@ import { MERCHANT_CUSTOMS_STATUS_LABELS, type MerchantCustomsContainer } from '.
|
||||
import { readCustomsDocuments, type CustomsDocumentRow } from '../utils/customsDocumentsReader'
|
||||
import CustomsDocumentsDialog from '../components/CustomsDocumentsDialog.vue'
|
||||
|
||||
import { useCustomsPendingStore } from '../store/customsPending'
|
||||
|
||||
const customsPending = useCustomsPendingStore()
|
||||
const loading = ref(false)
|
||||
const errorMessage = ref('')
|
||||
const queryModel = ref<QueryModel>({ orderNo: '', inboundCode: '', containerNo: '', status: '' })
|
||||
@@ -68,6 +71,7 @@ function statusType(detail: MerchantCustomsContainer) {
|
||||
}
|
||||
async function load() {
|
||||
if (loading.value) return
|
||||
void customsPending.refresh(true)
|
||||
loading.value = true; errorMessage.value = ''
|
||||
try {
|
||||
const { records: loadedRecords, failedCount } = await readCustomsDocuments()
|
||||
|
||||
Reference in New Issue
Block a user