20260511173242
This commit is contained in:
1 parent
56f5ba4e6b
commit
364d29dbaa
20 files changed
+2992
-88
No files matched your search
@@ -54,9 +54,16 @@ function handleChooseBox() {
|
||||
|
||||
imageCompress(tempFile.path).then((compressRes) => {
|
||||
form.value.b_container_img = compressRes.path
|
||||
const fileName = tempFile.name || `image_${Date.now()}.jpg`
|
||||
boxImage.value = {
|
||||
...tempFile,
|
||||
name: fileName,
|
||||
path: compressRes.path,
|
||||
size: compressRes.size,
|
||||
}
|
||||
|
||||
uploadTempFileApi(compressRes.path, {
|
||||
fileName: tempFile.name,
|
||||
fileName,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
recognizeOcrBoxApi({
|
||||
@@ -92,12 +99,15 @@ const computedOcrScore = computed(() => {
|
||||
function resetForm() {
|
||||
boxImage.value = null
|
||||
form.value.b_container_no = ''
|
||||
form.value.b_container_img = ''
|
||||
form.value.ocrNo = ''
|
||||
form.value.ocrScore = 0.00
|
||||
|
||||
showResult.value = false
|
||||
isError.value = false
|
||||
ocrFinish.value = false
|
||||
subFileList.value = []
|
||||
subFileList2.value = []
|
||||
}
|
||||
|
||||
function handleDeleteBoxImage() {
|
||||
@@ -140,7 +150,7 @@ function beforeRemove(_index: number, _fileItem: UploadFileItem): boolean | Prom
|
||||
}
|
||||
|
||||
async function handleConfirm() {
|
||||
if (form.value.b_container_img === '') {
|
||||
if (!boxImage.value) {
|
||||
toast.fail('集装箱号图片不能为空')
|
||||
return
|
||||
}
|
||||
@@ -258,6 +268,13 @@ async function handleConfirm() {
|
||||
tipContainerNo.value = form.value.b_container_no
|
||||
showResult.value = true
|
||||
}
|
||||
else {
|
||||
toast.fail('保存失败')
|
||||
}
|
||||
}).catch(() => {
|
||||
toast.fail('保存失败')
|
||||
}).finally(() => {
|
||||
toast.hide()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -279,19 +296,8 @@ async function continueAdd() {
|
||||
const idRes = await getUniqueIdApi()
|
||||
|
||||
if (idRes.success) {
|
||||
boxImage.value = null
|
||||
|
||||
ocrFinish.value = false
|
||||
isError.value = false
|
||||
|
||||
resetForm()
|
||||
form.value.b_id = idRes.data
|
||||
|
||||
subFileList.value = []
|
||||
subFileList2.value = []
|
||||
|
||||
showResult.value = false
|
||||
|
||||
tipContainerNo.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user