From 35ec29a0f80727b132ca003981335fdb7d4ec810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 24 Oct 2021 14:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E7=9A=84=E5=90=88=E8=AE=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/mixins/JeecgListMixin.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/jshERP-web/src/mixins/JeecgListMixin.js b/jshERP-web/src/mixins/JeecgListMixin.js index 367c0086..3e844ad7 100644 --- a/jshERP-web/src/mixins/JeecgListMixin.js +++ b/jshERP-web/src/mixins/JeecgListMixin.js @@ -386,22 +386,23 @@ export const JeecgListMixin = { let numKey = 'rowIndex' let totalRow = { [numKey]: '合计' } //移除不需要合计的列 - let removeCols = 'action,mBarCode,barCode,name,standard,model,categoryName,unitName,serialNo,unitPrice,purchaseDecimal,operTime,oTime' + let parseCols = 'initialStock,currentStock,currentStockPrice,initialAmount,thisMonthAmount,currentAmount,inSum,inSumPrice,' + + 'outSum,outSumPrice,outInSumPrice,operNumber,allPrice,numSum,priceSum,prevSum,thisSum,thisAllPrice,billMoney,changeAmount,' + + 'allPrice,safetystock,currentNumber,linjieNumber' columns.forEach(column => { let { key, dataIndex } = column if (![key, dataIndex].includes(numKey)) { let total = 0 dataSource.forEach(data => { - total += Number.parseFloat(data[dataIndex]) + if(parseCols.indexOf(dataIndex)>-1) { + total += Number.parseFloat(data[dataIndex]) + } else { + total = '-' + } }) - if (Number.isNaN(total)) { - total = '-' - } else { + if (total !== '-') { total = total.toFixed(2) } - if(removeCols.indexOf(dataIndex)>-1) { - total = '-' - } totalRow[dataIndex] = total } })