modified logic in ocr
This commit is contained in:
@@ -875,13 +875,13 @@ function cameraCapture() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const detectedText = result.data.text.trim();
|
const detectedText = result.data.text.trim();
|
||||||
alert("Detected Text:\n" + (detectedText || "[No text detected]"));
|
// alert("Detected Text:\n" + (detectedText || "[No text detected]"));
|
||||||
// Extract serial numbers (digits only)
|
// Extract serial numbers (digits only)
|
||||||
const matches = detectedText.match(/\d+/g) || [];
|
const matches = detectedText.match(/\d+/g) || [];
|
||||||
this.serialNumbers = matches.slice(0, 4); // take first 4 serials
|
this.serialNumbers = matches.slice(0, 4); // take first 4 serials
|
||||||
this.$refs.hiddenInputSerials.value = JSON.stringify(this.serialNumbers);
|
this.$refs.hiddenInputSerials.value = JSON.stringify(this.serialNumbers);
|
||||||
//this.$refs.serialInput.value = JSON.stringify(this.serialNumbers);
|
//this.$refs.serialInput.value = JSON.stringify(this.serialNumbers);
|
||||||
alert("Serial numbers stored in hidden input:\n" + this.$refs.hiddenInputSerials.value);
|
alert("Serial numbers:\n" + this.$refs.hiddenInputSerials.value);
|
||||||
// ✅ Save to Laravel Session using POST API
|
// ✅ Save to Laravel Session using POST API
|
||||||
fetch('/save-serials-to-session', {
|
fetch('/save-serials-to-session', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user