|
|
@ -480,7 +480,7 @@ import {
|
|
|
|
|
|
|
|
|
|
|
|
import initData from './modules/initData'
|
|
|
|
import initData from './modules/initData'
|
|
|
|
import { DjyUserConfigGet, DjyUserConfigAdd } from '@/api/modular/main/DjyUserConfig'
|
|
|
|
import { DjyUserConfigGet, DjyUserConfigAdd } from '@/api/modular/main/DjyUserConfig'
|
|
|
|
import { mapActions } from 'vuex'
|
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
|
|
|
const formInitData = [
|
|
|
|
const formInitData = [
|
|
|
|
{ title: '主提单号', align: 'center', width: '90', label: 'MBLNO', type: 'input' },
|
|
|
|
{ title: '主提单号', align: 'center', width: '90', label: 'MBLNO', type: 'input' },
|
|
|
|
{ title: '分提单号', align: 'center', width: '90', label: 'HBLNO', type: 'input' },
|
|
|
|
{ title: '分提单号', align: 'center', width: '90', label: 'HBLNO', type: 'input' },
|
|
|
@ -582,8 +582,12 @@ export default {
|
|
|
|
RecentlyCarrierData: []
|
|
|
|
RecentlyCarrierData: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
...mapGetters(['bookingList', 'bookingGridOptions'])
|
|
|
|
|
|
|
|
},
|
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
|
// console.log('路由离开')
|
|
|
|
this.setBookingGridOptions(this.gridOptions)
|
|
|
|
|
|
|
|
console.log('路由离开, 设置缓存', this.bookingGridOptions)
|
|
|
|
this.gridOptions = {
|
|
|
|
this.gridOptions = {
|
|
|
|
border: false,
|
|
|
|
border: false,
|
|
|
|
resizable: true,
|
|
|
|
resizable: true,
|
|
|
@ -610,18 +614,22 @@ export default {
|
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
// console.log('路由进入')
|
|
|
|
// console.log('路由进入')
|
|
|
|
next(vm => {
|
|
|
|
next(vm => {
|
|
|
|
console.log('== 进入路由 - beforeRouteEnter ==', vm.formRes)
|
|
|
|
console.log('== 进入路由 - beforeRouteEnter ==', vm.bookingGridOptions)
|
|
|
|
vm.createdInit()
|
|
|
|
if (Object.keys(vm.gridOptions).length > 0) {
|
|
|
|
vm.onresize()
|
|
|
|
vm.gridOptions = { ...vm.gridOptions, ...vm.bookingGridOptions }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// vm.createdInit()
|
|
|
|
|
|
|
|
// vm.onresize()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
// this.createdInit()
|
|
|
|
this.createdInit()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
// this.onresize()
|
|
|
|
this.onresize()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
...mapActions(['setBookingList', 'setBookingGridOptions']),
|
|
|
|
createdInit () {
|
|
|
|
createdInit () {
|
|
|
|
this.showColumns = JSON.parse(JSON.stringify(initData.columns))
|
|
|
|
this.showColumns = JSON.parse(JSON.stringify(initData.columns))
|
|
|
|
this.formAllData = JSON.parse(JSON.stringify(initData.condAllData))
|
|
|
|
this.formAllData = JSON.parse(JSON.stringify(initData.condAllData))
|
|
|
@ -719,7 +727,6 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
...mapActions(['setBookingList']),
|
|
|
|
|
|
|
|
FnCopy(data) {
|
|
|
|
FnCopy(data) {
|
|
|
|
const el = document.createElement('input')
|
|
|
|
const el = document.createElement('input')
|
|
|
|
el.setAttribute('value', data)
|
|
|
|
el.setAttribute('value', data)
|
|
|
@ -869,7 +876,7 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log('== 获取到form, 准备获取列表 ==', isReset, this.formRes)
|
|
|
|
console.log('== 获取到form, 准备获取列表 ==', isReset, this.formRes)
|
|
|
|
if (!isReset) {
|
|
|
|
if (!isReset) {
|
|
|
|
this.getList(this.formRes)
|
|
|
|
this.getList(this.formRes, true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const len = this.formData.length % 4
|
|
|
|
const len = this.formData.length % 4
|
|
|
|
if (this.formData.length === 4 || this.formData.length > 4) {
|
|
|
|
if (this.formData.length === 4 || this.formData.length > 4) {
|
|
|
@ -911,7 +918,6 @@ export default {
|
|
|
|
setPageSize (data) {
|
|
|
|
setPageSize (data) {
|
|
|
|
if (data && JSON.parse(data.configJson)) {
|
|
|
|
if (data && JSON.parse(data.configJson)) {
|
|
|
|
this.gridOptions.pagerConfig.pageSize = JSON.parse(data.configJson).pageSize
|
|
|
|
this.gridOptions.pagerConfig.pageSize = JSON.parse(data.configJson).pageSize
|
|
|
|
this.getList(this.formRes)
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
this.$forceUpdate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -919,59 +925,7 @@ export default {
|
|
|
|
// 获取表单设置内容
|
|
|
|
// 获取表单设置内容
|
|
|
|
getFormData(isReset = false) {
|
|
|
|
getFormData(isReset = false) {
|
|
|
|
DjyUserConfigGet({ type: 'booking_list_cond' }).then(res => {
|
|
|
|
DjyUserConfigGet({ type: 'booking_list_cond' }).then(res => {
|
|
|
|
if (res.data && JSON.parse(res.data.configJson).length) {
|
|
|
|
this.setFormData(res.data)
|
|
|
|
const arr = JSON.parse(res.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()
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
emnuSelectApi(type) {
|
|
|
|
emnuSelectApi(type) {
|
|
|
@ -1174,7 +1128,7 @@ export default {
|
|
|
|
editColumns(row) {
|
|
|
|
editColumns(row) {
|
|
|
|
this.$router.push({ name: 'BookingDetail', query: { id: row.id, type: row.carrierid, mblno: row.mblno } })
|
|
|
|
this.$router.push({ name: 'BookingDetail', query: { id: row.id, type: row.carrierid, mblno: row.mblno } })
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getList(queryParam = {}) {
|
|
|
|
getList(queryParam = {}, isInit = false) {
|
|
|
|
this.$set(this.gridOptions, 'loading', true)
|
|
|
|
this.$set(this.gridOptions, 'loading', true)
|
|
|
|
const { currentPage, pageSize } = this.gridOptions.pagerConfig
|
|
|
|
const { currentPage, pageSize } = this.gridOptions.pagerConfig
|
|
|
|
const query = {
|
|
|
|
const query = {
|
|
|
@ -1201,8 +1155,14 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BookingOrderPage(query)
|
|
|
|
BookingOrderPage(query)
|
|
|
|
.then(res => {
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (isInit) { this.getList(this.formRes) }
|
|
|
|
if (res.success) {
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
let newBookingList = {}
|
|
|
|
|
|
|
|
if (query.PageNo !== 1) {
|
|
|
|
|
|
|
|
newBookingList = this.bookingList
|
|
|
|
|
|
|
|
}
|
|
|
|
const _data = res.data.items.map((item, index) => {
|
|
|
|
const _data = res.data.items.map((item, index) => {
|
|
|
|
|
|
|
|
this.$set(newBookingList, item.id, item)
|
|
|
|
item.index = (currentPage - 1) * pageSize + index
|
|
|
|
item.index = (currentPage - 1) * pageSize + index
|
|
|
|
const bookstatus = [
|
|
|
|
const bookstatus = [
|
|
|
|
{ staCode: 'sta_cangdan', isChecked: false },
|
|
|
|
{ staCode: 'sta_cangdan', isChecked: false },
|
|
|
@ -1229,11 +1189,8 @@ export default {
|
|
|
|
this.$set(this.gridOptions, 'data', [..._data])
|
|
|
|
this.$set(this.gridOptions, 'data', [..._data])
|
|
|
|
this.$set(this.gridOptions.pagerConfig, 'total', res.data.totalCount)
|
|
|
|
this.$set(this.gridOptions.pagerConfig, 'total', res.data.totalCount)
|
|
|
|
this.$set(this.gridOptions, 'loading', false)
|
|
|
|
this.$set(this.gridOptions, 'loading', false)
|
|
|
|
const bookingList = {}
|
|
|
|
this.setBookingList(newBookingList)
|
|
|
|
this.gridOptions.data.map(($item, $index) => {
|
|
|
|
console.log(this.gridOptions.data.length, Object.keys(newBookingList).length, this.gridOptions.data, newBookingList)
|
|
|
|
this.$set(bookingList, $item.id, $item)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.setBookingList(bookingList)
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
this.$forceUpdate()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$set(this.gridOptions, 'data', [...[]])
|
|
|
|
this.$set(this.gridOptions, 'data', [...[]])
|
|
|
|