Quellcode durchsuchen

修复机构服务包引入问题

张田田 vor 10 Monaten
Ursprung
Commit
0effaafc98
2 geänderte Dateien mit 26 neuen und 8 gelöschten Zeilen
  1. 23 3
      src/service/EditSystemService.vue
  2. 3 5
      src/service/ServicePackageList.vue

+ 23 - 3
src/service/EditSystemService.vue

@@ -29,6 +29,7 @@ const props = defineProps<{ data: FollowModel }>();
 const fileList = ref<UploadFile[]>([]);
 const fileList = ref<UploadFile[]>([]);
 const uploadProps = reactive({ showRemoveIcon: true });
 const uploadProps = reactive({ showRemoveIcon: true });
 const emit = defineEmits<{ submit: [data?: SystemCwModel] }>();
 const emit = defineEmits<{ submit: [data?: SystemCwModel] }>();
+const deptId = ref<string>('');
 // 获取所有的机构
 // 获取所有的机构
 const branch = ref<any[]>([]);
 const branch = ref<any[]>([]);
 const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data }) => {
 const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data }) => {
@@ -550,6 +551,9 @@ function removeTableRow(idx: number) {
 }
 }
 // 引入服务包
 // 引入服务包
 function addInstitution() {
 function addInstitution() {
+  deptId.value = localStorage.getItem('deptId') || '';
+  console.log(deptId.value, '当前机构');
+  console.log(formData.institutionId, '选择的机构');
   VxeUI.modal.open({
   VxeUI.modal.open({
     title: '选择引入',
     title: '选择引入',
     width: 1000,
     width: 1000,
@@ -563,6 +567,7 @@ function addInstitution() {
       default() {
       default() {
         return h(ServicePackageList, {
         return h(ServicePackageList, {
           data: formData,
           data: formData,
+          institutionId: formData.institutionId ? formData.institutionId : deptId.value,
           onSubmit(data: SystemCwModel) {
           onSubmit(data: SystemCwModel) {
             VxeUI.modal.close(`systemService-list-modal`);
             VxeUI.modal.close(`systemService-list-modal`);
           },
           },
@@ -629,11 +634,11 @@ function openPopover() {
           style="width: 220px"
           style="width: 220px"
           :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
           :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
           placeholder="请选择"
           placeholder="请选择"
-          allow-clear
           tree-default-expand-all
           tree-default-expand-all
           :tree-data="branch"
           :tree-data="branch"
           @select="handleSelect"
           @select="handleSelect"
           :loading="branchLoading"
           :loading="branchLoading"
+          :getPopupContainer="(triggerNode: any) => triggerNode.parentNode"
         />
         />
       </div>
       </div>
       <!-- 服务包名称 -->
       <!-- 服务包名称 -->
@@ -668,7 +673,14 @@ function openPopover() {
         <span class="w-20">使用限制</span>
         <span class="w-20">使用限制</span>
         <div class="mr-10">
         <div class="mr-10">
           <span>性别:</span>
           <span>性别:</span>
-          <a-select placeholder="请选择" v-model:value="formData.conditioningWrapPatientMatchRule.sex" style="width: 150px; margin: 0 5px" allowClear :loading="gendersLoading">
+          <a-select
+            placeholder="请选择"
+            v-model:value="formData.conditioningWrapPatientMatchRule.sex"
+            style="width: 150px; margin: 0 5px"
+            allowClear
+            :loading="gendersLoading"
+            :getPopupContainer="(triggerNode: any) => triggerNode.parentNode"
+          >
             <a-select-option v-for="option in genders" :key="option.id" :value="option.id" placeholder="请选择">
             <a-select-option v-for="option in genders" :key="option.id" :value="option.id" placeholder="请选择">
               {{ option.name }}
               {{ option.name }}
             </a-select-option>
             </a-select-option>
@@ -676,7 +688,13 @@ function openPopover() {
         </div>
         </div>
         <div>
         <div>
           <span>年龄:</span>
           <span>年龄:</span>
-          <a-select v-model:value="formData.conditioningWrapPatientMatchRule.age" style="width: 150px; margin: 0 8px" placeholder="请选择" allowClear>
+          <a-select
+            v-model:value="formData.conditioningWrapPatientMatchRule.age"
+            style="width: 150px; margin: 0 8px"
+            placeholder="请选择"
+            allowClear
+            :getPopupContainer="(triggerNode: any) => triggerNode.parentNode"
+          >
             <a-select-option v-for="option in ages" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>
             <a-select-option v-for="option in ages" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>
           </a-select>
           </a-select>
         </div>
         </div>
@@ -712,6 +730,7 @@ function openPopover() {
             placeholder="请选择"
             placeholder="请选择"
             allowClear
             allowClear
             mode="multiple"
             mode="multiple"
+            :getPopupContainer="(triggerNode: any) => triggerNode.parentNode"
           >
           >
             <a-select-option v-for="option in constitutionGroups" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>
             <a-select-option v-for="option in constitutionGroups" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>
           </a-select>
           </a-select>
@@ -725,6 +744,7 @@ function openPopover() {
             placeholder="请选择"
             placeholder="请选择"
             allowClear
             allowClear
             mode="multiple"
             mode="multiple"
+            :getPopupContainer="(triggerNode: any) => triggerNode.parentNode"
             @change="(value) => (formData.conditioningWrapPatientMatchRule.willillStateNames = value)"
             @change="(value) => (formData.conditioningWrapPatientMatchRule.willillStateNames = value)"
           >
           >
             <a-select-option v-for="option in desiredConditions" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>
             <a-select-option v-for="option in desiredConditions" :key="option.id" :value="option.id" placeholder="请选择">{{ option.name }}</a-select-option>

+ 3 - 5
src/service/ServicePackageList.vue

@@ -6,7 +6,7 @@ import { getSystemCpListMethod, getCopyCwMethod } from '@/request/api/care.api';
 import { usePagination } from 'alova/client';
 import { usePagination } from 'alova/client';
 import type { SystemCwModel } from '@/model/care.model';
 import type { SystemCwModel } from '@/model/care.model';
 type FollowModel = Partial<SystemCwModel>;
 type FollowModel = Partial<SystemCwModel>;
-const props = defineProps<{ data: FollowModel }>();
+const props = defineProps<{ data: FollowModel; institutionId: string }>();
 const emit = defineEmits(['update:data']);
 const emit = defineEmits(['update:data']);
 const tableData = ref<SystemCwModel[]>([]);
 const tableData = ref<SystemCwModel[]>([]);
 const { loading, page, pageSize, total, onSuccess, replace, refresh, remove } = usePagination((page, size) => getSystemCpListMethod(page, size), {
 const { loading, page, pageSize, total, onSuccess, replace, refresh, remove } = usePagination((page, size) => getSystemCpListMethod(page, size), {
@@ -20,7 +20,6 @@ onSuccess(({ data: { data } }) => {
   loading.value = false;
   loading.value = false;
 });
 });
 const id = ref<string>('');
 const id = ref<string>('');
-const institutionId = ref<string>('');
 async function handleSubmit() {
 async function handleSubmit() {
   const res: any = await getCopyCwMethod(parms.value);
   const res: any = await getCopyCwMethod(parms.value);
   if (res && res.items && res.items.length > 0) {
   if (res && res.items && res.items.length > 0) {
@@ -45,12 +44,11 @@ const parms = ref<any>({});
 async function handleSelect(model?: SystemCwModel) {
 async function handleSelect(model?: SystemCwModel) {
   if (model?.id) {
   if (model?.id) {
     id.value = model.id;
     id.value = model.id;
-    institutionId.value = model.institutionId || '';
     try {
     try {
       parms.value = {
       parms.value = {
         types: 'institution',
         types: 'institution',
         id: model.id,
         id: model.id,
-        institutionId: model.institutionId,
+        institutionId: props.institutionId,
       };
       };
     } catch (err) {
     } catch (err) {
       console.error('Error fetching data:', err);
       console.error('Error fetching data:', err);
@@ -71,7 +69,7 @@ async function handleSelect(model?: SystemCwModel) {
         return h(IntroduceProjectList, {
         return h(IntroduceProjectList, {
           data: { ...props.data },
           data: { ...props.data },
           id: id.value,
           id: id.value,
-          institutionId: institutionId.value,
+          institutionId: props.institutionId,
           onSubmit() {
           onSubmit() {
             handleSubmit();
             handleSubmit();
             VxeUI.modal.close(`introduceProjectList-modal`);
             VxeUI.modal.close(`introduceProjectList-modal`);