|
|
@ -1055,7 +1055,6 @@ export default {
|
|
|
|
let kgs = 0
|
|
|
|
let kgs = 0
|
|
|
|
let cbm = 0
|
|
|
|
let cbm = 0
|
|
|
|
this.bookingDetails.ctnInputs.forEach(item => {
|
|
|
|
this.bookingDetails.ctnInputs.forEach(item => {
|
|
|
|
console.log(item)
|
|
|
|
|
|
|
|
if (parseFloat(item.pkgs)) {
|
|
|
|
if (parseFloat(item.pkgs)) {
|
|
|
|
pkgs = pkgs + parseFloat(item.pkgs)
|
|
|
|
pkgs = pkgs + parseFloat(item.pkgs)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1066,74 +1065,97 @@ export default {
|
|
|
|
cbm = cbm + parseFloat(item.cbm)
|
|
|
|
cbm = cbm + parseFloat(item.cbm)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
|
|
let confirm = text => {
|
|
|
|
|
|
|
|
this.$confirm({
|
|
|
|
|
|
|
|
title: `${text}不一致,是否继续?`,
|
|
|
|
|
|
|
|
okText: '是',
|
|
|
|
|
|
|
|
okType: 'danger',
|
|
|
|
|
|
|
|
cancelText: '否',
|
|
|
|
|
|
|
|
onOk() {
|
|
|
|
|
|
|
|
const _data = JSON.parse(JSON.stringify(that.bookingDetails))
|
|
|
|
|
|
|
|
delete _data.hbList
|
|
|
|
|
|
|
|
BookingOrderAddOrUpdate(_data)
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
that.$message.success('保存成功')
|
|
|
|
|
|
|
|
if (that.isAdd) {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
that.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: res.data,
|
|
|
|
|
|
|
|
type: that.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: that.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else if (that.$route.query.mblno === that.bookingDetails.mblno) {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
console.log('1.1 == 保存成功 - 不切换路由 ==', that.id)
|
|
|
|
|
|
|
|
// that.init()
|
|
|
|
|
|
|
|
that.checkSaveFun({ type: 'hbList', hasChange: false })
|
|
|
|
|
|
|
|
that.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
// console.log('1.2 == 保存成功 - 刷新路由 ==', that.id)
|
|
|
|
|
|
|
|
that.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: that.id,
|
|
|
|
|
|
|
|
type: that.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: that.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// that.init()
|
|
|
|
|
|
|
|
that.$forceUpdate()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (typeof res.message === 'string') {
|
|
|
|
|
|
|
|
that.$message.error(res.message)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
that.$message.error('保存失败')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
class: 'test'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let WText = ''
|
|
|
|
if (parseFloat(pkgs) != parseFloat(this.bookingDetails.pkgs)) {
|
|
|
|
if (parseFloat(pkgs) != parseFloat(this.bookingDetails.pkgs)) {
|
|
|
|
console.log(parseFloat(pkgs), parseFloat(this.bookingDetails.pkgs))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,件数不一致')
|
|
|
|
WText = `${WText},件数`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `件数`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parseFloat(kgs) != parseFloat(this.bookingDetails.kgs)) {
|
|
|
|
if (parseFloat(kgs) != parseFloat(this.bookingDetails.kgs)) {
|
|
|
|
console.log(parseFloat(kgs), parseFloat(this.bookingDetails.kgs))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,重量不一致')
|
|
|
|
WText = `${WText},重量`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `重量`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parseFloat(cbm) != parseFloat(this.bookingDetails.cbm)) {
|
|
|
|
if (parseFloat(cbm) != parseFloat(this.bookingDetails.cbm)) {
|
|
|
|
console.log(parseFloat(cbm), parseFloat(this.bookingDetails.cbm))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,尺码不一致')
|
|
|
|
WText = `${WText},尺码`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `尺码`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
confirm(WText)
|
|
|
|
// 自定义必填项验证 - end
|
|
|
|
// 自定义必填项验证 - end
|
|
|
|
const _data = JSON.parse(JSON.stringify(this.bookingDetails))
|
|
|
|
|
|
|
|
delete _data.hbList
|
|
|
|
|
|
|
|
BookingOrderAddOrUpdate(_data)
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
|
|
|
if (this.isAdd) {
|
|
|
|
|
|
|
|
this.isCopy = false
|
|
|
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: res.data,
|
|
|
|
|
|
|
|
type: this.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: this.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else if (this.$route.query.mblno === this.bookingDetails.mblno) {
|
|
|
|
|
|
|
|
this.isCopy = false
|
|
|
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
|
|
|
console.log('1.1 == 保存成功 - 不切换路由 ==', this.id)
|
|
|
|
|
|
|
|
// this.init()
|
|
|
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: false })
|
|
|
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.isCopy = false
|
|
|
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// this.init()
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (typeof res.message === 'string') {
|
|
|
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error('保存失败')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
bookingOrderAdd() {
|
|
|
|
bookingOrderAdd() {
|
|
|
@ -1214,7 +1236,6 @@ export default {
|
|
|
|
let kgs = 0
|
|
|
|
let kgs = 0
|
|
|
|
let cbm = 0
|
|
|
|
let cbm = 0
|
|
|
|
this.bookingDetails.ctnInputs.forEach(item => {
|
|
|
|
this.bookingDetails.ctnInputs.forEach(item => {
|
|
|
|
console.log(item)
|
|
|
|
|
|
|
|
if (parseFloat(item.pkgs)) {
|
|
|
|
if (parseFloat(item.pkgs)) {
|
|
|
|
pkgs = pkgs + parseFloat(item.pkgs)
|
|
|
|
pkgs = pkgs + parseFloat(item.pkgs)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1225,52 +1246,96 @@ export default {
|
|
|
|
cbm = cbm + parseFloat(item.cbm)
|
|
|
|
cbm = cbm + parseFloat(item.cbm)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
|
|
let confirm = text => {
|
|
|
|
|
|
|
|
this.$confirm({
|
|
|
|
|
|
|
|
title: `${text}不一致,是否继续?`,
|
|
|
|
|
|
|
|
okText: '是',
|
|
|
|
|
|
|
|
okType: 'danger',
|
|
|
|
|
|
|
|
cancelText: '否',
|
|
|
|
|
|
|
|
onOk() {
|
|
|
|
|
|
|
|
const _data = JSON.parse(JSON.stringify(that.bookingDetails))
|
|
|
|
|
|
|
|
delete _data.hbList
|
|
|
|
|
|
|
|
BookingOrderAddOrUpdate(_data)
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
that.$message.success('保存成功')
|
|
|
|
|
|
|
|
if (that.isAdd) {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
that.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: res.data,
|
|
|
|
|
|
|
|
type: that.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: that.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else if (that.$route.query.mblno === that.bookingDetails.mblno) {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
console.log('1.1 == 保存成功 - 不切换路由 ==', that.id)
|
|
|
|
|
|
|
|
// that.init()
|
|
|
|
|
|
|
|
that.checkSaveFun({ type: 'hbList', hasChange: false })
|
|
|
|
|
|
|
|
that.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
that.isCopy = false
|
|
|
|
|
|
|
|
that.isAdd = false
|
|
|
|
|
|
|
|
// console.log('1.2 == 保存成功 - 刷新路由 ==', that.id)
|
|
|
|
|
|
|
|
that.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: that.id,
|
|
|
|
|
|
|
|
type: that.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: that.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// that.init()
|
|
|
|
|
|
|
|
that.$forceUpdate()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (typeof res.message === 'string') {
|
|
|
|
|
|
|
|
that.$message.error(res.message)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
that.$message.error('保存失败')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
class: 'test'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let WText = ''
|
|
|
|
if (parseFloat(pkgs) != parseFloat(this.bookingDetails.pkgs)) {
|
|
|
|
if (parseFloat(pkgs) != parseFloat(this.bookingDetails.pkgs)) {
|
|
|
|
console.log(parseFloat(pkgs), parseFloat(this.bookingDetails.pkgs))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,件数不一致')
|
|
|
|
WText = `${WText},件数`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `件数`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parseFloat(kgs) != parseFloat(this.bookingDetails.kgs)) {
|
|
|
|
if (parseFloat(kgs) != parseFloat(this.bookingDetails.kgs)) {
|
|
|
|
console.log(parseFloat(kgs), parseFloat(this.bookingDetails.kgs))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,重量不一致')
|
|
|
|
WText = `${WText},重量`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `重量`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parseFloat(cbm) != parseFloat(this.bookingDetails.cbm)) {
|
|
|
|
if (parseFloat(cbm) != parseFloat(this.bookingDetails.cbm)) {
|
|
|
|
console.log(parseFloat(cbm), parseFloat(this.bookingDetails.cbm))
|
|
|
|
if (WText) {
|
|
|
|
this.$message.error('保存失败,尺码不一致')
|
|
|
|
WText = `${WText},尺码`
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
|
|
|
|
WText = `尺码`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 自定义必填项验证 - end
|
|
|
|
confirm(WText)
|
|
|
|
const _data = JSON.parse(JSON.stringify(this.bookingDetails))
|
|
|
|
|
|
|
|
delete _data.hbList
|
|
|
|
|
|
|
|
BookingOrderAddOrUpdate(_data)
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
|
|
|
this.id = res.data
|
|
|
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
|
|
|
// this.bookingDetails = JSON.parse(JSON.stringify(initDetail))
|
|
|
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
id: res.data,
|
|
|
|
|
|
|
|
type: this.bookingDetails.carrierid,
|
|
|
|
|
|
|
|
noOpenTab: true,
|
|
|
|
|
|
|
|
mblno: this.bookingDetails.mblno
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (typeof res.message === 'string') {
|
|
|
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error('保存失败')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
spliceMorefun(str) {
|
|
|
|
spliceMorefun(str) {
|
|
|
|