Просмотр исходного кода

修改调养过程详情显示

张田田 10 месяцев назад
Родитель
Сommit
80b3b9e0f8

+ 4 - 2
src/pages/index/care/conditioningRecord.vue

@@ -157,12 +157,13 @@ function conditioningProcess(model?: ConditioningRecordListModel, index?: number
     // width: 1200,
     height: window.innerHeight,
     width: window.innerWidth,
+    fullscreen: true,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     // },
     escClosable: true,
     destroyOnClose: true,
-    id: `plan-modal`,
+    id: `care-process-modal`,
     remember: true,
     storage: true,
     slots: {
@@ -171,7 +172,7 @@ function conditioningProcess(model?: ConditioningRecordListModel, index?: number
           data: model,
           onSubmit(data: ConditioningRecordListModel) {
             refresh(page.value);
-            VxeUI.modal.close(`plan-modal`);
+            VxeUI.modal.close(`care-process-modal`);
           },
         });
       },
@@ -188,6 +189,7 @@ function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
     // width: 1200,
     height: window.innerHeight,
     width: window.innerWidth,
+    fullscreen: true,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     // },

+ 3 - 2
src/pages/index/care/institutionService.vue

@@ -217,8 +217,9 @@ function editInstitution(model?: SystemCwModel, index?: number) {
     title: model?.id ? `修改机构服务` : `新增机构服务`,
     // height: 700,
     // width: 1200,
-    height: '100vh',
-    width: '100vw',
+    height: window.innerHeight,
+    width: window.innerWidth,
+    fullscreen: true,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     //   left: Math.min(100, window.innerWidth * 0.1),

+ 18 - 7
src/pages/index/care/issueService.vue

@@ -86,8 +86,8 @@ const address = ref({
 const lifeCwData = ref([]);
 // 获取可用的服务包
 const suggestCwData = ref<string[]>([]);
-async function loadAvailableCw(patientId: string) {
-  const res: any = await getAvailableCwMethod(patientId);
+async function loadAvailableCw(patientId: string,patientConditioningRecordId:string) {
+  const res: any = await getAvailableCwMethod(patientId,patientConditioningRecordId);
   if (res.length > 0) {
     lifeCwData.value = res;
     // 筛选出可推荐的
@@ -196,7 +196,7 @@ onMounted(async () => {
     // 获取患者列表
     await getPatientList(currentPatient.value?.patientId || '');
     // 获取服务包选择列表
-    await loadAvailableCw(currentPatient.value?.patientId || '');
+    await loadAvailableCw(currentPatient.value?.patientId || '',currentPatient.value?.id || '');
   }
   if (currentPatient.value?.id) {
     // 获取调养记录
@@ -222,7 +222,7 @@ async function selectPatient(item: any) {
   currentPatient.value = item;
   // 获取患者信息
   await getPatientList(item.patientId);
-  await loadAvailableCw(item.patientId || '');
+  await loadAvailableCw(item.patientId || '',item.id || '');
   // 获取患者调养记录
   await getCpRecordDetail(item.id);
   // 清空服务包选择
@@ -669,7 +669,7 @@ async function handleSubmit() {
         // 获取患者列表
         await getPatientList(currentPatient.value?.patientId || '');
         // 获取服务包选择列表
-        await loadAvailableCw(currentPatient.value?.patientId || '');
+        await loadAvailableCw(currentPatient.value?.patientId || '',currentPatient.value?.id || '');
 
         // 获取调养记录
         await getCpRecordDetail(currentPatient.value?.id || '');
@@ -916,7 +916,10 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
     <!-- 左侧患者列表 -->
     <div class="left-panel">
       <a-input v-model:value="searchName" placeholder="输入姓名搜索" style="margin-bottom: 12px" />
-      <div v-if="filteredPatients.length > 0">
+      <div
+        v-if="filteredPatients.length > 0"
+        class="patient-list"
+      >
         <div
           class="patient-item"
           v-for="item in filteredPatients"
@@ -1240,8 +1243,16 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
   border-right: 1px solid #eee;
   padding: 16px 8px 0 16px;
   background: #fafbfc;
-  /* min-height: 100vh; */
   box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+  min-height: 0;
+}
+.patient-list {
+  flex: 1 1 0;
+  overflow: auto;
+  min-height: 0;
+  // 让内容撑满剩余空间
 }
 .patient-item {
   padding: 10px 0;

+ 3 - 3
src/pages/index/care/systemService.vue

@@ -184,7 +184,7 @@ function seeInstitution(model?: SystemCwModel, index?: number) {
     title: '系统服务',
     // height: 700,
     // width: 1000,
-      height: window.innerHeight,
+    height: window.innerHeight,
     width: window.innerWidth,
     escClosable: true,
     destroyOnClose: true,
@@ -233,8 +233,8 @@ function editSystemService(model?: SystemCwModel, index?: number) {
     <main class="flex-auto overflow-hidden">
       <vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" :loading="loading">
         <template #toolbar-extra>
-          <vxe-button style="margin-right: 12px;" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
-        </template>  
+          <vxe-button style="margin-right: 12px" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
+        </template>
       </vxe-grid>
     </main>
     <footer class="flex-none">

+ 2 - 3
src/request/api/care.api.ts

@@ -289,7 +289,6 @@ export function addConditioningSchemeMethod(data: Partial<OpenConditioningScheme
 
 // 根据调理包id获取调理包详情
 export function getConditioningRecordDetailMethod(data: Partial<SystemCwModel>) {
-  console.log('获取调理包详情',data);
   if(data.types === 'institution' || data.types === 'system'){
     // 机构调理包详情
     return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
@@ -377,8 +376,8 @@ export function getConditioningProcessMethod(id: number) {
   }); 
 }
 // 获取可用的服务包
-export function getAvailableCwMethod(patientId: string) {
-  return request.Post('/fdhb-pc/patientCrManage/getPatUsableCw', { patientId }, {
+export function getAvailableCwMethod(patientId: string,patientConditioningRecordId:string) {
+  return request.Post('/fdhb-pc/patientCrManage/getPatUsableCw', { patientId,patientConditioningRecordId }, {
     name: 'get-available-cw',
     cacheFor: null,
   });

+ 12 - 8
src/service/CareProgress.vue

@@ -240,10 +240,10 @@ function open(row: Model) {
         </vxe-table>
         <div class="mt-3">
           <div class="mb-1">
-            预定频率:每 {{ item.frequencyType }}天 {{ item.frequencyMeasure }}
-            {{ item?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}
+            预定频率:每 {{ item.frequencyType }} 天 {{ item.frequencyMeasure }}
+            {{ item?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit || '次'}}
           </div>
-          <div>操作指南:{{ item.remark }}</div>
+          <div v-if="item.remark">操作指南:{{ item.remark }}</div>
         </div>
       </div>
       <!-- 线上 -->
@@ -253,10 +253,10 @@ function open(row: Model) {
           <span>数量:{{ item.totalMeasure }}</span>
         </div>
         <div class="mb-1">
-          预定频率:每 {{ item.frequencyType }}天 {{ item.frequencyMeasure }}
-          {{ item?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}
+          预定频率:每 {{ item.frequencyType }} 天 {{ item.frequencyMeasure }}
+          {{ item?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit || '次'}}
         </div>
-        <div>操作指南:{{ item.remark }}</div>
+        <div v-if="item.remark">操作指南:{{ item.remark }}</div>
       </div>
       <!-- 健康评估 -->
       <div  class="project-section mb-3" v-if="item?.healthAnalysisReports">
@@ -277,10 +277,14 @@ function open(row: Model) {
         </vxe-table>
         <div class="mt-3">
           <div class="mb-1">
-          预定频率:每 {{ item?.frequencyType }}天 {{ item?.frequencyMeasure }}
+          预定频率:
+          <span v-if="item?.frequencyType==='不限'">不限</span>
+          <span v-else>每 {{ item?.frequencyType }}天 {{ item?.frequencyMeasure }}
           {{ item?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}
+        </span>
+       
         </div>
-        <div>操作指南:{{ item?.remark }}</div>
+        <div v-if="item?.remark">操作指南:{{ item?.remark }}</div>
         </div>
       </div>
    

+ 54 - 68
src/service/EditSystemService.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, computed, nextTick, h, watch, onMounted, openBlock } from 'vue';
+import { ref, computed, nextTick, h, watch, onMounted } from 'vue';
 import { notification } from 'ant-design-vue';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
 import { UploadIFile } from '@/request/api/follow.api';
@@ -68,34 +68,34 @@ const formData = reactive<FollowModel>({
     constitutionGroupNames: [],
     willillStateNames: [],
   },
-  cwPatientMatchRules: [
-    {
-      diagnoseDiseaseNames: [],
-      diagnoseSyndromeNames: [],
-      constitutionGroupNames: [],
-      diagnoseDisease: {
-        id: '',
-        code: '',
-        name: '',
-        optionalWords: '',
-        attributes: [],
-        children: [],
-      },
-      diagnoseSyndrome: {
-        code: '',
-        name: '',
-        analysis: '',
-        remark: '',
-      },
-      constitutionGroup: {
-        id: '',
-        code: '',
-        name: '',
-        definition: '',
-        remark: '',
-      },
-    },
-  ], // 适用情况
+  // cwPatientMatchRules: [
+  //   {
+  //     diagnoseDiseaseNames: [],
+  //     diagnoseSyndromeNames: [],
+  //     constitutionGroupNames: [],
+  //     diagnoseDisease: {
+  //       id: '',
+  //       code: '',
+  //       name: '',
+  //       optionalWords: '',
+  //       attributes: [],
+  //       children: [],
+  //     },
+  //     diagnoseSyndrome: {
+  //       code: '',
+  //       name: '',
+  //       analysis: '',
+  //       remark: '',
+  //     },
+  //     constitutionGroup: {
+  //       id: '',
+  //       code: '',
+  //       name: '',
+  //       definition: '',
+  //       remark: '',
+  //     },
+  //   },
+  // ], // 适用情况
   items: [], // Initialize as empty array
 });
 const emptyRow = {
@@ -176,23 +176,6 @@ watch(totalPrice, (val) => {
   formData.price = val;
 });
 
-// function addSituation() {
-//   if (!formData.cwPatientMatchRules) formData.cwPatientMatchRules = [];
-//   formData.cwPatientMatchRules.push({
-//     diagnoseDiseaseNames: [],
-//     diagnoseSyndromeNames: [],
-//     constitutionGroupNames: [],
-//     diagnoseDisease: { id: '', code: '', name: '' },
-//     diagnoseSyndrome: { code: '', name: '', analysis: '', remark: '' },
-//     constitutionGroup: { id: '', code: '', name: '', definition: '', remark: '' },
-//   });
-// }
-
-// function removeSituation(idx: number) {
-//   if (formData.cwPatientMatchRules) {
-//     formData.cwPatientMatchRules.splice(idx, 1);
-//   }
-// }
 const projectSearchRef = useTemplateRef<HTMLInputElement>('projectSearchRef');
 const projectSearchFocus = (visible: boolean) => {
   if (visible) setTimeout(() => projectSearchRef.value?.focus?.(), 300);
@@ -227,14 +210,6 @@ function onSelectProject({ row }: any) {
   }
   // 添加新行到主表格
   if (!formData.items) formData.items = [];
-  // if (row.cpDynamicPricingRule[0]?.priceType === 0) {
-  //   // 单价
-  //   let unitPrice: number = row.cpDynamicPricingRule[0].price;
-  //   row.unitPrice = unitPrice;
-  // } else if (row.cpDynamicPricingRule[0]?.priceType === 1) {
-  //   // 一口价
-  //   row.unitPrice = '-';
-  // }
   formData.items.push({
     id: '',
     conditioningWrapId: '',
@@ -278,7 +253,7 @@ function onSelectProject({ row }: any) {
 }
 // 预览
 
-function onPreview(row) {
+function onPreview(row: any) {
   if (row.conditioningProgramDetail.id) {
     // 这里写你的预览逻辑
     VxeUI.modal.open({
@@ -294,7 +269,7 @@ function onPreview(row) {
         default() {
           return h(ServiceDetail, {
             data: row.conditioningProgramDetail,
-            onSubmit: (data) => {
+            onSubmit: (data: any) => {
               VxeUI.modal.close(`preview-modal`);
             },
           });
@@ -474,9 +449,7 @@ function confirm() {
         VxeUI.modal.close(`edit-system-service-modal`);
       });
     } else if (props.data.types === 'institution') {
-      console.log(fileList.value, '机构服务包的形象照');
       if (fileList.value.length > 0) {
-        console.log(fileList.value, 'fileList.value');
         const upImg = fileList.value[0]?.response?.url || fileList.value[0]?.thumbUrl;
         formData.photo = upImg;
         fileList.value = upImg
@@ -553,20 +526,19 @@ onMounted(async () => {
     props.data.types = 'institution'; // Modify the local copy instead
     // 调编辑接口获取数据
     const res: any = await getConditioningRecordDetailMethod(props.data);
-    console.log(res, '获取详情');
     Object.assign(formData, res); // Use the response to update formData
     await nextTick(); // 确保视图更新
 
-    formData.conditioningWrapPatientMatchRule = res?.conditioningWrapPatientMatchRule ?? {
-      sex: '',
-      age: '',
-      diagnoseDiseaseNames: [],
-      diagnoseSyndromeNames: [],
-      constitutionGroupNames: [],
-      willillStateNames: [],
-    };
+    const matchRule = res?.conditioningWrapPatientMatchRule || {};
+    Object.assign(formData.conditioningWrapPatientMatchRule!, {
+      sex: matchRule.sex ?? '',
+      age: matchRule.age ?? '',
+      diagnoseDiseaseNames: Array.isArray(matchRule.diagnoseDiseaseNames) ? matchRule.diagnoseDiseaseNames : [],
+      diagnoseSyndromeNames: Array.isArray(matchRule.diagnoseSyndromeNames) ? matchRule.diagnoseSyndromeNames : [],
+      constitutionGroupNames: Array.isArray(matchRule.constitutionGroupNames) ? matchRule.constitutionGroupNames : [],
+      willillStateNames: Array.isArray(matchRule.willillStateNames) ? matchRule.willillStateNames : [],
+    });
     formData.items = res?.items ?? [];
-    console.log(res?.photo, 'res?.photo');
     fileList.value = res?.photo
       ? [
           {
@@ -640,10 +612,24 @@ const handlePreview = async (file: UploadFile) => {
   previewImg.value = file.response?.url ?? file.thumbUrl;
   visible.value = true;
 };
+function set(){
+  formData.items = [];
+  formData.name='';
+  formData.conditioningWrapPatientMatchRule = {
+    sex: '',
+    age: '',
+    diagnoseDiseaseNames: [],
+    diagnoseSyndromeNames: [],
+    constitutionGroupNames: [],
+    willillStateNames: [],
+  };
+}
 let multiple = ref<boolean>(true);
 function handleSelect(value: string, node: any, extra: any) {
+  set();
   formData.institutionId = value;
   formData.institutionName = node.label;
+
 }
 function openPopover() {
   showProjectPopover.value = true;

+ 2 - 2
src/service/ServiceDetail.vue

@@ -33,13 +33,13 @@ onMounted(async () => {
     <div class="flex" v-if="data?.pricingType==='0'">
       <div class="detail-item mr-10">
         <div class="label">单价:</div>
-        <div class="content">{{ data?.cpFixedPricingRule?.unitPrice }}</div>
+        <div class="content">{{ data?.cpFixedPricingRule?.unitPrice }}</div>
       </div>
       <div class="detail-item">
         <div class="label">计价单位:</div>
         <div class="flex">
           <div class="content mr-10">{{ data?.cpFixedPricingRule?.pricingUnit }}</div>
-          <div class="content">相当于{{ data?.cpFixedPricingRule?.convertDose }}(使用单位)</div>
+          <div class="content">相当于 {{ data?.cpFixedPricingRule?.convertDose }} {{ data?.cpFixedPricingRule?.convertUnit ? data?.cpFixedPricingRule?.convertUnit : '次' }}(使用单位)</div>
         </div>
       </div>
     </div>

+ 2 - 2
src/service/ServicePackageDetail.vue

@@ -52,7 +52,7 @@ const setVisible = (value: boolean): void => {
             <span>{{ tableData?.institutionName }}</span>
           </div>
           <!-- 服务包名称 -->
-          <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0">
+          <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0" v-if="tableData?.name">
             <span style="white-space: nowrap; margin-right: 8px">服务包名称:</span>
             <span>{{ tableData?.name }}</span>
           </div>
@@ -195,7 +195,7 @@ const setVisible = (value: boolean): void => {
 .status {
   background: #ff9800;
   color: #fff;
-  /* padding: 2px 12px; */
+  padding: 8px 12px;
   border-radius: 4px;
   margin-right: 12px;
   font-weight: bold;

+ 1 - 1
src/service/ServicePackageList.vue

@@ -54,7 +54,7 @@ async function handleSelect(model?: SystemCwModel) {
         };
       }
 
-      props.data.cwPatientMatchRules = model.cwPatientMatchRules;
+      // props.data.cwPatientMatchRules = model.cwPatientMatchRules;
       props.data.price = model.price;
       props.data.name = model.name;