Przeglądaj źródła

中医调养第二版

张田田 10 miesięcy temu
rodzic
commit
ea09527cce

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

@@ -24,7 +24,6 @@ const attrs = useAttrs() as {
   multiple?: boolean;
 };
 
-
 const [modelValue, modifiers] = defineModel<any, 'complex'>('value', {
   get(v: any) {
     if (!v || !v?.length) return [];
@@ -50,9 +49,7 @@ async function fetchData(data: PageParameters, callback: FetchDataCallback) {
 }
 
 async function fetchSelectedData(keys: SelectPageKey[], callback: FetchSelectedDataCallback) {
-  console.log('keys', attrs.multiple);
   if (attrs.multiple) {
-    console.log('111', keys);
     callback(
       keys.map((key) => ({
         [props.labelProp]: key,
@@ -70,7 +67,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 {

+ 4 - 4
src/libs/vxe/plugin.ts

@@ -69,10 +69,10 @@ function LazyVxeUIForForm(app: App) {
   app.use(VxeModal);
   app.use(VxeDrawer);
   app.use(VxeTooltip);
-  app.use(VxeTable);
-  app.use(VxeColumn);
-  app.use(VxeGrid);
-  app.use(VxeToolbar);
+  // app.use(VxeTable);
+  // app.use(VxeColumn);
+  // app.use(VxeGrid);
+  // app.use(VxeToolbar);
 }
 
 function LazyVxeUIForTable(app: App) {

+ 16 - 12
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; // 功效
       isOnline: string; // 是否线上
@@ -226,7 +230,7 @@ export interface OpenConditioningSchemeModel {
   symptom: string; // 症型
   conditioningWrapId: string; // 调理包ID
   conditioningWrapName: string; // 调理包名称
-  photo: string; // 调理包照片	
+  photo: string; // 调理包照片
   isDelivery: string; // 是否配送 Y N
   estimatedStartDate: string; // 调养日期
   estimatedEndDate: string; // 调养结束日期
@@ -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; // 区

+ 10 - 5
src/pages/index/care/conditioningRecord.vue

@@ -138,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);
@@ -148,7 +148,8 @@ 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: 700,
@@ -176,10 +177,10 @@ function conditioningProcess(model?: ConditioningRecordListModel, index?: number
 }
 
 function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
-  const type='record'
+  const type='record';
     VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
-    title: '系统服务',
+    title: '服务包详情',
     height: 700,
     width: 1200,
     position: {
@@ -192,7 +193,11 @@ function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
         return h(ServicePackageDetail, <any>{
           data: {
             ...model,
-            type
+            type,
+          },
+          onVoidSubmit(data: ConditioningRecordListModel) {
+            console.log(data,"作废之后刷新页面")
+            refresh(page.value);
           },
         });
       },

+ 4 - 4
src/pages/index/care/institutionService.vue

@@ -94,10 +94,10 @@ const gridOptions = reactive<VxeGridProps<SystemCwModel>>({
   toolbarConfig: {
     custom: true,
     zoom: true,
-    slots: {
-      buttons: 'handle',
-      tools: 'toolbar-extra',
-    },
+    // slots: {
+    //   buttons: 'handle',
+    //   tools: 'toolbar-extra',
+    // },
   },
   columnConfig: {
     resizable: true,

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

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useRoute } from 'vue-router';
 import { ref, computed, nextTick, h, watch, onMounted } from 'vue';
-import { MinusCircleOutlined, EyeOutlined } from '@ant-design/icons-vue';
+import { MinusCircleOutlined, EyeOutlined, DashOutlined } from '@ant-design/icons-vue';
 import { notification } from 'ant-design-vue';
 import { message } from 'ant-design-vue';
 import type { OpenConditioningSchemeModel, SystemCwModel } from '@/model/care.model';
@@ -59,9 +59,13 @@ const form = reactive<FollowModel>({
   },
   items: [],
   provinceName: '',
+  provinceCode: '',
   cityName: '',
-  districtName: '',
+  cityCode: '',
+  // districtName: '',
+  // districtCode: '',
   areaName: '',
+  areaCode: '',
   detailAddress: '',
   phone: '',
   progress: '0',
@@ -147,15 +151,16 @@ 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
   });
 }
 async function getPatientList(id: string) {
-  console.log(id, '切换');
   if (id) {
     getCpDetail(id);
     loadTags(id);
@@ -212,14 +217,17 @@ async function selectPatient(item: any) {
   // 清空服务包选择
   selectedPackage.value = '';
   currentSelectedPackage.value = null;
-}
+  btnType.value=''
 
+}
+const btnType = ref('');
 // 打开调养记录
-function openRecord(item: any) {
+async function openRecord(item: any) {
   const type = 'record';
+  const title = '调养方案';
   VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
-    title: '调养记录',
+    title: '服务包详情',
     height: 700,
     width: 1200,
     escClosable: true,
@@ -227,7 +235,24 @@ function openRecord(item: any) {
     slots: {
       default() {
         return h(ServicePackageDetail, <any>{
-          data: { ...item, type },
+          data: { ...item, type,title },
+          async onSubmit(data: SystemCwModel) {
+            form.conditioningWrapName = data?.conditioningWrapName;
+            selectedProvince.value = data?.provinceCode;
+            selectedCity.value = data?.cityCode;
+            selectedArea.value = data?.areaCode;
+            form.detailAddress = data?.detailAddress;
+            form.phone = data?.phone;
+            btnType.value = data?.btnType;
+            formData.items = data.items;
+            // 获取省份
+            await loadProvinces();
+            // 获取城市
+            loadCities('', data?.provinceCode);
+            // 获取区域
+            await loadAreas('', data?.cityCode);
+            // VxeUI.modal.close('servicePackageDetail-modal');
+          },
         });
       },
     },
@@ -309,7 +334,6 @@ const displayTableData = computed(() => {
 const isShowDelivery = ref<boolean>(false);
 // 监听 displayTableData 的变化
 watch(displayTableData, (newValue, oldValue) => {
-  console.log('displayTableData 变化了:', newValue);
   if (newValue.length > 0) {
     isShowDelivery.value = newValue.some((item) => {
       return item.conditioningProgramDetail?.isDelivery === 'Y';
@@ -481,13 +505,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 }) => {
@@ -632,10 +650,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);
 }
 
@@ -643,13 +670,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 {
@@ -791,7 +828,7 @@ watch(showProjectPopover, (val) => {
         <!-- 服务包内容表格 -->
         <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">
@@ -832,7 +869,7 @@ watch(showProjectPopover, (val) => {
             <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>
@@ -841,9 +878,9 @@ watch(showProjectPopover, (val) => {
               <template #default="{ row }">
                 <div style="display: flex; align-items: center">
                   <span>每</span>
-                  <a-input v-model:value="row.frequencyType" style="width: 60px" @change="() => calculateCount(row)" :disabled="currentPatient?.status === '0' ? true : false" />
+                  <a-input v-model:value="row.frequencyType" style="width: 60px" @change="() => calculateCount(row)" />
                   <span>天</span>
-                  <a-input v-model:value="row.frequencyMeasure" style="width: 60px" @change="() => calculateCount(row)" :disabled="currentPatient?.status === '0' ? true : false" />
+                  <a-input v-model:value="row.frequencyMeasure" style="width: 60px" @change="() => calculateCount(row)" />
                   <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}</span>
                 </div>
               </template>
@@ -877,7 +914,7 @@ watch(showProjectPopover, (val) => {
               <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>
@@ -901,7 +938,7 @@ watch(showProjectPopover, (val) => {
             </vxe-column>
             <vxe-column field="remark" title="说明" width="180">
               <template #default="{ row }">
-                <a-input v-model:value="row.remark" style="width: 120px" :disabled="currentPatient?.status === '0' ? true : false" />
+                <a-input v-model:value="row.remark" style="width: 120px" />
               </template>
             </vxe-column>
           </vxe-table>
@@ -913,7 +950,7 @@ watch(showProjectPopover, (val) => {
         <!-- 调养日期 -->
         <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>
@@ -927,7 +964,15 @@ watch(showProjectPopover, (val) => {
         </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>
@@ -953,13 +998,6 @@ watch(showProjectPopover, (val) => {
               <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>
 
         <!-- 操作按钮 -->
@@ -975,7 +1013,6 @@ watch(showProjectPopover, (val) => {
     <div class="right-panel">
       <PatientTagWidget
         style="min-height: 112px; flex: none"
-        :style="{ height: `${height}px` }"
         :dataset="tags"
         editable
         @refresh="loadTags(currentPatient.patientId)"

+ 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: '中医调养' },

+ 13 - 6
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,14 +42,14 @@ export function getAllSystemCpMethod() {
 }
 // 新增和编辑系统项目和新增编辑项目列表
 export function systemCpEditMethod(data: Partial<SystemItemModel>) {
-  console.log(data, '新增和编辑项目1111111111');
+  // console.log(data, '新增和编辑项目1111111111');
   if(data.addType === 'system'){
-    console.log(data, '新增和编辑系统项目');
+    // console.log(data, '新增和编辑系统项目');
     return data?.id
       ? request.Post(`/fdhb-pc/conditioningManage/program/updateSystemCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
     : request.Post(`/fdhb-pc/conditioningManage/program/addSystemCp`, { ...data }, { name: 'edit-system-cp' });
   }else if(data.addType === 'itemsList'){
-    console.log(data, '新增和编辑项目列表');
+    // console.log(data, '新增和编辑项目列表');
     return data?.id
       ? request.Post(`/fdhb-pc/conditioningManage/program/updateInstitutionCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
     : request.Post(`/fdhb-pc/conditioningManage/program/addInstitutionCp`, { ...data }, { name: 'edit-system-cp' });
@@ -255,7 +255,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' });
@@ -276,7 +276,7 @@ export function addConditioningSchemeMethod(data: Partial<OpenConditioningScheme
 
 // 根据调理包id获取调理包详情
 export function getConditioningRecordDetailMethod(data: Partial<SystemCwModel>) {
-  console.log('获取调理包详情',data);
+  // console.log('获取调理包详情',data);
   if(data.type === 'institution'){
     // 机构调理包详情
     return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
@@ -325,6 +325,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', {

+ 9 - 18
src/service/AddItems.vue

@@ -63,25 +63,15 @@ const rules = {
   pricingType: [{ required: true, message: '请选择计价规则', trigger: 'change' }],
   conditioningProgramSupplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
   institutionId: [{ required: true, message: '请选择机构名称', trigger: 'change' }],
-  isOnline: [{ required: true, message: '请选择线上项目', trigger: 'change' }],
+  // isOnline: [{ required: true, message: '请选择线上项目', trigger: 'change' }],
 };
 const isShowOnline = ref<boolean>(false);
 const isShowDelivery = ref<boolean>(false);
 const supplierArr = ref<any[]>([]);
-function getIsDelivery(newVal: any) {
-  // if (newVal) {
-  //     deliverArr.value = [newVal];
-  //     if (newVal === 'Y') {
-  //       isShowDelivery.value = true;
-  //     } else {
-  //       isShowDelivery.value = false;
-  //     }
-  //   }
-}
+
 
 // 获取所有的供应商
 async function getSupplier(params: any) {
-  console.log(params, 'params==>');
   const res = await getAllSupplierMethod(params);
   if (res && res.length > 0) {
     supplierArr.value = res;
@@ -94,18 +84,14 @@ async function getSupplier(params: any) {
 }
 function getIsOnline(e: any, newOnline: any, newDelivery: any, newType: any) {
   let filterSupplierArr = supplierArr.value.filter((item: any) => item.id === e);
-  console.log(filterSupplierArr, 'filterSupplierArr==>',newType,supplierArr.value,e );
   if (filterSupplierArr.length > 0) {
     isShowOnline.value = filterSupplierArr.every((items: any) => {
-      console.log(newType, 'newType',form);
       if (newType.length > 0) {
-        console.log(filterSupplierArr, 'filterSupplierArr==>', newType[0],items.offlineCPTypes,items.onlineCPTypes);
         return items.offlineCPTypes.includes(newType[0]) && items.onlineCPTypes.includes(newType[0]);
       } else {
         return false;
       }
     });
-    console.log(isShowOnline.value, 'isShowOnline==>');
     if (isShowOnline.value) {
       if (newOnline) {
         onlineArr.value = [newOnline];
@@ -167,13 +153,17 @@ 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(() => {
+    .then((res) => {
+      console.log(res, 'res==>111');
       form.photo = fileList.value[0]?.response?.url || '';
       submit(form);
     })
-    .catch(() => {
+    .catch((error) => {
+      console.error('Validation Error:', error);
       message.error('请完善必填项');
     });
 }
@@ -223,6 +213,7 @@ onMounted(async () => {
 });
 const emits = defineEmits<{
   submit: [data?: SystemItemModel];
+  addSubmit: [data?: SystemItemModel];
 }>();
 const { loading: submitting, send: submit } = useRequest(systemCpEditMethod, {
   immediate: false,

+ 27 - 28
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 () => {
   // console.log(props.data, 'props.data');
@@ -194,42 +193,42 @@ function open(row: Model) {
   <div class="care-progress-card">
     <div class="header" v-if="careProcessList">
       <span class="title">{{
-        careProcessList.progress === '0'
+        careProcessList?.progress === '0'
           ? '待付款'
-          : careProcessList.progress === '1'
+          : careProcessList?.progress === '1'
             ? '已作废'
-            : careProcessList.progress === '2'
+            : careProcessList?.progress === '2'
               ? '用户取消'
-              : careProcessList.progress === '3'
+              : careProcessList?.progress === '3'
                 ? '未开始'
-                : careProcessList.progress === '4'
+                : careProcessList?.progress === '4'
                   ? '调理中'
-                  : careProcessList.progress === '5'
+                  : careProcessList?.progress === '5'
                     ? '已完结'
                     : ''
       }}</span>
       <span
-        >姓名:<b>{{ careProcessList.patientName }}</b></span
+        >姓名:<b>{{ careProcessList?.patientName }}</b></span
       >
-      <span>疾病名称:{{ careProcessList.diagnosis }}</span>
-      <span>证型:{{ careProcessList.symptom }}</span>
-      <span>开具医生:{{ careProcessList.createBy }}</span>
-      <span>调养周期:{{ careProcessList.estimatedStartDate }} ~ {{ careProcessList.estimatedEndDate }}</span>
+      <span>疾病名称:{{ careProcessList?.diagnosis }}</span>
+      <span>证型:{{ careProcessList?.symptom }}</span>
+      <span>开具医生:{{ careProcessList?.createBy }}</span>
+      <span>调养周期:{{ careProcessList?.estimatedStartDate }} ~ {{ careProcessList?.estimatedEndDate }}</span>
     </div>
     <div v-if="careProcessList?.isDelivery === 'Y'" class="delivery-info">
       <a-checkbox checked disabled style="color: #52c41a; margin-right: 8px" />
       <span>配送</span>
-      <span>地址:{{ careProcessList.provinceName }}{{ careProcessList.cityName }}{{ careProcessList.areaName }}{{ careProcessList.detailAddress }}</span>
-      <span style="margin-left: 16px">电话:{{ careProcessList.phone }}</span>
+      <span>地址:{{ careProcessList?.provinceName }}{{ careProcessList?.cityName }}{{ careProcessList?.areaName }}{{ careProcessList?.detailAddress }}</span>
+      <span style="margin-left: 16px">电话:{{ careProcessList?.phone }}</span>
     </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>
-          <span class="stat">还剩:{{ item.remainCount }}</span>
-          <span class="stat">已核销:{{ item.finishCount }}</span>
+          <span style="font-size: 14px; font-weight: bold">◇ {{ item?.conditioningProgramDetail?.name }}</span>
+          <span class="stat">数量:{{ item?.totalMeasure }}</span>
+          <span class="stat">还剩:{{ item?.remainCount }}</span>
+          <span class="stat">已核销:{{ item?.finishCount }}</span>
         </div>
         <vxe-table :data="item?.patientConditioningOfflines" border>
           <vxe-column type="seq" title="序号" width="80" />
@@ -240,8 +239,8 @@ 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>
@@ -249,12 +248,12 @@ function open(row: Model) {
       <!-- 线上 -->
       <div class="yuanqi-tea" v-if="item?.patientConditioningOnlines">
         <div class="mb-2">
-          <span class="mr-10">◇ {{ item.conditioningProgramDetail.name }}</span>
-          <span>数量:{{ item.totalMeasure }}</span>
+          <span class="mr-10">◇ {{ item?.conditioningProgramDetail?.name }}</span>
+          <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>
@@ -277,10 +276,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>操作指南:{{ item?.remark }}</div>
         </div>
       </div>
    

+ 28 - 52
src/service/EditSystemService.vue

@@ -129,17 +129,10 @@ function getInstitutionProjectList() {
   });
   onSuccess(({ data }: any) => {
     allProjects.value = data;
-    console.log(allProjects.value, 'allProjects.value');
   });
 }
 function getSystemProjectList() {
-  const {
-    loading: projectLoading,
-    onSuccess,
-    replace,
-    refresh,
-    remove,
-  } = useRequest(getAllSystemCpMethod, {
+  const { loading: projectLoading, onSuccess } = useRequest(getAllSystemCpMethod, {
     immediate: true,
   });
   onSuccess(({ data }: any) => {
@@ -147,9 +140,7 @@ function getSystemProjectList() {
   });
 }
 async function getProjectList() {
-  console.log(props.data, 'getProjectList');
   if (props.data.types === 'system') {
-    // console.log('系统');
     getSystemProjectList();
   } else {
     getInstitutionProjectList();
@@ -253,8 +244,7 @@ function onSelectProject({ row }: any) {
 }
 // 预览
 
-function onPreview(row) {
-  console.log(row, '66666');
+function onPreview(row: any) {
   if (row.conditioningProgramDetail.id) {
     // 这里写你的预览逻辑
     VxeUI.modal.open({
@@ -270,7 +260,7 @@ function onPreview(row) {
         default() {
           return h(ServiceDetail, {
             data: row.conditioningProgramDetail,
-            onSubmit: (data) => {
+            onSubmit: (data: any) => {
               VxeUI.modal.close(`preview-modal`);
             },
           });
@@ -306,7 +296,7 @@ function detailPreview(row: any) {
     });
     showProjectPopover.value = false;
   } else {
-    message.warning('请先添加服务包');
+    notification.warning({ message: '请先添加服务包' });
   }
 }
 function editPart(row) {
@@ -333,19 +323,24 @@ function editPart(row) {
       },
     });
   } else {
-    message.warning('请先添加服务包');
+    notification.warning({ message: '请先添加服务包' });
   }
 }
-let frequencyType = ref<string[]>([]);
+function changeCheckbox(value: any, row: any) {
+  if (value.includes('不限')) {
+    row.frequencyType = '不限';
+  } else {
+    row.frequencyType = '';
+  }
+  calculateCount(row);
+}
 // 添加计算数量的函数
 function calculateCount(row: any) {
   const period = Number(row.days) || 0;
   const frequency = Number(row.frequencyMeasure) || 0;
-
-  console.log(row.frequencyMeasure, 'row.frequencyMeasure');
   // 检查是否选择了"不限"
   if (row.frequencyType === '不限') {
-    frequencyType.value = [row.frequencyType];
+    console.log(row.frequencyType, '111不限不限');
     row.frequencyMeasure = ''; // 重置 frequencyMeasure
     row.totalMeasure = 1;
   } else {
@@ -363,7 +358,7 @@ function calculateCount(row: any) {
 watch(
   () => formData.items,
   (newData) => {
-    console.log(newData, 'newData');
+    console.log(newData, '是否发生变化');
     if (!newData) return;
     newData.forEach((row) => {
       if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
@@ -379,7 +374,6 @@ function cancel() {
 }
 
 function confirm() {
-  // console.log(formData, '性别值'); // 打印性别值
   const isValid = (formData.items ?? []).every((item: any) => {
     delete item.id; // 删除 id 属性
     if (item?.conditioningProgramDetail && item?.conditioningProgramDetail?.pricingType === '1') {
@@ -389,7 +383,7 @@ function confirm() {
       // 只要有一个长度大于0,就满足条件
       if (!hasMeridians && !hasPoints) {
         // 如果两个都没有,显示提示
-        message.warning('请至少选择一个穴位或经络');
+        notification.warning({ message: '请至少选择一个穴位或经络' });
         return false; // 返回 false 表示条件不满足
       }
     }
@@ -438,7 +432,6 @@ const desiredConditions = ref<{ id: string; name: string }[]>([]);
 const constitutionGroups = ref<{ id: string; name: string }[]>([]);
 async function getDesiredConditions() {
   const res = await getDictionaryMethod('conditioning_wrap_willill_state');
-  // console.log(res, 'getDesiredConditions');
   if (res?.length > 0) {
     desiredConditions.value = res.map((item: any) => ({
       id: item.value,
@@ -463,7 +456,6 @@ async function getGender() {
 const ages = ref<{ id: string; name: string }[]>([]);
 async function getAge() {
   const res = await getDictionaryMethod('conditioning_wrap_rule_age');
-  console.log(res, 'getAge');
   if (res?.length > 0) {
     ages.value = res.map((item: any) => ({
       id: item.label,
@@ -473,7 +465,6 @@ async function getAge() {
 }
 async function getConstitutionGroup() {
   const res = await getDictionaryMethod('constitution_group');
-  // console.log(res, 'constitutionGroup');
   if (res?.length > 0) {
     constitutionGroups.value = res.map((item: any) => ({
       id: item.value,
@@ -482,26 +473,20 @@ async function getConstitutionGroup() {
   }
 }
 onMounted(async () => {
-  getDesiredConditions();
-  getGender();
-  getAge();
-  getConstitutionGroup();
-  console.log(props.data, 'props.data');
+  await getDesiredConditions();
+  await getGender();
+  await getAge();
+  await getConstitutionGroup();
+
   if (props.data.id) {
     props.data.type = 'institution';
     // 调编辑接口获取数据
     const res: any = await getConditioningRecordDetailMethod(props.data);
     Object.assign(formData, res);
-    await nextTick(); // 确保视图更新
+    if (JSON.stringify(res?.conditioningWrapPatientMatchRule) !== '{}') {
+      formData.conditioningWrapPatientMatchRule = res?.conditioningWrapPatientMatchRule;
+    }
 
-    formData.conditioningWrapPatientMatchRule = res?.conditioningWrapPatientMatchRule ?? {
-      sex: '',
-      age: '',
-      diagnoseDiseaseNames: [],
-      diagnoseSyndromeNames: [],
-      constitutionGroupNames: [],
-      willillStateNames: [],
-    };
     formData.items = res?.items ?? [];
     fileList.value = res?.photo
       ? [
@@ -515,7 +500,6 @@ onMounted(async () => {
         ]
       : [];
   }
-  // console.log(formData.conditioningWrapPatientMatchRule, '初始化时性别值'); // 添加日志
   await getProjectList();
 });
 
@@ -753,15 +737,7 @@ let multiple = ref<boolean>(true);
                 <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit }}</span>
               </div>
               <div>
-                <a-checkbox-group
-                  @change="
-                    (value) => {
-                      row.frequencyType = value.includes('不限') ? '不限' : '';
-                      calculateCount(row);
-                    }
-                  "
-                  v-model:value="row.frequencyType"
-                >
+                <a-checkbox-group @change="(value) => changeCheckbox(value, row)" v-model:value="row.frequencyType">
                   <a-checkbox value="不限">不限</a-checkbox>
                 </a-checkbox-group>
               </div>
@@ -827,7 +803,7 @@ let multiple = ref<boolean>(true);
         </vxe-column>
         <vxe-column field="remark" title="说明" width="180">
           <template #default="{ row }">
-            <a-textarea v-model:value="row.remark" style="max-width: 180px; width: 100%; height: 50px" rows="2" show-count :maxLength="200" />
+            <a-textarea v-model:value="row.remark" style="max-width: 180px; width: 100%; height: 50px" show-count :maxLength="200" />
           </template>
         </vxe-column>
       </vxe-table>
@@ -841,11 +817,11 @@ let multiple = ref<boolean>(true);
       }"
       :src="previewImg"
     />
-    <div style="display: flex; justify-content: flex-end;">
+    <div style="display: flex; justify-content: flex-end">
       <span style="font-weight: bold">合计:{{ formData.price }}元</span>
     </div>
 
-    <div style="display: flex; justify-content: center;">
+    <div style="display: flex; justify-content: center">
       <a-button style="margin-right: 24px" @click="cancel">取消</a-button>
       <a-button type="primary" @click="confirm">确认</a-button>
     </div>

+ 67 - 2
src/service/IntroduceProjectList.vue

@@ -3,6 +3,8 @@ import { ref } from 'vue';
 import type { SystemItemModel, SystemCwModel } from '@/model/care.model';
 import { VxeUI } from 'vxe-pc-ui';
 import { getConditioningRecordDetailMethod } from '@/request/api/care.api';
+import AddItems from '@/service/AddItems.vue';
+import HealthEvaluation from "@/service/HealthEvaluation.vue"
 const tableData = ref<SystemItemModel[]>([]);
 
 type FollowModel = Partial<SystemCwModel>;
@@ -23,11 +25,68 @@ const dataObj = reactive<SystemCwModel>({
   type: 'institution',
   id: props.id,
 });
+// const tableData = ref<any[]>([]);
 onMounted(async () => {
   const res: any = await getConditioningRecordDetailMethod(dataObj);
   tableData.value = res.items;
+  // tableData.value = [
+  //   {
+  //     conditioningProgramDetail: { name: '111', conditioningProgramType: '222',ischeck:false,reason:"机构没有此项目,请先维护" },
+  //   },
+  //   {
+  //     conditioningProgramDetail: { name: '222', conditioningProgramType: '222',ischeck:true ,reason:""},
+  //   },
+  // ];
 });
 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>
@@ -37,8 +96,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

@@ -222,6 +222,7 @@ function seeItems(model?: SystemItemModel, index?: number) {
   }
 }
 function editItems(model?: SystemItemModel, index?: number) {
+  console.log(model,"编辑项目")
   const addType = 'system';
   if (model?.isErasable === 'N') {
     // 健康咨询 健康评估 x显示

+ 77 - 20
src/service/ServicePackageDetail.vue

@@ -1,23 +1,81 @@
 <script setup lang="ts">
 import { ref, reactive } from 'vue';
-import type { SystemCwModel } from '@/model/care.model';
-import { getConditioningRecordDetailMethod } from '@/request/api/care.api';
+import { getConditioningRecordDetailMethod, voidConditioningSchemeMethod } from '@/request/api/care.api';
 import { usePagination, useRequest } from 'alova/client';
-import { message } from 'ant-design-vue';
+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) {
     message.error('获取数据失败');
   }
+}
+onMounted(async () => {
+  await getRecordDetail();
 });
+
+// 转方案
+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>
@@ -49,15 +107,13 @@ onMounted(async () => {
 
     <!-- 表格和作废字样包裹层 -->
     <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" />
         <vxe-column field="frequencyType" title="频率" width="auto">
           <template #default="{ row }">
-            <div v-if="row.frequencyType === '不限'">
-             不限
-            </div>
+            <div v-if="row.frequencyType === '不限'">不限</div>
             <div style="display: flex; align-items: center" v-else>
               <span>每</span>
               <a-input v-model:value="row.frequencyType" style="width: 60px" @change="() => calculateCount(row)" :disabled="true" />
@@ -65,7 +121,6 @@ onMounted(async () => {
               <a-input v-model:value="row.frequencyMeasure" style="width: 60px" @change="() => calculateCount(row)" :disabled="true" />
               <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}</span>
             </div>
-           
           </template>
         </vxe-column>
         <vxe-column field="conditioningProgramDetail.conditioningProgramType" title="方案类型" align="center" />
@@ -94,11 +149,11 @@ onMounted(async () => {
     </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>
 
@@ -109,16 +164,18 @@ onMounted(async () => {
 .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;

+ 1 - 1
src/service/ServicePackageList.vue

@@ -20,7 +20,7 @@ onSuccess(({ data: { data } }) => {
   loading.value = false;
 });
 const id = ref<string>('');
-async function handleSelect(model?: SystemCwModel, index?: number) {
+async function handleSelect(model?: SystemCwModel) {
   if (model?.id) {
     id.value = model.id;
     try {