⚡ 新增预结算与正式结算合同币种为人民币时隐藏汇率日期、结算汇率与本位币合计
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
label-width="auto"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<el-col v-for="field in fields" :key="field.prop" :span="6">
|
||||
<el-col v-for="field in visibleFields" :key="field.prop" :span="6">
|
||||
<el-form-item :label="field.label" :prop="field.prop">
|
||||
<el-date-picker
|
||||
v-if="field.type === 'date' && editable"
|
||||
@@ -1010,6 +1010,7 @@ import { h } from 'vue';
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { normalizeCurrencyCode } from '@/utils/currency';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import {
|
||||
downloadKingdeeInvoiceFile,
|
||||
@@ -1020,6 +1021,9 @@ import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/m
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementEditor',
|
||||
components: { InfoFilled, KingdeeInvoicePoolDialog },
|
||||
@@ -1189,6 +1193,14 @@ export default {
|
||||
title() {
|
||||
return this.readonly ? '查看正式结算单' : this.recordId ? '编辑正式结算单' : '新增正式结算单';
|
||||
},
|
||||
// 币种为空按人民币处理,与后端预结算/正式结算对空币种的默认取值一致
|
||||
isLocalCurrencySettlement() {
|
||||
return normalizeCurrencyCode(this.form.currency) === 'RMB';
|
||||
},
|
||||
visibleFields() {
|
||||
if (!this.isLocalCurrencySettlement) return this.fields;
|
||||
return this.fields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
|
||||
},
|
||||
summaryTotal() {
|
||||
return this.summaryFees.reduce((total, row) => total + Number(row.settlementAmount || 0), 0);
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class="pre-settlement-editor__form"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<el-col v-for="field in formFields" :key="field.prop" :span="field.span || 6">
|
||||
<el-col v-for="field in visibleFormFields" :key="field.prop" :span="field.span || 6">
|
||||
<el-form-item :label="field.label" :prop="field.prop">
|
||||
<el-input
|
||||
v-if="field.type === 'contract'"
|
||||
@@ -40,7 +40,7 @@
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
:disabled="!editable || form.currency === 'RMB'"
|
||||
:disabled="!editable"
|
||||
placeholder="请选择"
|
||||
@change="handleExchangeRateDateChange"
|
||||
/>
|
||||
@@ -50,7 +50,7 @@
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
:disabled="!editable || form.currency === 'RMB'"
|
||||
:disabled="!editable"
|
||||
@change="recalculateLocalAmount"
|
||||
/>
|
||||
<el-input
|
||||
@@ -980,11 +980,15 @@ import {
|
||||
settlementSummaryColumns,
|
||||
} from '@/option/settlement/preSettlementTable';
|
||||
import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { normalizeCurrencyCode } from '@/utils/currency';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
|
||||
|
||||
export default {
|
||||
name: 'PreSettlementEditor',
|
||||
components: { InfoFilled, ChangeRecordDetailDialog },
|
||||
@@ -1194,6 +1198,14 @@ export default {
|
||||
settlementTypeName() {
|
||||
return this.form.settlementType === 'receivable' ? '应收' : '应付';
|
||||
},
|
||||
// 币种为空按人民币处理,与后端 normalizeRate 的取默认值一致
|
||||
isLocalCurrencySettlement() {
|
||||
return normalizeCurrencyCode(this.form.currency) === 'RMB';
|
||||
},
|
||||
visibleFormFields() {
|
||||
if (!this.isLocalCurrencySettlement) return this.formFields;
|
||||
return this.formFields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
|
||||
},
|
||||
contractDialogCategory() {
|
||||
return '承运商合同';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user