| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/tSite.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | // 仅格式化前端展示,接口返回的原始数值不作改动。 |
| | | function formatStatisticNumber(value) { |
| | | var number = Number(value); |
| | | return isFinite(number) ? number.toFixed(2) : '0.00'; |
| | | } |
| | | |
| | | |
| | | function search(){ |
| | |
| | | var records = labels.map(function (label, index) { |
| | | var item = statistics[index]; |
| | | return '<div class="income-period-record"><strong>' + label + '</strong>:总营收金额 ' |
| | | + item.totalIncomeAmount + ',净收入金额 ' + item.netIncomeAmount |
| | | + ',优惠券抵扣金额 ' + item.couponDeductionAmount + ',退款金额 ' |
| | | + item.refundAmount + '</div>'; |
| | | + formatStatisticNumber(item.totalIncomeAmount) + ',净收入金额 ' + formatStatisticNumber(item.netIncomeAmount) |
| | | + ',优惠券抵扣金额 ' + formatStatisticNumber(item.couponDeductionAmount) + ',退款金额 ' |
| | | + formatStatisticNumber(item.refundAmount) + '</div>'; |
| | | }).join(''); |
| | | document.getElementById(elementId).innerHTML = '<div class="income-period-title">' + title |
| | | + '</div><div class="income-period-records">' + records + '</div>'; |
| | |
| | | title: {text: title, left: 'center', textStyle: {fontSize: 15}}, |
| | | tooltip: {trigger: 'axis', formatter: function (params) { |
| | | var detail = statistics[params[0].dataIndex]; |
| | | return labels[params[0].dataIndex] + '<br/>总营收:' + detail.totalIncomeAmount |
| | | + '<br/>净收入:' + detail.netIncomeAmount + '<br/>优惠券抵扣:' |
| | | + detail.couponDeductionAmount + '<br/>退款:' + detail.refundAmount; |
| | | return labels[params[0].dataIndex] + '<br/>总营收:' + formatStatisticNumber(detail.totalIncomeAmount) |
| | | + '<br/>净收入:' + formatStatisticNumber(detail.netIncomeAmount) + '<br/>优惠券抵扣:' |
| | | + formatStatisticNumber(detail.couponDeductionAmount) + '<br/>退款:' + formatStatisticNumber(detail.refundAmount); |
| | | }}, |
| | | grid: {left: '5%', right: '4%', bottom: '18%', containLabel: true}, |
| | | xAxis: {type: 'category', boundaryGap: false, data: labels, axisLabel: {rotate: labels.length > 7 ? 35 : 0, interval: 0}}, |
| | |
| | | function income(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | yearX = resp.year; |
| | | $("#totalIncome").text(resp.incomeStatistics.totalIncomeAmount || 0); |
| | | $("#netIncomeAmount").text(resp.incomeStatistics.netIncomeAmount || 0); |
| | | $("#couponDeductionAmount").text(resp.incomeStatistics.couponDeductionAmount || 0); |
| | | $("#refundAmount").text(resp.incomeStatistics.refundAmount || 0); |
| | | $("#totalIncome").text(formatStatisticNumber(resp.incomeStatistics.totalIncomeAmount)); |
| | | $("#netIncomeAmount").text(formatStatisticNumber(resp.incomeStatistics.netIncomeAmount)); |
| | | $("#couponDeductionAmount").text(formatStatisticNumber(resp.incomeStatistics.couponDeductionAmount)); |
| | | $("#refundAmount").text(formatStatisticNumber(resp.incomeStatistics.refundAmount)); |
| | | var incomeTypeNet = resp.incomeTypeNet || {}; |
| | | $("#fee1").text(incomeTypeNet[1] || 0); |
| | | $("#fee2").text(incomeTypeNet[2] || 0); |
| | | $("#fee3").text(incomeTypeNet[3] || 0); |
| | | $("#fee4").text(incomeTypeNet[4] || 0); |
| | | $("#fee5").text(incomeTypeNet[5] || 0); |
| | | $("#fee7").text(incomeTypeNet[6] || 0); |
| | | $("#fee1").text(formatStatisticNumber(incomeTypeNet[1])); |
| | | $("#fee2").text(formatStatisticNumber(incomeTypeNet[2])); |
| | | $("#fee3").text(formatStatisticNumber(incomeTypeNet[3])); |
| | | $("#fee4").text(formatStatisticNumber(incomeTypeNet[4])); |
| | | $("#fee5").text(formatStatisticNumber(incomeTypeNet[5])); |
| | | $("#fee7").text(formatStatisticNumber(incomeTypeNet[6])); |
| | | renderIncomeStatisticsList("yearIncomeStatistics", "历年营收明细", resp.yearLabels, resp.yearIncomeStatistics); |
| | | renderIncomeStatisticsList("monthIncomeStatistics", "本年各月营收明细", resp.monthLabels, resp.monthIncomeStatistics); |
| | | renderIncomeStatisticsList("weekIncomeStatistics", "近四周营收明细", resp.weekLabels, resp.weekIncomeStatistics); |