修改计费详情应付显示

This commit is contained in:
wuweihua
2026-09-14 15:36:19 +08:00
parent 4bd95cb472
commit c89c1340b0
3 changed files with 146 additions and 48 deletions
@@ -56,8 +56,10 @@ public class TmsPriceQuoteResult implements Serializable
private String currency = "CNY";
/** UP / DOWN / HALF_UP */
private String roundMode;
/** 费用明细:运费/挂号费各一行,附加费按具体名称各一行 */
/** 应收费用明细(兼容旧字段 feeDetails) */
private List<TmsPriceQuoteFeeLine> feeDetails;
/** 应付费用明细 */
private List<TmsPriceQuoteFeeLine> payFeeDetails;
private String quoteId;
private String billId;
private String orderNo;
@@ -18,11 +18,13 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.price.domain.PrcIncomeBillFee;
import com.ruoyi.price.domain.PrcOrderBill;
import com.ruoyi.price.domain.PrcPayBillFee;
import com.ruoyi.price.domain.vo.TmsPriceBillRequest;
import com.ruoyi.price.domain.vo.TmsPriceQuoteFeeLine;
import com.ruoyi.price.domain.vo.TmsPriceQuoteResult;
import com.ruoyi.price.mapper.PrcIncomeBillFeeMapper;
import com.ruoyi.price.mapper.PrcOrderBillMapper;
import com.ruoyi.price.mapper.PrcPayBillFeeMapper;
import com.ruoyi.price.search.EsBizLogSupport;
import com.ruoyi.price.search.EsLogType;
import com.ruoyi.price.search.IBillSearchStore;
@@ -41,6 +43,9 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
@Autowired
private PrcIncomeBillFeeMapper incomeBillFeeMapper;
@Autowired
private PrcPayBillFeeMapper payBillFeeMapper;
@Autowired
private IBillSearchStore billSearchStore;
@@ -90,7 +95,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
{
throw new ServiceException(MessageUtils.message("price.bill.notFound"));
}
return toResult(bill, incomeBillFeeMapper.selectByBillId(billId));
return toResult(bill, incomeBillFeeMapper.selectByBillId(billId),
payBillFeeMapper.selectByBillId(billId));
}
@Override
@@ -105,7 +111,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
{
throw new ServiceException(MessageUtils.message("price.bill.notFound"));
}
return toResult(bill, incomeBillFeeMapper.selectByBillId(bill.getBillId()));
return toResult(bill, incomeBillFeeMapper.selectByBillId(bill.getBillId()),
payBillFeeMapper.selectByBillId(bill.getBillId()));
}
private void persistBill(TmsPriceBillRequest request, BigDecimal weight, Date bizDate,
@@ -218,7 +225,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
return fees;
}
private TmsPriceQuoteResult toResult(PrcOrderBill bill, List<PrcIncomeBillFee> fees)
private TmsPriceQuoteResult toResult(PrcOrderBill bill, List<PrcIncomeBillFee> incomeFees,
List<PrcPayBillFee> payFees)
{
TmsPriceQuoteResult r = new TmsPriceQuoteResult();
r.setBillId(bill.getBillId());
@@ -258,26 +266,55 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
r.setCurrency(bill.getCurrency());
r.setRoundMode(bill.getRoundMode());
r.setBizDate(bill.getBizDate());
List<TmsPriceQuoteFeeLine> lines = new ArrayList<TmsPriceQuoteFeeLine>();
if (fees != null)
{
for (PrcIncomeBillFee fee : fees)
{
TmsPriceQuoteFeeLine line = new TmsPriceQuoteFeeLine();
line.setFeeType(fee.getFeeType());
line.setFeeName(fee.getFeeName());
line.setScId(fee.getScId());
line.setAmount(fee.getAmount());
line.setCurrency(fee.getCurrency());
line.setRoundMode(fee.getRoundMode());
line.setRemark(fee.getRemark());
lines.add(line);
}
}
r.setFeeDetails(lines);
r.setFeeDetails(toIncomeFeeLines(incomeFees));
r.setPayFeeDetails(toPayFeeLines(payFees));
return r;
}
private List<TmsPriceQuoteFeeLine> toIncomeFeeLines(List<PrcIncomeBillFee> fees)
{
List<TmsPriceQuoteFeeLine> lines = new ArrayList<TmsPriceQuoteFeeLine>();
if (fees == null)
{
return lines;
}
for (PrcIncomeBillFee fee : fees)
{
TmsPriceQuoteFeeLine line = new TmsPriceQuoteFeeLine();
line.setFeeType(fee.getFeeType());
line.setFeeName(fee.getFeeName());
line.setScId(fee.getScId());
line.setAmount(fee.getAmount());
line.setCurrency(fee.getCurrency());
line.setRoundMode(fee.getRoundMode());
line.setRemark(fee.getRemark());
lines.add(line);
}
return lines;
}
private List<TmsPriceQuoteFeeLine> toPayFeeLines(List<PrcPayBillFee> fees)
{
List<TmsPriceQuoteFeeLine> lines = new ArrayList<TmsPriceQuoteFeeLine>();
if (fees == null)
{
return lines;
}
for (PrcPayBillFee fee : fees)
{
TmsPriceQuoteFeeLine line = new TmsPriceQuoteFeeLine();
line.setFeeType(fee.getFeeType());
line.setFeeName(fee.getFeeName());
line.setScId(fee.getScId());
line.setAmount(fee.getAmount());
line.setCurrency(fee.getCurrency());
line.setRoundMode(fee.getRoundMode());
line.setRemark(fee.getRemark());
lines.add(line);
}
return lines;
}
private void fillResultOrder(TmsPriceQuoteResult r, PrcOrderBill bill)
{
r.setTrackingNo(bill.getTrackingNo());
@@ -77,33 +77,66 @@
</div>
</section>
<section v-if="detail.feeDetails && detail.feeDetails.length" class="detail-block">
<section class="detail-block">
<div class="sec-title">费用明细</div>
<el-table :data="detail.feeDetails" border size="small" class="fee-table">
<el-table-column label="费用名称" min-width="140" show-overflow-tooltip>
<template #default="{ row }">{{ displayFeeName(row) }}</template>
</el-table-column>
<el-table-column label="费用类型" width="110" align="center">
<template #default="{ row }">
<el-tag size="small" :type="feeTypeTag(row.feeType)" effect="plain">
{{ feeTypeLabel(row.feeType) || row.feeType }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="金额" min-width="120" align="right">
<template #default="{ row }">
<span class="fee-amount">{{ formatMoney(row.amount) }}</span>
</template>
</el-table-column>
<el-table-column label="币种" width="90" align="center">
<template #default="{ row }">
<dict-tag :options="bms_currency" :value="displayCurrency(row.currency)" />
</template>
</el-table-column>
<el-table-column label="说明" min-width="160" show-overflow-tooltip>
<template #default="{ row }">{{ row.remark || '-' }}</template>
</el-table-column>
</el-table>
<el-tabs v-model="feeTab" class="fee-tabs">
<el-tab-pane label="应收" name="income">
<el-table v-if="incomeFees.length" :data="incomeFees" border size="small" class="fee-table">
<el-table-column label="费用名称" min-width="140" show-overflow-tooltip>
<template #default="{ row }">{{ displayFeeName(row) }}</template>
</el-table-column>
<el-table-column label="费用类型" width="110" align="center">
<template #default="{ row }">
<el-tag size="small" :type="feeTypeTag(row.feeType)" effect="plain">
{{ feeTypeLabel(row.feeType) || row.feeType }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="金额" min-width="120" align="right">
<template #default="{ row }">
<span class="fee-amount">{{ formatMoney(row.amount) }}</span>
</template>
</el-table-column>
<el-table-column label="币种" width="90" align="center">
<template #default="{ row }">
<dict-tag :options="bms_currency" :value="displayCurrency(row.currency)" />
</template>
</el-table-column>
<el-table-column label="说明" min-width="160" show-overflow-tooltip>
<template #default="{ row }">{{ row.remark || '-' }}</template>
</el-table-column>
</el-table>
<el-empty v-else description="暂无应收明细" :image-size="64" />
</el-tab-pane>
<el-tab-pane label="应付" name="pay">
<el-table v-if="payFees.length" :data="payFees" border size="small" class="fee-table">
<el-table-column label="费用名称" min-width="140" show-overflow-tooltip>
<template #default="{ row }">{{ displayFeeName(row) }}</template>
</el-table-column>
<el-table-column label="费用类型" width="110" align="center">
<template #default="{ row }">
<el-tag size="small" :type="feeTypeTag(row.feeType)" effect="plain">
{{ feeTypeLabel(row.feeType) || row.feeType }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="金额" min-width="120" align="right">
<template #default="{ row }">
<span class="fee-amount">{{ formatMoney(row.amount) }}</span>
</template>
</el-table-column>
<el-table-column label="币种" width="90" align="center">
<template #default="{ row }">
<dict-tag :options="bms_currency" :value="displayCurrency(row.currency)" />
</template>
</el-table-column>
<el-table-column label="说明" min-width="160" show-overflow-tooltip>
<template #default="{ row }">{{ row.remark || '-' }}</template>
</el-table-column>
</el-table>
<el-empty v-else description="暂无应付明细" :image-size="64" />
</el-tab-pane>
</el-tabs>
</section>
</div>
</div>
@@ -111,7 +144,7 @@
</template>
<script setup>
defineProps({
const props = defineProps({
modelValue: { type: Boolean, default: false },
title: { type: String, default: '计费详情' },
loading: { type: Boolean, default: false },
@@ -120,8 +153,25 @@ defineProps({
defineEmits(['update:modelValue'])
const feeTab = ref('income')
const { bms_fee_type, bms_currency } = useDict('bms_fee_type', 'bms_currency')
const incomeFees = computed(() => {
const d = props.detail
if (!d) return []
return d.feeDetails || d.incomeFeeDetails || []
})
const payFees = computed(() => {
const d = props.detail
if (!d) return []
return d.payFeeDetails || []
})
watch(() => props.detail, () => {
feeTab.value = 'income'
})
function displayCustomer(row) {
if (row.customerName && row.customerCode) return row.customerName + ' (' + row.customerCode + ')'
return row.customerName || row.customerCode || row.customerId || '-'
@@ -309,4 +359,13 @@ function sourceTagType(source) {
font-variant-numeric: tabular-nums;
font-weight: 500;
}
.fee-tabs {
margin-top: 0;
}
.fee-tabs :deep(.el-tabs__header) {
margin-bottom: 12px;
}
.fee-tabs :deep(.el-empty) {
padding: 24px 0;
}
</style>