修改台账更新

szh_zidingyibiaoti
lilu 2 years ago
parent 8ccf94d73a
commit a69a4002e0

@ -899,6 +899,12 @@ export default {
this.inAddSave = true
this.id = res.data.id
this.setDeatilsFun(res)
const newBookingList = JSON.parse(JSON.stringify(this.bookingList))
const newBookingGridOptions = JSON.parse(JSON.stringify(this.bookingGridOptions))
newBookingGridOptions.data = [...[res.data], ...newBookingGridOptions.data]
this.$set(newBookingList, res.data.id, res.data)
this.setBookingList(newBookingList)
this.setBookingGridOptions(newBookingGridOptions)
that.$router.replace({
name: 'BookingDetail',
query: {
@ -911,14 +917,6 @@ export default {
setTimeout(() => {
this.inAddSave = false
}, 2000)
console.log('== 新增订舱内容 ==', this.bookingList, this.bookingGridOptions, res.data)
const newBookingList = JSON.parse(JSON.stringify(this.bookingList))
const newBookingGridOptions = JSON.parse(JSON.stringify(this.bookingGridOptions))
newBookingGridOptions.data.push(res.data)
this.$set(newBookingList, res.data.id, res.data)
this.setBookingList(newBookingList)
this.setBookingGridOptions(newBookingGridOptions)
console.log('== 新增订舱内容 ==', newBookingList, newBookingGridOptions, res.data)
} else if (that.$route.query.mblno === that.bookingDetails.mblno) {
that.isCopy = false
that.isAdd = false
@ -932,15 +930,25 @@ export default {
return item.id
})
const index = arr.indexOf(res.data.id)
newBookingGridOptions.data[index] = res.data
console.log(index)
console.log('== 修改订舱内容 ==', this.bookingList, this.bookingGridOptions)
newBookingGridOptions.data.splice(index, 1, res.data)
this.setBookingList(newBookingList)
this.setBookingGridOptions(newBookingGridOptions)
} else {
that.isCopy = false
that.isAdd = false
this.inAddSave = true
this.id = res.data.id
this.setDeatilsFun(res)
const newBookingList = JSON.parse(JSON.stringify(this.bookingList))
const newBookingGridOptions = JSON.parse(JSON.stringify(this.bookingGridOptions))
this.$set(newBookingList, res.data.id, res.data)
const arr = newBookingGridOptions.data.map((item, index) => {
return item.id
})
const index = arr.indexOf(res.data.id)
newBookingGridOptions.data.splice(index, 1, res.data)
this.setBookingList(newBookingList)
this.setBookingGridOptions(newBookingGridOptions)
that.$router.replace({
name: 'BookingDetail',
query: {
@ -950,14 +958,6 @@ export default {
mblno: res.data.mblno
}
})
console.log('== 复制订舱内容 ==', this.bookingList, this.bookingGridOptions, res.data)
const newBookingList = JSON.parse(JSON.stringify(this.bookingList))
const newBookingGridOptions = JSON.parse(JSON.stringify(this.bookingGridOptions))
newBookingGridOptions.data.push(res.data)
this.$set(newBookingList, res.data.id, res.data)
this.setBookingList(newBookingList)
this.setBookingGridOptions(newBookingGridOptions)
console.log('== 复制订舱内容 ==', newBookingList, newBookingGridOptions, res.data)
}
that.$forceUpdate()
} else {

@ -1009,7 +1009,6 @@ export default {
this.details[type] = res.name || ''
this.details[`${type}id`] = res.id || ''
}
console.log('== 选中 ==', this.details, type)
},
dateChangeFun ({ type, value }) {
this.details[type] = value || ''

@ -587,7 +587,6 @@ export default {
},
beforeRouteLeave (to, from, next) {
this.setBookingGridOptions(this.gridOptions)
console.log('路由离开, 设置缓存', this.bookingGridOptions)
this.gridOptions = {
border: false,
resizable: true,
@ -612,23 +611,14 @@ export default {
next()
},
beforeRouteEnter (to, from, next) {
console.log('路由进入')
next(vm => {
// console.log('== - beforeRouteEnter ==', vm.bookingGridOptions)
// if (Object.keys(vm.gridOptions).length > 0) {
// vm.gridOptions = { ...vm.gridOptions, ...vm.bookingGridOptions }
// }
vm.upDate()
// vm.createdInit()
// vm.onresize()
})
},
created() {
console.log('== 列表页 - created ==')
this.createdInit()
},
mounted() {
console.log('== 列表页 - mounted ==')
this.onresize()
},
methods: {
@ -654,7 +644,6 @@ export default {
const copyArr = JSON.parse(JSON.stringify(this.bookingGridOptions.data))
const first = copyArr.splice(0, 10)
const more = this.bookingGridOptions.data.splice(10, this.bookingGridOptions.data.length)
console.log(first, more)
newData.data = first
this.gridOptions = { ...this.gridOptions, ...newData }
setTimeout(() => {
@ -775,7 +764,6 @@ export default {
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':
@ -894,7 +882,6 @@ export default {
}
}
})
console.log('== 获取到form, 准备获取列表 ==', isReset, this.formRes)
if (!isReset) {
this.getList(this.formRes, true)
}
@ -1089,7 +1076,6 @@ export default {
formChange(data) {
const { form, value } = data
console.log('== 表单 - 搜索更新 ==', form, value)
if (form.type === 'input') {
this.formRes[form.label] = value
} else if (form.type === 'date') {

Loading…
Cancel
Save