Jelajahi Sumber

Merge branch 'feature/improveCare' of six.fe/health.admin into develop

zhangtiantian 10 bulan lalu
induk
melakukan
53b88a1dda

+ 0 - 2
src/libs/v-select-page/RemoteSelect.vue

@@ -27,7 +27,6 @@ const attrs = useAttrs() as {
   debounce?: number;
 };
 
-
 const [modelValue, modifiers] = defineModel<any, 'complex'>('value', {
   get(v: any) {
     if (!v || !v?.length) return [];
@@ -72,7 +71,6 @@ async function fetchSelectedData(keys: SelectPageKey[], callback: FetchSelectedD
 }
 
 function onSelect(items: Record<string, unknown>[]) {
-  // console.log('Selected items:', items);
   if (attrs.multiple) {
     emits('update', items);
   } else {

+ 15 - 11
src/model/care.model.ts

@@ -63,7 +63,7 @@ export interface SystemCwModel {
   diagnoseDiseaseNames?: string[]; // 疾病
   diagnoseSyndromeNames?: string[]; // 证型
   constitutionGroupNames?: string[]; // 体质
-  conditioningWrapPatientMatchRule?: {
+  conditioningWrapPatientMatchRule: {
     sex: string; // 性别
     age: string; // 年龄
     diagnoseDiseaseNames: string[]; // 疾病
@@ -78,6 +78,10 @@ export interface SystemCwModel {
     }[]; // 调养目的
   }; // 患者匹配规则
   cwPatientMatchRules: {
+    diagnoseDiseaseNames: string[];
+    diagnoseSyndromeNames: string[];
+    constitutionGroupNames: string[];
+
     // 疾病
     diagnoseDisease: {
       id: string;
@@ -130,15 +134,15 @@ export interface SystemCwModel {
         convertUnit: string; // 转换单位
       };
       cpDynamicPricingRule: {
-          min: number; // 最小值
-          max: number; // 最大值
-          priceType: number; // 价格类型
-          price: number; // 价格
+        min: number; // 最小值
+        max: number; // 最大值
+        priceType: number; // 价格类型
+        price: number; // 价格
       }[];
       cpMedicines: {
-          id: string; // 药品ID
-          name: string; // 中药标准名称
-          dosage: string; // 剂量
+        id: string; // 药品ID
+        name: string; // 中药标准名称
+        dosage: string; // 剂量
       }[];
       effect: string; // 功效
       isOffline?: string | null; // 是否线下
@@ -237,15 +241,15 @@ export interface OpenConditioningSchemeModel {
     willillSocialName: string; // 疾病社会影响
     willillFunctionName: string; // 疾病功能影响
     constitutionGroupName: string; // 体质
-  },
-  patientMedicalRecord:{
+  };
+  patientMedicalRecord: {
     patientId: string; // 患者ID
     institutionId: string; // 机构ID
     institutionName: string; // 机构名称
     diagnosis: string; // 疾病
     symptom: string; // 症型
     syndrome: string; // 证状
-  }
+  };
   provinceName: string; // 省
   cityName: string; // 市
   districtName: string; // 区

+ 19 - 16
src/pages/index/care/conditioningRecord.vue

@@ -82,7 +82,7 @@ const gridOptions = reactive<VxeGridProps<ConditioningRecordListModel>>({
     custom: true,
     zoom: true,
     slots: {
-      // buttons: 'handle',
+      buttons: 'handle',
       tools: 'toolbar-extra',
     },
   },
@@ -103,11 +103,9 @@ const gridOptions = reactive<VxeGridProps<ConditioningRecordListModel>>({
     { field: 'estimatedStartDate', title: '开始调养日期' },
     { field: 'progress', title: '调理状态', slots: { default: 'patients' } },
     {
-      field: 'action',
       title: '操作',
       align: 'center',
       width: 120,
-      showOverflow: false,
       cellRender: {
         name: 'VxeButtonGroup',
         props: {
@@ -140,7 +138,7 @@ const { loading, page, pageSize, total, onSuccess, replace, refresh, remove } =
   initialPage: 1,
   initialPageSize: 100,
   watchingStates: [model],
-  immediate: false,
+  immediate: true,
 });
 onSuccess(({ data: { data } }) => {
   gridRef.value?.loadData(data);
@@ -150,20 +148,21 @@ onMounted(() => {
   model.value = toRaw(searchFormProps.data);
 });
 
-function conditioningProcess(model?: ConditioningRecordListModel, index?: number) {
+function conditioningProcess(model?: ConditioningRecordListModel) {
+  console.log(model,"调养过程")
   VxeUI.modal.open({
     title: model?.id ? `调养过程` : `新增调养过程`,
+    height:window.innerHeight,
+    width:window.innerWidth,
+    fullscreen:true,  
     // height: 700,
     // width: 1200,
-    height: window.innerHeight,
-    width: window.innerWidth,
-    fullscreen: true,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     // },
     escClosable: true,
     destroyOnClose: true,
-    id: `care-process-modal`,
+    id: `conditioning-process-modal`,
     remember: true,
     storage: true,
     slots: {
@@ -172,7 +171,7 @@ function conditioningProcess(model?: ConditioningRecordListModel, index?: number
           data: model,
           onSubmit(data: ConditioningRecordListModel) {
             refresh(page.value);
-            VxeUI.modal.close(`care-process-modal`);
+            VxeUI.modal.close(`conditioning-process-modal`);
           },
         });
       },
@@ -181,15 +180,15 @@ function conditioningProcess(model?: ConditioningRecordListModel, index?: number
 }
 
 function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
-  const types='record'
+  const types='record';
     VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
-    title: '调养详情',
+    title: '服务包详情',
+    height:window.innerHeight,
+    width:window.innerWidth,  
+    fullscreen:true,
     // height: 700,
     // width: 1200,
-    height: window.innerHeight,
-    width: window.innerWidth,
-    fullscreen: true,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     // },
@@ -200,7 +199,11 @@ function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
         return h(ServicePackageDetail, <any>{
           data: {
             ...model,
-            types
+            types,
+          },
+          onVoidSubmit(data: ConditioningRecordListModel) {
+            console.log(data,"作废之后刷新页面")
+            refresh(page.value);
           },
         });
       },

+ 46 - 24
src/pages/index/care/issueService.vue

@@ -63,9 +63,13 @@ const form = reactive<FollowModel>({
   },
   items: [],
   provinceName: '',
+  provinceCode: '',
   cityName: '',
-  districtName: '',
+  cityCode: '',
+  // districtName: '',
+  // districtCode: '',
   areaName: '',
+  areaCode: '',
   detailAddress: '',
   phone: '',
   progress: '0',
@@ -162,11 +166,13 @@ async function getCpRecordDetail(id: string) {
     form.estimatedEndDate = res?.estimatedEndDate;
     form.provinceName = res?.provinceName;
     form.cityName = res?.cityName;
-    form.districtName = res?.districtName;
     form.areaName = res?.areaName;
     form.detailAddress = res?.detailAddress;
     form.phone = res?.phone;
     form.healthAnalysisReport = res.healthAnalysisReport;
+    selectedProvince.value=res.provinceCode;
+    selectedCity.value=res.cityCode;
+    selectedArea.value=res.areaCode
   });
 }
 function getPatientList(id: string) {
@@ -234,8 +240,10 @@ async function selectPatient(item: any) {
   // 清空服务包选择
   selectedPackage.value = '';
   currentSelectedPackage.value = null;
-}
+  btnType.value=''
 
+}
+const btnType = ref('');
 // 打开调养记录
 function openRecord(item: any) {
   const types = 'record';
@@ -487,13 +495,7 @@ const allProjects = ref<
     effect?: string;
   }>
 >([]);
-const {
-  loading: projectLoading,
-  onSuccess,
-  refresh,
-  remove,
-} = usePagination(() => getCpContentListMethod(), {
-  initialData: { data: [], total: 0 },
+const { loading: projectLoading, onSuccess } = useRequest(() => getCpContentListMethod(), {
   immediate: true,
 });
 onSuccess(({ data }) => {
@@ -728,10 +730,19 @@ async function loadAreas(name: string, citycode: string) {
 }
 
 function handleProvinceChange(value: string) {
+  if (btnType.value === '转方案') {
+    selectedCity.value = '';
+    selectedArea.value = '';
+    form.cityCode = '';
+    form.areaCode = '';
+    form.detailAddress=''
+
+  }
   selectedProvince.value = value;
   const selectedProvinceOption = provinceOptions.value.find((p) => p.value === value);
   form.provinceName = selectedProvinceOption?.label || '';
-
+  form.provinceCode = selectedProvinceOption?.value || '';
+  // 获取城市
   loadCities(selectedProvinceOption?.name, value);
 }
 
@@ -739,13 +750,23 @@ function handleCityChange(value: string) {
   selectedCity.value = value;
   const selectedCityOption = cityOptions.value.find((c) => c.value === value);
   form.cityName = selectedCityOption?.label || '';
+  form.cityCode = selectedCityOption?.value || '';
+  if (btnType.value === '转方案') {
+    selectedArea.value = '';
+    form.areaCode = '';
+    form.detailAddress=''
+  }
   loadAreas(selectedCityOption?.name, value);
 }
 
 function handleAreaChange(value: string) {
   selectedArea.value = value;
   const selectedAreaOption = areaOptions.value.find((a) => a.value === value);
-  form.districtName = selectedAreaOption?.label || '';
+  form.areaName = selectedAreaOption?.label || '';
+  form.areaCode = selectedAreaOption?.value || '';
+  if (btnType.value === '转方案') {
+    form.detailAddress=''
+  }
 }
 
 interface PatientInfo {
@@ -985,7 +1006,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
         <!-- 服务包内容表格 -->
         <div class="table-section">
           <div class="table-title">服务包内容</div>
-          <vxe-table :data="displayTableData" border style="margin-top: 8px">
+          <vxe-table :data="displayTableData" border style="margin-top: 8px" max-height="380px">
             <vxe-column width="60" title="">
               <template #default="{ rowIndex }">
                 <a-button type="text" danger @click="removeTableRow(rowIndex)" :disabled="rowIndex === displayTableData.length - 1">
@@ -1026,7 +1047,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
             <vxe-column field="days" title="周期" width="120">
               <template #default="{ row }">
                 <div style="display: flex; align-items: center">
-                  <a-input v-model:value="row.days" @change="() => calculateCount(row)" :disabled="currentPatient?.status === '0' ? true : false" />
+                  <a-input v-model:value="row.days" @change="() => calculateCount(row)" />
                   <span>天</span>
                 </div>
               </template>
@@ -1094,7 +1115,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
               <template #default="{ row }">
                 <div style="display: flex; align-items: center">
                   <span>调养开始第</span>
-                  <a-input v-model:value="row.initialDay" style="width: 80px" :disabled="currentPatient?.status === '0' ? true : false" />
+                  <a-input v-model:value="row.initialDay" style="width: 80px" />
                   <span>天</span>
                 </div>
               </template>
@@ -1138,7 +1159,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
         <!-- 调养日期 -->
         <div class="delivery-row">
           <span>开始调养日期:</span>
-          <span v-if="currentPatient?.status === '0'">
+          <span v-if="currentPatient?.status === '0' && btnType !== '转方案'">
             {{ form.estimatedStartDate }}
           </span>
           <span v-else>
@@ -1152,7 +1173,15 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
         </div>
         <!-- 配送信息 -->
         <div class="delivery-row" v-if="isShowDelivery">
-          <div v-if="!form.progress || currentPatient?.status === '1'">
+          <div v-if="(btnType !== '转方案' && currentPatient?.status === '0')">
+            <a-checkbox v-model:checked="deliveryChecked" disabled>配送</a-checkbox>
+            <span>地址:</span>
+            <span>{{ form.provinceName }}{{ form.cityName }}{{ form.areaName }}{{ form.detailAddress }}</span>
+            <span style="margin-left: 16px" v-if="form.phone">电话:</span>
+            <span>{{ form.phone }}</span>
+          </div>
+          <!-- <div v-if="!form.progress || currentPatient?.status === '1'"> -->
+          <div v-else>
             <a-checkbox v-model:checked="deliveryChecked">配送</a-checkbox>
             <template v-if="deliveryChecked">
               <span>地址:</span>
@@ -1178,13 +1207,6 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
               <a-input v-model:value="form.phone" placeholder="请输入" style="width: 120px" />
             </template>
           </div>
-          <div v-else>
-            <a-checkbox v-model:checked="deliveryChecked" disabled>配送</a-checkbox>
-            <span>地址:</span>
-            <span>{{ form.provinceName }}{{ form.cityName }}{{ form.districtName }}{{ form.detailAddress }}</span>
-            <span style="margin-left: 16px" v-if="form.phone">电话:</span>
-            <span>{{ form.phone }}</span>
-          </div>
         </div>
 
         <!-- 操作按钮 -->

+ 0 - 1
src/pages/index/care/text.vue

@@ -133,7 +133,6 @@ export default defineComponent({
 
     // 拖动结束
     const handleMouseUp = () => {
-      console.log('拖动结束')
       draggingIndex.value = null
       document.removeEventListener('mousemove', handleMouseMove)
       document.removeEventListener('mouseup', handleMouseUp)

+ 2 - 0
src/request/api/account.api.ts

@@ -58,12 +58,14 @@ export function getMenusMethod(account: AccountModel) {
         menus.push({ key: path, title, label: title });
       }
     }
+    console.log(menus, 'menus');
     return menus;
   };
 
   return request.Get<AccountModel, any[]>(`/system/menu/getRouters`, {
     headers: { Authorization: account.token },
     transform(data) {
+      console.log(data, '获取菜单');
       // data.push({
       //   path: '/care',
       //   meta: { title: '中医调养' },

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

@@ -12,7 +12,7 @@ export function supplierMethod(page: number, size: number, query?: SupplierQuery
 
 // 新增和编辑供应商
 export function supplierEditMethod(data: Partial<SupplierModel>) {
-  console.log(data, '新增和编辑供应商');
+  // console.log(data, '新增和编辑供应商');
   return data?.id
     ? request.Post(`/fdhb-pc/conditioningManage/supplier/updateCpSupplier`, { ...data, id: data.id }, { name: 'edit-supplier' })
     : request.Post(`/fdhb-pc/conditioningManage/supplier/addCpSupplier`, { ...data }, { name: 'edit-supplier' });
@@ -42,7 +42,7 @@ export function getAllSystemCpMethod() {
 }
 // 新增和编辑系统项目和新增编辑项目列表
 export function systemCpEditMethod(data: Partial<SystemItemModel>) {
-  console.log(data, '新增和编辑项目1111111111');
+  // console.log(data, '新增和编辑项目1111111111');
   if(data.addType === 'system'){
     return data?.id
       ? request.Post(`/fdhb-pc/conditioningManage/program/updateSystemCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
@@ -268,7 +268,7 @@ export function pageOrgCwMethod(page: number, size: number, query?: Record<strin
 // }
 // 新增机构调理包
 export function addOrgCwMethod(data: Partial<SystemCwModel>) {
-  console.log(data, '新增机构调理包');
+  // console.log(data, '新增机构调理包');
   return data?.id
     ? request.Post(`/fdhb-pc/conditioningManage/wrap/updateInstitutionCw`, { ...data, id: data.id }, { name: 'edit-org-cw' })
     : request.Post(`/fdhb-pc/conditioningManage/wrap/addInstitutionCw`, { ...data }, { name: 'add-org-cw' });
@@ -345,6 +345,13 @@ export function getPatientConditioningRecordMethod(id: number) {
     cacheFor: null,
   });
 }
+// 作废患者调理方案
+export function voidConditioningSchemeMethod(id: number) {
+  return request.Post(`/fdhb-pc/patientCrManage/repealPcr/${id}`, {
+    name: 'void-conditioning-scheme',
+    cacheFor: null,
+  });
+}
 // 获取省市区
 export function getProvinceMethod() {
   return request.Get('/fdhb-pc/region/regionCascadeProvince', {

+ 5 - 1
src/service/AddItems.vue

@@ -180,13 +180,16 @@ function cancel() {
   VxeUI.modal.close(`add-items-modal`);
 }
 function doSubmit() {
+  console.log(formRef.value, 'formRef==>');
+  console.log(form, 'Form Data Before Submit');
   formRef.value
     ?.validate()
     .then(() => {
       form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
       submit(form);
     })
-    .catch(() => {
+    .catch((error) => {
+      console.error('Validation Error:', error);
       message.error('请完善必填项');
     });
 }
@@ -243,6 +246,7 @@ onMounted(async () => {
 });
 const emits = defineEmits<{
   submit: [data?: SystemItemModel];
+  addSubmit: [data?: SystemItemModel];
 }>();
 const { loading: submitting, send: submit } = useRequest(systemCpEditMethod, {
   immediate: false,

+ 2 - 3
src/service/CareProgress.vue

@@ -39,7 +39,6 @@ const careProcessList = ref<OpenConditioningSchemeModel>();
 async function getCareProgress() {
   const res = await getConditioningProcessMethod(Number(props.data.id));
   careProcessList.value = res as OpenConditioningSchemeModel;
-  // console.log('调养效果数据:', careProcessList.value?.patientConditioningScores);
 }
 onMounted(async () => {
   if (props.data.id) {
@@ -199,7 +198,7 @@ function open(row: Model) {
               ? '用户取消'
               : careProcessList?.progress === '3'
                 ? '未开始'
-                : careProcessList.progress === '4'
+                : careProcessList?.progress === '4'
                   ? '调理中'
                   : careProcessList?.progress === '5'
                     ? '已完结'
@@ -222,7 +221,7 @@ function open(row: Model) {
     </div>
     <!-- 线上项目 -->
     <div v-for="item in careProcessList?.items" :key="item.id">
-      <div class="project-section" v-if="item.patientConditioningOfflines">
+      <div class="project-section" v-if="item?.patientConditioningOfflines">
         <div class="project-title">
           <span style="font-size: 14px; font-weight: bold">◇ {{ item?.conditioningProgramDetail?.name }}</span>
           <span class="stat">数量:{{ item.totalMeasure }}</span>

+ 2 - 2
src/service/EditSystemService.vue

@@ -282,7 +282,7 @@ function detailPreview(row: any) {
     });
     showProjectPopover.value = false;
   } else {
-    message.warning('请先添加服务包');
+    notification.warning({ message: '请先添加服务包' });
   }
 }
 function editPart(row: any) {
@@ -400,7 +400,7 @@ function confirm() {
       // 只要有一个长度大于0,就满足条件
       if (!hasMeridians && !hasPoints) {
         // 如果两个都没有,显示提示
-        message.warning('请至少选择一个穴位或经络');
+        notification.warning({ message: '请至少选择一个穴位或经络' });
         return false; // 返回 false 表示条件不满足
       }
     }

+ 56 - 2
src/service/IntroduceProjectList.vue

@@ -42,6 +42,54 @@ onMounted(async () => {
   }
 });
 const checked = ref(true);
+function addProject(row: any) {
+  console.log(row,'添加项目');
+  const addType = 'system';
+  if (row?.isErasable === 'N') {
+    // 健康咨询 健康评估 x显示
+    VxeUI.modal.open({
+      title:row?.conditioningProgramType,
+      height: 400,
+      width: 750,
+      id: `health-consultation-modal`,
+      remember: true,
+      storage: true,
+      slots: {
+        default() {
+          return h(HealthEvaluation, <any>{
+            data: {
+              ...row,
+              addType,
+            },
+          });
+        },
+      },
+    });
+  } 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`);
+          },
+        });
+      },
+    },
+  });
+}
+}
 </script>
 
 <template>
@@ -51,8 +99,14 @@ const checked = ref(true);
       <vxe-column field="conditioningProgramDetail.conditioningProgramType" title="方案类型" width="300" />
       <vxe-column title="是否可引入" width="200" align="center">
         <template #default="{ row }">
-          <a-checkbox v-if="true" v-model:checked="checked" disabled />
-          <span v-else style="color: #f5222d; margin-right: 8px; font-size: 8px">{{ row.reason }}</span>
+          <span v-if="!row.conditioningProgramDetail.ischeck" style="color: #f5222d;">{{ row.conditioningProgramDetail.reason }}</span>
+          <a-checkbox v-else v-model:checked="checked" disabled />
+         
+        </template>
+      </vxe-column>
+      <vxe-column field="conditioningProgramDetail" title="操作" width="200">
+        <template #default="{ row }">
+          <a-button type="primary" @click="addProject(row.conditioningProgramDetail)" v-if="!row.conditioningProgramDetail.ischeck">新增</a-button>
         </template>
       </vxe-column>
     </vxe-table>

+ 1 - 0
src/service/ServiceItemsSystem.vue

@@ -224,6 +224,7 @@ function seeItems(model?: SystemItemModel, index?: number) {
   }
 }
 function editItems(model?: SystemItemModel, index?: number) {
+  console.log(model,"编辑项目")
   const addType = 'system';
   console.log(model, 'model');
   if (model?.isErasable === 'N') {

+ 79 - 22
src/service/ServicePackageDetail.vue

@@ -1,31 +1,86 @@
 <script setup lang="ts">
-import { ref } from 'vue';
-import type { SystemCwModel } from '@/model/care.model';
-import { getConditioningRecordDetailMethod } from '@/request/api/care.api';
-import { notification } from 'ant-design-vue';
+import { ref, reactive } from 'vue';
+import { getConditioningRecordDetailMethod, voidConditioningSchemeMethod } from '@/request/api/care.api';
+import { usePagination, useRequest } from 'alova/client';
+import type { ConditioningRecordListModel, ConditioningRecordListQuery,SystemCwModel } from '@/model/care.model';
+import CareProcess from '@/service/CareProgress.vue';
+import { message, notification } from 'ant-design-vue';
+import VxeUI from 'vxe-table';
+const model = shallowRef<ConditioningRecordListQuery>();
 const props = defineProps<{
-  data: SystemCwModel;
+  data: ConditioningRecordListModel;
+}>();
+const isVoided = ref(true);
+const emit = defineEmits<{
+  (e: 'submit', data: SystemCwModel): void;
+  (e: 'voidSubmit', data: SystemCwModel): void;
 }>();
-const isVoided = ref(false);
-
 let tableData = ref<any>({});
-onMounted(async () => {
+async function getRecordDetail(){
   try {
     const res: any = await getConditioningRecordDetailMethod(props.data);
     tableData.value = res;
   } catch (error) {
     notification.error({ message: '获取数据失败' });
   }
+}
+onMounted(async () => {
+  await getRecordDetail();
 });
-const visible = ref<boolean>(false);
-const setVisible = (value: boolean): void => {
-  visible.value = value;
-};
+
+// 转方案
+function handleChangePlan() {
+  tableData.value.btnType = '转方案';
+  emit('submit', tableData.value as SystemCwModel);
+  VxeUI.modal.close('servicePackageDetail-modal');
+}
+
+// 查看记录
+function handleViewRecord(model?: ConditioningRecordListModel) {
+  console.log(model,'查看记录');
+  VxeUI.modal.open({
+    title: model?.id ? `调养过程` : `新增调养过程`,
+    height: 700,
+    width: 1200,
+    position: {
+      top: Math.min(100, window.innerHeight * 0.1),
+    },
+    escClosable: true,
+    destroyOnClose: true,
+    id: `plan-modal`,
+    remember: true,
+    storage: true,
+    slots: {
+      default() {
+        return h(CareProcess, <any>{
+          data: model,
+          onSubmit(data: ConditioningRecordListModel) {
+            VxeUI.modal.close(`plan-modal`);
+          },
+        });
+      },
+    },
+  });
+}
+
+// 作废
+ function handleVoid() {
+  voidConditioningSchemeMethod(Number(props.data.id)).then(async (res) => {
+    notification.success({
+      message: '作废成功',
+      description: '',
+    });
+    // 作废之后刷新详情列表
+    await getRecordDetail();
+    isVoided.value = false;
+    emit('voidSubmit', tableData.value as SystemCwModel);
+  });
+}
 </script>
 
 <template>
   <div class="service-package">
-    <h2 class="title">{{ tableData?.name }}</h2>
+    <h2 class="title">{{ tableData?.name || tableData?.conditioningWrapName }}</h2>
     <!-- 顶部信息 -->
     <div class="header">
       <span class="status" v-if="tableData?.progress">{{
@@ -114,7 +169,7 @@ const setVisible = (value: boolean): void => {
 
     <!-- 表格和作废字样包裹层 -->
     <div class="table-wrapper">
-      <div v-if="isVoided" 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" />
@@ -156,11 +211,11 @@ const setVisible = (value: boolean): void => {
     </div>
 
     <!-- 按钮区,作废后隐藏 -->
-    <!-- <div class="footer-btns" v-if="!isVoided">
-      <a-button type="primary" style="margin-right: 24px;">转方案</a-button>
-      <a-button @click="isVoided = true">作废</a-button>
-      <a-button type="primary" style="margin-left: 24px;">查看记录</a-button>
-    </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>
 </template>
 
@@ -171,16 +226,18 @@ const setVisible = (value: boolean): void => {
 .voided-stamp {
   position: absolute;
   left: 50%;
-  top: 32px;
+  top: 50px;
   transform: translateX(-50%) rotate(-15deg);
-  color: #e74c3c;
-  font-size: 64px;
+  color: #ff8f8d;
+  font-size: 40px;
   font-weight: bold;
   letter-spacing: 16px;
   opacity: 1;
   pointer-events: none;
   z-index: 10;
   user-select: none;
+  border-radius: 10px;
+  border: 5px solid #ff8f8d;
 }
 .service-package {
   padding: 0 10px;