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

+ 5 - 1
src/components/PatientHealthRecordPreview.vue

@@ -76,7 +76,11 @@ const panels = shallowReactive([
     title: '就诊随访',
     component: defineAsyncComponent(() => import('@/widgets/PatientFollowUpRecordsWidget.vue')),
   },
-  { id: 'patient-service-records', title: '调养记录', disabled: true },
+  {
+    id: 'patient-service-records',
+    title: '调养记录',
+    component: defineAsyncComponent(() => import('@/widgets/PatientCareRecordsWidget.vue')),
+  },
   {
     id: 'patient-health-records',
     title: '健康分析记录',

+ 2 - 0
src/model/care.model.ts

@@ -19,6 +19,7 @@ export interface SystemItemModel {
   addType?: 'system' | 'itemsList' | 'confirm'; // 新增类型 system 系统调理包 itemsList 项目列表 confirm 确认项目
   id?: string; //调理方案ID
   name?: string; // 项目名称
+  sourceId?: string; // 来源id
   conditioningProgramType?: string; // 	调理方案类型
   collaborateDeptId?: number; // 合作机构ID
   conditioningProgramTypes?: string[]; // 调理方案类型
@@ -120,6 +121,7 @@ export interface SystemCwModel {
   status?: string; // 系统开关
   items: {
     id: string; //调理包明细id
+    sourceId?: string; // 来源id
     conditioningWrapId: string; // 系统调理包ID
     conditioningProgramId: number; // 调理方案ID
     conditioningProgramDetail: {

+ 9 - 34
src/pages/index/care/issueService.vue

@@ -176,7 +176,6 @@ async function getCpRecordDetail(id: string) {
   });
 }
 function getPatientList(id: string) {
-  // console.log(id, '切换');
   if (id) {
     getCpDetail(id);
     loadTags(id);
@@ -246,12 +245,11 @@ async function selectPatient(item: any) {
 const btnType = ref('');
 // 打开调养记录
 function openRecord(item: any) {
+  const status=currentPatient.value.status;
   const types = 'record';
   VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
     title: '调养记录',
-    // height: 700,
-    // width: 1200,
     height: window.innerHeight,
     width: window.innerWidth,
     escClosable: true,
@@ -259,7 +257,13 @@ function openRecord(item: any) {
     slots: {
       default() {
         return h(ServicePackageDetail, <any>{
-          data: { ...item, types },
+          data: { ...item, types ,status},
+          onSubmit(data: any) {
+            selectedPackage.value=data.conditioningWrapId;
+            formData.items = data?.items ?? [];
+            form.conditioningWrapName = data.conditioningWrapName;
+            form.conditioningWrapId = data.conditioningWrapId;
+          },
         });
       },
     },
@@ -399,7 +403,6 @@ function onSelectProject({ row }: any) {
     },
     remark: '',
   });
-  console.log(formData.items, '添加项目之后');
   // 关闭弹窗
   showProjectPopover.value = false;
   // 清空搜索
@@ -515,7 +518,6 @@ function calculateCount(row: any) {
   const frequency = Number(row.frequencyMeasure) || 0;
   const maxCount = row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.max;
   const acCount = (row.acuMeridianNames?.length ?? 0) + (row.acuPointNames?.length ?? 0);
-  // console.log(row, '添加计算数量的函数', pricingType, row.conditioningProgramDetail.pricingType);
   // 一口价
   if (pricingType === '0') {
     // 检查是否选择了"不限"
@@ -535,14 +537,12 @@ function calculateCount(row: any) {
     // 按穴位计价
     const frequencyType = Number(row.frequencyType) || 0;
     row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
-    // console.log(row.totalMeasure, 'row.totalMeasure', acCount, maxCount);
     if (acCount > maxCount) {
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
         // 单价
         if (acCount > 0) {
           let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
           row.unitPrice = unitPrice;
-          // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
           row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
         } else {
           row.unitPrice = '-';
@@ -552,48 +552,28 @@ function calculateCount(row: any) {
         // 一口价
         row.unitPrice = '-';
         row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[1].price;
-        // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
       }
     } else {
-      // console.log('数量很少', row.conditioningProgramDetail.cpDynamicPricingRule?.[0]);
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
         if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
           // 单价
           if (acCount > 0) {
             let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
             row.unitPrice = unitPrice;
-            // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
             row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
           } else {
             row.unitPrice = '-';
             row.totalPrice = 0;
           }
-          // console.log("数量很少",row.totalPrice,'row.unitPrice',row.unitPrice,'period',period,'frequencyType',frequencyType,'acCount',acCount)
         } else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 1) {
           // 一口价
           row.unitPrice = '-';
           row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
-          // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
         }
       }
     }
   }
 }
-// function calculateCount(row: any) {
-//   const convertDose = Number(row.conditioningProgramDetail.cpFixedPricingRule.convertDose) || 0;
-//   console.log(convertDose, 'convertDose');
-//   const period = Number(row.days) || 0;
-//   const frequency = Number(row.frequencyMeasure) || 0;
-//   let count = 0;
-//   count = Math.ceil(((period / (Number(row.frequencyType) || 1)) * frequency)/convertDose);
-//   row.totalMeasure = count;
-
-//   // 取单价
-//   const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
-//   // 计算总价
-//   row.totalPrice = (count * unitPrice).toFixed(2);
-// }
-
 // 添加监听器
 watch(totalPrice, (val) => {
   formData.price = val;
@@ -620,14 +600,9 @@ function handleCancel() {
 watch(
   () => formData.items,
   (newData) => {
-    // console.log(newData, 'newData');
     if (!newData) return;
     newData.forEach((row) => {
-      // console.log(row, '数据更新');
       calculateCount(row);
-      // if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
-      //   calculateCount(row);
-      // }
     });
   },
   { deep: true }
@@ -991,7 +966,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
             <span>{{ form.conditioningWrapName }}</span>
           </template>
           <template v-else>
-            <a-select v-model:value="selectedPackage" style="width: 180px" placeholder="请选择服务包">
+            <a-select v-model:value="selectedPackage" style="width: 180px" placeholder="请选择服务包" >
               <a-select-option v-for="item in lifeCwData" :key="item.id" :value="item.id" @click="selectCw(item)">
                 {{ item.name }}
               </a-select-option>

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

@@ -40,7 +40,7 @@ export function getAllSystemCpMethod() {
     cacheFor: null,
   });
 }
-// 新增和编辑系统项目和新增编辑项目列表
+// 新增和编辑系统项目和新增编辑项目列表。  项目列表就是机构项目
 export function systemCpEditMethod(data: Partial<SystemItemModel>) {
   // console.log(data, '新增和编辑项目1111111111');
   if(data.addType === 'system'){
@@ -158,7 +158,7 @@ export function getSystemCwDetailMethod(data: Partial<SystemCwModel>) {
 }
 // 根据调理方案id获取调理方案详情
 export function getConditioningSchemeDetailMethod(data: Partial<SystemCwModel>) {
-  return request.Post(`/fdhb-pc/conditioningManage/program/getCpDetailById/${data.id}`, {
+  return request.Post(`/fdhb-pc/conditioningManage/program/getCpDetailById/${data.id || data.sourceId}`, {
     name: 'get-system-cw-detail',
     cacheFor: null,
   });

+ 12 - 4
src/service/AddItems.vue

@@ -1,6 +1,6 @@
 <script lang="ts" setup>
 import { ref, watch } from 'vue';
-import { Form, message } from 'ant-design-vue';
+import {  message } from 'ant-design-vue';
 import { PlusOutlined } from '@ant-design/icons-vue'; // 确保导入
 import VxeUI from 'vxe-table';
 import { useRequest } from 'alova/client';
@@ -45,6 +45,7 @@ const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data })
       : [];
   };
   branch.value = to(data);
+  console.log(branch.value, '获取所有的机构');
 });
 const form = reactive<SystemModel>({
   institutionName: '',
@@ -209,16 +210,16 @@ async function getConditioningProgramType() {
 }
 
 onMounted(async () => {
+  console.log(props.data, '获取传来的数据');
   const deptId = localStorage.getItem('deptId');
   if (props.data.addType === 'system' && deptId) {
     form.institutionId = deptId;
   }
-
   if (props.data.addType === 'system') {
     isRequired.value = false;
   }
   form.addType = props.data.addType;
-  if (props.data.id) {
+  if (props.data.id || props.data.sourceId) {
     const res: any = await getConditioningSchemeDetailMethod(props.data);
     Object.assign(form, res);
     form.cpMedicines = (res.cpMedicines ?? []).map((item: any) => ({
@@ -238,11 +239,18 @@ onMounted(async () => {
           },
         ]
       : [];
+    console.log(props.data, 'form==>');
+    if (props.data.addType === 'itemsList' && props.data.sourceId) {
+      form.sourceId = form.id;
+      form.institutionId='';
+      delete form.id;
+    }
   }
   // 获取供应商
   // getSupplier({});
   // 获取方案类型
   getConditioningProgramType();
+  console.log(form, 'form==>');
 });
 const emits = defineEmits<{
   submit: [data?: SystemItemModel];
@@ -419,7 +427,7 @@ function handleSelect(value: string, node: any, extra: any) {
         <a-input v-model:value="form.effect" placeholder="请输入" />
       </a-form-item>
       <!-- 机构名称 -->
-      <a-form-item label="机构名称:" v-if="form?.addType === 'itemsList'" required name="institutionId">
+      <a-form-item label="机构名称:" v-if="form?.addType === 'itemsList' && form?.id" required name="institutionId">
         <a-tree-select
           v-model:value="form.institutionId"
           style="width: 100%"

+ 11 - 3
src/service/EditSystemService.vue

@@ -176,6 +176,7 @@ const filteredProjects = computed(() => {
 });
 
 function onSelectProject({ row }: any) {
+  console.log(row, '选择添加的项目');
   if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
     notification.warning({
       message: '不能重复添加该项目',
@@ -195,7 +196,9 @@ function onSelectProject({ row }: any) {
     totalMeasure: '',
     totalPrice: '',
     initialDay: '',
+    // 经络
     cwcpAcuMeridians: row?.cwcpAcuMeridians ?? [],
+    // 穴位
     cwcpAcuPoints: row?.cwcpAcuPoints ?? [],
     conditioningProgramDetail: {
       ...row,
@@ -217,6 +220,7 @@ function onSelectProject({ row }: any) {
       photo: row?.photo,
       conditioningProgramSupplierName: row?.conditioningProgramSupplierName,
     },
+    // 备注
     remark: row?.remark,
   });
 
@@ -375,7 +379,9 @@ function calculateCount(row: any) {
 // 添加监听器
 watch(
   () => formData.items,
-  (newData) => {
+  (newData,oldData) => {
+    // console.log(newData, 'newData');
+    // console.log(oldData, 'oldData');
     if (!newData) return;
     newData.forEach((row: any) => {
       if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
@@ -541,6 +547,7 @@ onMounted(async () => {
 });
 
 const tableData = computed(() => {
+  // console.log(formData.items, 'tableData');
   return [...(formData.items ?? []), { ...emptyRow }];
 });
 
@@ -552,8 +559,6 @@ function removeTableRow(idx: number) {
 // 引入服务包
 function addInstitution() {
   deptId.value = localStorage.getItem('deptId') || '';
-  console.log(deptId.value, '当前机构');
-  console.log(formData.institutionId, '选择的机构');
   VxeUI.modal.open({
     title: '选择引入',
     width: 1000,
@@ -569,6 +574,7 @@ function addInstitution() {
           data: formData,
           institutionId: formData.institutionId ? formData.institutionId : deptId.value,
           onSubmit(data: SystemCwModel) {
+            console.log(data, '引入服务包');
             VxeUI.modal.close(`systemService-list-modal`);
           },
         });
@@ -891,7 +897,9 @@ function openPopover() {
           </template>
         </vxe-column>
         <vxe-column field="remark" title="说明" width="180">
+         
           <template #default="{ row }">
+            <!-- <div>说明star:{{ row.remark }}:说明结束</div> -->
             <a-textarea v-model:value="row.remark" style="max-width: 180px; width: 100%; height: 50px" :rows="2" show-count :maxLength="200" />
           </template>
         </vxe-column>

+ 0 - 1
src/service/HealthEvaluation.vue

@@ -37,7 +37,6 @@ function onOk() {
       emits('change');
     });
   } else {
-    console.log(props.data, '提交逻辑');
     // 提交逻辑
     onOkSubmit(props.data);
   }

+ 65 - 51
src/service/IntroduceProjectList.vue

@@ -3,13 +3,15 @@ import { ref, onMounted, reactive } from 'vue';
 import type { SystemItemModel, SystemCwModel } from '@/model/care.model';
 import { VxeUI } from 'vxe-pc-ui';
 import { getCopyCwMethod } from '@/request/api/care.api';
+import AddItems from '@/service/addItems.vue';
+import HealthEvaluation from '@/service/HealthEvaluation.vue';
 
 const emit = defineEmits<{
-  submit: [data: any]
+  submit: [data: any];
 }>();
 const tableData = ref<SystemItemModel[]>([]);
 type FollowModel = Partial<SystemCwModel>;
-const props = defineProps<{ data: FollowModel; id: number | string; institutionId: number | string;  }>();
+const props = defineProps<{ data: FollowModel; id: number | string; institutionId: number | string }>();
 // 引入已有项目
 async function handleAdd() {
   // 关闭引入服务包弹窗
@@ -23,32 +25,40 @@ function handleCancel() {
   VxeUI.modal.close(`introduceProjectList-modal`);
 }
 const detailData = ref<any>({});
+
+const dataObj = reactive({
+  types: 'institution',
+  id: props.id,
+  institutionId: props.institutionId,
+});
+// 获取详情数据
+async function getDetailData(data?: SystemItemModel) {
+  console.log(data, '点击确定');
+  const res: any = await getCopyCwMethod(dataObj as Partial<SystemCwModel>);
+  if (res && res.items && res.items.length > 0) {
+    tableData.value = res.items;
+  }
+}
 onMounted(async () => {
-  const dataObj = reactive({
-    types: 'institution',
-    id: props.id,
-    institutionId: props.institutionId,
-  });
-  const res: any = await getCopyCwMethod(dataObj);
+  const res: any = await getCopyCwMethod(dataObj as Partial<SystemCwModel>);
   detailData.value = res;
   if (res && res.items && res.items.length > 0) {
     tableData.value = res.items;
 
-    if (res && res.items && res.items.length > 0) {
-      res.items.forEach((item: any) => {
-        delete item.conditioningProgramDetail.id;
-      });
-    }
+    
   }
 });
 const checked = ref(true);
 function addProject(row: any) {
-  console.log(row,'添加项目');
-  const addType = 'system';
+  console.log(row, '添加项目');
+  row.sourceId = row.id;
+  delete row.id;
+  const addType = 'itemsList';
+ 
   if (row?.isErasable === 'N') {
     // 健康咨询 健康评估 x显示
     VxeUI.modal.open({
-      title:row?.conditioningProgramType,
+      title: row?.conditioningProgramType,
       height: 400,
       width: 750,
       id: `health-consultation-modal`,
@@ -61,58 +71,62 @@ function addProject(row: any) {
               ...row,
               addType,
             },
+            onSubmit(data?: SystemItemModel) {
+              console.log(data, '点击确定');
+              // 点击确定 刷新列表
+              getDetailData();
+              VxeUI.modal.close(`health-consultation-modal`);
+            },
           });
         },
       },
     });
   } else {
-  VxeUI.modal.open({
-    id: 'add-items-modal',
-    title: '新增项目',
-    width: 1000,
-    height: 700,
-    escClosable: true,
-    destroyOnClose: true,
-    slots: {
-      default() {
-        return h(AddItems, {
-          data: {
-            ...row,
-            addType,
-          },
-          onSubmit(data: SystemItemModel) {
-            // 点击确定 刷新列表
-            VxeUI.modal.close(`add-items-modal`);
-          },
-        });
+    VxeUI.modal.open({
+      id: 'add-items-modal',
+      title: '新增项目',
+      width: 1000,
+      height: 700,
+      escClosable: true,
+      destroyOnClose: true,
+      slots: {
+        default() {
+          return h(AddItems, {
+            data: {
+              ...row,
+              addType,
+            },
+            onSubmit(data?: SystemItemModel) {
+              console.log(data, '点击确定刷新列表');
+              // 点击确定 刷新列表
+              getDetailData();
+              VxeUI.modal.close(`add-items-modal`);
+            },
+          });
+        },
       },
-    },
-  });
-}
+    });
+  }
 }
 </script>
 
 <template>
   <div style="background: #fff; border-radius: 6px">
-    <vxe-table :data="tableData" border :row-class-name="({ row }) => (!row.canImport ? 'highlight-row' : '')">
+    <vxe-table :data="tableData" border :row-class-name="({ row }) => (row.isForCopyCw === 'N' ? 'highlight-row' : '')">
       <vxe-column field="conditioningProgramDetail.name" title="项目名称" />
       <vxe-column field="conditioningProgramDetail.conditioningProgramType" title="方案类型" />
-      <vxe-column title="是否可引入"  align="center">
+
+      <vxe-column title="是否可引入" align="center">
         <template #default="{ row }">
-          <a-checkbox v-model:checked="checked" disabled />
+          <span v-if="row.isForCopyCw !== 'Y'" style="color: #f5222d; font-size: 11px">机构没有此项目,请先维护</span>
+          <a-checkbox v-else v-model:checked="checked" />
         </template>
       </vxe-column>
-      <!-- <vxe-column title="是否可引入"  align="center">
+      <vxe-column field="conditioningProgramDetail" title="操作" align="center">
         <template #default="{ row }">
-          <span v-if="!row.conditioningProgramDetail.ischeck" style="color: #f5222d;">{{ row.conditioningProgramDetail.reason }}</span>
-          <a-checkbox v-else v-model:checked="checked" disabled />
+          <a-button type="primary" @click="addProject(row.conditioningProgramDetail)" v-if="row.isForCopyCw === 'N'">新增</a-button>
         </template>
-      </vxe-column> -->
-      <!-- <vxe-column field="conditioningProgramDetail" title="操作" >
-        <template #default="{ row }">
-          <a-button type="primary" @click="addProject(row.conditioningProgramDetail)" v-if="!row.conditioningProgramDetail.ischeck">新增</a-button>
-        </template>
-      </vxe-column> -->
+      </vxe-column>
     </vxe-table>
     <div style="display: flex; justify-content: center; margin-top: 24px">
       <a-button style="margin-right: 24px" @click="handleCancel">取消</a-button>
@@ -123,6 +137,6 @@ function addProject(row: any) {
 
 <style scoped>
 .highlight-row {
-  background: #f8f5e6 !important;
+  background: red !important;
 }
 </style>

+ 11 - 8
src/service/ServicePackageDetail.vue

@@ -39,8 +39,11 @@ function handleChangePlan() {
 function handleViewRecord(model?: ConditioningRecordListModel) {
   VxeUI.modal.open({
     title: model?.id ? `调养过程` : `新增调养过程`,
-    height: 700,
-    width: 1200,
+    // height: 700,
+    // width: 1200,
+    width: window.innerWidth,
+    height: window.innerHeight,
+    fullscreen: true,
     position: {
       top: Math.min(100, window.innerHeight * 0.1),
     },
@@ -180,7 +183,7 @@ function handleVoid() {
 
     <!-- 表格和作废字样包裹层 -->
     <div class="table-wrapper">
-      <!-- <div v-if="tableData.progress === '1'" class="voided-stamp">作废</div> -->
+      <div v-if="tableData.progress === '1'" class="voided-stamp">作废</div>
       <vxe-table :data="tableData?.items" border>
         <vxe-column field="conditioningProgramDetail.name" title="项目名称" align="center" />
         <vxe-column field="days" title="周期" align="center" :disabled="true" />
@@ -221,11 +224,11 @@ function handleVoid() {
       >
     </div>
     <!-- 按钮区,作废后隐藏 -->
-    <!-- <div class="footer-btns">
-      <a-button type="primary" style="margin-right: 24px" @click="handleChangePlan" v-if="props.data.title === '调养方案'">转方案</a-button>
-      <a-button @click="handleVoid" v-if="tableData.progress !== '1'" >作废</a-button>
-      <a-button type="primary" style="margin-left: 24px" @click="handleViewRecord(props.data)" v-if="isVoided && tableData.progress !== '1'">查看记录</a-button>
-    </div> -->
+    <div class="footer-btns">
+      <a-button type="primary" style="margin-right: 24px" @click="handleChangePlan" v-if="props.data.status === '1'">转方案</a-button>
+      <a-button @click="handleVoid" v-if="tableData.progress === '0'" >作废</a-button>
+      <a-button type="primary" style="margin-left: 24px" @click="handleViewRecord(props.data)">查看记录</a-button>
+    </div>
 
   </div>
 </template>

+ 11 - 10
src/service/ServicePackageList.vue

@@ -21,13 +21,17 @@ onSuccess(({ data: { data } }) => {
 });
 const id = ref<string>('');
 async function handleSubmit() {
+  
   const res: any = await getCopyCwMethod(parms.value);
   if (res && res.items && res.items.length > 0) {
     res.items.forEach((item: any) => {
       delete item.conditioningProgramDetail.id;
       item.frequencyTypeing = item.frequencyType ? [item.frequencyType] : [];
     });
-    props.data.items = [...res.items];
+    const newItems = res.items.filter((item: any) => {
+      return item.isForCopyCw == 'Y';
+    });
+    props.data.items = [...newItems];
     props.data.price = res.price;
     props.data.name = res.name;
     if (res.conditioningWrapPatientMatchRule) {
@@ -44,15 +48,11 @@ const parms = ref<any>({});
 async function handleSelect(model?: SystemCwModel) {
   if (model?.id) {
     id.value = model.id;
-    try {
-      parms.value = {
-        types: 'institution',
-        id: model.id,
-        institutionId: props.institutionId,
-      };
-    } catch (err) {
-      console.error('Error fetching data:', err);
-    }
+    parms.value = {
+      types: 'institution',
+      id: model.id,
+      institutionId: props.institutionId,
+    };
   }
   // 这里写你的选择逻辑
   VxeUI.modal.open({
@@ -71,6 +71,7 @@ async function handleSelect(model?: SystemCwModel) {
           id: id.value,
           institutionId: props.institutionId,
           onSubmit() {
+            // 提交之后刷新列表
             handleSubmit();
             VxeUI.modal.close(`introduceProjectList-modal`);
           },

+ 157 - 0
src/widgets/PatientCareRecordsWidget.vue

@@ -0,0 +1,157 @@
+<script setup lang="ts">
+import { usePagination } from 'alova/client';
+import { getConditioningRecordMethod } from '@/request/api/care.api';
+import type { VxeGridInstance, VxeGridListeners, VxeGridProps } from 'vxe-table';
+import { VxeUI } from 'vxe-pc-ui';
+import type { FollowUpEvaluationReportVO } from '@/model/follow-up-report.model';
+import type { ConditioningRecordListModel } from '@/model/care.model';
+import ServicePackageDetail from '@/service/ServicePackageDetail.vue';
+import CareProcess from '@/service/CareProgress.vue';
+const props = defineProps<{ patient: { id: string } }>();
+
+const grid = ref<VxeGridInstance>();
+const { data, loading, page, isLastPage, refresh } = usePagination((page, size) => getConditioningRecordMethod(page, size, { patientId: props.patient.id }), {
+  initialData: { total: 0, data: [] },
+  initialPage: 0,
+  initialPageSize: 100,
+  append: true,
+  // watchingStates: [() => props.patient.id],
+}).onSuccess(({ data: { data } }) => {});
+const gridOptions = reactive<VxeGridProps<ConditioningRecordListModel>>({
+  // @ts-ignore
+  loading,
+  height: 'auto',
+  headerAlign: 'center',
+  align: 'center',
+  columnConfig: {
+    resizable: true,
+  },
+  columns: [
+    { type: 'seq', width: 70, fixed: 'left' },
+    { field: 'patientName', title: '姓名' },
+    { field: 'conditioningWrapName', title: '服务包名称' },
+    { field: 'diagnosis', title: '疾病名称' },
+    { field: 'symptom', title: '证型' },
+    { field: 'constitutionGroupName', title: '体质' },
+    { field: 'createBy', title: '开具医生' },
+    { field: 'estimatedStartDate', title: '开始调养日期' },
+    { field: 'progress', title: '调理状态', slots: { default: 'patients' } },
+    {
+      field: 'action',
+      title: '操作',
+      align: 'center',
+      width: 120,
+      cellRender: {
+        name: 'VxeButtonGroup',
+        props: {
+          mode: 'text',
+        },
+        options: [
+          { content: '详情', status: 'primary', name: 'serviceDetail' },
+          { content: '调养过程', status: 'primary', name: 'conditioningProcess' },
+        ],
+        events: {
+          click({ row, rowIndex }: { row: ConditioningRecordListModel; rowIndex: number }, { name }: { name: string }) {
+            let method;
+            if (name === 'serviceDetail') {
+              method = serviceDetail;
+            } else if (name === 'conditioningProcess') {
+              method = conditioningProcess;
+            }
+            method?.(row, rowIndex);
+          },
+        },
+      },
+    },
+  ],
+  // @ts-ignore
+  data,
+  scrollY: {
+    gt: 0,
+  },
+});
+// 调养过程
+function conditioningProcess(model?: ConditioningRecordListModel) {
+  VxeUI.modal.open({
+    title: model?.id ? `调养过程` : `新增调养过程`,
+    height: window.innerHeight,
+    width: window.innerWidth,
+    fullscreen: true,
+    escClosable: true,
+    destroyOnClose: true,
+    id: `conditioning-process-modal`,
+    remember: true,
+    storage: true,
+    slots: {
+      default() {
+        return h(CareProcess, <any>{
+          data: model,
+          onSubmit(data: ConditioningRecordListModel) {
+            refresh(page.value);
+            VxeUI.modal.close(`conditioning-process-modal`);
+          },
+        });
+      },
+    },
+  });
+}
+// 调养记录详情
+function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
+  const types = 'record';
+  VxeUI.modal.open({
+    id: 'servicePackageDetail-modal',
+    title: '服务包详情',
+    height: window.innerHeight,
+    width: window.innerWidth,
+    fullscreen: true,
+    escClosable: true,
+    destroyOnClose: true,
+    slots: {
+      default() {
+        return h(ServicePackageDetail, <any>{
+          data: {
+            ...model,
+            types,
+          },
+          onVoidSubmit(data: ConditioningRecordListModel) {
+            console.log(data, '作废之后刷新页面');
+            refresh(page.value);
+          },
+        });
+      },
+    },
+  });
+}
+
+const gridEvents: VxeGridListeners = {
+  scrollBoundary({ direction, isBottom }) {
+    if (isBottom && direction === 'bottom' && !isLastPage.value) page.value++;
+  },
+};
+</script>
+
+<template>
+  <vxe-grid ref="grid" v-bind="gridOptions" v-on="gridEvents">
+    <template #patients="{ row }">
+      <div>
+        {{
+          row.progress === '0'
+            ? '待付款'
+            : row.progress === '1'
+              ? '已作废'
+              : row.progress === '2'
+                ? '用户取消'
+                : row.progress === '3'
+                  ? '未开始'
+                  : row.progress === '4'
+                    ? '调理中'
+                    : row.progress === '5'
+                      ? '已完结'
+                      : ''
+        }}
+      </div>
+    </template>
+  </vxe-grid>
+</template>
+
+<style scoped lang="scss"></style>