From 563a7446291289a1728022a1c6695dc6e74daa18 Mon Sep 17 00:00:00 2001 From: eddie <1150970484@qq.com> Date: Fri, 6 Dec 2024 17:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E4=BB=B7=E8=B7=AF=E7=BA=BF=EF=BC=8C?= =?UTF-8?q?=E5=85=A8=E5=B9=B4=E7=9A=84=E4=BB=B7=E6=A0=BC=E6=97=A0=E9=9C=80?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../products/Print/AgencyContract_v1120.jsx | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/views/products/Print/AgencyContract_v1120.jsx b/src/views/products/Print/AgencyContract_v1120.jsx index d88d112..2f4b613 100644 --- a/src/views/products/Print/AgencyContract_v1120.jsx +++ b/src/views/products/Print/AgencyContract_v1120.jsx @@ -827,6 +827,8 @@ export default class AgencyContract { const { chunk, sizeSets, SSRange, PSRange } = chunkBy(use_year, withExtras, ['quote_season']) //当前表格的备注信息 const [remarkItem] = this.#remarkList.filter((i) => i.product_type_id == '7') + + // console.log(chunk,chunk.filter(i => i.info.city_name.includes("北京"))); const extraCol = (rowp, i) => { return new TableCell({ borders: tableBorderOne, @@ -867,18 +869,16 @@ export default class AgencyContract { : `${firstQ.group_size_min}-${firstQ.group_size_max}人,` return new Paragraph({ children: [ - // new TextRun({ text: `${extra.info.product_title} ${firstQ.unit_name}`, bold: true }), new TextRun({ text: `${sizeStr} ${firstQ.unit_name}, ${firstQ.adult_cost}` + - // + (`, ${firstQ.group_size_min}-${firstQ.group_size_max}人`) (compactBy !== 'dates' ? `, ${date1}~${date2}${otherStr}` : ''), }), ], }) }) + return ac.concat([thisE, ...thisP]) - // return new Paragraph({ text: `${extra.info.product_title} ${extra.quotation?.[0]?.adult_cost || ''} ${extra.quotation?.[0]?.unit_name || ''}` }); }, []), ], }) @@ -1236,14 +1236,7 @@ export default class AgencyContract { ...subItems.reduce((acc, quoteItem, index) => { const start = dayjs(quoteItem.use_dates_start).format('M-D').replace('-', '.') const end = dayjs(quoteItem.use_dates_end).format('M-D').replace('-', '.') - // new Paragraph({ - // alignment: AlignmentType.CENTER, - // text: isEmpty(quoteItem) - // ? '' - // : quoteItem.use_dates_start != firstDayOfYear || quoteItem.use_dates_end != lastDayOfYear - // ? `(${start}-${end})` - // : '', - // }), + return acc.concat( ...[ new Paragraph({ @@ -1254,28 +1247,17 @@ export default class AgencyContract { ? `${quoteItem.group_size_min}-${quoteItem.group_size_max}人,${quoteItem.unit_name}, ${quoteItem.adult_cost}` : `${quoteItem.adult_cost}`, }), - new Paragraph({ - alignment: AlignmentType.CENTER, - text: isEmpty(quoteItem) - ? '' - : quoteItem.use_dates_start != firstDayOfYear || quoteItem.use_dates_end != lastDayOfYear - ? `(${start}-${end})` - : '', - }), + ...(quoteItem.use_dates_start != firstDayOfYear && quoteItem.use_dates_end != lastDayOfYear + ? [ + new Paragraph({ + alignment: AlignmentType.CENTER, + text: `(${start}-${end})`, + }), + ] + : []), ], ) }, []), - // ...((withSeason ? rowp.quote_chunk?.['SS']?.[ss] : rowp.quote_chunk[ss]) || []).map( - // (quoteItem, ii) => - // new Paragraph({ - // alignment: AlignmentType.CENTER, - // text: isEmpty(quoteItem) - // ? '' - // : withSize && String(quoteItem.unit_id) !== defaultUnit - // ? `${quoteItem.group_size_min}-${quoteItem.group_size_max}人,${quoteItem.unit_name}, ${quoteItem.adult_cost}` - // : `${quoteItem.adult_cost}`, - // }), - // ), ], }) }),