张田田 10 месяцев назад
Родитель
Сommit
823f29a336
3 измененных файлов с 18 добавлено и 5 удалено
  1. 13 1
      src/service/AddItems.vue
  2. 3 2
      src/service/ConfirmItems.vue
  3. 2 2
      src/service/ServicePackageDetail.vue

+ 13 - 1
src/service/AddItems.vue

@@ -15,6 +15,7 @@ import type { FormInstance } from 'ant-design-vue';
 type SystemModel = Partial<SystemItemModel>;
 const props = defineProps<{ data: SystemModel }>();
 const formRef = ref<FormInstance>();
+const typeOptionsLoading = ref<boolean>(false);
 const typeOptions = ref<{ label: string; value: string }[]>([]);
 
 const supplierOptions = ref<{ label: string; value: string }[]>([]);
@@ -191,6 +192,7 @@ function doSubmit() {
 }
 // 获取方案类型
 async function getConditioningProgramType() {
+  typeOptionsLoading.value = true;
   try {
     const res = await getDictionaryMethod('condition_type');
     if (res?.length > 0) {
@@ -198,6 +200,8 @@ async function getConditioningProgramType() {
     }
   } catch (error) {
     console.error('获取方案类型列表失败:', error);
+  } finally {
+    typeOptionsLoading.value = false;
   }
 }
 
@@ -319,7 +323,15 @@ function handleSelect(value: string, node: any, extra: any) {
         <a-input v-model:value="form.name" placeholder="请输入" />
       </a-form-item>
       <a-form-item label="方案类型:" name="conditioningProgramType" required>
-        <a-select v-model:value="form.conditioningProgramType" :options="typeOptions" placeholder="请选择" allowClear @change="bindchange" />
+        <a-select
+          v-model:value="form.conditioningProgramType"
+          :options="typeOptions"
+          placeholder="请选择"
+          allowClear
+          :loading="typeOptionsLoading"
+          :disabled="typeOptions.length === 0"
+          @change="bindchange"
+        />
       </a-form-item>
       <a-form-item label="计价规则:" name="pricingType" required>
         <a-radio-group v-model:value="form.pricingType">

+ 3 - 2
src/service/ConfirmItems.vue

@@ -41,6 +41,7 @@ const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data })
 const supplierOptions = ref<any[]>([]);
 // 获取所有的供应商
 const supplierArr = ref<any[]>([]);
+supplierOptions.value = [];
 function getSupplier(params: any) {
   getAllSupplierMethod(params).then((res) => {
     if (res?.length > 0) {
@@ -74,7 +75,7 @@ function getIsonline(newSupplierId: any) {
   }
 
   // 使用 find 替代 filter,性能更好
-  const supplier = supplierArr.value.find(item => item.id === newSupplierId);
+  const supplier = supplierArr.value.find((item) => item.id === newSupplierId);
   if (!supplier) {
     return;
   }
@@ -121,7 +122,7 @@ watch(
         }, 200);
       }
     }
-  },
+  }
 );
 const uploadProps = reactive({ showRemoveIcon: true });
 function customUpload(e: any) {

+ 2 - 2
src/service/ServicePackageDetail.vue

@@ -52,10 +52,10 @@ const setVisible = (value: boolean): void => {
             <span>{{ tableData?.institutionName }}</span>
           </div>
           <!-- 服务包名称 -->
-          <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0" v-if="tableData?.name">
+          <!-- <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0" v-if="tableData?.name">
             <span style="white-space: nowrap; margin-right: 8px">服务包名称:</span>
             <span>{{ tableData?.name }}</span>
-          </div>
+          </div> -->
           <!-- 服务形象照 -->
           <div class="flex" v-if="props.data?.types === 'institution'" style="align-items: center; margin-bottom: 0">
             <div class="w-20" style="white-space: nowrap; margin-right: 8px">服务形象照:</div>