فهرست منبع

Merge branch 'develop' of ssh://121.43.162.141:10022/six.fe/health.admin into develop

cc12458 10 ماه پیش
والد
کامیت
acddfe755f

+ 13 - 5
src/components/Enabled.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import type { PlanModel } from '@/model/system.model';
 import {  tagMethod } from '@/request/api/system.api';
-import { message } from 'ant-design-vue';
+import { message, notification } from 'ant-design-vue';
 import {
   doctorMethod,
   departmentsMethod,
@@ -110,19 +110,27 @@ const formProps = reactive<VxeFormProps<FollowModel>>({
 
 function formCheck(data) {
   if (new Date(data?.endDate) < new Date(data?.startDate)) {
-    message.error('结束日期不能晚于开始日期');
+    notification.warning({
+      message: '结束日期不能晚于开始日期',
+    });
     return;
   }
   if (!data.arrangeTime) {
-    message.error('请选择随访推送时间!');
+    notification.warning({
+      message: '请选择随访推送时间!',
+    });
     return;
   }
   if (!data.remindTime) {
-    message.error('请选择提醒时间!');
+    notification.warning({
+      message: '请选择提醒时间!',
+    });
     return;
   }
   if (compareTime(data.remindTime, data.arrangeTime)) {
-    message.error('推送时间不能晚于提醒时间');
+    notification.warning({
+      message: '推送时间不能晚于提醒时间',
+    });
     return;
   }
   current.value++;

+ 2 - 2
src/components/Follow.vue

@@ -46,7 +46,7 @@ const changeTab = (data: any, index: number) => {
   const upImg = data.fillin?.upImg;
   const downImg = data.fillin?.downImg;
   const faceImg = data.fillin?.faceImg;
-  if (activeObj.value.syndromeList.length > 0) {
+  if (activeObj.value?.syndromeList && activeObj.value.syndromeList.length > 0) {
     activeObj.value.syndromeList.forEach((syndrome) => {
       activeObj.value.symptomsData.push({ name: syndrome });
     });
@@ -234,7 +234,7 @@ const previewImg = ref<string>('');
       <!--    左边-->
       <div class="animated-vertical-tabs">
         <div class="tab-list">
-          <div class="font-bold h-8 pt-3 mb-3 ml-2">失眠门诊随访</div>
+          <div class="font-bold h-8 pt-3 mb-3 ml-2">{{ activeObj?.followupPlanName }}</div>
           <div
             style="font-size: 14px"
             v-for="(content, index) in contentArr"

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

@@ -53,9 +53,8 @@ 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,

+ 15 - 11
src/pages/index/care/conditioningRecord.vue

@@ -153,11 +153,13 @@ onMounted(() => {
 function conditioningProcess(model?: ConditioningRecordListModel, index?: number) {
   VxeUI.modal.open({
     title: model?.id ? `调养过程` : `新增调养过程`,
-    height: 700,
-    width: 1200,
-    position: {
-      top: Math.min(100, window.innerHeight * 0.1),
-    },
+    // height: 700,
+    // width: 1200,
+    height: window.innerHeight,
+    width: window.innerWidth,
+    // position: {
+    //   top: Math.min(100, window.innerHeight * 0.1),
+    // },
     escClosable: true,
     destroyOnClose: true,
     id: `plan-modal`,
@@ -181,12 +183,14 @@ function serviceDetail(model?: ConditioningRecordListModel, index?: number) {
   const types='record'
     VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
-    title: '系统服务',
-    height: 700,
-    width: 1200,
-    position: {
-      top: Math.min(100, window.innerHeight * 0.1),
-    },
+    title: '调养详情',
+    // height: 700,
+    // width: 1200,
+    height: window.innerHeight,
+    width: window.innerWidth,
+    // position: {
+    //   top: Math.min(100, window.innerHeight * 0.1),
+    // },
     escClosable: true,
     destroyOnClose: true,
     slots: {

+ 9 - 5
src/pages/index/care/institutionService.vue

@@ -131,7 +131,7 @@ const gridOptions = reactive<VxeGridProps<SystemCwModel>>({
           { content: '删除', status: 'primary', name: 'deleteInstitution' },
         ],
         events: {
-          click({ row, rowIndex }, { name }) {
+          click({ row, rowIndex }:any, { name }:any) {
             let method;
             if (name === 'editInstitution') {
               method = editInstitution;
@@ -169,8 +169,10 @@ function seeInstitutionDetail(model: SystemCwModel, index: number) {
   const types = 'institution';
   VxeUI.modal.open({
     title: model?.id ? `机构服务详情` : `新增机构服务`,
-    height: 700,
-    width: 1000,
+    // height: 700,
+    // width: 1000,
+    height: window.innerHeight,
+    width: window.innerWidth,
     escClosable: true,
     destroyOnClose: true,
     id: `servicePackageDetail-modal`,
@@ -212,8 +214,10 @@ function editInstitution(model?: SystemCwModel, index?: number) {
   const types = 'institution';
   VxeUI.modal.open({
     title: model?.id ? `修改机构服务` : `新增机构服务`,
-    height: 700,
-    width: 1200,
+    // height: 700,
+    // width: 1200,
+    height: window.innerHeight,
+    width: window.innerWidth,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     //   left: Math.min(100, window.innerWidth * 0.1),

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

@@ -222,8 +222,10 @@ function openRecord(item: any) {
   VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
     title: '调养记录',
-    height: 700,
-    width: 1200,
+    // height: 700,
+    // width: 1200,
+    height: window.innerHeight,
+    width: window.innerWidth,
     escClosable: true,
     destroyOnClose: true,
     slots: {

+ 8 - 4
src/pages/index/care/systemService.vue

@@ -182,8 +182,10 @@ function seeInstitution(model?: SystemCwModel, index?: number) {
   VxeUI.modal.open({
     id: 'servicePackageDetail-modal',
     title: '系统服务',
-    height: 700,
-    width: 1000,
+    // height: 700,
+    // width: 1000,
+    height: window.innerHeight,
+    width: window.innerWidth,
     escClosable: true,
     destroyOnClose: true,
     slots: {
@@ -200,8 +202,10 @@ function editSystemService(model?: SystemCwModel, index?: number) {
   VxeUI.modal.open({
     id: 'edit-system-service-modal',
     title: model?.id ? `修改系统服务` : `新增系统服务`,
-    height: 700,
-    width: 1200,
+    // height: 700,
+    // width: 1200,
+    height: window.innerHeight,
+    width: window.innerWidth,
     // position: {
     //   top: Math.min(100, window.innerHeight * 0.1),
     // },

+ 3 - 1
src/pages/index/follow/task.vue

@@ -65,6 +65,7 @@ const searchFormProps = reactive<VxeFormProps<TaskQuery>>({
     },
 
     {
+      field: 'action',
       span: 6,
       itemRender: {
         name: 'VxeButtonGroup',
@@ -134,6 +135,7 @@ const gridOptions = reactive<VxeGridProps<TaskModel>>({
     { field: 'phone', title: '手机号码' },
     { field: 'tagNames', title: '标签' },
     {
+      field: 'action',
       title: '操作',
       align: 'center',
       width: 120,
@@ -198,7 +200,7 @@ function remind(row, rowIndex) {
   });
 }
 
-function fillFollow(row, rowIndexr) {
+function fillFollow(row:any, rowIndex:number) {
   VxeUI.modal.open({
     title: row.progress === '1' ? '填写随访' : '查看',
     width: 1100,

+ 1 - 2
src/service/AddItems.vue

@@ -181,7 +181,7 @@ function doSubmit() {
   formRef.value
     ?.validate()
     .then(() => {
-      form.photo = fileList.value[0]?.response?.url || '';
+      form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
       submit(form);
     })
     .catch(() => {
@@ -405,7 +405,6 @@ function handleSelect(value: string, node: any, extra: any) {
       <a-form-item label="机构名称:" v-if="form?.addType === 'itemsList'" required name="institutionId">
         <a-tree-select
           v-model:value="form.institutionId"
-          show-search
           style="width: 100%"
           :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
           placeholder="请选择"

+ 95 - 13
src/service/ConfirmItems.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, reactive, watch, onMounted, defineEmits } from 'vue';
+import { ref, reactive, watch, onMounted, defineEmits, nextTick } from 'vue';
 import { message } from 'ant-design-vue';
 import { PlusOutlined } from '@ant-design/icons-vue';
 import { branchMethod } from '@/request/api/system.api';
@@ -20,22 +20,31 @@ const unitOptions = [
   { label: '次', value: '次' },
 ];
 const fileList = ref<UploadFile[]>([]);
-const orgOptions = ref<any[]>([]);
 // 获取所有的机构
-const { data: branch, loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data }) => {
-  if (data?.length > 0) {
-    orgOptions.value = data.map((item: any) => ({
-      label: item.label,
-      value: item.id,
-    }));
-  }
+const branch = ref<any[]>([]);
+const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data }) => {
+  const to = (data?: any[]): any[] => {
+    return Array.isArray(data)
+      ? data.map((item) => {
+          return {
+            ...item,
+            value: item.id,
+            key: item.id.toString(),
+            children: to(item.children),
+          };
+        })
+      : [];
+  };
+  branch.value = to(data);
 });
 
 const supplierOptions = ref<any[]>([]);
 // 获取所有的供应商
+const supplierArr = ref<any[]>([]);
 function getSupplier(params: any) {
   getAllSupplierMethod(params).then((res) => {
     if (res?.length > 0) {
+      supplierArr.value = res;
       supplierOptions.value = res.map((item: any) => ({
         label: item.name,
         value: item.id,
@@ -57,6 +66,63 @@ watch(
   },
   { immediate: true }
 );
+let showOffLine = ref<boolean>(false);
+function getIsonline(newSupplierId: any) {
+  // 早期返回:检查必要条件
+  if (!supplierArr.value?.length || !newSupplierId || !props.data?.conditioningProgramType) {
+    return;
+  }
+
+  // 使用 find 替代 filter,性能更好
+  const supplier = supplierArr.value.find(item => item.id === newSupplierId);
+  if (!supplier) {
+    return;
+  }
+
+  const { offlineCPTypes, onlineCPTypes } = supplier;
+  const programType = props.data.conditioningProgramType;
+
+  // 检查是否同时支持线上和线下
+  const supportsOffline = offlineCPTypes?.includes(programType);
+  const supportsOnline = onlineCPTypes?.includes(programType);
+
+  if (supportsOffline && supportsOnline) {
+    showOffLine.value = true;
+    return;
+  }
+
+  // 设置显示状态
+  showOffLine.value = false;
+
+  // 根据支持情况设置项目类型
+  if (supportsOffline) {
+    props.data.isOffline = 'Y';
+  } else if (supportsOnline) {
+    props.data.isOffline = 'N';
+  } else {
+    props.data.isOffline = null;
+  }
+}
+
+watch(
+  () => props.data.conditioningProgramSupplierId,
+  async (newSupplierId: any) => {
+    if (newSupplierId) {
+      // 等待下一个 tick,确保数据更新
+      await nextTick();
+      if (supplierArr.value && supplierArr.value.length > 0) {
+        getIsonline(newSupplierId);
+      } else {
+        // 如果数据还没加载,等待一段时间后重试
+        setTimeout(() => {
+          if (supplierArr.value && supplierArr.value.length > 0) {
+            getIsonline(newSupplierId);
+          }
+        }, 200);
+      }
+    }
+  },
+);
 const uploadProps = reactive({ showRemoveIcon: true });
 function customUpload(e: any) {
   // uploadApi 你的二次封装上传接口
@@ -99,6 +165,9 @@ const emit = defineEmits<{
 }>();
 
 function handleOk() {
+  if (showOffLine.value && !props.data.isOffline) {
+    props.data.isOffline = 'N';
+  }
   confirmOrgConfirmMethod(props.data).then(() => {
     emit('submit', props.data);
     VxeUI.modal.close('confirm-item-modal');
@@ -115,6 +184,7 @@ onMounted(async () => {
   if (props.data.id) {
     const res = await getConditioningSchemeDetailMethod(props.data);
     Object.assign(props.data, res);
+    getIsonline(props.data.conditioningProgramSupplierId);
   }
   fileList.value = props.data?.photo
     ? [
@@ -129,6 +199,10 @@ onMounted(async () => {
     : [];
   isOffline.value = props.data.isOffline === 'Y';
 });
+function handleSelect(value: string, node: any, extra: any) {
+  props.data.institutionId = value;
+  props.data.institutionName = node.label;
+}
 </script>
 
 <template>
@@ -212,13 +286,21 @@ onMounted(async () => {
     </div>
     <div class="form-row">
       <label>机构名称:</label>
-      <a-select v-model:value="data.institutionId" :options="orgOptions" placeholder="请选择机构" style="width: 200px" allow-clear />
+      <a-tree-select
+        v-model:value="data.institutionId"
+        style="width: 400px"
+        :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+        placeholder="请选择"
+        allow-clear
+        tree-default-expand-all
+        :tree-data="branch"
+        @select="handleSelect"
+      ></a-tree-select>
     </div>
     <div class="form-row">
       <label>供应商:</label>
-      <a-select v-model:value="data.conditioningProgramSupplierId" :options="supplierOptions" placeholder="请选择供应商" style="width: 200px" allow-clear class="mr-10" />
-      <a-checkbox v-model:checked="isOffline" style="margin-right: 8px" @change="toggleOnlineStatus"> 线下项目 </a-checkbox>
-    
+      <a-select v-model:value="data.conditioningProgramSupplierId" :options="supplierOptions" placeholder="请选择供应商" style="width: 400px" allow-clear class="mr-10" />
+      <a-checkbox v-model:checked="isOffline" style="margin-right: 8px" @change="toggleOnlineStatus" v-show="showOffLine"> 线下项目 </a-checkbox>
     </div>
     <div class="form-row">
       <label>图片:</label>

+ 9 - 4
src/service/EditSystemService.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, computed, nextTick, h, watch, onMounted } from 'vue';
+import { ref, computed, nextTick, h, watch, onMounted, openBlock } from 'vue';
 import { notification } from 'ant-design-vue';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
 import { UploadIFile } from '@/request/api/follow.api';
@@ -220,7 +220,9 @@ const filteredProjects = computed(() => {
 
 function onSelectProject({ row }: any) {
   if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
-    message.warning('不能重复添加该项目');
+    notification.warning({
+      message: '不能重复添加该项目',
+    });
     return;
   }
   // 添加新行到主表格
@@ -628,6 +630,9 @@ function handleSelect(value: string, node: any, extra: any) {
   formData.institutionId = value;
   formData.institutionName = node.label;
 }
+function openPopover() {
+  showProjectPopover.value = true;
+}
 </script>
 
 <template>
@@ -775,7 +780,7 @@ function handleSelect(value: string, node: any, extra: any) {
           <template #default="{ row, rowIndex }">
             <template v-if="rowIndex === tableData.length - 1">
               <a-popover
-                v-model:open="showProjectPopover"
+                v-model="showProjectPopover"
                 trigger="click"
                 placement="bottomLeft"
                 :overlayStyle="{ width: '350px', padding: 0 }"
@@ -794,7 +799,7 @@ function handleSelect(value: string, node: any, extra: any) {
                     </vxe-column>
                   </vxe-table>
                 </template>
-                <a-input v-model:value="row.name" placeholder="请搜索" style="width: 120px" @click="showProjectPopover = true" readonly />
+                <a-input v-model:value="row.name" placeholder="请搜索" style="width: 120px" @click="openPopover" readonly />
               </a-popover>
             </template>
             <template v-else>