feat: Implement manual print dialog with full label printing functionality
Added complete manual print dialog to Web UI based on fManualPrint.cs: - Created ManualPrintDialog component with all input fields (SID, Vendor Lot, Qty, MFG Date, Reel ID, Supplier, Part No) - Added printer selection (Left/Right), print count, delete after print checkbox, and barcode input - Implemented ExecuteManualPrint backend method with ZPL label generation and printer integration - Added WebSocketServer handler for EXECUTE_MANUAL_PRINT command with full parameter support - Integrated dialog into Header component with proper error handling via AlertContext 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -525,7 +525,17 @@ class CommunicationLayer {
|
||||
}
|
||||
}
|
||||
|
||||
public async openManualPrint(): Promise<{ success: boolean; message: string }> {
|
||||
public async executeManualPrint(printData: {
|
||||
sid: string;
|
||||
venderLot: string;
|
||||
qty: string;
|
||||
mfg: string;
|
||||
rid: string;
|
||||
spy: string;
|
||||
partNo: string;
|
||||
printer: string;
|
||||
count: number;
|
||||
}): Promise<{ success: boolean; message: string }> {
|
||||
if (isWebView && machine) {
|
||||
return { success: false, message: 'Manual print not yet implemented in WebView2 mode' };
|
||||
} else {
|
||||
@@ -533,7 +543,7 @@ class CommunicationLayer {
|
||||
const timeoutId = setTimeout(() => {
|
||||
this.listeners = this.listeners.filter(cb => cb !== handler);
|
||||
reject(new Error('Manual print timeout'));
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
|
||||
const handler = (data: any) => {
|
||||
if (data.type === 'MANUAL_PRINT_RESULT') {
|
||||
@@ -544,7 +554,10 @@ class CommunicationLayer {
|
||||
};
|
||||
|
||||
this.listeners.push(handler);
|
||||
this.ws?.send(JSON.stringify({ type: 'OPEN_MANUAL_PRINT' }));
|
||||
this.ws?.send(JSON.stringify({
|
||||
type: 'EXECUTE_MANUAL_PRINT',
|
||||
...printData
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user