Commit 55b84043 authored by 黄奎's avatar 黄奎

11

parent e6c47cd4
......@@ -174,8 +174,8 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UnitPrice" @input="handleInput($event, item, 'UnitPrice')"
@blur="handleBlur(item, 'UnitPrice')" />
<input class="text-right" type="number" v-model="item.UnitPrice"
@input="handleInput($event, item, 'UnitPrice')" @blur="handleBlur(item, 'UnitPrice')" />
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -247,10 +247,17 @@
}
},
watch: {
dataIndex1: {
data: {
handler(newVal, oldVal) {
if (oldVal != newVal) {
this.initData()
console.log("newVal", newVal);
if (oldVal.dataIndex1 != newVal.dataIndex1) {
this.initData();
} else {
var newCrrId = newVal.BusList[this.dataIndex1].ReimburseList.CurrencyId;
var oldCurrId = oldVal.BusList[this.dataIndex1].ReimburseList.CurrencyId;
if (newCrrId != oldCurrId) {
this.initData();
}
}
},
deep: true,
......@@ -264,19 +271,17 @@
// 在模板中的使用示例
handleInput(e, item, field) {
const value = e.detail.value;
console.log("handleInput",value)
const validValue = this.$utils.checkInteger(value,true);
const validValue = this.$utils.checkInteger(value, true);
// 更新数据
item[field] = validValue;
// 触发其他逻辑(如计算)
this.getTotal();
},
handleBlur(item, field) {
console.log("handleBlur",item[field])
const formattedValue = this.$utils.checkPrice(item[field],true);
const formattedValue = this.$utils.checkPrice(item[field], true);
// 更新数据
item[field] = formattedValue;
this.$set(item,field,formattedValue);
this.$set(item, field, formattedValue);
// 触发其他逻辑
this.getTotal();
},
......@@ -291,6 +296,7 @@
},
getTotal() {
let total = 0;
this.datas.ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
......
......@@ -229,7 +229,13 @@
optionVisible: false,
optionObj: {},
params: {},
datas: null, //展示数据
datas: {
HotelOrderList: [{
ReimburseList: {
ReimburseDetailsList: [],
}
}],
}, //展示数据
dataIndex: 0,
ReimIndex: 0,
ReimDatas: {},
......@@ -237,7 +243,6 @@
}
},
watch: {
data: {
handler(newVal, oldVal) {
if (newVal && oldVal) {
......@@ -250,6 +255,16 @@
this.dataIndex2]
.hotelIndex) {
this.initData();
} //判断币种是否切换
else {
var newindex = oldVal.HotelOrderListReport[this.dataIndex2].hotelIndex;
var oldCrrId = oldVal.HotelOrderListReport[this.dataIndex2].HotelOrderList[newindex]
.CurrencyId;
var newCrrid = newVal.HotelOrderListReport[this.dataIndex2].HotelOrderList[newindex]
.CurrencyId;
if (oldCrrId != newCrrid) {
this.initData();
}
}
}
},
......@@ -265,7 +280,9 @@
this.params = JSON.parse(JSON.stringify(this.data))
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团
this.dataIndex = this.dataIndex2;
this.getRenderingData()
this.datas = this.HotelOrderListReport[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList
.ReimburseDetailsList[0]))
this.getTotal()
},
getNum() {
......@@ -273,10 +290,13 @@
},
getTotal() {
let total = 0
if (this.datas && this.datas.HotelOrderList && this.datas.HotelOrderList.length > 0 && this.datas
.HotelOrderList[this.datas.hotelIndex].ReimburseList) {
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
this.datas.HotelOrderList[this.datas.hotelIndex].TotalMoney = total;
}
this.updateData()
},
delInfor(index) {
......@@ -296,12 +316,7 @@
this.params.HotelOrderListReport = JSON.parse(JSON.stringify(this.HotelOrderListReport))
this.$emit('change', this.params)
},
// 酒店
getRenderingData() {
this.datas = this.HotelOrderListReport[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList
.ReimburseDetailsList[0]))
},
showOptionVisible(index) {
this.optionVisible = true
this.ReimIndex = index
......
......@@ -242,6 +242,7 @@
data: {
handler(newVal, oldVal) {
if (newVal && oldVal) {
//切换用餐日期
if (newVal.dataIndex3 != oldVal.dataIndex3) {
this.initData();
......@@ -250,6 +251,15 @@
else if (oldVal.DiningList[this.dataIndex3].diningIndex != newVal.DiningList[this.dataIndex3]
.diningIndex) {
this.initData();
} else {
var newindex = oldVal.DiningList[this.dataIndex3].diningIndex;
var oldCrrId = oldVal.DiningList[this.dataIndex3].DiningSummaryList[newindex].ReimburseList
.CurrencyId;
var newCrrid = newVal.DiningList[this.dataIndex3].DiningSummaryList[newindex].ReimburseList
.CurrencyId;
if (oldCrrId != newCrrid) {
this.initData();
}
}
}
},
......
......@@ -249,6 +249,16 @@
.scenicIndex) {
this.initData();
}
else {
var newindex = oldVal.ScenicList[this.dataIndex4].scenicIndex;
var oldCrrId = oldVal.ScenicList[this.dataIndex4].ScenicStatisticsList[newindex].ReimburseList
.CurrencyId;
var newCrrid = newVal.ScenicList[this.dataIndex4].ScenicStatisticsList[newindex].ReimburseList
.CurrencyId;
if (oldCrrId != newCrrid) {
this.initData();
}
}
}
},
deep: true,
......
......@@ -620,7 +620,6 @@
});
}
});
console.log("this.params.HotelOrderListReport", this.params.HotelOrderListReport)
}
if (this.params && this.params.DiningList && this.params.DiningList.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment