fix趋势图,订单导出

This commit is contained in:
messi
2024-08-27 17:11:27 +08:00
parent c0067c7db1
commit fadae0d7ac
4 changed files with 48 additions and 20 deletions

View File

@@ -25,7 +25,7 @@
LegendComponent LegendComponent
} from 'echarts/components'; } from 'echarts/components';
import VChart from 'vue-echarts'; import VChart from 'vue-echarts';
import { getSaleroomList, getVisitHourList } from "@/api/dashboard/analysis"; import { getSaleroomList, getVisitHourList } from '@/api/dashboard/analysis';
import useEcharts from '@/utils/use-echarts'; import useEcharts from '@/utils/use-echarts';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
@@ -47,21 +47,23 @@
/* 获取最近 1 小时访问情况数据 */ /* 获取最近 1 小时访问情况数据 */
const getVisitHourData = () => { const getVisitHourData = () => {
getVisitHourList() getSaleroomList()
.then((data) => { .then((data) => {
Object.assign(visitHourChartOption, { Object.assign(visitHourChartOption, {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['销售额'], data: ['销售额', '订单量'],
right: 20 right: 20
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: data.map((d) => dayjs(d.startStatisticsDate).format('YYYY-MM-DD')) data: data.salesAmountStatisticsList.map((d) =>
dayjs(d.startStatisticsDate).format('YYYY-MM-DD')
)
} }
], ],
yAxis: [ yAxis: [
@@ -78,18 +80,18 @@
areaStyle: { areaStyle: {
opacity: 0.5 opacity: 0.5
}, },
data: data.map((d) => d.dailySale) data: data.salesAmountStatisticsList.map((d) => d.dailySale)
},
{
name: '订单量',
type: 'line',
smooth: true,
symbol: 'none',
areaStyle: {
opacity: 0.5
},
data: data.orderStatisticsList.map((d) => d.dailyNewOrders)
} }
// {
// name: '访问量',
// type: 'line',
// smooth: true,
// symbol: 'none',
// areaStyle: {
// opacity: 0.5
// },
// data: data.map((d) => d.visits)
// }
] ]
}); });
}) })

View File

@@ -3,6 +3,7 @@
<statistics-card /> <statistics-card />
<!-- <sale-card />--> <!-- <sale-card />-->
<visit-hour /> <visit-hour />
</div> </div>
</template> </template>

View File

@@ -752,7 +752,8 @@ const getRenewOrder = () => {
listOrderPay({ listOrderPay({
rentOrderId: order.orderId, rentOrderId: order.orderId,
payStatus: 20, payStatus: 20,
sort: ' create_time asc' sort: ' create_time asc',
limit:1
}).then((data) => { }).then((data) => {
renewOrderList.value = data; renewOrderList.value = data;
loading.value = false; loading.value = false;
@@ -762,6 +763,7 @@ const getRenewOrder = () => {
rentOrderId: order.orderId, rentOrderId: order.orderId,
payStatus: 20, payStatus: 20,
sort: 'create_time asc', sort: 'create_time asc',
limit:1
}).then((data) => { }).then((data) => {
renewOrderList.value = data; renewOrderList.value = data;
loading.value = false; loading.value = false;
@@ -773,7 +775,8 @@ const getRenewOrder = () => {
const getEquipmentRecordList = () => { const getEquipmentRecordList = () => {
EquipmentRecordApi.pageEquipmentRecord({ EquipmentRecordApi.pageEquipmentRecord({
orderId: order.orderId, orderId: order.orderId,
userId: order.userId userId: order.userId,
limit:1
}).then((data) => { }).then((data) => {
EquipmentRecordList.value = data.list; EquipmentRecordList.value = data.list;
}); });

View File

@@ -517,12 +517,14 @@
const array: (string | number)[][] = [ const array: (string | number)[][] = [
[ [
'订单号', '订单号',
'下单日期',
'电池型号', '电池型号',
'电池编号', '电池编号',
'所属商户', '所属商户',
'到期时间', '到期时间',
'剩余天数', '剩余天数',
'买家', '买家',
'客户实名',
'订单金额', '订单金额',
'交易状态' '交易状态'
] ]
@@ -533,17 +535,37 @@
var equipmentCode = d.equipment ? d.equipment.equipmentCode : ''; var equipmentCode = d.equipment ? d.equipment.equipmentCode : '';
var orderStatus = '';
if (d.payStatus == 10) {
orderStatus = '待付款';
} else {
if (d.receiptStatus == 10) {
orderStatus = '待收货';
}
if (d.receiptStatus == 20) {
orderStatus = '已收货';
}
if (d.receiptStatus == 21) {
orderStatus = '退租中';
}
if (d.receiptStatus == 30) {
orderStatus = '已退租';
}
}
array.push([ array.push([
`${d.orderNo}`, `${d.orderNo}`,
`${d.createTime}`,
`${d.equipmentGoods.batteryModel}`, `${d.equipmentGoods.batteryModel}`,
`${equipmentCode}`, `${equipmentCode}`,
`${d.merchantName}`, `${d.merchantName}`,
`${d.expirationTime}`, `${d.expirationTime}`,
`${d.expirationDay}`, `${d.restDay}`,
`${username}`, `${username}`,
`${d.totalPrice}`, `${d.realName}`,
`${d.totalPayPrice}`,
`${d.orderStatus}` `${orderStatus}`
]); ]);
}); });
const sheetName = '设备列表'; const sheetName = '设备列表';