Merge remote-tracking branch 'websoft/dev'
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"
|
||||
@@ -64,6 +64,12 @@
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
/>
|
||||
<span
|
||||
v-else-if="field.prop === 'formalSettlementNo'"
|
||||
:class="{ 'form-readonly--code': form.formalSettlementNo }"
|
||||
>
|
||||
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
||||
</span>
|
||||
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
|
||||
<span v-else-if="field.type === 'contract'">{{
|
||||
displayValue(form.contractName)
|
||||
@@ -253,7 +259,14 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<el-link
|
||||
v-if="column.link && row[column.prop] && !publicMode"
|
||||
type="primary"
|
||||
@click.stop="handleDetailLink(row, column)"
|
||||
>
|
||||
{{ row[column.prop] }}
|
||||
</el-link>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<span v-else-if="column.prop === 'transportQuantity'">
|
||||
{{ formatDetailTransportQuantity(row[column.prop]) }}
|
||||
</span>
|
||||
@@ -997,6 +1010,11 @@ import {
|
||||
getDetailFees as getPreSettlementDetailFees,
|
||||
} from '@/api/settlement/preSettlement';
|
||||
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
||||
import {
|
||||
resolveReceivablePayableDetailId,
|
||||
resolveWaybillId,
|
||||
settlementDetailPath,
|
||||
} from '@/utils/settlement-detail-link';
|
||||
import { getBfiExchangeRate } from '@/api/base/currency';
|
||||
import {
|
||||
createFormalSettlementForm,
|
||||
@@ -1014,6 +1032,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,
|
||||
@@ -1025,6 +1044,9 @@ import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
|
||||
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, ProjectAdvanceWriteOff },
|
||||
@@ -1195,6 +1217,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);
|
||||
},
|
||||
@@ -2051,6 +2081,21 @@ export default {
|
||||
this.appliedDetailQuery = { ...this.detailQuery };
|
||||
this.detailPage.current = 1;
|
||||
},
|
||||
// 结算明细的「单据号」跳到该应收应付单据在应收明细/应付明细页的详情,「运单号」跳到运单详情
|
||||
async handleDetailLink(row, column) {
|
||||
if (column.prop === 'documentNo') {
|
||||
const settlementType = row.settlementType || this.form.settlementType || 'payable';
|
||||
const detailId = await resolveReceivablePayableDetailId(row, settlementType);
|
||||
if (!detailId) return this.$message.info('当前记录未找到对应的应收/应付明细');
|
||||
this.$router.push({ path: settlementDetailPath(settlementType), query: { detailId } });
|
||||
return;
|
||||
}
|
||||
if (column.prop === 'waybillNo') {
|
||||
const waybillId = await resolveWaybillId(row);
|
||||
if (!waybillId) return this.$message.info('当前记录未找到对应的运单详情');
|
||||
this.$router.push({ path: '/business/waybill-manage/detail', query: { id: waybillId } });
|
||||
}
|
||||
},
|
||||
resetDetailQuery(apply = true) {
|
||||
this.detailQuery = { documentNo: '', waybillNo: '', batchNo: '', cargoName: '' };
|
||||
if (apply) this.handleDetailQuery();
|
||||
@@ -2891,6 +2936,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-readonly--code {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
.formal-editor--page {
|
||||
padding-bottom: 72px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user