|
|
|
@ -2,15 +2,6 @@
|
|
|
|
|
<div>
|
|
|
|
|
<a-row :gutter="24">
|
|
|
|
|
<a-col :md="24" :sm="24" style="padding: 0 0 0 0" class="content-box">
|
|
|
|
|
<!-- <div class="nav-box">
|
|
|
|
|
<div class="nav" @click="addBooking"><i class="iconfont icon-jiahao2fill"></i>新建</div>
|
|
|
|
|
<div class="nav" @click="copyBooking"><i class="iconfont icon-fuzhi"></i>复制</div>
|
|
|
|
|
<div class="nav" @click="copyBookingMore"><i class="iconfont icon-fuzhi1"></i>复制多票</div>
|
|
|
|
|
<div class="nav"><i class="iconfont icon-bianjiwenjian"></i>批量编辑</div>
|
|
|
|
|
<div class="nav"><i class="iconfont icon-shujushangchuan-shixin"></i>批量VGM</div>
|
|
|
|
|
<div class="nav"><i class="iconfont icon-shishijifei"></i>定时订舱</div>
|
|
|
|
|
<div class="nav"><i class="iconfont icon-xiaopiaodayin"></i>小票状态</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<x-card class="content-nav">
|
|
|
|
|
<div slot="content" class="table-page-search-wrapper">
|
|
|
|
|
<a-form layout="inline">
|
|
|
|
@ -483,7 +474,8 @@ import {
|
|
|
|
|
Codeissuetypelist,
|
|
|
|
|
GetFrt,
|
|
|
|
|
GetService,
|
|
|
|
|
GetForwarderlist
|
|
|
|
|
GetForwarderlist,
|
|
|
|
|
DjyUserConfigMulti
|
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
|
|
|
|
|
import initData from './modules/initData'
|
|
|
|
@ -618,7 +610,7 @@ export default {
|
|
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
|
// console.log('路由进入')
|
|
|
|
|
next(vm => {
|
|
|
|
|
console.log('== 进入路由 - beforeRouteEnter ==', vm.inAddSave)
|
|
|
|
|
console.log('== 进入路由 - beforeRouteEnter ==', vm.formRes)
|
|
|
|
|
vm.createdInit()
|
|
|
|
|
vm.onresize()
|
|
|
|
|
})
|
|
|
|
@ -640,6 +632,7 @@ export default {
|
|
|
|
|
this.getTableList()
|
|
|
|
|
this.getPageSize()
|
|
|
|
|
this.getCarrier()
|
|
|
|
|
// this.getConfigUser()
|
|
|
|
|
},
|
|
|
|
|
onresize () {
|
|
|
|
|
// console.log('=== 列表加载完成 ===')
|
|
|
|
@ -757,6 +750,29 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.getTableList()
|
|
|
|
|
},
|
|
|
|
|
// 批量获取自定义数据
|
|
|
|
|
getConfigUser() {
|
|
|
|
|
// 请求自定义: 查询表单 表头 页码
|
|
|
|
|
const query = {
|
|
|
|
|
typeArr: ['booking_list_cond', 'booking_list_column', 'booking_list_page']
|
|
|
|
|
}
|
|
|
|
|
DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => {
|
|
|
|
|
console.log('批量获取自定义数据', res)
|
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
|
switch (item.type) {
|
|
|
|
|
case 'booking_list_cond':
|
|
|
|
|
this.setFormData(item)
|
|
|
|
|
break
|
|
|
|
|
case 'booking_list_column':
|
|
|
|
|
this.setTableList(item)
|
|
|
|
|
break
|
|
|
|
|
case 'booking_list_page':
|
|
|
|
|
this.setPageSize(item)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 船公司 - start
|
|
|
|
|
getCarrier() {
|
|
|
|
|
const Rdata = data => {
|
|
|
|
@ -817,6 +833,99 @@ export default {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
setFormData (data, isReset = false) {
|
|
|
|
|
if (data && JSON.parse(data.configJson).length) {
|
|
|
|
|
const arr = JSON.parse(data.configJson)
|
|
|
|
|
const nowData = []
|
|
|
|
|
const moreData = []
|
|
|
|
|
arr.map((item, index) => {
|
|
|
|
|
this.formAllData.map((fitem, findex) => {
|
|
|
|
|
if (fitem.label === item) {
|
|
|
|
|
nowData.push(fitem)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.formAllData.map((item, index) => {
|
|
|
|
|
if (!arr.includes(item.label)) {
|
|
|
|
|
moreData.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.formData = nowData
|
|
|
|
|
this.formMoreData = moreData
|
|
|
|
|
} else {
|
|
|
|
|
const nowData = this.formData.map((item, index) => {
|
|
|
|
|
return item.label
|
|
|
|
|
})
|
|
|
|
|
const moreData = []
|
|
|
|
|
this.formAllData.map((item, index) => {
|
|
|
|
|
if (!nowData.includes(item.label)) {
|
|
|
|
|
moreData.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.formMoreData = moreData
|
|
|
|
|
}
|
|
|
|
|
this.formData.map((item, index) => {
|
|
|
|
|
this.$set(this.formRes, item.label, this.formRes[item.label] || '')
|
|
|
|
|
// select 船公司 等获取下拉列表
|
|
|
|
|
if (item.type === 'select') {
|
|
|
|
|
if (['NOBILL', 'CARGOID'].includes(item.label)) {
|
|
|
|
|
item.dataList = item.data
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs[`fromlabel-${item.label}`][0].$data.dataList = item.data
|
|
|
|
|
}, 300)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('== 获取到form, 准备获取列表 ==', isReset, this.formRes)
|
|
|
|
|
if (!isReset) {
|
|
|
|
|
this.getList(this.formRes)
|
|
|
|
|
}
|
|
|
|
|
const len = this.formData.length % 4
|
|
|
|
|
if (this.formData.length === 4 || this.formData.length > 4) {
|
|
|
|
|
this.formBtnCol = 8
|
|
|
|
|
} else {
|
|
|
|
|
this.formBtnCol = 24 - len * 4
|
|
|
|
|
}
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
setTableList (data) {
|
|
|
|
|
if (data && JSON.parse(data.configJson).length) {
|
|
|
|
|
this.gridOptions.columns = JSON.parse(data.configJson)
|
|
|
|
|
this.formTableData = JSON.parse(data.configJson)
|
|
|
|
|
const nowTableArr = this.formTableData.map((item, index) => {
|
|
|
|
|
return item.field
|
|
|
|
|
})
|
|
|
|
|
const moreTableArr = []
|
|
|
|
|
this.fromTableAllData.map((item, index) => {
|
|
|
|
|
if (!nowTableArr.includes(item.field)) {
|
|
|
|
|
moreTableArr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.formMoreTableData = moreTableArr
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
const nowTableArr = this.formTableData.map((item, index) => {
|
|
|
|
|
return item.field
|
|
|
|
|
})
|
|
|
|
|
const moreTableArr = []
|
|
|
|
|
this.fromTableAllData.map((item, index) => {
|
|
|
|
|
if (!nowTableArr.includes(item.field)) {
|
|
|
|
|
moreTableArr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.formMoreTableData = moreTableArr
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setPageSize (data) {
|
|
|
|
|
if (data && JSON.parse(data.configJson)) {
|
|
|
|
|
this.gridOptions.pagerConfig.pageSize = JSON.parse(data.configJson).pageSize
|
|
|
|
|
this.getList(this.formRes)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取表单设置内容
|
|
|
|
|
getFormData(isReset = false) {
|
|
|
|
|
DjyUserConfigGet({ type: 'booking_list_cond' }).then(res => {
|
|
|
|
|
if (res.data && JSON.parse(res.data.configJson).length) {
|
|
|
|
@ -861,6 +970,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('== 获取到form, 准备获取列表 ==', isReset, this.formRes)
|
|
|
|
|
if (!isReset) {
|
|
|
|
|
this.getList(this.formRes)
|
|
|
|
|
}
|
|
|
|
@ -889,11 +999,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 添加获取表单下拉列表数据
|
|
|
|
|
getFromSelectData(func, ...args) {
|
|
|
|
|
// debugger
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
// debugger
|
|
|
|
|
func(...args).then(res => {
|
|
|
|
|
// debugger
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
resolve(res.data)
|
|
|
|
|
} else {
|
|
|
|
@ -959,7 +1066,7 @@ export default {
|
|
|
|
|
DjyUserConfigGet({ type: 'booking_list_page' }).then(res => {
|
|
|
|
|
if (res.data && JSON.parse(res.data.configJson)) {
|
|
|
|
|
this.gridOptions.pagerConfig.pageSize = JSON.parse(res.data.configJson).pageSize
|
|
|
|
|
this.getList()
|
|
|
|
|
this.getList(this.formRes)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -982,7 +1089,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
tableRefresh() {
|
|
|
|
|
let data = { ...this.formRes }
|
|
|
|
|
const data = { ...this.formRes }
|
|
|
|
|
this.init(this.formRes)
|
|
|
|
|
this.formRes = data
|
|
|
|
|
},
|
|
|
|
@ -1052,6 +1159,7 @@ export default {
|
|
|
|
|
this.$refs[label][0].$data.value = ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.getFormData()
|
|
|
|
|
this.init()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -1064,8 +1172,8 @@ export default {
|
|
|
|
|
} else if (form.type === 'date') {
|
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
|
} else if (form.type === 'dateRange') {
|
|
|
|
|
this.formRes[form.resLabel[0]] = value[0]
|
|
|
|
|
this.formRes[form.resLabel[1]] = value[1]
|
|
|
|
|
this.formRes[form.resLabel[0]] = value[0] || ''
|
|
|
|
|
this.formRes[form.resLabel[1]] = value[1] || ''
|
|
|
|
|
} else if (form.type === 'select') {
|
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
|
} else if (form.type === 'complete') {
|
|
|
|
|