|
|
|
@ -158,7 +158,8 @@ export default {
|
|
|
|
|
watch: {
|
|
|
|
|
bookingDetails: {
|
|
|
|
|
handler(nval, oval) {
|
|
|
|
|
// console.log('父级 -- 数据改变', nval)
|
|
|
|
|
console.log('改了', nval, oval)
|
|
|
|
|
localStorage.setItem(`${this.id}`, true)
|
|
|
|
|
},
|
|
|
|
|
deep: true
|
|
|
|
|
}
|
|
|
|
@ -166,7 +167,11 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
updated() {
|
|
|
|
|
localStorage.setItem(`${this.id}`, false)
|
|
|
|
|
},
|
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
|
console.log('beforeRouteUpdate')
|
|
|
|
|
if (!Object.keys(this.historyData).includes(this.$route.query.id)) {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.bookingDetails,
|
|
|
|
@ -184,6 +189,7 @@ export default {
|
|
|
|
|
this.getRouterHis()
|
|
|
|
|
},
|
|
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
|
|
console.log('beforeRouteLeave')
|
|
|
|
|
if (!Object.keys(this.historyData).includes(this.id)) {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.bookingDetails,
|
|
|
|
@ -210,6 +216,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getRouterHis() {
|
|
|
|
|
console.log('getRouterHis')
|
|
|
|
|
const newId = this.$route.query.id
|
|
|
|
|
if (Object.keys(this.historyData).includes(newId)) {
|
|
|
|
|
// const newType = this.$route.query.type
|
|
|
|
@ -236,6 +243,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
console.log('addSedList')
|
|
|
|
|
this.bookingDetails = {}
|
|
|
|
|
if (this.id) {
|
|
|
|
|
this.isAdd = false
|
|
|
|
@ -373,6 +381,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDetail() {
|
|
|
|
|
console.log('getDetail')
|
|
|
|
|
if (this.inPageLoading) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
@ -399,6 +408,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.$set(this, 'bookingDetails', res.data)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
console.log('bookingDetails', this.bookingDetails)
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
@ -406,6 +416,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeDetailFun(data) {
|
|
|
|
|
console.log('changeDetailFun')
|
|
|
|
|
const { detail, type } = data
|
|
|
|
|
this.bookingDetails = detail
|
|
|
|
|
},
|
|
|
|
@ -521,6 +532,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addSedList() {
|
|
|
|
|
console.log('addSedList')
|
|
|
|
|
if (this.isAdd) {
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
return false
|
|
|
|
|