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