vat-account-mapping.js 2.1 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
vatModule.directive('vatAccountMapping', ['$log',
    function ($log) {
        'use strict';

        $log.debug('vatAccountMapping.ctor()...');

        return {
            restrict: 'E',
            templateUrl: '/app/vat/reduction/vat-account-mapping/vat-account-mapping.html' + '?_=' + Math.random(),
            replace: true,
            scope: {},
            controller: 'vatAccountMappingController',
            link: function ($scope, $element, $attr) {
                Split(['#left-container', '#right-container'], {
                    //An array of initial sizes of the elements, specified as percentage values. Example: Setting the initial sizes to 25% and 75%.
                    sizes: [78, 22],
                    //An array of minimum sizes of the elements, specified as pixel values. Example: Setting the minimum sizes to 100px and 300px, respectively.
                    minSize: [750, 250],
                    onDragEnd: function () {
                        //$timeout(function () {
                        //    $rootScope.$broadcast(enums.vatEvent.layoutChanged, {});
                        //}, 700);
                    }
                });
                $scope.token = $('input[name="__RequestVerificationToken"]').val();

                //企业科目列表和标准科目列表切换
                $scope.SwitchAccount = function () {
                    $('.subject-corresponding-container').toggle();
                    $('.std-subject-container').toggle();
                };

                $(".filter-select").on("click", function (e) {
                    e.stopPropagation();
                });

                $scope.showFilter = function () {
                    if ($('.filter-select').is(":hidden")) {
                        $(".filter-select").show();
                    } else {
                        $(".filter-select").hide();
                    }

                    $(document).one("click", function () {
                        $(".filter-select").hide();
                    });
                    event.stopPropagation();
                };
            }
        };
    }
]);