dev
张同海 2 years ago
parent b559e56477
commit 472f674c26

@ -315,7 +315,7 @@ export function SendBookingOrClosingEDI(parameter) {
/**
* 下载订舱截单EDI
*/
export function DownloadBookingOrClosingEDI(parameter) {
export function DownloadBookingOrClosingEDI(parameter) {
return axios({
url: '/BookingOrder/DownloadBookingOrClosingEDI',
method: 'get',
@ -544,11 +544,12 @@ export function BookingOrderDownload(parameter) {
}
// 上传ocr文件
export function BookingOrderOcrUpFile(parameter) {
export function BookingOrderOcrUpFile(data) {
return axios({
url: '/BookingOrder/OcrUpFile',
method: 'post',
data: parameter
data: data.data,
params: data.parameter
})
}

@ -20,6 +20,7 @@
@changePage="changePageFun"
@copy="copyBookingFun"
@addSedList="addSedList"
@FnOcrChenga="FnOcrChenga"
></operationArea>
<a-tabs type="card">
<a-tab-pane key="1-1" tab="基础信息">
@ -39,15 +40,15 @@
<!-- 备注信息 -->
<remarksInfo :details="bookingDetails" @changeDetail="changeDetailFun"></remarksInfo>
<!-- 箱型 -->
<goodsTable :details="bookingDetails" @changeDetail="changeDetailFun" v-if="!inPageLoading"></goodsTable>
<goodsTable
:details="bookingDetails"
@changeDetail="changeDetailFun"
v-if="!inPageLoading"
></goodsTable>
</div>
</a-tab-pane>
<a-tab-pane key="2-2" tab="EDI补充信息">
<ediMore
class="pane-box"
:details="bookingDetails"
@changeDetail="changeDetailFun"
></ediMore>
<ediMore class="pane-box" :details="bookingDetails" @changeDetail="changeDetailFun"></ediMore>
</a-tab-pane>
</a-tabs>
</template>
@ -211,7 +212,7 @@ const initDetail = {
},
//
hbList: []
}
}
export default {
name: 'BookingDetail',
inject: ['reload'],
@ -275,9 +276,13 @@ export default {
this.init()
},
mounted() {
window.addEventListener('scroll', () => {
window.addEventListener(
'scroll',
() => {
this.scrollTop = document.getElementById('app').scrollTop
}, true)
},
true
)
},
beforeRouteUpdate(to, from, next) {
// console.log('fromId', from.query.id, '| toId', to.query.id)
@ -369,7 +374,7 @@ export default {
next()
setTimeout(() => {
this.inChildLoading = false
}, 2000);
}, 2000)
},
beforeRouteEnter(to, from, next) {
next(vm => {
@ -379,7 +384,11 @@ export default {
methods: {
...mapActions(['setNeedSavePages']),
getRouterHis() {
console.log('Router 2.3 === beforeRouteEnter - getRouterHis ===', Object.keys(this.historyData), this.$route.query.id)
console.log(
'Router 2.3 === beforeRouteEnter - getRouterHis ===',
Object.keys(this.historyData),
this.$route.query.id
)
this.inChildLoading = true
const newId = this.$route.query.id
if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') {
@ -477,7 +486,7 @@ export default {
}
this.inPageLoading = true
this.inChildLoading = true
this.$message.loading({ content: '加载中...' });
this.$message.loading({ content: '加载中...' })
// console.log('4.1 == ==', this.id)
BookingOrderGet({
id: this.id
@ -534,18 +543,17 @@ export default {
},
ifCompare(object1, object2) {
var o1keys = Object.keys(object1);
var o2keys = Object.keys(object2);
if (o2keys.length !== o1keys.length) return false;
var o1keys = Object.keys(object1)
var o2keys = Object.keys(object2)
if (o2keys.length !== o1keys.length) return false
for (let i = 0; i <= o1keys.length - 1; i++) {
let key = o1keys[i];
if (!o2keys.includes(key)) return false;
if (object2[key] !== object1[key]) return false;
let key = o1keys[i]
if (!o2keys.includes(key)) return false
if (object2[key] !== object1[key]) return false
}
return true;
return true
},
bookingOrderUpdate() {
if (!this.bookingDetails.mblno) {
this.$message.error('请输入提单号')
@ -566,13 +574,18 @@ export default {
// console.log('1.2 == - ==', this.id)
this.$router.replace({
name: 'BookingDetail',
query: { id: this.id, type: this.bookingDetails.carrierid, noOpenTab: true, mblno: this.bookingDetails.mblno }
query: {
id: this.id,
type: this.bookingDetails.carrierid,
noOpenTab: true,
mblno: this.bookingDetails.mblno
}
})
}
// this.init()
this.$forceUpdate()
} else {
if (typeof (res.message) === 'string') {
if (typeof res.message === 'string') {
this.$message.error(res.message)
} else {
this.$message.error('保存失败')
@ -599,11 +612,16 @@ export default {
this.$message.success('保存成功')
this.$router.replace({
name: 'BookingDetail',
query: { id: res.data, type: this.bookingDetails.carrierid, noOpenTab: true, mblno: this.bookingDetails.mblno }
query: {
id: res.data,
type: this.bookingDetails.carrierid,
noOpenTab: true,
mblno: this.bookingDetails.mblno
}
})
this.$forceUpdate()
} else {
if (typeof (res.message) === 'string') {
if (typeof res.message === 'string') {
this.$message.error(res.message)
} else {
this.$message.error('保存失败')
@ -642,7 +660,10 @@ export default {
changePageFun(type) {
const _this = this
const key = this.$route.fullPath
if (Object.keys(this.needSavePages).includes(key) && (this.needSavePages[key].details || this.needSavePages[key].hbList)) {
if (
Object.keys(this.needSavePages).includes(key) &&
(this.needSavePages[key].details || this.needSavePages[key].hbList)
) {
// console.log('== - biu ==')
this.$confirm({
title: '请确认无未保存数据!',
@ -659,7 +680,7 @@ export default {
this.changePage(type)
}
},
changePage (type) {
changePage(type) {
const nowId = this.$route.query.id
const arr = Object.keys(this.bookingList)
const index = arr.indexOf(nowId.toString())
@ -704,6 +725,10 @@ export default {
query: { id: this.id, isCopy: true, type: this.bookingDetails.carrierid }
})
},
FnOcrChenga(data) {
this.bookingDetails = data
console.log(this.bookingDetails)
},
addSedList() {
if (this.isAdd) {
this.$message.error('请先保存主单')
@ -720,7 +745,7 @@ export default {
this.tabActiveKey = '2'
this.Showtabs = true
},
changeHBFun (data) {
changeHBFun(data) {
const arr = data.map((item, index) => {
return item.isNoSave
})
@ -731,7 +756,7 @@ export default {
this.checkSaveFun({ type: 'hbList', hasChange: false })
}
},
checkSaveFun (data) {
checkSaveFun(data) {
// if (this.inPageLoading) {
// return false
// }
@ -749,16 +774,16 @@ export default {
// console.log('== vuex ==', this.needSavePages)
},
calc(num1, num2, calcStr) {
var str1; //
var str2;
var ws1 = 0; // ws1ws2 num
var ws2 = 0; //
var bigger; // biggersmaller0
var smaller; // 1.001 + 2.03 2.0301001+2031.12*1.1112*111000112*11/1000=1.232
var zeroCount; // 0
var isExistDot1; //
var isExistDot2;
var sum;
var str1 //
var str2
var ws1 = 0 // ws1ws2 num
var ws2 = 0 //
var bigger // biggersmaller0
var smaller // 1.001 + 2.03 2.0301001+2031.12*1.1112*111000112*11/1000=1.232
var zeroCount // 0
var isExistDot1 //
var isExistDot2
var sum
var beishu = 1
//
str1 = num1.toString()
@ -912,47 +937,47 @@ export default {
// // padding-top: 4px !important;
// background: #f99 !important;
// }
.ant-input-affix-wrapper .ant-input:not(:last-child){
.ant-input-affix-wrapper .ant-input:not(:last-child) {
height: 28px !important;
// margin-top: 4px !important;
// background: #9f9 !important;
}
.ant-select-selection{
.ant-select-selection {
height: 28px !important;
// margin-top: 4px !important;
// background: #f00 !important;
}
.ant-input:placeholder-shown{
.ant-input:placeholder-shown {
height: 28px !important;
// margin-top: 4px !important;
// background: #99f !important;
}
.ant-calendar-picker-input.ant-input{
.ant-calendar-picker-input.ant-input {
height: 28px !important;
// margin-top: 4px !important;
}
.ant-form-item-label{
.ant-form-item-label {
// line-height: 30px !important;
// border: 1px solid #f00;
}
.ant-form-item-control-wrapper{
.ant-form-item-control-wrapper {
// border: 1px solid #f99;
// height: 30px;
// vertical-align: top;
// padding: 0;
}
.left-box{
.left-box {
// padding-top: 60px;
}
.normal-nav{
transition: .5s all;
.normal-nav {
transition: 0.5s all;
}
.fixed-nav{
.fixed-nav {
position: fixed;
top: 56px;
box-shadow:0px 15px 10px -15px #ccc;
box-shadow: 0px 15px 10px -15px #ccc;
z-index: 999;
background:#fff;
transition: .5s all;
background: #fff;
transition: 0.5s all;
}
</style>

@ -633,6 +633,27 @@ export default {
methods: {
// ========== OCR ==========
FnClickCvBox(data) {
// let Arr = ['pkgs', 'cbm', 'kgs', 'portdischarge', 'destination', 'kindpkgs']
// let Type = false
// Arr.forEach(item => {
// if (data.code == item) {
// Type = true
// }
// })
// if (Type) {
// if (data.code == 'pkgs' || data.code == 'cbm' || data.code == 'kgs') {
// this.details[data.code] = parseInt(this.Rdata)
// } else {
// this.details[data.code] = this.Rdata
// }
// } else {
// this.details[data.code] = this.details[data.code] + this.Rdata
// }
console.log(data)
console.log(data.code)
console.log(this.details)
console.log(this.details[data.code])
console.log(this.Rdata)
this.details[data.code] = this.details[data.code] + this.Rdata
this.CvBoxType = false
this.BCvData.forEach((item, index) => {
@ -641,6 +662,7 @@ export default {
this.BCvData.push(item)
}
})
this.$emit('FnOcrChenga', this.details)
},
drawRect(e) {
if (this.flag) {
@ -704,10 +726,10 @@ export default {
uploadFile(file) {
const formData = new FormData()
formData.append('file', file.file)
formData.append('bookingId', this.id)
// formData.append('bookingId', this.id)
const type = file.file.type
console.log(type)
BookingOrderOcrUpFile(formData).then(res => {
BookingOrderOcrUpFile({ data: formData, parameter: { bookingId: this.id } }).then(res => {
this.fileName = res.data
BookingOrderOcrGetImg({ fileName: this.fileName, scale: this.scale }).then(res => {
this.imgSrc = window.URL.createObjectURL(new Blob([res], { type: `${type};chartset=UTF-8` }))

Loading…
Cancel
Save