From d1e443953eae3c5bdb0b443b4f5c3b7ced9236d7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 十一月 2023 01:38:44 +0800 Subject: [PATCH] Merge branch 'positec' into bms --- src/views/billprint/index.jsx | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index c46417f..8012bf6 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -358,7 +358,20 @@ if (component.type === 'table') { let getColumns = (cols) => { return cols.filter(item => { - if (item.type === 'colspan') { + if (item.Hide === 'true') return false + + if (item.type === 'number') { + if (typeof(item.decimal) === 'number') { + item.round = Math.pow(10, item.decimal) + if (item.format === 'percent') { + item.decimal = item.decimal > 2 ? item.decimal - 2 : 0 + } + } + } else if (item.type === 'formula') { + if (typeof(item.decimal) === 'number') { + item.round = Math.pow(10, item.decimal) + } + } else if (item.type === 'colspan') { item.subcols = getColumns(item.subcols) if (item.subcols.length === 0) { return false @@ -540,6 +553,16 @@ auto: config.printPage === 'auto', config }, () => { + if (config.normalcss) { + let node = document.getElementById(config.uuid) + node && node.remove() + + let ele = document.createElement('style') + ele.id = config.uuid + ele.innerHTML = config.normalcss + document.getElementsByTagName('head')[0].appendChild(ele) + } + if (params.length === 0 && initInters.length === 0) { this.setState({loadingview: false, pages: [config.components]}) } else if (initInters.length > 0) { @@ -596,6 +619,8 @@ if (cell.format === 'percent') { cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 } + } else if (cell.eleType === 'formula' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) } } -- Gitblit v1.8.0