修改BUG

dev
lilu 2 years ago
parent b29c785b37
commit 70e5fa2a3e

@ -95,7 +95,7 @@
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" /> <link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %> <% } %>
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_3756681_zq5v6ks4ruf.css" /> <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3756681_3akyt29bxji.css" />
<!-- 1.8K仔百度收录 --> <!-- 1.8K仔百度收录 -->
<meta name="baidu-site-verification" content="code-QVfBYJ5laQ" /> <meta name="baidu-site-verification" content="code-QVfBYJ5laQ" />
</head> </head>

@ -39,7 +39,7 @@ export default {
this.$forceUpdate() this.$forceUpdate()
} catch (e) {} } catch (e) {}
}) })
console.log('== 路由新增 ==', this.$route, this.$route.fullPath, this.fullPathList)
this.pages.push(this.$route) this.pages.push(this.$route)
this.fullPathList.push(this.$route.fullPath) this.fullPathList.push(this.$route.fullPath)
this.selectedLastPath() this.selectedLastPath()
@ -48,9 +48,10 @@ export default {
...mapActions(['setNeedSavePages']), ...mapActions(['setNeedSavePages']),
onEdit(targetKey, action) { onEdit(targetKey, action) {
const _that = this const _that = this
console.log(this.needSavePages[targetKey], targetKey) console.log('== 路由编辑 start ==', this.fullPathList, this.page)
if (targetKey.includes('BookingDetail')) { if (targetKey.includes('BookingDetail')) {
if (this.needSavePages[targetKey].details || this.needSavePages[targetKey].hbList) { if (Object.keys(this.needSavePages).includes(targetKey) && (this.needSavePages[targetKey].details || this.needSavePages[targetKey].hbList)) {
console.log('== 理由编辑 - 有未保存数据 biu 弹窗出现 ==', this.fullPathList, this.page)
this.$confirm({ this.$confirm({
title: '请确认无未保存数据!', title: '请确认无未保存数据!',
content: '当点击确定按钮时,此页面 将会关闭。', content: '当点击确定按钮时,此页面 将会关闭。',
@ -74,12 +75,12 @@ export default {
} else { } else {
this[action](targetKey) this[action](targetKey)
} }
// console.log('', targetKey, action) console.log(' === 路由编辑 end ==', this.fullPathList, this.page)
}, },
remove(targetKey) { remove(targetKey) {
this.pages = this.pages.filter(page => page.fullPath !== targetKey) this.pages = this.pages.filter(page => page.fullPath !== targetKey)
this.fullPathList = this.fullPathList.filter(path => path !== targetKey) this.fullPathList = this.fullPathList.filter(path => path !== targetKey)
console.log('== 关闭 ==') console.log('== 关闭 ==', this.pages, this.fullPathList)
// //
if (!this.fullPathList.includes(this.activeKey)) { if (!this.fullPathList.includes(this.activeKey)) {
console.log('=== 最后一个标签页 ===') console.log('=== 最后一个标签页 ===')
@ -92,6 +93,7 @@ export default {
// content menu // content menu
closeThat(e) { closeThat(e) {
console.log('=== 测试点4 ===', this.fullPathList)
// //
if (this.fullPathList.length > 1) { if (this.fullPathList.length > 1) {
this.remove(e) this.remove(e)
@ -100,7 +102,7 @@ export default {
} }
}, },
closeLeft(e) { closeLeft(e) {
console.log('=== 测试点1 ===') console.log('=== 测试点1 ===', this.fullPathList)
const currentIndex = this.fullPathList.indexOf(e) const currentIndex = this.fullPathList.indexOf(e)
if (currentIndex > 0) { if (currentIndex > 0) {
this.fullPathList.forEach((item, index) => { this.fullPathList.forEach((item, index) => {
@ -181,6 +183,7 @@ export default {
}, },
watch: { watch: {
$route: function(newVal) { $route: function(newVal) {
console.log('=== 路由切换 === - fullPath: ', newVal.fullPath)
if (!newVal.query.noOpenTab) { if (!newVal.query.noOpenTab) {
this.activeKey = newVal.fullPath this.activeKey = newVal.fullPath
if (this.fullPathList.indexOf(newVal.fullPath) < 0) { if (this.fullPathList.indexOf(newVal.fullPath) < 0) {
@ -195,6 +198,7 @@ export default {
}) })
this.activeKey = newVal.fullPath this.activeKey = newVal.fullPath
} }
console.log('=== 路由切换 === - pages: ', this.pages, ', fullPathList: ', this.fullPathList)
}, },
activeKey: function(newPathKey) { activeKey: function(newPathKey) {
this.$router.push({ path: newPathKey }) this.$router.push({ path: newPathKey })

@ -277,6 +277,12 @@ export default {
}, },
iscontainersoc(nval, oval) { iscontainersoc(nval, oval) {
this.details.iscontainersoc = nval !== '0' this.details.iscontainersoc = nval !== '0'
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
created() {}, created() {},

@ -138,6 +138,12 @@ export default {
} }
}, },
deep: true deep: true
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
created() { created() {

@ -244,11 +244,12 @@ export default {
moreStr: '', moreStr: '',
tabActiveKey: '1', tabActiveKey: '1',
historyData: {}, historyData: {},
Showtabs: false Showtabs: false,
inChildLoading: false
} }
}, },
computed: { computed: {
...mapGetters(['bookingList', 'needSavePages']), ...mapGetters(['bookingList', 'needSavePages'])
// Showtabs() { // Showtabs() {
// let Rdata = true // let Rdata = true
// if (this.bookingDetails.hbList && this.bookingDetails.hbList.length) { // if (this.bookingDetails.hbList && this.bookingDetails.hbList.length) {
@ -262,7 +263,7 @@ export default {
watch: { watch: {
bookingDetails: { bookingDetails: {
handler(nval, oval) { handler(nval, oval) {
this.checkSaveFun({ type: 'details', hasChange: true }) // this.checkSaveFun({ type: 'details', hasChange: true })
}, },
deep: true deep: true
} }
@ -272,7 +273,7 @@ export default {
}, },
beforeRouteUpdate(to, from, next) { beforeRouteUpdate(to, from, next) {
// console.log('fromId', from.query.id, '| toId', to.query.id) // console.log('fromId', from.query.id, '| toId', to.query.id)
// console.log('2.2 === beforeRouteUpdate ===', this.$route.query.id, this.isCopy) console.log('Router 2.2 === beforeRouteUpdate ===', this.$route.query.id, this.isCopy)
// if (!Object.keys(this.historyData).includes(this.$route.query.id)) { // if (!Object.keys(this.historyData).includes(this.$route.query.id)) {
// const hisData = { // const hisData = {
// bookingDetails: this.bookingDetails, // bookingDetails: this.bookingDetails,
@ -286,6 +287,7 @@ export default {
// } // }
// this.$set(this.historyData, this.$route.query.id, hisData) // this.$set(this.historyData, this.$route.query.id, hisData)
// } // }
// this.inChildLoading = true
if (this.isCopy) { if (this.isCopy) {
const hisData = { const hisData = {
bookingDetails: this.bookingDetails, bookingDetails: this.bookingDetails,
@ -312,10 +314,11 @@ export default {
this.$set(this.historyData, this.id, hisData) this.$set(this.historyData, this.id, hisData)
} }
next() next()
// this.inChildLoading = false
this.getRouterHis() this.getRouterHis()
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
// console.log('2.1 === beforeRouteLeave ===', this.id, this.isCopy) console.log('Router 2.1 === beforeRouteLeave ===', this.id, this.isCopy)
// if (!Object.keys(this.historyData).includes(this.id)) { // if (!Object.keys(this.historyData).includes(this.id)) {
// const hisData = { // const hisData = {
// bookingDetails: this.bookingDetails, // bookingDetails: this.bookingDetails,
@ -329,6 +332,7 @@ export default {
// } // }
// this.$set(this.historyData, this.id, hisData) // this.$set(this.historyData, this.id, hisData)
// } // }
this.inChildLoading = true
if (this.isCopy) { if (this.isCopy) {
const hisData = { const hisData = {
bookingDetails: this.bookingDetails, bookingDetails: this.bookingDetails,
@ -355,6 +359,9 @@ export default {
this.$set(this.historyData, this.id, hisData) this.$set(this.historyData, this.id, hisData)
} }
next() next()
setTimeout(() => {
this.inChildLoading = false
}, 2000);
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next(vm => { next(vm => {
@ -364,7 +371,8 @@ export default {
methods: { methods: {
...mapActions(['setNeedSavePages']), ...mapActions(['setNeedSavePages']),
getRouterHis() { getRouterHis() {
// console.log('2.3 === beforeRouteEnter - getRouterHis ===', Object.keys(this.historyData), this.$route.query.id) console.log('Router 2.3 === beforeRouteEnter - getRouterHis ===', Object.keys(this.historyData), this.$route.query.id)
this.inChildLoading = true
const newId = this.$route.query.id const newId = this.$route.query.id
if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') { if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') {
this.id = this.$route.query.id this.id = this.$route.query.id
@ -376,6 +384,12 @@ export default {
this.tabActiveKey = $data.tabActiveKey this.tabActiveKey = $data.tabActiveKey
this.isCopy = this.$route.query.isCopy this.isCopy = this.$route.query.isCopy
this.inPageLoading = false this.inPageLoading = false
setTimeout(() => {
this.inChildLoading = false
if (!Object.keys(this.needSavePages).includes(this.$route.fullPath)) {
this.checkSaveFun({ type: 'details', hasChange: false })
}
}, 1500)
// console.log('== ==', $data.isCopy, this.$route.query.isCopy, this.isCopy) // console.log('== ==', $data.isCopy, this.$route.query.isCopy, this.isCopy)
this.$forceUpdate() this.$forceUpdate()
} else if (Object.keys(this.historyData).includes(newId)) { } else if (Object.keys(this.historyData).includes(newId)) {
@ -393,6 +407,12 @@ export default {
// console.log('== , ==') // console.log('== , ==')
this.bookingDetails.mblno = '' this.bookingDetails.mblno = ''
} }
setTimeout(() => {
this.inChildLoading = false
if (!Object.keys(this.needSavePages).includes(this.$route.fullPath)) {
this.checkSaveFun({ type: 'details', hasChange: false })
}
}, 1500)
this.$forceUpdate() this.$forceUpdate()
} else { } else {
this.id = this.$route.query.id this.id = this.$route.query.id
@ -448,6 +468,7 @@ export default {
return false return false
} }
this.inPageLoading = true this.inPageLoading = true
this.inChildLoading = true
this.$message.loading({ content: '加载中...' }); this.$message.loading({ content: '加载中...' });
// console.log('4.1 == ==', this.id) // console.log('4.1 == ==', this.id)
BookingOrderGet({ BookingOrderGet({
@ -475,8 +496,10 @@ export default {
} }
this.$set(this, 'bookingDetails', res.data) this.$set(this, 'bookingDetails', res.data)
setTimeout(() => { setTimeout(() => {
// console.log(' 1. === ===')
this.inChildLoading = false
this.checkSaveFun({ type: 'details', hasChange: false }) this.checkSaveFun({ type: 'details', hasChange: false })
}, 600) }, 1500)
this.$forceUpdate() this.$forceUpdate()
}) })
.catch(err => { .catch(err => {
@ -486,9 +509,27 @@ export default {
changeDetailFun(data) { changeDetailFun(data) {
const { detail, type } = data const { detail, type } = data
// console.log('', this.ifCompare(this.bookingDetails, detail), !this.inChildLoading, this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading)
if (this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) {
// console.log('2. == == ', type)
this.checkSaveFun({ type: 'details', hasChange: true })
}
this.bookingDetails = detail this.bookingDetails = detail
}, },
ifCompare(object1, object2) {
var o1keys = Object.keys(object1);
var o2keys = Object.keys(object2);
if (o2keys.length !== o1keys.length) return false;
for (let i = 0; i <= o1keys.length - 1; i++) {
let key = o1keys[i];
if (!o2keys.includes(key)) return false;
if (object2[key] !== object1[key]) return false;
}
return true;
},
bookingOrderUpdate() { bookingOrderUpdate() {
if (!this.bookingDetails.mblno) { if (!this.bookingDetails.mblno) {
this.$message.error('请输入提单号') this.$message.error('请输入提单号')
@ -578,11 +619,12 @@ export default {
const _this = this const _this = this
const key = this.$route.fullPath const key = this.$route.fullPath
if (this.needSavePages[key].details || this.needSavePages[key].hbList) { if (this.needSavePages[key].details || this.needSavePages[key].hbList) {
// console.log('== - biu ==')
this.$confirm({ this.$confirm({
title: '请确认无未保存数据!', title: '请确认无未保存数据!',
content: '当点击确定按钮时,此页面 将会关闭。', content: '当点击确定按钮时,此页面 将会关闭。',
onOk() { onOk() {
_this.changePage() _this.changePage(type)
const $data = _this.needSavePages const $data = _this.needSavePages
delete $data[key] delete $data[key]
_this.setNeedSavePages($data) _this.setNeedSavePages($data)
@ -590,7 +632,7 @@ export default {
onCancel() {} onCancel() {}
}) })
} else { } else {
this.changePage() this.changePage(type)
} }
}, },
changePage (type) { changePage (type) {
@ -604,6 +646,10 @@ export default {
} }
const prevId = arr[index - 1] const prevId = arr[index - 1]
const prevType = this.bookingList[prevId].carrierid const prevType = this.bookingList[prevId].carrierid
const $data = this.needSavePages
delete $data[this.$route.fullPath]
this.setNeedSavePages($data)
this.$router.replace({ this.$router.replace({
name: 'BookingDetail', name: 'BookingDetail',
query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno, noOpenTab: true } query: { id: prevId, type: prevType, mblno: this.bookingList[prevId].mblno, noOpenTab: true }
@ -616,6 +662,9 @@ export default {
} }
const nextId = arr[index + 1] const nextId = arr[index + 1]
const nextType = this.bookingList[nextId].carrierid const nextType = this.bookingList[nextId].carrierid
const $data = this.needSavePages
delete $data[this.$route.fullPath]
this.setNeedSavePages($data)
this.$router.replace({ this.$router.replace({
name: 'BookingDetail', name: 'BookingDetail',
query: { id: nextId, type: nextType, mblno: this.bookingList[nextId].mblno, noOpenTab: true } query: { id: nextId, type: nextType, mblno: this.bookingList[nextId].mblno, noOpenTab: true }
@ -651,6 +700,7 @@ export default {
const arr = data.map((item, index) => { const arr = data.map((item, index) => {
return item.isNoSave return item.isNoSave
}) })
// console.log('3. === ===')
if (arr.includes(true)) { if (arr.includes(true)) {
this.checkSaveFun({ type: 'hbList', hasChange: true }) this.checkSaveFun({ type: 'hbList', hasChange: true })
} else { } else {
@ -658,6 +708,9 @@ export default {
} }
}, },
checkSaveFun (data) { checkSaveFun (data) {
// if (this.inPageLoading) {
// return false
// }
const lastPages = this.needSavePages const lastPages = this.needSavePages
const $data = this.needSavePages[this.id] || {} const $data = this.needSavePages[this.id] || {}
if (data.type === 'details') { if (data.type === 'details') {
@ -669,6 +722,7 @@ export default {
const key = this.$route.fullPath const key = this.$route.fullPath
this.$set(lastPages, key, $data) this.$set(lastPages, key, $data)
this.setNeedSavePages(lastPages) this.setNeedSavePages(lastPages)
// console.log('== vuex ==', this.needSavePages)
} }
} }
} }

@ -759,6 +759,12 @@ export default {
}) })
}, },
deep: true deep: true
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
created() { created() {
@ -854,7 +860,7 @@ export default {
this.etdWeek = this.getWeek(this.details.etd) this.etdWeek = this.getWeek(this.details.etd)
} }
this.ContactType = this.$options.filters['dictData']('booking_contact_type') this.ContactType = this.$options.filters['dictData']('booking_contact_type')
console.log(this.ContactType, 'this.ContactType') // console.log(this.ContactType, 'this.ContactType')
}, },
// - start // - start
getDjyCustomerpage(name = '', type, key) { getDjyCustomerpage(name = '', type, key) {

@ -388,6 +388,12 @@ export default {
}) })
}, },
deep: true deep: true
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
computed: { computed: {

@ -85,6 +85,12 @@ export default {
} }
this.details.description = str + nval this.details.description = str + nval
} }
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
created() {}, created() {},

@ -657,6 +657,7 @@ export default {
'$route.query': { '$route.query': {
immediate: true, immediate: true,
handler(nD, oD) { handler(nD, oD) {
this.id = this.$route.query.id
this.init() this.init()
} }
} }

@ -61,9 +61,7 @@
@change="consigneeChange" @change="consigneeChange"
@focus="consigneeChange" @focus="consigneeChange"
/> />
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('consignee')" <a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('consignee')"></a-button>
>保存</a-button
>
<div class="right"> <div class="right">
<span class="btn-circle" @click="spliceMore('consignee')" :style="{ fontSize: '14px' }">*</span> <span class="btn-circle" @click="spliceMore('consignee')" :style="{ fontSize: '14px' }">*</span>
<span class="btn" @click="changeCode(35, 'consignee')">35</span> <span class="btn" @click="changeCode(35, 'consignee')">35</span>
@ -99,9 +97,7 @@
@change="notifyChange" @change="notifyChange"
@focus="notifyChange" @focus="notifyChange"
/> />
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('notifyparty')" <a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('notifyparty')"></a-button>
>保存</a-button
>
<div class="right"> <div class="right">
<span class="btn-circle" @click="spliceMore('notifyparty')" :style="{ fontSize: '14px' }">*</span> <span class="btn-circle" @click="spliceMore('notifyparty')" :style="{ fontSize: '14px' }">*</span>
<span class="btn" @click="changeCode(35, 'notifyparty')">35</span> <span class="btn" @click="changeCode(35, 'notifyparty')">35</span>
@ -144,7 +140,6 @@
v-model="details.yard" v-model="details.yard"
class="customer-input" class="customer-input"
:data-source="yardDataArr" :data-source="yardDataArr"
@select="yardSelect" @select="yardSelect"
@change="yardChange" @change="yardChange"
/> --> /> -->
@ -712,6 +707,12 @@ export default {
}) })
}, },
deep: true deep: true
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
computed: { computed: {

@ -616,6 +616,12 @@ export default {
this.imgSrc = window.URL.createObjectURL(new Blob([res])) this.imgSrc = window.URL.createObjectURL(new Blob([res]))
}) })
} }
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
methods: { methods: {

@ -38,6 +38,12 @@ export default {
}) })
}, },
deep: true deep: true
},
'$route.query': {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
}
} }
}, },
created() {}, created() {},

@ -290,6 +290,7 @@ export default {
'$route.query': { '$route.query': {
immediate: true, immediate: true,
handler(nD, oD) { handler(nD, oD) {
this.id = this.$route.query.id
if (!nD.id) { if (!nD.id) {
this.BookingDetail = [] this.BookingDetail = []
this.bookingLogList = [] this.bookingLogList = []

@ -100,7 +100,7 @@
<span :class="{'active': btn.isChecked}">{{ enmuBookingBtn(btn.staCode) }}</span> <span :class="{'active': btn.isChecked}">{{ enmuBookingBtn(btn.staCode) }}</span>
</a-popover> </a-popover>
<span :class="{'active': btn.isChecked}" v-else>{{ enmuBookingBtn(btn.staCode) }}</span> <span :class="{'active': btn.isChecked}" v-else>{{ enmuBookingBtn(btn.staCode) }}</span>
<i class="iconfont icon-right-1-copy" :class="{'hide': bindex===row.bookstatus.length-1}"></i> <i class="iconfont icon-daoda" :class="{'hide': bindex===row.bookstatus.length-1}"></i>
</div> </div>
</div> </div>
</template> </template>

Loading…
Cancel
Save