修改右侧详情

szh_zidingyibiaoti
lilu 2 years ago
parent e4da966704
commit 3bde9b353a

@ -715,9 +715,8 @@ export function DjyCustomerContacts(parameter) {
// 删除备注
export function BookingOrderDeleteRemark(parameter) {
return axios({
url: '/BookingOrder/DeleteRemark',
method: 'post',
data: parameter
url: '/BookingOrder/DeleteRemark?Id=' + parameter,
method: 'post'
})
}
@ -746,3 +745,12 @@ export function DjyUserConfigMulti(parameter) {
method: 'get'
})
}
// 获取多个自定义消息
export function GetAllData(parameter) {
return axios({
url: '/BookingOrder/GetAllData',
method: 'get',
params: parameter
})
}

@ -110,6 +110,7 @@
:excuteRulesType="excuteRulesType"
@changeDetail="changeDetailFun"
@rules="getRules"
@upDateRight="upDateRightFun"
></rightContent>
</a-col>
</a-row>
@ -146,7 +147,8 @@ import {
// BookingOrderAdd,
// BookingOrderAddOrUpdate,
BookingOrderSave,
getDjyTenantConfig
getDjyTenantConfig,
GetAllData
} from '@/api/modular/main/BookingLedger'
import { mapActions, mapGetters } from 'vuex'
import rules from './rules'
@ -253,7 +255,13 @@ const initDetail = {
ediAttnMail: ''
},
//
hbList: []
hbList: [],
//
remark: [],
file: [],
log: [],
item: [],
statuslog: []
}
export default {
name: 'BookingDetail',
@ -314,11 +322,9 @@ export default {
...mapGetters(['bookingList', 'needSavePages', 'hasbookingDetail'])
},
created() {
// console.log('== - created ==')
this.init()
},
mounted() {
// console.log('== - mounted ==')
window.addEventListener(
'scroll',
() => {
@ -584,6 +590,7 @@ export default {
if (this.id) {
this.isAdd = false
this.getDetail()
this.getRightAll()
} else {
this.isAdd = true
this.bookingDetails.carrierid = this.type
@ -754,7 +761,9 @@ export default {
})
}
res.data.feeself = !!res.data.feeself
this.$set(this, 'bookingDetails', res.data)
this.$set(this, 'bookingDetails', { ...this.bookingDetails, ...res.data })
console.log('== 获取订舱详情 ==', this.bookingDetails)
// this.getRightAll()
setTimeout(() => {
this.inChildLoading = false
this.checkSaveFun({ type: 'details', hasChange: false })
@ -762,6 +771,27 @@ export default {
this.$forceUpdate()
},
getRightAll () {
GetAllData({
bookingId: this.id
})
.then(res => {
if (res.success) {
this.$set(this, 'bookingDetails', { ...this.bookingDetails, ...res.data })
console.log('== 修改订舱右侧内容 ==', this.bookingDetails)
} else {
console.log(res.message)
}
})
.catch(err => {
console.log(err)
})
},
upDateRightFun () {
this.getRightAll()
},
changeDetailFun(data) {
const { detail, type } = data
if (this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) {

@ -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>

@ -627,15 +627,10 @@ export default {
this.formAllData = JSON.parse(JSON.stringify(initData.condAllData))
this.fromTableAllData = JSON.parse(JSON.stringify(initData.columnsAllData))
this.tableHeight = document.body.clientHeight - 300
// console.log('=== ===')
this.getFormData()
this.getTableList()
this.getPageSize()
this.getCarrier()
// this.getConfigUser()
this.getConfigUser()
},
onresize () {
// console.log('=== ===')
window.onresize = () => {
this.screenWidth = document.body.clientWidth
}
@ -745,10 +740,6 @@ export default {
this.tableOrderType = ''
this.gridOptions.data = []
this.getList(queryParam)
if (Object.keys(queryParam).length === 0) {
this.getFormData()
}
this.getTableList()
},
//
getConfigUser() {
@ -1009,38 +1000,6 @@ export default {
})
})
},
//
getTableList() {
DjyUserConfigGet({ type: 'booking_list_column' }).then(res => {
if (res.data && JSON.parse(res.data.configJson).length) {
this.gridOptions.columns = JSON.parse(res.data.configJson)
this.formTableData = JSON.parse(res.data.configJson)
const nowTableArr = this.formTableData.map((item, index) => {
return item.field
})
const moreTableArr = []
this.fromTableAllData.map((item, index) => {
if (!nowTableArr.includes(item.field)) {
moreTableArr.push(item)
}
})
this.formMoreTableData = moreTableArr
this.$forceUpdate()
} else {
const nowTableArr = this.formTableData.map((item, index) => {
return item.field
})
const moreTableArr = []
this.fromTableAllData.map((item, index) => {
if (!nowTableArr.includes(item.field)) {
moreTableArr.push(item)
}
})
this.formMoreTableData = moreTableArr
this.$forceUpdate()
}
})
},
handlePageChange({ currentPage, pageSize }) {
if (this.gridOptions.pagerConfig.pageSize !== pageSize) {
this.editPageSizeSave(pageSize)
@ -1062,16 +1021,6 @@ export default {
})
},
getPageSize() {
DjyUserConfigGet({ type: 'booking_list_page' }).then(res => {
if (res.data && JSON.parse(res.data.configJson)) {
this.gridOptions.pagerConfig.pageSize = JSON.parse(res.data.configJson).pageSize
this.getList(this.formRes)
this.$forceUpdate()
}
})
},
// form
toggleAdvanced() {
this.advanced = !this.advanced

@ -516,6 +516,11 @@ export default {
}
}
</script>
<style lang="less" scoped>
/deep/ .ant-card-body {
padding-top: 10px !important;
}
</style>
<style lang="less">
.table-operator {
margin-bottom: 18px;
@ -548,9 +553,6 @@ button {
.vxe-table--render-default .vxe-body--row.row--stripe {
background: #f5f9fe;
}
.ant-card-body {
padding-top: 10px;
}
.nav-box {
padding: 0 10px;

Loading…
Cancel
Save