Parcourir la source

fix: 详情合并字段补全 + single_limit加载 + consult_mode友好提示 + outer_source_id映射

alphah il y a 2 semaines
Parent
commit
8b0d7def28

+ 9 - 3
backend/app/plugin/module_payment/expense/institution/controller.py

@@ -302,9 +302,15 @@ async def modify_institution_controller(
     # 第1次请求:仅修改制度基础信息(不含 scope)
     base_data = {k: v for k, v in data.items() if k != "modify_scope_info"}
     institution_modify_model = AlipayEbppInvoiceInstitutionModifyModel.from_alipay_dict(base_data)
-    result = await InstitutionService.modify_institution_service(
-        auth=auth, data=institution_modify_model, raw_data=base_data, scope_info=scope_info
-    )
+    try:
+        result = await InstitutionService.modify_institution_service(
+            auth=auth, data=institution_modify_model, raw_data=base_data, scope_info=scope_info
+        )
+    except Exception as e:
+        err_msg = str(e)
+        if "consult" in err_msg.lower() or "咨询" in err_msg or "发" in err_msg:
+            raise CustomException(msg="制度下存在发放规则,咨询模式不允许修改为外部服务商,请先删除发放规则后再试")
+        raise
     log.info(f"编辑费控制度成功: institution_id={institution_modify_model.institution_id}")
     return SuccessResponse(data=result, msg="编辑费控制度成功")
 

+ 2 - 1
backend/app/plugin/module_payment/expense/institution/service.py

@@ -389,7 +389,8 @@ class InstitutionService:
                 local_dict = InstitutionListOutSchema.model_validate(local_obj).model_dump()
                 for field in ("applicable_scope", "grant_mode", "period_type", "amount",
                               "single_limit", "effective_time_type", "employee_ids",
-                              "period_type", "scope_owner_id_list"):
+                              "scope_owner_id_list", "enterprise_id", "status",
+                              "created_time", "updated_time", "consult_mode"):
                     if field in local_dict and local_dict[field] is not None:
                         result_dict[field] = local_dict[field]
         except Exception as e:

+ 1 - 1
frontend/src/views/module_payment/institution/components/InstitutionDetail.vue

@@ -15,7 +15,7 @@
             {{ detailData.enterprise_id || "-" }}
           </el-descriptions-item>
           <el-descriptions-item label="外部业务编号" :span="1">
-            {{ detailData.out_biz_no || "-" }}
+            {{ detailData.outer_source_id || "-" }}
           </el-descriptions-item>
           <el-descriptions-item label="制度名称" :span="3">
             {{ detailData.name || detailData.institution_name || "-" }}

+ 3 - 0
frontend/src/views/module_payment/institution/components/InstitutionForm.vue

@@ -336,6 +336,9 @@ watch(
         formData.applicable_scope = data.applicable_scope || "none";
         formData.period_type = data.period_type || "monthly";
         formData.amount = data.amount;
+        formData.single_limit = data.single_limit;
+        formData.effective_time_type = data.effective_time_type || "unlimited";
+        formData.employee_ids = data.employee_ids || [];
       }
     }
   },

+ 5 - 1
frontend/src/views/module_payment/institution/components/QuotaList.vue

@@ -17,7 +17,11 @@
       </template>
       <el-table-column type="index" label="序号" width="60" align="center" />
       <el-table-column prop="quota_id" label="额度ID" min-width="160" show-overflow-tooltip />
-      <el-table-column prop="employee_id" label="员工ID" min-width="140" show-overflow-tooltip />
+      <el-table-column label="员工ID" min-width="140" show-overflow-tooltip>
+        <template #default="scope">
+          {{ scope.row.employee_id || "-" }}
+        </template>
+      </el-table-column>
       <el-table-column prop="total_amount" label="额度类型" width="90">
         <template #default="scope">
           {{ scope.row.total_amount ? '余额' : '额度' }}