张田田 5 месяцев назад
Родитель
Сommit
addb3e8869

+ 3 - 2
src/components/EditEquirement.vue

@@ -6,9 +6,10 @@ import { branchMethod } from '@/request/api/system.api';
 import { notification } from 'ant-design-vue';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
 import type { EquirementModel } from '@/model/device.model';
-
 type FollowModel = Partial<EquirementModel>;
-
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 const defaultModel = {
   deviceIds: [''],
 };

+ 3 - 1
src/components/EditMoreConfigured.vue

@@ -8,7 +8,9 @@ import type { DeviceManageModel } from '@/model/device.model';
 const flowData = ref<FlowRequestData>();
 const loading = ref(false);
 // const defaultModel: DeviceManageModel = {};
-
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 const props = defineProps<{ data: DeviceManageModel[] }>();
 
 const emits = defineEmits<{

+ 0 - 109
src/components/EditMoreEquirement.vue

@@ -1,109 +0,0 @@
-<script setup lang="ts">
-import { h } from 'vue';
-import { VxeUI } from 'vxe-pc-ui';
-import EditOrganization from '@/components/EditOrganization.vue';
-import EditProcesses from '@/components/EditProcesses.vue';
-
-function editOrganization() {
-  VxeUI.modal.open({
-    title: '修改所属组织',
-    content: '请选择所属组织',
-    width: 800,
-    height: 750,
-    escClosable: true,
-    destroyOnClose: true,
-    id: 'edit-organization',
-    remember: true,
-    storage: true,
-    slots: {
-      default() {
-        return h(EditOrganization, {} as any);
-      },
-    },
-  });
-}
-
-function editProcessConfig() {
-  VxeUI.modal.open({
-    title: '修改流程配置',
-    content: '请选择流程配置',
-    width: 1400,
-    height: 750,
-    escClosable: true,
-    destroyOnClose: true,
-    id: 'edit-process-config',
-    remember: true,
-    storage: true,
-    slots: {
-      default() {
-        return h(EditProcesses, {} as any);
-      },
-    },
-  });
-}
-</script>
-
-<template>
-  <div class="form-container">
-    <div class="button-group">
-      <vxe-button status="primary" content="修改所属组织" @click="editOrganization"></vxe-button>
-      <vxe-button status="warning" content="修改流程配置" @click="editProcessConfig"></vxe-button>
-    </div>
-  </div>
-</template>
-
-<style scoped lang="scss">
-.form-container {
-  padding: 80px 20px;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  align-items: center;
-  gap: 100px;
-}
-
-.button-group {
-  display: flex;
-  flex-direction: column;
-  gap: 20px;
-  width: 100%;
-  max-width: 300px;
-  margin: 40px 0;
-
-  .vxe-button {
-    height: 44px;
-    font-size: 16px;
-    font-weight: 500;
-    border-radius: 8px;
-    transition: all 0.3s ease;
-    width: 100%;
-    min-width: 200px;
-    
-    &:first-child {
-      background-color: #1890ff;
-      border: 1px solid #1890ff;
-      color: #fff;
-      
-      &:hover {
-        background-color: #40a9ff;
-        border-color: #40a9ff;
-        transform: translateY(-1px);
-        box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
-      }
-    }
-    
-    &:last-child {
-      background-color: #fa8c16;
-      border: 1px solid #fa8c16;
-      color: #fff;
-      
-      &:hover {
-        background-color: #ff9c2a;
-        border-color: #ff9c2a;
-        transform: translateY(-1px);
-        box-shadow: 0 4px 12px rgba(250, 140, 22, 0.3);
-      }
-    }
-  }
-}
-</style>

+ 3 - 1
src/components/EditOrganization.vue

@@ -5,7 +5,9 @@ import { branchMethod } from '@/request/api/system.api';
 import { notification } from 'ant-design-vue';
 import type { EquirementModel } from '@/model/device.model';
 type FollowModel = Partial<EquirementModel>;
-
+  (notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 const defaultModel = {};
 
 const props = defineProps<{ data: FollowModel }>();

+ 0 - 9
src/components/EditPatient.vue

@@ -8,7 +8,6 @@ import { notification } from 'ant-design-vue';
 import { message as Message } from 'ant-design-vue/es/components';
 import RemoteSelect from '@/libs/v-select-page/RemoteSelect.vue';
 import builtinRegions from '@/tools/regions';
-import { useRequest } from 'alova/client';
 
 interface FormModel {}
 const props = defineProps<{
@@ -20,7 +19,6 @@ const emits = defineEmits<{
 
 // 编辑患者
 const form = ref({});
-// 初始化中标记:用于避免初始化数据时触发 watch 引起二次覆盖
 const initializing = ref(false);
 const submitting = ref(false);
 // 身份证校验(格式、生日、校验码)
@@ -90,7 +88,6 @@ watch(
       return;
     }
     if (!newCardno) {
-      // 仅当用户清空且表单里本就没有后端给的年龄/性别时才清空
       const hasServerAge = form.value && (form.value as any).age != null && (form.value as any).age !== '';
       const hasServerSex = form.value && (form.value as any).sex != null && (form.value as any).sex !== '';
       if (!hasServerAge && !hasServerSex) {
@@ -150,7 +147,6 @@ function normalizeRegionValue() {
   const fv: any = form.value as any;
   const raw: any = fv?.region ?? fv?.regionCode ?? fv?.districtCode ?? fv?.areaCode ?? fv?.cityCode ?? fv?.provinceCode;
   if (!raw) {
-    // 尝试从拆分的字段组装
     const pc = fv?.provinceCode ?? fv?.province ?? fv?.province_id;
     const cc = fv?.cityCode ?? fv?.city ?? fv?.city_id;
     const dc = fv?.districtCode ?? fv?.district ?? fv?.areaCode ?? fv?.area ?? fv?.district_id;
@@ -217,7 +213,6 @@ async function getFoodAllergy() {
       id: item.value,
       name: item.label,
     }));
-    // 若表单里存的是名称数组,统一转换为编码数组
     const raw = (form.value as any)?.foodAllergy;
     const currentArr: any[] = Array.isArray(raw) ? raw : typeof raw === 'string' ? raw.split(',') : raw != null ? [raw] : [];
     if (currentArr.length > 0) {
@@ -245,7 +240,6 @@ async function getHobbyFlavor() {
       id: item.value,
       name: item.label,
     }));
-    // 若表单里存的是名称数组,统一转换为编码数组
     const raw = (form.value as any)?.hobbyFlavor;
     const currentArr: any[] = Array.isArray(raw) ? raw : typeof raw === 'string' ? raw.split(',') : raw != null ? [raw] : [];
     if (currentArr.length > 0) {
@@ -274,7 +268,6 @@ async function getJob() {
       id: item.value,
       name: item.label,
     }));
-    // 若表单里存的是名称,将其规范为编码
     const current = (form.value as any)?.job;
     if (current !== undefined && current !== null && current !== '') {
       const byId = job.value.find((i) => String(i.id) === String(current));
@@ -518,8 +511,6 @@ const formEmits: VxeFormListeners<FormModel> = {
     if (Array.isArray(processedData.hobbyFlavor)) {
       processedData.hobbyFlavor = processedData.hobbyFlavor.join(',');
     }
-    console.log(processedData, '处理后的数据');
-    // 直接调用 API 方法
     submitting.value = true;
     try {
       await patientBasicInfoMethod(processedData);

+ 3 - 1
src/components/Enabled.vue

@@ -16,7 +16,9 @@ import {
   type VxeFormInstance,
 } from 'vxe-pc-ui';
 import { list2Groups } from '@/tools/data';
-
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 type FollowModel = Partial<PlanModel>;
 
 const defaultModel = {};

+ 40 - 16
src/components/PatientHealthRecordPreview.vue

@@ -17,7 +17,6 @@ const props = defineProps<{
   report: Partial<ReportModel>;
   source?: string;
   sourceInsName?: string;
-
 }>();
 
 const emits = defineEmits<{
@@ -140,13 +139,22 @@ function openPatientTagEdit(event: MouseEvent) {
 function openPatientRecordsPreview() {
   const component = defineAsyncComponent(() => import('@/components/RecordsPatientPreview.vue'));
   const id = `modal:record-patient:preview`;
-  const onDestroy = () => { VxeUI.modal.close(id); };
+  const onDestroy = () => {
+    VxeUI.modal.close(id);
+  };
   onDestroy();
   VxeUI.modal.open({
-    id, remember: true,
-    showMaximize: true, mask: false, lockView: false, padding: false,
-    resize: true, width: Math.floor(window.innerWidth * 0.5), height: Math.floor(window.innerHeight * 0.5),
-    escClosable: true, maskClosable: true,
+    id,
+    remember: true,
+    showMaximize: true,
+    mask: false,
+    lockView: false,
+    padding: false,
+    resize: true,
+    width: Math.floor(window.innerWidth * 0.5),
+    height: Math.floor(window.innerHeight * 0.5),
+    escClosable: true,
+    maskClosable: true,
     title: `基础信息更新记录`,
     slots: {
       default() {
@@ -163,13 +171,22 @@ function openIndicatorRecordsPreview() {
   const component = defineAsyncComponent(() => import('@/components/RecordsIndicatorPreview.vue'));
   const id = `modal:record-indicator:preview`;
   console.log(patient.value, 'patient======');
-  const onDestroy = () => { VxeUI.modal.close(id); };
+  const onDestroy = () => {
+    VxeUI.modal.close(id);
+  };
   onDestroy();
   VxeUI.modal.open({
-    id, remember: true,
-    showMaximize: true, mask: false, lockView: false, padding: false,
-    resize: true, width: Math.floor(window.innerWidth * 0.5), height: Math.floor(window.innerHeight * 0.5),
-    escClosable: true, maskClosable: true,
+    id,
+    remember: true,
+    showMaximize: true,
+    mask: false,
+    lockView: false,
+    padding: false,
+    resize: true,
+    width: Math.floor(window.innerWidth * 0.5),
+    height: Math.floor(window.innerHeight * 0.5),
+    escClosable: true,
+    maskClosable: true,
     title: `指标信息更新记录`,
     slots: {
       default() {
@@ -188,10 +205,10 @@ function openIndicatorRecordsPreview() {
   <div class="p-6">
     <div class="flex">
       <section class="flex-auto">
-        <div class="row mb-5s" v-if="source || sourceInsName"> 
-         <span class="text-lg mr-20">来源</span>
-          <span class="text-lg mr-10" v-if="source">渠道:{{ source }}</span>
-          <span class="text-lg" v-if="sourceInsName">机构:{{ sourceInsName }}</span>
+        <div class="row mb-5" v-if="source || sourceInsName">
+          <span class="text-lg mr-12 font-bold">来源</span>
+          <a-tag color="pink">{{ source }}</a-tag>
+          <a-tag color="red">{{ sourceInsName }}</a-tag>
         </div>
         <header class="flex items-center">
           <div class="title">基本信息</div>
@@ -302,7 +319,10 @@ function openIndicatorRecordsPreview() {
             <div class="flex flex-wrap">
               <div class="text-center w-260px row" v-for="item in indicator" :key="item.id">
                 <div class="flex justify-center">
-                  <span><label>{{ item.name }}</label>{{ item.value }}{{ item.unit }}</span>
+                  <span
+                    ><label>{{ item.name }}</label
+                    >{{ item.value }}{{ item.unit }}</span
+                  >
                   <div class="inline-block ml-2 size-24px">
                     <a-button v-if="item.trend > 0" :icon="h(ArrowUpOutlined)" shape="circle" size="small" class="trend-up" />
                     <a-button v-else-if="item.trend < 0" :icon="h(ArrowDownOutlined)" shape="circle" size="small" class="trend-down" />
@@ -331,6 +351,10 @@ function openIndicatorRecordsPreview() {
 </template>
 
 <style scoped lang="scss">
+.title-text {
+  font-size: 16px;
+  color: rgba(0, 0, 0, 0.45);
+}
 section {
   color: rgba(0, 0, 0, 0.85);
 

+ 7 - 8
src/pages/index/care/configured.vue

@@ -1,7 +1,6 @@
 <script setup lang="ts">
 import { type VxeFormListeners, type VxeFormProps, type VxeGridInstance, type VxeGridListeners, type VxeGridProps, VxeUI } from 'vxe-pc-ui';
 import { usePagination, useRequest } from 'alova/client';
-import { notification } from 'ant-design-vue';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
 import dayjs from 'dayjs';
 import EditConfigured from '@/service/EditConfigured.vue';
@@ -156,13 +155,13 @@ const gridOptions = reactive<VxeGridProps<ConditioningSchemeModel>>({
   columns: [
     { field: 'orgName', title: '组织名称' },
     { field: 'insName', title: '机构名称' },
-    {
-      field: 'isHaveForInfer',
-      title: '是否定制项目',
-      slots: {
-        default: 'isHaveForInferSlot',
-      },
-    },
+    // {
+    //   field: 'isHaveForInfer',
+    //   title: '是否定制项目',
+    //   slots: {
+    //     default: 'isHaveForInferSlot',
+    //   },
+    // },
     // { field: 'forInferCount', title: '定制项目数' },
 
     {

+ 3 - 1
src/pages/index/care/issueService.vue

@@ -26,7 +26,9 @@ import { VxeUI } from 'vxe-pc-ui';
 import type { HealthReportVO } from '@/model/health-report.model';
 import type { PatientTagVO } from '@/model/patient.model';
 import dayjs from 'dayjs';
-
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 import { getPatientHealthRecordsMethod } from '@/request/api/report.api';
 
 type FollowModel = Partial<OpenConditioningSchemeModel>;

+ 3 - 0
src/pages/index/equipment/registe.vue

@@ -13,6 +13,9 @@ import type { EquirementModel, EquirementQuery } from '@/model/device.model';
 import { allTagsSearchMethod } from '@/request/api/follow.api';
 import { getDeviceRegisterMethod, deleteDeviceRegisterMethod, updateDeviceRegisterOrganizationMethod } from '@/request/api/device.api';
 import { branchMethod } from '@/request/api/system.api';
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 // 获取设备列表
 const { data: tags, loading: tagsLoading } = useRequest(getDeviceRegisterMethod, {
   initialData: { total: 0, data: [] },

+ 1 - 3
src/pages/index/patient/history.vue

@@ -106,11 +106,9 @@ const searchFormProps = reactive<VxeFormProps<PatientQuery>>({
         name: 'VxeNumberInput',
         props: {
           placeholder: '请输入',
-          min: 1,
           controls: false,
           precision: 0,
           step: 1,
-          max: 999,
         },
       },
     },
@@ -389,7 +387,7 @@ function openPatientEditHandle() {
   VxeUI.modal.open({
     id,
     title: `新增患者`,
-    maskClosable: true,
+    maskClosable: false,
     escClosable: true,
     slots: {
       default() {

+ 1 - 1
src/service/AddItems.vue

@@ -21,7 +21,7 @@ const typeOptionsLoading = ref<boolean>(false);
 const typeOptions = ref<{ label: string; value: string }[]>([]);
 
 // 统一提升消息提示层级,避免被弹窗遮挡
-message.config({ zIndex: 5000, top: 80, maxCount: 3, duration: 2 });
+message.config({ zIndex: '10000' as any, top: 80, maxCount: 3, duration: 2 });
 
 const supplierOptions = ref<{ label: string; value: string }[]>([]);
 

+ 8 - 0
src/service/ConfirmItems.vue

@@ -13,6 +13,9 @@ import { UploadIFile } from '@/request/api/follow.api';
 import type { UploadFile } from 'ant-design-vue/es/upload/interface';
 type SystemModel = Partial<SystemItemModel>;
 const props = defineProps<{ data: SystemModel }>();
+(notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 const unitOptions = [
   { label: '袋', value: '袋' },
   { label: '包', value: '包' },
@@ -295,7 +298,10 @@ function handleOk() {
   if (showOffLine.value && !props.data.isOffline) {
     props.data.isOffline = 'N';
   }
+  props.data.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
   confirmOrgConfirmMethod(props.data as SystemItemModel).then(() => {
+    console.log(props.data, 'props.data');
+    console.log(fileList.value, 'fileList.value111111');
     emit('submit', props.data as SystemItemModel);
     VxeUI.modal.close('confirm-item-modal');
     notification.success({
@@ -309,11 +315,13 @@ function toggleOnlineStatus() {
   props.data.isOffline = isOffline.value ? 'Y' : 'N';
 }
 onMounted(async () => {
+  console.log(props.data, 'props.data11111');
   if (props.data.id) {
     const res = await getConditioningSchemeDetailMethod(props.data);
     Object.assign(props.data, res);
     getIsonline(props.data.conditioningProgramSupplierId);
   }
+  
   fileList.value = props.data?.photo
     ? [
         {

+ 120 - 21
src/service/CustomConfiguration.vue

@@ -1,14 +1,13 @@
 <script setup lang="ts">
-import { ref, onMounted } from 'vue';
+import { ref, onMounted, computed } from 'vue';
 import { VxeUI } from 'vxe-pc-ui';
-import { notification } from 'ant-design-vue';
 import type { ConditioningSchemeModel } from '@/model/care.model';
 import { getConditioningSchemeItemsMethod } from '@/request/api/care.api';
 type ConditioningModel = Partial<ConditioningSchemeModel>;
 const props = defineProps<{ data: ConditioningModel }>();
 
-const emit = defineEmits(['submit', 'onSubmit']);
-
+const emit = defineEmits(['submit', 'onSubmit', 'close']);
+const selectedProjectsValue = ref<any[]>([]);
 // 定义项目接口
 interface ProjectItem {
   id: string | number;
@@ -28,16 +27,80 @@ const superiorProjects = ref<Organization[]>([]);
 // 本级项目数据
 const currentProjects = ref<ProjectItem[]>([]);
 
-// 关闭弹窗
+// ===== 全选相关逻辑 =====
+// 上级项目是否全部选中
+const isAllSuperiorChecked = computed(() => {
+
+  const allProjects = superiorProjects.value.flatMap((org) => org.projects);
+  console.log(allProjects, 'allProjects111111',superiorProjects.value);
+  if (allProjects.length === 0) return false;
+  return allProjects.every((p) => p.checked);
+});
+
+// 上级项目是否部分选中(用于半选中状态)
+const isSomeSuperiorChecked = computed(() => {
+  const allProjects = superiorProjects.value.flatMap((org) => org.projects);
+  const someChecked = allProjects.some((p) => p.checked);
+  return someChecked && !isAllSuperiorChecked.value;
+});
+
+// 切换上级项目全选
+const handleSuperiorCheckAllChange = (checked: boolean) => {
+  superiorProjects.value.forEach((org) => {
+    org.projects.forEach((project) => {
+      project.checked = checked;
+    });
+  });
+};
+
+// 某机构是否全部选中
+const isOrgAllChecked = (org: Organization) => {
+  if (!org.projects || org.projects.length === 0) return false;
+  return org.projects.every((p) => p.checked);
+};
+
+// 某机构是否部分选中
+const isOrgIndeterminate = (org: Organization) => {
+  const someChecked = org.projects?.some((p) => p.checked);
+  return !!someChecked && !isOrgAllChecked(org);
+};
+
+// 切换某机构全选
+const handleOrgCheckAllChange = (org: Organization, checked: boolean) => {
+  org.projects.forEach((project) => {
+    project.checked = checked;
+  });
+};
+
+// 本级项目是否全部选中
+const isAllCurrentChecked = computed(() => {
+  if (currentProjects.value.length === 0) return false;
+  return currentProjects.value.every((p) => p.checked);
+});
+
+// 本级项目是否部分选中
+const isSomeCurrentChecked = computed(() => {
+  const someChecked = currentProjects.value.some((p) => p.checked);
+  return someChecked && !isAllCurrentChecked.value;
+});
+
+// 切换本级项目全选
+const handleCurrentCheckAllChange = (checked: boolean) => {
+  currentProjects.value.forEach((project) => {
+    project.checked = checked;
+  });
+};
+
+// 关闭弹窗(取消时使用)
 function handleClose() {
+  emit('close');
   VxeUI.modal.close('custom-configuration-modal');
 }
 
-// 取消
+// 取消:仅关闭弹窗并让父组件回滚勾选状态
 function handleCancel() {
   handleClose();
 }
-
 // 确认
 function handleConfirm() {
   // 收集选中的项目数据
@@ -68,16 +131,19 @@ function handleConfirm() {
     originalData: props.data,
     selectedProjects: selectedProjects,
   };
+  
   // 必须选择一个项目
-  if (selectedProjects.length <= 0 && selectedProjects.length <= 0) {
-    notification.error({
-      message: '请至少选择一个项目',
-    });
-    return;
-  }
+  // if (selectedProjects.length <= 0 && selectedProjects.length <= 0) {
+  //   notification.error({
+  //     message: '请至少选择一个项目',
+  //   });
+  //   return;
+  // }
   emit('submit', result);
   emit('onSubmit', result);
-  handleClose();
+  selectedProjectsValue.value = selectedProjects;
+  // 确认时直接关闭弹窗,父组件通过 onSubmit 已经处理勾选状态
+  VxeUI.modal.close('custom-configuration-modal');
 }
 // 获取定制项目列表
 const getCustomProjectList = async () => {
@@ -127,10 +193,29 @@ onMounted(() => {
     <div class="content-wrapper">
       <!-- 上级项目 - 左侧 -->
       <div class="section section-left" v-if="superiorProjects.length > 0">
-        <div class="section-title">上级项目</div>
+        <div class="section-title section-title-with-checkbox">
+          <span>上级项目</span>
+          <a-checkbox
+            :checked="isAllSuperiorChecked"
+            :indeterminate="isSomeSuperiorChecked"
+            @change="(e: any) => handleSuperiorCheckAllChange(e.target.checked)"
+            style="margin-left: 20px;"
+          >
+            全选
+          </a-checkbox>
+        </div>
         <div class="organizations">
           <div v-for="org in superiorProjects" :key="org.id" class="organization-item">
-            <div class="org-name">{{ org.name }}</div>
+            <div class="org-header">
+              <div class="org-name">{{ org.name }}</div>
+              <a-checkbox
+                :checked="isOrgAllChecked(org)"
+                :indeterminate="isOrgIndeterminate(org)"
+                @change="(e: any) => handleOrgCheckAllChange(org, e.target.checked)"
+              >
+                全选
+              </a-checkbox>
+            </div>
             <div class="projects-list">
               <a-checkbox v-for="project in org.projects" :key="project.id" v-model:checked="project.checked" class="project-checkbox">
                 {{ project.name }}
@@ -142,7 +227,17 @@ onMounted(() => {
 
       <!-- 本级项目 - 右侧 -->
       <div class="section section-right" v-if="currentProjects.length > 0">
-        <div class="section-title">本级项目</div>
+        <div class="section-title section-title-with-checkbox">
+          <span>本级项目</span>
+          <a-checkbox
+            :checked="isAllCurrentChecked"
+            :indeterminate="isSomeCurrentChecked"
+            @change="(e: any) => handleCurrentCheckAllChange(e.target.checked)"
+            style="margin-left: 20px;"
+          >
+            全选
+          </a-checkbox>
+        </div>
         <div class="projects-list">
           <a-checkbox v-for="project in currentProjects" :key="project.id" v-model:checked="project.checked" class="project-checkbox">
             {{ project.name }}
@@ -211,7 +306,7 @@ onMounted(() => {
 
 .section-title {
   font-size: 16px;
-  font-weight: 500;
+  font-weight: 800;
   margin-bottom: 16px;
   color: #333;
 }
@@ -226,9 +321,9 @@ onMounted(() => {
 .organization-item {
   .org-name {
     font-size: 15px;
-    font-weight: 500;
-    margin-bottom: 12px;
+    // font-weight: 500;
     color: black;
+    margin-right: 20px;
   }
 }
 
@@ -244,7 +339,11 @@ onMounted(() => {
     color: #333;
   }
 }
-
+.org-header{
+  display: flex;
+  align-items: center;
+  margin-bottom: 20px;
+}
 .footer-buttons {
   display: flex;
   justify-content: center;

+ 40 - 34
src/service/EditConfigured.vue

@@ -2,14 +2,16 @@
 import { ref, watch, nextTick, h, onMounted, reactive } from 'vue';
 import { type VxeTablePropTypes, type VxeTableEvents, VxeUI } from 'vxe-table';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
-import { getConditioningDeviceDetailMethod, updateConditioningSchemeMethod, getConditioningSchemeItemsMethod } from '@/request/api/care.api';
+import { getConditioningDeviceDetailMethod, updateConditioningSchemeMethod } from '@/request/api/care.api';
 import type { ConditioningSchemeModel } from '@/model/care.model';
 import { useRequest } from 'alova/client';
-import { notification } from 'ant-design-vue';
+import { message, notification } from 'ant-design-vue';
 import { MenuUnfoldOutlined } from '@ant-design/icons-vue';
 import CustomConfiguration from '@/service/CustomConfiguration.vue';
 type ConditioningModel = Partial<ConditioningSchemeModel>;
-
+  (notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 // 定义表格行数据类型
 interface TableRowData {
   isCustomize: boolean;
@@ -21,8 +23,8 @@ interface TableRowData {
   selectedCpIds?: string[];
   isShowForInfer: string;
   isNewRow?: boolean; // 用于标识是否是新添加的行
-  showListIcon?: boolean; // 是否显示列表图标
-  previousChecked?: boolean; // 上一次的勾选状态,用于判断状态变化
+  previousChecked?: boolean; // 上一次“确认后”的勾选状态
+  backupSelectedCpIds?: string[]; // 打开弹窗前的已选项目快照(用于取消还原)
 }
 const emits = defineEmits<{
   submit: [success: boolean, data?: Array<TableRowData>];
@@ -96,7 +98,6 @@ const deleteRow = (row: any) => {
 
 // 保存
 const saveData = async () => {
-  console.log(tableData.value, '保存数据');
   // 数据验证和格式化
   formattedData = tableData.value.map((row) => ({
     ...row,
@@ -169,6 +170,7 @@ const organizationName = ref('');
 const insName = ref('');
 const insId = ref<number>(0);
 onMounted(async () => {
+  console.log(props.data, 'props.onMounted');
   getConditioningProgramType();
   const res: any = await getConditioningDeviceDetailMethod(props.data);
   organizationName.value = res.orgName ?? '';
@@ -183,13 +185,14 @@ onMounted(async () => {
     } else if (row.isHaveForInfer === 'Y') {
       // 是定制项目且展示
       row.isCustomize = true;
-      row.showListIcon = true; // 已勾选,显示列表图标
+      // row.showListIcon = true; // 已勾选,显示列表图标
     } else if (row.isHaveForInfer === 'N') {
       // 是定制项目但不展示
       row.isCustomize = true;
-      row.showListIcon = false; // 未勾选,隐藏列表图标
+      // row.showListIcon = false; // 未勾选,隐藏列表图标
     }
-    row.showListIcon = row.previousChecked = row.isChecked = row.isShowForInfer == 'Y' ? true : false;
+    // row.showListIcon =
+    row.isChecked = row.previousChecked = row.selectedCpIds && row.selectedCpIds.length > 0 ? true : false;
   });
 });
 
@@ -376,31 +379,15 @@ const handleItemLimitPaste = (params: any) => {
 };
 // 处理复选框变化
 function handleCheckboxChange(row: TableRowData) {
-  const wasChecked = row.previousChecked ?? false;
-  const isChecked = row.isChecked;
-
-  // 更新 previousChecked
-  row.previousChecked = isChecked;
-
-  // 从不勾选到勾选:显示列表图标并自动打开详情编辑
-  if (!wasChecked && isChecked) {
-    row.showListIcon = true;
-    row.isChecked = true;
-    row.isShowForInfer = 'Y';
-    // 延迟一下,确保UI更新后再打开弹窗
-    nextTick(() => {
-      handleCustomProjectTrue(row);
-    });
-  }
-  // 从勾选到不勾选:隐藏列表图标
-  else if (wasChecked && !isChecked) {
-    row.showListIcon = false;
-    row.isChecked = false;
-    row.isShowForInfer = 'N';
-  }
+  // 无论是勾选还是取消,都弹出定制项目弹窗;
+  // 真正的状态变更在弹窗“确认”时生效,“取消”会还原到打开前的项目选择
+  handleCustomProjectTrue(row);
 }
 
 const handleCustomProjectTrue = (row: any) => {
+  // 打开弹窗前先对项目选择做一份快照,供取消时还原
+  row.backupSelectedCpIds = row.selectedCpIds ? [...row.selectedCpIds] : [];
+
   VxeUI.modal.open({
     title: '定制项目',
     width: 1100,
@@ -418,8 +405,27 @@ const handleCustomProjectTrue = (row: any) => {
                 item.selectedCpIds = data.selectedProjects.map((item: any) => item.projectId) as string[];
               }
             });
+            // 根据是否有选中项目决定是否展示
+            const hasSelected = row.selectedCpIds && row.selectedCpIds.length > 0;
+            row.isChecked = !!hasSelected;
+            row.isShowForInfer = hasSelected ? 'Y' : 'N';
+
+            // 确认后更新“上一次确认”的状态和快照
+            row.previousChecked = row.isChecked;
+            row.backupSelectedCpIds = row.selectedCpIds ? [...row.selectedCpIds] : [];
+            VxeUI.modal.close('custom-configuration-modal');
+          },
+          onClose: () => {
+            // 取消时还原到打开弹窗前的项目选择
+            row.selectedCpIds = row.backupSelectedCpIds ? [...row.backupSelectedCpIds] : [];
+
+            // 根据还原后的已选项目恢复展示状态(是否显示仅由是否有选中项目决定)
+            const hasSelected = row.selectedCpIds && row.selectedCpIds.length > 0;
+            row.isChecked = !!hasSelected;
+            row.isShowForInfer = hasSelected ? 'Y' : 'N';
             VxeUI.modal.close('custom-configuration-modal');
           },
+        
         });
       },
     },
@@ -431,8 +437,8 @@ const handleCustomProjectTrue = (row: any) => {
   <div class="edit-configured">
     <!-- 组织名称 -->
     <div class="flex">
-      <div class="organization-name mr-15" v-if="organizationName">组织名称:{{ organizationName }}</div>
-      <div class="organization-name" v-if="insName">机构名称:{{ insName }}</div>
+      <div class="organization-name mr-15" v-if="organizationName">组织名称{{ organizationName }}</div>
+      <div class="organization-name" v-if="insName">机构名称{{ insName }}</div>
     </div>
     <!-- 表格 -->
     <vxe-table
@@ -474,7 +480,7 @@ const handleCustomProjectTrue = (row: any) => {
           <div class="custom-project-indicator">
             <div v-if="row.isCustomize" class="custom-project-true-container">
               <a-checkbox v-model:checked="row.isChecked" @change="handleCheckboxChange(row)"> 展示 </a-checkbox>
-              <div v-if="row.showListIcon" class="flex items-center custom-project-true" @click="handleCustomProjectTrue(row)">
+              <div v-if="row.isChecked" class="flex items-center custom-project-true" @click="handleCustomProjectTrue(row)">
                 <MenuUnfoldOutlined />
               </div>
             </div>

+ 3 - 0
src/service/EditSystemService.vue

@@ -30,6 +30,9 @@ const fileList = ref<UploadFile[]>([]);
 const uploadProps = reactive({ showRemoveIcon: true });
 const emit = defineEmits<{ submit: [data?: SystemCwModel] }>();
 const deptId = ref<string>('');
+  (notification.config as any)({
+  zIndex: 10000, // 直接设置层级
+});
 // 获取所有的机构
 const branch = ref<any[]>([]);
 const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data }) => {

+ 1 - 0
vite.config.ts

@@ -49,6 +49,7 @@ export default defineConfig((configEnv) => {
           VueRouterAutoImports,
         ],
         dts: `${ dts }auto-imports.d.ts`,
+
       }),
       Components({
         resolvers: [