|
|
@@ -230,6 +230,7 @@ import {
|
|
|
} from "@/api/module_payment/institution";
|
|
|
import InstitutionAPI from "@/api/module_payment/institution";
|
|
|
import DepartmentAPI from "@/api/module_payment/department";
|
|
|
+import { useEnterpriseStore } from "@/store/modules/enterprise.store";
|
|
|
import { reactive, ref, watch, computed } from "vue";
|
|
|
import EmployeeSelector from "./EmployeeSelector.vue";
|
|
|
|
|
|
@@ -289,9 +290,14 @@ const departmentOptions = ref<{ value: string; label: string }[]>([]);
|
|
|
|
|
|
// 从后端加载真实部门数据
|
|
|
async function loadDepartments() {
|
|
|
- if (!formData.enterprise_id) return;
|
|
|
+ let eid = formData.enterprise_id;
|
|
|
+ if (!eid) {
|
|
|
+ const store = useEnterpriseStore();
|
|
|
+ eid = store.getCurrentEnterprise?.enterprise_id || eid;
|
|
|
+ }
|
|
|
+ if (!eid) return;
|
|
|
try {
|
|
|
- const res = await DepartmentAPI.listDepartment({ enterprise_id: formData.enterprise_id, page_no: 1, page_size: 200 });
|
|
|
+ const res = await DepartmentAPI.listDepartment({ enterprise_id: eid, page_no: 1, page_size: 200 });
|
|
|
const items = res?.data?.data?.items || [];
|
|
|
departmentOptions.value = items.map((d: any) => ({
|
|
|
value: d.department_id,
|