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