修改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) { %>
<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仔百度收录 -->
<meta name="baidu-site-verification" content="code-QVfBYJ5laQ" />
</head>

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

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

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

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

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

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

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

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

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

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

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

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

@ -100,7 +100,7 @@
<span :class="{'active': btn.isChecked}">{{ enmuBookingBtn(btn.staCode) }}</span>
</a-popover>
<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>
</template>

Loading…
Cancel
Save