From 8ca5af1ff0e1589cd853a3c65af2b76819f3e1b7 Mon Sep 17 00:00:00 2001 From: wuweihua <88888888> Date: Thu, 12 Nov 2026 16:53:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E5=8D=95=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=98=8E=E7=BB=86=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=99=84=E5=8A=A0=E8=B4=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../price/LabelPackageController.java | 10 +++ .../com/bms/price/domain/PaySurcharge.java | 6 -- .../service/impl/PayProductServiceImpl.java | 24 ------ bms-front/src/api/price/label.js | 11 +++ .../basic/pay/components/PayConfigDetail.vue | 84 +++++++++++++------ .../components/PaySurchargePickerDialog.vue | 36 +++++++- .../label/components/LabelImportPanel.vue | 13 ++- .../components/LabelVersionProductDrawer.vue | 83 +++++++++++++++++- .../label/components/LabelVersionTable.vue | 4 +- bms-front/src/views/price/label/create.vue | 26 +----- 10 files changed, 200 insertions(+), 97 deletions(-) diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java index 69282591..e8fab8af 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java @@ -24,6 +24,7 @@ import com.bms.common.core.domain.AjaxResult; import com.bms.common.core.page.TableDataInfo; import com.bms.common.enums.BusinessType; import com.bms.common.exception.ServiceException; +import com.bms.price.domain.PayProduct; import com.bms.price.domain.PaySaveCommand; import com.bms.price.domain.PrcCustomerPriceSet; import com.bms.price.domain.PrcCustomerPriceSetBatch; @@ -208,6 +209,15 @@ public class LabelPackageController extends BaseController return success(payProductService.selectPayProductDetail(productId)); } + /** 保存打单产品明细(重量段/附加费等),按当前 term 覆盖子表 */ + @PreAuthorize("@ss.hasPermi('price:label:edit')") + @Log(title = "打单产品明细", businessType = BusinessType.UPDATE) + @PutMapping("/product") + public AjaxResult updateProduct(@RequestBody PayProduct product) + { + return toAjax(payProductService.updateDetail(product)); + } + /** 查询打单产品已绑定渠道(默认应收 AR) */ @PreAuthorize("@ss.hasPermi('price:label:query')") @GetMapping("/product/{productId}/channels") diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PaySurcharge.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PaySurcharge.java index 3c5fcae6..c44a1167 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PaySurcharge.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PaySurcharge.java @@ -73,10 +73,4 @@ public class PaySurcharge private BigDecimal weightMax; private Integer sortNo; - - /** - * 是否计费并落库:false 不写入 pay_surcharge;null/缺省视为要计费(兼容应付全量保存)。 - * 仅作为前端传参,不落库字段。 - */ - private Boolean needBill; } diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java index 85c56002..b9e60317 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java @@ -461,8 +461,6 @@ public class PayProductServiceImpl implements IPayProductService { product.setExtraLines(new ArrayList<>()); } - // 计数前先按「是否计费」过滤,与落库行数一致 - retainBillableSurcharges(product); product.setWeightCount(product.getWeightBands().size()); product.setSurchargeCount(product.getSurcharges().size()); product.setExtraCount(product.getExtraLines().size()); @@ -1531,7 +1529,6 @@ public class PayProductServiceImpl implements IPayProductService private void insertSurcharges(PayProduct product) { - retainBillableSurcharges(product); List rows = product.getSurcharges(); if (rows == null || rows.isEmpty()) { @@ -1550,27 +1547,6 @@ public class PayProductServiceImpl implements IPayProductService } } - /** - * 仅保留需要计费的附加费:needBill=false 不入库;null 视为要计费。 - */ - private void retainBillableSurcharges(PayProduct product) - { - List rows = product.getSurcharges(); - if (rows == null || rows.isEmpty()) - { - return; - } - List kept = new ArrayList(); - for (PaySurcharge fee : rows) - { - if (fee != null && !Boolean.FALSE.equals(fee.getNeedBill())) - { - kept.add(fee); - } - } - product.setSurcharges(kept); - } - /** * 按附加费名称映射 prc_surcharge.sc_id;币种不能为空:附加费 -> 价卡 -> EUR。 */ diff --git a/bms-front/src/api/price/label.js b/bms-front/src/api/price/label.js index d8ed0094..07759485 100644 --- a/bms-front/src/api/price/label.js +++ b/bms-front/src/api/price/label.js @@ -155,6 +155,17 @@ export function getLabelProduct(productId, termId) { }) } +/** 保存打单产品明细(重量段/附加费) */ +export function updateLabelProduct(data) { + return request({ + url: '/price/label/product', + method: 'put', + data, + headers: { repeatSubmit: false }, + timeout: 120000 + }) +} + export function removeLabelProducts(priceSetId, productIds) { return request({ url: '/price/label/' + priceSetId + '/products/' + productIds, diff --git a/bms-front/src/views/price/basic/pay/components/PayConfigDetail.vue b/bms-front/src/views/price/basic/pay/components/PayConfigDetail.vue index 269a4d70..ac71f769 100644 --- a/bms-front/src/views/price/basic/pay/components/PayConfigDetail.vue +++ b/bms-front/src/views/price/basic/pay/components/PayConfigDetail.vue @@ -79,16 +79,26 @@
添加附加费 - + 批量删除
- + + @@ -266,11 +276,6 @@ const props = defineProps({ type: Boolean, default: false }, - /** 打单套餐:附加费表显示「是否计费」勾选,仅勾选行入库 */ - billSelect: { - type: Boolean, - default: false - }, savingRowKey: { type: [String, Number], default: '' @@ -541,18 +546,51 @@ function filteredFees(pane) { function feeTabLabel(pane) { const fees = pane.item.surcharges || [] - if (!props.billSelect) return '附加费(' + fees.length + ')' - const n = fees.filter(f => f && f.needBill === true).length - return '附加费(已选 ' + n + '/' + fees.length + ')' + return '附加费(' + fees.length + ')' } -function setFeesBill(pane, value) { - const fees = pane.item.surcharges || [] - for (const fee of fees) { - if (fee) fee.needBill = !!value +function feeCheckedCount(pane) { + return (pane?.item?.surcharges || []).filter(fee => fee && fee._checked === true).length +} + +function isAllFilteredFeesChecked(pane) { + const rows = filteredFees(pane) + return rows.length > 0 && rows.every(fee => fee && fee._checked === true) +} + +function isFeeCheckIndeterminate(pane) { + const rows = filteredFees(pane) + if (!rows.length) return false + const n = rows.filter(fee => fee && fee._checked === true).length + return n > 0 && n < rows.length +} + +function setFilteredFeesChecked(pane, value) { + for (const fee of filteredFees(pane)) { + if (fee) fee._checked = !!value } } +async function removeCheckedFees(pane) { + const list = pane?.item?.surcharges + if (!list?.length) return + const checked = list.filter(fee => fee && fee._checked === true) + if (!checked.length) { + proxy.$modal.msgWarning('请先勾选要删除的附加费') + return + } + try { + await proxy.$modal.confirm(`确认删除所选 ${checked.length} 项附加费?`) + } catch { + return + } + const remain = list.filter(fee => !(fee && fee._checked === true)) + pane.item.surcharges = remain + const maxPage = Math.max(1, Math.ceil(remain.length / pageSize) || 1) + if (pane.feePageNo > maxPage) pane.feePageNo = maxPage + proxy.$modal.msgSuccess(`已删除 ${checked.length} 项`) +} + const { proxy } = getCurrentInstance() const feePickerVisible = ref(false) const feePickerPane = ref(null) @@ -589,9 +627,7 @@ function configToFeeRow(cfg, product) { priceUnit: isPercent ? '%' : (currency + '/ITEM'), feeDesc: String(cfg?.scNote || '').trim(), calcRule: toCalcRule(cfg?.chargeType), - calcParam: '', - // 从配置添加默认要计费 - needBill: true + calcParam: '' } } @@ -738,10 +774,6 @@ function statusText(status) { gap: 8px; margin-bottom: 8px; } -.pay-bill-tip { - color: var(--el-text-color-secondary); - font-size: 12px; -} .pay-hint { margin: 0 0 8px; color: var(--el-text-color-secondary); diff --git a/bms-front/src/views/price/basic/pay/components/PaySurchargePickerDialog.vue b/bms-front/src/views/price/basic/pay/components/PaySurchargePickerDialog.vue index 3b7f099a..e6f99275 100644 --- a/bms-front/src/views/price/basic/pay/components/PaySurchargePickerDialog.vue +++ b/bms-front/src/views/price/basic/pay/components/PaySurchargePickerDialog.vue @@ -14,6 +14,13 @@ placeholder="搜索附加费名称、计费方式、币种、国家或备注" class="picker-search" /> + 新建附加费 共 {{ filteredRows.length }} 项,已选 {{ picked.length }} 项 @@ -43,17 +50,20 @@ -
勾选后点确定写入当前产品附加费表;已存在相同配置的不会重复添加。
+
可先「新建附加费」写入配置库;勾选后点确定写入当前产品附加费表;已存在相同配置的不会重复添加。
+ +