Files
new_wms_admin/src/views/foundation/set/material/init/btnClick.ts
2025-09-28 16:11:10 +08:00

36 lines
1.0 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 { getMaterialListReloadApi, getMaterialListExportApi } from "@/api/modules/foundationMaterial";
import { useMsg } from "@/hooks/useMsg";
// 导出
export const handleExport = async (params: any) => {
const { initParam } = params;
const result = await getMaterialListExportApi(initParam);
if (result?.code === 0) {
useMsg("success", "导出成功 ");
}
};
//刷新
export const handleReload = async (params: any) => {
const { selectionList, proTable } = params;
let length = selectionList.length;
let ids: any = [];
if (length && length > 100) {
useMsg("warning", "选中刷新数据最大100条 ");
return;
}
selectionList.forEach((item: any) => {
ids.push(item.id);
});
let id = ids.join(",");
const result = await getMaterialListReloadApi({ id });
if (result?.code === 0) {
useMsg("success", "数据刷新成功 ");
proTable.value!.getTableList();
}
};
export const btnClick: any = {
export: handleExport,
reset: handleReload
};