nursing_unit_vue/src/views/invoicing/configSuppliersApply/NuConfigSuppliersApply.api.ts

91 lines
2.2 KiB
TypeScript
Raw Normal View History

2025-12-24 10:44:33 +08:00
import { defHttp } from '/@/utils/http/axios';
2026-01-26 14:27:09 +08:00
import { useMessage } from '/@/hooks/web/useMessage';
2025-12-24 10:44:33 +08:00
const { createConfirm } = useMessage();
enum Api {
list = '/configSuppliersApply/nuConfigSuppliersApply/list',
2026-01-26 14:27:09 +08:00
save = '/configSuppliersApply/nuConfigSuppliersApply/add',
edit = '/configSuppliersApply/nuConfigSuppliersApply/edit',
2025-12-24 10:44:33 +08:00
deleteOne = '/configSuppliersApply/nuConfigSuppliersApply/delete',
deleteBatch = '/configSuppliersApply/nuConfigSuppliersApply/deleteBatch',
importExcel = '/configSuppliersApply/nuConfigSuppliersApply/importExcel',
exportXls = '/configSuppliersApply/nuConfigSuppliersApply/exportXls',
2026-01-26 14:27:09 +08:00
getModifyInfo = '/configSuppliersApply/nuConfigSuppliersApply/getModifyInfo',
audit = '/configSuppliersApply/nuConfigSuppliersApply/audit',
2025-12-24 10:44:33 +08:00
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
2026-01-26 14:27:09 +08:00
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
2025-12-24 10:44:33 +08:00
handleSuccess();
});
2026-01-26 14:27:09 +08:00
};
2025-12-24 10:44:33 +08:00
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
2026-01-26 14:27:09 +08:00
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
2025-12-24 10:44:33 +08:00
handleSuccess();
});
2026-01-26 14:27:09 +08:00
},
2025-12-24 10:44:33 +08:00
});
2026-01-26 14:27:09 +08:00
};
2025-12-24 10:44:33 +08:00
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
2026-01-26 14:27:09 +08:00
};
/**
*
* @param params
*/
export const getModifyInfo = (params) => {
return defHttp.post({ url: Api.getModifyInfo, params });
};
/**
*
* @param params
*/
export const auditSubmit = (params) => {
return defHttp.post({ url: Api.audit, params });
};