diff --git a/fuintCashierWeb/src/api/order/exportExcel.js b/fuintCashierWeb/src/api/order/exportExcel.js index f56cf2fa8..8192f4397 100644 --- a/fuintCashierWeb/src/api/order/exportExcel.js +++ b/fuintCashierWeb/src/api/order/exportExcel.js @@ -41,6 +41,18 @@ export function exportExcelVipApi(data) { data: data // 通过 data 参数传递需要的数据 }); } +// 导出积分商城订单 +export function exportExcelPointsApi(data) { + return request({ + url: 'business/integral/integralOrders/exportExcel', + method: 'post', + responseType: 'blob', // 表明响应类型为二进制流 + data: data // 通过 data 参数传递需要的数据 + }); +} + + + // 导出小程序订单 export function exportExcelAppletApi(data) { diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/integralOrder/pointsCashier.vue b/fuintCashierWeb/src/views/cashier/NewComponents/integralOrder/pointsCashier.vue index a0bc3888d..8eeee893f 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/integralOrder/pointsCashier.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/integralOrder/pointsCashier.vue @@ -57,6 +57,7 @@ 搜索 重置 + 导出 @@ -126,6 +127,7 @@ + @@ -173,6 +175,7 @@ import {getOrderApi,getStatisticsApi } from "@/api/cashier/integralOrder/order"; import Detail from '@/views/cashier/NewComponents/integralOrder/detail' import {getDicts} from "@/api/dict/data"; +import { exportExcelPointsApi } from '@/api/order/exportExcel' export default { name: "pointsCashier", @@ -213,11 +216,32 @@ export default { } }, created() { + let start = new Date(); + start.setHours(0) + start.setMinutes(0) + start.setSeconds(0) + start.setMilliseconds(0) + this.dateRange = [start,new Date()]; + this.beginTime = start + this.endTime = new Date() + this.getList(); this.getStatistics(); }, methods: { + + exportExcelVip() { + let dateRange = [] + if (this.beginTime && this.endTime) { + dateRange.push(this.beginTime.toLocaleDateString()) + dateRange.push(this.endTime.toLocaleDateString()) + } + exportExcelPointsApi(this.addDateRange(this.queryParams, dateRange)).then(res => { + const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}); + this.$download.saveAs(blob, '积分商城订单.xLsx') + }) + }, getList(){ this.dateRange = [] if (this.beginTime && this.endTime) { diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue index 145ad144f..0c733b5e9 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue @@ -214,6 +214,7 @@