mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-24 11:00:22 +08:00
优化财务相关功能
This commit is contained in:
@@ -109,11 +109,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
billStatusText(v) {
|
||||
const map = { OUT: "已出账", CHECK: "已对账", EXAMINE: "已审核", COMPLETE: "已付款" };
|
||||
const map = { OUT: "已出账", CHECK: "已对账", COMPLETE: "已付款" };
|
||||
return map[v] || "已付款";
|
||||
},
|
||||
billStatusTagType(v) {
|
||||
const map = { OUT: "primary", CHECK: "", EXAMINE: "warning", COMPLETE: "success" };
|
||||
const map = { OUT: "primary", CHECK: "warning", COMPLETE: "success" };
|
||||
return map[v] || "success";
|
||||
},
|
||||
init() {
|
||||
|
||||
@@ -436,11 +436,11 @@ export default {
|
||||
API_Shop.downloadBill(this.id)
|
||||
.then((res) => {
|
||||
const blob = new Blob([res], {
|
||||
type: "application/vnd.ms-excel;charset=utf-8",
|
||||
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
});
|
||||
if ("download" in document.createElement("a")) {
|
||||
const link = document.createElement("a");
|
||||
link.download = "结算单-" + this.id + ".xls";
|
||||
link.download = "结算单-" + this.id + ".xlsx";
|
||||
link.style.display = "none";
|
||||
link.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(link);
|
||||
@@ -448,7 +448,7 @@ export default {
|
||||
URL.revokeObjectURL(link.href);
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
navigator.msSaveBlob(blob, "结算单-" + this.id + ".xls");
|
||||
navigator.msSaveBlob(blob, "结算单-" + this.id + ".xlsx");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||
<el-button class="search-btn" @click="handleReset">重置</el-button>
|
||||
<el-button class="search-btn" @click="handleExport">导出列表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -59,7 +60,6 @@
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.billStatus === 'OUT'" type="primary">已出账</el-tag>
|
||||
<el-tag v-else-if="row.billStatus === 'CHECK'" type="info">已对账</el-tag>
|
||||
<el-tag v-else-if="row.billStatus === 'EXAMINE'" type="warning">已审核</el-tag>
|
||||
<el-tag v-else type="success">已付款</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -88,6 +88,8 @@
|
||||
|
||||
<script>
|
||||
import * as API_Shop from "@/api/shops";
|
||||
import * as API_Finance from "@/api/finance";
|
||||
import { downloadBlob } from "@/utils/downloadBlob";
|
||||
|
||||
export default {
|
||||
name: "storeBill",
|
||||
@@ -149,6 +151,12 @@ export default {
|
||||
query: { id: v.id },
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
const params = { ...this.searchForm };
|
||||
API_Finance.exportBillList(params).then((blob) => {
|
||||
downloadBlob(blob, "结算单列表.xlsx");
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
||||
71
seller/src/views/shop/finance/summary.vue
Normal file
71
seller/src/views/shop/finance/summary.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<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-button @click="exportFlow">导出流水</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="mt_10" v-if="summary">
|
||||
<el-descriptions title="本店周期汇总" :column="2" border>
|
||||
<el-descriptions-item label="店铺">{{ summary.storeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单实付">{{ summary.orderPrice }}</el-descriptions-item>
|
||||
<el-descriptions-item label="退款">{{ summary.refundPrice }}</el-descriptions-item>
|
||||
<el-descriptions-item label="平台服务费">{{ summary.commissionPrice }}</el-descriptions-item>
|
||||
<el-descriptions-item label="分销佣金">{{ summary.distributionCommission }}</el-descriptions-item>
|
||||
<el-descriptions-item label="券补贴">{{ summary.siteCouponCommission }}</el-descriptions-item>
|
||||
<el-descriptions-item label="礼品卡补贴">{{ summary.giftCardSubsidy }}</el-descriptions-item>
|
||||
<el-descriptions-item label="应结金额">{{ summary.billPrice }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Finance from "@/api/finance";
|
||||
import { downloadBlob } from "@/utils/downloadBlob";
|
||||
|
||||
export default {
|
||||
name: "shop-finance-summary",
|
||||
data() {
|
||||
return {
|
||||
dateRange: [],
|
||||
summary: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
buildParams() {
|
||||
const p = {};
|
||||
if (this.dateRange?.length === 2) {
|
||||
p.startDate = this.dateRange[0];
|
||||
p.endDate = this.dateRange[1];
|
||||
}
|
||||
return p;
|
||||
},
|
||||
loadData() {
|
||||
API_Finance.getStoreSummary(this.buildParams()).then((res) => {
|
||||
if (res.success) this.summary = res.result;
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
API_Finance.exportStoreSummary(this.buildParams()).then((blob) => {
|
||||
downloadBlob(blob, "店铺周期汇总.xlsx");
|
||||
});
|
||||
},
|
||||
exportFlow() {
|
||||
API_Finance.exportStoreFlow(this.buildParams()).then((blob) => {
|
||||
downloadBlob(blob, "店铺流水.xlsx");
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user