feat(web-admin): support per-row planNo and multiline remarks on slip templates
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bbcb2b8936
commit
e930e583a9
3 files changed
+12
-7
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import type { Plan, PlanProduct } from '@/api/pl'
|
||||
import type { SlipPlanProduct } from '@/utils/pl-batch-print'
|
||||
import { formatRemarkForSlipHtml } from '@/utils/pl-batch-print'
|
||||
import { applyPdfStableTableCellBorders } from '@/utils/pl-slip-pdf-render'
|
||||
|
||||
/** 送(提)货单打印默认公司信息(可在富文本中修改) */
|
||||
@@ -175,10 +177,10 @@ function buildProductRows(
|
||||
return `<tr><td class="delivery-slip-product-cell" colspan="8" style="${PRODUCT_CELL}">暂无产品信息</td></tr>`
|
||||
}
|
||||
|
||||
const planNoText = formatDeliverySlipProductGridCellContent(planNo)
|
||||
|
||||
const dataRows = products
|
||||
.map((product) => {
|
||||
const rowPlanNo = (product as SlipPlanProduct).slipPlanNo || planNo
|
||||
const planNoText = formatDeliverySlipProductGridCellContent(rowPlanNo)
|
||||
const qty = product.outboundQty ?? product.outboundEstimateQty ?? product.quantity ?? ''
|
||||
return `<tr>
|
||||
<td class="delivery-slip-product-cell delivery-slip-product-grid-cell" style="${PRODUCT_GRID_CELL}">${planNoText}</td>
|
||||
@@ -1800,7 +1802,7 @@ export function replaceDeliverySlipPlaceholders(
|
||||
'{{driverInfo}}': '',
|
||||
'{{planDateChinese}}': formatPlanDateChinese(plan.planDate),
|
||||
'{{productTable}}': buildProductRows(plan.products, plan.planNo || '', ctx),
|
||||
'{{remark}}': plan.remark || '',
|
||||
'{{remark}}': formatRemarkForSlipHtml(plan.remark),
|
||||
'{{companyAddress}}': DELIVERY_SLIP_DEFAULTS.companyAddress,
|
||||
'{{companyPhone}}': DELIVERY_SLIP_DEFAULTS.companyPhone,
|
||||
'{{contactPhone}}': DELIVERY_SLIP_DEFAULTS.contactPhone,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { Plan, PlanProduct } from '@/api/pl'
|
||||
import type { SlipPlanProduct } from '@/utils/pl-batch-print'
|
||||
import { formatRemarkForSlipHtml } from '@/utils/pl-batch-print'
|
||||
import { applyPdfStableTableCellBorders } from '@/utils/pl-slip-pdf-render'
|
||||
|
||||
/** 入库单打印默认公司信息(可在富文本中修改) */
|
||||
@@ -173,10 +175,10 @@ function buildProductRows(
|
||||
return `<tr><td class="inbound-slip-product-cell" colspan="8" style="${PRODUCT_CELL}">暂无产品信息</td></tr>`
|
||||
}
|
||||
|
||||
const planNoText = formatInboundSlipProductGridCellContent(planNo)
|
||||
|
||||
const dataRows = products
|
||||
.map((product) => {
|
||||
const rowPlanNo = (product as SlipPlanProduct).slipPlanNo || planNo
|
||||
const planNoText = formatInboundSlipProductGridCellContent(rowPlanNo)
|
||||
const qty = product.inboundQty ?? product.inboundEstimateQty ?? product.quantity ?? ''
|
||||
return `<tr>
|
||||
<td class="inbound-slip-product-cell inbound-slip-product-grid-cell" style="${PRODUCT_GRID_CELL}">${planNoText}</td>
|
||||
@@ -1364,7 +1366,7 @@ export function replaceInboundSlipPlaceholders(
|
||||
'{{driverInfo}}': '',
|
||||
'{{planDateChinese}}': formatPlanDateChinese(plan.planDate),
|
||||
'{{productTable}}': buildProductRows(plan.products, plan.planNo || '', ctx),
|
||||
'{{remark}}': plan.remark || '',
|
||||
'{{remark}}': formatRemarkForSlipHtml(plan.remark),
|
||||
'{{companyAddress}}': INBOUND_SLIP_DEFAULTS.companyAddress,
|
||||
'{{companyPhone}}': INBOUND_SLIP_DEFAULTS.companyPhone,
|
||||
'{{contactPhone}}': INBOUND_SLIP_DEFAULTS.contactPhone,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Plan, PlanProduct } from '@/api/pl'
|
||||
import { formatRemarkForSlipHtml } from '@/utils/pl-batch-print'
|
||||
import { applyPdfStableTableCellBorders } from '@/utils/pl-slip-pdf-render'
|
||||
|
||||
/** 分装单打印默认公司信息(可在富文本中修改) */
|
||||
@@ -2119,7 +2120,7 @@ export function replaceSubpackSlipPlaceholders(
|
||||
'{{driverInfo}}': '',
|
||||
'{{planDateChinese}}': '',
|
||||
'{{productTable}}': buildProductRows(plan.products, ctx),
|
||||
'{{remark}}': plan.remark || '',
|
||||
'{{remark}}': formatRemarkForSlipHtml(plan.remark),
|
||||
'{{remarkExtra}}': '',
|
||||
'{{companyAddress}}': '',
|
||||
'{{companyPhone}}': '',
|
||||
|
||||
Reference in new issue
Block a user