From f772e608630e02039e47fc54552fa8ae60e25669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Tue, 25 Jun 2024 17:30:54 +0800 Subject: [PATCH] 06/25 --- .../operation/seaexport/api/BookingLedger.js | 5 +- .../operation/seaexport/detail/index.vue | 6 + .../seaexport/detail/modules/mailingInfo.vue | 1 + .../detail/modules/operationArea.vue | 110 +++++++++--------- .../seaexport/detail/modules/rightContent.vue | 4 +- 5 files changed, 69 insertions(+), 57 deletions(-) diff --git a/src/views/operation/seaexport/api/BookingLedger.js b/src/views/operation/seaexport/api/BookingLedger.js index c35149d8..355ca414 100644 --- a/src/views/operation/seaexport/api/BookingLedger.js +++ b/src/views/operation/seaexport/api/BookingLedger.js @@ -1117,14 +1117,13 @@ export function UploadOcrFile(data) { url: '/opApi/SeaExport/UploadOcrFile', method: 'post', data: data.data, - params: data.parameter, }) } // 获取图片 export function GetOcrImg(parameter) { return request({ url: '/opApi/SeaExport/GetOcrImg', - method: 'post', + method: 'get', params: parameter, responseType: 'arraybuffer', }) @@ -1133,7 +1132,7 @@ export function GetOcrImg(parameter) { export function GetOcrText(parameter) { return request({ url: '/opApi/SeaExport/GetOcrText', - method: 'post', + method: 'get', params: parameter, }) } diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index 436c2581..8d82ba1a 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -23,6 +23,7 @@ :inChildLoading="inChildLoading" @refresh="refreshPage" @save="save" + @SetOCR="SetOCR" > @@ -828,6 +829,11 @@ console.log('error', err) }) } + // OCR 赋值 + function SetOCR(data) { + console.log(data) + bookingDetails.value = { ...bookingDetails.value, ...data } + } // 组件的值发生变化时 function changeDetailFun(data) { const { detail } = data diff --git a/src/views/operation/seaexport/detail/modules/mailingInfo.vue b/src/views/operation/seaexport/detail/modules/mailingInfo.vue index 3deba720..d45db44c 100644 --- a/src/views/operation/seaexport/detail/modules/mailingInfo.vue +++ b/src/views/operation/seaexport/detail/modules/mailingInfo.vue @@ -123,6 +123,7 @@ watch( () => props.details, (nval) => { + console.log(nval) setFieldsValueL(nval) setFieldsValueR(nval) // if (!props.details.notifypartY2) { diff --git a/src/views/operation/seaexport/detail/modules/operationArea.vue b/src/views/operation/seaexport/detail/modules/operationArea.vue index 81e6212e..a62fb551 100644 --- a/src/views/operation/seaexport/detail/modules/operationArea.vue +++ b/src/views/operation/seaexport/detail/modules/operationArea.vue @@ -935,6 +935,7 @@ 'changePage', 'GetData', 'GetDefault', + 'SetOCR', ]) const props = defineProps({ details: { @@ -1270,7 +1271,7 @@ EDISloading.value = false EDIUloading.value = false // 未完成 - if (res.success) { + if (res.succeeded) { notification.success({ message: '发送成功', duration: 3 }) handleModelCancel() } else { @@ -1410,7 +1411,7 @@ VgmSend(id.value) .then((res) => { // notification.open({ message: '发送中..' }) - if (res.success) { + if (res.succeeded) { notification.success({ message: 'VGM发送成功', duration: 3 }) } else { notification.error({ message: res.message, duration: 3 }) @@ -1424,7 +1425,7 @@ SendXHZ({ id: id.value }) .then((res) => { // notification.loading({ message: '发送中..' }) - if (res.success) { + if (res.succeeded) { notification.success({ message: '下货纸发送成功', duration: 3 }) } else { notification.error({ message: res.message, duration: 3 }) @@ -1459,7 +1460,7 @@ function getLetterYard() { LetterYard(id.value) .then((res) => { - if (res.success) { + if (res.succeeded) { initCabinFrom.value = { ...initCabinFrom.value, ...res.data } } else { notification.error({ message: res.message, duration: 3 }) @@ -1473,7 +1474,7 @@ function getSampleBill() { SampleBill(id.value) .then((res) => { - if (res.success) { + if (res.succeeded) { initCabinFrom.value = res.data } else { notification.error({ message: res.message, duration: 3 }) @@ -1486,7 +1487,7 @@ function sampleBillPdf() { SampleBillPdf(id.value) .then((res) => { - if (res.success) { + if (res.succeeded) { hsaBillPdf.value = true billPdf.value = res.data.description } else { @@ -1501,7 +1502,7 @@ function getVgmLink() { LetterYard(id.value) .then((res) => { - if (res.success) { + if (res.succeeded) { initCabinFrom.value = { ...initCabinFrom.value, ...res.data } } else { notification.error({ message: res.message, duration: 3 }) @@ -1514,7 +1515,7 @@ function FnTxxpLink() { TxxpLink({ id: id.value }) .then((res) => { - if (res.success) { + if (res.succeeded) { copyFun(res.data) } else { notification.error({ message: res.message, duration: 3 }) @@ -1566,18 +1567,18 @@ const Bx = ref(0) const By = ref(0) const BCvData = ref([ - { name: '发货人', code: 'shipper' }, - { name: '收货人', code: 'consignee' }, - { name: '装货港', code: 'portload' }, + { name: '发货人', code: 'shipperContent' }, + { name: '收货人', code: 'consigneeContent' }, + { name: '装货港', code: 'loadPort' }, { name: '目的地', code: 'destination' }, { name: '唛头', code: 'marks' }, { name: '货物描述', code: 'description' }, - { name: '包装', code: 'kindpkgs' }, + // { name: '包装', code: 'kindPkgs' }, { name: '件数', code: 'pkgs' }, - { name: '尺寸', code: 'cbm' }, + { name: '尺码', code: 'cbm' }, { name: '毛重', code: 'kgs' }, - { name: '卸货港', code: 'portdischarge' }, - { name: '通知人', code: 'notifyparty' }, + { name: '卸货港', code: 'dischargePort' }, + { name: '通知人', code: 'notifyPartyContent' }, ]) function FnClickCvBox(data) { let details = { ...props.details } @@ -1597,7 +1598,6 @@ } else { details[data.code] = details[data.code] + Rdata.value } - // details[data.code] = details[data.code] + Rdata.value CvBoxType.value = false BCvData.value.forEach((item, index) => { if (item.code == data.code) { @@ -1605,29 +1605,30 @@ BCvData.value.push(item) } }) + emit('SetOCR', details) } function mouseup(e) { flag.value = false - // if (imgSrc.value && width.value != 0 && height.value != 0) { - GetOcrText({ - fileName: fileName.value, - x: x.value, - y: y.value, - w: width.value, - h: height.value, - scale: scale.value, - }).then((res) => { - Rdata.value = res.data - Bx.value = x.value + width.value - By.value = y.value + height.value - CvBoxType.value = true - }) - // } + if (imgSrc.value && width.value != 0 && height.value != 0) { + GetOcrText({ + fileName: fileName.value, + x: x.value, + y: y.value, + w: width.value, + h: height.value, + scale: scale.value, + }).then((res) => { + Rdata.value = res.data + Bx.value = x.value + width.value + By.value = y.value + height.value + CvBoxType.value = true + }) + } } function mousemove(e) { - // if (imgSrc.value) { - drawRect(e) - // } + if (imgSrc.value) { + drawRect(e) + } } function drawRect(e) { if (flag.value) { @@ -1648,14 +1649,14 @@ } function mousedown(e) { myCanvas.value.getContext('2d').clearRect(0, 0, myCanvas.value.width, myCanvas.value.height) - // if (imgSrc.value) { - flag.value = true - x.value = e.offsetX // 鼠标落下时的X - y.value = e.offsetY // 鼠标落下时的Y - CvBoxType.value = false - width.value = 0 - height.value = 0 - // } + if (imgSrc.value) { + flag.value = true + x.value = e.offsetX // 鼠标落下时的X + y.value = e.offsetY // 鼠标落下时的Y + CvBoxType.value = false + width.value = 0 + height.value = 0 + } } function copyFun(data) { @@ -1672,9 +1673,6 @@ } function uploadFile(file) { const formData = new FormData() - formData.append('file', file.file) - // formData.append('bookingId', id.value) - const type = file.file.type let Did: any = id.value if (route.query.isCopy) { Did = 0 @@ -1682,15 +1680,23 @@ if (!id.value) { Did = 0 } + formData.append('LinkId', Did) + formData.append('TypeCode', 'other') + formData.append('TypeName', '其他') + + formData.append('file', file.file) + + const type = file.file.type + UploadOcrFile({ data: formData, - parameter: { LinkId: Did, TypeCode: 'other', TypeName: '其他' }, + // parameter: { LinkId: Did, TypeCode: 'other', TypeName: '其他' }, }).then((res) => { - if (res.success) { - fileName.value = res.data.ocrFileName - if (Did == 0) { - emit('ocrUpflie', res.data.uploadFileName) - } + if (res.succeeded) { + fileName.value = res.data + // if (Did == 0) { + // emit('ocrUpflie', res.data.uploadFileName) + // } GetOcrImg({ fileName: fileName.value, scale: scale.value }).then((res) => { imgSrc.value = window.URL.createObjectURL( new Blob([res], { type: `${type};chartset=UTF-8` }), @@ -1716,7 +1722,7 @@ function handleCancelCabin() { cabinLoad.value = true CancelAllocationSlot(props.details.id).then((res) => { - if (res.success) { + if (res.succeeded) { notification.success({ message: '取消成功', duration: 3 }) emit('handleSetCtnList') } else { diff --git a/src/views/operation/seaexport/detail/modules/rightContent.vue b/src/views/operation/seaexport/detail/modules/rightContent.vue index 103ca94e..917f2a74 100644 --- a/src/views/operation/seaexport/detail/modules/rightContent.vue +++ b/src/views/operation/seaexport/detail/modules/rightContent.vue @@ -33,12 +33,12 @@ > {{ rule.resultName }} - + /> -->