张田田 2 mesi fa
parent
commit
7c5f463fd1

+ 1 - 1
src/components/UserPreview.vue

@@ -18,7 +18,7 @@ const { data, loading } = useRequest(
 <template>
   <a-spin :spinning="loading">
     <a-descriptions bordered>
-      <a-descriptions-item label="系统账号">{{ data.userId }}</a-descriptions-item>
+      <a-descriptions-item label="系统账号">{{data.userName}}</a-descriptions-item>
       <a-descriptions-item label="角色" :span="2">{{ data.roles?.map(t => t.roleName)?.join(', ') }}
       </a-descriptions-item>
       <a-descriptions-item label="医院 / 科室" :span="2">{{ data.dept?.deptFullPathName }}</a-descriptions-item>

+ 8 - 8
src/order/Amount.vue

@@ -12,13 +12,13 @@ const emit = defineEmits<{
   'close': [];
 }>();
 
-// 初始申请金额
-const originalAmount = computed(() => {
-  return props.data?.applyAmount || 0;
+// 商品总价
+const totalPrice = computed(() => {
+  return props.data?.totalPrice || 0;
 });
 
 // 最终退款金额 (双向绑定)
-const finalAmount = ref<string | number>(originalAmount.value.toFixed(2));
+const finalAmount = ref<string | number>(totalPrice.value.toFixed(2));
 
 // 监听数据变化同步初始值
 watch(() => props.data, (newVal) => {
@@ -43,7 +43,7 @@ function handleBlur() {
     val = 0;
   }
   
-  if (val > originalAmount.value) {
+  if (val > totalPrice.value) {
     return;
   }
 
@@ -59,8 +59,8 @@ async function handleConfirm() {
     message.error('请输入有效的退款金额');
     return;
   }
-  if (val > originalAmount.value) {
-    message.warning(`退款金额不能超过申请金额 ¥${originalAmount.value.toFixed(2)}`);
+  if (val > totalPrice.value) {
+    message.warning(`退款金额不能超过商品总价 ¥${totalPrice.value.toFixed(2)}`);
     return;
   }
   if (!props.data?.id) return;
@@ -87,7 +87,7 @@ function handleCancel() {
       <div class="info-row apply-amount">
         <span class="label">申请金额:</span>
         <span class="symbol">¥</span>
-        <span class="value">{{ originalAmount.toFixed(2) }}</span>
+        <span class="value">{{ totalPrice.toFixed(2) }}</span>
       </div>
 
       <!-- 最终退款金额编辑 -->

+ 16 - 4
src/order/SeeAmount.vue

@@ -5,13 +5,19 @@ const props = defineProps<{
   data?: any;
 }>();
 
-const originalAmount = computed(() => {
-  return props.data?.refundAmount || 240.00;
+const totalPrice = computed(() => {
+  return props.data?.totalPrice || 0;
+});
+
+const applyAmount = computed(() => {
+  return props.data?.applyAmount || 0;
 });
 
 const finalAmount = computed(() => {
-  return props.data?.finalRefundAmount || props.data?.refundAmount || 240.00;
+  return props.data?.refundAmount || 0;
 });
+
+
 </script>
 
 <template>
@@ -21,7 +27,7 @@ const finalAmount = computed(() => {
       <div class="info-row apply-amount">
         <span class="label">申请金额:</span>
         <span class="symbol">¥</span>
-        <span class="value">{{ originalAmount.toFixed(2) }}</span>
+        <span class="value">{{ applyAmount.toFixed(2) }}</span>
       </div>
 
       <!-- 最终退款金额展示 -->
@@ -89,5 +95,11 @@ const finalAmount = computed(() => {
       }
     }
   }
+
+  .warning-text {
+    color: #ff4d4f;
+    font-size: 14px;
+    margin-top: 4px;
+  }
 }
 </style>

+ 14 - 25
src/pages/index/care/serviceItems.vue

@@ -1,8 +1,8 @@
 <script setup lang="ts">
-import { ref, unref, shallowReactive, defineAsyncComponent } from 'vue';
+import { ref, unref, computed, defineAsyncComponent, nextTick } from 'vue';
 import { usePermission } from '@/core/usePermission';
 
-const panels = shallowReactive([
+const allPanels = [
   {
     id: 'service-items-list',
     title: '项目列表',
@@ -19,26 +19,20 @@ const panels = shallowReactive([
     component: defineAsyncComponent(() => import('@/service/ServiceItemsSystem.vue')),
     hide: usePermission('fdhb:service_items_system:list', true),
   },
-].filter(item => !unref(item.hide)));
+];
 
-const activePanel = ref(panels[0].id);
+const panels = computed(() => allPanels.filter((item) => !unref(item.hide)));
+const activePanel = ref(panels.value[0]?.id);
+const activePanelData = computed(() =>
+  panels.value.find((panel) => panel.id === activePanel.value)
+);
 const currentComponent = ref<any>(null);
 
-// 获取当前激活的组件
-const getCurrentComponent = () => {
-  return panels.find(panel => panel.id === activePanel.value);
-};
-
-// 切换面板
-function handleChange(panelId: string) {
+async function handleChange(panelId: string) {
   activePanel.value = panelId;
-  // 延迟执行,确保新组件已经渲染完成
-  setTimeout(() => {
-    if (currentComponent.value && typeof currentComponent.value.send === 'function') {
-      currentComponent.value?.send();
-    } 
-  }, 100);
-};
+  await nextTick();
+  currentComponent.value?.send?.();
+}
 </script>
 
 <template>
@@ -51,15 +45,10 @@ function handleChange(panelId: string) {
         </a-radio-button>
       </a-radio-group>
     </div>
-    
+
     <!-- 内容区域 -->
     <div class="content-wrapper">
-      <component 
-        :is="getCurrentComponent()?.component" 
-        :title="getCurrentComponent()?.title" 
-        ref="currentComponent"
-        :key="activePanel"
-      ></component>
+      <component :is="activePanelData?.component" :title="activePanelData?.title" ref="currentComponent" :key="activePanel"></component>
     </div>
   </div>
 </template>

+ 37 - 27
src/service/ServiceItemsConfirm.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { onMounted, toRaw, shallowRef, reactive } from 'vue';
 import ConfirmItems from './ConfirmItems.vue';
 import type { SystemItemModel, SystemIteQuery } from '@/model/care.model';
 
@@ -89,7 +90,7 @@ const gridOptions = reactive<VxeGridProps<SystemItemModel>>({
     { field: 'name', title: '项目名称' },
     { field: 'conditioningProgramType', title: '方案类型' },
     { field: 'cpFixedPricingRule.unitPrice', title: '单价(元)', slots: { default: 'unitPriceCell' } },
-    { field: 'cpFixedPricingRule.pricingUnit', title: '计价单位',slots: { default: 'pricingUnitCell' } },
+    { field: 'cpFixedPricingRule.pricingUnit', title: '计价单位', slots: { default: 'pricingUnitCell' } },
     { field: 'cpFixedPricingRule.convertDose', title: '计价说明', slots: { default: 'convertDoseCell' } },
     { field: 'conditioningProgramSupplierName', title: '供应商' },
     {
@@ -125,7 +126,16 @@ const gridOptions = reactive<VxeGridProps<SystemItemModel>>({
 });
 const gridEvents: VxeGridListeners = {};
 
-const { loading, page, pageSize, total, onSuccess, refresh, remove,send:sendRefresh } = usePagination((page, size) => pageOrgConfirmMethod(page, size, model.value), {
+const {
+  loading,
+  page,
+  pageSize,
+  total,
+  onSuccess,
+  refresh,
+  remove,
+  send: sendRefresh,
+} = usePagination((page, size) => pageOrgConfirmMethod(page, size, model.value), {
   initialData: { data: [], total: 0 },
   initialPage: 1,
   initialPageSize: 100,
@@ -176,7 +186,7 @@ function sureItem(model?: SystemItemModel, index?: number) {
       slots: {
         default() {
           return h(HealthEvaluation, <any>{
-            data: {...model,addType},
+            data: { ...model, addType },
             onChange: (data: SystemItemModel) => {
               // 确认成功之后刷新页面
               refresh(page.value);
@@ -187,34 +197,34 @@ function sureItem(model?: SystemItemModel, index?: number) {
     });
   } else {
     VxeUI.modal.open({
-    title: `确认项目`,
-    height: 700,
-    width: 1000,
-    position: {
-      top: Math.min(100, window.innerHeight * 0.1),
-    },
-    escClosable: true,
-    destroyOnClose: true,
-    id: `confirm-item-modal`,
-    remember: true,
-    storage: true,
-    slots: {
-      default() {
-        return h(ConfirmItems, <any>{
-          data: model,
-          onSubmit(data: SystemItemModel) {
-            refresh(page.value);
-            VxeUI.modal.close(`confirm-item-modal`);
-          },
-        });
+      title: `确认项目`,
+      height: 700,
+      width: 1000,
+      position: {
+        top: Math.min(100, window.innerHeight * 0.1),
       },
-    },
-  });
-}
+      escClosable: true,
+      destroyOnClose: true,
+      id: `confirm-item-modal`,
+      remember: true,
+      storage: true,
+      slots: {
+        default() {
+          return h(ConfirmItems, <any>{
+            data: model,
+            onSubmit(data: SystemItemModel) {
+              refresh(page.value);
+              VxeUI.modal.close(`confirm-item-modal`);
+            },
+          });
+        },
+      },
+    });
+  }
 }
 defineExpose({
   send: sendRefresh,
-})
+});
 </script>
 <template>
   <div class="page-container flex flex-col">

+ 1 - 1
src/service/ServiceItemsSystem.vue

@@ -290,7 +290,7 @@ const onCheckboxAll = (params: any) => {
 };
 defineExpose({
   send: sendRefresh,
-})
+});
 </script>
 <template>
   <div class="page-container flex flex-col">