新增功能:收银台

This commit is contained in:
2024-08-05 01:33:10 +08:00
parent 05f890f343
commit 1d81fa9270
37 changed files with 3655 additions and 74 deletions

View File

@@ -1,6 +1,6 @@
<!-- 统计卡片 -->
<template>
<a-row :gutter="16">
<a-row :gutter="16" v-if="data">
<a-col
v-bind="styleResponsive ? { lg: 6, md: 12, sm: 24, xs: 24 } : { span: 6 }"
>
@@ -11,11 +11,13 @@
<ele-tag color="green">全门店</ele-tag>
</a-tooltip>
</div>
<h1 class="analysis-chart-card-num">¥ 126,560</h1>
<h1 class="analysis-chart-card-num"
>¥ {{ formatNumber(data[0].totalPrice) }}</h1
>
<a-divider />
<div class="flex justify-between">
<span>本月订单数</span>
<span>6,234</span>
<span>{{ data.todayOrders }}</span>
</div>
</a-card>
</a-col>
@@ -27,11 +29,11 @@
<div class="ele-cell-content">订单总数</div>
<ele-tag color="green">全门店</ele-tag>
</div>
<h1 class="analysis-chart-card-num">8,846</h1>
<h1 class="analysis-chart-card-num">{{ data.totalOrders }}</h1>
<a-divider />
<div class="flex justify-between">
<span>昨日订单数</span>
<span>634</span>
<span>{{ 634 }}</span>
</div>
</a-card>
</a-col>
@@ -87,9 +89,11 @@
import { GridComponent, TooltipComponent } from 'echarts/components';
import VChart from 'vue-echarts';
import { storeToRefs } from 'pinia';
import { formatNumber } from 'ele-admin-pro/es';
import { useThemeStore } from '@/store/modules/theme';
import { getPayNumList } from '@/api/dashboard/analysis';
import useEcharts from '@/utils/use-echarts';
import { Count } from '@/api/shop/count/model';
use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]);
@@ -97,6 +101,13 @@
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: Count | null;
}>();
//
const visitChartRef = ref<InstanceType<typeof VChart> | null>(null);
const payNumChartRef = ref<InstanceType<typeof VChart> | null>(null);

View File

@@ -1,13 +1,15 @@
<template>
<div class="ele-body ele-body-card">
<statistics-card />
<statistics-card :data="statistics" />
<sale-card />
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useThemeStore } from '@/store/modules/theme';
import * as ShopCountApi from '@/api/shop/count';
import StatisticsCard from './components/statistics-card.vue';
import SaleCard from './components/sale-card.vue';
import VisitHour from './components/visit-hour.vue';
@@ -16,6 +18,18 @@
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const statistics = ref();
const reload = () => {
ShopCountApi.data({}).then((list) => {
if (list) {
statistics.value = list;
}
});
};
reload();
</script>
<script lang="ts">

View File

@@ -73,14 +73,14 @@
v-model:value="form.merchantSerialNumber"
/>
</a-form-item>
<a-form-item label="支付通知(选填)" name="notifyUrl" extra="微信支付通知原样推送到该地址(携带租户ID)">
<a-input
allow-clear
placeholder="请输入支付结果通知地址"
v-model:value="form.notifyUrl"
/>
</a-form-item>
</template>
<a-form-item label="支付通知" name="notifyUrl" extra="推送支付结果(携带租户ID的POST请求)">
<a-input
allow-clear
placeholder="请输入支付结果通知地址"
v-model:value="form.notifyUrl"
/>
</a-form-item>
<a-form-item label="图标" name="image">
<SelectFile
:placeholder="`请选择图片`"
@@ -240,6 +240,14 @@
trigger: 'blur'
}
],
notifyUrl: [
{
required: true,
type: 'string',
message: '请填写支付通知地址',
trigger: 'blur'
}
],
merchantSerialNumber: [
{
required: true,