|
|
|
@ -34,8 +34,8 @@
|
|
|
|
|
class="items"
|
|
|
|
|
v-for="(serive, sindex) in bookingServiceItem"
|
|
|
|
|
:key="sindex"
|
|
|
|
|
:class="{ active: locaService.includes(serive.name) }"
|
|
|
|
|
@click="saveService(serive.name)"
|
|
|
|
|
:class="{ active: locaService.includes(serive.code) }"
|
|
|
|
|
@click="saveService(serive)"
|
|
|
|
|
>
|
|
|
|
|
{{ serive.name }}
|
|
|
|
|
</div>
|
|
|
|
@ -297,7 +297,8 @@ export default {
|
|
|
|
|
attachName: '',
|
|
|
|
|
attachCode: '',
|
|
|
|
|
locaService: [],
|
|
|
|
|
editRemarkVal: null
|
|
|
|
|
editRemarkVal: null,
|
|
|
|
|
serviceData: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -331,29 +332,22 @@ export default {
|
|
|
|
|
this.getBookingLog()
|
|
|
|
|
this.getLog()
|
|
|
|
|
this.getLocal()
|
|
|
|
|
// this.getServiceItem()
|
|
|
|
|
},
|
|
|
|
|
getLocal() {
|
|
|
|
|
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
|
|
|
|
|
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
|
|
|
|
|
// 获取服务历史记录 - 需要替换
|
|
|
|
|
let items = null
|
|
|
|
|
if (window.localStorage.getItem('locaService')) {
|
|
|
|
|
items = JSON.parse(window.localStorage.getItem('locaService'))[this.id]
|
|
|
|
|
}
|
|
|
|
|
this.locaService = items || []
|
|
|
|
|
},
|
|
|
|
|
getLocal() {
|
|
|
|
|
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
|
|
|
|
|
console.log('== 服务项目 ==', this.bookingServiceItem)
|
|
|
|
|
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
|
|
|
|
|
},
|
|
|
|
|
getServiceItem () {
|
|
|
|
|
GetServiceItemList({
|
|
|
|
|
bookingId: this.id
|
|
|
|
|
this.bookingServiceItem.map((item, index) => {
|
|
|
|
|
if (this.locaService.includes(item.code)) {
|
|
|
|
|
this.serviceData.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
debugger
|
|
|
|
|
if (res.success) { }
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
console.log('== 服务项目 ==', this.bookingServiceItem, this.serviceData)
|
|
|
|
|
},
|
|
|
|
|
// 校验
|
|
|
|
|
checkFun() {
|
|
|
|
@ -573,16 +567,35 @@ export default {
|
|
|
|
|
this.logList[index].showMore = !this.logList[index].showMore
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
saveService(name) {
|
|
|
|
|
if (!this.locaService.includes(name)) {
|
|
|
|
|
this.locaService.push(name)
|
|
|
|
|
saveService(data) {
|
|
|
|
|
if (!this.locaService.includes(data.code)) {
|
|
|
|
|
this.locaService.push(data.code)
|
|
|
|
|
this.serviceData.push(data)
|
|
|
|
|
} else {
|
|
|
|
|
this.locaService.splice(this.locaService.indexOf(name), 1)
|
|
|
|
|
const index = this.locaService.indexOf(data.code)
|
|
|
|
|
this.locaService.splice(index, 1)
|
|
|
|
|
this.serviceData.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
const value = {}
|
|
|
|
|
this.$set(value, this.id, this.locaService)
|
|
|
|
|
window.localStorage.setItem('locaService', JSON.stringify(value))
|
|
|
|
|
}
|
|
|
|
|
console.log('== 修改服务 ==', this.locaService, this.serviceData)
|
|
|
|
|
this.saveServiceItem()
|
|
|
|
|
// const value = {}
|
|
|
|
|
// this.$set(value, this.id, this.locaService)
|
|
|
|
|
// window.localStorage.setItem('locaService', JSON.stringify(value))
|
|
|
|
|
},
|
|
|
|
|
saveServiceItem () {
|
|
|
|
|
SaveServiceItem({
|
|
|
|
|
bookingId: this.id,
|
|
|
|
|
item: this.serviceData
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
console.log('== 服务项目设置成功 ==')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|