nursing_unit_vue/src/views/invoicing/jxc/JxcInfo.api.ts

77 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-06-30 10:14:24 +08:00
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
2025-09-05 10:43:04 +08:00
list = '/invoicing/blWarehouseMaterialInfo/list',
save='/invoicing/configMaterialInfo/add',
2025-07-15 08:41:14 +08:00
edit='/invoicing/qgdInfo/edit',
deleteOne = '/invoicing/qgdInfo/delete',
deleteBatch = '/invoicing/configMaterialInfo/deleteBatch',
2025-07-15 08:41:14 +08:00
addList='/invoicing/qgdInfo/addList',
queryListByUser='/invoicing/qgdInfo/queryListByUser',
2025-10-09 14:53:16 +08:00
addCgdByUser='/invoicing/qgdInfo/addCgdByUser',
2025-10-17 15:35:48 +08:00
saveCgd='/invoicing/qgdInfo/saveCgd',
2025-06-30 10:14:24 +08:00
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
2025-07-15 08:41:14 +08:00
/**
2026-04-21 13:32:33 +08:00
*
2025-07-15 08:41:14 +08:00
* @param params
*/
export const queryListByUser = (params) => defHttp.get({ url: Api.queryListByUser, params });
2025-10-09 14:53:16 +08:00
export const addCgdByUser = (params) => defHttp.post({ url: Api.addCgdByUser, params });
2025-10-17 15:35:48 +08:00
export const saveCgd = (params) => defHttp.post({ url: Api.saveCgd, params });
2025-06-30 10:14:24 +08:00
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
2025-07-15 08:41:14 +08:00
2026-04-21 13:32:33 +08:00
//添加采购信息
2025-07-15 08:41:14 +08:00
export const addList = (params) => {
return defHttp.post({ url: Api.addList, params }, { isTransformResponse: false });
}