Files
new_wms_admin/src/views/foundation/subscribe/warehousing/init/btnClick.ts
2025-10-17 16:38:54 +08:00

40 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useMsg } from "@/hooks/useMsg";
import { getSubscribeResetListApi, getSubscribeResetListExportApi } from "@/api/modules/warehousing";
import { cloneDeep } from "lodash-es";
// 导出
export const handleExport = async (data: any) => {
const { initParam } = data;
let params = cloneDeep(initParam);
params.org_number =
Array.isArray(params?.org_number) && params?.org_number?.length ? params.org_number.join(",") : params.org_number;
const result = await getSubscribeResetListExportApi(params);
if (result?.code === 0) {
useMsg("success", "导出成功 ");
}
};
// proTable: any
export const handleReSet = async (params: any) => {
const { proTable, selectionList } = params;
let length = selectionList.length;
if (length && length > 100) {
useMsg("warning", "选中刷新数据最大100条 ");
return;
}
let ids: any = [];
selectionList.forEach((item: any) => {
ids.push(item.id);
});
let id = ids.join(",");
const result = await getSubscribeResetListApi({ id });
if (result?.code === 0) {
useMsg("success", "数据刷新成功 ");
proTable?.value!.getTableList();
}
};
export const btnClick: any = {
export: handleExport,
reset: handleReSet
};