Files
lilishop-ui/manager/src/views/finance/payment-method.vue
lifenlong 88fc1b0b2a refactor: 四端完成 Options API → script setup + vuex → pinia 迁移
- buyer(95) / seller(169) / im(53) / manager(280) 共 597 个组件全部从 Options API 转换为 <script setup>
- 四端 vuex 全部移除,状态管理统一迁移至 pinia 4(stores/ 目录)
- util.js 等基础设施去除 vm 首参依赖;全局属性($Message/$filters 等)在 script 内改为具名导入
- 被外部 ref 访问的公共组件均已补齐 defineExpose(清单见各端 MIGRATION-VUE3.md)
- 各端 eslint 启用 vue/component-api-style 防止新代码回退 Options API
- 四端 yarn build 全部通过;迁移约定与注意事项已更新至各端 MIGRATION-VUE3.md
2026-10-13 07:06:59 +08:00

63 lines
1.9 KiB
Vue

<template>
<div class="search">
<el-card>
<el-form inline>
<el-form-item label="日期范围">
<el-date-picker v-model="dateRange" type="daterange" value-format="YYYY-MM-DD" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="loadData">查询</el-button>
<el-button @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="mt_10">
<el-table v-loading="loading" border :data="data">
<el-table-column prop="period" label="日期" width="120" />
<el-table-column prop="paymentName" label="支付方式" width="140" />
<el-table-column prop="payCount" label="支付笔数" width="100" />
<el-table-column prop="payAmount" label="支付金额" width="120" />
<el-table-column prop="refundCount" label="退款笔数" width="100" />
<el-table-column prop="refundAmount" label="退款金额" width="120" />
</el-table>
</el-card>
</div>
</template>
<script setup>
import { onMounted, ref } from "vue";
import * as API_Finance from "@/api/finance";
import { downloadBlob } from "@/utils/downloadBlob";
defineOptions({ name: "finance-payment-method" });
const loading = ref(false);
const dateRange = ref([]);
const data = ref([]);
onMounted(() => {
loadData();
});
function buildParams() {
const p = {};
if (dateRange.value?.length === 2) {
p.startDate = dateRange.value[0];
p.endDate = dateRange.value[1];
}
return p;
}
function loadData() {
loading.value = true;
API_Finance.getPaymentMethodReport(buildParams()).then((res) => {
loading.value = false;
if (res.success) data.value = res.result || [];
});
}
function handleExport() {
API_Finance.exportPaymentMethodReport(buildParams()).then((blob) => {
downloadBlob(blob, "支付方式汇总.xlsx");
});
}
</script>