|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="main">
|
|
|
|
|
<div class="btn-list">
|
|
|
|
|
<a-input
|
|
|
|
|
style="display: inline-block;width: 160px;"
|
|
|
|
|
v-if="details.bookingno"
|
|
|
|
|
disabled
|
|
|
|
|
v-model="details.bookingno" />
|
|
|
|
|
<span v-if="details.bookingno">{{ details.bookingno }}</span>
|
|
|
|
|
<a-button type="primary" @click="handleSave">保存</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleCopy">复制</a-button>
|
|
|
|
|
<a-button type="primary">存为模板</a-button>
|
|
|
|
|
<a-button type="danger" @click="handleDelete">删除</a-button>
|
|
|
|
|
<a-button type="primary">发送订舱</a-button>
|
|
|
|
|
<a-button type="danger" v-if="details.bsstatus == '已录入'" @click="handleDelete">删除</a-button>
|
|
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleSubimt"
|
|
|
|
|
v-if="details.bsstatus == '已录入' || details.bsstatus == '已驳回'">发送订舱</a-button>
|
|
|
|
|
<a-button type="danger" @click="handleCancle" v-if="details.bsstatus == '已提交'">撤销</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
|
<div class="box">
|
|
|
|
@ -726,7 +726,10 @@ import datePickerView from '../../BookingLedger/detail/components/datePickerView
|
|
|
|
|
import autoView from '../../BookingLedger/detail/components/autoView'
|
|
|
|
|
import textareaView from '../../BookingLedger/detail/components/textareaView'
|
|
|
|
|
import { UploadTempFile, BookingCustomerOrderGetFile } from '@/api/modular/system/fileManage'
|
|
|
|
|
import { BookingCustomerOrderSave, BookingTemplateAdd, BookingCustomerOrderGet, BookingCustomerOrderDelete } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import {
|
|
|
|
|
BookingCustomerOrderSave, BookingTemplateAdd, BookingCustomerOrderGet,
|
|
|
|
|
BookingCustomerOrderDelete, BookingCustomerOrderSubmit, BookingCustomerOrderCancelSubmit
|
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
@ -748,6 +751,7 @@ export default {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.details,
|
|
|
|
|
isCopy: this.isCopy,
|
|
|
|
|
fileList: this.fileList,
|
|
|
|
|
id: this.id
|
|
|
|
|
}
|
|
|
|
|
if (Object.keys(this.$refs).includes('sedOrder')) {
|
|
|
|
@ -759,6 +763,7 @@ export default {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.details,
|
|
|
|
|
isCopy: this.isCopy,
|
|
|
|
|
fileList: this.fileList,
|
|
|
|
|
id: this.id
|
|
|
|
|
}
|
|
|
|
|
this.$set(this.historyData, this.id, hisData)
|
|
|
|
@ -773,6 +778,7 @@ export default {
|
|
|
|
|
if (this.isCopy) {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.details,
|
|
|
|
|
fileList: this.fileList,
|
|
|
|
|
isCopy: this.isCopy,
|
|
|
|
|
id: this.id
|
|
|
|
|
}
|
|
|
|
@ -785,6 +791,7 @@ export default {
|
|
|
|
|
const hisData = {
|
|
|
|
|
bookingDetails: this.details,
|
|
|
|
|
isCopy: this.isCopy,
|
|
|
|
|
fileList: this.fileList,
|
|
|
|
|
id: this.id
|
|
|
|
|
}
|
|
|
|
|
this.$set(this.historyData, this.id, hisData)
|
|
|
|
@ -853,6 +860,7 @@ export default {
|
|
|
|
|
if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') {
|
|
|
|
|
const $data = JSON.parse(JSON.stringify(this.historyData[`copy-${newId}`]))
|
|
|
|
|
this.details = $data.bookingDetails
|
|
|
|
|
this.fileList = $data.fileList
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
this.isCopy = this.$route.query.isCopy
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
@ -861,11 +869,13 @@ export default {
|
|
|
|
|
this.isCopy = this.$route.query.isCopy
|
|
|
|
|
const $data = JSON.parse(JSON.stringify(this.historyData[newId]))
|
|
|
|
|
this.details = $data.bookingDetails
|
|
|
|
|
this.fileList = $data.fileList
|
|
|
|
|
if (this.isCopy && !$data.isCopy) {
|
|
|
|
|
$data.bookingDetails.copyId = this.$route.query.id
|
|
|
|
|
$data.bookingDetails.id = 0
|
|
|
|
|
$data.bookingDetails.bookingno = ''
|
|
|
|
|
$data.bookingDetails.files = {}
|
|
|
|
|
this.fileList = []
|
|
|
|
|
$data.bookingDetails.tempFileNames = []
|
|
|
|
|
this.details = $data.bookingDetails
|
|
|
|
|
} else {
|
|
|
|
@ -885,23 +895,18 @@ export default {
|
|
|
|
|
item.label = item.name
|
|
|
|
|
item.value = item.code
|
|
|
|
|
})
|
|
|
|
|
// const shipperScroll = document.getElementById('shipper-scroll')
|
|
|
|
|
// if (shipperScroll) {
|
|
|
|
|
// shipperScroll.addEventListener('scroll', () => {
|
|
|
|
|
// document.getElementById('shipper-scroll-right').scrollTop = shipperScroll.scrollTop
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// const consigneeScroll = document.getElementById('consignee-scroll')
|
|
|
|
|
// consigneeScroll.addEventListener('scroll', () => {
|
|
|
|
|
// document.getElementById('consignee-scroll-right').scrollTop = consigneeScroll.scrollTop
|
|
|
|
|
// })
|
|
|
|
|
// const notifypartyScroll = document.getElementById('notifyparty-scroll')
|
|
|
|
|
// notifypartyScroll.addEventListener('scroll', () => {
|
|
|
|
|
// document.getElementById('notifyparty-scroll-right').scrollTop = notifypartyScroll.scrollTop
|
|
|
|
|
// })
|
|
|
|
|
if (this.id) {
|
|
|
|
|
if (this.$route.query.id) {
|
|
|
|
|
this.isAdd = false
|
|
|
|
|
this.getDetail()
|
|
|
|
|
} else {
|
|
|
|
|
this.details = {
|
|
|
|
|
shipper: '',
|
|
|
|
|
serviceList: [],
|
|
|
|
|
notifyparty: '',
|
|
|
|
|
consignee: '',
|
|
|
|
|
ctnList: []
|
|
|
|
|
}
|
|
|
|
|
this.fileList = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCopy() {
|
|
|
|
@ -910,6 +915,32 @@ export default {
|
|
|
|
|
query: { id: this.id, isCopy: true }
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSubimt() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
BookingCustomerOrderSubmit([this.details.id]).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.$message.success('提交成功')
|
|
|
|
|
this.getDetail()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
this.loading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCancle() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
BookingCustomerOrderCancelSubmit([this.details.id]).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.$message.success('撤销成功')
|
|
|
|
|
this.getDetail()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
this.loading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getDetail() {
|
|
|
|
|
const data = {
|
|
|
|
|
id: this.id
|
|
|
|
@ -993,21 +1024,29 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (Object.values(data.files).length === 0) {
|
|
|
|
|
if (data.files && Object.values(data.files).length === 0) {
|
|
|
|
|
delete data.files
|
|
|
|
|
}
|
|
|
|
|
if (!data.id && !this.isCopy) {
|
|
|
|
|
data.id = this.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.loading = true
|
|
|
|
|
BookingCustomerOrderSave(data).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('操作成功')
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.getDetail()
|
|
|
|
|
this.id = res.data.id
|
|
|
|
|
if (this.isCopy) {
|
|
|
|
|
this.isCopy = false
|
|
|
|
|
this.id = res.data.id
|
|
|
|
|
}
|
|
|
|
|
this.$router.replace({
|
|
|
|
|
name: 'BookingCustomerDetail',
|
|
|
|
|
query: {
|
|
|
|
|
id: res.data.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
@ -1367,6 +1406,7 @@ export default {
|
|
|
|
|
.main {
|
|
|
|
|
padding-bottom: 60px;
|
|
|
|
|
position: sticky;
|
|
|
|
|
|
|
|
|
|
.box {
|
|
|
|
|
background: white;
|
|
|
|
|
padding: 10px;
|
|
|
|
@ -1380,6 +1420,7 @@ export default {
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
margin: 0 7px;
|
|
|
|
|
}
|
|
|
|
|