Commit afaff852 authored by 我在何方's avatar 我在何方

收款单货币bug

parent 35b9e1e1
This diff is collapsed.
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<p style="margin: 0;word-break: break-all;">A/C NO{{bankTiem.platformAccountNo}}</p> <p style="margin: 0;word-break: break-all;">A/C NO{{bankTiem.platformAccountNo}}</p>
</div> </div>
<div style="padding:6px 0;width: 87.5%;text-align: center;"> <div style="padding:6px 0;width: 87.5%;text-align: center;">
<p style="margin: 0;">应收<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="bankTiem.currencyId" />¥{{bankTiem.receivableAmount}}</p> <p style="margin: 0;">应收<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="bankTiem.currencyId" />{{bankTiem.receivableAmount}}¥</p>
<!-- <p style="margin: 0;">未收:¥{{bankTiem.noReceipt}}</p> --> <!-- <p style="margin: 0;">未收:¥{{bankTiem.noReceipt}}</p> -->
</div> </div>
</div> </div>
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
getOrder(orderId).then(response => { getOrder(orderId).then(response => {
this.orderData = response.data this.orderData = response.data
}); });
}, },
print(){ print(){
lodop().then(LODOP => { lodop().then(LODOP => {
LODOP.PRINT_INIT(); LODOP.PRINT_INIT();
......
...@@ -192,7 +192,8 @@ ...@@ -192,7 +192,8 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款币种')" align="center"> <el-table-column :label="$t('期望收款币种')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.collectionCurrencyId" /> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.collectionCurrencyId" /> -->
{{getCurrencyLabel(scope.row.collectionCurrencyId)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款汇率')" align="center"> <el-table-column :label="$t('期望收款汇率')" align="center">
...@@ -324,9 +325,22 @@ ...@@ -324,9 +325,22 @@
prop="currencyId" prop="currencyId"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('币种不能为空') }" :rules="{ required: true, trigger: ['blur', 'change'], message: $t('币种不能为空') }"
> >
<dict-selector v-if="!isView" :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" @change="val => currencyIdChange(val)"/> <el-select
v-model="addForm.currencyId"
:placeholder="$t('请选择')"
:disabled="isView"
@change="val => currencyIdChange(val)"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="item.titleZh"
:value="item.id"
/>
</el-select>
<!-- <dict-selector v-if="!isView" :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" @change="val => currencyIdChange(val)"/> -->
<!-- <span v-else>{{ addForm.currencyId }}</span> --> <!-- <span v-else>{{ addForm.currencyId }}</span> -->
<dict-tag v-else :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="addForm.currencyId" /> <!-- <dict-tag v-else :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="addForm.currencyId" /> -->
</el-form-item> </el-form-item>
</div> </div>
<el-form-item <el-form-item
...@@ -533,10 +547,10 @@ export default { ...@@ -533,10 +547,10 @@ export default {
const dollarList = res.data.filter(v => v.collectionCurrencyId == 1) const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const rmbList = res.data.filter(v => v.collectionCurrencyId == 2) const rmbList = res.data.filter(v => v.collectionCurrencyId == 3)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const nairaList = res.data.filter(v => v.collectionCurrencyId == 3) const nairaList = res.data.filter(v => v.collectionCurrencyId == 2)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira] res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
...@@ -547,14 +561,14 @@ export default { ...@@ -547,14 +561,14 @@ export default {
const d = res.data.find(v => v.currencyId == 1) const d = res.data.find(v => v.currencyId == 1)
d && (d.discountTotal = discountDollar) d && (d.discountTotal = discountDollar)
const rmbListByList = this.list.filter(v => v.currencyId === 2) const rmbListByList = this.list.filter(v => v.currencyId === 3)
const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0) const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const r = res.data.find(v => v.currencyId == 2) const r = res.data.find(v => v.currencyId == 3)
r && (r.discountTotal = discountRmb) r && (r.discountTotal = discountRmb)
const nairaListByList = this.list.filter(v => v.currencyId === 3) const nairaListByList = this.list.filter(v => v.currencyId === 2)
const discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0) const discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const n = res.data.find(v => v.currencyId == 3) const n = res.data.find(v => v.currencyId == 2)
n && (n.discountTotal = discountNaira) n && (n.discountTotal = discountNaira)
...@@ -573,13 +587,18 @@ export default { ...@@ -573,13 +587,18 @@ export default {
setWriteOffAmount() { setWriteOffAmount() {
this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0)) this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0))
}, },
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
calculation() { calculation() {
const verificationList = this.detailed.filter(v => v.status === 1) const verificationList = this.detailed.filter(v => v.status === 1)
const dollarList = verificationList.filter(v => v.currencyId === 1) const dollarList = verificationList.filter(v => v.currencyId === 1)
const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0 const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const rmbList = verificationList.filter(v => v.currencyId === 2) const rmbList = verificationList.filter(v => v.currencyId === 3)
const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0 const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const nairaList = verificationList.filter(v => v.currencyId === 3) const nairaList = verificationList.filter(v => v.currencyId === 2)
const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0 const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira)) // const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira))
...@@ -653,12 +672,12 @@ export default { ...@@ -653,12 +672,12 @@ export default {
if(val === this.showCurrencyId) { if(val === this.showCurrencyId) {
rate = 1 rate = 1
} else { } else {
if (this.showCurrencyId === 1 && val === 2) rate = this.RMBtoUS() if (this.showCurrencyId === 1 && val === 3) rate = this.RMBtoUS()
else if (this.showCurrencyId === 1 && val === 3) rate = this.NANtoUS() else if (this.showCurrencyId === 1 && val === 2) rate = this.NANtoUS()
else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoRMB() else if (this.showCurrencyId === 3 && val === 1) rate = this.UStoRMB()
else if (this.showCurrencyId === 2 && val === 3) rate = this.NANtoRMB() else if (this.showCurrencyId === 3 && val === 2) rate = this.NANtoRMB()
else if (this.showCurrencyId === 3 && val === 1) rate = this.UStoNAN() else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoNAN()
else if (this.showCurrencyId === 3 && val === 2) rate = this.RMBtoNAN() else if (this.showCurrencyId === 2 && val === 3) rate = this.RMBtoNAN()
} }
this.$set(this.addForm, 'rate', rate) this.$set(this.addForm, 'rate', rate)
}, },
......
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