diff --git a/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js b/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js index 4d6328a9..4c159554 100644 --- a/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js +++ b/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js @@ -361,16 +361,6 @@ function formatQuotaAbs(obj, fieldName) { return html; } -function formatFixedTwoDecimals(cellvalue) { - if (cellvalue === null || cellvalue === undefined || cellvalue === '' || cellvalue === 'NaN') { - return ''; - } - var numberValue = Number(cellvalue); - return isFinite(numberValue) - ? numberValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) - : ''; -} - function formatQuotaRef(obj, fieldName) { var html = ""; var upperValue = obj["Quota_" + fieldName + "_Upper"]; @@ -554,21 +544,8 @@ function quotaMonitorUploadForm(url) { } function Output() { - var summaryType = $('#myTab .active a').text(); - var fileName = new moment().format("YYYYMMDD") + summaryType; - var formatters = null; - if (summaryType === '整体业务汇总' || summaryType === '标的汇总' || summaryType === '客户汇总') { - formatters = [{ - colName: '名义本金', - formatter: function (cellvalue, options, rowObject) { - if (summaryType === '整体业务汇总' && rowObject.BusinessType === '场内业务') { - return ''; - } - return formatFixedTwoDecimals(cellvalue); - } - }]; - } - main.toExcel("listGrid", fileName, "xls", null, [" ", "操作"], formatters); + var fileName = new moment().format("YYYYMMDD") + $('#myTab .active a').text(); + main.toExcel("listGrid", fileName, "xls", null, [" ", "操作"]); } function confirmAllSelect() { @@ -1113,7 +1090,7 @@ var colModel_undelrying = [ align: 'right', sortable: false, formatter: function (cellvalue, options, rowObject) { - return formatFixedTwoDecimals(cellvalue); + return !cellvalue || cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); }, cellattr: function (cellvalue, options, rowObject) { var style = checkQuota(rowObject, 'StockEqvNotional'); @@ -1530,7 +1507,7 @@ var colModel_client = [ align: 'right', sortable: false, formatter: function (cellvalue, options, rowObject) { - return formatFixedTwoDecimals(cellvalue); + return !cellvalue || cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); }, cellattr: function (cellvalue, options, rowObject) { var style = "style='" + checkQuota(rowObject, 'StockEqvNotional') + "'"; @@ -1681,7 +1658,10 @@ var colModel_global = [ if (rowObject.BusinessType == "场内业务") { return '
'; } - return formatFixedTwoDecimals(cellvalue); + if (page.IsGuoXin && cellvalue != null) { + return cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); + } + return !cellvalue || cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); }, cellattr: function (cellvalue, options, rowObject) { var style = checkQuota(rowObject, 'StockEqvNotional'); @@ -2152,4 +2132,4 @@ var colModel_Log = [ align: 'center', sortable: false } -]; +]; \ No newline at end of file