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

11

parent e6c47cd4
...@@ -174,8 +174,8 @@ ...@@ -174,8 +174,8 @@
<text>金额</text> <text>金额</text>
</view> </view>
<view class="inputBoxRight"> <view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UnitPrice" @input="handleInput($event, item, 'UnitPrice')" <input class="text-right" type="number" v-model="item.UnitPrice"
@blur="handleBlur(item, 'UnitPrice')" /> @input="handleInput($event, item, 'UnitPrice')" @blur="handleBlur(item, 'UnitPrice')" />
</view> </view>
</view> </view>
<view class="inputBox row justify-between noBorder"> <view class="inputBox row justify-between noBorder">
...@@ -247,10 +247,17 @@ ...@@ -247,10 +247,17 @@
} }
}, },
watch: { watch: {
dataIndex1: { data: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (oldVal != newVal) { console.log("newVal", newVal);
this.initData() 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, deep: true,
...@@ -264,19 +271,17 @@ ...@@ -264,19 +271,17 @@
// 在模板中的使用示例 // 在模板中的使用示例
handleInput(e, item, field) { handleInput(e, item, field) {
const value = e.detail.value; 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; item[field] = validValue;
// 触发其他逻辑(如计算) // 触发其他逻辑(如计算)
this.getTotal(); this.getTotal();
}, },
handleBlur(item, field) { 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; item[field] = formattedValue;
this.$set(item,field,formattedValue); this.$set(item, field, formattedValue);
// 触发其他逻辑 // 触发其他逻辑
this.getTotal(); this.getTotal();
}, },
...@@ -291,6 +296,7 @@ ...@@ -291,6 +296,7 @@
}, },
getTotal() { getTotal() {
let total = 0; let total = 0;
this.datas.ReimburseList.ReimburseDetailsList.forEach(x => { this.datas.ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice total += x.UserNum * x.UnitPrice
}) })
......
...@@ -229,7 +229,13 @@ ...@@ -229,7 +229,13 @@
optionVisible: false, optionVisible: false,
optionObj: {}, optionObj: {},
params: {}, params: {},
datas: null, //展示数据 datas: {
HotelOrderList: [{
ReimburseList: {
ReimburseDetailsList: [],
}
}],
}, //展示数据
dataIndex: 0, dataIndex: 0,
ReimIndex: 0, ReimIndex: 0,
ReimDatas: {}, ReimDatas: {},
...@@ -237,7 +243,6 @@ ...@@ -237,7 +243,6 @@
} }
}, },
watch: { watch: {
data: { data: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal && oldVal) { if (newVal && oldVal) {
...@@ -250,6 +255,16 @@ ...@@ -250,6 +255,16 @@
this.dataIndex2] this.dataIndex2]
.hotelIndex) { .hotelIndex) {
this.initData(); 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 @@ ...@@ -265,7 +280,9 @@
this.params = JSON.parse(JSON.stringify(this.data)) this.params = JSON.parse(JSON.stringify(this.data))
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团 this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团
this.dataIndex = this.dataIndex2; 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() this.getTotal()
}, },
getNum() { getNum() {
...@@ -273,10 +290,13 @@ ...@@ -273,10 +290,13 @@
}, },
getTotal() { getTotal() {
let total = 0 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 => { this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice total += x.UserNum * x.UnitPrice
}) })
this.datas.HotelOrderList[this.datas.hotelIndex].TotalMoney = total; this.datas.HotelOrderList[this.datas.hotelIndex].TotalMoney = total;
}
this.updateData() this.updateData()
}, },
delInfor(index) { delInfor(index) {
...@@ -296,12 +316,7 @@ ...@@ -296,12 +316,7 @@
this.params.HotelOrderListReport = JSON.parse(JSON.stringify(this.HotelOrderListReport)) this.params.HotelOrderListReport = JSON.parse(JSON.stringify(this.HotelOrderListReport))
this.$emit('change', this.params) 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) { showOptionVisible(index) {
this.optionVisible = true this.optionVisible = true
this.ReimIndex = index this.ReimIndex = index
......
...@@ -242,6 +242,7 @@ ...@@ -242,6 +242,7 @@
data: { data: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal && oldVal) { if (newVal && oldVal) {
//切换用餐日期 //切换用餐日期
if (newVal.dataIndex3 != oldVal.dataIndex3) { if (newVal.dataIndex3 != oldVal.dataIndex3) {
this.initData(); this.initData();
...@@ -250,6 +251,15 @@ ...@@ -250,6 +251,15 @@
else if (oldVal.DiningList[this.dataIndex3].diningIndex != newVal.DiningList[this.dataIndex3] else if (oldVal.DiningList[this.dataIndex3].diningIndex != newVal.DiningList[this.dataIndex3]
.diningIndex) { .diningIndex) {
this.initData(); 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 @@ ...@@ -249,6 +249,16 @@
.scenicIndex) { .scenicIndex) {
this.initData(); 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, deep: true,
......
...@@ -620,7 +620,6 @@ ...@@ -620,7 +620,6 @@
}); });
} }
}); });
console.log("this.params.HotelOrderListReport", this.params.HotelOrderListReport)
} }
if (this.params && this.params.DiningList && this.params.DiningList.length > 0) { 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