Pārlūkot izejas kodu

【系统服务包】编辑时无法添加项目

张田田 10 mēneši atpakaļ
vecāks
revīzija
add032a91c
2 mainītis faili ar 22 papildinājumiem un 9 dzēšanām
  1. 13 5
      src/components/Enabled.vue
  2. 9 4
      src/service/EditSystemService.vue

+ 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++;

+ 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>