|
|
|
@ -38,7 +38,6 @@
|
|
|
|
|
<div class="parents-tabs-content">
|
|
|
|
|
<div id="tab-content1" class="tab-content" v-show="mainOrderActiveKey === '1-1'">
|
|
|
|
|
<div class="pane-box">
|
|
|
|
|
<!-- 基本信息 -->
|
|
|
|
|
<basicInfo
|
|
|
|
|
ref="basicInfo"
|
|
|
|
|
:type="type"
|
|
|
|
@ -49,7 +48,6 @@
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
@editLineName="editLineNameFun"
|
|
|
|
|
></basicInfo>
|
|
|
|
|
<!-- 收发通信息 -->
|
|
|
|
|
<mailingInfo
|
|
|
|
|
ref="mailingInfo"
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
@ -59,7 +57,6 @@
|
|
|
|
|
@spliceMore="spliceMorefun"
|
|
|
|
|
@pkgsEnCapital="pkgsEnCapitalFun"
|
|
|
|
|
></mailingInfo>
|
|
|
|
|
<!-- 货物信息 -->
|
|
|
|
|
<cargoInfo
|
|
|
|
|
ref="cargoInfo"
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
@ -68,7 +65,6 @@
|
|
|
|
|
isParent="parent"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></cargoInfo>
|
|
|
|
|
<!-- 签单信息 -->
|
|
|
|
|
<billInfo
|
|
|
|
|
ref="billInfo"
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
@ -76,7 +72,6 @@
|
|
|
|
|
isParent="parent"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></billInfo>
|
|
|
|
|
<!-- 备注信息 -->
|
|
|
|
|
<remarksInfo
|
|
|
|
|
ref="remarksInfo"
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
@ -84,7 +79,6 @@
|
|
|
|
|
isParent="parent"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></remarksInfo>
|
|
|
|
|
<!-- 箱型 -->
|
|
|
|
|
<goodsTable
|
|
|
|
|
ref="goodsTable"
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
@ -155,20 +149,15 @@ import sedOrder from './modules/sedOrder'
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
BookingOrderGet,
|
|
|
|
|
// BookingOrderUpdate,
|
|
|
|
|
// BookingOrderAdd,
|
|
|
|
|
// BookingOrderAddOrUpdate,
|
|
|
|
|
BookingOrderSave,
|
|
|
|
|
getDjyTenantConfig,
|
|
|
|
|
GetAllData
|
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { mapActions, mapGetters } from 'vuex'
|
|
|
|
|
import rules from './rules'
|
|
|
|
|
// import { string } from 'clipboard'
|
|
|
|
|
const initDetail = {
|
|
|
|
|
id: 0,
|
|
|
|
|
parentId: 0,
|
|
|
|
|
// 基本信息
|
|
|
|
|
customername: '',
|
|
|
|
|
customerid: '',
|
|
|
|
|
carrier: 'CMA',
|
|
|
|
@ -201,10 +190,8 @@ const initDetail = {
|
|
|
|
|
custserviceid: '',
|
|
|
|
|
route: '',
|
|
|
|
|
routeid: '',
|
|
|
|
|
// 添加单证备注,操作备注
|
|
|
|
|
dzRemark: '',
|
|
|
|
|
czRemark: '',
|
|
|
|
|
// 收发通信息
|
|
|
|
|
shipper: '',
|
|
|
|
|
feeself: false,
|
|
|
|
|
consignee: '',
|
|
|
|
@ -246,7 +233,6 @@ const initDetail = {
|
|
|
|
|
pkgstotal: '',
|
|
|
|
|
kgstotal: '',
|
|
|
|
|
cbmtotal: '',
|
|
|
|
|
// 货物信息
|
|
|
|
|
marks: '',
|
|
|
|
|
goodsname: '',
|
|
|
|
|
goodscode: '',
|
|
|
|
@ -254,7 +240,6 @@ const initDetail = {
|
|
|
|
|
hscode: '',
|
|
|
|
|
description: '',
|
|
|
|
|
totalno: '',
|
|
|
|
|
// 签单信息
|
|
|
|
|
issuetype: '',
|
|
|
|
|
issuedate: '',
|
|
|
|
|
issueplace: '',
|
|
|
|
@ -279,12 +264,9 @@ const initDetail = {
|
|
|
|
|
dpage: '',
|
|
|
|
|
dlabel: '',
|
|
|
|
|
linkman: '',
|
|
|
|
|
// 备注信息
|
|
|
|
|
soremark: '',
|
|
|
|
|
siremark: '',
|
|
|
|
|
// 箱型
|
|
|
|
|
ctnInputs: [],
|
|
|
|
|
// edi补充信息 (edi联系人等暂无字段)
|
|
|
|
|
weituo: '',
|
|
|
|
|
freightpayer: '',
|
|
|
|
|
scaccode: '',
|
|
|
|
@ -309,17 +291,12 @@ const initDetail = {
|
|
|
|
|
exRemark2: '',
|
|
|
|
|
exRemark3: '',
|
|
|
|
|
exRemark4: '',
|
|
|
|
|
// == 以下为太平 ==
|
|
|
|
|
consigneeEdiCode: '',
|
|
|
|
|
shipperEdiCode: '',
|
|
|
|
|
notifyCdoe: '',
|
|
|
|
|
// salerCode: 'CN087',
|
|
|
|
|
// salerCodeName: 'GRACE SUN',
|
|
|
|
|
salerCode: '',
|
|
|
|
|
salerCodeName: '',
|
|
|
|
|
emanifestHbl: '',
|
|
|
|
|
// masterBolIndicator: '3',
|
|
|
|
|
// masterBolIndicatorName: 'Not Applicable/Straight bl | 无HBL',
|
|
|
|
|
masterBolIndicator: '',
|
|
|
|
|
masterBolIndicatorName: '',
|
|
|
|
|
s0CC0C: '',
|
|
|
|
@ -328,9 +305,7 @@ const initDetail = {
|
|
|
|
|
wncm: '',
|
|
|
|
|
acihbl: ''
|
|
|
|
|
},
|
|
|
|
|
// 分单信息未添加
|
|
|
|
|
hbList: [],
|
|
|
|
|
// 新增右侧内容
|
|
|
|
|
remark: [],
|
|
|
|
|
file: [],
|
|
|
|
|
log: [],
|
|
|
|
@ -356,17 +331,12 @@ const bookingEDIExt = {
|
|
|
|
|
exRemark2: '',
|
|
|
|
|
exRemark3: '',
|
|
|
|
|
exRemark4: '',
|
|
|
|
|
// == 以下为太平 ==
|
|
|
|
|
consigneeEdiCode: '',
|
|
|
|
|
shipperEdiCode: '',
|
|
|
|
|
notifyCdoe: '',
|
|
|
|
|
// salerCode: 'CN087',
|
|
|
|
|
// salerCodeName: 'GRACE SUN',
|
|
|
|
|
salerCode: '',
|
|
|
|
|
salerCodeName: '',
|
|
|
|
|
emanifestHbl: '',
|
|
|
|
|
// masterBolIndicator: '3',
|
|
|
|
|
// masterBolIndicatorName: 'Not Applicable/Straight bl | 无HBL',
|
|
|
|
|
masterBolIndicator: '',
|
|
|
|
|
masterBolIndicatorName: '',
|
|
|
|
|
s0CC0C: '',
|
|
|
|
@ -377,7 +347,6 @@ const bookingEDIExt = {
|
|
|
|
|
}
|
|
|
|
|
export default {
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
activated: function() { }, // 当页面被激活时触发 仅限首次加载
|
|
|
|
|
inject: ['reload'],
|
|
|
|
|
components: {
|
|
|
|
|
operationArea,
|
|
|
|
@ -397,7 +366,6 @@ export default {
|
|
|
|
|
id: this.$route.query.id,
|
|
|
|
|
isCopy: this.$route.query.isCopy || false,
|
|
|
|
|
inPageLoading: false,
|
|
|
|
|
// bookingDetails: {},
|
|
|
|
|
bookingDetails: JSON.parse(JSON.stringify(initDetail)),
|
|
|
|
|
tabBarStyle: {
|
|
|
|
|
background: '#fff',
|
|
|
|
@ -584,7 +552,6 @@ export default {
|
|
|
|
|
getRouterHis() {
|
|
|
|
|
this.inChildLoading = true
|
|
|
|
|
const newId = this.$route.query.id ? this.$route.query.id.toString() : ''
|
|
|
|
|
// debugger
|
|
|
|
|
if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') {
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
const $data = JSON.parse(JSON.stringify(this.historyData[`copy-${newId}`]))
|
|
|
|
@ -619,7 +586,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: hbListChange })
|
|
|
|
|
// this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
this.inChildLoading = false
|
|
|
|
|
}, 500)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
@ -663,7 +629,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
const hbListChange = !!this.needSavePages[key].hbList
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: hbListChange })
|
|
|
|
|
// this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
this.inChildLoading = false
|
|
|
|
|
}, 500)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
@ -769,7 +734,6 @@ export default {
|
|
|
|
|
}).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()
|
|
|
|
@ -777,7 +741,6 @@ export default {
|
|
|
|
|
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] !== '' ? this.bookingDetails[label] : item.code
|
|
|
|
@ -801,7 +764,6 @@ export default {
|
|
|
|
|
} 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] !== '' ? this.bookingDetails.bookingEDIExt[label] : item.code
|
|
|
|
@ -923,7 +885,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDetail() {
|
|
|
|
|
// this.inPageLoading = false
|
|
|
|
|
if (this.inPageLoading) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
@ -993,7 +954,6 @@ export default {
|
|
|
|
|
this.inPageLoading = false
|
|
|
|
|
this.getDefaultVal()
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// console.log('== 5. 设置主单保存数据 - false ==')
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: false })
|
|
|
|
|
this.detailsLoadOver = true
|
|
|
|
|
this.inChildLoading = false
|
|
|
|
@ -1037,7 +997,6 @@ export default {
|
|
|
|
|
changeDetailFun(data) {
|
|
|
|
|
const { detail, type } = data
|
|
|
|
|
if (this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) {
|
|
|
|
|
// console.log('== 6. 设置主单有保存数据 - true ==')
|
|
|
|
|
this.checkSaveFun({ type: 'details', hasChange: true })
|
|
|
|
|
}
|
|
|
|
|
this.bookingDetails = detail
|
|
|
|
@ -1094,7 +1053,6 @@ export default {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// edi 初始数据验证
|
|
|
|
|
Object.keys(this.ediRules).map((item, index) => {
|
|
|
|
|
if (this.checkFrom.includes(item) && !this.bookingDetails[item.split('.')[0]][item.split('.')[1]]) {
|
|
|
|
|
this.hasEdiRules = true
|
|
|
|
@ -1107,7 +1065,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 箱信息验证
|
|
|
|
|
if (this.hasTableRules && this.bookingDetails.shippingMethod !== '拼箱') {
|
|
|
|
|
if (this.bookingDetails.ctnInputs.length === 0) {
|
|
|
|
|
this.$message.error('保存失败,箱信息未填写')
|
|
|
|
@ -1293,7 +1250,6 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
FnOk()
|
|
|
|
|
}
|
|
|
|
|
// 自定义必填项验证 - end
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
spliceMorefun(str) {
|
|
|
|
@ -1304,7 +1260,6 @@ export default {
|
|
|
|
|
this.mainOrderActiveKey = e
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 操作按钮
|
|
|
|
|
refreshPage() {
|
|
|
|
|
this.init()
|
|
|
|
|
this.$refs.rightContent.init()
|
|
|
|
@ -1355,7 +1310,6 @@ export default {
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno, noOpenTab: true }
|
|
|
|
|
})
|
|
|
|
|
// this.$route.query.id = 1123
|
|
|
|
|
} else {
|
|
|
|
|
if (index === arr.length - 1) {
|
|
|
|
|
this.$message.error('当前已经是最后一票')
|
|
|
|
@ -1381,8 +1335,6 @@ export default {
|
|
|
|
|
query: { id: this.id, isCopy: true, type: this.bookingDetails.carrierid }
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 分单部分
|
|
|
|
|
// 切换
|
|
|
|
|
changeTab(e) {
|
|
|
|
|
console.log('== 切换顶部标签 ==', this.detailsLoadOver, this.inChildLoading)
|
|
|
|
|
const _this = this
|
|
|
|
@ -1391,13 +1343,11 @@ export default {
|
|
|
|
|
_this.$refs.sedOrder.init(_this.bookingDetails.hbList)
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
// 新增
|
|
|
|
|
addSedList() {
|
|
|
|
|
if (this.isAdd) {
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// this.$message.loading('加载中...')
|
|
|
|
|
const data = JSON.parse(JSON.stringify(this.bookingDetails))
|
|
|
|
|
data.isNoSave = true
|
|
|
|
|
data.hblno = ''
|
|
|
|
@ -1417,7 +1367,6 @@ export default {
|
|
|
|
|
this.$refs.sedOrder.init(this.bookingDetails.hbList)
|
|
|
|
|
}, 200)
|
|
|
|
|
},
|
|
|
|
|
// 修改
|
|
|
|
|
changeHBFun(data) {
|
|
|
|
|
const arr = []
|
|
|
|
|
data.map((item, index) => {
|
|
|
|
@ -1426,16 +1375,11 @@ export default {
|
|
|
|
|
if (arr.includes(true)) {
|
|
|
|
|
this.$set(this.bookingDetails, 'hbList', data)
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: true })
|
|
|
|
|
// console.log('== 分单有修改 ==')
|
|
|
|
|
} else {
|
|
|
|
|
this.checkSaveFun({ type: 'hbList', hasChange: false })
|
|
|
|
|
// console.log('== 分单无修改 ==')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
checkSaveFun(data) {
|
|
|
|
|
// if (this.inPageLoading) {
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
if (this.inGoodsSave) { return false }
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
const lastPages = this.needSavePages
|
|
|
|
@ -1448,7 +1392,6 @@ export default {
|
|
|
|
|
} else if (data.type === 'hbList') {
|
|
|
|
|
this.$set($data, 'hbList', data.hasChange)
|
|
|
|
|
}
|
|
|
|
|
// console.log('== 设置主单保存数据 ==', this.detailsLoadOver, this.inPageLoading, this.inChildLoading)
|
|
|
|
|
this.$set(lastPages, key, $data)
|
|
|
|
|
this.setNeedSavePages(lastPages)
|
|
|
|
|
},
|
|
|
|
@ -1456,7 +1399,6 @@ export default {
|
|
|
|
|
this.inGoodsSave = data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 箱信息计算
|
|
|
|
|
calc(num1, num2, calcStr) {
|
|
|
|
|
var str1 // 转换为字符串的数字
|
|
|
|
|
var str2
|
|
|
|
@ -1566,16 +1508,13 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
sedOrderRemoveFun(sedData) {
|
|
|
|
|
// console.log('== 父组件收到子单删除数据 ==', sedData, this.bookingDetails.hbList)
|
|
|
|
|
this.$set(this.bookingDetails, 'hbList', sedData)
|
|
|
|
|
if (sedData.length === 0) {
|
|
|
|
|
// console.log('== 子单删除完毕 ==')
|
|
|
|
|
this.Showtabs = false
|
|
|
|
|
this.tabActiveKey = '1'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeCtnInfoFun ({ type, val }) {
|
|
|
|
|
console.log('获取数据')
|
|
|
|
|
if (type === 'kindpkgs') {
|
|
|
|
|
this.bookingDetails.kindpkgs = val
|
|
|
|
|
}
|
|
|
|
|