|
|
|
@ -82,6 +82,7 @@
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
|
:sedOrderList="bookingDetails.hbList"
|
|
|
|
|
:isAdd="isAdd"
|
|
|
|
|
@changeHB="changeHBFun"
|
|
|
|
|
></sedOrder>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
@ -107,6 +108,109 @@ import {
|
|
|
|
|
BookingOrderAddOrUpdate
|
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { mapActions, mapGetters } from 'vuex'
|
|
|
|
|
const initDetail = {
|
|
|
|
|
id: 0,
|
|
|
|
|
parentId: 0,
|
|
|
|
|
// 基本信息
|
|
|
|
|
customername: '',
|
|
|
|
|
customerid: '',
|
|
|
|
|
carrier: '',
|
|
|
|
|
carrierid: '',
|
|
|
|
|
forwarder: '',
|
|
|
|
|
pono: '',
|
|
|
|
|
mblno: '',
|
|
|
|
|
hblno: '',
|
|
|
|
|
bookingno: '',
|
|
|
|
|
contractno: '',
|
|
|
|
|
vessel: '',
|
|
|
|
|
voyno: '',
|
|
|
|
|
voynoinner: '',
|
|
|
|
|
lanecode: '',
|
|
|
|
|
etd: '',
|
|
|
|
|
atd: '',
|
|
|
|
|
lanename: '',
|
|
|
|
|
shipagency: '',
|
|
|
|
|
sale: '',
|
|
|
|
|
op: '',
|
|
|
|
|
doc: '',
|
|
|
|
|
custservice: '',
|
|
|
|
|
// 收发通信息
|
|
|
|
|
shipper: '',
|
|
|
|
|
consignee: '',
|
|
|
|
|
notifyparty: '',
|
|
|
|
|
yard: '',
|
|
|
|
|
customser: '',
|
|
|
|
|
trucker: '',
|
|
|
|
|
agentid: '',
|
|
|
|
|
eta: '',
|
|
|
|
|
closingdate: '',
|
|
|
|
|
closedocdate: '',
|
|
|
|
|
closevgmdate: '',
|
|
|
|
|
portload: '',
|
|
|
|
|
portloadid: '',
|
|
|
|
|
transport: '',
|
|
|
|
|
transportid: '',
|
|
|
|
|
portdischarge: '',
|
|
|
|
|
portdischargeid: '',
|
|
|
|
|
destination: '',
|
|
|
|
|
destinationid: '',
|
|
|
|
|
placedelivery: '',
|
|
|
|
|
placedeliveryid: '',
|
|
|
|
|
placereceipt: '',
|
|
|
|
|
placereceiptid: '',
|
|
|
|
|
pkgs: 0,
|
|
|
|
|
kindpkgs: '',
|
|
|
|
|
kgs: 0,
|
|
|
|
|
cbm: 0,
|
|
|
|
|
// 货物信息
|
|
|
|
|
marks: '',
|
|
|
|
|
cargoid: '',
|
|
|
|
|
hscode: '',
|
|
|
|
|
description: '',
|
|
|
|
|
totalno: '',
|
|
|
|
|
// 签单信息
|
|
|
|
|
issuetype: '',
|
|
|
|
|
issuedate: '',
|
|
|
|
|
issueplace: '',
|
|
|
|
|
issueplaceid: '',
|
|
|
|
|
nobill: 'THREE',
|
|
|
|
|
copynobilll: 'THREE',
|
|
|
|
|
prepardat: '',
|
|
|
|
|
payableat: '',
|
|
|
|
|
blfrt: '',
|
|
|
|
|
thirdpayaddr: '',
|
|
|
|
|
service: '',
|
|
|
|
|
reeferf: '',
|
|
|
|
|
tempset: '',
|
|
|
|
|
tempid: '',
|
|
|
|
|
tempmin: '',
|
|
|
|
|
tempmax: '',
|
|
|
|
|
humidity: '',
|
|
|
|
|
dclass: '',
|
|
|
|
|
dunno: '',
|
|
|
|
|
dpage: '',
|
|
|
|
|
dlabel: '',
|
|
|
|
|
linkman: '',
|
|
|
|
|
// 备注信息
|
|
|
|
|
soremark: '',
|
|
|
|
|
siremark: '',
|
|
|
|
|
// 箱型
|
|
|
|
|
ctnInputs: [],
|
|
|
|
|
// edi补充信息 (edi联系人等暂无字段)
|
|
|
|
|
weituo: '',
|
|
|
|
|
freightpayer: '',
|
|
|
|
|
scaccode: '',
|
|
|
|
|
itncode: '',
|
|
|
|
|
iscontainersoc: 0,
|
|
|
|
|
bookingEDIExt: {
|
|
|
|
|
weiTuoFang: '',
|
|
|
|
|
ediAttn: '',
|
|
|
|
|
ediAttnTel: '',
|
|
|
|
|
ediAttnMail: ''
|
|
|
|
|
},
|
|
|
|
|
// 分单信息未添加
|
|
|
|
|
hbList: []
|
|
|
|
|
}
|
|
|
|
|
export default {
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
inject: ['reload'],
|
|
|
|
@ -129,7 +233,8 @@ export default {
|
|
|
|
|
id: this.$route.query.id,
|
|
|
|
|
isCopy: this.$route.query.isCopy || false,
|
|
|
|
|
inPageLoading: false,
|
|
|
|
|
bookingDetails: {},
|
|
|
|
|
// bookingDetails: {},
|
|
|
|
|
bookingDetails: initDetail,
|
|
|
|
|
tabBarStyle: {
|
|
|
|
|
background: '#fff',
|
|
|
|
|
padding: '0 20px'
|
|
|
|
@ -157,7 +262,7 @@ export default {
|
|
|
|
|
watch: {
|
|
|
|
|
bookingDetails: {
|
|
|
|
|
handler(nval, oval) {
|
|
|
|
|
localStorage.setItem(`${this.id}`, true)
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: true })
|
|
|
|
|
},
|
|
|
|
|
deep: true
|
|
|
|
|
}
|
|
|
|
@ -165,9 +270,6 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
updated() {
|
|
|
|
|
localStorage.setItem(`${this.id}`, false)
|
|
|
|
|
},
|
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
|
if (!Object.keys(this.historyData).includes(this.$route.query.id)) {
|
|
|
|
|
const hisData = {
|
|
|
|
@ -230,7 +332,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
this.bookingDetails = {}
|
|
|
|
|
// this.bookingDetails = {}
|
|
|
|
|
this.bookingDetails = initDetail
|
|
|
|
|
if (this.id) {
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
this.getDetail()
|
|
|
|
@ -367,10 +470,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDetail() {
|
|
|
|
|
if (this.inPageLoading) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.inPageLoading = true
|
|
|
|
|
this.inPageLoading = false
|
|
|
|
|
// if (this.inPageLoading) {
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
// this.inPageLoading = true
|
|
|
|
|
// this.$message.loading({ content: '加载中...' });
|
|
|
|
|
BookingOrderGet({
|
|
|
|
|
id: this.id
|
|
|
|
@ -392,6 +496,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$set(this, 'bookingDetails', res.data)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
}, 600)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
@ -443,7 +550,7 @@ export default {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
query: { id: res.data, type: this.bookingDetails.carrierid }
|
|
|
|
|
query: { id: res.data, type: this.bookingDetails.carrierid, noOpenTab: true }
|
|
|
|
|
})
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
@ -480,6 +587,25 @@ export default {
|
|
|
|
|
this.excuteRulesType = type
|
|
|
|
|
},
|
|
|
|
|
changePageFun(type) {
|
|
|
|
|
const _this = this
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
if (this.needSavePages[key].details || this.needSavePages[key].hbList) {
|
|
|
|
|
this.$confirm({
|
|
|
|
|
title: '请确认无未保存数据!',
|
|
|
|
|
content: '当点击确定按钮时,此页面 将会关闭。',
|
|
|
|
|
onOk() {
|
|
|
|
|
_this.changePage()
|
|
|
|
|
const $data = _this.needSavePages
|
|
|
|
|
delete $data[key]
|
|
|
|
|
_this.setNeedSavePages($data)
|
|
|
|
|
},
|
|
|
|
|
onCancel() {}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.changePage()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changePage (type) {
|
|
|
|
|
const nowId = this.$route.query.id
|
|
|
|
|
const arr = Object.keys(this.bookingList)
|
|
|
|
|
const index = arr.indexOf(nowId.toString())
|
|
|
|
@ -492,7 +618,7 @@ export default {
|
|
|
|
|
const prevType = this.bookingList[prevId].carrierid
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno }
|
|
|
|
|
query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno, noOpenTab: true }
|
|
|
|
|
})
|
|
|
|
|
// this.$route.query.id = 1123
|
|
|
|
|
} else {
|
|
|
|
@ -504,7 +630,7 @@ export default {
|
|
|
|
|
const nextType = this.bookingList[nextId].carrierid
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
query: { id: nextId, type: nextType, mblno: this.bookingList[nextId].mblno }
|
|
|
|
|
query: { id: nextId, type: nextType, mblno: this.bookingList[nextId].mblno, noOpenTab: true }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -527,6 +653,31 @@ export default {
|
|
|
|
|
data.hblno = ''
|
|
|
|
|
this.bookingDetails.hbList = [data]
|
|
|
|
|
this.tabActiveKey = '2'
|
|
|
|
|
},
|
|
|
|
|
changeHBFun (data) {
|
|
|
|
|
const arr = data.map((item, index) => {
|
|
|
|
|
return item.isNoSave
|
|
|
|
|
})
|
|
|
|
|
if (arr.includes(true)) {
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: true })
|
|
|
|
|
} else {
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: false })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
checkSaveFun (data) {
|
|
|
|
|
const lastPages = this.needSavePages
|
|
|
|
|
const $data = this.needSavePages[this.id] || {}
|
|
|
|
|
if (data.type === 'details') {
|
|
|
|
|
this.$set($data, 'details', data.hasChange)
|
|
|
|
|
} else if (data.type === 'hbList') {
|
|
|
|
|
this.$set($data, 'hbList', data.hasChange)
|
|
|
|
|
}
|
|
|
|
|
// const key = this.id
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
this.$set(lastPages, key, $data)
|
|
|
|
|
this.setNeedSavePages(lastPages)
|
|
|
|
|
console.log(' ==== > 父组件监听到总数据改变: ', key, $data, lastPages, this.needSavePages)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|