新增:订单导出功能

This commit is contained in:
2025-04-22 11:20:29 +08:00
parent 90c79c16cb
commit 87caf654cc
2 changed files with 91 additions and 9 deletions
@@ -86,14 +86,11 @@
/>
<a-button @click="reset">重置</a-button>
<a-button @click="setHasInvoice" :disabled="!selection?.length"
>设置已开票</a-button
>
<!-- <a-button class="ele-btn-icon" :disabled="loading" @click="handleExport">-->
<!-- <template #icon>-->
<!-- <download-outlined />-->
<!-- </template>-->
<!-- <span>导出订单</span>-->
<!-- </a-button>-->
>设置已开票
</a-button>
<a-button class="ele-btn-icon" @click="handleExport">
<span>导出订单</span>
</a-button>
</a-space>
</template>
@@ -126,6 +123,7 @@
(e: 'add'): void;
(e: 'remove'): void;
(e: 'advanced'): void;
(e: 'export'): void;
}>();
// 表单数据
@@ -175,8 +173,21 @@
search();
};
const handleExport = () => {
const [d1, d2] = dateRange.value ?? [];
xlsFileName.value = `${d1}至${d2}`;
where.forAdmin = true;
where.limit = 5000;
where.page = 1;
where.timeStart = d1 ? dayjs(d1).valueOf() / 1000 : undefined;
where.timeEnd = d2 ? dayjs(d2).valueOf() / 1000 : undefined;
emit('export', {
...where
});
};
// 导出
const handleExport = async () => {
const handleExport2 = async () => {
loading.value = true;
const array: (string | number)[][] = [
[