|
|
|
@ -310,7 +310,7 @@ const initDetail = {
|
|
|
|
|
exRemark4: '',
|
|
|
|
|
// == 以下为太平 ==
|
|
|
|
|
consigneeEdiCode: '',
|
|
|
|
|
shipperEdiCode: '',
|
|
|
|
|
shipperEdiCode: 'CN218868',
|
|
|
|
|
notifyCdoe: '',
|
|
|
|
|
salerCode: 'CN087',
|
|
|
|
|
salerCodeName: 'GRACE SUN',
|
|
|
|
@ -333,7 +333,7 @@ const initDetail = {
|
|
|
|
|
statuslog: []
|
|
|
|
|
}
|
|
|
|
|
const bookingEDIExt = {
|
|
|
|
|
weiTuoFang: '',
|
|
|
|
|
weiTuoFang: '',
|
|
|
|
|
ediAttn: '',
|
|
|
|
|
ediAttnTel: '',
|
|
|
|
|
ediAttnMail: '',
|
|
|
|
@ -353,7 +353,7 @@ const bookingEDIExt = {
|
|
|
|
|
exRemark4: '',
|
|
|
|
|
// == 以下为太平 ==
|
|
|
|
|
consigneeEdiCode: '',
|
|
|
|
|
shipperEdiCode: '',
|
|
|
|
|
shipperEdiCode: 'CN218868',
|
|
|
|
|
notifyCdoe: '',
|
|
|
|
|
salerCode: 'CN087',
|
|
|
|
|
salerCodeName: 'GRACE SUN',
|
|
|
|
@ -421,7 +421,9 @@ export default {
|
|
|
|
|
inAddSave: false,
|
|
|
|
|
hasHbList: false,
|
|
|
|
|
detailsLoadOver: false,
|
|
|
|
|
inGoodsSave: false
|
|
|
|
|
inGoodsSave: false,
|
|
|
|
|
ctnDefaultData: {},
|
|
|
|
|
defaultData: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -603,7 +605,7 @@ export default {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
|
|
|
|
|
const detailsChange = !!this.needSavePages[key].details
|
|
|
|
|
const detailsChange = this.needSavePages[key] ? !!this.needSavePages[key].details : false
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: detailsChange })
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
@ -647,7 +649,7 @@ export default {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
|
|
|
|
|
const detailsChange = !!this.needSavePages[key].details
|
|
|
|
|
const detailsChange = this.needSavePages[key] ? !!this.needSavePages[key].details : false
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: detailsChange })
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
@ -689,7 +691,7 @@ export default {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
|
|
|
|
|
const detailsChange = !!this.needSavePages[key].details
|
|
|
|
|
const detailsChange = this.needSavePages[key] ? !!this.needSavePages[key].details : false
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: detailsChange })
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
@ -709,7 +711,7 @@ export default {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
|
|
|
|
|
const detailsChange = !!this.needSavePages[key].details
|
|
|
|
|
const detailsChange = this.needSavePages[key] ? !!this.needSavePages[key].details : false
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: detailsChange })
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
@ -737,6 +739,7 @@ export default {
|
|
|
|
|
this.detailsLoadOver = false
|
|
|
|
|
this.bookingDetails.carrierid = this.type
|
|
|
|
|
this.bookingDetails.carrier = this.type
|
|
|
|
|
// this.getDefaultVal()
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (Object.keys(this.$refs).includes('sedOrder')) {
|
|
|
|
|
this.$refs.sedOrder.init([])
|
|
|
|
@ -750,6 +753,83 @@ export default {
|
|
|
|
|
this.getDjyTenantConfig()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDefaultVal() {
|
|
|
|
|
getDjyTenantConfig({
|
|
|
|
|
type: 'booking_default_value'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
const defaultData = JSON.parse(res.data.configJson)
|
|
|
|
|
this.defaultData = defaultData
|
|
|
|
|
console.log(defaultData)
|
|
|
|
|
defaultData.map((item, index) => {
|
|
|
|
|
const field = item.field.split('.')
|
|
|
|
|
let label = field[1].toLowerCase()
|
|
|
|
|
if (field[0] === 'order') {
|
|
|
|
|
if (['EPCODE', 'DZREMARK', 'CZREMARK', 'Warehouse'].includes(field[1])) {
|
|
|
|
|
label = this.emnuDefaultLabel(field[1])
|
|
|
|
|
}
|
|
|
|
|
console.log('initData ----', label)
|
|
|
|
|
if (Object.keys(initDetail).includes(label)) {
|
|
|
|
|
initDetail[label] = item.code
|
|
|
|
|
this.bookingDetails[label] = this.bookingDetails[label] ? this.bookingDetails[label] : item.code
|
|
|
|
|
}
|
|
|
|
|
} else if (field[0] === 'ctn') {
|
|
|
|
|
if (['CTNALL', 'CTNNUM', 'CNTRNO', 'SEALNO', 'PKGS', 'KINDPKGS', 'KGS', 'CBM', 'TAREWEIGHT', 'WEIGHTYPE', 'WEIGHKGS'].includes(field[1])) {
|
|
|
|
|
this.ctnDefaultData[label] = item.code
|
|
|
|
|
this.bookingDetails.ctnInputs.map((citem, cindex) => {
|
|
|
|
|
this.bookingDetails.ctnInputs[cindex][label] = citem[label] ? citem[label] : item.code
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else if (field[0] === 'edi') {
|
|
|
|
|
// type 1 首字母大写转小写
|
|
|
|
|
const typeArr1 = ['WeiTuoFang', 'SendCode', 'ReceiveCode', 'NotifyCdoe', 'SalerCode', 'MasterBolIndicator', 'EmanifestHbl', 'ConsigneeEdiCode', 'ShipperEdiCode', 'OpEName', 'OpTel', 'OpEmail', 'GoodsName', 'MasterBolIndicatorName', 'SalerCodeName', 'OrderRemark', 'ExRemark1', 'ExRemark2', 'ExRemark3', 'ExRemark4', 'KingTareweight']
|
|
|
|
|
// type2 第一个单词大写 + 驼峰
|
|
|
|
|
const typeArr2 = ['EDIAttn', 'EDIAttnTel', 'EDIAttnMail', 'AMSConsignee', 'AMSNotifyParty']
|
|
|
|
|
// type 3 全大写转全小写
|
|
|
|
|
const typeArr3 = ['ACIHBL', 'CKHI', 'CNCM', 'WNCM']
|
|
|
|
|
const typeArr4 = ['S0CC0C']
|
|
|
|
|
if (typeArr1.includes(field[1])) {
|
|
|
|
|
label = field[1].substr(0, 1).toLowerCase() + field[1].substr(1, field[1].length - 1)
|
|
|
|
|
} else if (typeArr3.includes(field[1])) {
|
|
|
|
|
label = field[1].toLowerCase()
|
|
|
|
|
} else if (typeArr2.includes(field[1]) || typeArr4.includes(field[1])) {
|
|
|
|
|
label = this.emnuDefaultLabel(field[1])
|
|
|
|
|
}
|
|
|
|
|
console.log('edi --- ', label)
|
|
|
|
|
initDetail.bookingEDIExt[label] = item.code
|
|
|
|
|
bookingEDIExt[label] = item.code
|
|
|
|
|
this.bookingDetails.bookingEDIExt[label] = this.bookingDetails.bookingEDIExt[label] ? this.bookingDetails.bookingEDIExt[label] : item.code
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
emnuDefaultLabel (field) {
|
|
|
|
|
switch (field) {
|
|
|
|
|
case 'EPCODE':
|
|
|
|
|
return 'EPCode'
|
|
|
|
|
case 'DZREMARK':
|
|
|
|
|
return 'dzRemark'
|
|
|
|
|
case 'CZREMARK':
|
|
|
|
|
return 'czRemark'
|
|
|
|
|
case 'Warehouse':
|
|
|
|
|
return 'warehouse'
|
|
|
|
|
case 'S0CC0C':
|
|
|
|
|
return 's0CC0C'
|
|
|
|
|
case 'EDIAttn':
|
|
|
|
|
return 'ediAttn'
|
|
|
|
|
case 'EDIAttnTel':
|
|
|
|
|
return 'ediAttnTel'
|
|
|
|
|
case 'EDIAttnMail':
|
|
|
|
|
return 'ediAttnMail'
|
|
|
|
|
case 'AMSConsignee':
|
|
|
|
|
return 'amsConsignee'
|
|
|
|
|
case 'AMSNotifyParty':
|
|
|
|
|
return 'amsNotifyParty'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDjyTenantConfig() {
|
|
|
|
|
getDjyTenantConfig({
|
|
|
|
|
type: 'booking_form_col'
|
|
|
|
@ -865,17 +945,9 @@ export default {
|
|
|
|
|
delete item.id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.data.hbList && res.data.hbList.length > 0) {
|
|
|
|
|
this.Showtabs = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!res.data.bookingEDIExt) {
|
|
|
|
|
res.data.bookingEDIExt = {
|
|
|
|
|
weiTuoFang: '',
|
|
|
|
|
ediAttn: '',
|
|
|
|
|
ediAttnTel: '',
|
|
|
|
|
ediAttnMail: '',
|
|
|
|
|
sendCode: ''
|
|
|
|
|
}
|
|
|
|
|
res.data.bookingEDIExt = bookingEDIExt
|
|
|
|
|
}
|
|
|
|
|
// 初始化箱型 累加 称重总重
|
|
|
|
|
if (res.data.ctnInputs.length > 0) {
|
|
|
|
@ -896,6 +968,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (res.data.hbList.length > 0) {
|
|
|
|
|
res.data.hbList.map((item, index) => {
|
|
|
|
|
item.bookingEDIExt.shipperEdiCode = item.bookingEDIExt.shipperEdiCode ? item.bookingEDIExt.shipperEdiCode : 'CN218868'
|
|
|
|
|
const newBookingEDIExt = { ...JSON.parse(JSON.stringify(bookingEDIExt)), ...item.bookingEDIExt }
|
|
|
|
|
item = { ...JSON.parse(JSON.stringify(initDetail)), ...item, ...{ bookingEDIExt: newBookingEDIExt } }
|
|
|
|
|
if (item.ctnInputs.length > 0) {
|
|
|
|
@ -911,15 +984,20 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
res.data.feeself = !!res.data.feeself
|
|
|
|
|
res.data.bookingEDIExt.shipperEdiCode = res.data.bookingEDIExt.shipperEdiCode ? res.data.bookingEDIExt.shipperEdiCode : 'CN218868'
|
|
|
|
|
const $BookingEDIExt = { ...JSON.parse(JSON.stringify(bookingEDIExt)), ...res.data.bookingEDIExt }
|
|
|
|
|
this.$set(this, 'bookingDetails', { ...this.bookingDetails, ...res.data, ...{ bookingEDIExt: $BookingEDIExt } })
|
|
|
|
|
this.inPageLoading = false
|
|
|
|
|
// this.getDefaultVal()
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// console.log('== 5. 设置主单保存数据 - false ==')
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
this.detailsLoadOver = true
|
|
|
|
|
this.inChildLoading = false
|
|
|
|
|
this.$message.success({ content: '加载完成' })
|
|
|
|
|
if (res.data.hbList && res.data.hbList.length > 0) {
|
|
|
|
|
this.Showtabs = true
|
|
|
|
|
}
|
|
|
|
|
if (!this.hasHbList && this.bookingDetails.hbList.length > 0) {
|
|
|
|
|
this.$refs.sedOrder.init(this.bookingDetails.hbList)
|
|
|
|
|
this.hasHbList = true
|
|
|
|
@ -1278,6 +1356,7 @@ export default {
|
|
|
|
|
// 分单部分
|
|
|
|
|
// 切换
|
|
|
|
|
changeTab(e) {
|
|
|
|
|
console.log('== 切换顶部标签 ==', this.detailsLoadOver, this.inChildLoading)
|
|
|
|
|
const _this = this
|
|
|
|
|
this.tabActiveKey = e
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|