修改传参 + 收发通

dev
lilu 2 years ago
parent 2b86717918
commit 1a60671db2

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

@ -65,7 +65,6 @@ export default {
data() {
return {
showKey: ['1']
moreIndex: 0
}
},
watch: {

@ -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()
}
},
}

@ -57,7 +57,7 @@
</div>
</template>
</vxe-toolbar>
<vxe-grid ref="xGrid" v-bind="gridOptions" @page-change="handlePageChange" @cell-dblclick="editColumns">
<vxe-grid ref="xGrid" v-bind="gridOptions" @page-change="handlePageChange" @cell-dblclick="handledbclick">
<template #operate="{ row }">
<vxe-button type="text" icon="vxe-icon-edit" @click="editColumns(row)"></vxe-button>
</template>
@ -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 } })

Loading…
Cancel
Save