From 1a60671db2826bd0a3a9abed0ed06b0c0419f0c3 Mon Sep 17 00:00:00 2001 From: lilu Date: Wed, 23 Nov 2022 12:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=A0=E5=8F=82=20+=20?= =?UTF-8?q?=E6=94=B6=E5=8F=91=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/BookingLedger/detail/index.vue | 15 ++++++-- .../detail/modules/cargoInfo.vue | 1 - .../detail/modules/mailingInfo.vue | 35 ++++++++++++++++++- src/views/main/BookingLedger/list/index.vue | 5 ++- 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 6f0f1c6..32f7f1c 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -82,22 +82,28 @@ export default { }, excuteRules: [], isAdd: false, - moreStr: '' + moreStr: '', } }, watch: { bookingDetails: { handler (nval, oval) { - console.log('父级 -- 数据改变', nval) + // console.log('父级 -- 数据改变', nval) }, deep: true }, - '$route': 'init' + '$route': 'routerChange' }, created() { this.init() }, methods: { + routerChange () { + console.log('路由变化') + this.id = this.$route.query.id + this.type = this.$route.query.type + this.init() + }, init() { this.bookingDetails = {} if (this.id) { @@ -228,6 +234,9 @@ export default { }, getDetail() { + if (this.inPageLoading) { + return false + } this.inPageLoading = true this.$message.loading({ content: '加载中...' }); BookingOrderGet({ diff --git a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue index 858faf4..9ac5e97 100644 --- a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue @@ -65,7 +65,6 @@ export default { data() { return { showKey: ['1'] - moreIndex: 0 } }, watch: { diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index 422e071..ec3dc27 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -1062,7 +1062,7 @@ export default { this.modelName = '' }, - changeCode(num, type) { + changeCodeRemove(num, type) { const newStr = this.details[type].replace(/\n|\r/g, '') console.log(newStr) const indexs = [] @@ -1177,6 +1177,39 @@ export default { this.details[field] = str1 this.$emit('spliceMore', strStar + str2) } + }, + + changeCode (len, type) { + const value = this.details[type] + var textArr = value.match(/.+[\n]*/g); // 按行匹配 + var subValue = ""; + + for (var j = 0; j < textArr.length; j++) { + var subArr = textArr[j].match(/[\w]+[ ]*[\n]*|[\d]+[ ]*[\n]*|[^\w\d]+[ ]*[\n]*/g); + var count = 0; + for (var i = 0; i < subArr.length; i++) { + count += subArr[i].replace(/\n/g, "").length; + while (count > len) { + subValue += "\n"; + count = subArr[i].replace(/\n/g, "").length; + if (count > len) { + subValue += subArr[i].substring(0, len); + subValue += "\n"; + subArr[i] = subArr[i].substring(len); + count = subArr[i].replace(/\n/g, "").length; + } + } + subValue += subArr[i]; + } + if (j + 1 < textArr.length) + {subValue += "\n";} + } + subValue = subValue.replace(/[\n]+/g, "\n"); // 多个换行变为一个换行 + subValue = subValue.replace(/[ ]+[\n]+/g, '\n'); // 去除每行末尾空格 + subValue = subValue.replace(/[ ]+$/g, ''); // 去除末行空格 + + this.details[type] = subValue + this.$forceUpdate() } }, } diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 2946dc5..30757f9 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -57,7 +57,7 @@ - + @@ -371,6 +371,9 @@ export default { console.log('=新的clomn=', this.columns) this.$forceUpdate() }, + handledbclick ({row}) { + this.editColumns(row) + }, editColumns(row) { console.log(row) this.$router.push({ name: 'BookingDetail', query: { id: row.id, type: row.carrierid } })