原材料送检记录

This commit is contained in:
2026-05-18 16:59:34 +08:00
parent 5800b6b61c
commit a1181e49fc
19 changed files with 1182 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ enum Api {
queryPrinters = '/xslmes/mesXslRawMaterialCard/queryPrinters',
prepareNativePrint = '/xslmes/mesXslRawMaterialCard/prepareNativePrint',
printPdf = '/xslmes/mesXslRawMaterialCard/printPdf',
createInspectRecordByCard = '/xslmes/mesXslRawMaterialInspectRecord/createByCard',
}
export const getExportUrl = Api.exportXls;
@@ -63,3 +64,6 @@ export const prepareNativePrint = (id: string) =>
/** id + 前端生成的 pdfBase64printerName 空则用默认队列 */
export const printPdf = (data: { id: string; printerName?: string; pdfBase64: string; fileName?: string }) =>
defHttp.post({ url: Api.printPdf, data, timeout: 3 * 60 * 1000 });
export const createInspectRecordByCard = (rawMaterialCardId: string) =>
defHttp.post({ url: Api.createInspectRecordByCard, params: { rawMaterialCardId } });

View File

@@ -99,6 +99,7 @@
getExportUrl,
updatePriority,
prepareNativePrint,
createInspectRecordByCard,
} from './MesXslRawMaterialCard.api';
import { useMessage } from '/@/hooks/web/useMessage';
import {
@@ -431,6 +432,14 @@
}
}
async function handleSendInspect(record: Recordable) {
await createInspectRecordByCard(record.id as string);
record.testResult = '0';
record.hasPendingInspect = true;
createMessage.success('已生成送检记录');
reload();
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
@@ -452,6 +461,12 @@
onClick: handlePrintRow.bind(null, record),
auth: 'xslmes:mes_xsl_raw_material_card:edit',
},
{
label: '送检',
onClick: handleSendInspect.bind(null, record),
auth: 'xslmes:mes_xsl_raw_material_card:edit',
ifShow: () => (!record.testResult || record.testResult === '0') && !record.hasPendingInspect,
},
];
}