tax-cash-flow-analysis.ctl.js 4.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
frameworkModule.controller('dashboardTaxCashFlowAnalysisController', ["$scope", "$compile", "$timeout", "$translate",
    function ($scope, $compile, $timeout, $translate) {
    'use strict';

    /***************************************** DEMO CODE BEGIN *****************************************/
        //TODO:DEMO 数据正式版中应该动态取值
    var orgList = [
            { "ID": "root", "name": $translate.instant("HeaderCompany"), "expanded": true, "status": "未开始"},
            { "ID": "1", "categoryId": "root", "name": $translate.instant("CompanyA1"), "expanded": true, "status": "已提交" },
            { "ID": "2", "categoryId": 'root', "name": $translate.instant("CompanyA2"), "expanded": true, "status": "已提交" },
            { "ID": "3", "categoryId": 'root', "name": $translate.instant("CompanyA3"), "expanded": true, "status": "未开始" },
            { "ID": "4", "categoryId": 'root', "name": $translate.instant("CompanyA4"), "expanded": true, "status": "未开始" },
            { "ID": "5", "categoryId": 'root', "name": $translate.instant("CompanyA5"), "expanded": true, "status": "未开始" },
            { "ID": "6", "categoryId": "root", "name": $translate.instant("CompanyA6"), "expanded": true, "status": "未开始" }
        ];

    $scope.categoryAxisData = ['增值税', '消费税', '流转税附加税费', '印花税', '房产税', '土地使用税', '车船税', '土地增值税', '契税', '车辆购置税', '关税', '个人所得税', '企业所得税'];

    $scope.valueAxisData = [
        [100000, 80000, 20000, 100, 5000, 4000, 300, 1000, 500, 2000, 0, 30000, 50000],
        [105000, 78000, 21000, 150, 4600, 4200, 280, 880, 520, 1800, 0, 32000, 48000]
    ];

    /***************************************** DEMO CODE END *****************************************/

    $scope.display = 2;

    $scope.categorySelectorOption = {
        placeholder: $translate.instant('Category'),
        width: '15em',
        value: $translate.instant('Organization'),
        dataSource: [$translate.instant('BusinessUnit'), $translate.instant('Area'), $translate.instant('Organization'), $translate.instant('Industry')],
        onValueChanged: function (e) {
        }
    };

    $scope.selectedOrgIds = ["root"];
    $scope.selectOrgBoxOptions = {
        bindingOptions: {
            value: "selectedOrgIds"
        },
        dataSource: orgList,
        displayExpr: "name",
        valueExpr: "ID",
        placeholder: '. . .',
        showClearButton: false,
        width: '15em',
        treeView: {
            dataSource: orgList,
            dataStructure: "plain",
            focusStateEnabled: false,
            keyExpr: "ID",
            parentIdExpr: "categoryId",
            displayExpr: "name",
            selectByClick: true,
            selectNodesRecursive: false,
            showCheckBoxesMode: "none",
            selectionMode: 'single',
            treeViewInstance: null,
            onContentReady: function (e) {
                e.component.unselectAll();
                if ($scope.selectedOrgIds && $scope.selectedOrgIds.length > 0)
                    e.component.selectItem($scope.selectedOrgIds[0]);
            },
            onItemSelectionChanged: function (args) {
                var value = args.component.getSelectedNodesKeys();
                $scope.selectedOrgIds = value;
            }
        }
    };

    $scope.periodFrom = new Date();
    $scope.periodTo = new Date();
    var periodSelectorBasicOption = {
        bindingOptions: {
            value: null
        },
        acceptCustomValue: false,
        displayFormat: $translate.instant('dateFormat4YearMonthForDX'),
        maxZoomLevel: "year",
        minZoomLevel: "year",
        min: "2010/1/1",
        max: "2030/12/31",
        placeholder: ""
    };
    $scope.periodFromSelectorOption = $.extend(true, {}, periodSelectorBasicOption);
    $scope.periodFromSelectorOption.bindingOptions.value = "periodFrom";
    $scope.periodToSelectorOption = $.extend(true, {}, periodSelectorBasicOption);
    $scope.periodToSelectorOption.bindingOptions.value = "periodTo";
}]);