Commit 68d5c6bf authored by 黄奎's avatar 黄奎

人数汇率变更

parent dc9e4a58
......@@ -165,8 +165,8 @@
</template>
</font>
</template>
<!-- </br><a v-if="IsEdit==3" style="color:blue;cursor:pointer"
@click="showOfferChange(3,item,index)">{{$t('objFill.dayofferchange')}}</a> -->
<br /><a v-if="IsEdit==3" style="color:blue;cursor:pointer"
@click="showOfferChange(3,item,index)">{{$t('objFill.dayofferchange')}}</a>
</td>
<td :colspan="13-2-CostCurrencyList.length+1">
</td>
......@@ -185,9 +185,9 @@
</template>
</font>
</template>
<!-- <br/>
<a v-if="IsEdit==3" style="color:blue;cursor:pointer"
@click="showOfferChange(3,item,index)">{{$t('objFill.dayofferchange')}}</a> -->
<br />
<a v-if="IsEdit==3" style="color:blue;cursor:pointer"
@click="showOfferChange(3,item,index)">{{$t('objFill.dayofferchange')}}</a>
</td>
<td :colspan="13-2-CostNumberList.length+1">
</td>
......@@ -333,7 +333,6 @@
</font><br />
</template>
</template>
</td>
<td style="white-space:nowrap;">
<template v-if="subItem.BreakfastCostPrice>0||subItem.IsBreakfastChange">
......@@ -391,7 +390,9 @@
v-if="(childItem.TicketName&&childItem.TicketName!='')||(childItem.NewTicketName&&childItem.NewTicketName!='')">
<font>
{{childIndex+1}}
<font v-if="childItem.TicketName!=''" :style="(childItem.TicketCostPrice+childItem.NewTicketCostPrice==0)?'text-decoration: line-through;':''">{{childItem.TicketName}}</font>
<font v-if="childItem.TicketName!=''"
:style="(childItem.TicketCostPrice+childItem.NewTicketCostPrice==0)?'text-decoration: line-through;':''">
{{childItem.TicketName}}</font>
<font v-if="childItem.NewTicketName&&childItem.NewTicketName!=''" style="color:red;">
{{childItem.NewTicketName}}</font>
</font>
......@@ -463,7 +464,6 @@
<template v-else>
{{getDayChangeXiaoJi(1,1)}}
</template>
</font>
=<font style="color:red">{{Number(getDayXiaoJi(1,1))+Number(getDayChangeXiaoJi(1,1))}}</font>
</template>
......@@ -547,14 +547,17 @@
</template>
</template>
<template v-if="getRateChangeXiaoJi(1)!=0">
<template v-if="getRateChangeXiaoJi(1)>0">
+{{getRateChangeXiaoJi(1)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(1)}}
</template>
<el-tooltip content="汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getRateChangeXiaoJi(1)>0">
+{{getRateChangeXiaoJi(1)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(1)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
{{Number(getDayXiaoJi(1,2))+Number(getDayChangeXiaoJi(1,2))+Number(getRateChangeXiaoJi(1))}}</font>
......@@ -574,12 +577,16 @@
</template>
</template>
<template v-if="getRateChangeXiaoJi(2)!=0">
<template v-if="getRateChangeXiaoJi(2)>0">
+{{getRateChangeXiaoJi(2)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(2)}}
</template>
<el-tooltip content="汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getRateChangeXiaoJi(2)>0">
+{{getRateChangeXiaoJi(2)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(2)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -600,12 +607,16 @@
</template>
</template>
<template v-if="getRateChangeXiaoJi(4)!=0">
<template v-if="getRateChangeXiaoJi(4)>0">
+{{getRateChangeXiaoJi(4)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(4)}}
</template>
<el-tooltip content="汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getRateChangeXiaoJi(4)>0">
+{{getRateChangeXiaoJi(4)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(4)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -626,12 +637,16 @@
</template>
</template>
<template v-if="getRateChangeXiaoJi(3)!=0">
<template v-if="getRateChangeXiaoJi(3)>0">
+{{getRateChangeXiaoJi(3)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(3)}}
</template>
<el-tooltip content="汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getRateChangeXiaoJi(3)>0">
+{{getRateChangeXiaoJi(3)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(3)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -652,12 +667,16 @@
</template>
</template>
<template v-if="getRateChangeXiaoJi(9)!=0">
<template v-if="getRateChangeXiaoJi(9)>0">
+{{getRateChangeXiaoJi(9)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(9)}}
</template>
<el-tooltip content="汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getRateChangeXiaoJi(9)>0">
+{{getRateChangeXiaoJi(9)}}
</template>
<template v-else>
{{getRateChangeXiaoJi(9)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red;">
......@@ -770,7 +789,6 @@
<td colspan="2">
<el-form-item :label="$t('objFill.qitafeiyongsm')">
{{OtherPrice.OtherRemark}}
</el-form-item>
</td>
<td colspan="2" rowspan="2">
......@@ -1116,28 +1134,23 @@
</td>
<td style="white-space:nowrap;">
{{getLocalJpyTotalMoney(subItem.PeopleNumber)}}
<template
v-if="(getLocalJpyChangeTotalMoney(subItem.PeopleNumber)!=0||getPeopleNumJpyChangeTotalMoney(subItem))!=0">
<template v-if="(getLocalJpyChangeTotalMoney(subItem)!=0)!=0">
<font style="color:red;">
<template v-if="getLocalJpyChangeTotalMoney(subItem.PeopleNumber)!=0">
<template v-if="getLocalJpyChangeTotalMoney(subItem.PeopleNumber)>0">
+{{getLocalJpyChangeTotalMoney(subItem.PeopleNumber)}}
</template>
<template v-else>
{{getLocalJpyChangeTotalMoney(subItem.PeopleNumber)}}
</template>
</template>
<template v-if="getPeopleNumJpyChangeTotalMoney(subItem)!=0">
<template v-if="getPeopleNumJpyChangeTotalMoney(subItem)>0">
+{{getPeopleNumJpyChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumJpyChangeTotalMoney(subItem)}}
</template>
<template v-if="getLocalJpyChangeTotalMoney(subItem)!=0">
<el-tooltip content="地接费用变更金额">
<font>
<template v-if="getLocalJpyChangeTotalMoney(subItem)>0">
+{{getLocalJpyChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getLocalJpyChangeTotalMoney(subItem)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
{{(Number(getLocalJpyTotalMoney(subItem.PeopleNumber))+Number(getLocalJpyChangeTotalMoney(subItem.PeopleNumber))+Number(getPeopleNumJpyChangeTotalMoney(subItem))).toFixed(2)}}
{{(Number(getLocalJpyTotalMoney(subItem.PeopleNumber))+Number(getLocalJpyChangeTotalMoney(subItem))).toFixed(2)}}
</font>
</template>
</td>
......@@ -1156,12 +1169,16 @@
</template>
</template>
<template v-if="getPeopleNumberChangeTotalMoney(subItem)!=0">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<el-tooltip content="人数汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -1183,12 +1200,16 @@
</template>
</template>
<template v-if="getPeopleNumberChangeTotalMoney(subItem)!=0">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<el-tooltip content="人数汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -1210,12 +1231,16 @@
</template>
</template>
<template v-if="getPeopleNumberChangeTotalMoney(subItem)!=0">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<el-tooltip content="人数汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
</font>
</el-tooltip>
</template>
</font>
=<font style="color:red">
......@@ -1241,12 +1266,16 @@
</template>
</template>
<template v-if="getPeopleNumberChangeTotalMoney(subItem)!=0">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<el-tooltip content="人数汇率变更">
<font style="color:#ef5b9c;">
<template v-if="getPeopleNumberChangeTotalMoney(subItem)>0">
+{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
<template v-else>
{{getPeopleNumberChangeTotalMoney(subItem)}}
</template>
</font>
</el-tooltip>
</template>
<template v-if="getChangeCostTotalMoney()!=0">
<template v-if="getChangeCostTotalMoney()>0">
......@@ -1595,7 +1624,6 @@
this.changMsg.checkObj = item;
}
}
},
GetDayStr(dayNum) {
var str = "";
......@@ -1911,10 +1939,14 @@
return totalMoney.toFixed(2);
},
//获取地接项目变更金额
getLocalJpyChangeTotalMoney(PeopleNumber) {
getLocalJpyChangeTotalMoney(subItem) {
var PeopleNumber = subItem.PeopleNumber;
if (PeopleNumber <= 0) {
PeopleNumber = 1;
}
if (subItem.OtherChangeModel != null && subItem.OtherChangeModel.HotelChangeValue != 0) {
PeopleNumber += Number(subItem.OtherChangeModel.HotelChangeValue);
}
let totalMoney = 0.0;
var busFee = Number(this.getDayChangeXiaoJi(2, 1)) / PeopleNumber;
var hotelPrice = Number(this.getDayChangeXiaoJi(1, 1)); //酒店费用
......@@ -1924,21 +1956,6 @@
totalMoney = busFee + hotelPrice + sencePrice + canPrice + otherPrice;
return totalMoney.toFixed(2);
},
//地接成本(日元)
getPeopleNumJpyChangeTotalMoney(subItem) {
let totalMoney = 0.0;
var peopleNumber = Number(subItem.PeopleNumber);
if (subItem.OtherChangeModel != null && subItem.OtherChangeModel.HotelChangeValue != 0) {
peopleNumber += Number(subItem.OtherChangeModel.HotelChangeValue);
var busFee = Number(this.getDayXiaoJi(2, 1)) / peopleNumber;
var otherPrice = Number(this.getDayXiaoJi(9, 1)) / peopleNumber; //其它费用
totalMoney = busFee + otherPrice; //hotelPrice + sencePrice + canPrice +
if (subItem.OtherChangeModel.HotelChangeValue > 0) {
totalMoney = Number(totalMoney) * Number(-1);
}
}
return totalMoney.toFixed(2);
},
getPeopleNumberChangeTotalMoney(subItem) {
let totalMoney = 0.0;
//汇率的变更
......@@ -1955,8 +1972,7 @@
//人数的变更
if (subItem.OtherChangeModel != null && subItem.OtherChangeModel.HotelChangeValue != 0) {
peopleNumber += Number(subItem.OtherChangeModel.HotelChangeValue);
// console.log(peopleNumber, "otherPrice", this.getRateChangeXiaoJi(9));
// console.log(peopleNumber, "busFee", this.getRateChangeXiaoJi(2));
if (subItem.OtherChangeModel.HotelChangeValue > 0) {
totalMoney -= Number(this.getRateChangeXiaoJi(9)) / Number(peopleNumber); //其它费用
totalMoney -= Number(this.getRateChangeXiaoJi(2)) / Number(peopleNumber); //车费
......
......@@ -48,35 +48,32 @@
<template>
<div class="changeOffer">
<div>
<table class="changeOfferTable" >
<table class="changeOfferTable">
<tr>
<td style="width:105px;" class="CP_ComTitle2 CostcomCenter">币种</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">汇率</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">汇率变更值</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">汇率变更值</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">人数</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">人数变更值</td>
<td style="width:500px;" class="CP_ComTitle2 CostcomCenter">变更备注</td>
<td style="width:100px;" class="CP_ComTitle2 CostcomCenter">
<a style="color:blue;cursor:pointer;" @click="AddOfferObj()" v-show="dataList.length<costCurrencyList.length">添加</a>
<a style="color:blue;cursor:pointer;" @click="AddOfferObj()"
v-show="dataList.length<costCurrencyList.length">添加</a>
</td>
</tr>
<tbody>
<tr v-for="(item,index) in dataList" :key="index">
<tr v-for="(item,index) in dataList" :key="index">
<td>
<el-select v-model="item.CurrencyId" filterable @change="handleCheckChange(index,item)" placeholder="请选择">
<!-- <el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option> -->
<el-option
v-for="item in costCurrencyList"
:key="item.CurrencyId"
:label="item.CurrencyName"
<el-select v-model="item.CurrencyId" filterable @change="handleCheckChange(index,item)" placeholder="请选择">
<el-option v-for="item in costCurrencyList" :key="item.CurrencyId" :label="item.CurrencyName"
:value="item.CurrencyId">
</el-option>
</el-select>
</el-select>
</td>
<td>
{{ item.ExchangeRate}}
</td>
<td>
<td>
<el-input v-model="item.NewExchangeRate" style="width:100px;" max="6"></el-input>
</td>
<td>
......@@ -89,7 +86,7 @@
<el-input placeholder="请输入内容" v-model="item.ChangeRemarks" class="input-with-select">
</el-input>
</td>
<td>
<td>
<a style="color:red;cursor:pointer;" @click="DeleteOfferChange(item,index)">删除</a>
</td>
</tr>
......@@ -104,35 +101,17 @@
</template>
<script>
export default {
props: ["OfferCurrency","costNumberList","costCurrencyList"],
props: ["OfferCurrency", "costNumberList", "costCurrencyList"],
data() {
return {
loading: false,
dataList: [],
datas: {
ChangeId:0,
OfferId:0,
EidtType:3,
DayNum:0,
ChangeType:8,
ChangeValue:0,
ChangeRemarks:"",
OldPrice:0,
DJPrice:0,
CostId:0,
PeopleNumber:0,
ExchangeRate:0,
CurrencyId:'',
NewExchangeRate:0,
NewPeopleNumber:0,
},
dataList: [],
};
},
watch:{
},
watch: {},
methods: {
handleCheckChange(index,nowItem) {
var flag = false;
handleCheckChange(index, nowItem) {
var flag = false;
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach((qitem, qIndex) => {
if (!flag && qIndex != index) {
......@@ -145,63 +124,60 @@
if (flag) {
this.Error("已存在此项币种,请选择其他变更币种!");
nowItem.CurrencyId = '';
return ;
return;
}
if (this.costCurrencyList != null && this.costCurrencyList.length > 0) {
var typeIndex=this.dataList[index];
var costCurrency = this.costCurrencyList.find(item=>item.CurrencyId==typeIndex.CurrencyId);//币种信息
var typeIndex = this.dataList[index];
var costCurrency = this.costCurrencyList.find(item => item.CurrencyId == typeIndex.CurrencyId); //币种信息
//查找人数信息
var costNumber={};
if(this.costNumberList.length>index){
costNumber=this.costNumberList[index];
var costNumber = {};
if (this.costNumberList.length > index) {
costNumber = this.costNumberList[index];
} else {
costNumber = this.costNumberList[0];
}
else{
costNumber=this.costNumberList[0];
}
// 使用find方法查找value为3的对象
let hasCurrencyId = this.dataList.findIndex(item => item.CurrencyId === nowItem.CurrencyId)
// 使用find方法查找value为3的对象
let hasCurrencyId = this.dataList.findIndex(item => item.CurrencyId === nowItem.CurrencyId)
const nowData = this.dataList[hasCurrencyId];
// 创建深拷贝(避免引用问题)
const newData = JSON.parse(JSON.stringify(nowData));
newData.PeopleNumber=costNumber.PeopleNumber;
newData.CostId=costNumber.Id;
newData.NewPeopleNumber=Number(0) - Number(newData.PeopleNumber);//costNumber.PeopleNumber;
newData.ExchangeRate=costCurrency.ExchangeRate;
newData.NewExchangeRate=Number(0) - Number(newData.ExchangeRate);//costCurrency.ExchangeRate;
newData.ChangeRemarks="";
console.log("newData",newData);
// 替换原对象
newData.PeopleNumber = costNumber.PeopleNumber;
newData.CostId = costNumber.Id;
newData.NewPeopleNumber = 0; //costNumber.PeopleNumber;
newData.ExchangeRate = costCurrency.ExchangeRate;
newData.NewExchangeRate = 0; //costCurrency.ExchangeRate;
newData.ChangeRemarks = "人数/汇率变更";
// 替换原对象
this.$set(this.dataList, hasCurrencyId, newData);
this.getOfferChange();
}
},
AddOfferObj() {
var obj = {
ChangeId:0,
OfferId:0,
EidtType:3,
DayNum:0,
ChangeType:8,
ChangeValue:0,
ChangeRemarks:"",
OldPrice:0,
DJPrice:0,
CostId:0,
PeopleNumber:0,
ExchangeRate:0,
CurrencyId:'',
NewExchangeRate:0,
NewPeopleNumber:0,
}
obj.OfferId = this.OfferCurrency.OfferId;
obj.EidtType = this.OfferCurrency.EditType;
if(this.dataList.length<this.costCurrencyList.length){
this.dataList.push(obj);
}
},
//删除报价单变更项
AddOfferObj() {
var obj = {
ChangeId: 0,
OfferId: 0,
EidtType: 3,
DayNum: 0,
ChangeType: 8,
ChangeValue: 0,
ChangeRemarks: "人数/汇率变更",
OldPrice: 0,
DJPrice: 0,
CostId: 0,
PeopleNumber: 0,
ExchangeRate: 0,
CurrencyId: '',
NewExchangeRate: 0,
NewPeopleNumber: 0,
}
obj.OfferId = this.OfferCurrency.OfferId;
obj.EidtType = this.OfferCurrency.EditType;
if (this.dataList.length < this.costCurrencyList.length) {
this.dataList.push(obj);
}
},
//删除报价单变更项
DeleteOfferChange(item, index) {
var that = this;
this.Confirm('是否要删除此项变更内容?', function () {
......@@ -221,8 +197,8 @@
// }
// );
// } else {
that.dataList.splice(index, 1);
// }
that.dataList.splice(index, 1);
// }
})
},
//关闭弹窗
......@@ -231,74 +207,71 @@
},
//向父组件传递选中酒店
saveOfferChange() {
var tempMsg=[];
var changeList=[];
if( this.dataList!=null&& this.dataList.length>0){
this.dataList.forEach(item => {
if(item.CurrencyId!=""&& item.CurrencyId>0){
changeList.push( {
CurrencyId:item.CurrencyId,
OfferId:item.OfferId,
CostId:item.CostId,
PeopleNumber:item.NewPeopleNumber,
ExchangeRate:item.NewExchangeRate,
ChangeRemarks:item.ChangeRemarks, });
}
});
if(changeList==null||changeList.length==0){
this.Error("请选择变更类型");
return;
}
tempMsg.push({
ChangeId:this.dataList[0].ChangeId,
OfferId:this.dataList[0].OfferId,
EidtType:this.dataList[0].EidtType,
DayNum:0,
ChangeType:this.dataList[0].ChangeType,
ChangeValue:0,
ChangeRemarks:'',
OldPrice:0,
DJPrice:0,
ChangeContent:JSON.stringify(changeList),
HotelList:[]
var tempMsg = [];
var changeList = [];
if (this.dataList != null && this.dataList.length > 0) {
this.dataList.forEach(item => {
if (item.CurrencyId != "" && item.CurrencyId > 0) {
changeList.push({
CurrencyId: item.CurrencyId,
OfferId: item.OfferId,
CostId: item.CostId,
PeopleNumber: item.NewPeopleNumber,
ExchangeRate: item.NewExchangeRate,
ChangeRemarks: item.ChangeRemarks,
});
}
});
this.apipost("travel_post_SetChangeOffer", tempMsg, res => {
if (res.data.resultCode == 1) {
this.getOfferChange()
this.Success(res.data.message);
this.$emit("success", 1);
} else {
this.Error(res.data.message);
}
});
}
else{
var searchParmeters = {
EidtType: 0,
OfferId: 0,
DayNum: 0,
};
searchParmeters.OfferId = this.OfferCurrency.OfferId;
searchParmeters.EidtType = this.OfferCurrency.EditType;
searchParmeters.DayNum = 0;
this.apipost(
"travel_post_RemoveChangeOfferByEidtType", searchParmeters,
res => {
if (res.data.resultCode == 1) {
this.getOfferChange()
this.Success(res.data.message);
this.$emit("success", 1);
} else {
this.Error(that.$t('objFill.v101.hote.shanchusb'));
}
if (changeList == null || changeList.length == 0) {
this.Error("请选择变更类型");
return;
}
tempMsg.push({
ChangeId: this.dataList[0].ChangeId,
OfferId: this.dataList[0].OfferId,
EidtType: this.dataList[0].EidtType,
DayNum: 0,
ChangeType: this.dataList[0].ChangeType,
ChangeValue: 0,
ChangeRemarks: '人数/汇率变更',
OldPrice: 0,
DJPrice: 0,
ChangeContent: JSON.stringify(changeList),
HotelList: []
});
this.apipost("travel_post_SetChangeOffer", tempMsg, res => {
if (res.data.resultCode == 1) {
this.getOfferChange()
this.Success(res.data.message);
this.$emit("success", 1);
} else {
this.Error(res.data.message);
}
});
} else {
var searchParmeters = {
EidtType: 0,
OfferId: 0,
DayNum: 0,
};
searchParmeters.OfferId = this.OfferCurrency.OfferId;
searchParmeters.EidtType = this.OfferCurrency.EditType;
searchParmeters.DayNum = 0;
this.apipost(
"travel_post_RemoveChangeOfferByEidtType", searchParmeters,
res => {
if (res.data.resultCode == 1) {
this.getOfferChange()
this.Success(res.data.message);
this.$emit("success", 1);
} else {
this.Error(that.$t('objFill.v101.hote.shanchusb'));
}
);
}
}
);
}
},
//查询价格变更信息
//查询价格变更信息
getOfferChange() {
this.loading = true;
var searchParmeters = {
......@@ -313,71 +286,67 @@
this.loading = false;
if (res.data.resultCode == 1) {
var tempArray = res.data.data;
if(tempArray!=null&&tempArray.length>0){
tempArray.forEach(item => {
var ChangeContentList= JSON.parse(item.ChangeContent);
ChangeContentList.forEach(ChangeContentModel => {
let hasCurrencyId = this.dataList.findIndex(itemd => itemd.CurrencyId === ChangeContentModel.CurrencyId)
console.log("hasCurrencyId",hasCurrencyId);
if(hasCurrencyId!=-1){
const nowData = this.dataList[hasCurrencyId];
// 创建深拷贝(避免引用问题)
const newData = JSON.parse(JSON.stringify(nowData));
newData.NewPeopleNumber=ChangeContentModel.PeopleNumber;
newData.NewExchangeRate=ChangeContentModel.ExchangeRate;
newData.ChangeRemarks=ChangeContentModel.ChangeRemarks;
newData.ChangeId=item.ChangeId;
newData.CostId=ChangeContentModel.CostId;
// 替换原对象
this.$set(this.dataList, hasCurrencyId, newData);
}
else{
var obj = {
ChangeId:item.ChangeId,
OfferId:0,
EidtType:3,
DayNum:0,
ChangeType:8,
ChangeValue:0,
ChangeRemarks:ChangeContentModel.ChangeRemarks,
OldPrice:0,
DJPrice:0,
CostId:ChangeContentModel.CostId,
PeopleNumber:0,
ExchangeRate:0,
CurrencyId:ChangeContentModel.CurrencyId,
NewExchangeRate:ChangeContentModel.ExchangeRate,
NewPeopleNumber:ChangeContentModel.PeopleNumber,
}
let hasOCurrencyId = this.costCurrencyList.findIndex(item => item.CurrencyId === ChangeContentModel.CurrencyId)
obj.ExchangeRate=this.costCurrencyList[hasOCurrencyId].ExchangeRate;
//查找人数信息
var costNumber={};
if(this.costNumberList.length>hasOCurrencyId){
costNumber=this.costNumberList[hasOCurrencyId];
}
else{
costNumber=this.costNumberList[0];
}
obj.PeopleNumber=costNumber.PeopleNumber;
obj.OfferId = this.OfferCurrency.OfferId;
obj.EidtType = this.OfferCurrency.EditType;
this.dataList.push(obj);
}
});
});
if (tempArray != null && tempArray.length > 0) {
tempArray.forEach(item => {
var ChangeContentList = JSON.parse(item.ChangeContent);
ChangeContentList.forEach(ChangeContentModel => {
let hasCurrencyId = this.dataList.findIndex(itemd => itemd.CurrencyId ===
ChangeContentModel.CurrencyId)
if (hasCurrencyId != -1) {
const nowData = this.dataList[hasCurrencyId];
// 创建深拷贝(避免引用问题)
const newData = JSON.parse(JSON.stringify(nowData));
newData.NewPeopleNumber = ChangeContentModel.PeopleNumber;
newData.NewExchangeRate = ChangeContentModel.ExchangeRate;
newData.ChangeRemarks = ChangeContentModel.ChangeRemarks;
newData.ChangeId = item.ChangeId;
newData.CostId = ChangeContentModel.CostId;
// 替换原对象
this.$set(this.dataList, hasCurrencyId, newData);
} else {
var obj = {
ChangeId: item.ChangeId,
OfferId: 0,
EidtType: 3,
DayNum: 0,
ChangeType: 8,
ChangeValue: 0,
ChangeRemarks: ChangeContentModel.ChangeRemarks,
OldPrice: 0,
DJPrice: 0,
CostId: ChangeContentModel.CostId,
PeopleNumber: 0,
ExchangeRate: 0,
CurrencyId: ChangeContentModel.CurrencyId,
NewExchangeRate: ChangeContentModel.ExchangeRate,
NewPeopleNumber: ChangeContentModel.PeopleNumber,
}
let hasOCurrencyId = this.costCurrencyList.findIndex(item => item.CurrencyId ===
ChangeContentModel.CurrencyId)
obj.ExchangeRate = this.costCurrencyList[hasOCurrencyId].ExchangeRate;
//查找人数信息
var costNumber = {};
if (this.costNumberList.length > hasOCurrencyId) {
costNumber = this.costNumberList[hasOCurrencyId];
} else {
costNumber = this.costNumberList[0];
}
obj.PeopleNumber = costNumber.PeopleNumber;
obj.OfferId = this.OfferCurrency.OfferId;
obj.EidtType = this.OfferCurrency.EditType;
this.dataList.push(obj);
}
});
});
}
}
});
},
},
created() {
},
mounted() {
this.getOfferChange();
......
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