Commit 117784f9 authored by youjie's avatar youjie

no message

parent df0ffe7d
<style scoped>
@import '../../../assets/css/financia/editRate.css';
</style>
<template v-if="GetDetail.DetailList.length>0" >
<div class="Receipt_box" :class="[GetDetail.Type==1|| GetDetail.Type==5?'':'color_blur',isPrintPage?'_PrintPageStyle':'']" :style="{width:width,backgroundColor:color}" @click.stop v-loading='loading'>
<table class="Receipt_table" border="1" :class="[GetDetail.Type==1|| GetDetail.Type==5?'_border_color_r':'_border_color_b',isPrintPage?'_border_color_p':'']" :bordercolor="GetDetail.Type==1|| GetDetail.Type==5?'#c94052':'#106BAF'" style="border-collapse:collapse;">
<tr>
<th rowspan="2" width="150">{{$t('fnc.fyshuoming')}}</th>
<th rowspan="2" width="100">{{$t('hotel.hotel_Currency')}}</th>
<th colspan="3">{{$t('fnc.jine')}}
<template v-if="GetDetail.StandardCurrencyId>0">({{GetDetail.StandardCurrencyName}})</template>
</th>
</tr>
<tr>
<th width="88">{{$t('fnc.yuanbi')}}</th>
<th width="50">{{$t('hotel.hotel_CurrentRate')}}</th>
<th width="88">{{$t('fnc.bweibi')}}</th>
</tr>
<template v-if="GetDetail.DetailList&&GetDetail.DetailList.length!==0">
<tr v-for="(item,daIn) in GetDetail.DetailList" class="_color_b">
<td height="26px">{{item.CostTypeName}}</td>
<td height="26px">{{item.CurrencyName}}</td>
<td height="26px">{{item.OriginalMoney}}</td>
<td height="26px" style="padding: 0 5px;">
<el-input v-model="item.Rate" type="text"
class="w80 _border_b_1"
style="border-bottom: 1px solid #333;margin-bottom: 5px;"
@change="addList(item,daIn)"></el-input>
</td>
<td height="26px" style="position: relative;">{{item.Money}}
<span v-if="!daIn&&GetDetail.DetailList.length>1"
@click="copyRate(item.Rate)"
style="position: absolute;right: -45px;top: 10px;color: #33B3FF;cursor: pointer;">同下</span>
</td>
</tr>
</template>
<tr>
<td height="26px"></td>
<td height="26px"></td>
<td height="26px">{{currentMoney}}</td>
<td height="26px"></td>
<td height="26px">{{benMoney}}</td>
</tr>
<tr>
<td colspan="1">{{$t('fnc.shouxufei')}}<br/><span class="_font_size12">{{$t('fnc.khyuanbi')}}</span></td>
<td colspan="1" class="_font_size12" >{{GetDetail.OriginalFee}}</td>
<td colspan="1">{{$t('fnc.shouxufei')}}<br/><span class="_font_size12">{{$t('fnc.khbweibi')}}</span></td>
<td colspan="2" class="_font_size12">{{GetDetail.Fee}}</td>
</tr>
</table>
</div>
</template>
<script>
export default {
props:["ID","width","color","isPrintPage","name","Num","OrderSource","titleName"], //接收参数 ID width color isPrintPage
data(){
return{
loading: false,
EmployeeId:'',
EndDate:'',
StartDate:'',
printTime:'',
currentMoney:0,
benMoney:0,
GetDetail: {}
}
},
created(){
let date = new Date(),
y = date.getFullYear(),
m = date.getMonth() < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1,
d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(),
h = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
min = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.printTime = y + '' + m + '' + d + ' ' + h + ':' + min + ':' + s;
},
methods:{
copyRate(t){
for(let i = 0; i < this.GetDetail.DetailList.length; i++) {
if(this.GetDetail.DetailList[i].Rate!=t){
this.GetDetail.DetailList[i].Rate = t
}
if(i+1==this.GetDetail.DetailList.length){
this.calculation()
}
}
},
addList(t, i) { // 添加
t.Money = (t.Rate*100)* t.Money
t.Money = t.Money/100
this.calculation()
},
calculation(){
this.currentMoney = 0
this.benMoney = 0
this.GetDetail.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = (x.Rate*100)*x.OriginalMoney
x.Money = (x.Money/100).toFixed(2)
// x.Money = Math.round(x.Money * 100) / 100
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
this.benMoney += parseFloat(x.Money);
})
},
Financial_post_GetDetail(id){ //获取单据详情
if(!id) return;
this.loading = true;
this.apipost('Financial_post_GetDetail',{ID:id}, res => {
if(res.data.resultCode == 1) {
let data= res.data.data;
let numberC = 0;
let price = 0;
let rate = 0;
data.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100);
x.Money = Math.round(x.Money * 100) / 100;
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100;
this.currentMoney += parseFloat(x.OriginalMoney);
this.benMoney += parseFloat(x.Money);
})
this.currentMoney = Math.round(this.currentMoney * 100) / 100;
this.benMoney = Math.round(this.benMoney * 100) / 100;
let m = data.PayMoney?data.PayMoney:data.Money;
data.ChineseMoney = this.$commonUtils.changeMoneyToChinese(data.Money);
data.ChinesePayMoney = this.$commonUtils.changeMoneyToChinese(data.PayMoney)
data.PayMoney = this.$commonUtils.addCommas(Math.round(data.PayMoney * 100) / 100)
data.Money = this.$commonUtils.addCommas(Math.round(data.Money * 100) / 100);
data.AuditSteps.reverse();
this.GetDetail = data;
this.loading=false
this.$set(this.$data,"GetDetail",data);
}
}, err => {})
},
},
mounted(){
const myDate = new Date();
let yaer = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
let month = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月)
let dateS = myDate.getDate(); //获取当前日(1-31)
this.StartDate = yaer + '-' + month + '-' + '01';
this.EndDate = yaer + '-' + month + '-' + dateS;
let userInfo = this.getLocalStorage();
this.EmployeeId = userInfo.EmployeeId;
this.Financial_post_GetDetail(this.ID);
},
watch: { // 监听参数变化
GetDetail: {
handler: function(val, oldVal) {
this.$emit('getList',val)
},
deep: true
},
ID:{
handler: function(val, oldVal) {
this.ID = val
this.Financial_post_GetDetail(this.ID)
},
deep: true
},
num: {
handler: function(val, oldVal) {
},
deep: true
},
}
}
</script>
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