This commit is contained in:
fuenmao
2025-12-05 14:26:00 +08:00
parent 09c99be903
commit 6be187e9b7
6 changed files with 90 additions and 26 deletions
+44
View File
@@ -18,22 +18,66 @@ declare module 'vue' {
CropUpload: typeof import('./src/components/CropUpload/index.vue')['default']
DatePicker: typeof import('./src/components/Form/DatePicker/index.vue')['default']
ECharts: typeof import('./src/components/ECharts/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
ElWatermark: typeof import('element-plus/es')['ElWatermark']
ESign: typeof import('./src/components/ESign/index.vue')['default']
FormContainer: typeof import('./src/components/Form/FormContainer/index.vue')['default']
Grid: typeof import('./src/components/Grid/index.vue')['default']
-1
View File
@@ -14,7 +14,6 @@ const globalStore = useGlobalStore();
// init theme
const { initTheme } = useTheme();
console.log(11)
initTheme();
// element assemblySize
const assemblySize = computed(() => globalStore.assemblySize);
@@ -144,6 +144,11 @@ const prescriptionApi = {
/** 获取关系类型 */
getRelationTypes() {
return http.get<RelationTypeDto[]>("relation-types");
},
/** 获取处方总价 */
getTotalCost() {
return http.get<number>("gettotalcost");
}
};
@@ -1,17 +1,9 @@
<template>
<!-- 分页组件 -->
<el-pagination
:background="true"
:current-page="pageable.pageNum"
:page-size="pageable.pageSize"
:pager-count="pagerCount"
:page-sizes="[10, 25, 50, 100]"
:total="pageable.total"
:size="globalStore?.assemblySize ?? 'default'"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
<el-pagination :background="true" :current-page="pageable.pageNum" :page-size="pageable.pageSize"
:pager-count="pagerCount" :page-sizes="[10, 25, 50, 100]" :total="pageable.total"
:size="globalStore?.assemblySize ?? 'default'" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange" @current-change="handleCurrentChange"></el-pagination>
</template>
<script setup lang="ts" name="Pagination">
@@ -17,7 +17,7 @@
<!-- unitPrice 列:只展示单价,不编辑 -->
<template #unitPrice="{ row }">
{{ (row.unitPrice ?? 0).toFixed(2) }}
{{ (row.unitPrice ?? 0).toFixed(5) }}
</template>
<!-- totalPrice 列:查看时显示合计,编辑时可以修改 -->
+36 -12
View File
@@ -5,6 +5,7 @@
<!-- 原有:表格头部按钮(不变) -->
<template #tableHeader>
<s-button suffix="处方" type="success" @click="handleAddPrescription" />
<el-button type="primary" @click="handleViewTotalCost">查看处方总价</el-button>
</template>
<!-- 原有:就诊人类型自定义插槽(不变) -->
@@ -33,12 +34,25 @@
</template>
</ProTable>
<!-- 原有:处方详情/编辑弹窗(不变) -->
<!--处方详情/编辑弹窗 -->
<PrescriptionDetailDialog v-model:visible="showDetailDialog" :prescription-id="currentPrescriptionId"
:is-edit="isEdit" @refresh-list="handleRefresh" />
<!-- 关键改动:引入独立的报告弹窗组件 -->
<!-- 报告弹窗组件 -->
<PrescriptionReportDialog v-model="showReportDialog" :prescription-id="currentReportId" />
<!-- 处方总价弹窗 -->
<el-dialog v-model="showTotalCostDialog" title="查看处方总价" width="400px" :close-on-click-modal="false">
<div style="padding: 20px; text-align: center;">
<div style="font-size: 16px; color: #606266; margin-bottom: 10px;">预估总药材成本</div>
<div style="color: #f56c6c; font-size: 32px; font-weight: bold;">
¥{{ totalCostData || 0 }}
</div>
</div>
<template #footer>
<el-button @click="showTotalCostDialog = false">关闭</el-button>
</template>
</el-dialog>
</div>
</template>
@@ -63,6 +77,10 @@ const isEdit = ref(false);
const showReportDialog = ref(false); // 报告弹窗显隐
const currentReportId = ref<number | undefined>(undefined); // 当前报告对应的处方ID
// 新增:处方总价弹窗相关状态
const showTotalCostDialog = ref(false); // 总价弹窗显隐
const totalCostData = ref<number>(0); // 总价数据
// 原有:就诊人类型选项、表格列配置(不变)
const personTypeOptions = [
{ label: "公司员工", value: 1 },
@@ -79,7 +97,8 @@ const columns: ColumnProps<any>[] = [
search: { el: "select" }
},
{ prop: "visitDate", label: "就诊时间" },
{ prop: "totalMedicineCost", label: "预估处方药材成本(元)" },
{ prop: "createTime", label: "添加时间" },
{ prop: "totalMedicineCost", label: "预估药材成本" },
{ prop: "operation", label: "操作", width: 280, fixed: "right" }
];
const rowKey = "id";
@@ -87,7 +106,7 @@ const getPrescriptionListApi = (params: any) => {
return prescriptionApi.getList(params);
};
// 原有:新增、查看详情、编辑、刷新逻辑(不变)
//新增、查看详情、编辑、刷新
const handleAddPrescription = () => {
currentPrescriptionId.value = undefined;
isEdit.value = false;
@@ -107,16 +126,21 @@ const handleRefresh = () => {
proTable.value?.refresh?.();
};
// 关键改动:新增“打开报告弹窗”方法
// 打开报告弹窗
const handleOpenReport = (id: number) => {
currentReportId.value = id; // 传递当前处方ID给报告组件
showReportDialog.value = true; // 显示报告弹窗
};
</script>
<style lang="scss" scoped>
/* 原有样式(不变):确保操作列按钮不换行 */
.table-box {
padding: 16px;
}
</style>
// 新增:查看处方总价
const handleViewTotalCost = async () => {
showTotalCostDialog.value = true;
try {
const { data } = await prescriptionApi.getTotalCost();
totalCostData.value = data || 0;
} catch (error) {
console.error("获取处方总价失败:", error);
totalCostData.value = 0;
}
};
</script>