Commit c76c885d authored by youjie's avatar youjie

no message

parent 117784f9
<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;width: 95%;">
<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-for="(item,daIn) in GetDetail.DetailList">
<tr class="addList1">
<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 v-if="GetDetail.CashierDetail&&GetDetail.CashierDetail.length&&(GetDetail.Type!=1|| GetDetail.Type!=5)">
<td height="34px" class="">{{$t('tips.jiaoyifangshi')}}</td>
<td height="34px" colspan="2" class="_color_b">
<template v-for="(item,index) in GetDetail.CashierDetail">
<p class=" clearfix"><span class="_bold">{{item.Alias}}-</span><span class="">{{item.TypeName}}-</span><span >{{item.AccountType==""?$t('fnc.no'):item.AccountType}}</span> {{item.BankNo?'-':''}} <span>{{item.BankNo}}</span>{{item.Money}}</p>
</template>
</td>
</tr>
</table>
</div>
</template>
<script>
export default {
props:["ID","width","color","isPrintPage","name","OrderSource","titleName"], //接收参数 ID width color
data(){
return{
detailCurrDis: false,
XSTC: false,
coinGetList: [],
GetCostTypeList:[],
orderObj: null,
allPrice: 0,
allPriceTo: '',
allPriceTocalc: '',
chinaAllPrice: this.$commonUtils.changeMoneyToChinese(this.allPrice),
detailList: {
ID: 0,
UnitPrice: '',
UnitPriceTo: '',
Number: '',
Rate: '',
CostTypeId: '',
CurrencyId: '',
Remark: '',
CostTypeName: '',
yTotalPrice: '',
yTotalPriceTo: '',
bTotalPrice: '',
bTotalPriceTo: '',
show: false,
},
SelectState: false,
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 arrList = function(arr){
arr.forEach(x=>{
x.show = false
})
}
arrList(data.DetailList)
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;
this.$emit('headCallBack', this.currentMoney);
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.Financial_post_GetCostTypeList(data.TemplateId, data.type);
if (id > 0) {
let TCID = data.TCIDList.length > 0 ? data.TCIDList[0] : 0
this.financeinfo_post_GetList(TCID);
}
}
}, err => {})
},
financeinfo_post_GetList(TCID) { // 获取币种
this.apipost('financeinfo_post_GetList', {
Name: '',
TCID: TCID,
StandCurrBranchId: this.GetDetail.RB_Branch_Id
}, res => {
if (res.data.resultCode == 1) {
this.coinGetList = res.data.data;
let numberC = 0;
let price = 0;
let rate = 0;
this.coinGetList.forEach(x => {
if (x.ID == this.detailList.CurrencyId) {
this.detailList.currenName = x.Name
// 台湾提成汇率
if (this.orderObj && this.orderObj.Rate) {
this.detailList.Rate = this.orderObj.Rate
} else {
this.detailList.Rate = x.Rate
}
}
this.GetDetail && this.GetDetail.DetailList && this.GetDetail.DetailList.forEach((item, i) => {
if (item.CurrencyId == x.ID) {
item.currenName = x.Name
item.Rate = x.Rate
}
price = parseFloat(item.UnitPrice);
rate = parseFloat(item.Rate);
if (price == 0) {
price = '';
item.UnitPrice = '';
}
if (numberC && price) {
item.UnitPriceTo = this.$commonUtils.addCommas(Math.round(price * 100) / 100)
item.yTotalPrice = numberC * price;
item.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(item.yTotalPrice * 100) /
100);
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
item.bTotalPrice = num;
item.bTotalPriceTo = this.$commonUtils.addCommas(num)
}
}
})
})
}
}, err => {})
},
Financial_post_GetCostTypeList(id, type) { //获取支出费用类型
this.apipost('Financial_post_GetCostTypeList', {
ID: id
}, res => {
if (res.data.resultCode == 1) {
this.GetCostTypeList = res.data.data;
if (type) {
this.GetDetail.detailList.forEach(x => {
this.GetCostTypeList.forEach(y => {
if (y.ID == x.CostTypeId) {
x.CostTypeName = y.Name;
}
})
})
}
}
}, 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,
immediate: true
},
ID:{
handler: function(val, oldVal) {
this.ID = val
this.Financial_post_GetDetail(this.ID)
},
deep: true
},
titleName: {
handler: function(val, oldVal) {
this.titleName = val
},
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