瀏覽代碼

优化中药组成

张田田 9 月之前
父節點
當前提交
2a7ef6026c
共有 1 個文件被更改,包括 23 次插入28 次删除
  1. 23 28
      src/pages/index/care/issueService.vue

+ 23 - 28
src/pages/index/care/issueService.vue

@@ -90,12 +90,12 @@ const address = ref({
 const lifeCwData = ref([]);
 // 获取可用的服务包
 const suggestCwData = ref<string[]>([]);
-async function loadAvailableCw(patientId: string,patientConditioningRecordId:string) {
-  const res: any = await getAvailableCwMethod(patientId,patientConditioningRecordId);
+async function loadAvailableCw(patientId: string, patientConditioningRecordId: string) {
+  const res: any = await getAvailableCwMethod(patientId, patientConditioningRecordId);
   if (res.length > 0) {
     lifeCwData.value = res;
     // 筛选出可推荐的
-    suggestCwData.value = lifeCwData.value.filter((item: any) => item.isSuggest==='Y');
+    suggestCwData.value = lifeCwData.value.filter((item: any) => item.isSuggest === 'Y');
   }
 }
 export interface PatientModel {
@@ -170,9 +170,9 @@ async function getCpRecordDetail(id: string) {
     form.detailAddress = res?.detailAddress;
     form.phone = res?.phone;
     form.healthAnalysisReport = res.healthAnalysisReport;
-    selectedProvince.value=res.provinceCode;
-    selectedCity.value=res.cityCode;
-    selectedArea.value=res.areaCode
+    selectedProvince.value = res.provinceCode;
+    selectedCity.value = res.cityCode;
+    selectedArea.value = res.areaCode;
   });
 }
 function getPatientList(id: string) {
@@ -196,13 +196,12 @@ onMounted(async () => {
     } else {
       currentPatient.value = res[0];
     }
-   
   }
   if (currentPatient.value?.patientId) {
     // 获取患者列表
     await getPatientList(currentPatient.value?.patientId || '');
     // 获取服务包选择列表
-    await loadAvailableCw(currentPatient.value?.patientId || '',currentPatient.value?.id || '');
+    await loadAvailableCw(currentPatient.value?.patientId || '', currentPatient.value?.id || '');
   }
   if (currentPatient.value?.id) {
     // 获取调养记录
@@ -221,7 +220,7 @@ function loadTags(patientId: string) {
 
 // 展示的患者数据
 const filteredPatients: any = computed(() => {
-  if(patients.value.length > 0){
+  if (patients.value.length > 0) {
     return patients.value.filter((p: any) => (p.patientName || '').includes(searchName.value));
   }
   return [];
@@ -233,19 +232,18 @@ async function selectPatient(item: any) {
   currentPatient.value = item;
   // 获取患者信息
   await getPatientList(item.patientId);
-  await loadAvailableCw(item.patientId || '',item.id || '');
+  await loadAvailableCw(item.patientId || '', item.id || '');
   // 获取患者调养记录
   await getCpRecordDetail(item.id);
   // 清空服务包选择
   selectedPackage.value = '';
   currentSelectedPackage.value = null;
-  btnType.value=''
-
+  btnType.value = '';
 }
 const btnType = ref('');
 // 打开调养记录
 function openRecord(item: any) {
-  const status=currentPatient.value.status;
+  const status = currentPatient.value.status;
   const types = 'record';
   VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
@@ -257,9 +255,9 @@ function openRecord(item: any) {
     slots: {
       default() {
         return h(ServicePackageDetail, <any>{
-          data: { ...item, types ,status},
+          data: { ...item, types, status },
           onSubmit(data: any) {
-            selectedPackage.value=data.conditioningWrapId;
+            selectedPackage.value = data.conditioningWrapId;
             formData.items = data?.items ?? [];
             form.conditioningWrapName = data.conditioningWrapName;
             form.conditioningWrapId = data.conditioningWrapId;
@@ -624,7 +622,7 @@ async function handleSubmit() {
       delete item.id;
     });
   }
-
+  form.isDelivery = isShowDelivery.value ? 'Y' : 'N';
   form.id = Number(currentPatient.value.id);
   form.patientId = currentPatient.value.patientId;
   form.patientName = currentPatient.value.patientName;
@@ -652,7 +650,7 @@ async function handleSubmit() {
         // 获取患者列表
         await getPatientList(currentPatient.value?.patientId || '');
         // 获取服务包选择列表
-        await loadAvailableCw(currentPatient.value?.patientId || '',currentPatient.value?.id || '');
+        await loadAvailableCw(currentPatient.value?.patientId || '', currentPatient.value?.id || '');
 
         // 获取调养记录
         await getCpRecordDetail(currentPatient.value?.id || '');
@@ -710,8 +708,7 @@ function handleProvinceChange(value: string) {
     selectedArea.value = '';
     form.cityCode = '';
     form.areaCode = '';
-    form.detailAddress=''
-
+    form.detailAddress = '';
   }
   selectedProvince.value = value;
   const selectedProvinceOption = provinceOptions.value.find((p) => p.value === value);
@@ -729,7 +726,7 @@ function handleCityChange(value: string) {
   if (btnType.value === '转方案') {
     selectedArea.value = '';
     form.areaCode = '';
-    form.detailAddress=''
+    form.detailAddress = '';
   }
   loadAreas(selectedCityOption?.name, value);
 }
@@ -740,7 +737,7 @@ function handleAreaChange(value: string) {
   form.areaName = selectedAreaOption?.label || '';
   form.areaCode = selectedAreaOption?.value || '';
   if (btnType.value === '转方案') {
-    form.detailAddress=''
+    form.detailAddress = '';
   }
 }
 
@@ -918,10 +915,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
     <!-- 左侧患者列表 -->
     <div class="left-panel">
       <a-input v-model:value="searchName" placeholder="输入姓名搜索" style="margin-bottom: 12px" />
-      <div
-        v-if="filteredPatients.length > 0"
-        class="patient-list"
-      >
+      <div v-if="filteredPatients.length > 0" class="patient-list">
         <div
           class="patient-item"
           v-for="item in filteredPatients"
@@ -930,7 +924,8 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
           :class="{ active: currentPatient?.id === item.id }"
           style="cursor: pointer"
         >
-          <span>{{ item.patientName }}</span><span v-if="item.patientAge">{{ item.patientAge }}岁</span>
+          <span>{{ item.patientName }}</span
+          ><span v-if="item.patientAge">{{ item.patientAge }}岁</span>
           <span v-if="item.status === '0'" style="color: #aaa">(已开)</span>
         </div>
       </div>
@@ -966,7 +961,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>
@@ -1148,7 +1143,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
         </div>
         <!-- 配送信息 -->
         <div class="delivery-row" v-if="isShowDelivery">
-          <div v-if="(btnType !== '转方案' && currentPatient?.status === '0')">
+          <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>