szh-new
张同海 5 months ago
parent d4072f7aa0
commit f772e60863

@ -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,
})
}

@ -23,6 +23,7 @@
:inChildLoading="inChildLoading"
@refresh="refreshPage"
@save="save"
@SetOCR="SetOCR"
>
</operationArea>
<a-tabs v-model:activeKey="mainOrderActiveKey" type="card" class="mt2">
@ -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

@ -123,6 +123,7 @@
watch(
() => props.details,
(nval) => {
console.log(nval)
setFieldsValueL(nval)
setFieldsValueR(nval)
// if (!props.details.notifypartY2) {

@ -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 {

@ -33,12 +33,12 @@
></i>
<i class="iconfont icon-shibai Error" v-else-if="rule.errorType === 'Error'"></i>
<span>{{ rule.resultName }}</span>
<a-icon
<!-- <a-icon
class="rule-icon"
@click="handleOpenRule(rule, 2)"
type="setting"
theme="filled"
/>
/> -->
</div>
</div>
<div class="tip" v-else-if="excuteRulesType === 'success'">

Loading…
Cancel
Save