fix: 正式结算单金额按结算币种显示,追加预结算来源结算金额按汇率反算
- 结算合计原金额/结算金额/合计行与表头结算金额按合同结算币种显示币种代码(人民币 RMB、外币如 USD),本位币合计固定 RMB - confirmCandidates 追加预结算来源时结算金额由来源本位币汇总按结算汇率反算,本位币合计保留本位币汇总,修复外币结算未换算
This commit is contained in:
@@ -84,7 +84,12 @@
|
||||
>
|
||||
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
||||
</span>
|
||||
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
|
||||
<span v-else-if="field.money">{{
|
||||
formatMoney(
|
||||
form[field.prop],
|
||||
field.prop === 'settlementAmount' ? settlementCurrencyCode : 'RMB'
|
||||
)
|
||||
}}</span>
|
||||
<span v-else-if="field.type === 'select'">{{
|
||||
formSelectLabel(field, form[field.prop])
|
||||
}}</span>
|
||||
@@ -180,7 +185,7 @@
|
||||
'formal-editor__negative-amount': isNegativeAdjustedAmount(row, column.prop),
|
||||
}"
|
||||
>
|
||||
{{ formatMoney(row[column.prop]) }}
|
||||
{{ formatMoney(row[column.prop], settlementCurrencyCode) }}
|
||||
</span>
|
||||
<span v-else-if="column.prop === 'feeType'">{{ feeCategoryName(row.feeType) }}</span>
|
||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||
@@ -201,7 +206,7 @@
|
||||
class="formal-editor__settle-summary"
|
||||
>
|
||||
<el-descriptions-item label="结算合计(原金额)">
|
||||
{{ formatMoney(form.settlementAmount) }}
|
||||
{{ formatMoney(form.settlementAmount, settlementCurrencyCode) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已付金额(含预付、核销)">
|
||||
{{ formatMoney(settlePaidTotal) }}
|
||||
@@ -1373,6 +1378,10 @@ export default {
|
||||
isLocalCurrencySettlement() {
|
||||
return normalizeCurrencyCode(this.form.currency) === 'RMB';
|
||||
},
|
||||
// 结算单据币种:本位币结算固定 RMB,外币结算取归一化后的合同结算币种
|
||||
settlementCurrencyCode() {
|
||||
return this.isLocalCurrencySettlement ? 'RMB' : normalizeCurrencyCode(this.form.currency);
|
||||
},
|
||||
visibleFields() {
|
||||
if (!this.isLocalCurrencySettlement) return this.fields;
|
||||
return this.fields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
|
||||
@@ -1945,12 +1954,13 @@ export default {
|
||||
});
|
||||
this.refreshFormalSettlementNo();
|
||||
}
|
||||
this.form.settlementAmount = this.sources.reduce(
|
||||
// 来源预结算金额为本位币;外币结算时结算金额按汇率反算,本位币合计保留本位币汇总
|
||||
const sourceTotal = this.sources.reduce(
|
||||
(sum, item) => sum + Number(item.settlementAmount || 0),
|
||||
0
|
||||
);
|
||||
this.form.localSettlementAmount =
|
||||
this.form.settlementAmount * Number(this.form.exchangeRate || 1);
|
||||
this.form.settlementAmount = this.convertLocalToSettlementAmount(sourceTotal);
|
||||
this.form.localSettlementAmount = Number(sourceTotal).toFixed(2);
|
||||
this.candidate.visible = false;
|
||||
// 预结算转正式:带出来源预结算已保存的项目预付核销行(后端保存时转移源行,额度单份占用)
|
||||
const newIds = this.sources
|
||||
@@ -2100,7 +2110,7 @@ export default {
|
||||
if (index === 0) return '合计';
|
||||
if (!sumProps.includes(column.property)) return '';
|
||||
const total = data.reduce((sum, row) => sum + Number(row[column.property] || 0), 0);
|
||||
const totalText = this.formatMoney(total);
|
||||
const totalText = this.formatMoney(total, this.settlementCurrencyCode);
|
||||
if (column.property === 'settlementAmount' && hasNegativeAdjustment) {
|
||||
return h('span', { style: { color: 'var(--el-color-danger)' } }, totalText);
|
||||
}
|
||||
@@ -3167,8 +3177,8 @@ export default {
|
||||
const body = response?.data || response || {};
|
||||
return body?.data || body;
|
||||
},
|
||||
formatMoney(value) {
|
||||
return `${Number(value || 0).toFixed(2)} RMB`;
|
||||
formatMoney(value, currency = 'RMB') {
|
||||
return `${Number(value || 0).toFixed(2)} ${currency}`;
|
||||
},
|
||||
formatDetailTransportQuantity(row) {
|
||||
const value = row.transportQuantity;
|
||||
|
||||
Reference in New Issue
Block a user