|
|
@ -617,7 +617,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
// this.createdInit()
|
|
|
|
// this.createdInit()
|
|
|
|
// this.getConfigUser()
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
// this.onresize()
|
|
|
|
// this.onresize()
|
|
|
@ -633,6 +632,7 @@ export default {
|
|
|
|
this.getTableList()
|
|
|
|
this.getTableList()
|
|
|
|
this.getPageSize()
|
|
|
|
this.getPageSize()
|
|
|
|
this.getCarrier()
|
|
|
|
this.getCarrier()
|
|
|
|
|
|
|
|
// this.getConfigUser()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onresize () {
|
|
|
|
onresize () {
|
|
|
|
// console.log('=== 列表加载完成 ===')
|
|
|
|
// console.log('=== 列表加载完成 ===')
|
|
|
@ -761,13 +761,14 @@ export default {
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
switch (item.type) {
|
|
|
|
switch (item.type) {
|
|
|
|
case 'booking_list_cond':
|
|
|
|
case 'booking_list_cond':
|
|
|
|
this.getFormData(res.data)
|
|
|
|
this.setFormData(item)
|
|
|
|
return
|
|
|
|
break
|
|
|
|
case 'booking_list_column':
|
|
|
|
case 'booking_list_column':
|
|
|
|
this.getTableList(res.data)
|
|
|
|
this.setTableList(item)
|
|
|
|
return
|
|
|
|
break
|
|
|
|
case 'booking_list_page':
|
|
|
|
case 'booking_list_page':
|
|
|
|
this.getPageSize(res.data)
|
|
|
|
this.setPageSize(item)
|
|
|
|
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -832,6 +833,99 @@ export default {
|
|
|
|
console.log(err)
|
|
|
|
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) {
|
|
|
|
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) {
|
|
|
|
if (res.data && JSON.parse(res.data.configJson).length) {
|
|
|
@ -995,7 +1089,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tableRefresh() {
|
|
|
|
tableRefresh() {
|
|
|
|
let data = { ...this.formRes }
|
|
|
|
const data = { ...this.formRes }
|
|
|
|
this.init(this.formRes)
|
|
|
|
this.init(this.formRes)
|
|
|
|
this.formRes = data
|
|
|
|
this.formRes = data
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -1065,6 +1159,7 @@ export default {
|
|
|
|
this.$refs[label][0].$data.value = ''
|
|
|
|
this.$refs[label][0].$data.value = ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.getFormData()
|
|
|
|
this.init()
|
|
|
|
this.init()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -1077,8 +1172,8 @@ export default {
|
|
|
|
} else if (form.type === 'date') {
|
|
|
|
} else if (form.type === 'date') {
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
} else if (form.type === 'dateRange') {
|
|
|
|
} else if (form.type === 'dateRange') {
|
|
|
|
this.formRes[form.resLabel[0]] = value[0]
|
|
|
|
this.formRes[form.resLabel[0]] = value[0] || ''
|
|
|
|
this.formRes[form.resLabel[1]] = value[1]
|
|
|
|
this.formRes[form.resLabel[1]] = value[1] || ''
|
|
|
|
} else if (form.type === 'select') {
|
|
|
|
} else if (form.type === 'select') {
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
this.formRes[form.label] = value
|
|
|
|
} else if (form.type === 'complete') {
|
|
|
|
} else if (form.type === 'complete') {
|
|
|
|