fix: 订单管理新增订单统计

This commit is contained in:
2025-04-07 17:02:39 +08:00
parent 0994dd94d5
commit 3ac645e4a0
6 changed files with 108 additions and 31 deletions

View File

@@ -9,6 +9,33 @@ import { App, ConfigProvider, theme } from 'ant-design-vue';
import { antdLocale } from '#/locales';
defineOptions({ name: 'App' });
// 定义颜色代码
const redBoldYellowBg = '\u001B[1;31;43m'; // 1=加粗 31=红色文字 43=黄色背景
const reset = '\u001B[0m';
console.log(
`${redBoldYellowBg}......................阿弥陀佛...................... \n` +
` _oo0oo_ \n` +
` o8888888o \n` +
` 88" . "88 \n` +
` (| -_- |) \n` +
` 0\\ = /0 \n` +
` ___/---\\___ \n` +
` .' \\| |/ '. \n` +
` / \\\\||| : |||// \\ \n` +
` / _||||| -卍-|||||_ \\ \n` +
` | | \\\\\\ - /// | | \n` +
` | \\_| ''\\---/'' |_/ | \n` +
` \\ .-\\__ '-' ___/-. / \n` +
` ___'. .' /--.--\\ '. .'___ \n` +
` ."" < .___\\_<|>_/___.> "". \n` +
` | | : - \\.;\\ _ /;./ - : | | \n` +
` \\ \\ _. \\_ __\\ /__ _/ .- / / \n` +
` =====-.____.___ \\_____/___.-___.-===== \n` +
` =---= \n` +
` \n` +
`....................佛祖保佑 ,永无BUG...................${reset}`,
);
const { isDark } = usePreferences();
const { tokens } = useAntdDesignTokens();

View File

@@ -30,15 +30,6 @@ const [Modal, modalApi] = useVbenModal({
});
await formApi.validateAndSubmitForm();
},
onOpenChange(isOpen: boolean) {
console.log(isOpen, '开启状态');
// if (isOpen) {
// const {values} =
// modalApi.getData<Record<string, any>>();
// if (values) {
// }
// }
},
});
</script>

View File

@@ -55,9 +55,8 @@ export const useAuthStore = defineStore('auth', () => {
console.log(userInfo.home_path);
console.log(DEFAULT_HOME_PATH);
// console.log(accessStore.loginExpired);
// console.log(onSuccess?.());
// console.log(onSuccess);
console.log(userInfo.home_path || DEFAULT_HOME_PATH, 'ssssssssssssssss');
console.log(userInfo.home_path || DEFAULT_HOME_PATH, 'ssssssssssssssss');
if (accessStore.loginExpired) {
accessStore.setLoginExpired(false);
} else {

View File

@@ -15,6 +15,13 @@ export async function getOrderList(data: any) {
export async function getOrderStatusOption(data: any) {
return requestClient.get<any>(`${prefix}status-option`, { params: data });
}
/**
* 分页查询用户列表
* @param data
*/
export async function saleAmountApi(data: any) {
return requestClient.get<any>(`${prefix}sale-amount`, { params: data });
}
/**
* 获取订单详情

View File

@@ -3,18 +3,28 @@ import type { VxeGridListeners } from '#/adapter/vxe-table';
import { ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import {
AnalysisOverview,
type AnalysisOverviewItem,
Page,
useVbenModal,
} from '@vben/common-ui';
import { SvgCakeIcon } from '@vben/icons';
import { Button, Image, message, Tag } from 'ant-design-vue';
import { Button, Image, Tag } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { TableAction } from '#/components/table-action';
import {
getOrderList,
saleAmountApi,
} from '#/views/business/order/product-order/api';
import PrescrtionDetail from '#/views/doctor/doctor-reception/components/PrescrtionDetail.vue';
import FormModalDemo from './components/modal.vue';
import DetailModal from './components/detail.vue';
import FormModalDemo from './components/modal.vue';
import { formOptions } from './config/search';
import { gridOptions } from './config/table';
import PrescrtionDetail from "#/views/doctor/doctor-reception/components/PrescrtionDetail.vue";
const hasTopTableDropDownActions = ref(false);
@@ -36,7 +46,25 @@ const [Grid, gridApi] = useVbenVxeGrid({
gridOptions,
gridEvents,
});
const initTableAjax = () => {
gridApi.setGridOptions({
proxyConfig: {
ajax: {
// 请求后端接口方法
query: async ({ page }, formValues) => {
saleAmount();
return await getOrderList({
page: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
});
};
initTableAjax();
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: FormModalDemo,
});
@@ -51,17 +79,7 @@ const infoModal = (data = {}) => {
gridApi,
});
modalApi.open();
// message.success(`正在开发${JSON.stringify(data)}`);
};
// const showModal = (data = {}, isUpdate = false) => {
// formModalApi.setData({
// // 表单值
// values: data,
// update: isUpdate,
// gridApi,
// });
// formModalApi.open();
// };
const wareSend = (data = {}) => {
formModalApi.setData({
@@ -81,7 +99,34 @@ const expandAll = () => {
const collapseAll = () => {
gridApi.grid?.setAllRowExpand(false);
};
const overviewItems = ref<AnalysisOverviewItem[]>([]);
const income = ref(0);
const total = ref(0);
const saleAmount = () => {
saleAmountApi({
search_time: gridApi.formApi.latestSubmissionValues.search_time,
}).then((res) => {
console.log(res, 'sssssssss');
income.value = res.income;
total.value = res.total;
overviewItems.value = [
{
icon: SvgCakeIcon,
title: '累计收益',
totalTitle: '累计收益',
totalValue: total.value,
value: total.value,
},
{
icon: 'fluent-emoji:balance-scale',
title: '我的收益',
totalTitle: '我的收益',
totalValue: income.value,
value: income.value,
},
];
});
};
const [PrescrtionDetailModal, PrescrtionDetailModalApi] = useVbenModal({
connectedComponent: PrescrtionDetail,
@@ -100,6 +145,7 @@ const openPrescriptionDetail = (values) => {
<FormModal />
<Modal />
<PrescrtionDetailModal />
<AnalysisOverview :items="overviewItems" :my-card="false" class="mt-5" />
<Grid>
<template #toolbar-buttons>
<TableAction
@@ -262,7 +308,13 @@ const openPrescriptionDetail = (values) => {
</div>
<div class="text-sm">
<span class="text-gray-500 dark:text-gray-400">商品厂家:</span>
{{ item.drug ? item.drug.source_info != null ? item.drug.source_info.name : item.drug.source : '暂无' }}
{{
item.drug
? item.drug.source_info != null
? item.drug.source_info.name
: item.drug.source
: '暂无'
}}
</div>
<div class="text-sm">
<span class="text-gray-500 dark:text-gray-400">商品价格:</span>
@@ -273,7 +325,10 @@ const openPrescriptionDetail = (values) => {
</div>
</div>
<div v-if="row.prescription_type === 1" class="medication-details mt-5 p-10">
<div
v-if="row.prescription_type === 1"
class="medication-details mt-5 p-10"
>
<span class="mb-2 font-medium">药品明细</span>
<ul class="custom-list pl-6">
<li

View File

@@ -105,7 +105,6 @@ getMyStoreList();
const userStore = useUserStore();
const myStoreId = ref(userStore.userInfo.store_id);
// userStore.userInfo?.nick_name
console.log(userStore.userInfo.store_id);
/**
* 获取患者列表
@@ -720,7 +719,6 @@ function newDrugModalOk() {
}
function updateChineseNumberGoNewDrug(event: KeyboardEvent) {
console.log(event.key);
if (event.key === 'Enter') {
updateLocalStorage();
setTimeout(() => {