|
|
@ -47,7 +47,7 @@
|
|
|
|
<span class="right" @click="addRemark"><i class="iconfont icon-jiahao2fill"></i>新增备注</span>
|
|
|
|
<span class="right" @click="addRemark"><i class="iconfont icon-jiahao2fill"></i>新增备注</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<div class="remark" v-for="(remark, rindex) in remarkList" :key="rindex">
|
|
|
|
<div class="remark" v-for="(remark, rindex) in details.remark" :key="rindex">
|
|
|
|
<div class="remark-main">
|
|
|
|
<div class="remark-main">
|
|
|
|
<div class="top"><i class="iconfont icon-yuandian"></i>{{ remark.remark }}</div>
|
|
|
|
<div class="top"><i class="iconfont icon-yuandian"></i>{{ remark.remark }}</div>
|
|
|
|
<div class="bottom">{{ remark.updatedTime || remark.createdTime }} {{ remark.updatedUserName }}</div>
|
|
|
|
<div class="bottom">{{ remark.updatedTime || remark.createdTime }} {{ remark.updatedUserName }}</div>
|
|
|
@ -57,7 +57,7 @@
|
|
|
|
<div class="remark-btn"><i class="iconfont icon-shanchu1"></i></div>
|
|
|
|
<div class="remark-btn"><i class="iconfont icon-shanchu1"></i></div>
|
|
|
|
</a-popconfirm>
|
|
|
|
</a-popconfirm>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="remark no-data" v-if="remarkList.length === 0">
|
|
|
|
<div class="remark no-data" v-if="details.remark.length === 0">
|
|
|
|
<i class="iconfont icon-wushuju"></i>
|
|
|
|
<i class="iconfont icon-wushuju"></i>
|
|
|
|
<div class="text">暂无内容</div>
|
|
|
|
<div class="text">暂无内容</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -67,7 +67,7 @@
|
|
|
|
<div class="title"><i class="iconfont icon-fujian-wenjian"></i><span>附件</span></div>
|
|
|
|
<div class="title"><i class="iconfont icon-fujian-wenjian"></i><span>附件</span></div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<a-button type="primary" class="file-btn" @click="addFile">新增附件</a-button>
|
|
|
|
<a-button type="primary" class="file-btn" @click="addFile">新增附件</a-button>
|
|
|
|
<div class="file" v-for="(file, findex) in fileList" :key="findex">
|
|
|
|
<div class="file" v-for="(file, findex) in details.file" :key="findex">
|
|
|
|
<div class="top">
|
|
|
|
<div class="top">
|
|
|
|
<span class="left">
|
|
|
|
<span class="left">
|
|
|
|
<i class="iconfont icon-Excel" v-if="['xls', 'xlsx'].includes(getFileType(file.fileName))"></i>
|
|
|
|
<i class="iconfont icon-Excel" v-if="['xls', 'xlsx'].includes(getFileType(file.fileName))"></i>
|
|
|
@ -89,7 +89,7 @@
|
|
|
|
<span><i class="iconfont icon-shijian1"></i>{{ file.createdTime }}</span>
|
|
|
|
<span><i class="iconfont icon-shijian1"></i>{{ file.createdTime }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="no-data" v-if="fileList.length === 0">
|
|
|
|
<div class="no-data" v-if="details.file.length === 0">
|
|
|
|
<i class="iconfont icon-wushuju"></i>
|
|
|
|
<i class="iconfont icon-wushuju"></i>
|
|
|
|
<div class="text">暂无附件</div>
|
|
|
|
<div class="text">暂无附件</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -100,10 +100,10 @@
|
|
|
|
<i class="iconfont icon-lightning-full"></i><span>订单及货运动态</span>
|
|
|
|
<i class="iconfont icon-lightning-full"></i><span>订单及货运动态</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<div class="booking-log" v-for="(bookingLog, bindex) in bookingLogList" :key="bindex">
|
|
|
|
<div class="booking-log" v-for="(bookingLog, bindex) in details.statuslog" :key="bindex">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="log"
|
|
|
|
class="log"
|
|
|
|
:class="{ hideline: bindex === bookingLogList.length - 1 && bookingLog.detail.length === 0 }"
|
|
|
|
:class="{ hideline: bindex === details.statuslog.length - 1 && bookingLog.detail.length === 0 }"
|
|
|
|
@click="bookingShow(bookingLog)"
|
|
|
|
@click="bookingShow(bookingLog)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span class="log-time">{{ bookingLog.opTime }}</span>
|
|
|
|
<span class="log-time">{{ bookingLog.opTime }}</span>
|
|
|
@ -116,25 +116,12 @@
|
|
|
|
<div class="child-log" v-for="(child, cindex) in bookingLog.detail" :key="cindex">
|
|
|
|
<div class="child-log" v-for="(child, cindex) in bookingLog.detail" :key="cindex">
|
|
|
|
<span class="log-time">{{ child.opTime }}</span>
|
|
|
|
<span class="log-time">{{ child.opTime }}</span>
|
|
|
|
<i class="iconfont icon-yuanxuankuang2 icon"></i>
|
|
|
|
<i class="iconfont icon-yuanxuankuang2 icon"></i>
|
|
|
|
<span class="log-name"
|
|
|
|
<span class="log-name">{{ child.status }} <span class="min-log" v-if="child.cntrno">箱号:{{ child.cntrno }}</span>
|
|
|
|
>{{ child.status }} <span class="min-log" v-if="child.cntrno">箱号:{{ child.cntrno }}</span>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <a-directory-tree multiple default-expand-all>
|
|
|
|
<div class="no-data" v-if="details.statuslog.length === 0">
|
|
|
|
<a-tree-node v-for="(bookingLog, bindex) in bookingLogList" :key="`0-${bindex}`" :title="bookingLog.status">
|
|
|
|
|
|
|
|
<template v-if="bookingLog.detail.length > 0">
|
|
|
|
|
|
|
|
<a-tree-node
|
|
|
|
|
|
|
|
v-for="(detailLog, dindex) in bookingLog.detail"
|
|
|
|
|
|
|
|
:key="`0-${bindex}-${dindex}`"
|
|
|
|
|
|
|
|
:title="detailLog.status"
|
|
|
|
|
|
|
|
is-leaf
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</a-tree-node>
|
|
|
|
|
|
|
|
</a-directory-tree> -->
|
|
|
|
|
|
|
|
<div class="no-data" v-if="bookingLogList.length === 0">
|
|
|
|
|
|
|
|
<i class="iconfont icon-queshengye_zanwushuju" :style="{ fontSize: '50px' }"></i>
|
|
|
|
<i class="iconfont icon-queshengye_zanwushuju" :style="{ fontSize: '50px' }"></i>
|
|
|
|
<div class="text">暂无动态</div>
|
|
|
|
<div class="text">暂无动态</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -150,7 +137,7 @@
|
|
|
|
<span>修改人</span>
|
|
|
|
<span>修改人</span>
|
|
|
|
<span>修改时间</span>
|
|
|
|
<span>修改时间</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-for="(log, lindex) in logList" :key="lindex">
|
|
|
|
<div v-for="(log, lindex) in details.log" :key="lindex">
|
|
|
|
<div class="list">
|
|
|
|
<div class="list">
|
|
|
|
<span class="btn">{{ log.createdUserName }}</span>
|
|
|
|
<span class="btn">{{ log.createdUserName }}</span>
|
|
|
|
<span class="btn">
|
|
|
|
<span class="btn">
|
|
|
@ -237,17 +224,11 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
GetRemark,
|
|
|
|
|
|
|
|
AddRemark,
|
|
|
|
AddRemark,
|
|
|
|
GetFile,
|
|
|
|
|
|
|
|
GetBookingLog,
|
|
|
|
|
|
|
|
GetLog,
|
|
|
|
|
|
|
|
AddFile,
|
|
|
|
AddFile,
|
|
|
|
BookingOrderGetFile,
|
|
|
|
|
|
|
|
ExcuteRulesOceanBooking,
|
|
|
|
ExcuteRulesOceanBooking,
|
|
|
|
BookingOrderDownload,
|
|
|
|
BookingOrderDownload,
|
|
|
|
BookingOrderDeleteRemark,
|
|
|
|
BookingOrderDeleteRemark,
|
|
|
|
GetServiceItemList,
|
|
|
|
|
|
|
|
SaveServiceItem
|
|
|
|
SaveServiceItem
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
|
|
|
|
|
|
@ -280,10 +261,10 @@ export default {
|
|
|
|
remarkModelvisible: false,
|
|
|
|
remarkModelvisible: false,
|
|
|
|
bookingModelconfirm: false,
|
|
|
|
bookingModelconfirm: false,
|
|
|
|
remarkVal: '',
|
|
|
|
remarkVal: '',
|
|
|
|
remarkList: [],
|
|
|
|
// remarkList: [], // 改为 remark
|
|
|
|
fileList: [],
|
|
|
|
// fileList: [], // 改为 file
|
|
|
|
bookingLogList: [],
|
|
|
|
// bookingLogList: [], // 改为 statuslog
|
|
|
|
logList: [],
|
|
|
|
// logList: [], // 改为 log
|
|
|
|
showKey: [],
|
|
|
|
showKey: [],
|
|
|
|
fileModelvisible: false,
|
|
|
|
fileModelvisible: false,
|
|
|
|
fileModelconfirm: false,
|
|
|
|
fileModelconfirm: false,
|
|
|
@ -296,9 +277,16 @@ export default {
|
|
|
|
bookingAttachType: [],
|
|
|
|
bookingAttachType: [],
|
|
|
|
attachName: '',
|
|
|
|
attachName: '',
|
|
|
|
attachCode: '',
|
|
|
|
attachCode: '',
|
|
|
|
locaService: [],
|
|
|
|
editRemarkVal: null
|
|
|
|
editRemarkVal: null,
|
|
|
|
// locaService: [],
|
|
|
|
serviceData: []
|
|
|
|
// serviceData: []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
locaService () {
|
|
|
|
|
|
|
|
return this.details.item.map((item, index) => {
|
|
|
|
|
|
|
|
return item.code
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
@ -313,41 +301,18 @@ export default {
|
|
|
|
handler(nD, oD) {
|
|
|
|
handler(nD, oD) {
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
if (!nD.id) {
|
|
|
|
if (!nD.id) {
|
|
|
|
|
|
|
|
// 切换路由需要修改
|
|
|
|
this.BookingDetail = []
|
|
|
|
this.BookingDetail = []
|
|
|
|
this.bookingLogList = []
|
|
|
|
|
|
|
|
this.bookingServiceItem = []
|
|
|
|
|
|
|
|
this.fileList = []
|
|
|
|
|
|
|
|
this.remarkList = []
|
|
|
|
|
|
|
|
this.logList = []
|
|
|
|
|
|
|
|
} else if (nD.id && this.$route.name === 'BookingDetail') {
|
|
|
|
} else if (nD.id && this.$route.name === 'BookingDetail') {
|
|
|
|
this.init()
|
|
|
|
// this.init()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
init() {
|
|
|
|
init() {
|
|
|
|
this.getRemark()
|
|
|
|
|
|
|
|
this.getFile()
|
|
|
|
|
|
|
|
this.getBookingLog()
|
|
|
|
|
|
|
|
this.getLog()
|
|
|
|
|
|
|
|
this.getLocal()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getLocal() {
|
|
|
|
|
|
|
|
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
|
|
|
|
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
|
|
|
|
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
|
|
|
|
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 || []
|
|
|
|
|
|
|
|
this.bookingServiceItem.map((item, index) => {
|
|
|
|
|
|
|
|
if (this.locaService.includes(item.code)) {
|
|
|
|
|
|
|
|
this.serviceData.push(item)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log('== 服务项目 ==', this.bookingServiceItem, this.serviceData)
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 校验
|
|
|
|
// 校验
|
|
|
|
checkFun() {
|
|
|
|
checkFun() {
|
|
|
@ -374,25 +339,19 @@ export default {
|
|
|
|
this.$message.success({ content: '校验失败' })
|
|
|
|
this.$message.success({ content: '校验失败' })
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 备注 - start
|
|
|
|
|
|
|
|
getRemark() {
|
|
|
|
|
|
|
|
GetRemark({
|
|
|
|
|
|
|
|
id: this.id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.remarkList = res.data
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addRemark() {
|
|
|
|
addRemark() {
|
|
|
|
|
|
|
|
if (!this.id) {
|
|
|
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
this.remarkModelvisible = true
|
|
|
|
this.remarkModelvisible = true
|
|
|
|
this.remarkVal = ''
|
|
|
|
this.remarkVal = ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleModelSubmit() {
|
|
|
|
handleModelSubmit() {
|
|
|
|
|
|
|
|
if (!this.id) {
|
|
|
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
AddRemark({
|
|
|
|
AddRemark({
|
|
|
|
id: this.editRemarkVal ? this.editRemarkVal.id : 0,
|
|
|
|
id: this.editRemarkVal ? this.editRemarkVal.id : 0,
|
|
|
|
pId: this.id,
|
|
|
|
pId: this.id,
|
|
|
@ -403,7 +362,7 @@ export default {
|
|
|
|
this.$message.info('备注提交成功')
|
|
|
|
this.$message.info('备注提交成功')
|
|
|
|
this.editRemarkVal = null
|
|
|
|
this.editRemarkVal = null
|
|
|
|
this.handleModelCancel()
|
|
|
|
this.handleModelCancel()
|
|
|
|
this.getRemark()
|
|
|
|
this.$emit('upDateRight')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(err => {
|
|
|
|
.catch(err => {
|
|
|
@ -411,17 +370,15 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
editRemark(data) {
|
|
|
|
editRemark(data) {
|
|
|
|
// console.log('=== 暂无接口, 需要添加编辑备注 ===')
|
|
|
|
|
|
|
|
this.remarkModelvisible = true
|
|
|
|
this.remarkModelvisible = true
|
|
|
|
this.remarkVal = data.remark
|
|
|
|
this.remarkVal = data.remark
|
|
|
|
this.editRemarkVal = data
|
|
|
|
this.editRemarkVal = data
|
|
|
|
},
|
|
|
|
},
|
|
|
|
deleteRemark(data) {
|
|
|
|
deleteRemark(data) {
|
|
|
|
console.log(data)
|
|
|
|
console.log(data)
|
|
|
|
BookingOrderDeleteRemark({ id: data.id }).then(res => {
|
|
|
|
BookingOrderDeleteRemark(data.id).then(res => {
|
|
|
|
// console.log(res)
|
|
|
|
|
|
|
|
this.$message.success('成功删除')
|
|
|
|
this.$message.success('成功删除')
|
|
|
|
this.getRemark()
|
|
|
|
this.$emit('upDateRight')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleModelCancel() {
|
|
|
|
handleModelCancel() {
|
|
|
@ -431,19 +388,6 @@ export default {
|
|
|
|
// 备注 - end
|
|
|
|
// 备注 - end
|
|
|
|
|
|
|
|
|
|
|
|
// 附件 - start
|
|
|
|
// 附件 - start
|
|
|
|
getFile() {
|
|
|
|
|
|
|
|
GetFile({
|
|
|
|
|
|
|
|
id: this.id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.fileList = res.data
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getFileType(val) {
|
|
|
|
getFileType(val) {
|
|
|
|
if (val) {
|
|
|
|
if (val) {
|
|
|
|
return val.substr(val.lastIndexOf('.') + 1)
|
|
|
|
return val.substr(val.lastIndexOf('.') + 1)
|
|
|
@ -452,6 +396,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addFile() {
|
|
|
|
addFile() {
|
|
|
|
|
|
|
|
if (!this.id) {
|
|
|
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
this.fileModelvisible = true
|
|
|
|
this.fileModelvisible = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fileModelCancel() {
|
|
|
|
fileModelCancel() {
|
|
|
@ -501,7 +449,8 @@ export default {
|
|
|
|
.then(res => {
|
|
|
|
.then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message.success('上传成功')
|
|
|
|
this.$message.success('上传成功')
|
|
|
|
this.getFile()
|
|
|
|
// this.getFile()
|
|
|
|
|
|
|
|
this.$emit('upDateRight')
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$message.error(res.message)
|
|
|
|
this.$message.error(res.message)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -526,35 +475,6 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 附件 - end
|
|
|
|
// 附件 - end
|
|
|
|
|
|
|
|
|
|
|
|
// 获取动态
|
|
|
|
|
|
|
|
getBookingLog() {
|
|
|
|
|
|
|
|
GetBookingLog({
|
|
|
|
|
|
|
|
id: this.id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.bookingLogList = res.data
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 获取日志
|
|
|
|
|
|
|
|
getLog() {
|
|
|
|
|
|
|
|
GetLog({
|
|
|
|
|
|
|
|
id: this.id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.logList = res.data
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleAttachChange(index) {
|
|
|
|
handleAttachChange(index) {
|
|
|
|
this.attachCode = this.bookingAttachType[index].code
|
|
|
|
this.attachCode = this.bookingAttachType[index].code
|
|
|
|
this.attachName = this.bookingAttachType[index].name
|
|
|
|
this.attachName = this.bookingAttachType[index].name
|
|
|
@ -564,28 +484,32 @@ export default {
|
|
|
|
this.$forceUpdate()
|
|
|
|
this.$forceUpdate()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showLogMore(index) {
|
|
|
|
showLogMore(index) {
|
|
|
|
this.logList[index].showMore = !this.logList[index].showMore
|
|
|
|
this.details.log[index].showMore = !this.details.log[index].showMore
|
|
|
|
this.$forceUpdate()
|
|
|
|
this.$forceUpdate()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
saveService(data) {
|
|
|
|
saveService(data) {
|
|
|
|
|
|
|
|
if (!this.id) {
|
|
|
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!this.locaService.includes(data.code)) {
|
|
|
|
if (!this.locaService.includes(data.code)) {
|
|
|
|
this.locaService.push(data.code)
|
|
|
|
this.locaService.push(data.code)
|
|
|
|
this.serviceData.push(data)
|
|
|
|
this.details.item.push({
|
|
|
|
|
|
|
|
code: data.code,
|
|
|
|
|
|
|
|
value: data.name
|
|
|
|
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const index = this.locaService.indexOf(data.code)
|
|
|
|
const index = this.locaService.indexOf(data.code)
|
|
|
|
this.locaService.splice(index, 1)
|
|
|
|
this.locaService.splice(index, 1)
|
|
|
|
this.serviceData.splice(index, 1)
|
|
|
|
this.details.item.splice(index, 1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log('== 修改服务 ==', this.locaService, this.serviceData)
|
|
|
|
console.log('== 修改服务 ==', this.locaService, this.details.item)
|
|
|
|
this.saveServiceItem()
|
|
|
|
this.saveServiceItem()
|
|
|
|
// const value = {}
|
|
|
|
|
|
|
|
// this.$set(value, this.id, this.locaService)
|
|
|
|
|
|
|
|
// window.localStorage.setItem('locaService', JSON.stringify(value))
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
saveServiceItem () {
|
|
|
|
saveServiceItem () {
|
|
|
|
SaveServiceItem({
|
|
|
|
SaveServiceItem({
|
|
|
|
bookingId: this.id,
|
|
|
|
bookingId: this.id,
|
|
|
|
item: this.serviceData
|
|
|
|
item: this.details.item
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then(res => {
|
|
|
|
.then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
if (res.success) {
|
|
|
@ -595,7 +519,7 @@ export default {
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err)
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|