Browse Source

feat(@six/smart-pharmacy): 智慧药事系统第二版-均贴费用标准页面新增

cmj 2 weeks ago
parent
commit
26c4c62aea

+ 10 - 0
apps/smart-pharmacy/public/database/menu.json

@@ -153,6 +153,16 @@
         },
         "component": "/prescription-review/indicator-library/list"
       },
+      {
+        "id": "2507",
+        "path": "/prescription-review/cost-limit",
+        "name": "PrescriptionReviewCostLimit",
+        "meta": {
+          "icon": "mdi:cash-multiple",
+          "title": "均贴费用标准"
+        },
+        "component": "/prescription-review/cost-limit/index"
+      },
       {
         "id": "2504",
         "path": "/prescription-review/task/review/:id",

+ 46 - 1
apps/smart-pharmacy/src/api/method/prescription-review.ts

@@ -1,5 +1,6 @@
-import type { TransformList, TransformRecord } from '#/api';
+import type { TransformData, TransformList, TransformRecord } from '#/api';
 
+import { http } from '#/api';
 import {
   listUsersMethod,
   updateUserStatusMethod,
@@ -179,6 +180,18 @@ export namespace PrescriptionReviewModel {
     children?: ReviewStatisticsCostRow[];
   }
 
+  /** 均贴费用上限配置 */
+  export interface ReviewCostLimitConfig {
+    createTime?: string;
+    del?: string;
+    dictCode?: string;
+    dictName?: string;
+    dictSort?: number;
+    dictValue?: string;
+    id?: number;
+    remark?: string;
+  }
+
   /** 统计分析 - 点评结果汇报 */
   export interface ReviewStatisticsSummary {
     sampledPrescriptionCount: number;
@@ -229,6 +242,38 @@ export function updateReviewExpertStatusMethod(
   return updateUserStatusMethod(expertId, { status });
 }
 
+/** 获取中药处方均贴费用上限价 */
+export function getReviewCostLimitMethod() {
+  return http.get<
+    PrescriptionReviewModel.ReviewCostLimitConfig,
+    TransformData
+  >(`/manager/tcmp-pc/config/getLimit`, {
+    cacheFor: 0,
+    transform(data) {
+      return {
+        createTime: data?.createTime,
+        del: data?.del,
+        dictCode: data?.dictCode,
+        dictName: data?.dictName,
+        dictSort: data?.dictSort,
+        dictValue:
+          data?.dictValue === undefined || data?.dictValue === null
+            ? ''
+            : String(data.dictValue),
+        id: data?.id,
+        remark: data?.remark,
+      };
+    },
+  });
+}
+
+/** 修改中药处方均贴费用上限价 */
+export function updateReviewCostLimitMethod(dictValue: string) {
+  return http.post<void, unknown>(`/manager/tcmp-pc/config/updateLimit`, void 0, {
+    params: { dictValue },
+  });
+}
+
 const MOCK_INDICATOR_CATEGORIES: PrescriptionReviewModel.ReviewIndicatorCategory[] =
   [
     { id: 'cat-1', name: '适应症', source: 'system' },

+ 1 - 0
apps/smart-pharmacy/src/api/model/menu.ts

@@ -54,6 +54,7 @@ export const HARDCODED_MENU_TREE_SELECT: TreeSelectMenuNode[] = [
       { id: '2506', label: '点评详情' },
       { id: '2501', label: '点评专家' },
       { id: '2502', label: '点评指标库' },
+      { id: '2507', label: '均贴费用标准' },
     ],
   },
   {

+ 108 - 0
apps/smart-pharmacy/src/views/prescription-review/cost-limit/index.vue

@@ -0,0 +1,108 @@
+<script lang="ts" setup>
+import { computed, onMounted, ref } from 'vue';
+
+import { Page } from '@vben/common-ui';
+
+import { Button, Input, message } from 'ant-design-vue';
+
+import {
+  getReviewCostLimitMethod,
+  updateReviewCostLimitMethod,
+} from '#/api';
+
+const dictValue = ref('');
+const originalValue = ref('');
+const loading = ref(false);
+const saving = ref(false);
+
+const hasChanged = computed(
+  () => dictValue.value.trim() !== originalValue.value,
+);
+
+async function loadConfig() {
+  loading.value = true;
+  try {
+    const data = await getReviewCostLimitMethod();
+    dictValue.value = data.dictValue ?? '';
+    originalValue.value = dictValue.value;
+  } catch (error: any) {
+    message.error(error.message || '获取配置失败');
+  } finally {
+    loading.value = false;
+  }
+}
+
+async function handleSave() {
+  const value = dictValue.value.trim();
+  if (!value) {
+    message.warning('请输入均贴费用上限价');
+    return;
+  }
+
+  saving.value = true;
+  try {
+    await updateReviewCostLimitMethod(value);
+    originalValue.value = value;
+    dictValue.value = value;
+    message.success('保存成功');
+  } catch (error: any) {
+    dictValue.value = originalValue.value;
+    message.error(error.message || '保存失败');
+  } finally {
+    saving.value = false;
+  }
+}
+
+onMounted(() => {
+  loadConfig();
+});
+</script>
+
+<template>
+  <Page auto-content-height class="cost-limit-page">
+    <div class="cost-limit-form">
+      <span class="cost-limit-form__label">中药处方均贴费用上限价:</span>
+      <Input
+        v-model:value="dictValue"
+        :disabled="loading || saving"
+        class="cost-limit-form__input"
+        placeholder="请输入"
+      />
+      <span class="cost-limit-form__unit">元</span>
+      <Button
+        :disabled="loading || !hasChanged"
+        :loading="saving"
+        type="primary"
+        @click="handleSave"
+      >
+        保存
+      </Button>
+    </div>
+  </Page>
+</template>
+
+<style scoped>
+.cost-limit-page {
+  padding: 24px;
+}
+
+.cost-limit-form {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+
+.cost-limit-form__label {
+  font-size: 14px;
+  color: rgb(0 0 0 / 88%);
+}
+
+.cost-limit-form__input {
+  width: 200px;
+}
+
+.cost-limit-form__unit {
+  font-size: 14px;
+  color: rgb(0 0 0 / 88%);
+}
+</style>

+ 13 - 2
apps/smart-pharmacy/src/views/system/personnel-qualification-query/list.vue

@@ -5,7 +5,7 @@ import type {
 } from '#/adapter/vxe-table';
 import type { PersonnelQualificationModel } from '#/api';
 
-import { ref } from 'vue';
+import { onActivated, ref } from 'vue';
 
 import { Page, useVbenModal } from '@vben/common-ui';
 
@@ -28,7 +28,9 @@ const [CertificateModal, certificateModalApi] = useVbenModal({
   destroyOnClose: true,
 });
 
-const [Grid] = useVbenVxeGrid({
+const isFirstActivated = ref(true);
+
+const [Grid, gridApi] = useVbenVxeGrid({
   formOptions: {
     schema: usePersonnelQualificationSearchFormSchema(),
     submitOnChange: true,
@@ -75,6 +77,15 @@ function onCertificateHandle(row: PersonnelQualificationModel.Personnel) {
   certificateModalApi.setData(row).open();
 }
 
+// keepAlive 缓存下从其他页面切回时重新拉取列表
+onActivated(() => {
+  if (isFirstActivated.value) {
+    isFirstActivated.value = false;
+    return;
+  }
+  gridApi.query();
+});
+
 </script>
 <template>
   <Page auto-content-height class="personnel-qualification-page">

+ 1 - 1
apps/smart-pharmacy/src/views/system/personnel-qualification/modules/certificate.vue

@@ -121,7 +121,7 @@ const [Modal, modalApi] = useVbenModal({
           </div>
           <div class="meta-item">
             <span class="meta-label">证书类型:</span>
-            <span>{{ activeCertificate.name || '-' }}</span>
+            <span>{{ activeCertificate.type || '-' }}</span>
           </div>
           <div class="meta-item">
             <span class="meta-label">资质附件:</span>