diff --git a/src/api/modular/main/BookingLedger.js b/src/api/modular/main/BookingLedger.js index f9952ff..4e5f9c6 100644 --- a/src/api/modular/main/BookingLedger.js +++ b/src/api/modular/main/BookingLedger.js @@ -717,6 +717,24 @@ export function BookingOrderDeleteRemark(parameter) { return axios({ url: '/BookingOrder/DeleteRemark', method: 'post', + data: parameter + }) +} + +// 服务项目 +export function SaveServiceItem(parameter) { + return axios({ + url: '/BookingOrder/SaveServiceItem', + method: 'post', + data: parameter + }) +} + +// 服务项目 +export function GetServiceItemList(parameter) { + return axios({ + url: '/BookingOrder/GetServiceItemList', + method: 'get', params: parameter }) } diff --git a/src/components/MultiTab/MultiTab.vue b/src/components/MultiTab/MultiTab.vue index 83fc2cf..fb591a3 100644 --- a/src/components/MultiTab/MultiTab.vue +++ b/src/components/MultiTab/MultiTab.vue @@ -13,7 +13,7 @@ export default { } }, computed: { - ...mapGetters(['needSavePages']) + ...mapGetters(['needSavePages', 'hasbookingDetail']) }, created() { // bind event @@ -44,7 +44,7 @@ export default { this.selectedLastPath() }, methods: { - ...mapActions(['setNeedSavePages']), + ...mapActions(['setNeedSavePages', 'setHasBookingDetail']), onEdit(targetKey, action) { const _that = this if (targetKey.includes('BookingDetail')) { @@ -80,6 +80,13 @@ export default { if (!this.fullPathList.includes(this.activeKey)) { this.selectedLastPath() } + let hasDetail = false + this.fullPathList.map((item, index) => { + if (item.includes('/BookingDetail')) { + hasDetail = true + } + }) + this.setHasBookingDetail(hasDetail) }, selectedLastPath() { this.activeKey = this.fullPathList[this.fullPathList.length - 1] diff --git a/src/store/getters.js b/src/store/getters.js index adf28aa..ac48d03 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -17,8 +17,8 @@ const getters = { multiTab: state => state.app.multiTab, lang: state => state.i18n.lang, bookingList: state => state.user.bookingList, - needSavePages: state => state.user.needSavePages - + needSavePages: state => state.user.needSavePages, + hasbookingDetail: state => state.user.hasbookingDetail } export default getters diff --git a/src/store/modules/user.js b/src/store/modules/user.js index aec24b0..9417b38 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -21,7 +21,8 @@ const user = { info: {}, notices: [], // 接收的通知公告 bookingList: {}, // 订舱台账列表 - needSavePages: {} // 需要保存的页面 + needSavePages: {}, // 需要保存的页面 + hasbookingDetail: false // 订舱详情是否销毁 }, mutations: { @@ -77,6 +78,9 @@ const user = { }, SET_NEEDSAVEPAGES: (state, list) => { state.needSavePages = list + }, + SET_HASBOOKINGDETAIL: (state, obj) => { + state.hasbookingDetail = obj } }, @@ -272,6 +276,14 @@ const user = { commit('SET_NEEDSAVEPAGES', obj) resolve() }) + }, + + // 设置订舱页是否需要销毁 + setHasBookingDetail({ commit }, obj) { + return new Promise(resolve => { + commit('SET_HASBOOKINGDETAIL', obj) + resolve() + }) } } } diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 24839a9..714e280 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -310,7 +310,7 @@ export default { } }, computed: { - ...mapGetters(['bookingList', 'needSavePages']) + ...mapGetters(['bookingList', 'needSavePages', 'hasbookingDetail']) }, created() { // console.log('== 详情页 - created ==') @@ -390,7 +390,6 @@ export default { }, 800) }, beforeRouteLeave(to, from, next) { - // console.log('== 离开路由- beforeRouteLeave ==') this.inChildLoading = true if (this.isCopy) { const hisData = { @@ -444,6 +443,9 @@ export default { } this.$set(this.historyData, this.id, hisData) } + if (this.hasbookingDetail) { + this.bookingDetails = {} + } next() setTimeout(() => { this.inChildLoading = false @@ -451,7 +453,6 @@ export default { }, beforeRouteEnter(to, from, next) { next(vm => { - // console.log('== 进入路由 - beforeRouteEnter ==') vm.getRouterHis() }) }, diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue index 5e471a5..c8f22ae 100644 --- a/src/views/main/BookingLedger/detail/modules/operationArea.vue +++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue @@ -846,6 +846,7 @@ export default { immediate: true, handler(nD, oD) { this.id = this.$route.query.id + this.bookingModelFrom.id = this.$route.query.id } }, PrintType(newdata, oldData) { @@ -1133,6 +1134,8 @@ export default { } this.bookingModelFrom.send = type === 'send' this.bookingModelFrom.orderNo = this.details.mblno + this.bookingModelFrom.id = this.$route.query.id + // console.log('==== 订舱截单 ====', this.bookingModelFrom) if (type == 'save') { this.EDISloading = true this.downloadBookingOrEDI(type) diff --git a/src/views/main/BookingLedger/detail/modules/rightContent.vue b/src/views/main/BookingLedger/detail/modules/rightContent.vue index 4b4c371..4d2f986 100644 --- a/src/views/main/BookingLedger/detail/modules/rightContent.vue +++ b/src/views/main/BookingLedger/detail/modules/rightContent.vue @@ -246,7 +246,9 @@ import { BookingOrderGetFile, ExcuteRulesOceanBooking, BookingOrderDownload, - BookingOrderDeleteRemark + BookingOrderDeleteRemark, + GetServiceItemList, + SaveServiceItem } from '@/api/modular/main/BookingLedger' export default { @@ -302,6 +304,7 @@ export default { this.$bus.$on('WebTest001', val => { this.WebTest001(val) }) + this.init() }, watch: { '$route.query': { @@ -328,6 +331,7 @@ export default { this.getBookingLog() this.getLog() this.getLocal() + // this.getServiceItem() let items = null if (window.localStorage.getItem('locaService')) { items = JSON.parse(window.localStorage.getItem('locaService'))[this.id] @@ -338,6 +342,17 @@ export default { this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item') this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type') }, + getServiceItem () { + GetServiceItemList({ + bookingId: this.id + }) + .then(res => { + if (res.success) { } + }) + .catch((err) => { + console.log(err) + }) + }, // 校验 checkFun() { this.$message.loading({ content: '校验中...' })