新增原料入场记录的免密查询和删除功能,支持级联删除关联原材料卡片。重构相关服务和控制器以增强逻辑删除支持,优化数据处理流程,确保数据一致性和准确性。同时,更新前端表单以支持新功能。
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslRawMaterialEntry/list',
|
||||
enum Api { list = '/xslmes/mesXslRawMaterialEntry/list',
|
||||
save = '/xslmes/mesXslRawMaterialEntry/add',
|
||||
edit = '/xslmes/mesXslRawMaterialEntry/edit',
|
||||
deleteOne = '/xslmes/mesXslRawMaterialEntry/delete',
|
||||
deleteBatch = '/xslmes/mesXslRawMaterialEntry/deleteBatch',
|
||||
linkedRawMaterialCards = '/xslmes/mesXslRawMaterialEntry/linkedRawMaterialCards',
|
||||
batchStockIn = '/xslmes/mesXslRawMaterialEntry/batchStockIn',
|
||||
importExcel = '/xslmes/mesXslRawMaterialEntry/importExcel',
|
||||
exportXls = '/xslmes/mesXslRawMaterialEntry/exportXls',
|
||||
@@ -20,26 +17,29 @@ enum Api {
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/** 删除前:查询入场记录关联的已生成原材料卡片 */
|
||||
export const getLinkedRawMaterialCards = (ids: string) =>
|
||||
defHttp.get<MesXslRawMaterialCardBrief[]>({ url: Api.linkedRawMaterialCards, params: { ids } });
|
||||
|
||||
export interface MesXslRawMaterialCardBrief {
|
||||
id?: string;
|
||||
barcode?: string;
|
||||
batchNo?: string;
|
||||
materialName?: string;
|
||||
splitDetailId?: string;
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
export const deleteOne = (params: { id: string; cascadeDeleteCards?: boolean }, handleSuccess?: () => void) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
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();
|
||||
});
|
||||
},
|
||||
export const batchDelete = (params: { ids: string; cascadeDeleteCards?: boolean }, handleSuccess?: () => void) => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess?.();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user