Sfoglia il codice sorgente

fix(@six/smart-pharmacy) - 686: 智慧药事系统第一版-处方列表的查询条件少了患者姓名和煎药方式

cmj 1 mese fa
parent
commit
0134fedb19

+ 5 - 0
apps/smart-pharmacy/src/api/method/dict.ts

@@ -78,3 +78,8 @@ export function listMatUsageNameDictMethod() {
 export function listExpressStateDictMethod() {
   return listDictByCodeMethod('express_state');
 }
+
+/** 煎药方式字典(decoction_type) */
+export function listDecoctionTypeDictMethod() {
+  return listDictByCodeMethod('decoction_type');
+}

+ 3 - 4
apps/smart-pharmacy/src/api/model/prescription.ts

@@ -221,10 +221,9 @@ export function fromPrescription(
 ): PrescriptionModel.Prescription {
   const id =
     data?.id === undefined || data?.id === null ? '' : String(data.id);
-  const decoctionMethod =
-    data?.decoctionMethod ??
-    data?.isBehalfName ??
-    resolveDecoctionMethod(data?.isBehalf);
+  const decoctionMethod = String(
+    data?.isBehalf ?? data?.decoctionMethod ?? '',
+  );
 
   return {
     ...fromRow({

+ 7 - 0
apps/smart-pharmacy/src/api/model/process-node-dict.ts

@@ -1,4 +1,5 @@
 import {
+  listDecoctionTypeDictMethod,
   listDeliveryMethodDictMethod,
   listExpressStateDictMethod,
   listLogisticsCompanyDictMethod,
@@ -24,6 +25,7 @@ export { resolveDictLabel as resolveZyjxLabel };
 export { resolveDictLabel as resolveZyRouteLabel };
 export { resolveDictLabel as resolveMatUsageNameLabel };
 export { resolveDictLabel as resolveExpressStateLabel };
+export { resolveDictLabel as resolveDecoctionTypeLabel };
 
 /** 获取流程节点字典映射(带缓存) */
 export const getProcessNodeLabelMap = createDictLabelMapGetter(
@@ -51,6 +53,11 @@ export const getExpressStateLabelMap = createDictLabelMapGetter(
   listExpressStateDictMethod,
 );
 
+/** 获取煎药方式字典映射(带缓存) */
+export const getDecoctionTypeLabelMap = createDictLabelMapGetter(
+  listDecoctionTypeDictMethod,
+);
+
 let cachedLogisticsCompanyMap: Map<string, string> | null = null;
 let loadingLogisticsCompanyPromise: Promise<Map<string, string>> | null = null;
 

+ 24 - 0
apps/smart-pharmacy/src/views/prescription/management/data.ts

@@ -6,6 +6,7 @@ import type { PrescriptionModel } from '#/api';
 
 import {
   listCampusByParentApiMethod,
+  listDecoctionTypeDictMethod,
   listMedicalInstitutionsMethod,
   listDecoctionCentersAllMethod,
   listProcessNodeDictMethod,
@@ -175,6 +176,29 @@ export function useUserSearchFormSchema(): VbenFormSchema[] {
         maxTagCount: 'responsive',
       },
     },
+    {
+      component: 'Input',
+      fieldName: 'patientName',
+      label: $t('prescription.list.patientName'),
+      componentProps: {
+        allowClear: true,
+        placeholder: '请输入',
+      },
+    },
+    {
+      component: 'ApiSelect',
+      fieldName: 'decoctionMethod',
+      label: $t('prescription.list.decoctionMethod'),
+      componentProps: {
+        allowClear: true,
+        api: listDecoctionTypeDictMethod,
+        class: 'w-full',
+        labelField: 'dictName',
+        valueField: 'dictValue',
+        mode: 'multiple',
+        maxTagCount: 'responsive',
+      },
+    },
   ];
 }
 

+ 23 - 11
apps/smart-pharmacy/src/views/prescription/management/list.vue

@@ -12,9 +12,11 @@ import { Page } from '@vben/common-ui';
 import { useVbenVxeGrid } from '#/adapter/vxe-table';
 import { listPrescriptionsMethod } from '#/api';
 import {
+  getDecoctionTypeLabelMap,
   getDeliveryMethodLabelMap,
   getLogisticsCompanyLabelMap,
   getProcessNodeLabelMap,
+  resolveDecoctionTypeLabel,
   resolveDeliveryMethodLabel,
   resolveLogisticsCompanyLabel,
   resolveProcessNodeLabel,
@@ -36,17 +38,23 @@ const [Grid] = useVbenVxeGrid({
     proxyConfig: {
       ajax: {
         async query({ page }, formValues) {
-          const [result, processNodeMap, deliveryMethodMap, logisticsCompanyMap] =
-            await Promise.all([
-              listPrescriptionsMethod(
-                page.currentPage,
-                page.pageSize,
-                formValues,
-              ),
-              getProcessNodeLabelMap(),
-              getDeliveryMethodLabelMap(),
-              getLogisticsCompanyLabelMap(),
-            ]);
+          const [
+            result,
+            processNodeMap,
+            deliveryMethodMap,
+            logisticsCompanyMap,
+            decoctionTypeMap,
+          ] = await Promise.all([
+            listPrescriptionsMethod(
+              page.currentPage,
+              page.pageSize,
+              formValues,
+            ),
+            getProcessNodeLabelMap(),
+            getDeliveryMethodLabelMap(),
+            getLogisticsCompanyLabelMap(),
+            getDecoctionTypeLabelMap(),
+          ]);
           return {
             ...result,
             items: result.items.map((item) => ({
@@ -55,6 +63,10 @@ const [Grid] = useVbenVxeGrid({
                 item.processStatus,
                 processNodeMap,
               ),
+              decoctionMethod: resolveDecoctionTypeLabel(
+                item.decoctionMethod,
+                decoctionTypeMap,
+              ),
               deliveryMethod: resolveDeliveryMethodLabel(
                 item.deliveryMethod,
                 deliveryMethodMap,