huangc 7 rokov pred
rodič
commit
87b62f95ef

+ 4 - 1
scss/linker.scss

@@ -2203,7 +2203,10 @@ ion-header-bar {
     margin-top: 10px;
 }
 
-
+.col-5 {
+    @include flex(0, 0, 5%);
+    max-width: 5%;
+}
 
 
 

+ 51 - 0
www/apps/audit/index.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
+    <!--     <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"> -->
+    <title></title>
+
+    <!-- compiled css output -->
+    <link href="/css/ionic.app.min.css" rel="stylesheet">
+    <link href="/css/linker.min.css" rel="stylesheet">
+
+
+
+    <script src="/lib/ionic/js/ionic.bundle.min.js"></script>
+    <!-- cordova script (this will be a 404 during development) -->
+    <script src="/lib/ngCordova/dist/ng-cordova.min.js"></script>
+    <!-- cordova script (this will be a 404 during development) -->
+    <script src="/cordova.js"></script>
+    <!-- your app's js -->
+    <script src="/lib/underscore/underscore-min.js"></script>
+    <script src="/lib/angular-resource/angular-resource.min.js"></script>
+    <script src="/lib/angular-underscore-module/angular-underscore-module.js"></script>
+    <script src="/lib/angular-translate/angular-translate.min.js"></script>
+    <script src="/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
+    <script src="/js/starter.js"></script>
+    <script src="js/route.js"></script>
+    <script src="js/controllers.js"></script>
+    <script src="js/directive.js"></script>
+    <script src="js/factory.js"></script>
+</head>
+
+<body ng-app="starter" ng-cloak>
+<!--
+  The nav bar that will be updated as we navigate between views.
+-->
+<ion-nav-bar class="bar-stable" ng-cloak>
+    <ion-nav-back-button class="button ion-chevron-left button-clear button-dark">
+        {{'backTitle' | translate}}
+    </ion-nav-back-button>
+</ion-nav-bar>
+<!--
+  The views will be rendered in the <ion-nav-view> directive below
+  Templates are in the /templates folder (but you could also
+  have templates inline in this html file if you'd like).
+-->
+<ion-nav-view></ion-nav-view>
+</body>
+</html>
+

+ 313 - 0
www/apps/audit/js/controllers.js

@@ -0,0 +1,313 @@
+starter.controller('AuditCtrl', function ($rootScope, $scope, $state, $ionicActionSheet, $window, $timeout, Audit, global, formatFilter) {
+    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function (event, data) {
+        global.fetch_user().then(function () {
+            getcountdata();
+        });
+    });
+
+    $scope.doRefresh = function () {
+        getcountdata();
+    }
+
+    $scope.show = function () {
+        $ionicActionSheet.show({
+            buttons: [
+                {text: '过滤条件'}
+            ],
+            titleText: '设置',
+            cancelText: '取消',
+            buttonClicked: function (index) {
+                if (index == 0)
+                    $state.go('audit-filter');
+            }
+        });
+    };
+
+    function getcountdata() {
+        if (global.user.token != "") {
+            Audit.Audit('GetAuditCounts').save(Audit.getFilter(), function (data) {
+                $scope.count = data;
+            }, function (err) {
+                if (err.status == 401 && _.has(err.data, 'IsAuth'))
+                    $window.location.href = formatFilter("http://" + $window.location.host + "/apps/authuser/index.html");
+            }).$promise.finally(function () {
+                $scope.$broadcast('scroll.refreshComplete');
+            });
+        }
+    }
+
+    var CountDoRefresh = $rootScope.$on('CountDoRefresh', function (event ,data) {
+        getcountdata();
+    })
+
+    $scope.$on('$destroy', function () {
+        beforeEnter();
+        CountDoRefresh();
+    })
+})
+
+.controller('FilterCtrl', function ($rootScope, $scope, $state, Audit, showPopup) {
+    showPopup.modalTemplate('templates/modal-selectdate.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.select_date_modal = modal;
+    });
+
+    $scope.filter = Audit.getFilter();
+    $scope.chkdd_tv_arr = Audit.chkdd_tv_arr;
+    $scope.clearLocalStorage = function () {
+        window.localStorage.clear();
+        $scope.filter = Audit.getFilter();
+    }
+
+    $scope.showModal = function () {
+        $scope.select_date_modal.show();
+        $rootScope.commons.modal = $scope.select_date_modal;
+    }
+
+    $scope.closeModal = function () {
+        Audit.setFilter($scope.filter);
+        $rootScope.commons.modal.hide();
+    }
+
+    var watchFilter = $scope.$watch('filter.substitutechk', function (n, o) {
+        if (n == o)
+            return;
+        Audit.setFilter($scope.filter);
+    });
+
+    $scope.$on('$destroy', function () {
+        if ($rootScope.commons.modal)
+            $rootScope.commons.modal = null;
+        $scope.select_date_modal.remove();
+        watchFilter();
+    })
+})
+
+.controller('ListCtrl', function ($rootScope, $scope, $state, $stateParams, Audit, global, Tool) {
+    $scope.QueryID = $stateParams.QueryID;
+    global.fetch_user().then(function () {
+        getlistdata();
+    });
+
+    $scope.doRefresh = function () {
+        getlistdata();
+    }
+
+    $scope.todetails = function (item) {
+        $state.go('audit-detail', {
+            QueryID: $scope.QueryID,
+            BIL_ID: item.bil_id,
+            BIL_NO: item.no,
+            BIL_ITM: item.bil_itm,
+            IsAuditCall: 'T',
+            CheckInAudit: 'T'
+        })
+    }
+
+    $scope.loadMore = function () {
+        if ($scope.list != undefined && $scope.list.next != null) {
+            Tool.get($scope.list.next).then(function (data) {
+                $scope.list.Data = $scope.list.Data.concat(data.Data);
+                $scope.list.next = data.next;
+                $scope.list.previous = data.previous;
+            }).finally(function () {
+                $scope.$broadcast('scroll.infiniteScrollComplete');
+                $scope.loading = false;
+            });
+        } else {
+            $scope.$broadcast('scroll.infiniteScrollComplete');
+        }
+    }
+
+    $scope.moreCanBeLoaded = function () {
+        return $scope.list != undefined && $scope.list.next != null;
+    }
+
+    function getlistdata() {
+        if (global.user.token != "") {
+            if ($scope.list == undefined) {
+                $scope.loading = true;
+            }
+            Audit.Audit('GetAuditLists').save({QueryID: $scope.QueryID, page: 1}, Audit.getFilter(), function (data) {
+                $scope.list = data;
+            }, function (err) {
+                alert(JSON.stringify(err));
+            }).$promise.finally(function () {
+                $scope.$broadcast('scroll.refreshComplete');
+                $scope.loading = false;
+            });
+        }
+    }
+
+    var ListDoRefresh = $rootScope.$on('ListDoRefresh', function (event ,data) {
+        getlistdata();
+    })
+
+    $scope.$on('$destroy', function () {
+        ListDoRefresh();
+    })
+})
+
+.controller('DetailHeadCtrl', function ($rootScope, $scope, $state, $stateParams, $cordovaDialogs, $ionicModal, global, cfg, Audit, showPopup, formatFilter) {
+    $scope.QueryID = $stateParams.QueryID;
+    $scope.BIL_ID = $stateParams.BIL_ID;
+    $scope.BIL_NO = $stateParams.BIL_NO;
+    $scope.BIL_ITM = $stateParams.BIL_ITM;
+    $scope.IsAuditCall = $stateParams.IsAuditCall;
+    $scope.CheckInAudit = $stateParams.CheckInAudit;
+    showPopup.modalTemplate('templates/modal-routeaudit.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.route_audit_modal = modal;
+    });
+    showPopup.modalTemplate('templates/modal-imagepopover.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.image_popover_modal = modal;
+    });
+
+    global.fetch_user().then(function () {
+        getbilldata();
+    });
+
+    $scope.goBack = function () {
+        global.goBack();
+    }
+
+    $scope.tobody = function (name) {
+        if (name != 'BODY_COUNT')
+            return;
+        Audit.body = $scope.detail.body;
+        $state.go('audit-detail-body');
+    }
+
+    $scope.audit = function (op) {
+        $scope.data = {};
+        if (op == 1 && $scope.QueryID == 1) {
+            setPopup('同意', '请输入备注(选填)', op);
+        } else if (op == 2 && $scope.QueryID == 1) {
+            setPopup('驳回', '请输入驳回理由(必填)', op);
+        } else if (op == 3 && $scope.QueryID == 2) {
+            setPopup('反审批', '请输入备注(选填)', op);
+        } else if (op == 4 && $scope.QueryID == 1) {
+            postAudit($scope.data);
+        }
+    }
+
+    $scope.doRefresh = function () {
+        getbilldata();
+    }
+
+    $scope.showImages = function (index, event) {
+        $scope.activeSlide = index;
+        $scope.image_popover_modal.show();
+        $rootScope.commons.modal = $scope.image_popover_modal;
+    }
+
+    function getbilldata() {
+        if (global.user.token != "") {
+            if ($scope.detail == undefined) {
+                $scope.loading = true;
+            }
+            Audit.Bills('GetBilHeadDetails').get({
+                QueryID: $scope.QueryID,
+                BIL_ID: $scope.BIL_ID,
+                BIL_NO: $scope.BIL_NO,
+                BIL_ITM: $scope.BIL_ITM,
+                IsAuditCall: $scope.IsAuditCall,
+                CheckInAudit: $scope.CheckInAudit
+            }, function (data) {
+                $scope.detail = data;
+                $scope.detail.group = _.values(_.groupBy(data.Data, function (item) {
+                    return item.GROUPID;
+                }));
+                getshlcdata();
+                Audit.Bills('GetBilAttrFileList').get({BIL_ID: $scope.BIL_ID, BIL_NO: $scope.BIL_NO}, function (data) {
+                    $scope.detail.files = data;
+                    $scope.detail.imagefiles = _.filter($scope.detail.files.Data, function (item) {
+                        return item.FILE_TYPE == '.BMP' || item.FILE_TYPE == '.JPEG' || item.FILE_TYPE == '.JPG' || item.FILE_TYPE == '.GIF' || file.FILE_TYPE != '.PNG'
+                    });
+                    _.each($scope.detail.imagefiles, function (item) {
+                       item.url = formatFilter('{0}ext_erp/{1}', cfg.api, item.FILE_URL);
+                    })
+                }, function (err) {
+                    alert(JSON.stringify(err));
+                });
+                Audit.Bills('GetBilBodyDetails').get({BIL_ID: $scope.BIL_ID, BIL_NO: $scope.BIL_NO, BIL_ITM: $scope.BIL_ITM}, function (data) {
+                    $scope.detail.body = data;
+                }, function (err) {
+                    alert(JSON.stringify(err));
+                });
+            }, function (err) {
+                alert(JSON.stringify(err));
+            }).$promise.finally(function () {
+                $scope.$broadcast('scroll.refreshComplete');
+                $scope.loading = false;
+            });
+        }
+    }
+
+    function getshlcdata() {
+        Audit.Audit('GetAuditSHLC').get({BIL_ID: $scope.BIL_ID, BIL_NO: $scope.BIL_NO, BIL_ITM: $scope.BIL_ITM}, function (data) {
+            $scope.detail.shlc = data;
+        }, function (err) {
+            alert(JSON.stringify(err));
+        });
+    }
+
+    function setPopup(title, placeholdertext, op) {
+        $cordovaDialogs.prompt(placeholdertext, title, ['确定', '取消']).then(function (result) {
+            var input = result.input1;
+            var btnIndex = result.buttonIndex;
+            if (btnIndex == 1) {
+                if ( op == 2 && (input == '' || input == null)) {
+                    $cordovaDialogs.alert('请填写驳回理由', '提示', '确定');
+                } else {
+                    $scope.data = {
+                        PROCID: op,
+                        BIL_ID: $scope.BIL_ID,
+                        BIL_NO: $scope.BIL_NO,
+                        BIL_ITM: $scope.BIL_ITM,
+                        REM_SH: input == '' || input == null ? null : input,
+                        NodeIndex: null
+                    }
+                    showPopup.showLoading(1, '正在提交');
+                    postAudit($scope.data);
+                }
+            }
+        });
+    }
+
+    function postAudit(data) {
+        Audit.Audit('ExecuteAudit').save(data, function (data) {
+            $scope.nodeData = data.NodeData;
+            if (data.hasExistsNode == 'T') {
+                $scope.route_audit_modal.show();
+                $rootScope.commons.modal = $scope.route_audit_modal;
+            } else {
+                $scope.$emit('ListDoRefresh');
+                $scope.$emit('CountDoRefresh');
+                getshlcdata();
+            }
+        }, function (err) {
+            showPopup.PopupWindow(0, err.message)
+        }).$promise.finally(function () {
+            showPopup.hideLoading();
+        })
+    }
+
+    $scope.$on('$destroy', function () {
+        if ($rootScope.commons.modal)
+            $rootScope.commons.modal = null;
+        $scope.route_audit_modal.remove();
+    })
+})
+
+.controller('DetailBodyCtrl', function ($scope, $state, Audit) {
+    $scope.body = angular.copy(Audit.body);
+    $scope.toitem = function (item) {
+        Audit.bodyitem = item;
+        $state.go('audit-body-data');
+    }
+})
+
+.controller('BodyDataCtrl', function ($scope, Audit) {
+    $scope.bodyitem = _.values(_.groupBy(angular.copy(Audit.bodyitem), function (item) {
+        return item.GROUPID;
+    }));
+})

+ 32 - 0
www/apps/audit/js/directive.js

@@ -0,0 +1,32 @@
+starter.directive('httpSrc', function ($http, global) {
+    return {
+        restrict: "A",
+        link: function (scope, element, attrs) {
+            var requestConfig = {
+                method: 'GET',
+                responseType: 'arraybuffer',
+                cache: 'true'
+            };
+
+            function base64Img(data) {
+                var arr = new Uint8Array(data);
+                var raw = '';
+                var i, j, subArray, chunk = 5000;
+                for (i = 0, j = arr.length; i < j; i += chunk) {
+                    subArray = arr.subarray(i, i + chunk);
+                    raw += String.fromCharCode.apply(null, subArray);
+                }
+                return btoa(raw);
+            };
+
+            attrs.$observe('httpSrc', function (newValue) {
+                requestConfig.url = newValue;
+                global.fetch_user().then(function () {
+                    $http(requestConfig).then(function (data) {
+                        attrs.$set('src', "data:image/jpeg;base64," + base64Img(data.data));
+                    });
+                });
+            });
+        }
+    }
+})

+ 38 - 0
www/apps/audit/js/factory.js

@@ -0,0 +1,38 @@
+starter.factory('Audit', function ($resource, $q, $filter, cfg, formatFilter) {
+    var audit = {};
+    audit.body = {};
+    audit.bodyitem = [];
+    audit.chkdd_tv_arr = ['不限制', '当日', '本周', '上周', '本月', '上月', '本季', '上季', '本年', '去年'];
+
+    audit.Audit = function (type) {
+        return $resource(formatFilter('{0}ext_erp/Audit/{1}/', cfg.api, type))
+    }
+    audit.Bills = function (type) {
+        return $resource(formatFilter('{0}ext_erp/Bills/{1}/', cfg.api, type))
+    }
+
+    audit.getFilter = function () {
+        var filter = window.localStorage.getItem('auditFilter');
+        if (filter) {
+            filter = JSON.parse(filter);
+        } else {
+            filter = {
+                chkdd_tv:0,
+                bil_id_tv:null,
+                b_no_tv:null,
+                e_no_tv:null,
+                b_cus_tv:null,
+                e_cus_tv:null,
+                substitutechk:true
+            };
+            window.localStorage['auditFilter'] = JSON.stringify(filter);
+        }
+        return filter;
+    }
+
+    audit.setFilter = function (filter) {
+        window.localStorage['auditFilter'] = JSON.stringify(filter);
+    }
+
+    return audit;
+})

+ 48 - 0
www/apps/audit/js/route.js

@@ -0,0 +1,48 @@
+starter.config(function ($stateProvider, $httpProvider) {
+    $stateProvider.state('audit', {
+        url: '/index',
+        templateUrl: 'templates/audit.html',
+        controller: 'AuditCtrl'
+    })
+
+    .state('audit-filter', {
+        url: '/filter',
+        templateUrl: 'templates/filter.html',
+        controller: 'FilterCtrl'
+    })
+
+    .state('audit-list', {
+        url: '/list/:QueryID',
+        templateUrl: 'templates/list.html',
+        controller: 'ListCtrl'
+    })
+
+    .state('audit-detail', {
+        url: '/detail/:QueryID&:BIL_ID&:BIL_NO&:BIL_ITM&:IsAuditCall&:CheckInAudit',
+        templateUrl: 'templates/detailhead.html',
+        controller: 'DetailHeadCtrl'
+    })
+
+    .state('audit-detail-body', {
+        url: '/detail-body/',
+        templateUrl: 'templates/detailbody.html',
+        controller: 'DetailBodyCtrl'
+    })
+
+    .state('audit-body-data', {
+        url: '/body-data/',
+        templateUrl: 'templates/bodydata.html',
+        controller: 'BodyDataCtrl'
+    });
+
+    $httpProvider.interceptors.push(function ($q, cfg, global) {
+        return {
+            'request': function (config) {
+                if (config.url.indexOf("ext_erp") != -1) {//分页时自带了请求路径
+                    config.headers['cid'] = JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone});
+                }
+                return config;
+            }
+        };
+    });
+});

+ 27 - 0
www/apps/audit/templates/audit.html

@@ -0,0 +1,27 @@
+<ion-view view-title="审批" hide-back-button="true">
+    <ion-nav-buttons side="left">
+        <ion-back-button></ion-back-button>
+    </ion-nav-buttons>
+    <ion-nav-buttons side="right">
+        <button class="button button-clear" ng-click="show()">
+            <i class="icon ion-ios-more"></i>
+        </button>
+    </ion-nav-buttons>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <div class="item item-divider"></div>
+        <a class="item item-icon-left item-icon-right" ng-href="#/list/1">待审核
+            <i class="icon ion-ios-paper-outline positive" ></i>
+            <span ng-show="count.SHCOUNT1 >= 1" class="badge badge-assertive">{{count.SHCOUNT1}}</span>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </a>
+        <div class="item item-divider"></div>
+        <a class="item item-icon-left item-icon-right" ng-href="#/list/2">已审核
+            <i class="icon ion-ios-list-outline positive" ></i>
+            <span ng-show="count.SHCOUNT2 >= 1" class="badge badge-assertive">{{count.SHCOUNT2}}</span>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </a>
+
+        <!--<div class="button button-positive button-full" ng-click="downloadfile()">下载文件</div>-->
+    </ion-content>
+</ion-view>

+ 11 - 0
www/apps/audit/templates/bodydata.html

@@ -0,0 +1,11 @@
+<ion-view view-title="表身详情">
+    <ion-content>
+        <div ng-repeat="item in bodyitem">
+            <ion-item class="item-divider"></ion-item>
+            <ion-item class="item-text-wrap over-flow-auto" ng-repeat="i in item">
+                {{i.TITILE}}
+                <span class="item-note max-width-45">{{i.VALUE}}</span>
+            </ion-item>
+        </div>
+    </ion-content>
+</ion-view>

+ 9 - 0
www/apps/audit/templates/detailbody.html

@@ -0,0 +1,9 @@
+<ion-view view-title="表身列表">
+    <ion-content>
+        <div class="item" ng-if="!loading" ng-repeat="item in body.Data" ng-click="toitem(item.RowData)">
+            {{item.no}}
+            <span class="item-note">{{item.bil_date}}</span>
+            <p> {{item.name}},{{item.bil_usr}} </p>
+        </div>
+    </ion-content>
+</ion-view>

+ 64 - 0
www/apps/audit/templates/detailhead.html

@@ -0,0 +1,64 @@
+<ion-view view-title="单据详情" hide-back-button="true">
+    <ion-nav-buttons side="left">
+        <button class="button ion-chevron-left button-clear button-dark" ng-click="goBack()">&nbsp;{{'backTitle' | translate}}</button>
+    </ion-nav-buttons>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
+        <div  ng-if="!loading">
+            <!-- 表头 -->
+            <div ng-repeat="item in detail.group">
+                <ion-item class="item-divider"></ion-item>
+                <ion-item class="item-text-wrap over-flow-auto" ng-class="{'item-icon-right':i.NAME == 'BODY_COUNT'}" ng-repeat="i in item" ng-click="tobody(i.NAME)">
+                    {{i.TITILE}}
+                    <span class="item-note max-width-45">{{i.VALUE}}</span>
+                    <i ng-if="i.NAME == 'BODY_COUNT'" class="icon ion-chevron-right icon-accessory"></i>
+                </ion-item>
+            </div>
+            <!-- 附件 -->
+            <div ng-if="detail.files.Data.length - detail.imagefiles.length > 0">
+                <ion-item class="item-divider">共[{{detail.files.Data.length - detail.imagefiles.length}}]个附件</ion-item>
+                <ion-item class="item-icon-right" ng-repeat="file in detail.files.Data" ng-if="file.FILE_TYPE != '.BMP' && file.FILE_TYPE != '.JPEG' && file.FILE_TYPE != '.JPG' && file.FILE_TYPE != '.GIF' && file.FILE_TYPE != '.PNG'">
+                    {{file.FILE_NAME}}
+                    <i class="icon ion-chevron-right icon-accessory"></i>
+                </ion-item>
+            </div>
+            <!-- 照片 -->
+            <div ng-if="detail.imagefiles.length > 0">
+                <ion-item class="item-divider">共[{{detail.imagefiles.length}}]张照片</ion-item>
+                <ion-item>
+                    <img style="width: 48px; height: 48px; margin: 3px; background-color: #F5F5F5; border-radius: 2px; " ng-repeat='image in detail.imagefiles' ng-click='showImages($index,$event)' http-src='{{image.url}}' class='img-popver-pad'/>
+                </ion-item>
+            </div>
+            <!-- 审核流程 -->
+            <ion-item class="item-divider"></ion-item>
+            <div ng-repeat="s in detail.shlc.Data">
+                <ion-item class="item-icon-left">
+                    <i class="icon" ng-class="{'ion-ios-help positive':s.Tag == 0, 'ion-ios-close assertive':s.Tag == 1, 'ion-ios-checkmark balanced':s.Tag == 2, 'ion-ios-redo energized':s.Tag != 0 && s.Tag != 1 && s.Tag != 2}" ></i>
+                    {{s.UsrName}}
+                    <span class="item-note">{{s.DateStr}}</span>
+                    <p>{{s.Rem}}</p>
+                </ion-item>
+                <div ng-if="!$last" class="item item-divider center">
+                    <i class="icon ion-chevron-down positive" style="font-size: 14px;"></i>
+                </div>
+            </div>
+            <ion-item class="item-divider"></ion-item>
+            <ion-item ng-if="detail.IsInAudit" class="item-divider-ios"></ion-item>
+        </div>
+    </ion-content>
+    <ion-footer-bar ng-if="!loading && detail.IsInAudit">
+        <div class="bar bar-footer" ng-if="QueryID == 1">
+            <div class="col-5"></div>
+            <button class="button button-balanced col-40" ng-click="audit(1)" >同意</button>
+            <div class="col-10"></div>
+            <button class="button button-energized col-40" ng-click="audit(2)">驳回</button>
+            <div class="col-5"></div>
+        </div>
+        <div class="bar bar-footer" ng-if="QueryID == 2">
+            <div class="col-10"></div>
+            <button class="button button-energized col-80" ng-click="audit(3)">反审核</button>
+            <div class="col-10"></div>
+        </div>
+    </ion-footer-bar>
+</ion-view>

+ 32 - 0
www/apps/audit/templates/filter.html

@@ -0,0 +1,32 @@
+<ion-view view-title="过滤条件">
+    <ion-nav-buttons side="right">
+        <button class="button button-clear" ng-click="clearLocalStorage()">清除</button>
+    </ion-nav-buttons>
+    <ion-content>
+        <!--<a class="item item-icon-right" ng-href="">单据别-->
+            <!--<span class="item-note">{{filter.bil_id_tv}}</span>-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <a class="item item-icon-right" ng-click="showModal()">起止日期自动取值
+            <span class="item-note">{{filter.chkdd_tv}}.{{chkdd_tv_arr[filter.chkdd_tv]}}</span>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </a>
+        <!--<a class="item item-icon-right" ng-href="">起始单号-->
+            <!--<span class="item-note">{{filter.b_no_tv}}</span>-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <!--<a class="item item-icon-right" ng-href="">截止单号-->
+            <!--<span class="item-note">{{filter.e_no_tv}}</span>-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <!--<a class="item item-icon-right" ng-href="">起始客户厂商-->
+            <!--<span class="item-note">{{filter.b_cus_tv}}</span>-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <!--<a class="item item-icon-right" ng-href="">截止客户厂商-->
+            <!--<span class="item-note">{{filter.e_cus_tv}}</span>-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <ion-toggle ng-model="filter.substitutechk" toggle-class="toggle-balanced">列示代理审核单据</ion-toggle>
+    </ion-content>
+</ion-view>

+ 13 - 0
www/apps/audit/templates/list.html

@@ -0,0 +1,13 @@
+<ion-view view-title="{{QueryID == 1 ? '待审核' : QueryID == 2 ? '已审核' : null}}">
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
+        <div class="item item-divider">{{QueryID == 1 ? '需要我审批的' : QueryID == 2 ? '可以进行反审核的' : null}}</div>
+        <ion-item ng-if="!loading" ng-repeat="item in list.Data" ng-click="todetails(item)">
+            {{item.no}}
+            <span class="item-note">{{item.bil_date}}</span>
+            <p> {{item.name}},{{item.bil_usr}} </p>
+        </ion-item>
+        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
+    </ion-content>
+</ion-view>

+ 7 - 0
www/apps/audit/templates/modal-imagepopover.html

@@ -0,0 +1,7 @@
+<div class="modal image-modal transparent" ng-click="$root.commons.modal.hide()">
+    <ion-slide-box on-slide-changed="slideChanged(index)" show-pager="true" active-slide="activeSlide" class="popover-backdrop1">
+        <ion-slide ng-repeat="image in detail.imagefiles">
+            <img http-src="{{image.url}}" class="fullscreen-image" ng-pinch-zoom/>
+        </ion-slide>
+    </ion-slide-box>
+</div>

+ 17 - 0
www/apps/audit/templates/modal-routeaudit.html

@@ -0,0 +1,17 @@
+<ion-modal-view>
+    <ion-header-bar class="bar bar-header">
+        <button class="button button-clear button-calm" ng-click="$root.commons.modal.hide()">取消</button>
+        <h1 class="title">下一步审批人</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-radio ng-model="data.NodeIndex" ng-value="node.NodeIndex" ng-repeat="node in nodeData">{{node.NodeIndex}}.{{node.NodeName}}</ion-radio>
+    </ion-content>
+    <ion-footer-bar keyboard-attach class="bar-stable">
+        <div class="bar bar-footer item-input-inset">
+            <label class="item-input-wrapper radius-30">
+                <input type="text" ng-model="data.REM_SH" placeholder="备注">
+            </label>
+            <button class="button button-positive" ng-click="audit(4)">提交</button>
+        </div>
+    </ion-footer-bar>
+</ion-modal-view>

+ 13 - 0
www/apps/audit/templates/modal-selectdate.html

@@ -0,0 +1,13 @@
+<ion-modal-view>
+    <ion-header-bar>
+        <button class="button ion-chevron-left button-clear button-dark" ng-click="$root.commons.modal.hide()">&nbsp;返回</button>
+        <h1 class="title">起止日期自动取值</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-list>
+            <ion-radio ng-repeat="chkdd in chkdd_tv_arr" ng-model="filter.chkdd_tv" ng-value="$index" ng-click="closeModal()">
+                {{$index}}.{{chkdd}}
+            </ion-radio>
+        </ion-list>
+    </ion-content>
+</ion-modal-view>

+ 52 - 0
www/apps/erpbx/index.html

@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
+    <!--     <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"> -->
+    <title></title>
+
+    <!-- compiled css output -->
+    <link href="/css/ionic.app.min.css" rel="stylesheet">
+    <link href="/css/linker.min.css" rel="stylesheet">
+    <link href="/css/timeline.css" rel="stylesheet">
+
+
+    <script src="/lib/ionic/js/ionic.bundle.min.js"></script>
+    <!-- cordova script (this will be a 404 during development) -->
+    <script src="/lib/ngCordova/dist/ng-cordova.min.js"></script>
+    <!-- cordova script (this will be a 404 during development) -->
+    <script src="/cordova.js"></script>
+    <!-- your app's js -->
+    <script src="/lib/underscore/underscore-min.js"></script>
+    <script src="/lib/angular-resource/angular-resource.min.js"></script>
+    <script src="/lib/angular-underscore-module/angular-underscore-module.js"></script>
+    <script src="/lib/angular-translate/angular-translate.min.js"></script>
+
+    <script src="/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
+    <script src="/js/starter.min.js"></script>
+    <script src="js/route.js"></script>
+    <script src="js/controllers.js"></script>
+    <script src="js/directive.js"></script>
+    <script src="js/factory.js"></script>
+</head>
+
+<body ng-app="starter" ng-cloak>
+<!--
+  The nav bar that will be updated as we navigate between views.
+-->
+<ion-nav-bar class="bar-stable" ng-cloak>
+    <ion-nav-back-button class="button ion-chevron-left button-clear button-dark">
+        返回
+    </ion-nav-back-button>
+</ion-nav-bar>
+<!--
+  The views will be rendered in the <ion-nav-view> directive below
+  Templates are in the /templates folder (but you could also
+  have templates inline in this html file if you'd like).
+-->
+<ion-nav-view></ion-nav-view>
+</body>
+</html>
+

+ 606 - 0
www/apps/erpbx/js/controllers.js

@@ -0,0 +1,606 @@
+starter.controller('ErpBxCtrl', function ($rootScope, $scope, $state, $window, $ionicPopover, global, ErpBx) {
+    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function (event, data) {
+        global.fetch_user().then(function () {
+            gettaxrtodata();
+        });
+    });
+
+    global.fetch_user().then(function () {
+        getrecorddata();
+    });
+
+    $ionicPopover.fromTemplateUrl('templates/paymenu.html', {
+        scope: $scope
+    }).then(function (popover) {
+        $scope.popover = popover;
+    });
+
+    $scope.torecord = function (record) {
+        if (record) {
+            ErpBx.recordItem = record;
+            $state.go('erpbx-record', {
+                id: record.id
+            });
+        } else {
+            $scope.popover.hide();
+            $state.go('erpbx-record', {
+                id: -1
+            });
+        }
+    };
+
+    $scope.toaudit = function () {
+
+    }
+
+    $scope.tobill = function () {
+        $scope.popover.hide();
+        $state.go('erpbx-bill', {
+            id: -1
+        });
+    };
+
+    $scope.doRefresh = function () {
+        getrecorddata();
+    }
+
+    function gettaxrtodata() {
+        ErpBx.linkerBX('GetTaxRto').get(function (data) {
+            ErpBx.taxrto = data.taxrto;
+        })
+    }
+
+    function getrecorddata() {
+        ErpBx.linkerBX('GetBX').query(function (data) {
+            $scope.records = data;
+            ErpBx.recordlist = data;
+        }, function (err) {
+            if (err.status == 401 && _.has(err.data, 'IsAuth'))
+                $window.location.href = formatFilter("http://" + $window.location.host + "/apps/authuser/index.html");
+        }).$promise.finally(function () {
+            $scope.$broadcast('scroll.refreshComplete');
+        })
+    }
+
+    var RecordListDoRefresh = $rootScope.$on('RecordListDoRefresh', function (event ,data) {
+        getrecorddata();
+    })
+
+    $scope.$on('$destroy', function () {
+        RecordListDoRefresh();
+        beforeEnter();
+    })
+})
+
+.controller('ErpBxRecordCtrl', function ($rootScope, $scope, $state, $cordovaDatePicker, $ionicHistory, $cordovaDialogs, global, showPopup, ErpBx, Tool, formatFilter, cfg) {
+    $scope.recordid = $state.params['id'];
+    $scope.taxCategory = ['', '不计税', '税内含', '税外加'];
+    $scope.deleteimage_list = [];
+
+    var watch = null;
+    showPopup.modalTemplate('templates/modal-selecttax.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.select_tax_modal = modal;
+    });
+    showPopup.modalTemplate('templates/modal-selecttype.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.select_type_modal = modal;
+    });
+    var isModified = false;
+    $scope.language = global.language;
+
+    global.fetch_user().then(function () {
+        if ($scope.recordid == -1) {
+            gettypedata();
+            $scope.record = {
+                fee_id: null,
+                fee_name: null,
+                fee_eng_name: null,
+                tax_id: 1,
+                amt: null,
+                tax_rto: ErpBx.taxrto,
+                tax: null,
+                inv_no: null,
+                bx_dd: new Date(),
+                rem: null,
+                uni_no_pay: null,
+                files: []
+            };
+        } else if ($scope.recordid == 0){
+            $scope.record = angular.copy(ErpBx.tfitem);
+        } else {
+            gettypedata();
+            ErpBx.linkerBX('GetOneBX').get({id :$scope.recordid}, function (data) {
+                $scope.record = data;
+                _.each($scope.record.files, function (item) {
+                    item.file_thumbnail_path = formatFilter('{0}ext_erp/{1}', cfg.api, item.url);
+                    item.file_full_path = formatFilter('{0}ext_erp/{1}', cfg.api, item.url);
+                });
+                watch = $scope.$watch('record', function (n, o) {
+                    if (n == o)
+                        return;
+                    isModified = true;
+                }, true);
+            })
+        }
+    });
+
+    $scope.doRefresh = function () {
+        gettypedata();
+    }
+
+    $scope.loadMore = function () {
+        if ($scope.types != undefined && $scope.types.next != null) {
+            Tool.get($scope.types.next).then(function (data) {
+                $scope.types.Data = $scope.types.Data.concat(data.Data);
+                $scope.types.next = data.next;
+                $scope.types.previous = data.previous;
+            }).finally(function () {
+                $scope.$broadcast('scroll.infiniteScrollComplete');
+            });
+        } else {
+            $scope.$broadcast('scroll.infiniteScrollComplete');
+        }
+    }
+
+    $scope.moreCanBeLoaded = function () {
+        return $scope.types != undefined && $scope.types.next != null;
+    }
+
+    $scope.showModal = function (type) {
+        if ($scope.recordid == 0) return;
+        if (type == 'tax') {
+            $scope.select_tax_modal.show();
+            $rootScope.commons.modal = $scope.select_tax_modal;
+        } else if (type == 'type') {
+            $scope.select_type_modal.show();
+            $rootScope.commons.modal = $scope.select_type_modal;
+        }
+    }
+    
+    $scope.closeModal = function (item) {
+        $scope.record.fee_name = item.name;
+        $scope.record.fee_eng_name = item.eng_name;
+        $rootScope.commons.modal.hide();
+    }
+
+    $scope.selectDate = function () {
+        if ($scope.recordid == 0) return;
+        var options = {
+            mode: 'date',
+            date: new Date($scope.record.bx_dd),
+            androidTheme: 3
+        };
+        $cordovaDatePicker.show(options).then(function (date) {
+            if (date == undefined) return;
+            $scope.record.bx_dd = date;
+        });
+    }
+
+    $scope.saverecord = function () {
+        if ($scope.recordid == 0) return;
+        if ($scope.record.amt == null) {
+            showPopup.PopupWindow(0, "请填写金额", false);
+            return
+        } else if ($scope.record.fee_id == null) {
+            showPopup.PopupWindow(0, "请选择消费类型", false);
+            return
+        } else if ($scope.language == 'zh-TW') {
+            if (!$scope.record.inv_no || $scope.record.inv_no == '') {
+                showPopup.PopupWindow(0, "请填写发票号码", false);
+                return
+            } else if ($scope.record.inv_no && $scope.record.inv_no.length != 14) {
+                showPopup.PopupWindow(0, "请核对发票号码", false);
+                return
+            }
+            if (!$scope.record.uni_no_pay || $scope.record.uni_no_pay == '') {
+                showPopup.PopupWindow(0, "请填写统一编号", false);
+                return
+            } else if ($scope.record.uni_no_pay && $scope.record.uni_no_pay.length != 20) {
+                showPopup.PopupWindow(0, "请核对统一编号", false);
+                return
+            }
+        }
+        showPopup.showLoading(1, '正在提交', true);
+        if ($scope.recordid == -1) {
+            ErpBx.linkerBX('PostBx').save($scope.record, function (data) {
+                var imagefiles = _.pluck($scope.record.files, 'file_full_path');
+                postImgae(imagefiles);
+            })
+        } else {
+            if (isModified) {
+                ErpBx.linkerBX('PutBX').update($scope.record, function (data) {
+                    _.each($scope.deleteimage_list, function (image) {
+                        ErpBx.image('DelFile').delete({id: image.id, filename:image.filename, table:'LINKERBX_FILE'});
+                    });
+                    var imagefiles = [];
+                    _.each($scope.record.files, function (image) {
+                        if (!image.id)
+                            imagefiles.push(image.file_full_path);
+                    });
+                    postImgae(imagefiles);
+                })
+            } else {
+                showPopup.hideLoading();
+                $ionicHistory.goBack();
+            }
+        }
+    }
+    
+    $scope.deleteRecord = function () {
+        if ($scope.recordid == 0) return;
+        $cordovaDialogs.confirm('是否删除该消费记录?', '提示', ['是','否']).then(function(buttonIndex) {
+            if (res) {
+                showPopup.showLoading(1, '删除中', true);
+                ErpBx.linkerBX('DeleteBX').delete({id: $scope.recordid}, function (data) {
+                    $scope.$emit('RecordListDoRefresh');
+                    $ionicHistory.goBack();
+                }, function (err) {
+                    alert(JSON.stringify(err));
+                }).$promise.finally(function () {
+                    showPopup.hideLoading();
+                })
+            }
+        });
+    }
+
+    function  postImgae(imagefiles) {
+        if (imagefiles.length > 0) {
+            ErpBx.uploadImage(imagefiles, 'LINKERBX_FILE', $scope.record.id).then(function (data) {
+                $scope.$emit('RecordListDoRefresh');
+                showPopup.hideLoading();
+                $ionicHistory.goBack();
+            })
+        } else {
+            $scope.$emit('RecordListDoRefresh');
+            showPopup.hideLoading();
+            $ionicHistory.goBack();
+        }
+    }
+
+    function gettypedata() {
+        if (global.user.token != "") {
+            ErpBx.query('GetData').get({table: 'EXPENSE', page: 1}, function (data) {
+                $scope.types = data;
+            }, function (err) {
+                alert(JSON.stringify(err));
+            }).$promise.finally(function () {
+                $scope.$broadcast('scroll.refreshComplete');
+            });
+        }
+    }
+
+    $scope.isCheck = function () {
+        return $scope.recordid == 0;
+    }
+
+    $scope.$on('$destroy', function () {
+        $scope.select_tax_modal.remove();
+        $scope.select_type_modal.remove();
+        if ($scope.recordid != -1 && $scope.recordid != 0) {
+            watch();
+        }
+    })
+})
+
+.controller('ErpBxBillCtrl', function ($rootScope, $scope, $state, $cordovaDatePicker, $ionicHistory, $cordovaDialogs, global, ErpBx, showPopup, Tool, formatFilter, cfg) {
+    $scope.select_record_modal = showPopup.modalTemplate('templates/modal-selectrecord.html', 'slide-in-right', $scope);
+    showPopup.modalTemplate('templates/modal-selectdept.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.select_dept_modal = modal;
+    });
+    $scope.billid = $state.params['id'];
+    $scope.recordlist = angular.copy(ErpBx.recordlist);
+    $scope.amountSum = 0;
+    var isModified = false;
+    var isFirst = false;
+    var watch = null;
+
+    global.fetch_user().then(function () {
+        getdeptdata();
+        if ($scope.billid == -1) {
+            $scope.bill = {
+                bx_no: null,
+                bx_dd: new Date(),
+                dep: null,
+                depname: null,
+                chk_man: null,
+                bxlist:[]
+            };
+
+            $scope.select_record_modal.then(function (modal) {
+                isFirst = true;
+                $scope.select_record_modal = modal;
+                $rootScope.commons.modal = modal;
+                $scope.select_record_modal.show();
+            });
+        } else {
+            $scope.select_record_modal.then(function (modal) {
+                $scope.select_record_modal = modal;
+            });
+            ErpBx.MFBX('GetMFBX').get({bxno :$scope.billid}, function (data) {
+                $scope.bill = data;
+                _.each($scope.bill.bxlist, function (item) {
+                    $scope.amountSum += item.amt;
+                    $scope.recordlist.splice(0, 0, item);
+                    item.selected = true;
+                    _.each(item.files, function (file) {
+                        file.file_thumbnail_path = formatFilter('{0}ext_erp/{1}', cfg.api, file.url);
+                        file.file_full_path = formatFilter('{0}ext_erp/{1}', cfg.api, file.url);
+                    })
+                });
+                $scope.bxlist_old = _.map(data.bxlist, function (item) {
+                    return {id: item.id}
+                });
+                watch = $scope.$watch('bill', function (n, o) {
+                    if (n == o)
+                        return;
+                    isModified = true;
+                }, true);
+            }, function (err) {
+                alert(JSON.stringify(err));
+            })
+        }
+    });
+
+    $scope.doRefresh = function () {
+        getdeptdata();
+    }
+
+    $scope.loadMore = function () {
+        if ($scope.department != undefined && $scope.department.next != null) {
+            Tool.get($scope.department.next).then(function (data) {
+                $scope.department.Data = $scope.department.Data.concat(data.Data);
+                $scope.department.next = data.next;
+                $scope.department.previous = data.previous;
+            }).finally(function () {
+                $scope.$broadcast('scroll.infiniteScrollComplete');
+            });
+        } else {
+            $scope.$broadcast('scroll.infiniteScrollComplete');
+        }
+    }
+
+    $scope.moreCanBeLoaded = function () {
+        return $scope.department != undefined && $scope.department.next != null;
+    }
+
+    $scope.selectRecord = function (recorditem) {
+        if (recorditem.selected) {
+            $scope.amountSum = parseFloat($scope.amountSum) + parseFloat(recorditem.amt);
+        } else {
+            $scope.amountSum = parseFloat($scope.amountSum) - parseFloat(recorditem.amt);
+        }
+    };
+
+    $scope.toEditRecord = function () {
+        $scope.select_record_modal.show();
+        $rootScope.commons.modal = $scope.select_record_modal;
+    };
+
+    $scope.selectDate = function () {
+        var options = {
+            mode: 'date',
+            date: new Date($scope.bill.bx_dd),
+            androidTheme: 3
+        };
+        $cordovaDatePicker.show(options).then(function (date) {
+            if (date == undefined) return;
+            $scope.bill.bx_dd = date;
+        });
+    }
+
+    $scope.ok = function () {
+        if (isFirst) {
+            isFirst = false;
+        }
+        $scope.bill.bxlist = _.filter($scope.recordlist, function (item) {
+            return item.selected;
+        })
+        $rootScope.commons.modal.hide();
+    }
+
+    $scope.cancel = function () {
+        goback();
+    };
+
+    $scope.showModal = function () {
+        $scope.select_dept_modal.show();
+        $rootScope.commons.modal = $scope.select_dept_modal;
+    }
+
+    $scope.closeModal = function (item) {
+        $scope.bill.dep = item.no;
+        $scope.bill.depname = item.name;
+        $rootScope.commons.modal.hide();
+    }
+
+    $rootScope.commons.fun = function () {
+        goback();
+    };
+
+    $scope.savebill = function () {
+        if ($scope.bill.dep == null) {
+            showPopup.PopupWindow(0, "请选择部门", false);
+            return
+        } else if ($scope.bill.bxlist.length == 0) {
+            showPopup.PopupWindow(0, "请选择消费记录", false);
+            return
+        }
+        var data = angular.copy($scope.bill);
+        data.bxlist = _.map(data.bxlist, function (item) {
+            return {id: item.id}
+        });
+        data = _.omit(data, 'depname');
+        showPopup.showLoading(1, '正在提交', true);
+        if ($scope.billid == -1) {
+            ErpBx.MFBX('PostMFBX').save(data, function (data) {
+                $scope.$emit('RecordListDoRefresh');
+                $ionicHistory.goBack();
+            }, function (err) {
+                alert(JSON.stringify(err));
+            }).$promise.finally(function () {
+                showPopup.hideLoading();
+            })
+        } else {
+            if (isModified) {
+                var addlist = _.difference(_.map(data.bxlist, function (item) {
+                    return item.id
+                }), _.map($scope.bxlist_old, function (item) {
+                    return item.id
+                }));
+                var deletelist = _.difference(_.map($scope.bxlist_old, function (item) {
+                    return item.id
+                }), _.map(data.bxlist, function (item) {
+                    return item.id
+                }));
+                _.each(addlist, function (additem) {
+                    var item = _.find(data.bxlist, function (item) {
+                        return additem == item.id
+                    });
+                    item.tfbx_status = 'A'
+                });
+                data.bxlist = data.bxlist.concat(_.map(deletelist, function (item) {
+                    return {id: item, tfbx_status: 'D'}
+                }));
+                ErpBx.MFBX('PutMFBX').update(data, function (data) {
+                    $scope.$emit('BillListDoRefresh');
+                    $scope.$emit('RecordListDoRefresh');
+                    $ionicHistory.goBack();
+                }, function (err) {
+                    alert(JSON.stringify(err));
+                }).$promise.finally(function () {
+                    showPopup.hideLoading();
+                })
+            } else {
+                $ionicHistory.goBack();
+                showPopup.hideLoading();
+            }
+        }
+    }
+
+    $scope.deletebill = function () {
+        $cordovaDialogs.confirm('是否删除该报销单?', '提示', ['是','否']).then(function(buttonIndex) {
+            if (buttonIndex == 1) {
+                showPopup.showLoading(1, '删除中', true);
+                ErpBx.MFBX('DeleteMFBX').delete({key: $scope.billid, modifydd: $scope.bill.modify_dd ? $scope.bill.modify_dd : ''}, function (data) {
+                    $scope.$emit('BillListDoRefresh');
+                    $scope.$emit('RecordListDoRefresh');
+                    $ionicHistory.goBack();
+                }, function (err) {
+                    alert(JSON.stringify(err));
+                }).$promise.finally(function () {
+                    showPopup.hideLoading();
+                })
+            }
+        });
+    }
+
+    $scope.totfdetail = function (item) {
+        ErpBx.tfitem = item;
+        $state.go('erpbx-record', {
+            id: 0
+        });
+    }
+
+    function goback() {
+        if (isFirst) {
+            $ionicHistory.goBack();
+        }
+        if ($rootScope.commons.modal) {
+            $rootScope.commons.modal.hide();
+            $rootScope.commons.modal = undefined;
+        }
+    }
+
+    function getdeptdata() {
+        if (global.user.token != "") {
+            ErpBx.query('GetData').get({table: 'DEPT', page: 1}, function (data) {
+                $scope.department = data;
+            }, function (err) {
+                alert(JSON.stringify(err));
+            }).$promise.finally(function () {
+                $scope.$broadcast('scroll.refreshComplete');
+            });
+        }
+    }
+
+    $scope.$on("$destroy", function () {
+        $scope.select_record_modal.remove();
+        $scope.select_dept_modal.remove();
+        if ($scope.billid != -1) {
+            watch();
+        }
+    });
+})
+
+.controller('ErpBxListCtrl', function ($rootScope, $scope, $state, global, Tool, ErpBx, showPopup) {
+    showPopup.modalTemplate('templates/modal-selectdate.html', 'slide-in-right', $scope).then(function (modal) {
+        $scope.select_date_modal = modal;
+    });
+    $scope.chkdd_tv_arr = ErpBx.chkdd_tv_arr;
+    $scope.chkdd_tv = 0;
+
+    global.fetch_user().then(function () {
+        getbilldata();
+    });
+
+    $scope.doRefresh = function () {
+        getbilldata();
+    }
+
+    $scope.todetail = function (id) {
+        $state.go('erpbx-bill', {
+            id:id
+        })
+    }
+
+    $scope.showModal = function (type) {
+        $scope.select_date_modal.show();
+        $rootScope.commons.modal = $scope.select_date_modal;
+    }
+
+    $scope.closeModal = function (index) {
+        $scope.chkdd_tv = index;
+        getbilldata();
+        $rootScope.commons.modal.hide();
+    }
+
+    $scope.loadMore = function () {
+        if ($scope.billlist != undefined && $scope.billlist.next != null) {
+            Tool.get($scope.billlist.next).then(function (data) {
+                $scope.billlist.Data = $scope.billlist.Data.concat(data.Data);
+                $scope.billlist.next = data.next;
+                $scope.billlist.previous = data.previous;
+            }).finally(function () {
+                $scope.$broadcast('scroll.infiniteScrollComplete');
+            });
+        } else {
+            $scope.$broadcast('scroll.infiniteScrollComplete');
+        }
+    }
+
+    $scope.moreCanBeLoaded = function () {
+        return $scope.billlist != undefined && $scope.billlist.next != null;
+    }
+
+    function getbilldata() {
+        if ($scope.billlist == undefined) {
+            $scope.loading = true;
+        }
+        ErpBx.query('GetDatabyDate').get({table: 'MF_BX', page:1 ,condi: $scope.chkdd_tv}, function (data) {
+            $scope.billlist = data;
+        }, function (err) {
+            alert(JSON.stringify(err));
+        }).$promise.finally(function () {
+            $scope.$broadcast('scroll.refreshComplete');
+            $scope.loading = false;
+        })
+    }
+
+    var BillListDoRefresh = $rootScope.$on('BillListDoRefresh', function (event ,data) {
+        getbilldata();
+    })
+
+    $scope.$on('$destroy', function () {
+        $scope.select_date_modal.remove();
+        BillListDoRefresh();
+    })
+})

+ 127 - 0
www/apps/erpbx/js/directive.js

@@ -0,0 +1,127 @@
+starter.directive('httpSrc', function ($http, global) {
+    return {
+        restrict: "A",
+        link: function (scope, element, attrs) {
+            var requestConfig = {
+                method: 'GET',
+                responseType: 'arraybuffer',
+                cache: 'true'
+            };
+
+            function base64Img(data) {
+                var arr = new Uint8Array(data);
+                var raw = '';
+                var i, j, subArray, chunk = 5000;
+                for (i = 0, j = arr.length; i < j; i += chunk) {
+                    subArray = arr.subarray(i, i + chunk);
+                    raw += String.fromCharCode.apply(null, subArray);
+                }
+                return btoa(raw);
+            }
+
+            attrs.$observe('httpSrc', function (newValue) {
+                requestConfig.url = newValue;
+                if (newValue.indexOf('data:image') >= 0) {
+                    attrs.$set('src', newValue);
+                } else {
+                    global.fetch_user().then(function () {
+                        $http(requestConfig).then(function (data) {
+                            attrs.$set('src', "data:image/jpeg;base64," + base64Img(data.data));
+                        });
+                    });
+                }
+            });
+        }
+    }
+})
+
+.directive('erpBxPhotoBar', [function () {
+    return {
+        restrict: "E",
+        scope: {
+            files: '=',
+            deleteImage:'=',
+            headerBorder:'@',
+            isDisabled:'='
+        },
+        replace: true,
+        template: '<div class="item camera-item" ng-class={"border-top-none":headerBorder}><div ng-repeat="image in files" ng-click="shouBigImage(image.file_full_path)"><img http-src="{{image.file_thumbnail_path}}"/></div><div class="center" ng-click="addphoto(isDisabled)"><i class="icon ion-camera"></i></div></div>',
+        controller: function ($scope, $rootScope, $q, showPopup, ImageManage) {
+            $scope.popup = {
+                isPopup: false
+            };
+
+            $scope.headerBorder === 'true' ? $scope.headerBorder = true : $scope.headerBorder = false;
+
+            $scope.shouBigImage = function (url) {
+                $scope.imageUrl = url;
+                $scope.$emit('showImage', {url: url});
+            }
+
+            $scope.addphoto = function (disabled) {
+                if (disabled) {
+                    return
+                }
+                $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
+                $scope.popup.isPopup = true;
+            }
+
+            function ImagePicker() { //打开相册
+                $scope.popup.optionsPopup.close();
+                ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount - $scope.files.length).then(function (data) {
+                    $q.all(data).then(function (res) {
+                        $scope.files = $scope.files.concat(_.map(res, function (value) {
+                            return {"file_thumbnail_path": value, "file_full_path": value};
+                        }));
+                    }, function (error) {
+                        alert(error);
+                    });
+                });
+            }
+
+            function Camera() {
+                $scope.popup.optionsPopup.close();
+                ImageManage.Camera_getPicture().then(function (result) {
+                    $scope.files.push({
+                        "file_thumbnail_path": result,
+                        "file_full_path": result
+                    });
+                });
+            }
+
+            $rootScope.$on('deleteImage', function (event, data) {
+                var img = _.find($scope.files, function (image) {
+                    return image.file_full_path == $scope.imageUrl;
+                });
+                if (img) {
+                    $scope.files.splice(_.indexOf($scope.files, img), 1);
+                    if (img.id)
+                        $scope.deleteImage.push({id:img.id, filename: img.fileName});
+                }
+                $rootScope.commons.bigImage = false;
+            })
+        }
+    }
+}])
+
+.directive('erpBxLargerImage', [function () {
+    return {
+        restrict: "E",
+        template: '<div id="rightDisplay" ng-show="$root.commons.bigImage" class="popover-backdrop1" ng-click="hideBigImage()" ><img class="fullscreen-image" http-src="{{imageUrl}}" ng-pinch-zoom/><i class="ion-ios-trash-outline" ng-click="deleteimage();"></i></div>',
+        controller: function ($scope, $rootScope) {
+            $scope.showImage = false;
+            $scope.hideBigImage = function () {
+                $rootScope.commons.bigImage = false;
+            }
+
+            $scope.deleteimage = function () {
+                $scope.$emit('deleteImage');
+            }
+
+            $rootScope.$on('showImage', function (event, data) {
+                $scope.imageUrl = data.url;
+                $rootScope.commons.bigImage = true;
+            })
+        }
+    }
+}])

+ 43 - 0
www/apps/erpbx/js/factory.js

@@ -0,0 +1,43 @@
+starter.factory('ErpBx', function ($resource, $cordovaFileTransfer, $q, cfg, formatFilter, global, $timeout) {
+    var erpbx = {};
+    erpbx.taxrto = null;
+    erpbx.recordlist = [];
+    erpbx.tfitem = {};
+    erpbx.chkdd_tv_arr = ['不限制', '当日', '本周', '上周', '本月', '上月', '本季', '上季', '本年', '去年'];
+
+    erpbx.query = function (type) {
+        return $resource(formatFilter('{0}ext_erp/Query/{1}/', cfg.api, type));
+    }
+    erpbx.linkerBX = function (type) {
+        return $resource(formatFilter('{0}ext_erp/LinkerBX/{1}/', cfg.api, type));
+    }
+    erpbx.MFBX = function (type) {
+        return $resource(formatFilter('{0}ext_erp/MFBX/{1}/', cfg.api, type));
+    }
+    erpbx.image = function (type) {
+        return $resource(formatFilter('{0}ext_erp/File/{1}/', cfg.api, type));
+    }
+
+    erpbx.uploadImage = function (fileurls, table, key) {
+        uploadUrl = formatFilter('{0}{1}ext_erp/File/PostUpload/?table={2}&key={3}', global.api, cfg.api, table, key);
+        var promises = [];
+        _.each(_.isArray(fileurls) ? fileurls : [fileurls], function (itemfile) {
+            var defer_up = $q.defer();
+            var options = new FileUploadOptions();
+            options.headers = {
+                cid: {"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone},
+                authorization: 'Token ' + global.user.token
+            }
+            $cordovaFileTransfer.upload(uploadUrl, itemfile, options, true).then(function (res) {
+                defer_up.resolve(res);
+            }, function (err) {
+                console.log(JSON.stringify(err));
+                defer_up.reject(err);
+            });
+            promises.push(defer_up.promise);
+        });
+        return $q.all(promises);
+    }
+
+    return erpbx;
+});

+ 36 - 0
www/apps/erpbx/js/route.js

@@ -0,0 +1,36 @@
+starter.config(function ($stateProvider, $httpProvider) {
+    $stateProvider.state('erpbx', {
+        url: '/index',
+        templateUrl: 'templates/erpbx.html',
+        controller: 'ErpBxCtrl'
+    })
+
+    .state('erpbx-record', {
+        url: '/erpbx-record/:id',
+        templateUrl: 'templates/erpbx-record.html',
+        controller: 'ErpBxRecordCtrl'
+    })
+
+    .state('erpbx-bill', {
+        url: '/erpbx-bill/:id',
+        templateUrl: 'templates/erpbx-bill.html',
+        controller: 'ErpBxBillCtrl'
+    })
+
+    .state('erpbx-list', {
+        url: '/erpbx-list/',
+        templateUrl: 'templates/erpbx-list.html',
+        controller: 'ErpBxListCtrl'
+    })
+
+    $httpProvider.interceptors.push(function ($q, cfg, global) {
+        return {
+            'request': function (config) {
+                if (config.url.indexOf("ext_erp") != -1) {//分页时自带了请求路径
+                    config.headers['cid'] = JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone});
+                }
+                return config;
+            }
+        };
+    });
+});

+ 48 - 0
www/apps/erpbx/templates/erpbx-bill.html

@@ -0,0 +1,48 @@
+<ion-view view-title="{{billid == -1 ? '新建' : '编辑'}}报销单">
+    <ion-nav-buttons side="right">
+        <button class="button button-clear" ng-click="savebill()">完成</button>
+    </ion-nav-buttons>
+    <ion-content>
+        <div ng-if="billid != -1">
+            <ion-item class="item-divider"></ion-item>
+            <ion-item>单号<span class="item-note">{{bill.bx_no}}</span></ion-item>
+        </div>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item class="item-icon-right" ng-click="showModal()">
+            部门
+            <span class="item-note">{{bill.dep}}/{{bill.depname}}</span>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item class="item-icon-right" ng-click="selectDate()">
+            日期
+            <span class="item-note">{{bill.bx_dd | date:"yyyy-MM-dd"}}</span>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item class="item-divider"></ion-item>
+        <label class="item item-input text-input">
+            <span class="input-label">描述</span>
+            <input type="text" placeholder="请输入描述" ng-model="bill.rem"/>
+        </label>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item>
+            需报销的消费({{bill.bxlist.length}})
+            <label for="" class="edit-text-label positive" ng-click="toEditRecord()">修改</label>
+        </ion-item>
+        <ion-item class="item-icon-right" ng-repeat="item in bill.bxlist" ng-click="totfdetail(item)">
+            {{item.fee_name}}
+            <span class="item-note">{{item.bx_dd}}</span>
+            <p>金额:{{item.amt}}</p>
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item>
+            <p class="item-note">共计:<span class="assertive">{{amountSum}}</span></p>
+        </ion-item>
+        <ion-item class="item-divider"></ion-item>
+        <div ng-if="billid!= -1">
+            <ion-item class="assertive center" ng-click="deletebill()">
+                删除
+            </ion-item>
+            <ion-item class="item-divider"></ion-item>
+        </div>
+    </ion-content>
+</ion-view>

+ 18 - 0
www/apps/erpbx/templates/erpbx-list.html

@@ -0,0 +1,18 @@
+<ion-view view-title="我的报销单">
+    <ion-nav-buttons side="right">
+        <button class="button button-clear" ng-click="showModal()">
+            筛选
+        </button>
+    </ion-nav-buttons>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
+        <ion-item ng-if="!loading" ng-repeat="bill in billlist.Data" ng-click="todetail(bill.no)">
+            {{bill.no}}
+            <span class="item-note">{{bill.bil_date}}</span>
+            <p>金额:{{bill.bil_oth3}}</p>
+            <p ng-if="bill.rem">备注:{{bill.rem}}</p>
+        </ion-item>
+        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
+    </ion-content>
+</ion-view>

+ 68 - 0
www/apps/erpbx/templates/erpbx-record.html

@@ -0,0 +1,68 @@
+<ion-view view-title="{{recordid && recordid == -1 ? '新建' : recordid && recordid == 0 ? null : '编辑'}}消费记录">
+    <ion-nav-buttons side="right">
+        <button ng-if="!isCheck()" class="button button-clear" ng-click="saverecord()">完成</button>
+    </ion-nav-buttons>
+    <ion-content>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item class="item-input text-input">
+            <span class="input-label">金额</span>
+            <span ng-if="isCheck()">{{record.amt}}</span>
+            <input ng-if="!isCheck()" type="number" ng-model="record.amt" placeholder="输入金额">
+        </ion-item>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item class="item-icon-right" ng-click="showModal('type')">
+            消费类型
+            <span class="item-note">{{record.fee_name}}</span>
+            <i ng-if="!isCheck()" class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item class="item-icon-right" ng-click="selectDate()">
+            消费日期
+            <span class="item-note">{{record.bx_dd | date:"yyyy-MM-dd"}}</span>
+            <i ng-if="!isCheck()" class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item class="item-icon-right" ng-click="showModal('tax')">
+            扣税类别
+            <span class="item-note">{{record.tax_id}}.{{taxCategory[record.tax_id]}}</span>
+            <i ng-if="!isCheck()" class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <ion-item>
+            税率
+            <span class="item-note">{{record.tax_rto}}</span>
+        </ion-item>
+        <ion-item ng-if="recordid != -1 && recordid != 0">
+            税额
+            <span class="item-note">{{record.tax}}</span>
+        </ion-item>
+        <div ng-if="language == 'zh-TW'">
+            <ion-item class="item-divider"></ion-item>
+            <ion-item class="item-input text-input">
+                <span class="input-label">发票号码</span>
+                <span ng-if="isCheck()">{{record.inv_no}}</span>
+                <input ng-if="!isCheck()" type="text" maxlength="14" ng-model="record.inv_no" placeholder="输入发票号码">
+            </ion-item>
+            <ion-item class="item-input text-input">
+                <span class="input-label">统一编号</span>
+                <span ng-if="isCheck()">{{record.uni_no_pay}}</span>
+                <input ng-if="!isCheck()" type="text" maxlength="20" ng-model="record.uni_no_pay" placeholder="输入统一编号">
+            </ion-item>
+        </div>
+        <ion-item class="item-divider"></ion-item>
+        <ion-item>票据图片</ion-item>
+        <erp-bx-photo-bar files="record.files" delete-image="deleteimage_list" is-disabled="isCheck()"></erp-bx-photo-bar>
+        <ion-item class="item-divider"></ion-item>
+        <label class="item item-input text-input">
+            <span class="input-label">描述</span>
+            <span ng-if="isCheck()">{{record.rem}}</span>
+            <input ng-if="!isCheck()" type="text" ng-model="record.rem" placeholder="输入描述"/>
+        </label>
+        <ion-item class="item-divider"></ion-item>
+        <div ng-if="recordid != -1 && recordid != 0">
+            <ion-item class="assertive center" ng-click="deleteRecord()">
+                删除
+            </ion-item>
+            <ion-item class="item-divider"></ion-item>
+        </div>
+    </ion-content>
+    <erp-bx-larger-image></erp-bx-larger-image>
+</ion-view>

+ 36 - 0
www/apps/erpbx/templates/erpbx.html

@@ -0,0 +1,36 @@
+<ion-view view-title="报销" hide-back-button="true">
+    <ion-nav-buttons side="left">
+        <ion-back-button></ion-back-button>
+    </ion-nav-buttons>
+    <ion-nav-buttons side="right">
+        <button class="button button-clear" ng-click="popover.show($event)">
+            <i class="icon ion-android-add"></i>
+        </button>
+    </ion-nav-buttons>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <ion-item class="item-icon-right" ng-href="#/erpbx-list/">我的报销单
+            <i class="icon ion-chevron-right icon-accessory"></i>
+        </ion-item>
+        <!--<a class="item item-icon-right">需要我审批的报销单-->
+            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
+        <!--</a>-->
+        <div class="item item-divider">消费记录({{records.length}})</div>
+        <ion-item class="item-icon-left" ng-repeat="record in records" ng-click="torecord(record)">
+            {{record.fee_name}}
+            <i class="icon icon-money energized"></i>
+            <span class="item-note">{{record.bx_dd | date:'yyyy-MM-dd'}}</span>
+            <p class="energized">金额:{{record.amt}}</p>
+        </ion-item>
+    </ion-content>
+    <script id="templates/paymenu.html" type="text/ng-template">
+        <ion-popover-view class="popver_view">
+            <ion-content>
+                <ion-list>
+                    <ion-item class="item item-button" ng-click="torecord()">添加消费记录</ion-item>
+                    <ion-item class="item item-button" ng-click="tobill()">创建报销单</ion-item>
+                </ion-list>
+            </ion-content>
+        </ion-popover-view>
+    </script>
+</ion-view>

+ 13 - 0
www/apps/erpbx/templates/modal-selectdate.html

@@ -0,0 +1,13 @@
+<ion-modal-view>
+    <ion-header-bar>
+        <button class="button ion-chevron-left button-clear button-dark" ng-click="$root.commons.modal.hide()">&nbsp;返回</button>
+        <h1 class="title">起止日期自动取值</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-list>
+            <ion-radio ng-repeat="chkdd in chkdd_tv_arr" ng-model="chkdd_tv" ng-value="$index" ng-click="closeModal($index)">
+                {{$index}}.{{chkdd}}
+            </ion-radio>
+        </ion-list>
+    </ion-content>
+</ion-modal-view>

+ 13 - 0
www/apps/erpbx/templates/modal-selectdept.html

@@ -0,0 +1,13 @@
+<ion-modal-view>
+    <ion-header-bar class="bar bar-header">
+        <button class="button button-clear button-calm" ng-click="$root.commons.modal.hide()">取消</button>
+        <h1 class="title">选择要报销的消费</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+            <ion-radio ng-repeat="dept in department.Data" ng-model="bill.dep" ng-value="dept.no" ng-click="closeModal(dept)">
+            {{dept.name}}
+        </ion-radio>
+        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
+    </ion-content>
+</ion-modal-view>

+ 23 - 0
www/apps/erpbx/templates/modal-selectrecord.html

@@ -0,0 +1,23 @@
+<ion-modal-view>
+    <ion-header-bar class="bar bar-header">
+        <button class="button button-clear button-calm" ng-click="cancel();">取消</button>
+        <h1 class="title">选择要报销的消费</h1>
+    </ion-header-bar>
+    <ion-content>
+        <!--<div class="item item-divider divider-font">本月</div>-->
+        <ul class="list">
+            <li class="item item-checkbox" ng-repeat="record in recordlist">
+                {{record.fee_name}}
+                <span class="item-note">{{record.bx_dd}}</span>
+                <p>金额:{{record.amt}}</p>
+                <label class="checkbox">
+                    <input type="checkbox" ng-model="record.selected" ng-click="selectRecord(record)">
+                </label>
+            </li>
+        </ul>
+    </ion-content>
+    <div class="bar bar-footer bar-dark footer-div record-count-div">
+        <span class="record-count-span">合计:<label for="">{{amountSum}}</label></span>
+        <button ng-click="ok();" class="button pull-right button-calm" ng-disabled="amountSum==0">确定</button>
+    </div>
+</ion-modal-view>

+ 13 - 0
www/apps/erpbx/templates/modal-selecttax.html

@@ -0,0 +1,13 @@
+<ion-modal-view>
+    <ion-header-bar>
+        <button class="button ion-chevron-left button-clear button-dark" ng-click="$root.commons.modal.hide()">&nbsp;返回</button>
+        <h1 class="title">扣税类别</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-list>
+            <ion-radio ng-repeat="tax in taxCategory" ng-model="record.tax_id" ng-value="$index" ng-if="!$first" ng-click="$root.commons.modal.hide()">
+                {{$index}}.{{tax}}
+            </ion-radio>
+        </ion-list>
+    </ion-content>
+</ion-modal-view>

+ 13 - 0
www/apps/erpbx/templates/modal-selecttype.html

@@ -0,0 +1,13 @@
+<ion-modal-view>
+    <ion-header-bar>
+        <button class="button ion-chevron-left button-clear button-dark" ng-click="$root.commons.modal.hide()">&nbsp;返回</button>
+        <h1 class="title">消费类型</h1>
+    </ion-header-bar>
+    <ion-content>
+        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
+        <ion-radio ng-repeat="type in types.Data" ng-model="record.fee_id" ng-value="type.no" ng-click="closeModal(type)">
+            {{type.name}}
+        </ion-radio>
+        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
+    </ion-content>
+</ion-modal-view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/css/linker.min.css


+ 6 - 3
www/js/start/config.js

@@ -42,13 +42,15 @@ starter.run(function ($ionicPlatform, $rootScope, $http, formatFilter, $q, $cord
                 switch (value) {
                     case 'zh-TW':
                         value = 'locate-zh_tw';
+                        global.language = 'zh-TW';
                         break;
                     case 'en':
                         value = 'locate-en_us';
+                        global.language = 'en';
                         break;
-                    case 'zh':
                     default:
                         value = 'locate-zh_cn';
+                        global.language = 'zh';
                         break;
                 }
                 $translate.use(value).then(function (data) {
@@ -66,7 +68,7 @@ starter.run(function ($ionicPlatform, $rootScope, $http, formatFilter, $q, $cord
         if (global.user && global.user.token) {
             usergot(global.user, deferred)
         } else if (ionic.Platform.platform() == 'win32' || ionic.Platform.platform() == 'linux') {
-            $http.post(formatFilter('{0}authcheck/', "http://srv.linkerplus.com/api/"), "imid=zPayHMi6s&password=123456", {
+            $http.post(formatFilter('{0}authcheck/', "http://srv.linkerplus.com/api/"), "imid=66J2Z5sMT&password=abc.123", {
                 headers: {
                     'Content-Type': 'application/x-www-form-urlencoded'
                 }
@@ -295,7 +297,8 @@ starter.run(function ($ionicPlatform, $rootScope, $http, formatFilter, $q, $cord
     },
     api: "",
     debug: true,
-    refresh: false
+    refresh: false,
+    language: null
 })
 
 _.mixin({

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov