Browse Source

Merge remote-tracking branch 'origin/feature-201825-wangcz' into feature-201825-wangcz

liusw 7 years ago
parent
commit
8cd65fd9b7

+ 36 - 1
src/main/webapp/resources/css/admin.css

@@ -1193,4 +1193,39 @@ body div.ng-table-pager a.page-a{
 body div.ng-table-pager a.page-a:hover{
 	background: #3ba9e9 !important;
 	color: #fff;
-}
+}
+
+/*---------------------标准控件-单选框start---------------------*/
+/** html代码
+    <label class="com-check-radio">
+        <input type="radio" id="effect" name="radio">
+        <label for="effect"></label>
+        生效
+    </label>
+    <label class="com-check-radio">
+        <input type="radio" id="no-effect" name="radio" checked="checked">
+        <label for="no-effect"></label>
+        暂不生效
+    </label>
+**/
+.com-check-radio input[type='radio']{
+	display: none!important;
+	margin: 7px 8px 0!important;
+}
+.com-check-radio input[type='radio'] + label{
+	position: relative!important;
+	top: 7px!important;
+	margin-right: 5px!important;
+	display: inline-block!important;
+	width: 12px!important;
+	height: 12px!important;
+	font-weight: normal!important;
+	background: url(../img/icon/check-rule.png) no-repeat;
+}
+.com-check-radio label{
+	background-position: 0 0!important;
+}
+.com-check-radio input:checked + label{
+	background-position: -15px 0!important;
+}
+/*---------------------标准控件-单选框end---------------------*/

+ 7 - 0
src/main/webapp/resources/js/admin/app.js

@@ -826,6 +826,13 @@
             controller: 'b2bManageCtrl',
             controllerUrl: 'app/controllers/b2b/b2bManageCtrl',
             title: '贷款申请列表'
+        })).state('statsData', angularAMD.route({
+            // b2b后台管理
+            url: '/statsData',
+            templateUrl: 'static/view/admin/stats_data.html',
+            controller: 'statsDataCtrl',
+            controllerUrl: 'app/controllers/statsDataCtrl',
+            title: '数据统计数据'
 		}));
 		
 		$httpProvider.interceptors.push(['Loading', '$q', function(Loading, $q) {

+ 138 - 0
src/main/webapp/resources/js/admin/controllers/statsDataCtrl.js

@@ -0,0 +1,138 @@
+define([ 'app/app' ], function(app) {
+    //在售商品信息统计
+    app.register.controller('statsDataCtrl', ['$scope', 'Goods', 'toaster', 'ComponentActive', 'BrandActive', 'CommonCountAPI', function($scope, toaster, ComponentActive, BrandActive, Goods, CommonCountAPI) {
+
+        $scope.dateArea = 'autoMonth';
+
+        var _formatDate = function (date, fmt) {
+            if (!date) {
+                return null;
+            }
+            if (typeof date === 'string') {
+                date = new Date(Date.parse(date.replace(/-/g, '/')));
+            }
+            var o = {
+                'M+': date.getMonth() + 1, // 月份
+                'd+': date.getDate(), // 日
+                'h+': date.getHours(), // 小时
+                'm+': date.getMinutes(), // 分
+                's+': date.getSeconds(), // 秒
+                'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+                'S': date.getMilliseconds() // 毫秒
+            }
+            if (/(y+)/.test(fmt)) {
+                fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+            }
+            for (var k in o) {
+                if (new RegExp('(' + k + ')').test(fmt)) {
+                    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
+                }
+            }
+            return fmt;
+        };
+        var _getClearDay = function (date) {
+            return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
+        };
+        $scope.setFilters = function (type, val) {
+            $scope[type] = val;
+            if (type == 'dateArea') {
+                // 时间筛选
+                var currentTime = _getClearDay(new Date());
+                var endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
+                if (val == 'ALL' || val == 'autoMonth') {
+                    $scope.startDate = null;
+                    $scope.endDate = null;
+                } else if (val == 'oneMonth') {
+                    $scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
+                    $scope.endDate = endDate;
+                } else if (val == 'threeMonth') {
+                    $scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
+                    $scope.endDate = endDate;
+                } else if (val == 'sixMonth') {
+                    $scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
+                    $scope.endDate = endDate;
+                } else {
+                    $scope.startDate = null;
+                    $scope.endDate = null;
+                }
+            }
+        };
+
+        $scope.condition = [];
+        var start = {
+            open : false
+        };
+        var end = {
+            open : false
+        };
+        $scope.condition.push(start);
+        $scope.condition.push(end);
+        // 打开日期选择框
+        $scope.openDatePicker = function($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            openParam == 0 ? $scope.condition[1].open = false : $scope.condition[0].open = false;
+            item[openParam].open = !item[openParam].open;
+        };
+
+        $scope.onDateCondition = function (bool) {
+            var startTime = $scope.startDate ? $scope.startDate.getTime() : null;
+            var endTime = $scope.endDate ? $scope.endDate.getTime() : null;
+            if (startTime && endTime && startTime > endTime) {
+                if (bool == 1) {
+                    toaster.pop('info', '起始时间不能大于结束时间');
+                    $scope.startDate = null;
+                } else {
+                    toaster.pop('info', '结束时间不能小于起始时间');
+                    $scope.endDate = null;
+                }
+            }
+            if ($scope.endDate && bool == 2) {
+                $scope.endDate = new Date($scope.endDate.getFullYear(), $scope.endDate.getMonth(), $scope.endDate.getDate())
+                $scope.endDate = new Date($scope.endDate.getTime() + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
+            }
+
+        };
+        // 在售商品信息汇总
+        // Goods.getStatistics({}, {}, function(data) {
+        //     $scope.statistics = data;
+        // }, function(res) {
+        //     toaster.pop('error', '提示', '获取数据失败,请刷新页面');
+        // });
+
+        // // 各月新增器件数量
+        // ComponentActive.getIncreaseCount({}, function(data) {
+        //     $scope.increaseCmpCount = data;
+        // }, function (response) {
+        //     toaster.pop('error', '数据获取失败,请重试');
+        // });
+        //
+        // //各月新增品牌数量
+        // BrandActive.getIncreaseCount({}, function(data) {
+        //     $scope.increaseBrandCount = data;
+        // }, function (response) {
+        //     toaster.pop('error', '数据获取失败,请重试');
+        // });
+        //
+        // //各月新增批次数量
+        // Goods.getIncreaseBatch({}, function(data) {
+        //     $scope.increaseBatchCount = data;
+        // }, function (response) {
+        //     toaster.pop('error', '数据获取失败,请重试');
+        // });
+        //
+        // //各月新增在售器件数量
+        // Goods.getIncreaseCmp({}, function(data) {
+        //     $scope.increaseInSaleCmpCount = data;
+        // }, function (response) {
+        //     toaster.pop('error', '数据获取失败,请重试');
+        // });
+        //
+        // // 首页轮播数据统计
+        // CommonCountAPI.getActived({}, function (data) {
+        //     $scope.count = data;
+        // }, function (response) {
+        //     toaster.pop('error', '数据获取失败,请重试');
+        // });
+    }]);
+});

+ 5 - 0
src/main/webapp/resources/view/admin/index.html

@@ -36,6 +36,11 @@
 							<span class="green">9</span> b2b管理页面
 						</a>
 					</li>
+					<li>
+						<a href="#/statsData">
+							<span class="red">10</span>数据统计
+						</a>
+					</li>
 				</ul>
 			</div>
 		</div>

+ 372 - 0
src/main/webapp/resources/view/admin/stats_data.html

@@ -0,0 +1,372 @@
+<style>
+    .fl{
+        float:left;
+    }
+    .fr{
+        float:right;
+    }
+    #rootStats ul>li.newItem {
+        display: inline-block;
+        width: 22%;
+        border: 1px solid #ccc;
+        padding: 10px;
+        margin: 0 10px;
+    }
+
+    #rootStats ul>li.newItem .month,.count {
+        border: 1px solid #ccc;
+        padding: 5px;
+        font-family: sans-serif;
+        font-size: 15px;
+    }
+
+    #rootStats .newTitle {
+        font-weight: 600;
+    }
+    #rootStats .fullscreen .title span{
+        font-weight: bold;
+        margin-bottom:10px;
+        color:#333;
+    }
+
+    /*搜索时间筛选 start*/
+    #rootStats .screen {
+        position: absolute;
+        top: 15px;
+        left: 175px;
+        font-size: 14px;
+        font-weight: normal;
+        margin-right:10px;
+    }
+    #rootStats .com-check-radio{
+        font-size: 14px;
+        font-weight: normal;
+        line-height: 32px;
+        margin-right: 10px;
+        cursor:pointer;
+    }
+    #rootStats .screen .sreach .date{
+        margin:0 20px;
+    }
+    #rootStats .screen .sreach .date input{
+        width: 117px;
+        text-align: left;
+        border: 1px solid #5078cb;
+    }
+    #rootStats .screen .sreach .date input:hover{
+        cursor: pointer;
+    }
+    #rootStats .screen .sreach .date strong{
+        float: left;
+        line-height: 32px;
+        color: #999;
+        margin: 0 5px;
+    }
+    #rootStats .data-input{
+        float: left;
+        position: relative;
+    }
+    #rootStats .data-input button.open{
+        position: absolute;
+        right: 1px;
+        top: 1px;
+        width: 20px;
+        height: 30px;
+        background: url('static/img/user/images/xiala.png') right no-repeat #fff !important;
+        background-position-x: 100% !important;
+        border: none;
+    }
+    #rootStats .screen .sreach .date input.form-control{
+        padding: 6px 6px;
+        border-radius: 2px;
+        height:32px;
+    }
+</style>
+<div class="row-fluid sortable" id="rootStats">
+    <div class="box">
+        <div class="box-header well" data-original-title>
+            <i class="icon-user"></i> 信息统计
+        </div>
+        <div class="box-content row">
+            <div class="fullscreen" style="padding: 10px;">
+                <div class="col-sm-4 f14">
+                    <div class="form-group row title">
+                        <span class="col-sm-6 text-right">经营目标统计:</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+                <div class="col-sm-4 f14">
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+                <div class="col-sm-4 f14">
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="box">
+        <div class="box-header well" data-original-title style="position:relative;">
+            <i class="icon-user"></i> 更多数据统计
+            <!--搜索时间筛选-->
+            <div class="screen">
+                <div class="radio-block fl">
+                    日期区间:
+                    <label class="com-check-radio">
+                        <input type="radio" id="All" name="date" ng-click="setFilters('dateArea', 'All')" ng-checked="dateArea == 'All'">
+                        <label for="All"></label>
+                        全部
+                    </label>
+                    <label class="com-check-radio">
+                        <input type="radio" id="oneMonth" name="date" ng-click="setFilters('dateArea', 'oneMonth')" ng-checked="dateArea == 'oneMonth'">
+                        <label for="oneMonth"></label>
+                        一个月
+                    </label>
+                    <label class="com-check-radio">
+                        <input type="radio" id="threeMonth" name="date" ng-click="setFilters('dateArea', 'threeMonth')" ng-checked="dateArea == 'threeMonth'">
+                        <label for="threeMonth"></label>
+                        三个月
+                    </label>
+                    <label class="com-check-radio">
+                        <input type="radio" id="sixMonth" name="date" ng-click="setFilters('dateArea', 'sixMonth')" ng-checked="dateArea == 'sixMonth'">
+                        <label for="sixMonth"></label>
+                        六个月
+                    </label>
+                    <label class="com-check-radio">
+                        <input type="radio" id="autoMonth" name="date" ng-click="setFilters('dateArea', 'autoMonth')" ng-checked="dateArea == 'autoMonth'">
+                        <label for="autoMonth"></label>
+                        自定义
+                    </label>
+                </div>
+                <div class="sreach fr">
+                    <div  ng-show="dateArea == 'autoMonth'" class="date fl">
+                        <div class="data-input">
+                            <input id="start" type="text" ng-model="startDate" readonly="readonly"
+                                   class="form-control select-adder" placeholder="起始时间"
+                                   datepicker-popup="yyyy-MM-dd"
+                                   is-open="condition[0].open"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-click="openDatePicker($event, condition, 0,1)"
+                                   ng-change="onDateCondition(1)"/>
+                            <button class="open" ng-click="openDatePicker($event, condition, 0)"></button>
+                        </div>
+                        <strong>–</strong>
+                        <div class="data-input">
+                            <input id="end" type="text" ng-model="endDate" readonly="readonly"
+                                   class="form-control select-adder" placeholder="结束时间"
+                                   datepicker-popup="yyyy-MM-dd"
+                                   is-open="condition[1].open"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-click="openDatePicker($event, condition, 1, 2)"
+                                   ng-change="onDateCondition(2)"/>
+                            <button class="open" ng-click="openDatePicker($event, condition, 1)"></button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="box-content row">
+            <div class="fullscreen" style="padding: 10px;">
+                <div class="col-sm-4 f14">
+                    <div class="form-group row title">
+                        <span class="col-sm-6 text-right">经营目标统计:</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+                <div class="col-sm-4 f14">
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+                <div class="col-sm-4 f14">
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品型号数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.codes | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品类目数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.kinds | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售产品品牌数量:</span>
+                        <span class="col-sm-4" ng-bind="statistics.brands | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">库存合计:</span>
+                        <span class="col-sm-4" ng-bind="statistics.reserves | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMB | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">未税金额合计(RMB):</span>
+                        <span class="col-sm-5 text-num">¥
+							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
+						</span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">含税金额合计:</span>
+                        <span class="col-sm-4">批次RMB最高单价*库存数量</span>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>