diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 9d40baa..7dd2167 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -787,19 +787,33 @@ export default { typeArr: ['booking_list_cond', 'booking_list_column'] } DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => { + const $data = {} res.data.map((item, index) => { switch (item.type) { case 'booking_list_cond': - this.setFormData(item, false, true) + this.$set($data, 'booking_list_cond', item) + // this.setFormData(item, false, true) break case 'booking_list_column': - this.setTableList(item) + this.$set($data, 'booking_list_column', item) + // this.setTableList(item) break // case 'booking_list_page': // this.setPageSize(item) // break } }) + console.log('获取到自定义数据', $data) + if (Object.keys($data).includes('booking_list_cond')) { + this.setFormData($data.booking_list_cond, false, true) + } else { + this.setFormData({}, false, true) + } + if (Object.keys($data).includes('booking_list_column')) { + this.setTableList($data.booking_list_column) + } else { + this.setTableList({}) + } }) }, // 船公司 - start @@ -863,7 +877,7 @@ export default { }) }, setFormData (data, isReset = false, isInit = false) { - if (data && JSON.parse(data.configJson).length) { + if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) { const arr = JSON.parse(data.configJson) const nowData = [] const moreData = [] @@ -917,7 +931,7 @@ export default { this.$forceUpdate() }, setTableList (data) { - if (data && JSON.parse(data.configJson).length) { + if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) { this.formTableData = JSON.parse(data.configJson) const nowTableArr = this.formTableData.map((item, index) => { if (item.field === 'operate') {