更新
This commit is contained in:
1 parent
4ab63e77ed
commit
eb9b7beff5
16 files changed
+1031
-91
No files matched your search
@@ -108,12 +108,17 @@ import { Refresh, Search } from "@element-plus/icons-vue";
|
||||
import DetailDrawer from "./components/DetailDrawer.vue";
|
||||
import { getApprovalTodo } from "@/api/approval";
|
||||
|
||||
// 进销存审批由 ERP 工作台的审批列表单独处理,OA 审批中心只管其它审批
|
||||
const ERP_BIZ_PREFIX = "erp_";
|
||||
const ALL_NON_ERP = "non_erp";
|
||||
|
||||
const bizTypes = [
|
||||
{ value: ALL_NON_ERP, label: "全部类型" },
|
||||
{ value: "reimburse", label: "报销单" },
|
||||
{ value: "oa", label: "OA 通用审批" },
|
||||
];
|
||||
|
||||
const filters = reactive({ handled: 0, biz_type: "" });
|
||||
const filters = reactive({ handled: 0, biz_type: ALL_NON_ERP });
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 });
|
||||
const list = ref([]);
|
||||
const loading = ref(false);
|
||||
@@ -129,19 +134,23 @@ const responseData = (res) => res?.data?.data ?? res?.data ?? res ?? {};
|
||||
const loadList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 清空下拉也按「全部非 ERP 审批」处理,保证不会混入进销存审批
|
||||
const scope = filters.biz_type || ALL_NON_ERP;
|
||||
const data = responseData(
|
||||
await getApprovalTodo({
|
||||
handled: filters.handled,
|
||||
biz_type: filters.biz_type || "",
|
||||
biz_type: scope,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
}),
|
||||
);
|
||||
// 前端二次过滤:类型下拉切换后即时生效
|
||||
const rows = data.list || [];
|
||||
list.value = filters.biz_type
|
||||
? rows.filter((row) => row.instance?.biz_type === filters.biz_type)
|
||||
: rows;
|
||||
// 后端旧版本忽略 biz_type 时再兜一层,隔离始终生效
|
||||
const rows = (data.list || []).filter(
|
||||
(row) => !String(row?.instance?.biz_type || "").startsWith(ERP_BIZ_PREFIX)
|
||||
);
|
||||
list.value = scope === ALL_NON_ERP
|
||||
? rows
|
||||
: rows.filter((row) => row.instance?.biz_type === scope);
|
||||
pagination.total = Number(data.total || 0);
|
||||
} catch (error) {
|
||||
ElMessage.error(error?.message || "加载审批列表失败");
|
||||
|
||||
Reference in new issue
Block a user