Browse Source

clear apps

zhuxc 7 years ago
parent
commit
377872343f
100 changed files with 15 additions and 10192 deletions
  1. 0 876
      www/apps/accountMng/js/controllers.js
  2. 0 73
      www/apps/accountMng/js/factory.js
  3. 0 61
      www/apps/accountMng/js/route.js
  4. 0 0
      www/apps/compmanage/index.html
  5. 0 0
      www/apps/compmanage/js/controllers.js
  6. 0 0
      www/apps/compmanage/js/directive.js
  7. 8 0
      www/apps/compmanage/js/factory.js
  8. 7 0
      www/apps/compmanage/js/route.js
  9. 0 0
      www/apps/compmanage/templates/account-manage.html
  10. 0 0
      www/apps/compmanage/templates/applycheck.html
  11. 0 0
      www/apps/compmanage/templates/compinfo.html
  12. 0 0
      www/apps/compmanage/templates/contacts-companylst.html
  13. 0 0
      www/apps/compmanage/templates/contacts-deptlst.html
  14. 0 0
      www/apps/compmanage/templates/createcomp-modaltemplate.html
  15. 0 0
      www/apps/compmanage/templates/editDep.html
  16. 0 0
      www/apps/compmanage/templates/edit_deptdegree.html
  17. 0 0
      www/apps/compmanage/templates/joincomp.html
  18. 0 0
      www/apps/compmanage/templates/managecomp.html
  19. 0 0
      www/apps/compmanage/templates/modal-dept_degree.html
  20. 0 0
      www/apps/compmanage/templates/personinfo.html
  21. 0 49
      www/apps/daily/index.html
  22. 0 1514
      www/apps/daily/js/controllers.js
  23. 0 118
      www/apps/daily/js/directive.js
  24. 0 94
      www/apps/daily/js/factory.js
  25. 0 96
      www/apps/daily/js/route.js
  26. 0 32
      www/apps/daily/templates/additem.html
  27. 0 24
      www/apps/daily/templates/custom-form.html
  28. 0 67
      www/apps/daily/templates/daily-details.html
  29. 0 37
      www/apps/daily/templates/daily-edit.html
  30. 0 27
      www/apps/daily/templates/daily-man.html
  31. 0 36
      www/apps/daily/templates/daily-permission.html
  32. 0 46
      www/apps/daily/templates/daily-read.html
  33. 0 15
      www/apps/daily/templates/daily-readDay.html
  34. 0 31
      www/apps/daily/templates/daily-readDayCount.html
  35. 0 15
      www/apps/daily/templates/daily-readDayDeptCount.html
  36. 0 24
      www/apps/daily/templates/daily-readMouthCount.html
  37. 0 26
      www/apps/daily/templates/daily-template.html
  38. 0 22
      www/apps/daily/templates/daily-templateEdit.html
  39. 0 30
      www/apps/daily/templates/daily-templateScope.html
  40. 0 22
      www/apps/daily/templates/daily.html
  41. 0 9
      www/apps/daily/templates/modal-selectDate.html
  42. 0 11
      www/apps/daily/templates/modal-selectdept.html
  43. 0 56
      www/apps/daily/templates/selectdeptoritem.html
  44. 0 29
      www/apps/daily/templates/simplydaily_write.html
  45. 0 18
      www/apps/daily/templates/template-daily.html
  46. 0 51
      www/apps/daily/templates/template-itemWrite.html
  47. 0 54
      www/apps/notice/index.html
  48. 0 962
      www/apps/notice/js/controllers.js
  49. 0 256
      www/apps/notice/js/factory.js
  50. 0 45
      www/apps/notice/js/route.js
  51. 0 28
      www/apps/notice/templates/modal-back.html
  52. 0 11
      www/apps/notice/templates/modal-selectgroup.html
  53. 0 44
      www/apps/notice/templates/modal-vote.html
  54. 0 209
      www/apps/notice/templates/notice-details.html
  55. 0 25
      www/apps/notice/templates/notice-posted.html
  56. 0 69
      www/apps/notice/templates/notice-result.html
  57. 0 36
      www/apps/notice/templates/notice.html
  58. 0 53
      www/apps/notice/templates/postnotice.html
  59. 0 46
      www/apps/notice/templates/power-set.html
  60. 0 18
      www/apps/notice/templates/result-details.html
  61. 0 54
      www/apps/pay/index.html
  62. 0 1593
      www/apps/pay/js/controllers.js
  63. 0 90
      www/apps/pay/js/directive.js
  64. 0 23
      www/apps/pay/js/factory.js
  65. 0 90
      www/apps/pay/js/route.js
  66. 0 32
      www/apps/pay/templates/addtype.html
  67. 0 46
      www/apps/pay/templates/auditstep.html
  68. 0 44
      www/apps/pay/templates/auditstepset.html
  69. 0 12
      www/apps/pay/templates/billapprove.html
  70. 0 11
      www/apps/pay/templates/billapproved.html
  71. 0 8
      www/apps/pay/templates/billlist.html
  72. 0 11
      www/apps/pay/templates/billpay.html
  73. 0 13
      www/apps/pay/templates/modal-paytype.html
  74. 0 24
      www/apps/pay/templates/modal-selectrecord.html
  75. 0 10
      www/apps/pay/templates/modal-stepReject.html
  76. 0 17
      www/apps/pay/templates/pay-analyse.html
  77. 0 64
      www/apps/pay/templates/pay-bill.html
  78. 0 46
      www/apps/pay/templates/pay-record.html
  79. 0 45
      www/apps/pay/templates/pay.html
  80. 0 87
      www/apps/pay/templates/paybilldetails.html
  81. 0 19
      www/apps/pay/templates/payman.html
  82. 0 33
      www/apps/pay/templates/seestepmflist.html
  83. 0 23
      www/apps/pay/templates/template-filterbar.html
  84. 0 13
      www/apps/pay/templates/template-payBillList.html
  85. 0 20
      www/apps/pay/templates/typeset.html
  86. 0 52
      www/apps/schedule/index.html
  87. 0 593
      www/apps/schedule/js/controllers.js
  88. 0 53
      www/apps/schedule/js/directive.js
  89. 0 176
      www/apps/schedule/js/factory.js
  90. 0 25
      www/apps/schedule/js/route.js
  91. 0 13
      www/apps/schedule/templates/modal-selectrepeatenddd.html
  92. 0 102
      www/apps/schedule/templates/modal-selectrepeatid.html
  93. 0 11
      www/apps/schedule/templates/modal-selectwarningid.html
  94. 0 40
      www/apps/schedule/templates/schedule-create.html
  95. 0 41
      www/apps/schedule/templates/schedule-details.html
  96. 0 16
      www/apps/schedule/templates/schedule-posted.html
  97. 0 23
      www/apps/schedule/templates/schedule.html
  98. 0 13
      www/apps/schedule/templates/template-schedule.html
  99. 0 49
      www/apps/task/index.html
  100. 0 1192
      www/apps/task/js/controllers.js

+ 0 - 876
www/apps/accountMng/js/controllers.js

@@ -1,876 +0,0 @@
-starter.controller('AccountManageCtrl', function ($scope, global, showPopup, CompManage) {
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        $scope.show = {
-            isshow: false
-        };
-        global.fetch_user().then(function (data) {
-            $scope.is_showcurrent = (global.user.compno != null);
-            if (global.user.token != "") {
-                CompManage.get_Compdata().then(function (data) {
-                    data = _.filter(data, function (item) {
-                        return item.usr_status == 2;
-                    });
-                    if (data.length > 0) {
-                        _.each(data, function (c) {
-                            c.check = false;
-                            if (c.id == global.user.compno) {
-                                $scope.currentcomp = c;
-                                c.check = true;
-                            }
-                        });
-                    }
-                    $scope.compdata = data;
-                }, function (err) {
-                    $scope.is_showcurrent = false;
-                    alert(JSON.stringify(err))
-                });
-            } else {
-                $scope.compdata = [];
-            }
-        });
-    });
-
-    $scope.change = function (comp) {
-        if ($scope.compdata.length > 0) {
-            if ($scope.currentcomp != comp) {
-                showPopup.showLoading(1, '', false);
-                var password = global.user.password;
-                CompManage.post_authcheck(global.user.im_usrid, comp.id).then(function (data) {
-                    $scope.currentcomp = comp;
-                    $scope.show.isshow = false;
-                    _.each($scope.compdata, function (_comp) {
-                        if (comp.id != _comp.id) {
-                            _comp.check = false;
-                        }
-                    });
-                    global.user = data;
-                    global.user.password = password;
-                    CompManage.store_user().then(function (data) {
-                        console.log(data);
-                        showPopup.hideLoading();
-                    }, function (error) {
-                        showPopup.hideLoading();
-                        console.log('store error:' + JSON.stringify(error));
-                    });
-                }, function (error) {
-                    showPopup.hideLoading();
-                    alert(JSON.stringify(error));
-                });
-            }
-        }
-    };
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.showcomplist = function () {
-        if ($scope.compdata.length > 0) $scope.show.isshow = !$scope.show.isshow;
-    }
-})
-
-.controller('ManageCompCtrl', function ($scope, $state, $ionicPopup, $rootScope, $ionicHistory, $q, global, ImageManage, showPopup, CompManage) {
-    $scope.newcompname = {
-        "compname": ""
-    };
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        $scope.loading = ($scope.compdata == undefined);
-        global.fetch_user().then(function (data) {
-            if (global.user.token != "") {
-                getmycomplist();
-            } else {
-                $scope.compdata = [];
-                $scope.loading = false;
-            }
-            $scope.popup = {
-                isSetPopup: false
-            };
-        });
-    });
-
-    $scope.tocompinfo = function (compid, op) {
-        $state.go('compinfo', {
-            'compid': compid,
-            'op': op
-        });
-    };
-
-    $scope.showaddcompmodel = function () {
-        showPopup.modalTemplate('templates/createcomp-modaltemplate.html', 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        });
-    };
-
-    $scope.cancel = function () {
-        $rootScope.commons.modal.hide();
-        $scope.logourl = '../../../img/logo.png';
-    };
-
-    $scope.createcomp = function () {
-        var newcompdata = {"compname": "", "cellphone": global.user.cellphone, "username": "", "imid": "", "password": global.user.password};
-        newcompdata.username = global.user.usrname;
-        newcompdata.compname = $scope.newcompname.compname;
-        newcompdata.imid = global.user.im_usrid;
-        showPopup.showLoading(1, '正在提交', true, $scope.logourl != "../../../img/logo.png" ? 20000 : 10000);
-        CompManage.post_Register(newcompdata).then(function (compdata) {
-            if ($scope.logourl != "../../../img/logo.png") {
-                if (global.user.token == "") {
-                    var password = global.user.password;
-                    CompManage.post_authcheck(global.user.im_usrid, compdata.compid).then(function (data) {
-                        global.user = data;
-                        global.user.password = password;
-                        uploadcomplogo(compdata);
-                        CompManage.store_user().then(function () {
-                        }, function (error) {
-                            showPopup.hideLoading();
-                            console.log('store error:' + JSON.stringify(error));
-                        });
-                    }, function (err) {
-                        showPopup.hideLoading();
-                        alert('post_authcheck error:' + JSON.stringify(err))
-                    });
-                } else {
-                    uploadcomplogo(compdata)
-                }
-            } else {
-                get_authcheckInfo(compdata.compid);
-            }
-        }, function (e) {
-            showPopup.hideLoading();
-            if (_.has(e.data, 'msg')) showPopup.PopupWindow(0, e.data.msg, false, 2000);
-            else alert(JSON.stringify(e));
-        });
-    };
-
-    $scope.$on('$destroy', function () {
-        if ($rootScope.commons.modal != null) {
-            $rootScope.commons.modal.remove();
-        }
-        beforeEnter = null;
-    });
-
-    $scope.logourl = '../../../img/logo.png';
-
-    $scope.editlogo = function () {
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isSetPopup = true;
-    };
-
-    function uploadcomplogo(comp) {
-        ImageManage.uploadImage($scope.logourl, 'comp', comp.compid, 'complogo').then(function (res) {
-            $q.all(res).then(function (res1) {
-                get_authcheckInfo(comp.id);
-            }, function (error) {
-                showPopup.hideLoading();
-                alert('upload error:' + JSON.stringify(error));
-            });
-        }, function (err) {
-            showPopup.hideLoading();
-            alert('upload token error:' + JSON.stringify(err));
-        });
-    }
-
-    function get_authcheckInfo(compid) {
-        if (global.user.token == '') {
-            var password = global.user.password;
-            CompManage.post_authcheck(global.user.im_usrid, compid).then(function (data) {
-                global.user = data;
-                global.user.password = password;
-                getmycomplist();
-                CompManage.store_user().then(function (data) {
-                    console.log(data);
-                    $ionicHistory.goBack();
-                    showPopup.hideLoading();
-                }, function (error) {
-                    showPopup.hideLoading();
-                    console.log('store error:' + JSON.stringify(error));
-                });
-            }, function (err) {
-                showPopup.hideLoading();
-                alert('post_authcheck error:' + JSON.stringify(err))
-            });
-        } else {
-            showPopup.hideLoading();
-            if ($rootScope.commons.modal != null) $rootScope.commons.modal.hide();
-            getmycomplist();
-        }
-    }
-
-    function getmycomplist() {
-        CompManage.get_Compdata().then(function (data) {
-            _.each(data, function (comp) {
-                if (comp.file_thumbnail_path == null) {
-                    comp.file_thumbnail_path = $scope.logourl;
-                }
-                var admin = _.find(comp.compadmin, function (adminitem) {
-                    return adminitem.user_id == global.user.usrid;
-                });
-                comp.op = admin == undefined ? 0 : 1;
-                comp.compadmins = _.pluck(comp.compadmin, 'username').join(',');
-            });
-            $scope.compdata = _.sortBy(data, 'op').reverse();
-            $scope.loading = false;
-            $scope.newcompname.compname = "";
-            $scope.logourl = "../../../img/logo.png"
-        }, function (err) {
-            $scope.loading = false;
-            alert(JSON.stringify(err));
-        });
-    }
-
-    var ImagePicker = function () { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures(1).then(function (results) {
-            if (results.length == 0) return;
-            $q.all(results).then(function (res) {
-                $scope.logourl = res[0];
-            })
-        });
-    };
-
-    var Camera = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture(true).then(function (result) {
-            $scope.logourl = result;
-        });
-    };
-})
-
-.controller('JoinCompCtrl', function ($scope, $ionicHistory, $timeout, CompManage, global, showPopup) {
-    $scope.data = {
-        "compid": ""
-    };
-    var compdata = _.pick(global.user, 'cellphone', 'password');
-    compdata.username = global.user.usrname;
-    compdata.imid = global.user.im_usrid;
-    $scope.addedcomp = {};
-    $scope.is_show_jointip = false;
-    $scope.joincomp = function () {
-        var complist = CompManage.getComplist();
-        var comp = _.findWhere(complist, {'id': $scope.data.compid});
-        compdata.compid = $scope.data.compid;
-        if (comp == undefined) { //未加入过
-            showPopup.showLoading(1, '正在提交', true);
-            CompManage.post_Joinin(compdata).then(function (res) {
-                showPopup.hideLoading();
-                if (res.status == 201)
-                    $scope.is_show_jointip = true;
-                else
-                    showPopup.PopupWindow(0, res.msg, false, 2000);
-                $timeout(function () {
-                    $scope.is_show_jointip = false;
-                }, 5000);
-            }, function (e) {
-                showPopup.hideLoading();
-                if (_.has(e.data, 'msg')) showPopup.PopupWindow(0, e.data.msg, false, 2000);
-                else alert(JSON.stringify(e));
-            });
-        } else {
-            if (comp.file_thumbnail_path == "") {
-                comp.file_thumbnail_path = '../../../img/logo.png'
-            }
-            showPopup.PopupWindow(0, '你已加入该公司!', false, 2000);
-            $scope.addedcomp = comp;
-        }
-    };
-})
-
-.controller('CompInfoCtrl', function ($scope, $ionicPopup, $state, $ionicHistory, $q, showPopup, ImageManage, CompManage, global) {
-    var compid = $state.params['compid'];
-    $scope.op = $state.params['op'];
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        var compdata = CompManage.getComplist();
-        $scope.rdata = _.find(compdata, function (comp) {
-            return comp.id == $state.params['compid'];
-        });
-        console.log($scope.rdata);
-        $scope.data = _.clone($scope.rdata);
-        $scope.popup = {
-            isPopup: false
-        };
-    });
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-    });
-
-    $scope.selectphoto = function () {
-        if ($scope.op == 0) {
-            return;
-        }
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isPopup = true;
-    };
-
-    $scope.disbandcomp = function () {
-        showPopup.confirm('确定解散公司吗?', '确定', '取消').then(function (res) {
-            if (res) {
-                //解散
-                showPopup.showLoading(1, '', false);
-                CompManage.dismiss_comp($scope.data.id).then(function () {
-                    CheckComp();
-                    // alert('dismiss_comp success')
-                }, function (error) {
-                    showPopup.hideLoading();
-                    alert('error disbandcomp:' + JSON.stringify(error));
-                });
-            }
-        })
-    };
-
-    $scope.leavecomp = function () {
-        showPopup.confirm('确定退出公司吗?', '确定', '取消').then(function (res) {
-            if (res) {
-                if ($scope.op == 1) { //admin
-                    if ($scope.rdata.compadmin.length > 1) { //admin count>=2
-                        //退出
-                        showPopup.showLoading(1, '', false);
-                        CompManage.leave_comp($scope.data.id).then(function () {
-                            CheckComp();
-                        }, function (error) {
-                            showPopup.hideLoading();
-                            alert('error leavecomp:' + JSON.stringify(error));
-                        })
-                    } else {
-                        showPopup.PopupWindow(0, '你是该公司唯一的管理员不允许退出!', false);
-                    }
-                } else {
-                    //退出
-                    showPopup.showLoading(1, '', false, 20000);
-                    CompManage.leave_comp($scope.data.id).then(function () {
-                        CheckComp();
-                    }, function (error) {
-                        showPopup.hideLoading();
-                        alert('error leavecomp:' + JSON.stringify(error));
-                    });
-                }
-            }
-        })
-    };
-
-    $scope.showeditpopup = function () {
-        if ($scope.op == 0) {
-            return;
-        }
-        $scope.editdata = _.clone($scope.data);
-        var myPopup = $ionicPopup.show({
-            template: '<div class="popup-edit-comp" ><input type="text" ng-model="editdata.name" ><label ></label></div>',
-            title: '<div><h5>修改公司名称</h5></div>',
-            scope: $scope,
-            buttons: [{
-                text: '取消',
-                onTap: function () {
-                    return false;
-                }
-            }, {
-                text: '<b>保存</b>',
-                type: 'button-positive',
-                onTap: function (e) {
-                    if (!$scope.editdata.name) {
-                        e.preventDefault();
-                    } else {
-                        return true;
-                    }
-                }
-            }]
-        });
-
-        myPopup.then(function (res) {
-            if (res) {
-                // alert('editComp');
-                if ($scope.editdata.name != $scope.data.name) {
-                    CompManage.editComp($scope.editdata).then(function (data) {
-                        $scope.data.name = $scope.editdata.name;
-                        // alert(1);
-                    }, function (err) {
-                        alert('Error:' + JSON.stringify(err));
-                    });
-                }
-            }
-        });
-    };
-    $scope.image_list = [];
-
-    var ImagePicker = function () { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures(1).then(function (results) {
-            if (results.length == 0) return;
-            $q.all(results).then(function (res) {
-                uploadimage(res[0]);
-            })
-        });
-    };
-
-    var Camera = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture(true).then(function (result) {
-            uploadimage(result);
-        });
-    };
-
-    function CheckComp() {
-        var compdata = CompManage.getComplist();
-        compdata.splice(_.findIndex(compdata, {'id': $scope.data.id}), 1);
-        if (compdata.length > 0 && global.user.compno == $scope.data.id) { //退出/解散当前登录的公司
-            var comp = compdata[0];
-            var password = global.user.password;
-            CompManage.post_authcheck(global.user.im_usrid, comp.id).then(function (data) {
-                global.user = data;
-                global.user.password = password;
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-                CompManage.store_user().then(function (data) {
-                    console.log(data);
-                }, function (error) {
-                    console.log('store error:' + JSON.stringify(error));
-                });
-            });
-        } else if (compdata.length == 0) { //用户没有公司时
-            global.user.token = "";
-            global.user.compno = "";
-            global.user.compname = "";
-            global.user.deptno = "";
-            global.user.deptname = "";
-            global.user.roleid = "";
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-            CompManage.store_user().then(function (data) {
-                console.log(JSON.stringify(data));
-            }, function (error) {
-                console.log('store error:' + JSON.stringify(error));
-            });
-        } else {
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        }
-    }
-
-    function uploadimage(result) {
-        showPopup.showLoading(1, '', false, 20000);
-        ImageManage.uploadImage(result, 'comp', $scope.data.id, 'complogo').then(function (res) {
-            $q.all(res).then(function (res1) {
-                showPopup.hideLoading();
-                $scope.data.file_thumbnail_path = JSON.parse(res1[0].response).file_thumbnail_path;
-            }, function (error) {
-                showPopup.hideLoading();
-                alert('upload error:' + JSON.stringify(error));
-            })
-        }, function (error) {
-            alert('get token error:' + JSON.stringify(error));
-            showPopup.hideLoading();
-        });
-    }
-})
-
-.controller('ApplyCheckCtrl', function ($scope, $ionicPlatform, $cordovaPreferences, $location, global, CompManage, showPopup) {
-    var compid = $location.search().compid;
-    global.fetch_user().then(function (data) {
-        getAuditUsers();
-    }, function (error) {
-        alert(JSON.stringify(error));
-    });
-
-    $scope.check = function (user, op) { //todo:y=0;n=1
-        // alert(JSON.stringify($scope.audituserlst))
-        showPopup.showLoading(1, '正在提交', false);
-        CompManage.auditUser(user, op, compid).then(function (data) {
-            showPopup.hideLoading();
-            $scope.audituserlst.splice(_.indexOf($scope.audituserlst, user), 1);
-        }, function (err) {
-            showPopup.hideLoading();
-            alert(JSON.stringify(err));
-        });
-    };
-    $scope.doRefresh = function () {
-        getAuditUsers();
-    };
-
-    $scope.goBack = function () {
-        global.goBack();
-    }
-
-    function getAuditUsers() {
-        if (global.user.token != "") {
-            CompManage.getUserAuditstatus(1, compid).then(function (data) {
-                $scope.audituserlst = data;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-            });
-        }
-    }
-})
-
-.controller('ContactsCompanylstCtrl', function ($scope, $cordovaPreferences, $ionicPlatform, $state, global, Dept, CompManage) {
-    $scope.complistdata = [];
-    $scope.logourl = '../../../img/logo.png';
-    $scope.loading = true;
-    var beforeEnter = $scope.$on('$ionicView.beforeEnter', function () {
-        Dept.setdeptlst([]);
-        // alert(Dept.all().length);
-    });
-    $scope.init = function () {
-        global.fetch_user().then(function (data) {
-            if (global.user.token != "") {
-                CompManage.get_Compdata().then(function (data) {
-                    // alert(JSON.stringify(data));
-                    _.each(data, function (c) {
-                        if (c.file_thumbnail_path == null) {
-                            c.file_thumbnail_path = $scope.logourl;
-                        }
-                    })
-                    $scope.complistdata = data;
-                    $scope.loading = false;
-                });
-            } else {
-                $scope.loading = false;
-            }
-        }, function (error) {
-            $scope.loading = false;
-            alert(JSON.stringify(error));
-        });
-    };
-
-    $scope.goBack = function () {
-        global.goBack();
-    }
-
-    $scope.tocompuser = function (compid, compname) {
-        $state.go('deptlst', {
-            id: -1,
-            name: compname,
-            compid: compid
-        })
-    };
-
-    function getcompdata() {
-        if (global.user.token != "") {
-            CompManage.get_Compdata().then(function (data) {
-                $scope.complistdata = data;
-            });
-        }
-    }
-})
-
-.controller('DeptCtrl', function ($scope, $state, $http, $stateParams, Dept, $ionicViewSwitcher) {
-    $scope.deptlst = [];
-    $scope.emplst = [];
-    $scope.titleName = '';
-    $scope.checked = false;
-    $scope.titleName = $stateParams.name;
-    $scope.deptid = -1;
-    $scope.$on('$ionicView.beforeEnter', function () {
-        $scope.deptid = setdeptid();
-        if (Dept.all().length == 0) {
-            $scope.loading = true;
-            Dept.getDep($stateParams.compid).then(function (data) {
-                $scope.deptid = setdeptid();
-                data = _.filter(data, function (item) {
-                    return item.parent == $scope.deptid;
-                });
-                $scope.dept_data = data;
-                $scope.deptlst = data;
-                getemp();
-            }, function (err) {
-                $scope.loading = false;
-            });
-        } else {
-            $scope.loading = false;
-            var data = Dept.getChildDept($scope.deptid);
-            $scope.dept_data = data;
-            $scope.deptlst = data;
-            getemp();
-        }
-    });
-
-    function setdeptid() {
-        var deptid = parseInt($stateParams.id);
-        if (Dept.all().length > 0) {
-            if (deptid < 0) {
-                deptid = _.find(Dept.all(), function (item) {
-                    return item.level == 0
-                }).id;
-            }
-        }
-        return deptid;
-    }
-
-    function getemp() {
-        Dept.getEmp($scope.deptid, $stateParams.compid).then(function (data) {
-            console.log('user json:' + JSON.stringify(data));
-            $scope.emplst = data;
-            $scope.loading = false;
-        }, function (err) {
-            $scope.loading = false;
-            alert(JSON.stringify(err));
-        });
-    }
-
-    $scope.deptdisplay = function () {
-        if ($scope.deptlst.length > 0) {
-            return true;
-        } else {
-            return false;
-        }
-    };
-
-    $scope.empdisplay = function () {
-        if ($scope.emplst.length > 0) {
-            return true;
-        } else {
-            return false;
-        }
-    };
-
-    $scope.search = function () {
-        $state.go('search');
-    };
-
-    $scope.editDep = function () {
-        $state.go('editDep', {
-            id: $scope.deptid,
-            compid: $stateParams.compid,
-            name: $stateParams.name
-        });
-        $ionicViewSwitcher.nextDirection("back");
-    };
-
-    $scope.cancel = function () {
-        $state.go('addGroup2');
-    };
-
-    $scope.lookMsg = function (im_id, name, cellphone) {
-        var data = {
-            'im_id': im_id,
-            'name': name,
-            'cellphone': cellphone
-        }
-        console.log(data)
-        if (window.cordovaLinker != undefined) {
-            window.cordovaLinker.startChat(data, function (s) {
-                console.log(s);
-            }, function (err) {
-                console.error(err);
-            });
-        }
-    };
-
-    $scope.todept = function (dept) {
-        $state.go('deptlst', {id: dept.id, name: dept.depname, compid: $stateParams.compid})
-    };
-})
-
-.controller('EditDepCtrl', function ($scope, $ionicPopup, $stateParams, $timeout, $ionicHistory, Dept, showPopup, Tool) {
-    $scope.deptlst = [];
-    $scope.titleName = $stateParams.name;
-    var del_deptids = [];
-    var dept_data = [];
-    var compid = $stateParams.compid;
-    var beforeenter = $scope.$on('$ionicView.beforeEnter', function () {
-        $scope.deptlst = angular.copy(Dept.getChildDept($stateParams.id));
-        dept_data = angular.copy($scope.deptlst);
-    });
-
-    $scope.add = function () {
-        $timeout(function () {
-            $scope.deptlst.push({
-                depname: '',
-                parent_id: $stateParams.id
-            })
-        })
-    };
-    $scope.remove = function (dept, index) {
-        if (_.has(dept, 'id')) del_deptids.push(dept.id);
-        $scope.deptlst.splice(index, 1);
-    };
-
-    $scope.save = function () {
-        var deptlst = _.filter($scope.deptlst, function (dep) {
-            return Tool.trim(dep.depname).length > 0;
-        });
-        if (deptlst.length > _.uniq(_.pluck(deptlst, 'depname')).length) {
-            showPopup.PopupWindow(0, '名称不能重复!', false);
-            return;
-        }
-        var depts = _.partition(deptlst, 'id');
-        var up_depts = _.map(_.difference(_.map(depts[0], JSON.stringify), _.map(dept_data, JSON.stringify)), JSON.parse);
-        var add_depts = depts[1];
-        if (del_deptids.length > 0 || add_depts.length > 0 || up_depts.length > 0) {
-            showPopup.showLoading(1, '', false);
-            $scope.isdisabled_ok = true;
-            Dept.save(up_depts, del_deptids, add_depts, compid).then(function (data) {
-                Dept.setdeptlst([]);
-                $ionicHistory.goBack();
-            }, function (err) {
-                console.log(err);
-            }).finally(function (f) {
-                showPopup.hideLoading();
-                $scope.isdisabled_ok = false;
-            }); //修改、删除、添加;
-        }
-    };
-
-    $scope.cancel = function () {
-        if (JSON.stringify($scope.deptlst) != JSON.stringify(dept_data)) {
-            showPopup.confirm('是否退出编辑?', '是', '否').then(function (res) {
-                if (res) {
-                    $ionicHistory.goBack();
-                }
-            });
-        } else $ionicHistory.goBack();
-    };
-})
-
-.controller('PersonInfoCtrl', function ($scope, $state, $rootScope, $ionicPopup, $ionicModal, $q, $timeout, $ionicHistory, formatFilter, Dept, showPopup, global, ImageManage, Member) {
-    $scope.personinfo = {value: ''};
-    $scope.selectdatas = [{
-        name: '女',
-        id: 0
-    }, {
-        name: '男',
-        id: 1
-    }];
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        global.fetch_user().then(function (data) {
-            $scope.loading = $scope.userinfo == undefined;
-            Dept.getUsrDetail().then(function (data) {
-                $scope.userinfo = angular.copy(data);
-                $scope.userinfo.photo = data.photo == null ? '../../../img/panda.png' : data.photo;
-                $scope.userinfo.compname = global.user.compname;
-                $scope.userinfo.compno = global.user.compno;
-                $scope.loading = false;
-            }, function (err) {
-                alert(JSON.stringify(err))
-            });
-        });
-        $scope.popup = {
-            isPopup: false,
-            optionsPopup: null
-        };
-    });
-
-    $scope.selectimg = function () {
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isPopup = true;
-    };
-
-    $scope.editInfo = function (title, input_type, field_name, value) {
-        $scope.userinfo[field_name] = value == undefined ? '' : value;
-        $scope.personinfo.value = value == undefined ? '' : value;
-        var template = formatFilter('<div rj-close-back-drop><label class="item item-input"> <input type="{0}" ng-model="personinfo.value" placeholder="输入{1}"></label></div>', input_type, title);
-        $scope.popup.optionsPopup = $ionicPopup.show({
-            template: template,
-            title: '<div><h4>' + title + '</h4></div>',
-            scope: $scope,
-            buttons: [{
-                text: '取消',
-                onTap: function () {
-                    return false;
-                }
-            }, {
-                text: '<b>保存</b>',
-                type: 'button-positive',
-                onTap: function (e) {
-                    if (!$scope.personinfo.value) e.preventDefault(); else  return true;
-                }
-            }]
-        });
-        $scope.popup.optionsPopup.then(function (res) {
-            if (res) {
-                $scope.userinfo[field_name] = $scope.personinfo.value;
-                $scope.updateInfo();
-                $scope.popup.optionsPopup.close();
-            }
-        });
-        $scope.popup.isPopup = true;
-    };
-
-    var ImagePicker = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures(1).then(function (results) {
-            if (results.length == 0) return;
-            $q.all(results).then(function (res) {
-                uploadimg(res);
-            })
-        });
-    };
-
-    var Camera = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture(true).then(function (result) {
-            uploadimg([result])
-        });
-    };
-
-    function uploadimg(files) {
-        showPopup.showLoading(1, '', true);
-        ImageManage.uploadImage(files, 'user', global.user.usrid, 'userfile').then(function (ps) {
-            $q.all(ps).then(function (fs) {
-                $scope.userinfo.photo = JSON.parse(fs[0].response).file_thumbnail_path;
-                showPopup.hideLoading();
-            }, function (err) {
-                showPopup.hideLoading();
-            })
-        }, function (err) {
-            showPopup.hideLoading();
-        })
-    }
-
-    $scope.updateInfo = function () {
-        showPopup.showLoading(1, '', false);
-        Dept.putUsrInfo($scope.userinfo).then(function (res) {
-            showPopup.hideLoading();
-        }, function (err) {
-            showPopup.hideLoading();
-        })
-    };
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-        Member.selecteddepts = [];
-        if ($rootScope.commons.modal != null) $rootScope.commons.modal.remove();
-    })
-})
-
-.controller('EditDeptDegreeCtrl', function ($scope, $state, $rootScope, $ionicHistory, $timeout, global, Member, showPopup, Dept, Tool) {
-    $scope.userinfo = {};
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        global.fetch_user().then(function (data) {
-            if (Member.selecteddepts.length > 0) {
-                $scope.userinfo.depname = Member.selecteddepts[0].depname;
-                $scope.userinfo.dept_id = Member.selecteddepts[0].id;
-            } else $scope.userinfo = Tool.getTempData('userinfo');
-        });
-    });
-
-    $scope.selectdept = function () {
-        Member.routename = 'editdeptdegree';
-        Member.titlename = '选择部门';
-        Member.resourcemember = [{'id': $scope.userinfo.dept_id, 'depname': $scope.userinfo.depname}];
-        Member.selecteddepts = [];
-        $state.go('selectsingledept');
-    };
-
-    $scope.ok = function () {
-        showPopup.showLoading(1, '', false);
-        Dept.putUsrInfo($scope.userinfo).then(function (res) {
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        }, function (err) {
-            showPopup.hideLoading();
-            alert(JSON.stringify(err));
-        })
-    };
-
-    $scope.cancel = function () {
-        $ionicHistory.goBack();
-    };
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-        Member.selecteddepts = [];
-    })
-})
-;

+ 0 - 73
www/apps/accountMng/js/factory.js

@@ -1,73 +0,0 @@
-starter.factory('CompManage', function ($http, $q, $filter, $ionicPlatform, $cordovaPreferences, cfg, formatFilter, global, Tool) {
-
-    var complist = [];
-
-    return {
-        post_Register: function (data) {
-            console.log(data)
-            var url = formatFilter('{0}register/', cfg.api);
-            return Tool.post(url, data);
-        },
-        post_Joinin: function (data) {
-            var url = formatFilter('{0}joinin/', cfg.api);
-            var deferred = $q.defer();
-            $http.post(url, data).then(function (res) {
-                    deferred.resolve(res);
-                },
-                function (err) {
-                    deferred.reject(err);
-                });
-            return deferred.promise;
-        },
-        getUserAuditstatus: function (auditstatus, compid) {
-            var url = formatFilter('{0}joinin/?auditstatus={1}&compid={2}', cfg.api, auditstatus, compid);
-            return Tool.get(url);
-        },
-        auditUser: function (user, status, compid) {
-            var url = formatFilter('{0}joinin/{1}/?status={2}&compid={3}', cfg.api, user.user_id, status, compid);
-            return Tool.put(url);
-        },
-        get_Compdata: function () {
-            var url = formatFilter('{0}comps/', cfg.api);
-            return Tool.get(url, true, 'complist');
-        },
-        getComplist: function () {
-            complist = Tool.getTempData('complist');
-            return complist;
-        },
-        editComp: function (data) {
-            var url = formatFilter('{0}comps/{1}/', cfg.api, data.id);
-            return Tool.put(url, data);
-        },
-        post_authcheck: function (imid, compid) {
-            var url = formatFilter('{0}authcheck/', cfg.api);
-            var d = $filter('format')("imid={0}&compid={1}&password={2}", imid, compid, global.user.password);
-            return Tool.post(url, d, false);
-        },
-        store_user: function () {
-            var deferred = $q.defer();
-            var user = angular.copy(global.user);
-            user.cfg = {'api': global.api};
-            $cordovaPreferences.store('user', ionic.Platform.isAndroid() ? JSON.stringify(user) : user)
-            .success(function (value) {
-                deferred.resolve(value);
-                // alert("store Success: " + value);
-            })
-            .error(function (error) {
-                deferred.reject(err);
-                alert("store Error: " + error);
-            });
-            return deferred.promise;
-        },
-        leave_comp: function (compid) {
-            var url = formatFilter('{0}comps/{1}/?type={2}', cfg.api, compid, "leave");
-            var d = $filter('format')("imid={0}&compid={1}", global.user.im_usrid, compid);
-            return Tool.put(url, d);
-        },
-        dismiss_comp: function (compid) {
-            var url = formatFilter('{0}comps/{1}/?type={2}', cfg.api, compid, "dismiss");
-            var d = $filter('format')("compid={0}", compid);
-            return Tool.put(url, d);
-        }
-    };
-})

+ 0 - 61
www/apps/accountMng/js/route.js

@@ -1,61 +0,0 @@
-starter.config(function ($stateProvider, $translateProvider) {
-    $stateProvider.state('account-manage', {
-        url: '/index',
-        templateUrl: 'templates/account-manage.html',
-        controller: 'AccountManageCtrl'
-    })
-
-    .state('managecomp', {
-        url: '/managecomp',
-        templateUrl: 'templates/managecomp.html',
-        controller: 'ManageCompCtrl'
-    })
-
-    .state('compinfo', {
-        url: '/compinfo/:compid/:op',
-        templateUrl: 'templates/compinfo.html',
-        controller: 'CompInfoCtrl'
-    })
-
-    .state('joincomp', {
-        url: '/joincomp',
-        templateUrl: 'templates/joincomp.html',
-        controller: 'JoinCompCtrl'
-    })
-
-    .state('applycheck', {
-        url: '/applycheck',
-        templateUrl: 'templates/applycheck.html',
-        controller: 'ApplyCheckCtrl'
-    })
-
-    .state('contacts-companylst', {
-        url: '/contacts-companylst',
-        templateUrl: 'templates/contacts-companylst.html',
-        controller: 'ContactsCompanylstCtrl'
-    })
-
-    .state('deptlst', {
-        url: '/contacts/:id&:name&:compid',
-        templateUrl: 'templates/contacts-deptlst.html',
-        controller: 'DeptCtrl'
-    })
-
-    .state('editDep', {
-        url: '/editDep/:id&:name&:compid',
-        templateUrl: 'templates/editDep.html',
-        controller: 'EditDepCtrl'
-    })
-
-    .state('personinfo', {
-        url: '/personinfo',
-        templateUrl: 'templates/personinfo.html',
-        controller: 'PersonInfoCtrl'
-    })
-
-    .state('editdeptdegree', {
-        url: '/editdeptdegree',
-        templateUrl: 'templates/edit_deptdegree.html',
-        controller: 'EditDeptDegreeCtrl'
-    })
-});

+ 0 - 0
www/apps/accountMng/index.html → www/apps/compmanage/index.html


+ 0 - 0
www/apps/accountMng/js/directive.js → www/apps/compmanage/js/controllers.js


+ 0 - 0
www/apps/notice/js/directive.js → www/apps/compmanage/js/directive.js


+ 8 - 0
www/apps/compmanage/js/factory.js

@@ -0,0 +1,8 @@
+starter.factory('CompManage', function ($http, $q, $filter, $ionicPlatform, $cordovaPreferences, cfg, formatFilter, global, Tool) {
+
+    var complist = [];
+
+    return {
+
+    };
+})

+ 7 - 0
www/apps/compmanage/js/route.js

@@ -0,0 +1,7 @@
+starter.config(function ($stateProvider, $translateProvider) {
+    $stateProvider.state('compmanage', {
+        url: '/index',
+        templateUrl: 'templates/account-manage.html',
+        controller: 'AccountManageCtrl'
+    })
+});

+ 0 - 0
www/apps/accountMng/templates/account-manage.html → www/apps/compmanage/templates/account-manage.html


+ 0 - 0
www/apps/accountMng/templates/applycheck.html → www/apps/compmanage/templates/applycheck.html


+ 0 - 0
www/apps/accountMng/templates/compinfo.html → www/apps/compmanage/templates/compinfo.html


+ 0 - 0
www/apps/accountMng/templates/contacts-companylst.html → www/apps/compmanage/templates/contacts-companylst.html


+ 0 - 0
www/apps/accountMng/templates/contacts-deptlst.html → www/apps/compmanage/templates/contacts-deptlst.html


+ 0 - 0
www/apps/accountMng/templates/createcomp-modaltemplate.html → www/apps/compmanage/templates/createcomp-modaltemplate.html


+ 0 - 0
www/apps/accountMng/templates/editDep.html → www/apps/compmanage/templates/editDep.html


+ 0 - 0
www/apps/accountMng/templates/edit_deptdegree.html → www/apps/compmanage/templates/edit_deptdegree.html


+ 0 - 0
www/apps/accountMng/templates/joincomp.html → www/apps/compmanage/templates/joincomp.html


+ 0 - 0
www/apps/accountMng/templates/managecomp.html → www/apps/compmanage/templates/managecomp.html


+ 0 - 0
www/apps/accountMng/templates/modal-dept_degree.html → www/apps/compmanage/templates/modal-dept_degree.html


+ 0 - 0
www/apps/accountMng/templates/personinfo.html → www/apps/compmanage/templates/personinfo.html


+ 0 - 49
www/apps/daily/index.html

@@ -1,49 +0,0 @@
-<!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.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>

+ 0 - 1514
www/apps/daily/js/controllers.js

@@ -1,1514 +0,0 @@
-starter.controller('DailyCtrl', function ($rootScope, $scope, $state, global, Daily, Tool) {
-    $scope.goBack = function () {
-        global.goBack();
-    }
-
-    global.fetch_user().then(function () {
-        getdailydata();
-    });
-
-    $scope.toman = function () {
-        $state.go('daily-man');
-    }
-
-    $scope.towrite = function () {
-        $state.go('daily-edit', {
-            'flag': 0
-        });
-    }
-
-    $scope.totransfer = function (id) {
-        $state.go('transfer', {
-            module: 'daily',
-            id: id
-        });
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getdailydata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.dailys != undefined && $scope.dailys.next != null) {
-            Tool.get($scope.dailys.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.dailys.results.push(item);
-                });
-                $scope.dailys.next = data.next;
-                $scope.dailys.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.dailys != undefined && $scope.dailys.next != null ? true : false;
-    }
-
-    function getdailydata() {
-        if (global.user.token != "") {
-            if ($scope.dailys == undefined) {
-                $scope.loading = true;
-            }
-            Daily.dailymf.get(function (res) {
-                $scope.dailys = res;
-                console.log($scope.dailys);
-                $scope.roleid = global.user.roleid;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    DailyDoRefresh = $rootScope.$on('DailyDoRefresh', function (event, data) {
-        getdailydata();
-    });
-
-    $scope.$on("$destroy", function () {
-        DailyDoRefresh();
-    });
-})
-
-.controller('DailyReadCtrl', function ($scope, $state, $ionicSlideBoxDelegate, Daily, global, Tool) {
-    $scope.index = 0;
-
-    global.fetch_user().then(function () {
-        getsummaryata();
-    });
-
-    $scope.select = function (index) {
-        $ionicSlideBoxDelegate.slide(index);
-        $scope.index = $ionicSlideBoxDelegate.currentIndex();
-    }
-
-    $scope.toMonthCount = function (item) {
-        $state.go('daily-readMonthCount', {
-            'daily_dd': item.daily_date
-        });
-    }
-
-    $scope.toDayCount = function (date) {
-        $state.go('daily-readDay', {
-            'daily_dd': date
-        })
-    }
-
-    $scope.isMonth = function (item) {
-        var date = new Date(item.daily_date);
-        return date.getMonth() == new Date().getMonth() ? false : true;
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getsummaryata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.summary != undefined && $scope.summary.next != null) {
-            Tool.get($scope.summary.next).then(function (data) {
-                data.results = initialize(data.results);
-                _.each(data.results, function (value, key) {
-                    var item = _.pick($scope.summary.results, key);
-                    if (item[key]) {
-                        _.each(value, function (i) {
-                            $scope.summary.results[key].push(i);
-                        })
-                    } else {
-                        $scope.summary.results[key] = value;
-                    }
-                });
-                console.log($scope.summary.results);
-                $scope.summary.next = data.next;
-                $scope.summary.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.summary != undefined && $scope.summary.next != null ? true : false;
-    }
-
-    function getsummaryata() {
-        if (global.user.token != "") {
-            if ($scope.summary == undefined) {
-                $scope.loading = true;
-            }
-            Daily.dailysummary.get(function (res) {
-                console.log(res.results);
-                res.results = initialize(res.results);
-                $scope.summary = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    function initialize(data) {
-        _.each(data, function (item) {
-            var date = new Date(item.daily_date);
-            item.month = date.getFullYear() + '-' + (date.getMonth() + 1);
-        });
-        return _.groupBy(data, 'month');
-    }
-})
-
-.controller('DailyDetailsCtrl', function ($rootScope, $scope, $state, $ionicPopover, $ionicPopup, $ionicHistory, global, Daily, showPopup) {
-    $scope.id = $state.params['id'];
-    $scope.cssstyle = true;
-    $scope.comments = {};
-    $scope.reads = {};
-    $scope.data = {
-        daily_mf: $scope.id,
-        comment: null
-    }
-    var view = $ionicHistory.backView();
-
-    $scope.popup = {
-        isPopup: false
-    }
-
-    global.fetch_user().then(function () {
-        if (view) {
-            $scope.loading = true;
-            $scope.daily = Daily.daily;
-            Daily.dailyread.get({mf_id: $scope.id}, function (data) {
-                $scope.comments = data;
-                $scope.loading = false;
-            });
-            Daily.readview.query({mf_id: $scope.id}, function (data) {
-                $scope.reads = data;
-            });
-        } else {
-            getdailydata();
-        }
-    });
-
-    $scope.goBack = function () {
-        global.goBack();
-    }
-
-    $ionicPopover.fromTemplateUrl('templates/detiilsmenu.html', {
-        scope: $scope
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    $scope.sendComment = function () {
-        if ($scope.data.comment != null && $scope.data.comment != "") {
-            Daily.dailyread.save($scope.data, function (data) {
-                $scope.comments.results.splice(0, 0, data);
-                $scope.data.comment = null;
-            })
-        }
-    }
-
-    $scope.popupMessageOpthins = function (id, usrid) {
-        if (usrid == global.user.usrid) {
-            $scope.popup.optionsPopup = $ionicPopup.show({
-                template: '<div class="center" style="height:20px;width:100%;line-height:20px;margin-top:10px;" rj-close-back-drop><h4>用户操作</h4></div>',
-                scope: $scope,
-                buttons: [{
-                    text: '删除',
-                    type: 'button-positive',
-                    onTap: function (e) {
-                        Daily.dailyread.delete({id: id}, function () {
-                            var comment = _.find($scope.comments.results, function (item) {
-                                if (item.id === parseInt(id))
-                                    return item;
-                            });
-                            if (comment != undefined)
-                                $scope.comments.results.splice($scope.comments.results.indexOf(comment), 1);
-                        });
-                    }
-                }]
-            });
-            $scope.popup.isPopup = true;
-        }
-    }
-
-    $scope.transfer = function () {
-        $scope.popover.hide();
-        $state.go('transfer', {
-            module: 'daily',
-            id: $scope.id
-        });
-    }
-
-    $scope.remove = function () {
-        $scope.popover.hide();
-        showPopup.confirm('是否删除该汇报?', '是', '否').then(function (res) {
-            if (res) {
-                Daily.dailymf.delete({id: $scope.id}, function () {
-                    $scope.$emit('DailyDoRefresh');
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.edit = function () {
-        $scope.popover.hide();
-        $state.go('daily-edit', {
-            'flag': $scope.id
-        })
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getdailydata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.comments != undefined && $scope.comments.next != null) {
-            Tool.get($scope.comments.next).then(function (data) {
-                _.each(data.comments, function (item) {
-                    $scope.comments.results.push(item);
-                });
-                $scope.comments.next = data.next;
-                $scope.comments.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.comments != undefined && $scope.comments.next != null ? true : false;
-    }
-
-    function getdailydata() {
-        if ($scope.daily == undefined) {
-            $scope.loading = true;
-        }
-        Daily.dailymf.get({id: $scope.id}, function (res) {
-            Daily.daily = _.clone(res);
-            $scope.daily = res;
-        }, function (err) {
-            alert(JSON.stringify(err));
-        }).$promise.finally(function () {
-            $scope.$broadcast('scroll.refreshComplete');
-            $scope.loading = false;
-        });
-        Daily.dailyread.get({mf_id: $scope.id}, function (data) {
-            $scope.comments = data;
-        });
-        Daily.readview.query({mf_id: $scope.id}, function (data) {
-            $scope.reads = data;
-        });
-    }
-
-    DailyDetailDoRefresh = $rootScope.$on('DailyDetailDoRefresh', function (event, data) {
-        getdailydata();
-    });
-
-    $scope.$on("$destroy", function () {
-        DailyDetailDoRefresh();
-        $scope.popover.remove();
-    })
-})
-
-.controller('DailyPermissionCtrl', function ($rootScope, $scope, $ionicPopover, $state, global, Daily) {
-    var deletes = {C: [], D: [], U: []};
-
-    global.fetch_user().then(function () {
-        getpermissiondata();
-    });
-
-    $ionicPopover.fromTemplateUrl('templates/add.html', {
-        scope: $scope
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    $scope.isshowdelete = {
-        showDelete: false
-    }
-
-    $scope.displayremove = function () {
-        $scope.isshowdelete.showDelete = !$scope.isshowdelete.showDelete;
-        $scope.popover.hide();
-    }
-
-    $scope.ok = function () {
-        $scope.popover.hide();
-        if (deletes.D.length > 0) {
-            deletes.D = deletes.D.join(',');
-            Daily.dailypermission.patch(deletes, function () {
-                deletes.D = [];
-            });
-        }
-        $scope.isshowdelete.showDelete = false;
-    }
-
-    $scope.toadd = function () {
-        $scope.popover.hide();
-        $state.go('additem');
-    }
-
-    $scope.remove = function (item) {
-        _.each(item.permissions, function (permission) {
-            deletes.D.push(permission.id);
-        });
-        $scope.userlist.results.splice(_.indexOf($scope.userlist.results, item), 1);
-    }
-
-    $scope.toSelectDeptOrItem = function (item) {
-        Daily.permissionUser = _.clone(item);
-        $state.go('selectdeptoritem', {
-            "id": item.user_id
-        });
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpermissiondata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.userlist != undefined && $scope.userlist.next != null) {
-            Tool.get($scope.userlist.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.userlist.results.push(item);
-                });
-                $scope.userlist.next = data.next;
-                $scope.userlist.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.userlist != undefined && $scope.userlist.next != null ? true : false;
-    }
-
-    function getpermissiondata() {
-        if (global.user.token != "") {
-            if ($scope.userlist == undefined) {
-                $scope.loading = true;
-            }
-            Daily.dailypermission.get(function (res) {
-                $scope.userlist = res;
-                Daily.permissionUsers = res.results;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    DailyPermissionDoRefresh = $rootScope.$on('DailyPermissionDoRefresh', function (event, data) {
-        getpermissiondata();
-    });
-
-    $scope.$on('$destroy', function () {
-        DailyPermissionDoRefresh();
-        $scope.popover.remove();
-    })
-})
-
-.controller('SelectDeptOrItemCtrl', function ($rootScope, $scope, $state, $stateParams, $ionicHistory, Daily, Dept, showPopup, Tool) {
-    var userId = $stateParams.id;
-    $scope.cancel = function () {
-        $ionicHistory.goBack();
-    }
-    $scope.leftbtn = [{
-        text: '取消',
-        click: 'cancel'
-    }, {
-        text: '上一层',
-        click: 'up'
-    }];
-    $scope.index = 0;
-    $scope.deptlst = [];
-    $scope.emplst = [];
-    $scope.deptid = null;
-    $scope.selecteditems = angular.copy(Daily.permissionUser);
-    var selecteditems_old = [];
-    _.each($scope.selecteditems.depts, function (dept) {
-        selecteditems_old.push(dept.permission);
-    });
-    _.each($scope.selecteditems.users, function (user) {
-        selecteditems_old.push(user.permission);
-    });
-
-    var patchs = {C: [], D: [], U: []};
-    $scope.selectcount = '';
-    $scope.isUp = false;
-    $scope.loading = true;
-    Dept.getDep().then(function (data) {
-        d = _.find(data, function (dept) {
-            return dept.parent == null;
-        });
-        data = _.filter(data, function (item) {
-            return item.level == 1;
-        });
-        $scope.deptlst = data;
-        setdeptrighticon($scope.deptlst);
-        getemp(d.id);
-        $scope.loading = false;
-    });
-
-    $scope.tochilddept = function (dept) {
-        getChildDept(dept.id);
-    }
-
-    function getemp(id, childdepts) {
-        Dept.getEmp(id).then(function (data) {
-            $scope.emplst = data;
-            setitem();
-        });
-    }
-
-    function getChildDept(did) {
-        Dept.getEmp(did).then(function (data) {
-            $scope.emplst = data;
-            $scope.deptlst = Dept.getChildDept(did);
-            setdeptrighticon($scope.deptlst);
-            setitem();
-            deptid = did;
-            if (did == 1) {
-                $scope.index = 0;
-            } else {
-                $scope.index = 1;
-            }
-        });
-    }
-
-    function setitem() {
-        _.each($scope.deptlst, function (cd) {
-            cd.selected = false;
-            _.each($scope.selecteditems.depts, function (dept) {
-                if (cd.id == dept.id)
-                    cd.selected = true;
-            });
-            cd.isShow = Dept.getChildDept(cd.id).length == 0 ? false : true;
-        });
-        _.each($scope.emplst, function (e) {
-            e.selected = false;
-            _.each($scope.selecteditems.users, function (user) {
-                if (e.user_id == user.user_id)
-                    e.selected = true;
-            });
-        });
-    }
-
-    function setdeptrighticon(deptlst) {
-        _.each(deptlst, function (d) {
-            d.isShow = Dept.getChildDept(d.id).length == 0 ? false : true;
-        })
-    }
-
-    $scope.up = function () {
-        var dept = _.find(Dept.all(), function (d) {
-            return d.id == parseInt(deptid);
-        });
-        getChildDept(dept.parent);
-    }
-
-    $scope.change = function (selitem, op) {
-        var type = op == 'd' ? true : false;
-        if (op == 'd') {
-            setSelectItem(selitem, type, $scope.selecteditems.depts);
-        } else {
-            setSelectItem(selitem, type, $scope.selecteditems.users);
-        }
-        if ($scope.selecteditems.all) {
-            $scope.selecteditems.all = false;
-            if ($scope.selecteditems.permissions.length == 1 && $scope.selecteditems.permissions[0].flag == 0) {
-                patchs.D = $scope.selecteditems.permissions[0].id.toString();
-            }
-        }
-    }
-
-    function setSelectItem(selectItem, type, array) {
-        if (selectItem.selected) {
-            selectItem.permission = {
-                'user_id': userId,
-                'flag': type ? 1 : 2,
-                'value': type ? selectItem.id : selectItem.user_id
-            };
-            array.push(selectItem);
-        } else {
-            var item = _.find(array, function (item) {
-                return type ? item.id == selectItem.id : item.user_id == selectItem.user_id;
-            });
-            array.splice(_.indexOf(array, item), 1);
-        }
-    }
-
-    $scope.ok = function () {
-        selecteditems = [];
-        _.each($scope.selecteditems.depts, function (dept) {
-            selecteditems.push(dept.permission);
-        });
-        _.each($scope.selecteditems.users, function (user) {
-            selecteditems.push(user.permission);
-        });
-
-        rst = _.diff(selecteditems, selecteditems_old);
-        if (patchs.D.length > 0) {
-            if (rst.D.length > 0) {
-                rst.D = rst.D + ',' + patchs.D;
-            } else {
-                rst.D = patchs.D;
-            }
-        }
-        if (rst.C.length > 0 || rst.U.length > 0 || rst.D.length > 0) {
-            showPopup.showLoading(1, '正在提交');
-            Daily.dailypermission.patch(rst, function () {
-                $scope.$emit('DailyPermissionDoRefresh');
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            })
-        } else {
-            $ionicHistory.goBack();
-        }
-    }
-
-    $scope.selectAll = function () {
-        if ($scope.selecteditems.all) {
-            if ($scope.selecteditems.permissions.length == 1 && $scope.selecteditems.permissions[0].flag == 0) {
-                $ionicHistory.goBack();
-            } else {
-                showPopup.showLoading(1, '正在提交');
-                var data = {C: [], D: [], U: []};
-                data.C.push({
-                    'user_id': userId,
-                    'flag': 0,
-                    'value': 0
-                });
-                data.D = _.map($scope.selecteditems.permissions, function (permission) {
-                    return permission.id;
-                }).join(',');
-                Daily.dailypermission.patch(data, function () {
-                    $scope.$emit('DailyPermissionDoRefresh');
-                    showPopup.hideLoading();
-                    $ionicHistory.goBack();
-                })
-            }
-        }
-    }
-})
-
-.controller('DailyTemplateCtrl', function ($rootScope, $scope, $state, Daily, global) {
-    $scope.gosetmoban = function (template) {
-        Daily.currentTemplate = template;
-        $state.go('daily-templateEdit', {
-            "id": template.id
-        });
-    }
-
-    global.fetch_user().then(function () {
-        gettemplatedata();
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        gettemplatedata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.templates != undefined && $scope.templates.next != null) {
-            Tool.get($scope.templates.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.templates.results.push(item);
-                });
-                $scope.templates.next = data.next;
-                $scope.templates.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.templates != undefined && $scope.templates.next != null ? true : false;
-    }
-
-    function gettemplatedata() {
-        if (global.user.token != "") {
-            if ($scope.templates == undefined) {
-                $scope.loading = true;
-            }
-            Daily.template.get(function (res) {
-                $scope.templates = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    DailyTemplateDoRefresh = $rootScope.$on('DailyTemplateDoRefresh', function (event, data) {
-        gettemplatedata();
-    });
-
-    $scope.$on("$destroy", function () {
-        DailyTemplateDoRefresh();
-    });
-})
-
-.controller('DailyTemplateScopeCtrl', function ($rootScope, $scope, $stateParams, $ionicHistory, $state, Dept, Daily) {
-    $scope.leftbtn = [{
-        text: '取消',
-        click: 'cancel'
-    }, {
-        text: '上一层',
-        click: 'up'
-    }];
-    $scope.isNew = $stateParams.id == -1;
-    // Daily.templateData = {items: [], depts: []}
-    $scope.deptsAll = [];
-    $scope.index = 0;
-    $scope.actived = false;
-    $scope.cancel = function () {
-        $ionicHistory.goBack();
-    }
-    $scope.depts = [];
-    if (!$scope.isNew) {
-        $scope.selecteddepts = _.map(Daily.templateData.depts, function (dept) {
-            return {'id': dept.dept_id, 'depname': dept.dept_name}
-        });
-    } else {
-        $scope.selecteddepts = []
-    }
-
-    $scope.selecteddepts_old = _.map($scope.selecteddepts, _.clone)
-    $scope.selectdeptcount = '';
-    $scope.showupbtn = false;
-    var resourcedept = [];
-    $scope.isUp = false;
-    $scope.loading = true;
-    function setdept(data) {
-        $scope.depts = data;
-    }
-
-    Dept.getDep().then(function (data) {
-        $scope.deptsAll = data;
-        Daily.templatedept.get(function (res) {
-            _.each($scope.deptsAll, function (dept) {
-                dept.selected = _.find($scope.selecteddepts, function (d) {
-                    return d.id == dept.id && !$scope.isNew;
-                }) == undefined ? false : true; //selected the existing dept
-                if (!dept.selected) {
-                    dept.isdisabled = _.find(res.results, function (d) {
-                        return d.dept_id == dept.id;
-                    }) == undefined ? false : true;//部门是否已设置模板
-                }
-                dept.isshow = Dept.getChildDept(dept.id).length > 0;
-            });
-            $scope.loading = false;
-        });
-
-        depts_lvl_1 = _.filter($scope.deptsAll, function (item) {
-            return item.level == 1;
-        });
-        setdept(depts_lvl_1);
-    });
-
-    $scope.change = function (dept) {
-        if (dept.selected) {
-            $scope.selecteddepts.push(dept);
-            Daily.templateDepts.push(dept);
-        } else {
-            $scope.selecteddepts.splice(_.indexOf($scope.selecteddepts, dept), 1);
-            Daily.templateDepts.splice(_.indexOf(Daily.templateDepts, dept), 1);
-        }
-    }
-
-    $scope.ok = function () {
-        depts = _.pluck($scope.selecteddepts, 'depname');
-        dept_names = depts.join(',');
-        dept_ids = _.pluck($scope.selecteddepts, 'id');
-        if ($scope.isNew) {
-            Daily.template.save({'name': dept_names, 'dept_ids': dept_ids}, function (dept) {
-                $scope.$emit('DailyTemplateDoRefresh');
-                $state.go('custom-form', {id: dept.id});
-            })
-        } else {
-            Daily.template.update({'id': $stateParams.id, 'name': dept_names, 'dept_ids': dept_ids}, function (dept) {
-                $scope.$emit('DailyTemplateDetailDoRefresh');
-                $scope.$emit('DailyTemplateDoRefresh');
-                $ionicHistory.goBack();
-            })
-        }
-    }
-
-    var activedept = {};
-    $scope.tochilddept = function (dept) {
-        activedept = dept;
-        if (dept.isshow) {
-            getChildDept(dept);
-        } else {
-            activedept.selected = !activedept.selected;
-            $scope.change(activedept);
-        }
-    }
-
-    function getChildDept(dept) {
-        var childdepts = Dept.getChildDept(dept.id);
-        $scope.index = dept.level < 1 ? 0 : 1;
-        if (childdepts.length > 0) {
-            setdept(childdepts);
-        }
-    }
-
-    $scope.up = function () {
-        dept = _.find($scope.deptsAll, function (dept) {
-            return dept.id == activedept.parent;
-        });
-        getChildDept(dept);
-        activedept = dept
-    }
-})
-
-.controller('DailyTemplateEditCtrl', function ($rootScope, $scope, $ionicHistory, $state, $stateParams, global, Dept, Daily, showPopup) {
-    Daily.templateId = $stateParams.id;
-
-    $scope.cancel = function () {
-        $ionicHistory.goBack();
-    }
-
-    global.fetch_user().then(function (data) {
-        gettemplatedata();
-    });
-
-    $scope.delete = function () {
-        showPopup.confirm('是否删除该日报模板?', '是', '否').then(function (res) {
-            if (res) {
-                Daily.template.delete({id: $stateParams.id}, function () {
-                    $scope.$emit('DailyTemplateDoRefresh');
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.defineform = function () {
-        $state.go('custom-form', {
-            id: $stateParams.id
-        });
-    }
-
-    $scope.toSetDept = function () {
-        $state.go('daily-templateScope', {
-            "id": $stateParams.id
-        });
-    }
-
-    function gettemplatedata() {
-        if (global.user.token != "") {
-            Daily.template.get({'id': Daily.templateId}, function (res) {
-                $scope.template = res;
-                Daily.templateData = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            });
-        }
-    }
-
-    DailyTemplateDetailDoRefresh = $rootScope.$on('DailyTemplateDetailDoRefresh', function (event, data) {
-        gettemplatedata();
-    });
-
-    $scope.$on("$destroy", function () {
-        DailyTemplateDetailDoRefresh();
-    });
-})
-
-.controller('FormFieldTypeCtrl', function ($scope, $state, $ionicHistory, global, showPopup, Daily) {
-    $scope.template_field = {};
-    $scope.index = $state.params['id'];
-    $scope.isNew = $scope.index == -1;
-    $scope.showadd = false;
-    $scope.template_field.required = false;
-    $scope.selecttexts = [{text: ""}];
-    $scope.template_field_active = {};
-    if (!$scope.isNew && Daily.templateData.items[$scope.index]) {
-        $scope.template_field = Daily.templateData.items[$scope.index];
-    }
-
-    watch = $scope.$watch('template_field', function (n, o) {
-        if (n == o)
-            return;
-        $scope.template_field.isModified = true; //TODO:check
-    }, true);
-
-    global.fetch_user().then(function () {
-        Daily.templatefield.get(function (res) {
-            $scope.template_fields = res.results;
-            if ($scope.isNew) {
-                if ($scope.template_fields.length > 1) {
-                    $scope.template_field_active = $scope.template_fields[1]
-                }
-            } else {
-                $scope.template_field_active = _.find($scope.template_fields, function (r_field) {
-                    return r_field.id == $scope.template_field.daily_template_field_id;
-                })
-            }
-
-            if ($scope.template_field && $scope.template_field.extra)
-                $scope.selecttexts = JSON.parse($scope.template_field.extra)
-        })
-    });
-
-    $scope.back = function () {
-        $ionicHistory.goBack();
-    }
-
-    $scope.add = function () {
-        $scope.selecttexts.push({text: ""});
-    }
-
-    $scope.change = function (item) {
-        $scope.template_field_active = item;
-    }
-
-    $scope.ok = function () {
-        if ($scope.template_field.name == '' || $scope.template_field.name == undefined) {
-            showPopup.PopupWindow(0, '名称不能为空!', false);
-            return;
-        }
-
-        if ($scope.template_field.showlist)
-            if ($scope.selecttexts.length == 0) {
-                showPopup.PopupWindow(0, '请添加选项!', false);
-                return;
-            } else {
-                $scope.template_field.extra = $scope.selecttexts;
-            }
-        exists = _.find(Daily.templateData.items, function (f) {
-            return f.name == $scope.template_field.name && f != $scope.template_field;
-        });
-
-        if (exists) {
-            showPopup.PopupWindow(0, '名称不能重复!', false);
-            return;
-        }
-
-        if ($scope.template_field_active) {
-            $scope.template_field.daily_template_field_id = $scope.template_field_active.id;
-            $scope.template_field.t__type = $scope.template_field_active.type;
-        }
-
-        d = _.filter($scope.selecttexts, function (item) {
-            return item.text != "";
-        });
-        if (d.length > 0) {
-            $scope.template_field.extra = JSON.stringify(d)
-        }
-
-        if ($scope.isNew) {
-            $scope.template_field.daily_template_id = Daily.templateId;
-            Daily.templateData.items.push($scope.template_field);
-        }
-
-        $ionicHistory.goBack();
-    }
-
-    $scope.delete = function () {
-        Daily.templateData.items.splice($scope.index, 1);
-        $ionicHistory.goBack();
-    }
-
-    $scope.remove = function (index) {
-        $scope.selecttexts.splice(index, 1);
-    }
-
-    $scope.$on("$destroy", function () {
-        watch();
-    })
-})
-
-.controller('CustomFormCtrl', function ($rootScope, $scope, $ionicHistory, $state, global, Daily, showPopup, Tool) {
-    $scope.fieldItems = [];
-    $scope.fieldItems_old = [];
-
-    $scope.mobanitems = null;
-    $scope.addmobanitems = null;
-    Daily.templateId = $state.params['id'];
-    $scope.isNew = Daily.templateId == -1;
-
-    global.fetch_user().then(function (data) {
-        Daily.templateitem.get({'daily_template_id': Daily.templateId}, function (res) {
-            Daily.templateData.items = res.results;
-            $scope.fieldItems = Daily.templateData.items;
-            $scope.fieldItems_old = _.map($scope.fieldItems, _.clone);
-        })
-    });
-
-    $scope.ok = function () {
-        if (Daily.templateData.items.length == 0) {
-            showPopup.PopupWindow(0, '请添加字段!', false);
-            return;
-        }
-        showPopup.showLoading(1, '正在上传');
-        Daily.templateData.description = Daily.get_description();
-        Daily.template.update({'id': Daily.templateId, 'description': Daily.templateData.description});
-        var fieldItems = _.map($scope.fieldItems, function (item) {
-            return _.omit(item, 't__type');
-        });
-        rst = _.diff(fieldItems, $scope.fieldItems_old);
-        Daily.templateitem.patch(rst, function () {
-            $scope.$emit('DailyTemplateDoRefresh');
-            Tool.removeBackView('daily-templateScope');
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        });
-    }
-
-    $scope.cancel = function () {
-        Daily.templateData.items = [];
-        Tool.removeBackView('daily-templateScope');
-        $ionicHistory.goBack();
-    }
-
-    $rootScope.commons.fun = $scope.cancel;
-
-    $scope.tohref = function (item) {
-        var index = _.indexOf(Daily.templateData.items, item);
-        return '#/fieldtype/' + index;
-    }
-
-    $scope.preview = function () {
-        Daily.previewData = {
-            'daily_tfs': Daily.templateData.items
-        }
-        $state.go('daily-edit', {
-            'flag': -1
-        });
-    }
-})
-
-.controller('AddItemCtrl', function ($rootScope, $scope, $state, $ionicHistory, Dept, Daily, showPopup) {
-    $scope.isUp = false;
-    $scope.leftbtn = [{
-        text: '取消',
-        click: 'cancel'
-    }, {
-        text: '上一层',
-        click: 'up'
-    }];
-    $scope.index = 0;
-    $scope.deptlst = [];
-    $scope.emplst = [];
-    $scope.selectedemplst = [];
-    var deptid = 0;
-    $scope.selectcount = '';
-    Dept.getDep().then(function (data) {
-        d = _.find(data, function (dept) {
-            return dept.parent == null;
-        });
-        data = _.filter(data, function (item) {
-            return item.level == 1;
-        });
-        $scope.deptlst = data;
-        setdeptrighticon($scope.deptlst);
-        getemp(d.id);
-    });
-
-    $scope.changedept = function (dept) {
-        getdept_emp(dept.id);
-    }
-
-    $scope.change = function (emp) {
-        if (emp.selected) {
-            $scope.selectedemplst.push(emp);
-        } else {
-            $scope.selectedemplst.splice(_.indexOf($scope.selectedemplst, emp), 1);
-        }
-    }
-
-    $scope.cancel = function () {
-        $ionicHistory.goBack();
-    }
-
-    $scope.up = function () {
-        var dept = _.find(Dept.all(), function (d) {
-            return d.id == parseInt(deptid);
-        });
-        getdept_emp(dept.parent);
-    }
-
-    $scope.ok = function () {
-        showPopup.showLoading(1, '提交中');
-        var data = [];
-        _.each($scope.selectedemplst, function (item) {
-            data.push({'user': item.user_id, 'flag': 0, 'value': 0});
-        });
-        Daily.dailypermission.save(data, function () {
-            $scope.$emit('DailyPermissionDoRefresh');
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        });
-    }
-
-    function getdept_emp(did) {
-        Dept.getEmp(did).then(function (data) {
-            $scope.emplst = data;
-            $scope.deptlst = Dept.getChildDept(did);
-            setdeptrighticon($scope.deptlst);
-            setitem();
-            deptid = did;
-            if (did == 1) {
-                $scope.index = 0;
-            } else {
-                $scope.index = 1;
-            }
-        });
-    }
-
-    function getemp(id) {
-        Dept.getEmp(id).then(function (data) {
-            $scope.emplst = data;
-            setitem();
-        });
-    }
-
-    function setitem() {
-        _.each($scope.emplst, function (e) {
-            e.selected = false;
-            e.disabled = false;
-            _.each(Daily.permissionUsers, function (p) {
-                if (p.user_id == parseInt(e.user_id)) {
-                    e.disabled = true;
-                    e.selected = true;
-                }
-            });
-            _.each($scope.selectedemplst, function (e1) {
-                if (e1.user_id == e.user_id) {
-                    e.selected = true;
-                }
-            });
-        });
-    }
-
-    function setdeptrighticon(deptlst) {
-        _.each(deptlst, function (d) {
-            d.isShow = Dept.getChildDept(d.id).length == 0 ? false : true;
-        })
-    }
-})
-
-.controller('DailyEditCtrl', function ($rootScope, $scope, $stateParams, $state, $ionicHistory, $q, global, ImageManage, showPopup, Daily, Tool) {
-    $scope.flag = $stateParams.flag;
-    $scope.change = 1;
-    $scope.index = 14;
-    $scope.coke = 11;
-    $scope.image_list = [];
-    $scope.deleteimage_list = [];
-    $scope.popup = {
-        isPopup: false
-    };
-    var isModified = false;
-
-    $scope.changeDate = function (id) {
-        $scope.index = id;
-        $scope.change = 15 - id;
-        $scope.closeModal();
-    }
-
-    global.fetch_user().then(function () {
-        if ($scope.flag == 0) {
-            Daily.templatedept.get(function (td) {
-                dept = _.find(td.results, function (d) {
-                    return d.dept_id == global.user.deptno;
-                });
-                Daily.templateitem.get({'daily_template_id': dept.daily_template_id}, function (res) {
-                    Daily.templateData.items = res.results;
-                    _.each(Daily.templateData.items, function (item) {
-                        item.daily_template_item = item.id
-                    });
-                    Daily.previewData = {
-                        'daily_tfs': res.results
-                    };
-                    $scope.item = Daily.previewData;
-                    $scope.item.files = [];
-                })
-            });
-            $scope.newDate = Daily.getDate();
-        } else if ($scope.flag == -1) {
-            $scope.item = Daily.previewData;
-            $scope.item.files = [];
-            $scope.newDate = Daily.getDate();
-        } else {
-            $scope.item = angular.copy(Daily.daily);
-        }
-    });
-
-    $scope.goBack = function () {
-        if ($scope.flag == 0) {
-            back = _.find($scope.item.daily_tfs, function (item) {
-                return item.text !== undefined && item.text != '';
-            });
-            showConfirm(isModified, '是否退出写日报?');
-        } else if ($scope.flag > 0) {
-            showConfirm(isModified, '是否放弃当前编辑?');
-        } else {
-            $ionicHistory.goBack();
-        }
-    }
-
-    $scope.addDaily = function () {
-        if (Daily.checkDaily($scope.item.daily_tfs)) {
-            showPopup.showLoading(1, '正在提交');
-            if ($scope.flag == 0) {
-                date = $scope.newDate[$scope.change].day;
-                Daily.dailymf.save({'daily_dd': date}, function (res) {
-                    var id = res.id;
-                    data = _.map($scope.item.daily_tfs, function (it) {
-                        return _.extend(_.pick(it, 'text', 'daily_template_item'), {'daily_mf': id});
-                    });
-                    Daily.dailytf.save(data, function (res) {
-                        var imagefiles = [];
-                        _.each($scope.item.files, function (image) {
-                            if (!image.id)
-                                imagefiles.push(image.file_full_path);
-                        });
-                        postimg(imagefiles, id);
-                    });
-                });
-            } else if ($scope.flag > 0) {
-                if (isModified) {
-                    data = _.map($scope.item.daily_tfs, function (it) {
-                        return _.pick(it, 'id', 'text', 'daily_template_item', 'daily_mf')
-                    });
-                    Daily.dailytf.update(data, function (res) {
-                        _.each($scope.deleteimage_list, function (file) {
-                            Daily.dailyfile.delete({id: file});
-                        });
-                        var imagefiles = [];
-                        _.each($scope.item.files, function (image) {
-                            if (!image.id)
-                                imagefiles.push(image.file_full_path);
-                        });
-                        postimg(imagefiles, $scope.flag, true);
-                    });
-                } else {
-                    showPopup.hideLoading();
-                    $ionicHistory.goBack();
-                }
-            } else {
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            }
-        }
-    }
-
-    showPopup.modalTemplate('templates/modal-selectDate.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.select_date_modal = modal;
-    });
-
-    $scope.showModal = function () {
-        $scope.select_date_modal.show();
-        $rootScope.commons.modal = $scope.select_date_modal;
-    }
-
-    $scope.closeModal = function (rst) {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.shouBigImage = function (imageName) { //传递一个参数(图片的URl)
-        $scope.Url = imageName; //$scope定义一个变量Url,这里会在大图出现后再次点击隐藏大图使用
-        $rootScope.commons.bigImage = true; //显示大图
-    }
-
-    $rootScope.commons.bigImage = false; //初始默认大图是隐藏的
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    }
-
-    $scope.deleteimage = function () {
-        var img = _.find($scope.item.files, function (image) {
-            return image.file_full_path == $scope.Url;
-        });
-        if (img) {
-            $scope.item.files.splice(_.indexOf($scope.item.files, img), 1);
-            if (img.id)
-                $scope.deleteimage_list.push(img.id);
-        }
-        $rootScope.commons.bigImage = false;
-    }
-
-    $scope.addphoto = function () {
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isPopup = true;
-    }
-
-    if ($scope.flag > 0) {
-        watch = $scope.$watch('item', function (n, o) {
-            if (n == o)
-                return;
-            isModified = true;
-        }, true);
-    }
-
-    $scope.$on("$destroy", function () {
-        if ($rootScope.commons.modal)
-            $rootScope.commons.modal = null;
-        $scope.select_date_modal.remove();
-        if ($scope.flag > 0) {
-            watch();
-        }
-    });
-
-    function ImagePicker() { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount - $scope.item.files.length).then(function (data) {
-            $q.all(data).then(function (res) {
-                console.log(res);
-                $scope.item.files = $scope.item.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.item.files.push({
-                "file_thumbnail_path": result,
-                "file_full_path": result
-            });
-        });
-    }
-
-    function postimg(imgfiles, id, isEdit) {
-        if (imgfiles.length > 0) {
-            ImageManage.uploadImage(imgfiles, 'daily', id, 'dailyfile').then(function (res) {
-                $q.all(res).then(function (data) {
-                    if (isEdit)
-                        $scope.$emit('DailyDetailDoRefresh');
-                    $scope.$emit('DailyDoRefresh');
-                    showPopup.hideLoading();
-                    $ionicHistory.goBack();
-                })
-            }, function (err) {
-                alert(JSON.stringify(error));
-                showPopup.PopupWindow(0, 'upload image fail');
-            })
-        } else {
-            if (isEdit)
-                $scope.$emit('DailyDetailDoRefresh');
-            $scope.$emit('DailyDoRefresh');
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        }
-    }
-
-    function showConfirm(flag, content) {
-        if (flag) {
-            showPopup.confirm(content, '是', '否').then(function (res) {
-                if (res)
-                    $ionicHistory.goBack();
-            });
-        } else {
-            $ionicHistory.goBack();
-        }
-    }
-})
-
-.controller('DailyReadMonthCountCtrl', function ($rootScope, $scope, $state, global, Daily, showPopup) {
-    var daily_dd = $state.params['daily_dd'];
-    var date = new Date(daily_dd);
-    $scope.year = date.getFullYear();
-    $scope.month = date.getMonth() + 1;
-
-    global.fetch_user().then(function () {
-        if (global.user.token != "") {
-            Daily.mouthsummary.get({'daily_dd': daily_dd}, function (res) {
-                $scope.monthView = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            });
-            Daily.dailydeptview.query(function (res) {
-                $scope.index = res[0].id;
-                if (res[0].id == 1 && res[0].parent == null)
-                    res[0].depname = '全体成员';
-                $scope.depts = res;
-            })
-        }
-    });
-
-    $scope.changeindex = function (dept) {
-        $scope.index = dept.id;
-        var data = {'dept': dept.id, 'daily_dd': daily_dd};
-        if (dept.parent == null)
-            data = _.omit(data, 'dept');
-        Daily.mouthsummary.get(data, function (res) {
-            $scope.monthView = res;
-            $scope.closeModal();
-        })
-    }
-
-    showPopup.modalTemplate('templates/modal-selectdept.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.select_dept_modal = modal;
-    });
-
-    $scope.showModal = function () {
-        $scope.select_dept_modal.show();
-        $rootScope.commons.modal = $scope.select_dept_modal;
-    }
-
-    $scope.closeModal = function (rst) {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.$on("$destroy", function () {
-        if ($rootScope.commons.modal)
-            $rootScope.commons.moda = null;
-        $scope.select_dept_modal.remove();
-    })
-})
-
-.controller('DailyReadDayCtrl', function ($rootScope, $scope, $state, global, Daily, Tool) {
-    var daily_dd = $state.params['daily_dd'];
-    var date = new Date(daily_dd);
-    $scope.month = date.getMonth() + 1;
-    $scope.day = date.getDate();
-
-    global.fetch_user().then(function () {
-        getdailydata();
-    });
-
-    $scope.totransfer = function (id) {
-        $state.go('transfer', {
-            module: 'daily',
-            id: id
-        });
-    }
-
-    $scope.lookCount = function () {
-        $state.go('daily-readDayCount', {
-            'daily_dd': daily_dd
-        });
-    }
-
-    $scope.shouBigImage = function (imageName, event) { //传递一个参数(图片的URl)
-        $scope.Url = imageName; //$scope定义一个变量Url,这里会在大图出现后再次点击隐藏大图使用
-        $rootScope.commons.bigImage = true; //显示大图
-        event.stopPropagation();
-    }
-
-    $rootScope.commons.bigImage = false; //初始默认大图是隐藏的
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getdailydata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.dailys != undefined && $scope.dailys.next != null) {
-            Tool.get($scope.dailys.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.dailys.results.push(item);
-                });
-                $scope.dailys.next = data.next;
-                $scope.dailys.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.dailys != undefined && $scope.dailys.next != null ? true : false;
-    }
-
-    function getdailydata() {
-        if (global.user.token != "") {
-            if ($scope.dailys == undefined) {
-                $scope.loading = true;
-            }
-            Daily.dailyview.get({'daily_dd': daily_dd}, function (res) {
-                $scope.dailys = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-})
-
-.controller('DailyReadDayCountCtrl', function ($scope, $state, global, Daily) {
-    var daily_dd = $state.params['daily_dd'];
-    var date = new Date(daily_dd);
-    $scope.year = date.getFullYear();
-    $scope.month = date.getMonth() + 1;
-    $scope.day = date.getDate();
-
-    global.fetch_user().then(function () {
-        if (global.user.token != "") {
-            Daily.todaysummary.get({'daily_dd': daily_dd}, function (res) {
-                console.log(res);
-                $scope.toDayView = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            });
-        }
-    });
-
-    $scope.lookDeptCount = function (flag, users, dept, isSubmit) {
-        if (isSubmit != 0) {
-            Daily.toDayViewUsers = users;
-            $state.go('daily-readDayDeptCount', {
-                'flag': flag,
-                'daily_dd': daily_dd,
-                'dept': dept
-            });
-        }
-    }
-})
-
-.controller('DailyReadDayDeptCountCtrl', function ($scope, $state, Daily) {
-    var daily_dd = $state.params['daily_dd'];
-    $scope.flag = $state.params['flag'];
-    $scope.dept = $state.params['dept'];
-    var date = new Date(daily_dd);
-    $scope.year = date.getFullYear();
-    $scope.month = date.getMonth() + 1;
-    $scope.day = date.getDate();
-
-    $scope.users = Daily.toDayViewUsers;
-});

+ 0 - 118
www/apps/daily/js/directive.js

@@ -1,118 +0,0 @@
-starter.directive('itemWrite', [function () {
-    return {
-        restrict: "E",
-        scope: {
-            item: "=itemData"
-        },
-        templateUrl: 'templates/template-itemWrite.html',
-        controller: function ($scope, $cordovaDatePicker) {
-
-            $scope.selectedChange = function (value) {
-                $scope.item.text = value;
-            }
-
-            $scope.chooseDate = function (datetime) {
-                var options = {
-                    mode: 'date',
-                    date: new Date(),
-                    androidTheme: 3
-                };
-
-                $cordovaDatePicker.show(options).then(function (date) {
-                    if (date == undefined) return;
-                    $scope.item.datetime_data = date;
-                });
-            }
-
-            if ($scope.item.t__type in {1:'单行文本',4:'数字'}) {
-                if ($scope.item.required) {
-                    $scope.note = '输入内容';
-                } else {
-                    $scope.note = '输入内容(选填)';
-                }
-            } else if ($scope.item.t__type in {2:'多行文本',3:'日期',5:'数字'}) {
-                if ($scope.item.t__type == 5) {
-                    if ($scope.item.select_data == undefined)
-                        $scope.item.select_data = $scope.item.selecttext;
-                    data = JSON.parse($scope.item.extra)
-                    data = _.pluck(data, 'text')
-                    $scope.selectData = data;
-                }
-                if (!$scope.item.required)
-                    $scope.note = '(选填)';
-            }
-        }
-    }
-}])
-
-.directive('setClassWhenAtTop', function ($window) {
-    var $win = angular.element($window);
-    return {
-        restrict: 'A',
-        link: function (scope, element, attrs) {
-            var topClass = attrs.setClassWhenAtTop,
-                offsetTop = element[0].offsetTop;
-
-            $win.on('scroll', function (e) {
-                if ($win.scrollTop() >= 44) {
-                    element.addClass(topClass);
-                } else {
-                    element.removeClass(topClass);
-                }
-            });
-        }
-    };
-})
-
-.directive('daily', function () {
-    return {
-        restrict: "E",
-        scope: {
-            dailys: "=dailys",
-            loading: "=loading"
-        },
-        templateUrl: 'templates/template-daily.html',
-        controller: function ($scope, $state, Daily) {
-            $scope.todetails = function (daily) {
-                Daily.daily = _.clone(daily);
-                $state.go('daily-details', {
-                    'id': daily.id
-                });
-            }
-        }
-    }
-})
-
-.directive('dailyHeader', function () {
-    return {
-        restrict: "E",
-        scope: {
-            daily: "=daily"
-        },
-        template: '<div class="item item-avatar"><img ng-src="../../../img/panda.png" ng-click="showcardinfo(daily.create_user)"><span>{{daily.create_user_name}}</span><p>{{daily.create_date | date:"MM-dd HH:mm"}}</p><p class="time">日报({{daily.daily_dd | date:"M月d日"}})</p></div>'
-    }
-})
-
-.directive('dailyContent', function () {
-    return {
-        restrict: "E",
-        scope: {
-            daily: "=daily"
-        },
-        template: '<div class="item item-body"><span ng-bind-html="itemContent | getHtmlContent" ng-repeat="itemContent in daily.daily_tfs"></span><div class="blob"><image-popover all-images="daily.files"></image-popover></div></div>'
-    }
-})
-
-.filter('getHtmlContent', function () {
-    return function (content) {
-        if (!content.required && !content.text)
-            return null;
-        fieldname = '';
-        if (content.daily_template_item != 1)
-            fieldname = content.name + '&nbsp:&nbsp';
-        fielddata = content.text || '';
-        var str = fieldname + fielddata + '<br/>';
-        str = str.replace(/\n/g, '<br/>');
-        return str;
-    }
-})

+ 0 - 94
www/apps/daily/js/factory.js

@@ -1,94 +0,0 @@
-starter.factory('Daily', function ($resource, cfg, formatFilter, Tool, showPopup) {
-    var daily = {};
-    daily.templateData = {};
-    daily.templateId = -1;
-    daily.fieldItems = []; //存放模板字段集合
-    daily.templateDepts = [];
-    daily.currentTemplate = {};
-    daily.daily = {};
-    daily.permissionUsers = [];
-    daily.permissionUser = {};
-    daily.previewData = {};
-    daily.toDayViewUsers = [];
-    
-    daily.templatefield = $resource(formatFilter('{0}daily/templatefield/', cfg.api));
-    daily.templateitem = $resource(formatFilter('{0}daily/templateitem/', cfg.api));
-    daily.templatedept = $resource(formatFilter('{0}daily/templatedept/', cfg.api));
-    daily.template = $resource(formatFilter('{0}daily/template/:id/', cfg.api));
-    daily.dailytf = $resource(formatFilter('{0}daily/dailytf/', cfg.api), {}, {'save': {method: 'POST', isArray: true}, 'update': {method: 'PUT', isArray: true}});
-    daily.dailymf = $resource(formatFilter('{0}daily/dailymf/:id/', cfg.api));
-    daily.dailypermission = $resource(formatFilter('{0}daily/dailypermission/', cfg.api), {}, {'save': {method: 'POST', isArray: true}, 'patch': {method: 'PATCH', isArray: true}});
-    daily.dailyread = $resource(formatFilter('{0}daily/dailyread/:id/', cfg.api));
-    daily.dailyfile = $resource(formatFilter('{0}daily/dailyfile/:id/', cfg.api));
-    daily.dailysummary = $resource(formatFilter('{0}daily/dailysummary/', cfg.api));
-    daily.dailyview = $resource(formatFilter('{0}daily/dailyview/', cfg.api));
-    daily.mouthsummary = $resource(formatFilter('{0}daily/monthsummary/', cfg.api));
-    daily.dailydeptview = $resource(formatFilter('{0}daily/dailydeptview/', cfg.api));
-    daily.todaysummary = $resource(formatFilter('{0}daily/todaysummary/', cfg.api));
-    daily.readview = $resource(formatFilter('{0}daily/readview/', cfg.api));
-    
-    daily.get_name = function () {
-        return daily.templateDepts.map(function (dept) {
-            return dept.depname;
-        }).join(',');
-    }
-
-    daily.get_fieldItems = function () {
-        if (daily.templateId == -1) {
-            return _.map(daily.fieldItems, function (fi) {
-                return _.pick(fi, 'name', 'daily_template_field_id', 'required', 'extra');
-            })
-        } else {
-            return _.map(daily.fieldItems, function (fi) {
-                return _.pick(fi, 'id', 'name', 'daily_template_field_id', 'required', 'extra');
-            })
-        }
-    }
-
-    daily.get_description = function () {
-        return _.map(daily.templateData.items, function (fi) {
-            return fi.name;
-        }).join(',')
-    }
-    
-    daily.checkDaily = function (dailys) {
-        var flag = true;
-        var note = null;
-        
-        daily = _.find(dailys, function(daily){
-            return (!daily.text || daily.text == '') && daily.required
-        });
-        
-        if (daily) {
-            if (parseInt(daily.t__type) in [1, 2, 4]) {
-            	note = '请填写';
-            } else if (parseInt(daily.t__type) in [3, 5]) {
-                note = '请选择';
-            }
-            note += daily.name;
-            flag = false;
-            showPopup.PopupWindow(0, note, false);
-        }
-        return flag;
-    }
-    
-    daily.getDate = function (timer) {
-        timer = timer || 7;
-        var newDate = [];
-        timer = timer - 2;
-        for (var i = -timer; i < 2; i++) {
-            var id = i + timer;
-            var day = new Date();
-            day.setDate(day.getDate() + i);
-            var week_day = Tool.getTranslateByKey("weekdays", day.getDay());
-            newDate.push({
-                'id':id,
-                'day':day,
-                'week':week_day
-            });
-        }
-        return newDate.reverse();
-    }
-    
-    return daily;
-});

+ 0 - 96
www/apps/daily/js/route.js

@@ -1,96 +0,0 @@
-starter.config(function ($stateProvider) {
-    $stateProvider.state('daily', {
-        url: '/index',
-        templateUrl: 'templates/daily.html',
-        controller: 'DailyCtrl'
-    })
-
-    .state('daily-man', {
-        url: '/daily-man',
-        templateUrl: 'templates/daily-man.html'
-    })
-
-    .state('daily-read', {
-        url: '/daily-read',
-        templateUrl: 'templates/daily-read.html',
-        controller: 'DailyReadCtrl'
-    })
-
-    .state('daily-details', {
-        url: '/daily/:id',
-        templateUrl: 'templates/daily-details.html',
-        controller: 'DailyDetailsCtrl'
-    })
-
-    .state('daily-edit', {
-        url: '/daily-edit/:flag',
-        templateUrl: 'templates/daily-edit.html',
-        controller: 'DailyEditCtrl'
-    })
-
-    .state('daily-readMonthCount', {
-        url: '/daily-readMonthCount/:daily_dd',
-        templateUrl: 'templates/daily-readMouthCount.html',
-        controller: 'DailyReadMonthCountCtrl'
-    })
-
-    .state('daily-readDay', {
-        url: '/daily-read/:daily_dd',
-        templateUrl: 'templates/daily-readDay.html',
-        controller: 'DailyReadDayCtrl'
-    })
-
-    .state('daily-readDayCount', {
-        url: '/daily-readDayCount/:daily_dd',
-        templateUrl: 'templates/daily-readDayCount.html',
-        controller: 'DailyReadDayCountCtrl'
-    })
-
-    .state('daily-readDayDeptCount', {
-        url: '/daily-readDayCount/:daily_dd&:dept&:flag',
-        templateUrl: 'templates/daily-readDayDeptCount.html',
-        controller: 'DailyReadDayDeptCountCtrl'
-    })
-
-    .state('daily-permission', {
-        url: '/daily-permission',
-        templateUrl: 'templates/daily-permission.html',
-        controller: 'DailyPermissionCtrl'
-    })
-
-    .state('selectdeptoritem', {
-        url: '/selectdeptoritem/:id',
-        templateUrl: 'templates/selectdeptoritem.html',
-        controller: 'SelectDeptOrItemCtrl'
-    })
-
-    .state('daily-template', {
-        url: '/daily-template',
-        templateUrl: 'templates/daily-template.html',
-        controller: 'DailyTemplateCtrl'
-    })
-
-    .state('daily-templateScope', {
-        url: '/daily-templateScope/:id',
-        templateUrl: 'templates/daily-templateScope.html',
-        controller: 'DailyTemplateScopeCtrl'
-    })
-
-    .state('daily-templateEdit', {
-        url: '/daily-templateEdit/:id',
-        templateUrl: 'templates/daily-templateEdit.html',
-        controller: 'DailyTemplateEditCtrl'
-    })
-
-    .state('custom-form', {
-        url: '/custom-form/:id',
-        templateUrl: 'templates/custom-form.html',
-        controller: 'CustomFormCtrl'
-    })
-
-    .state('additem', {
-        url: '/additem',
-        templateUrl: 'templates/additem.html',
-        controller: 'AddItemCtrl'
-    })
-});

+ 0 - 32
www/apps/daily/templates/additem.html

@@ -1,32 +0,0 @@
-<ion-view view-title="选择添加的成员" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="this[leftbtn[index].click]();">{{leftbtn[index].text}}</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider divider-font" ng-if="deptlst.length>0"><i class="icon ion-ios-star"></i>部门({{deptlst.length}})</div>
-        <ion-list>
-            <!--部门列表-->
-            <ion-item class="item item-icon-right" ng-repeat="dept in deptlst" ng-click="changedept(dept);">
-                {{dept.depname}}
-                <i class="icon ion-chevron-right icon-accessory" ng-if="dept.isShow"></i>
-            </ion-item>
-        </ion-list>
-        <!--员工-->
-        <div class="item item-divider divider-font"><i class="icon ion-ios-star"></i>联系人({{emplst.length}})</div>
-        <ion-list>
-            <ion-checkbox ng-repeat="emp in emplst" ng-disabled="emp.disabled" ng-change="change(emp)" ng-model="emp.selected" class="ion-checkbox-class">
-                <img ng-src="../../../img/panda.png"/>
-                <label class="labelname">{{emp.username}}</label>
-                <label class="labelrole">{{emp.degree}}</label>
-            </ion-checkbox>
-            <ion-list>
-            <div class='obligate-item'></div>
-    </ion-content>
-    <div ng-class="{true:'bar bar-footer bar-dark footer-div bigview',false:'bar bar-footer footer-div bar-dark'}[isUp]" style="">
-        <i ng-class="{true:'ion-ios-arrow-down cirl-i',false:' ion-ios-arrow-up cirl-i'}[isUp]" ng-click="isUp = !isUp"></i>
-        <ul class='ul-imgs dept-icon'>
-            <li ng-repeat="user in selectedemplst track by $index">{{user.username}}</li>
-        </ul>
-        <button ng-disabled="selectedemplst.length==0" ng-click="ok();" class="button pull-right button-calm">确定{{selectedemplst.length>0?"("+selectedemplst.length+")":""}}</button>
-    </div>
-</ion-view>

+ 0 - 24
www/apps/daily/templates/custom-form.html

@@ -1,24 +0,0 @@
-<ion-view view-title="自定义表单" hide-back-button="true">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click='ok();'>完成</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click='cancel();'>取消</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider dividercolor dividertextcolor" ng-if="fieldItems.length>0" ng-click="preview();">点击预览</div>
-        <div class="item-divider item-divider-defineform"></div>
-        <ion-list>
-            <ion-item class="empclass item-icon-right" type="item-text-wrap" ng-repeat="item in fieldItems" ng-href="{{tohref(item)}}">
-                <h2>{{item.name}}<i class="ion-ios-compose-outline"></i></h2>
-                <p class="from-p">字段类型:{{item.fieldtype.name}}({{item.required?"必填":"选填"}})</p>
-                <i class="icon ion-navicon-round icon-accessory"></i>
-            </ion-item>
-        </ion-list>
-        <div class="item-divider item-divider-defineform"></div>
-        <ion-item class="positive" type="item-text-wrap" style="text-align:center" ng-href="#/fieldtype/-1">
-            添加字段&nbsp;<i class="ion-plus"></i>
-        </ion-item>
-    </ion-content>
-</ion-view>
-

+ 0 - 67
www/apps/daily/templates/daily-details.html

@@ -1,67 +0,0 @@
-<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;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-icon ion-ios-more" ng-click="popover.show($event)" ng-if="cssstyle"></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" class="list daily">
-            <div class="item item-divider"></div>
-            <daily-header daily="daily"></daily-header>
-            <daily-content daily="daily"></daily-content>
-            <div class="item item-divider" ng-if="reads.length != 0"></div>
-            <div class="item" ng-if="reads.length != 0">
-                <p>看过&nbsp;{{reads.length == 0 ? "" : reads.length}}</p>
-                <div class="list see-list">
-                    <img ng-repeat="read in reads" ng-click="showcardinfo(read.create_user)" ng-src="../../../img/cat.png"/>
-                    <!--//todo:{{readitem.usrid.photo}}-->
-                </div>
-            </div>
-            <div class="item item-divider"></div>
-            <!--//todo:将评论和看过独立出一个指令进行操作-->
-            <div class="item">
-                <p>评论&nbsp;{{comments.results.length == 0 ? "" : comments.results.length}}</p>
-            </div>
-            <ion-list>
-                <div class="item center" ng-if="comments.results.length == 0">还没有人进行评论哦</div>
-                <a class="item item-avatar item-text-wrap" ng-repeat="comment in comments.results" ng-click="popupMessageOpthins(comment.id,comment.create_user)">
-                    <img ng-src="../../../img/panda.png" ng-click="showcardinfo()">
-                    <!--//todo:查看信息-->
-                    <div>
-                        <span>{{comment.create_user_name}}</span>
-                        <p>{{comment.comment}}</p>
-                        <p class="time">{{comment.create_date | getDateDiff}}</p>
-                    </div>
-                </a>
-                <div class='obligate-item'></div>
-            </ion-list>
-        </div>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-    <ion-footer-bar keyboard-attach class="bar-stable">
-        <div class="bar bar-footer item-input-inset">
-            <!--<button ng-click="addhappy()" class="button button-clear">
-                <i class="icon ion-android-happy clear"></i>
-            </button>-->
-            <label class="item-input-wrapper radius-30">
-                <input type="text" ng-model="data.comment" placeholder="添加评论">
-            </label>
-            <button class="button button-positive" ng-disabled="data.comment == '' || data.comment == null" ng-click="sendComment()">发送</button>
-        </div>
-    </ion-footer-bar>
-    <script id="templates/detiilsmenu.html" type="text/ng-template">
-        <!--<ion-popover-view ng-class="{true:'details-popup',false:'details-popup-other'}[cssstyle]">-->
-        <ion-popover-view ng-class="{true:'popver_view',false:'details-popup-other'}[cssstyle]">
-            <ion-content>
-                <ion-list>
-                    <!--<ion-item class="item item-button" type="item-text-wrap" ng-click="transfer()">转发</ion-item>-->
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="edit()" ng-if="cssstyle">编辑</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="remove()" ng-if="cssstyle">删除</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 37
www/apps/daily/templates/daily-edit.html

@@ -1,37 +0,0 @@
-<ion-view view-title="写日报" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="goBack()">取消</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-if="flag >= 0" ng-click="addDaily()">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <a class="item item-icon-right" ng-click="flag <= 0 ? showModal() : null">日期
-            <span class="item-note" ng-if="flag <= 0">{{newDate[change].day | date:'yyyy年M月d日'}}</span>
-            <span class="item-note" ng-if="flag > 0">{{item.daily_dd | date:'yyyy年M月d日'}}</span>
-            <i class="icon ion-chevron-right icon-accessory" ng-if="flag <= 0"></i>
-        </a>
-        <div class="list">
-            <div ng-repeat="data in item.daily_tfs">
-                <item-write item-data="data"></item-write>
-            </div>
-            <!--照片-->
-            <div>
-                <div class="item item-divider"></div>
-                <div class="item camera-item">
-                    <div ng-repeat="image in item.files" ng-click="shouBigImage(image.file_full_path)">
-                        <img ng-src="{{image.file_thumbnail_path}}"/>
-                    </div>
-                    <div class="center" ng-click="addphoto()">
-                        <i class="icon ion-camera"></i>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div id="rightDisplay" ng-show="commons.bigImage" class="popover-backdrop1">
-            <img class="fullscreen-image" ng-click="hideBigImage()" ng-src="{{Url}}" ng-pinch-zoom/>
-            <i class="ion-ios-trash-outline" ng-click="deleteimage();"></i>
-        </div>
-    </ion-content>
-</ion-view>

+ 0 - 27
www/apps/daily/templates/daily-man.html

@@ -1,27 +0,0 @@
-<ion-view view-title="工作汇报管理" hide-tabs="true">
-    <ion-content>
-        <div class=" item item-divider"></div>
-        <ion-list>
-            <ion-item class="item item-icon-right" type="item-text-wrap" href="#/daily-permission">
-                允许谁看工作汇报
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <div class="item item-divider dividertext">
-                <label>可选择每个人的查看范围</label>
-            </div>
-            <ion-item class="item item-icon-right" type="item-text-wrap" href="#/daily-template">
-                日报模板设置
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <!-- <ion-item class="item item-icon-right" type="item-text-wrap">
-                周报模板设置
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <ion-item class="item item-icon-right" type="item-text-wrap">
-                月报模板设置
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item> -->
-            <div class="desctext">可自定义模板表单,让员工按要求填写,比如:今日总结、明日计划、产品销量...</div>
-        </ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 36
www/apps/daily/templates/daily-permission.html

@@ -1,36 +0,0 @@
-<ion-view view-title="允许谁看工作汇报" hide-nav-bar="false">
-    <ion-nav-buttons side="right">
-        <button class="button button-icon ion-ios-more" ng-if="isshowdelete.showDelete!=true" ng-click="popover.show($event)"></button>
-        <button class="button button-clear" ng-if="isshowdelete.showDelete" ng-click="ok();">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <div class="item item-divider dividercolor">可以设置每个人的查看范围</div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-list show-delete="isshowdelete.showDelete">
-            <ion-item class="item item-icon-right item-remove-animate item-text-wrap" ng-repeat="item in userlist.results" ng-click="toSelectDeptOrItem(item)">
-                <span>{{item.username}}</span>
-                <p> 
-                    <span ng-if="item.depts.length == 0 && item.users.length == 0 && item.all">全体成员</span>
-                    <span ng-repeat="dept in item.depts">{{dept.depname}}{{$last ? '' : '、'}}</span>
-                    <span ng-if="item.depts.length > 0 && item.users.length > 0">、</span>
-                    <span ng-repeat="user in item.users">{{user.username}}{{$last ? '' : '、'}}</span>
-                </p>
-                <ion-delete-button class="ion-minus-circled" ng-click="remove(item)">
-                </ion-delete-button>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-        </ion-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-    <script id="templates/add.html" type="text/ng-template">
-        <ion-popover-view class="popver_view">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="toadd();">添加成员</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="displayremove();">移除成员</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 46
www/apps/daily/templates/daily-read.html

@@ -1,46 +0,0 @@
-<ion-view view-title="我可以查看的工作汇报">
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <!--<div class="button-bar report-button">
-            <button class="button" ng-class="{true:'daily-color',false:'daily-hover'}[index==0?true:false]" ng-click="select(0)">日报</button>
-            <button class="button" ng-class="{true:'daily-color',false:'daily-hover'}[index==1?true:false]" ng-click="select(1)">周报</button>
-            <button class="button" ng-class="{true:'daily-color',false:'daily-hover'}[index==2?true:false]" ng-click="select(2)">月报</button>
-        </div>
-        <ion-slide-box show-pager="false" ng-init="init()" class="text-margin">
-            <ion-slide>-->
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-list ng-if="!loading">
-            <div ng-repeat="(key,item) in summary.results track by $index">
-                <div class="item item-stable center"><!--ng-if="isMonth(item[0])"-->
-                    <a class="link" ng-click="toMonthCount(item[0])">{{key}}&nbsp;统计</a>
-                </div>
-                <a class="item item-icon-right" 
-                    ng-repeat="it in item track by $index"
-                    ng-click="toDayCount(it.daily_date)">
-                    {{it.daily_date | date:'MM-dd'}}
-                    <span class="item-note">{{it.count}}篇</span>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </a>    
-            </div>
-        </ion-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <!--</ion-slide>
-        <ion-slide>
-            <ion-list>
-                <a class="item item-icon-right" href="#/daily-read/1">{xx月xx周}
-                    <span class="item-note">{number}</span>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </a>
-            </ion-list>
-        </ion-slide>
-        <ion-slide>
-            <ion-list>
-                <a class="item item-icon-right">{xx月}
-                    <span class="item-note">{number}</span>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </a>
-            </ion-list>
-        </ion-slide>
-    </ion-slide-box>-->
-    </ion-content>
-</ion-view>

+ 0 - 15
www/apps/daily/templates/daily-readDay.html

@@ -1,15 +0,0 @@
-<ion-view view-title="日报({{month}}月{{day}}日)">
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <div class="item item-stable center">
-            <a class="link" ng-click="lookCount()">本日日报统计></a>
-        </div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <daily dailys="dailys.results" loading="loading"></daily>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <h4 class="stable center" ng-show="dailys != undefined && dailys.next == null && dailys.results.length > 10">没有更多了</h4>
-    </ion-content>
-    <div id="rightDisplay" ng-show="commons.bigImage" class="popover-backdrop1">
-        <img class="img-responsive" ng-click="hideBigImage()" ng-src="{{Url}}"/>
-    </div>
-</ion-view>

+ 0 - 31
www/apps/daily/templates/daily-readDayCount.html

@@ -1,31 +0,0 @@
-<ion-view view-title="日报统计">
-    <ion-content>
-        <div class="item-stable row daily-count-back">
-            <span class="note col-34">{{year}}年{{month}}月
-                <p>{{day}}日</p>
-            </span>
-            <span class="note col-66">
-                <h4>共<span>&nbsp;{{toDayView.reported_count}}&nbsp;</span>人写了日报 </h4>
-            </span>
-        </div>
-        <ion-list>
-            <div class="item" ng-repeat="dept in toDayView.depts">
-                <div class="row">
-                    <span><b>{{dept.dept_name}}</b></span>
-                </div>
-                <div class="row">
-                    <div class="col-40 div-active" ng-click="lookDeptCount(1, dept.reported, dept.dept_name,dept.reported_count)">
-                        <span>提交&nbsp;:{{dept.reported_count}}人</span>
-                        <i class="icon ion-chevron-right float-right" ng-class="{'disabled':dept.reported_count == 0}"></i>
-                    </div>
-                    <div class="col-10 border-right"></div>
-                    <div class="col-10"></div>
-                    <div class="col-40 div-active" ng-click="lookDeptCount(0, dept.unreported, dept.dept_name, dept.unreported_count)">
-                        <span>未提交&nbsp;:{{dept.unreported_count}}人</span>
-                        <i class="icon ion-chevron-right float-right" ng-class="{'disabled':dept.unreported_count == 0}"></i>
-                    </div>
-                </div>
-            </div>
-        </ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 15
www/apps/daily/templates/daily-readDayDeptCount.html

@@ -1,15 +0,0 @@
-<ion-view view-title="{{dept}}">
-    <ion-content>
-        <div class="item-stable daily-count-back daily-count-height-40" ng-class="{true:'daily-count-back-submit'}[flag == 0]">
-            <p>{{year}}年{{month}}月{{day}}日,共&nbsp;{{users.length}}&nbsp;人{{flag == 1 ? '写了' : '没写'}}日报</p>
-        </div>
-        <div class="item item-divider center">人员列表</div>
-        <ion-list>
-            <a class="item item-avatar" ng-repeat="user in users">{{user.user_name}}
-                <img ng-src="../../../img/cat.png"/>
-                <span class="item-note">{{user.diary_dd | date:'HH:mm'}}</span>
-                <p>{{dept}}&nbsp;{{user.degree}}</p>
-            </a>
-        </ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 24
www/apps/daily/templates/daily-readMouthCount.html

@@ -1,24 +0,0 @@
-<ion-view view-title="日报月统计">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="showModal()">选择部门</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item-stable row daily-count-back">
-            <span class="note col-34">{{year}}年
-                <p>{{month}}月</p>
-            </span>
-            <span class="note col-33">汇报人员
-                <p>{{monthView.total}}人</p>
-            </span>
-            <span class="note col-33">日报
-                <p>{{monthView.mfs_count}}篇</p>
-            </span>
-        </div>
-        <div class="item item-divider disabled">汇报人员</div>
-        <a class="item item-avatar item-icon-right text-line-height" ng-repeat="item in monthView.daily_mfs">{{item.create_username}}
-            <img ng-src="../../../img/cat.png"/>
-            <span class="item-note">{{item.count}}</span>
-            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
-        </a>
-    </ion-content>
-</ion-view>

+ 0 - 26
www/apps/daily/templates/daily-template.html

@@ -1,26 +0,0 @@
-<ion-view view-title="日报模板设置">
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <div class="item item-divider"></div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-list ng-show="!loading">
-            <ion-item class="item item-icon-right positive" type="item-text-wrap" href="#/daily-templateScope/-1">
-                新建日报模板
-                <i class="icon ion-android-add positive"></i>
-            </ion-item>
-            <div ng-repeat="template in templates.results">
-                <div class="item item-divider"></div>
-                <ion-item class="mobanitem" ng-click="gosetmoban(template);">
-                    <ion-item class="item item-icon-right " type="item-text-wrap">
-                        {{template.name}}
-                        <i class="icon ion-chevron-right icon-accessory"></i>
-                    </ion-item>
-                    <div class="item itemfield">
-                        <label>{{template.description}}</label>
-                    </div>
-                </ion-item>
-            </div>
-        </ion-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-</ion-view>

+ 0 - 22
www/apps/daily/templates/daily-templateEdit.html

@@ -1,22 +0,0 @@
-<ion-view view-title="编辑日报模板">
-    <ion-content>
-        <div class=" item item-divider item-divider-deptmoban"></div>
-        <ion-list>
-            <ion-item class="item item-icon-right" type="item-text-wrap" ng-click="toSetDept();">
-                谁能使用
-                <span class="item-note">{{template.name}}</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <div class="item item-divider divider-editmoban-text"><label>公司的哪些部门,可以使用该模板</label></div>
-            <ion-item class="item item-icon-right" type="item-text-wrap" ng-click="defineform();">
-                自定义表单
-                <span class="item-note">{{template.description}}</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-        </ion-list>
-        <div class=" item item-divider item-divider-deptmoban"></div>
-        <ion-item class="item assertive" type="item-text-wrap" ng-click="delete();" style="text-align:center">
-            删除模板
-        </ion-item>
-    </ion-content>
-</ion-view>

+ 0 - 30
www/apps/daily/templates/daily-templateScope.html

@@ -1,30 +0,0 @@
-<ion-view view-title="选择模板范围" cache-view="false" hide-nav-bar="false" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="this[leftbtn[index].click]();">{{leftbtn[index].text}}</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div class="item item-divider dividercolor">公司哪些部门,能够使用该模板</div>
-        <ul ng-if="!loading" class="list">
-            <li class="check-dept-li" ng-click="consoles();" ng-repeat="dept in depts track by $index" ng-class="{true:'clickactive',fasle:''}[actived]">
-                <label class="list item-checkbox">
-                    <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
-                        <input ng-disabled="dept.isdisabled" ng-model="dept.selected" ng-change="change(dept)" type="checkbox" class="ng-pristine ng-untouched ng-valid ng-not-empty">
-                        <i class="checkbox-icon" ng-show="!dept.isdisabled"></i>
-                    </div>
-                </label>
-                <label ng-click="tochilddept(dept);" ng-class="{true:'',false:'disabled'}[!dept.isdisabled]">
-                    <span class="deptname">{{dept.depname}}{{dept.isdisabled?"(已设置)":""}}</span>
-                    <i class="icon ion-chevron-right icon-accessory" ng-show="dept.isshow"></i>
-                </label>
-            </li>
-        </ul>
-    </ion-content>
-    <div ng-class="{true:'bar bar-footer bar-dark footer-div bigview',false:'bar bar-footer footer-div bar-dark'}[isUp]">
-        <i ng-class="{true:'ion-ios-arrow-down cirl-i',false:' ion-ios-arrow-up cirl-i'}[isUp]" ng-click="isUp = !isUp"></i>
-        <ul class='ul-imgs dept-icon'>
-            <li ng-repeat="deptitem in selecteddepts track by $index">{{deptitem.depname}}</li>
-        </ul>
-        <button ng-disabled="selecteddepts.length==0" ng-click="ok();" class="button pull-right button-calm">确定{{selecteddepts.length>0?"("+selecteddepts.length+")":""}}</button>
-    </div>
-</ion-view>

+ 0 - 22
www/apps/daily/templates/daily.html

@@ -1,22 +0,0 @@
-<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;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toman()" ng-if="roleid==1">管理&nbsp;&nbsp;</button>
-        <button class="button button-clear" ng-click="towrite()">
-            <i class="icon ion-android-add"></i>
-        </button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <a class="item item-icon-right" href="#/daily-read">我可以查看的工作汇报
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider"></div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <daily dailys="dailys.results" loading="loading"></daily>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <h4 class="stable center" ng-show="dailys != undefined && dailys.next == null && dailys.results.length > 10">没有更多了</h4>
-    </ion-content>
-</ion-view>

+ 0 - 9
www/apps/daily/templates/modal-selectDate.html

@@ -1,9 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar>
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="closeModal(ok)">&nbsp;返回</button>
-        <h1 class="title">日期</h1>
-    </ion-header-bar>
-    <ion-content>
-        <ion-radio ng-model="index" ng-click="changeDate(day.id)" ng-value="day.id" ng-repeat="day in newDate">{{day.day | date:'M月d日'}}&nbsp;{{day.week | translate}}</ion-radio>
-    </ion-content>
-</ion-modal-view>

+ 0 - 11
www/apps/daily/templates/modal-selectdept.html

@@ -1,11 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar>
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="closeModal('ok')">&nbsp;返回</button>
-        <h1 class="title">选择部门</h1>
-    </ion-header-bar>
-    <ion-content>
-        <ion-list>
-            <ion-radio ng-model="index" ng-click="changeindex(dept)" ng-value="dept.id" ng-repeat="dept in depts">{{dept.depname}}</ion-radio>
-        </ion-list>
-    </ion-content>
-</ion-modal-view>

+ 0 - 56
www/apps/daily/templates/selectdeptoritem.html

@@ -1,56 +0,0 @@
-<ion-view view-title="选择部门或成员" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="this[leftbtn[index].click]();">{{leftbtn[index].text}}</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div ng-show="!loading">
-            <ul>
-                <li class="check-dept-li" ng-show="index==0">
-                    <label class="list item-checkbox">
-                        <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
-                            <input ng-model="selecteditems.all" ng-click="selectAll()" type="checkbox" class="ng-pristine ng-untouched ng-valid ng-not-empty">
-                            <i class="checkbox-icon"></i>
-                        </div>
-                    </label>
-                    <label ng-click="selectAll()">
-                        <span class="deptname">全部成员</span>
-                    </label>
-                </li>
-                <div class="item item-divider divder divider-font" ng-if="deptlst.length>0"><i class="icon ion-ios-star"></i>部门({{deptlst.length}})</div>
-                <li class="check-dept-li" ng-repeat="dept in deptlst track by $index" ng-class="{true:'clickactive',fasle:''}[actived]">
-                    <label class="list item-checkbox">
-                        <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
-                            <input ng-model="dept.selected" ng-change="change(dept,'d')" type="checkbox" class="ng-pristine ng-untouched ng-valid ng-not-empty">
-                            <i class="checkbox-icon"></i>
-                        </div>
-                    </label>
-                    <label ng-click="tochilddept(dept);">
-                        <span class="deptname">{{dept.depname}}</span>
-                        <i class="icon ion-chevron-right icon-accessory" ng-show="dept.isShow"></i>
-                    </label>
-                </li>
-            </ul>
-            <!--员工-->
-            <div class="item item-divider divder divider-font"><i class="icon ion-ios-star"></i>联系人({{emplst.length}})</div>
-            <ion-list>
-                <ion-checkbox ng-change="change(emp,'e')" ng-model="emp.selected" class="ion-checkbox-class" ng-repeat="emp in emplst">
-                    <img ng-src="../../../img/panda.png"/>
-                    <label class="labelname">{{emp.username}}</label>
-                    <label class="labelrole">{{emp.degree}}</label>
-                </ion-checkbox>
-                <ion-list>
-                <div class='obligate-item'></div>
-        </div>
-    </ion-content>
-    <div class="bar bar-footer bar-dark footer-div" ng-class="{true:'bigview',false:''}[isUp]" style="">
-        <i ng-class="{true:'ion-ios-arrow-down cirl-i',false:' ion-ios-arrow-up cirl-i'}[isUp]" ng-click="isUp = !isUp"></i>
-        <ul class='ul-imgs dept-icon'>
-            <li ng-repeat="dept in selecteditems.depts">{{dept.depname}}
-            </li>
-            <li ng-repeat="user in selecteditems.users">{{user.username}}
-            </li>
-        </ul>
-        <button ng-click="ok();" ng-disabled="selecteditems.depts.length==0&&selecteditems.users.length==0" class="button pull-right button-calm">确定{{selecteditems.depts.length>0||selecteditems.users.length>0?"(" + (selecteditems.depts.length + selecteditems.users.length) +")":""}}</button>
-    </div>
-</ion-view>

+ 0 - 29
www/apps/daily/templates/simplydaily_write.html

@@ -1,29 +0,0 @@
-<ion-view view-title="写日报">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="ok()">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <a class="item item-icon-right  over-flow-auto item-text-wrap" ng-click="showModal('date')">日期
-            <span class="item-note">2017-01-05</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider"></div>
-        <div class="task-create-content">
-            <div class="item item-input">
-                <textarea rows="6" ng-model="task.content" placeholder="工作内容"></textarea>
-            </div>
-            <div class="item">
-                <div ng-repeat="image in task.task_files">
-                    <img ng-src={{image.file_thumbnail_path}} ng-click="shouBigImage(image.file_full_path)"/>
-                </div>
-                <div ng-repeat="image in image_list">
-                    <img ng-src={{image}} ng-click="shouBigImage(image)"/>
-                </div>
-                <div class="center" ng-click="addphoto()">
-                    <i class="icon ion-camera"></i>
-                </div>
-            </div>
-        </div>
-    </ion-content>
-</ion-view>

+ 0 - 18
www/apps/daily/templates/template-daily.html

@@ -1,18 +0,0 @@
-<div ng-if="!loading" class="daily" ng-repeat="daily in dailys">
-    <daily-header daily="daily"></daily-header>
-    <daily-content daily="daily" ng-click="todetails(daily)"></daily-content>
-    <div class="item item-body tool">
-        <div class="row">
-            <!--<a class="icon col-33 ion-ios-upload-outline" ng-click="totransfer(daily.id)">
-                    &nbsp;{{(daily.transfertimes == null || daily.transfertimes == 0)? "转发" : daily.transfertimes}}
-                </a>-->
-            <a class="icon col-50 ion-ios-chatboxes-outline" ng-click="todetails(daily)">
-                &nbsp;{{(daily.comment_times == null || daily.comment_times == 0)? "评论" : daily.comment_times}}
-            </a>
-            <a class="icon col-50 ion-ios-eye-outline" ng-click="todetails(daily)">
-                &nbsp;{{(daily.read_times == null || daily.read_times == 0) ? "看过" : daily.read_times}}
-            </a>
-        </div>
-    </div>
-    <div class="item item-divider"></div>
-</div>

+ 0 - 51
www/apps/daily/templates/template-itemWrite.html

@@ -1,51 +0,0 @@
-<!--单行-->
-<div ng-if="item.t__type == 1">
-    <div class="item item-divider"></div>
-    <div class="item item-input">
-        <span>{{item.name}}</span>
-        <label class="input-margin">
-            <input type="text" ng-model="item.text" placeholder="{{note}}">
-        </label>
-    </div>
-</div>
-<!--多行-->
-<div ng-if="item.t__type == 2">
-    <div class="item item-divider"></div>
-    <div class="item item-input">
-        <textarea rows="6" ng-model="item.text" placeholder="{{item.name}}{{note}}"></textarea>
-    </div>
-</div>
-<!--日期-->
-<div ng-if="item.t__type == 3">
-    <div class="item item-divider"></div>
-    <a class="item item-icon-right" ng-click="chooseDate(item.text)">{{item.name}}
-        <span class="item-note">{{item.text | date:"yyyy-MM-dd"}}</span>
-        <span>{{note}}</span>
-        <i class="icon ion-chevron-right icon-accessory"></i>
-    </a>
-</div>
-<!--数字-->
-<div ng-if="item.t__type == 4">
-    <div class="item item-divider"></div>
-    <div class="item item-input">
-        <span>{{item.name}}</span>
-        <label class="input-margin">
-            <input type="number" ng-model="item.text" placeholder="{{note}}">
-        </label>
-    </div>
-</div>
-<!--单选-->
-<div ng-if="item.t__type == 5">
-    <div class="item item-divider"></div>
-    <div class="list">
-        <label class="item item-input item-select">
-            <div class="input-label">
-                <span>{{item.name}}</span>
-                <span>{{note}}</span>
-            </div>
-            <select ng-model="item.text" ng-change="selectedChange(item.text)">
-                <option ng-repeat="selectitem in selectData track by $index">{{selectitem}}</option>
-            </select>
-        </label>
-    </div>
-</div>

+ 0 - 54
www/apps/notice/index.html

@@ -1,54 +0,0 @@
-<!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/chineseTopinyin.js"></script>
-
-    <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>
-

+ 0 - 962
www/apps/notice/js/controllers.js

@@ -1,962 +0,0 @@
-starter.controller('NoticeCtrl', function ($rootScope, $scope, $state, $ionicHistory, _, global, Member, Notice, Tool) {
-    var beoreenter = $scope.$on("$ionicView.beforeEnter", function () {
-        global.fetch_user().then(function () {
-            Notice.getCreateUsrsState().then(function (data) {
-                $scope.createstate = data.state;
-            });
-            getnoticedata();
-            $scope.roleid = global.user.roleid;
-        }, function (err) {
-            alert(JSON.stringify(err));
-            $scope.loading = false;
-        });
-        Notice.getsavedata = Notice.getstructdata();
-        Member.selectedemplst = [];
-        $ionicHistory.clearHistory(); //清除所有的view
-    });
-    $scope.$on("$destroy", function () {
-        beoreenter = null;
-    });
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.todetails = function (id) {
-        $state.go('notice-details', {
-            id: id
-        });
-    };
-
-    $scope.toper = function () {
-        $state.go('power-set');
-    };
-
-    $scope.toadd = function () {
-        Member.resourcemember = [];
-        Member.selectedemplst = [];
-        Member.showall = true;
-        Member.showgroup = true;
-        Member.titlename = "选择通知的成员";
-        Member.routename = "postnotice";
-        Member.routeparams = {
-            "id": -1
-        };
-        $state.go('selectmember');
-    };
-
-    $scope.doRefresh = function () {
-        getnoticedata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.Notice != undefined && $scope.Notice.next != null) {
-            Notice.getNext($scope.Notice.next).then(function (data) {
-                console.log(data);
-                _.each(data.results, function (item) {
-                    $scope.Notice.results.push(item);
-                })
-                $scope.Notice.next = data.next;
-                $scope.Notice.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.Notice != undefined && $scope.Notice.next != null ? true : false;
-    };
-
-    function getnoticedata() {
-        if (global.user.token != "") {
-            if ($scope.Notice == undefined) $scope.loading = true;
-            Notice.getReceive().then(function (data) {
-                data.results = _.sortBy(data.results, 'create_dd').reverse();
-                $scope.Notice = data;
-                console.log($scope.Notice);
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-})
-
-.controller('NoticeDetailsCtrl', function ($rootScope, $scope, $state, $ionicSlideBoxDelegate, $ionicPopover, $ionicPopup, _, global, showPopup, Notice, General) {
-    $scope.id = $state.params['id'];
-    $scope.isScopeShow = false;
-    $scope.activeIndex = 0;
-    $scope.data = {
-        notice_id: $scope.id,
-        content: null
-    };
-    var isChange = false;
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.change = function (index) {
-        $scope.activeIndex = index;
-        $ionicSlideBoxDelegate.slide(index);
-    };
-
-    $scope.lockSlide = function () {
-        $ionicSlideBoxDelegate.enableSlide(false);
-    };
-
-    $scope.changeIndex = function (index) {
-        if (!isChange) {
-            isChange = true;
-        }
-        if ($scope.details.vote_selecttype == 1) {
-            $scope.selectIndex = index;
-        } else {
-            var flag = false;
-            _.each($scope.selectIndex, function (item) {
-                if (item == index) {
-                    $scope.selectIndex.splice($scope.selectIndex.indexOf(item), 1);
-                    flag = true;
-                }
-            })
-            if (!flag) {
-                $scope.selectIndex.push(index);
-            }
-        }
-    }
-
-    $scope.result = function () {
-        // type 0 admin 1 usr
-        var type = null;
-        if ($scope.isAdmin) {
-            type = 0;
-        } else {
-            type = 1;
-        }
-        $scope.popover.hide();
-        $state.go('notice-result', {
-            id: $scope.id,
-            type: type
-        });
-    }
-
-    $scope.transfer = function (id) {
-        $scope.popover.hide();
-    }
-
-    $scope.deleteNotice = function () {
-        $scope.popover.hide();
-        showPopup.confirm("是否删除改公告?", '是', '否').then(function (res) {
-            if (res) {
-                Notice.delete_NoticeMf($scope.id).then(function (data) {
-                    $state.go('notice');
-                }, function (error) {
-                    alert('delete noticemf error:' + JSON.stringify(error))
-                })
-            }
-        });
-    }
-
-    $scope.sendComment = function () {
-        if ($scope.data.content != null && $scope.data.content != "") {
-            $scope.data.create_dd = new Date();
-            General.postComment($scope.data, 'notice').then(function (data) {
-                $scope.data.content = null;
-            });
-        }
-    }
-
-    $scope.popupMessageOpthins = function (id, usrid) {
-        if (usrid == global.user.usrid) {
-            $scope.popup.optionsPopup = $ionicPopup.show({
-                template: '<div class="center" style="height:20px;width:100%;line-height:20px;margin-top:10px;" rj-close-back-drop><h4>用户操作</h4></div>',
-                scope: $scope,
-                buttons: [{
-                    text: '删除',
-                    type: 'button-positive',
-                    onTap: function (e) {
-                        General.deleteComment(id, 'notice');
-                    }
-                }]
-            });
-            $scope.popup.isPopup = true;
-        } else {
-            //todo:对其进行回复
-        }
-    };
-
-    $scope.giveUp = function (type) {
-        // type 0:投票 1:反馈
-        var title = ['是否放弃投票?', '是否放弃反馈?']
-        showPopup.confirm(title[type], '是', '否').then(function (res) {
-            if (res) {
-                postGiveUp(type);
-            }
-        })
-    };
-
-    $scope.postVote = function () {
-        if (isChange) {
-            var data = {
-                vote_selectindex: ''
-            };
-            $scope.usr_select_index = $scope.selectIndex;
-            if ($scope.details.vote_selecttype == 0) {
-                for (var i = 0; i < $scope.selectIndex.length; i++) {
-                    if (i == $scope.selectIndex.length - 1) {
-                        data.vote_selectindex += $scope.selectIndex[i];
-                    } else {
-                        data.vote_selectindex += $scope.selectIndex[i] + ';';
-                    }
-                }
-            } else {
-                data.vote_selectindex = $scope.selectIndex;
-            }
-            postRecordData(data);
-        }
-    }
-
-    $scope.showbackpopup = function () {
-        $scope.backData = {
-            content: null
-        };
-        var backpopup = $ionicPopup.show({
-            template: '<div class="popup-edit-comp" ><input type="text" ng-model="backData.content" ><label ></label></div>',
-            title: '<div><h5>请输入反馈内容</h5></div>',
-            scope: $scope,
-            buttons: [{
-                text: '取消',
-                onTap: function () {
-                    return false;
-                }
-            }, {
-                text: '<b>提交</b>',
-                type: 'button-positive',
-                onTap: function (e) {
-                    if (!$scope.backData.content) {
-                        e.preventDefault();
-                    } else {
-                        return true;
-                    }
-                }
-            }]
-        }).then(function (res) {
-            if (res) {
-                postBackContent();
-            }
-        });
-    };
-
-    $scope.edit = function () {
-        $scope.popover.hide();
-        $state.go("postnotice", {
-            "id": $scope.id
-        })
-    }
-
-    $ionicPopover.fromTemplateUrl('templates/detiilsmenu.html', {
-        scope: $scope,
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    $scope.shouBigImage = function (imageName, event) {
-        if (event != undefined) {
-            event.stopPropagation();
-        }
-        $scope.Url = imageName;
-        $rootScope.commons.bigImage = true;
-    };
-
-    $scope.doRefresh = function () {
-        getDetails();
-    };
-
-    function postBackContent() {
-        postRecordData({
-            back_content: $scope.backData.content
-        });
-    }
-
-    function postGiveUp(type) {
-        // type 0 投票 1 反馈
-        var data = {};
-        if (type == 0) {
-            data.vote_giveup = 1
-        } else if (type == 1) {
-            data.back_giveup = 1
-        }
-        postRecordData(data);
-    }
-
-    function postRecordData(data) {
-        data.notice_id = $scope.id;
-        data.user_id = global.user.usrid;
-        Notice.postRecord(data).then(function (data) {
-            $scope.record = data;
-        })
-    }
-
-    function getDetails() {
-        if ($scope.details == undefined) {
-            $scope.loading = true;
-        }
-        Notice.getDetails($scope.id).then(function (data) {
-            $scope.details = data;
-            if ($scope.details.user == global.user.usrid) {
-                $scope.isAdmin = true;
-            }
-            if ($scope.details.vote_enddd != null) {
-                $scope.details.vote_enddd = new Date($scope.details.vote_enddd)
-            }
-            if ($scope.details.back_enddd != null) {
-                $scope.details.back_enddd = new Date($scope.details.back_enddd)
-            }
-            $scope.datetime = new Date();
-            if ($scope.details.vote_selectdata != null) {
-                $scope.selectData = $scope.details.vote_selectdata.split(';');
-            }
-            if ($scope.details.vote_selecttype == 1) {
-                $scope.selectIndex = 0;
-            } else if ($scope.details.vote_selecttype == 0) {
-                $scope.selectIndex = [];
-            }
-            Notice.getRecord($scope.id).then(function (data) {
-                $scope.record = data;
-                if ($scope.record != null) {
-                    if ($scope.record.vote_selectindex != null) {
-                        $scope.usr_select_index = $scope.record.vote_selectindex.split(';');
-                    }
-                }
-                $scope.loading = false;
-            });
-            General.getComment($scope.id, 'notice').then(function (data) {
-                $scope.commentData = data.reverse();
-            });
-            General.getRead($scope.id, 'notice').then(function (data) {
-                $scope.readData = data.reverse();
-            });
-            General.getRead($scope.id, 'notice', 'unreads').then(function (data) {
-                $scope.unreadData = data.reverse();
-            });
-        }).finally(function () {
-            $scope.$broadcast('scroll.refreshComplete');
-        });
-    }
-
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        if (global.user.token == "") {
-            global.fetch_user().then(function () {
-                getDetails();
-            }, function (err) {
-                $scope.loading = false;
-                alert(JSON.stringify(err));
-            });
-        } else {
-            getDetails();
-        }
-
-        $scope.popup = {
-            isPopup: false
-        };
-    });
-
-    $scope.$on("$destroy", function () {
-        $scope.popover.remove();
-        beforeEnter = null;
-        $rootScope.commons.bigImage = false;
-    })
-})
-
-.controller('PowerSetCtrl', function ($rootScope, $scope, $state, $timeout, $location, $ionicScrollDelegate, $ionicPopover, _, global, Dept, Member, Notice) {
-    $ionicPopover.fromTemplateUrl('templates/add.html', {
-        scope: $scope
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        $scope.sortchars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#'];
-        if (Member.selectedemplst.length > 0) {
-            var add_usrs = _.pluck(Member.selectedemplst, 'user_id');
-            // alert("add_usrs data:"+JSOM.stringify(add_usrs));
-            Notice.post_NoticeCreateUsrs(add_usrs).then(function (data) {
-                getCreateUsrs();
-            }, function (error) {
-                console.log(error);
-            })
-        } else {
-            getCreateUsrs();
-        }
-        Member.cancelroutename = '';
-        Member.cancelrouteparams = {};
-    });
-
-    $scope.$on("$destroy", function () {
-        $scope.popover.remove();
-        beforeEnter = null;
-    });
-
-    $scope.isshowdelete = {
-        showDelete: false
-    };
-    $scope.sortchar = 'A';
-    $scope.Isshowmiddle = false;
-
-    $scope.sortByChar = function (char, id) {
-        $scope.sortchar = char;
-        $scope.Isshowmiddle = true;
-        $location.hash(id);
-        $ionicScrollDelegate.anchorScroll();
-        $timeout(function () {
-            $scope.Isshowmiddle = false;
-        }, 200);
-    };
-
-    $scope.displayremove = function () {
-        $scope.isshowdelete.showDelete = !$scope.isshowdelete.showDelete;
-        $scope.popover.hide();
-    };
-
-    $scope.ok = function () {
-        $scope.popover.hide();
-        $scope.isshowdelete.showDelete = false;
-        if (delete_data.length > 0) {
-            Notice.delete_NoticeCreateUsrs(delete_data);
-            for (var i = 0; i < $scope.empdata.length; i++) {
-                _.each(delete_data, function (d) {
-                    if (d == $scope.empdata[i].id) {
-                        $scope.empdata.splice(i, 1)
-                    }
-                })
-            }
-        }
-    };
-
-    $scope.toadd = function () {
-        Member.resourcemember = [];
-        Member.selectedemplst = [];
-        Member.disabled = true;
-        Member.resourcemember = $scope.empdata;
-        Member.showall = false;
-        Member.showgroup = false;
-        Member.titlename = "选择成员";
-        Member.routename = "";
-        $scope.popover.hide();
-        $state.go('selectmember');
-    };
-    var delete_data = [];
-    $scope.removeItem = function (id, _char) {
-        delete_data.push(id);
-        for (var i = 0; i < $scope.resultdata.length; i++) {
-            if ($scope.resultdata[i].sortchar == _char) {
-                for (var j = 0; j < $scope.resultdata[i].persons.length; j++) {
-                    if ($scope.resultdata[i].persons[j].nid == id) {
-                        $scope.resultdata[i].persons.splice(j, 1);
-                        if ($scope.resultdata[i].persons.length == 0) {
-                            $scope.resultdata.splice(i, 1)
-                        }
-                        break;
-                    }
-                }
-                break;
-            }
-        }
-    };
-
-    function getCreateUsrs() {
-        if ($scope.resultdata == undefined) {
-            $scope.loading = true;
-        }
-        Notice.getCreateUsrs().then(function (data) {
-            $scope.loading = false;
-            $scope.empdata = data;
-            $scope.resultdata = [];
-            var chars = _.map($scope.empdata, function (emp) {
-                var char = pinyin.getCamelChars(emp.name).toUpperCase().charAt(0);
-                return _.contains($scope.sortchars, char) ? char : '#';
-            });
-            chars = _.sortBy(_.uniq(chars));
-            for (var i = 0; i < chars.length; i++) {
-                var d = {
-                    "sortchar": chars[i],
-                    "persons": []
-                };
-                $scope.resultdata.push(d);
-                for (var j = 0; j < $scope.empdata.length; j++) {
-                    var char = pinyin.getCamelChars($scope.empdata[j].name).toUpperCase().charAt(0);
-                    var empchar = _.contains($scope.sortchars, char) ? char : '#';
-                    if (empchar == chars[i]) {
-                        d.persons.push({
-                            "nid": $scope.empdata[j].id,
-                            "username": $scope.empdata[j].name
-                        });
-                    }
-                }
-            }
-            var index = _.pluck($scope.resultdata, 'sortchar').indexOf('#');
-            if (index >= 0) {
-                var item = $scope.resultdata[index];
-                $scope.resultdata.splice(index, 1);
-                $scope.resultdata.push(item);
-            }
-            Member.selectedemplst = [];
-        }, function (err) {
-            $scope.loading = false;
-            alert(JSON.stringify(err))
-        });
-    }
-})
-
-.controller('PostNoticeCtrl', function ($rootScope, $scope, $state, $cordovaDatePicker, $timeout, $ionicHistory, $q, $ionicScrollDelegate, _, global, ImageManage, showPopup, Notice, Member, Tool, formatFilter) {
-    $rootScope.commons.bigImage = false;
-    var tmday = new Date((new Date() / 1000 + 86400) * 1000);
-    $scope.isNew = (parseInt($state.params["id"]) < 0);
-    $scope.selectdatas = [{
-        name: '多选',
-        id: 0
-    }, {
-        name: '单选',
-        id: 1
-    }];
-    var deleteimages = {};
-
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        Tool.removeBackView('selectmember');
-        $scope.usernames = "";
-        if ($scope.isNew) { //add
-            deleteimages = Notice.getsavedata.deleteimages;
-            $scope.noticedata = Notice.getsavedata;
-            $scope.noticedata.allid = Member.all;
-            if (Member.dialogresult == 0) { //cancel
-                $scope.noticedata.allid == 0 ? setreadusrs($scope.noticedata.readusrs) : $scope.usernames = "全部成员";
-            } else {
-                if (Member.all == 0 && Member.selectedemplst.length > 0) {
-                    $scope.noticedata.readusrs = _.map(Member.selectedemplst, function (item) {
-                        return _.pick(item, 'user_id', 'username');
-                    });
-                    setreadusrs(Member.selectedemplst);
-                } else if (Member.all == 1) {
-                    $scope.noticedata.readusrs = [];
-                    $scope.usernames = "全部成员";
-                }
-            }
-        } else { //edit
-            deleteimages = Notice.getLoalDetails().deleteimages;
-            $scope.noticedata = Notice.getLoalDetails();
-            $scope.editvotedata = $scope.noticedata.selectitems;
-            $scope.noticedata.disablededit.showadditem = (Tool.trim($scope.noticedata.vote_title).length == 0);
-            $scope.noticedata.disablededit.showeditback = (Tool.trim($scope.noticedata.back_title).length == 0);
-            if (Member.selectedemplst.length > 0) {
-                $scope.noticedata.allid = Member.all;
-                $scope.noticedata.readusrs = _.map(Member.selectedemplst, function (item) {
-                    return _.pick(item, 'user_id', 'username');
-                });
-                setreadusrs(Member.selectedemplst)
-            } else {
-                if ($scope.noticedata.allid == 1) {
-                    $scope.noticedata.readusrs = [];
-                    $scope.usernames = "全部成员";
-                } else {
-                    setreadusrs($scope.noticedata.readusrs)
-                }
-            }
-        }
-        Member.routeparams = {};
-        $scope.popup = {
-            isSetPopup: false
-        };
-        $ionicScrollDelegate.resize();
-    });
-
-    $scope.$on("$destroy", function () {
-        $rootScope.commons.modal = null;
-        $rootScope.commons.fun = null;
-        beforeEnter = null;
-        Notice.getsavedata = Notice.getstructdata();
-    });
-
-    $scope.noticedata = [];
-    $scope.imagePicker = function () {
-        ImageManage.ImagePicker_getPictures(10).then(function (data) {
-            if (data.length == 0) return;
-            $scope.noticedata.noticefiles = $scope.noticedata.noticefiles.concat(_.map(data, function (imageUrl) {
-                return {"file_thumbnail_path": imageUrl, "file_full_path": imageUrl};
-            }));
-        });
-    };
-
-    $scope.Camera = function () {
-        ImageManage.Camera_getPicture().then(function (result) {
-            $scope.noticedata.noticefiles.push({
-                "file_thumbnail_path": result,
-                "file_full_path": result
-            });
-        });
-    };
-
-    $scope.shouBigImage = function (imageName, event) {
-        if (event != undefined) event.stopPropagation();
-        $scope.Url = imageName;
-        $rootScope.commons.bigImage = true;
-    };
-
-    $rootScope.commons.bigImage = false;
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.deleteimage = function () {
-        for (var i = 0; i < $scope.noticedata.noticefiles.length; i++) {
-            if ($scope.noticedata.noticefiles[i].file_full_path == $scope.Url) {
-                if (_.has($scope.noticedata.noticefiles[i], 'id')) {
-                    deleteimages.oldimages.push($scope.noticedata.noticefiles[i]);
-                }
-                $scope.noticedata.noticefiles.splice(i, 1);
-                break;
-            }
-        }
-        $rootScope.commons.bigImage = false;
-    };
-
-    var tempdata = {};
-    $scope.set_voteback = function (type, event) {
-        type == 'vote' ? $scope.noticedata.setbtnstyle.vote = true : $scope.noticedata.setbtnstyle.back = true;
-        tempdata = angular.copy($scope.noticedata);
-        tempdata.selectitems = tempdata.vote_selectdata == "" ? [] : _.map(tempdata.vote_selectdata.split(';'), function (text) {
-                return {'text': text};
-            });
-        showPopup.modalTemplate(formatFilter('templates/modal-{0}.html', type), 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.fun = clear_change;
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        })
-    };
-
-    $scope.cancel = function (op) {
-        $rootScope.commons.fun = null;
-        if (op == 'notice') {
-            $ionicHistory.goBack();
-        } else {
-            clear_change()
-        }
-    };
-
-    function clear_change() {
-        $scope.noticedata = angular.copy(tempdata);
-        if (Tool.trim(tempdata.vote_title).length == 0) $scope.noticedata.setbtnstyle.vote = false;
-        if (Tool.trim(tempdata.back_title).length == 0) $scope.noticedata.setbtnstyle.back = false;
-        set_modal();
-    }
-
-    $scope.ok = function (op) {
-        $rootScope.commons.fun = null;
-        if (op == "notice") { //创建公告的首页-确定按钮
-            if (Tool.trim($scope.noticedata.title).length == 0) {
-                showPopup.PopupWindow(0, "标题不能为空!", false);
-                return;
-            }
-            if (Tool.trim($scope.noticedata.content).length == 0) {
-                showPopup.PopupWindow(0, "内容不能为空!", false);
-                return;
-            }
-            showPopup.showLoading(1, '正在提交');
-            $scope.noticedata.usrid = global.user.usrid;
-            var temp_notice = angular.copy($scope.noticedata);
-            temp_notice.readusrs = _.pluck(temp_notice.readusrs, 'user_id');
-            if ($scope.isNew) {
-                Notice.post_NoticeMf(temp_notice).then(function (data) {
-                    if ($scope.noticedata.noticefiles.length > 0) {
-                        postimg($scope.noticedata.noticefiles, data.id);
-                    } else {
-                        showPopup.hideLoading();
-                        $ionicHistory.goBack();
-                        $timeout(function () {
-                            $state.go("notice-details", {
-                                "id": data.id
-                            })
-                        });
-                    }
-                }, function (error) {
-                    showPopup.hideLoading();
-                    alert('post_NoticeMf error:  ' + JSON.stringify(error))
-                });
-            } else {
-                temp_notice.del_files = _.pluck(deleteimages.oldimages, 'id');
-                Notice.put_NoticeMf(temp_notice).then(function (data) {
-                    postimgs = _.filter($scope.noticedata.noticefiles, function (img) {
-                        return !_.has(img, 'id');
-                    });
-                    if (postimgs.length > 0) {
-                        postimg(postimgs, $state.params['id']);
-                    } else {
-                        showPopup.hideLoading();
-                        $ionicHistory.goBack();
-                    }
-                }, function (error) {
-                    showPopup.hideLoading();
-                    alert("put notice error: " + JSON.stringify(error))
-                })
-            }
-        } else if (op == "vote") { //添加投票模态窗口-确定按钮
-            if (Tool.trim($scope.noticedata.vote_title).length == 0) {
-                showPopup.PopupWindow(0, '标题不能为空!', false);
-                return;
-            }
-            var items = _.filter($scope.noticedata.selectitems, function (item) {
-                return Tool.trim(item.text).length > 0;
-            });
-
-            var resultitems = _.uniq(_.pluck(items, 'text'));
-            if (resultitems.length < items.length) {
-                showPopup.PopupWindow(0, '选项不能重复!', false);
-                return;
-            }
-            if (resultitems.length < 2) {
-                showPopup.PopupWindow(0, '实际投票选项不能少于2项!', false);
-                return;
-            }
-            $scope.noticedata.vote_selectdata = _.pluck($scope.noticedata.selectitems, 'text').join(';');
-            set_modal();
-            $timeout(function () {
-                $scope.noticedata.showvoteDelete = true;
-            }, 1000);
-        } else if (op == "back") {
-            if (Tool.trim($scope.noticedata.back_title).length == 0) {
-                showPopup.PopupWindow(0, '问题内容不能为空!', false);
-                return;
-            }
-            set_modal();
-            $timeout(function () {
-                $scope.noticedata.showbackDelete = true;
-            }, 1000);
-        }
-    };
-
-    $scope.checkend_dd = function (op) {
-        var date = null;
-        if ($scope.isNew) {
-            date = tmday;
-        } else {
-            if (op == "vote") {
-                date = $scope.noticedata.vote_enddd == null ? tmday : $scope.noticedata.vote_enddd;
-            } else {
-                date = $scope.noticedata.back_enddd == null ? tmday : $scope.noticedata.vote_enddd;
-            }
-        }
-        var options = {
-            mode: 'date',
-            date: date,
-            androidTheme: 3
-        };
-        $cordovaDatePicker.show(options).then(function (date) {
-            $timeout(function () {
-                if (date == undefined) return;
-                op == "vote" ? $scope.noticedata.vote_enddd = date : $scope.noticedata.back_enddd = date;
-            });
-        });
-    };
-
-    $scope.addItem = function () {
-        $timeout(function () {
-            $scope.noticedata.selectitems.push({
-                "text": ""
-            });
-        });
-    };
-
-    $scope.removeItem = function (index) {
-        $scope.noticedata.selectitems.splice(index, 1);
-    };
-
-    //todo:选择要通知的成员
-    $scope.toselect = function () {
-        Member.resourcemember = [];
-        Member.showall = true;
-        Member.showgroup = true;
-        Member.titlename = "选择通知的成员";
-        Member.routename = "postnotice";
-        Member.cancelroutename = "postnotice";
-        Member.cancelrouteparams = {
-            "id": $state.params['id']
-        };
-        Member.disabled = false;
-        if ($scope.isNew) {
-            Member.dialogresult == 0 ? setresourcedata($scope.noticedata.readusrs) : setresourcedata(Member.selectedemplst);
-            Member.routeparams = {
-                "id": -1
-            };
-        } else {
-            Member.selectedemplst.length == 0 ? setresourcedata($scope.noticedata.readusrs) : setresourcedata(Member.selectedemplst);
-            Member.routeparams = {
-                "id": $state.params['id']
-            };
-        }
-        Member.selectedemplst = [];
-        $state.go('selectmember');
-    };
-
-    $scope.delete = function (op) {
-        if (op == "vote") {
-            $scope.noticedata.vote_title = "";
-            $scope.noticedata.vote_selectdata = "";
-            $scope.noticedata.vote_selecttype = 1;
-            $scope.noticedata.vote_enddd = tmday;
-            $scope.noticedata.selectitems = [];
-            $scope.noticedata.setbtnstyle.vote = false;
-            $scope.noticedata.showvoteDelete = false;
-            $scope.noticedata.disablededit.showadditem = true;
-        } else {
-            $scope.noticedata.back_title = "";
-            $scope.noticedata.back_enddd = tmday;
-            $scope.noticedata.setbtnstyle.back = false;
-            $scope.noticedata.showbackDelete = false;
-            $scope.noticedata.disablededit.showeditback = true;
-        }
-        set_modal();
-    };
-
-    $scope.getaddress = function () {
-        if (window.cordovaLinker) {
-            var local = {
-                NAME: "",
-                Latitude: "",
-                Longitude: "",
-                Distance: ""
-            };
-            cordovaLinker.callMap(local, function (mapdata) {
-                $scope.noticedata.address = mapdata.NAME
-            });
-        }
-    };
-
-    function setresourcedata(data) {
-        Member.resourcemember = Member.resourcemember.concat(_.map(data, function (item) {
-            if (_.has(item, 'user__username')) item.username = item.user__username;
-            return item
-        }));
-    }
-
-    function setreadusrs(data) {
-        $scope.usernames = _.map(data, function (item) {
-            return _.has(item, 'username') ? item.username : item.user__username;
-        }).join('、');
-    }
-
-    function postimg(imgfiles, id) {
-        ImageManage.uploadImage(_.pluck(imgfiles, 'file_full_path'), 'notice', id, 'noticefile').then(function (res) {
-            $q.all(res).then(function (res1) {
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-                $timeout(function () {
-                    $state.go("notice-details", {
-                        "id": id
-                    })
-                });
-            })
-        }, function (err) {
-            showPopup.hideLoading();
-            alert(JSON.stringify(error));
-            showPopup.PopupWindow(0, 'upload image fail');
-        })
-    }
-
-    function set_modal() {
-        $rootScope.commons.modal.hide();
-        $rootScope.commons.modal = null;
-    }
-})
-
-.controller('NoticeResultCtrl', function ($rootScope, $scope, $state, $timeout, showPopup, Notice) {
-    $scope.id = $state.params['id'];
-    $scope.type = $state.params['type'];
-
-    $scope.toResultDetails = function (type, index) {
-        // type 0 未看 1 已看 2 未反馈 3 已反馈 4 放弃反馈 5 未投票 6 放弃投票 7 已投票
-        // index 选项的下标
-        showPopup.showLoading(1, '加载中');
-        var data = Notice.getCountDetails();
-        if (type == 7) {
-            data.selectItem = $scope.selectData[index];
-        }
-        Notice.getUsrCount($scope.id, type, index).then(function () {
-            $state.go('result-details', {
-                type: type
-            });
-            showPopup.hideLoading();
-        })
-    }
-
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        if ($scope.details == undefined) {
-            showPopup.showLoading(1, '加载中');
-        }
-        Notice.getCount($scope.id).then(function (data) {
-            $scope.countData = data;
-            $scope.details = Notice.getLoalDetails();
-            if ($scope.details.vote_title != null) {
-                $scope.selectData = $scope.details.vote_selectdata.split(';');
-                $scope.usrvotecount = 0;
-                for (var i = 0; i < $scope.countData.votecount.length; i++) {
-                    $scope.usrvotecount += $scope.countData.votecount[i];
-                }
-                $scope.usrvotecount += $scope.countData.unvote;
-                $scope.usrvotecount += $scope.countData.votegiveup;
-            }
-            showPopup.hideLoading();
-        });
-    });
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-    })
-})
-
-.controller('NoticePostedCtrl', function ($scope, $state, Member, Notice) {
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        if ($scope.createstate == undefined)
-            $scope.createstate = 0; //默认不显示'+'标记
-        Notice.getCreateUsrsState().then(function (data) {
-            $scope.createstate = data.state;
-        });
-        Notice.getRelease().then(function (data) {
-            $scope.Notice = _.sortBy(data.results, 'create_dd').reverse();
-        });
-        Notice.getsavedata = Notice.getstructdata();
-        Member.selectedemplst = [];
-    });
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-    });
-
-    $scope.toadd = function () {
-        Member.resourcemember = [];
-        Member.selectedemplst = [];
-        Member.showall = true;
-        Member.showgroup = true;
-        Member.titlename = "选择通知的成员";
-        Member.routename = "postnotice";
-        Member.routeparams = {
-            "id": -1
-        };
-        $state.go('selectmember');
-    };
-
-    $scope.todetails = function (id) {
-        $state.go('notice-details', {
-            id: id
-        });
-    };
-})
-
-.controller('ResultDetailsCtrl', function ($scope, $state, Notice) {
-    $scope.type = $state.params['type'];
-    $scope.titleArr = ['未看', '已看', '未反馈', '已反馈', '放弃反馈', '未投票', '放弃投票', '已投票'];
-    $scope.countDetails = Notice.getCountDetails();
-});

+ 0 - 256
www/apps/notice/js/factory.js

@@ -1,256 +0,0 @@
-starter.factory('Notice', function ($http, $q, cfg, global, formatFilter, Tool) {
-    var NoticeDetailsData = null;
-    var curDate = new Date();
-    var tmday = new Date((curDate / 1000 + 86400) * 1000);
-    var savedata = {
-        "user_id": global.user.usrid,
-        "title": "",
-        "content": "",
-        "address": null,
-        "create_dd": null,
-        "readtimes": 0,
-        "commenttimes": 0,
-        "back_title": null,
-        "back_enddd": tmday,
-        "vote_title": null,
-        "vote_selecttype": 1,
-        "vote_selectdata": "",
-        "vote_enddd": tmday,
-        "allid": 0,
-        "groupid": null,
-        "readusrs": [],
-        "noticefiles": [],
-        "setbtnstyle": {
-            vote: false,
-            back: false
-        },
-        "selectitems": [],
-        "deleteimages": {
-            "oldimages": [],
-            "newimages": []
-        },
-        "disablededit": {
-            showadditem: true,
-            showeditback: true
-        }
-    };
-
-    var countDetails = {
-        usrCountList: [],
-        selectItem: null
-    };
-
-    function pick() {
-
-    }
-
-    function setdata(data) {
-        if (Tool.trim(data.vote_title).length == 0) {
-            data.vote_title = null;
-            data.vote_enddd = null;
-        }
-        if (Tool.trim(data.back_title).length == 0) {
-            data.back_title = null;
-            data.back_enddd = null;
-        }
-    }
-
-    return {
-        getCreateUsrs: function () {
-            var url = formatFilter('{0}notice/createusrs/', cfg.api);
-            return Tool.get(url);
-        },
-        post_NoticeCreateUsrs: function (add_usrs) {
-            var url = formatFilter('{0}notice/createusrs/', cfg.api);
-            return Tool.post(url, add_usrs);
-        },
-        delete_NoticeCreateUsrs: function (delete_usrs) {
-            var data = [{
-                "op": "del",
-                "values": delete_usrs
-            }];
-            var url = formatFilter('{0}notice/createusrs/', cfg.api);
-            return Tool.patch(url, data);
-        },
-        post_NoticeMf: function (data) {
-            console.log(angular.copy(data));
-            console.log(data);
-            data = _.pick(data,
-                    "user_id",
-                    "title",
-                    "content",
-                    "address",
-                    "create_dd",
-                    "commenttimes",
-                    "back_title",
-                    "back_enddd",
-                    "vote_title",
-                    "vote_selecttype",
-                    "vote_selectdata",
-                    "vote_enddd",
-                    "allid",
-                    "groupid",
-                    "update_dd",
-                    "readusrs");
-            var url = formatFilter('{0}notice/', cfg.api);
-            setdata(data);
-            return Tool.post(url, data);
-        },
-        post_NoticeReadList: function (data) {
-            var url = formatFilter('{0}notice/readlist/', cfg.api);
-            return Tool.post(url, data);
-        },
-        getReceive: function () {
-            var url = formatFilter('{0}notice/list/?type=receive', cfg.api);
-            return Tool.get(url);
-        },
-        getRelease: function () {
-            var url = formatFilter('{0}notice/list/', cfg.api);
-            return Tool.get(url);
-        },
-        getNext: function(url) {
-            return Tool.get(url);
-        },
-        getDetails: function (id) {
-            var url = formatFilter('{0}notice/{1}/', cfg.api, id);
-            var deferred = $q.defer();
-            $http.get(url).then(function (res) {
-                        deferred.resolve(res.data);
-                        NoticeDetailsData = angular.copy(res.data);
-                        NoticeDetailsData.setbtnstyle = {
-                            vote: false,
-                            back: false
-                        };
-                        NoticeDetailsData.selectitems = [];
-                        if (NoticeDetailsData.vote_title !== null) {
-                            NoticeDetailsData.setbtnstyle.vote = true;
-                            var selectitems = NoticeDetailsData.vote_selectdata.split(';');
-                            _.each(selectitems, function (item) {
-                                NoticeDetailsData.selectitems.push({
-                                    "text": item
-                                });
-                            });
-                        }
-                        if (NoticeDetailsData.back_title != null) {
-                            NoticeDetailsData.setbtnstyle.back = true;
-                        }
-
-                        NoticeDetailsData.showvoteDelete = false;
-                        NoticeDetailsData.showbackDelete = false;
-                        if (NoticeDetailsData.vote_title != null) {
-                            NoticeDetailsData.showvoteDelete = true;
-                        } else {
-                            NoticeDetailsData.vote_enddd = tmday;
-                        }
-                        if (NoticeDetailsData.back_title != null) {
-                            NoticeDetailsData.showbackDelete = true;
-                        } else {
-                            NoticeDetailsData.back_enddd = tmday;
-                        }
-                        NoticeDetailsData.deleteimages = {
-                            "oldimages": [],
-                            "newimages": []
-                        };
-                        NoticeDetailsData.disablededit = {
-                            showadditem: true,
-                            showeditback: true
-                        };
-                        console.log(NoticeDetailsData)
-                    },
-                    function (err) {
-                        deferred.reject(err);
-                    });
-            return deferred.promise;
-        },
-        getLoalDetails: function (op) {
-            return NoticeDetailsData;
-        },
-        getsavedata: savedata,
-        getstructdata: function () {
-            var structdata = {
-                "user_id": global.user.usrid,
-                "title": "",
-                "content": "",
-                "address": null,
-                "create_dd": null,
-                "readtimes": 0,
-                "commenttimes": 0,
-                "back_title": null,
-                "back_enddd": tmday,
-                "vote_title": null,
-                "vote_selecttype": 1,
-                "vote_selectdata": "",
-                "vote_enddd": tmday,
-                "allid": 0,
-                "groupid": null,
-                "readusrs": [],
-                "noticefiles": [],
-                "setbtnstyle": {
-                    vote: false,
-                    back: false
-                },
-                "selectitems": [],
-                "deleteimages": {
-                    "oldimages": [],
-                    "newimages": []
-                },
-                "disablededit": {
-                    showadditem: true,
-                    showeditback: true
-                }
-            };
-            return angular.copy(structdata);
-        },
-        put_NoticeMf: function (data) {
-            data = _.pick(data, "id",
-                    "title",
-                    "content",
-                    "address",
-                    "back_enddd",
-                    "back_title",
-                    "vote_title",
-                    "vote_selecttype",
-                    "vote_selectdata",
-                    "vote_enddd",
-                    "allid",
-                    "groupid",
-                    "update_dd",
-                    "readusrs",
-                    "del_files");
-            var url = formatFilter('{0}notice/{1}/', cfg.api, data.id);
-            setdata(data);
-            return Tool.put(url, data);
-        },
-        delete_NoticeMf: function (id) {
-            var url = formatFilter('{0}notice/{1}/', cfg.api, id);
-            return Tool.delete(url);
-        },
-        getUsrCount: function (id, type, index) {
-            var url = formatFilter('{0}notice/stat/detail/?notice_id={1}&type={2}', cfg.api, id, type);
-            if (type == 7 && index != undefined) {
-                url = formatFilter('{0}notice/stat/detail/?notice_id={1}&type={2}&index={3}', cfg.api, id, type, index);
-            }
-            return Tool.get(url, true, 'noticecount');
-        },
-        getCountDetails: function () {
-            countDetails.usrCountList = Tool.getTempData('noticecount');
-            return countDetails;
-        },
-        getCount: function (id) {
-            var url = formatFilter('{0}notice/stat/?notice_id={1}', cfg.api, id);
-            return Tool.get(url);
-        },
-        getRecord: function (id) {
-            var url = formatFilter('{0}notice/record/?noticeid={1}', cfg.api, id);
-            return Tool.get(url);
-        },
-        postRecord: function (data) {
-            var url = formatFilter('{0}notice/record/', cfg.api);
-            return Tool.post(url, data);
-        },
-        getCreateUsrsState: function () {
-            var url = formatFilter('{0}notice/createusrs/?type={1}', cfg.api, 'state');
-            return Tool.get(url);
-        }
-    }
-});

+ 0 - 45
www/apps/notice/js/route.js

@@ -1,45 +0,0 @@
-starter.config(function ($stateProvider) {
-    $stateProvider
-
-    .state('notice', {
-        url: '/index',
-        templateUrl: 'templates/notice.html',
-        controller: 'NoticeCtrl'
-    })
-
-    .state('notice-details', {
-        url: '/notice-details/:id',
-        templateUrl: 'templates/notice-details.html',
-        controller: 'NoticeDetailsCtrl'
-    })
-
-    .state('power-set', {
-        url: '/power-set',
-        templateUrl: 'templates/power-set.html',
-        controller: 'PowerSetCtrl'
-    })
-
-    .state('postnotice', {
-        url: '/postnotice/:id',
-        templateUrl: 'templates/postnotice.html',
-        controller: 'PostNoticeCtrl'
-    })
-
-    .state('notice-result', {
-        url: '/notice-result/:id&:type',
-        templateUrl: 'templates/notice-result.html',
-        controller: 'NoticeResultCtrl'
-    })
-
-    .state('notice-posted', {
-        url: '/notice-posted',
-        templateUrl: 'templates/notice-posted.html',
-        controller: 'NoticePostedCtrl'
-    })
-
-    .state('result-details', {
-        url: '/result-details/:type',
-        templateUrl: 'templates/result-details.html',
-        controller: 'ResultDetailsCtrl'
-    })
-});

+ 0 - 28
www/apps/notice/templates/modal-back.html

@@ -1,28 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar class="bar bar-header">
-        <button class="button button-clear button-calm" ng-click="cancel('back');">取消</button>
-        <h1 class="title">反馈</h1>
-        <button class="button button-clear button-calm" ng-click="ok('back');">完成</button>
-    </ion-header-bar>
-    <ion-content>
-        <div class=" item item-divider"></div>
-        <div class="list notice-input">
-            <label class="item item-input">
-                <span class="input-label">问题:</span>
-                <input type="text" class="notice-title" placeholder="输入问题" ng-model="noticedata.back_title" ng-if="noticedata.disablededit.showeditback" focus-me="true">
-                <label for="" ng-if="!noticedata.disablededit.showeditback">{{noticedata.back_title}}</label>
-            </label>
-            <div class="item item-divider dividertext">
-                <label>提出问题,让被通知的员工逐一回答</label>
-            </div>
-            <ion-item class="item item-icon-right" type="item-text-wrap" ng-disabled="noticedata.disablededit.showeditback" ng-click="checkend_dd('back');">
-                截止日期
-                <label class="label-right-text item-note">{{noticedata.back_enddd | date:"y年MM月dd日"}}</label>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-        </div>
-    </ion-content>
-    <div class="bar bar-footer bar-balanced footer" ng-click='delete("back");' ng-show="noticedata.showbackDelete">
-        <div class="title">删除</div>
-    </div>
-</ion-modal-view>

+ 0 - 11
www/apps/notice/templates/modal-selectgroup.html

@@ -1,11 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar class="bar bar-header">
-        <button class="button button-clear button-calm" ng-click="back()">
-            <i class="icon ion-ios-arrow-left"></i>
-        </button>
-        <h1 class="title">选择通知的小组</h1>
-    </ion-header-bar>
-    <ion-content>
-        <div class="item item-divider divider-font"><i class="icon ion-ios-star"></i>我加入的小组({{0}})</div>
-    </ion-content>
-</ion-modal-view>

+ 0 - 44
www/apps/notice/templates/modal-vote.html

@@ -1,44 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar class="bar bar-header">
-        <button class="button button-clear button-calm" ng-click="cancel('vote');">取消</button>
-        <h1 class="title">投票</h1>
-        <button class="button button-clear button-calm" ng-click="ok('vote');">完成</button>
-    </ion-header-bar>
-    <ion-content>
-        <div class=" item item-divider"></div>
-        <div class="list notice-input">
-            <label class="item item-input">
-                <span class="input-label">标题:</span>
-                <input type="text" class="notice-title" placeholder="输入投票标题" ng-model="noticedata.vote_title" ng-if="noticedata.disablededit.showadditem" focus-me="true">
-                <label ng-if="!noticedata.disablededit.showadditem">{{noticedata.vote_title}}</label>
-            </label>
-            <label class="item item-input item-select">
-                <div class="input-label">
-                    类型
-                </div>
-                <select ng-model="noticedata.vote_selecttype" ng-options="x.id as x.name for x in selectdatas" ng-disabled="!noticedata.disablededit.showadditem"></select>
-            </label>
-            <ion-item class="item item-icon-right" type="item-text-wrap" ng-disabled="!noticedata.disablededit.showadditem" ng-click="checkend_dd('vote');">
-                截止日期
-                <label class="label-right-text item-note">{{noticedata.vote_enddd | date:"y年MM月dd日"}}</label>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <div class=" item item-divider"></div>
-            <ion-item class="item item-text-wrap item-icon-left" ng-repeat="_item in noticedata.selectitems track by $index" ng-if="noticedata.disablededit.showadditem">
-                <i class="icon ion-android-remove-circle" style="color:red;" ng-click="removeItem($index);"></i>
-                <input type="text" placeholder="请输入选项标题" ng-model="_item.text" focus-me="true"/>
-            </ion-item>
-            <ion-item class="item item-icon-left" ng-click="addItem();" ng-if="noticedata.disablededit.showadditem">
-                <i class="icon ion-plus-circled balanced"></i> 选项
-            </ion-item>
-            <div ng-show="!noticedata.disablededit.showadditem">
-                <ion-item class="item item-text-wrap" ng-click="" ng-repeat="_item in editvotedata track by $index">
-                    {{_item.text}}
-                </ion-item>
-            </div>
-        </div>
-    </ion-content>
-    <div class="bar bar-footer bar-balanced footer" ng-click='delete("vote");' ng-show="noticedata.showvoteDelete">
-        <div class="title">删除</div>
-    </div>
-</ion-modal-view>

+ 0 - 209
www/apps/notice/templates/notice-details.html

@@ -1,209 +0,0 @@
-<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;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button ng-if="isAdmin" class="button button-icon ion-ios-more" ng-click="popover.show($event)"></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 class="item border-style item-text-wrap" ng-if="!loading" style="margin:-1px 0;">
-            <h1>{{details.title}}</h1>
-            <p>{{details.user__username}}
-                <span ng-if="details.update_dd != details.create_dd">&nbsp;修改于</span> &nbsp;{{details.update_dd == null ? details.create_dd : details.update_dd | date:'MM月dd日 HH:mm'}}
-                <a class="float-right" ng-click="isScopeShow = !isScopeShow">{{isScopeShow ? '隐藏详情' : '显示详情'}}</a>
-            </p>
-            <p ng-show="isScopeShow">范围:
-                <span ng-if="details.allid == 1">全体成员</span>
-                <span ng-if="details.groupid != null"></span>
-                <span ng-if="details.readusrs.length != 0">
-                    <span ng-repeat="item in details.readusrs">{{item.user__username}}{{$last ? '' : '、'}}</span>
-                </span>
-            </p>
-            <br/>
-            <span ng-bind-html="details.content | SwitchHtmlContent"></span>
-            <br/>
-            <image-popover all-images="details.noticefiles"></image-popover>
-            <br/>
-            <!--投票-->
-            <div ng-if="details.vote_title != null">
-                <p>需要投票来完成</p>
-                <div class="item item-body">
-                    <span>{{details.vote_title}}{{details.vote_selecttype == 1 ? '(单选)' : '(多选)'}}</span>
-                    <!--未过期单选-->
-                    <ion-list ng-if="details.vote_selecttype == 0 && details.vote_enddd >= datetime">
-                        <br/>
-                        <!--未选-->
-                        <ion-checkbox ng-if="record.vote_selectindex == null && record.vote_giveup == null" ng-repeat="selectitem in selectData track by $index" class="notice-details-voteitem" ng-click="changeIndex($index)" ng-model="selectIndexArr" ng-value="selectitem">
-                            {{selectitem}}
-                        </ion-checkbox>
-                        <!--已选-->
-                        <div ng-if="record.vote_selectindex != null || record.vote_giveup != null" ng-click="result()" class="item item-icon-left item-icon-right notice-details-voteitem">
-                            <i ng-if="record.vote_selectindex != null || record.vote_giveup == 1" class="icon ion-checkmark-circled energized"></i>
-                            <span ng-if="record.vote_selectindex != null">投票成功</span>
-                            <span ng-if="record.vote_giveup == 1">放弃投票</span>
-                            <div ng-repeat="item in usr_select_index">
-                                <p>{{selectData[item]}}</p>
-                            </div>
-                            <i class="icon ion-chevron-right icon-accessory"></i>
-                        </div>
-                        <br/>
-                    </ion-list>
-                    <!--未过期多选-->
-                    <ion-list ng-if="details.vote_selecttype == 1 && details.vote_enddd >= datetime">
-                        <br/>
-                        <!--未选-->
-                        <ion-radio ng-if="record.vote_selectindex == null && record.vote_giveup == null" ng-repeat="selectitem in selectData track by $index" class="notice-details-voteitem" ng-click="changeIndex($index)" ng-model="selectIndex" ng-value="selectitem">
-                            {{selectitem}}
-                        </ion-radio>
-                        <!--已选-->
-                        <div ng-if="record.vote_selectindex != null || record.vote_giveup != null" ng-click="result()" class="item item-icon-left item-icon-right notice-details-voteitem">
-                            <i ng-if="record.vote_selectindex != null || record.vote_giveup == 1" class="icon ion-checkmark-circled energized"></i>
-                            <span ng-if="record.vote_selectindex != null">投票成功</span>
-                            <span ng-if="record.vote_giveup == 1">放弃投票</span>
-                            <div ng-repeat="item in usr_select_index">
-                                <p>{{selectData[item]}}</p>
-                            </div>
-                            <i class="icon ion-chevron-right icon-accessory"></i>
-                        </div>
-                        <br/>
-                    </ion-list>
-                    <!--已过期-->
-                    <ion-list ng-if="details.vote_enddd < datetime">
-                        <br/>
-                        <div class="item item-icon-left item-icon-right notice-details-voteitem" ng-click="result()">
-                            <!--未选-->
-                            <i ng-if="record.vote_selectindex == null && record.vote_giveup == null" class="icon ion-close-circled assertive"></i>
-                            <span ng-if="record.vote_selectindex == null && record.vote_giveup == null">已过期</span>
-                            <!--已选-->
-                            <i ng-if="record.vote_selectindex != null || record.vote_giveup == 1" class="icon ion-checkmark-circled energized"></i>
-                            <span ng-if="record.vote_selectindex != null">投票成功</span>
-                            <span ng-if="record.vote_giveup == 1">放弃投票</span>
-                            <div ng-repeat="item in usr_select_index">
-                                <p>{{selectData[item]}}</p>
-                            </div>
-                            <i class="icon ion-chevron-right icon-accessory"></i>
-                        </div>
-                        <br/>
-                    </ion-list>
-                    <button ng-show="record.vote_selectindex == null && record.vote_giveup == null && details.vote_enddd >= datetime" class="button button-outline button-energized notice-details-button" ng-click="postVote()">确定投票</button>
-                    <button ng-show="record.vote_selectindex == null && record.vote_giveup == null && details.vote_enddd >= datetime" class="button button-clear button-light float-right notice-details-giveupbutton" ng-click="giveUp(0)">放弃投票?</button>
-                </div>
-            </div>
-            <br/>
-            <!--反馈-->
-            <div ng-if="details.back_title != null">
-                <p>需要反馈来完成</p>
-                <div class="item item-body">
-                    <span>{{details.back_title}}</span>
-                    <ion-list>
-                        <!--未过期未填-->
-                        <hr ng-if="details.back_enddd >= datetime && record.back_content == null && record.back_giveup == null" class="notice-details-hr"/>
-                        <!--未过期已填-->
-                        <br ng-if="details.back_enddd >= datetime && (record.back_content != null || record.back_giveup == 1)"/>
-                        <div ng-if="details.back_enddd >= datetime && (record.back_content != null || record.back_giveup == 1)" class="item item-icon-left notice-details-voteitem">
-                            <i ng-if="record.back_content != null || record.back_giveup == 1" class="icon ion-checkmark-circled energized"></i>
-                            <span ng-if="record.back_content != null">反馈成功</span>
-                            <span ng-if="record.back_giveup == 1">放弃反馈</span>
-                            <p ng-if="record.back_content != null">反馈内容:&nbsp;{{record.back_content}}</p>
-                        </div>
-                        <br ng-if="details.back_enddd >= datetime && (record.back_content != null || record.back_giveup == 1)"/>
-                        <!--已过期-->
-                        <br ng-if="details.back_enddd < datetime"/>
-                        <div ng-if="details.back_enddd < datetime" class="item item-icon-left notice-details-voteitem">
-                            <!--未填-->
-                            <i ng-if="record.back_content == null && record.back_giveup == null" class="icon ion-close-circled assertive"></i>
-                            <span ng-if="record.back_content == null && record.back_giveup == null">已过期</span>
-                            <!--已填-->
-                            <i ng-if="record.back_content != null || record.back_giveup == 1" class="icon ion-checkmark-circled energized"></i>
-                            <span ng-if="record.back_content != null">反馈成功</span>
-                            <span ng-if="record.back_giveup == 1">放弃反馈</span>
-                            <p ng-if="record.back_content != null">反馈内容:&nbsp;{{record.back_content}}</p>
-                        </div>
-                        <br ng-if="details.back_enddd < datetime"/>
-                        <!--未过期未填-->
-                        <button ng-show="record.back_content == null && record.back_giveup == null && details.back_enddd >= datetime" class="button button-outline button-energized notice-details-button" ng-click="showbackpopup()">反馈</button>
-                        <button ng-show="record.back_content == null && record.back_giveup == null && details.back_enddd >= datetime" class="button button-clear button-light float-right notice-details-giveupbutton" ng-click="giveUp(1)">放弃反馈?</button>
-                    </ion-list>
-                </div>
-            </div>
-        </div>
-        <div class="task-button-div" id="nav-comment" ng-if="!loading">
-            <div class="comment-div" ng-click="change(0)" ng-class="{'colorgray':!(activeIndex == 0)}">评论&nbsp;{{commentData.length == 0 ? '0' : commentData.length}}
-                <label>|</label>
-                <hr ng-show="activeIndex==0">
-            </div>
-            <div class="comment-div" ng-click="change(1)" ng-class="{'colorgray':!(activeIndex == 1)}">看过&nbsp;{{readData.length == 0 ? '0' : readData.length}}
-                <label>|</label>
-                <hr ng-show="activeIndex==1">
-            </div>
-            <div ng-click="change(2)" ng-class="{'colorgray':!(activeIndex == 2)}">未看&nbsp;{{unreadData.length == 0 ? '0' : unreadData.length}}
-                <hr ng-show="activeIndex==2">
-            </div>
-        </div>
-        <ion-slide-box class="slide-task" show-pager="false" ng-init="lockSlide()" active-slide="activeIndex" ng-if="!loading">
-            <ion-slide>
-                <ion-list class="daily">
-                    <div class="item center notice-details-voteitem" ng-if="commentData.length == 0">还没有人进行评论哦</div>
-                    <a class="item item-avatar item-text-wrap" ng-repeat="comment in commentData" ng-click="popupMessageOpthins(comment.id,comment.user_id)">
-                        <img ng-src="../../../img/panda.png" ng-click="showcardinfo(comment.user_id)">
-                        <div>
-                            <span>{{comment.user__username}}</span>
-                            <p>{{comment.content}}</p>
-                            <p class="time">{{comment.create_dd | getDateDiff}}</p>
-                        </div>
-                    </a>
-                </ion-list>
-                <div class='obligate-item' ng-if="!loading"></div>
-            </ion-slide>
-            <ion-slide>
-                <ion-list>
-                    <div class="item item-avatar" ng-repeat="read in readData">
-                        <img ng-src="../../../img/panda.png" ng-click="showcardinfo({{read.user_id}})">
-                        <div>
-                            <span>{{read.user__username}}</span>
-                            <p>{{read.user__usr__degree}}</p>
-                        </div>
-                    </div>
-                </ion-list>
-                <div class='obligate-item' ng-if="!loading"></div>
-            </ion-slide>
-            <ion-slide>
-                <!--<button ng-if="unreadData.lenght != 0" class="button button-outline button-energized notice-details-warn">提醒未看成员</button>-->
-                <ion-list>
-                    <div class="item item-avatar" ng-repeat="unread in unreadData">
-                        <img ng-src="../../../img/panda.png" ng-click="showcardinfo({{unread.user_id}})">
-                        <div>
-                            <span>{{unread.user__username}}</span>
-                            <p>{{unread.user__usr__degree}}</p>
-                        </div>
-                    </div>
-                </ion-list>
-                <div class='obligate-item' ng-if="!loading"></div>
-            </ion-slide>
-        </ion-slide-box>
-    </ion-content>
-    <ion-footer-bar keyboard-attach class="bar-stable" ng-if="!loading">
-        <div class="bar bar-footer item-input-inset">
-            <!--<button ng-click="addhappy()" class="button button-clear">
-                <i class="icon ion-android-happy clear"></i>
-            </button>-->
-            <label class="item-input-wrapper radius-30">
-                <input type="text" ng-model="data.content" placeholder="添加评论">
-            </label>
-            <button class="button button-positive" ng-disabled="data.content == '' || data.content == null" ng-click="sendComment()">发送</button>
-        </div>
-    </ion-footer-bar>
-    <script id="templates/detiilsmenu.html" type="text/ng-template">
-        <ion-popover-view class="details-popup">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="result()">统计结果</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="edit()">编辑</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="deleteNotice()">删除</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 25
www/apps/notice/templates/notice-posted.html

@@ -1,25 +0,0 @@
-<ion-view view-title="发布的公告">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toadd()" ng-show="createstate==1">
-            <i class="icon ion-android-add"></i>
-        </button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div ng-if="!loading">
-            <div class="list">
-                <div class="item item-avatar item-icon-right" ng-repeat="data in Notice" ng-click="todetails(data.id)">
-                    <img ng-src="../../../img/panda.png" ng-click="showcardinfo({{data.usrid.id}})">
-                    <span>{{data.title}}</span>
-                    <p>{{data.content}}</p>
-                    <p>{{data.update_dd == null ? data.create_dd : data.update_dd | date:'MM-dd'}}&nbsp;
-                        <span ng-hide="(data.readtimes == 0 || data.readtimes == null) || (data.commenttimes == 0 || data.commenttimes == null)">|</span>&nbsp;
-                        <span ng-hide="data.readtimes == 0 || data.readtimes == null">{{data.readtimes}}看</span>&nbsp;
-                        <span ng-hide="data.commenttimes == 0 || data.commenttimes == null">{{data.commenttimes}}评</span>
-                    </p>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </div>
-            </div>
-        </div>
-    </ion-content>
-</ion-view>

+ 0 - 69
www/apps/notice/templates/notice-result.html

@@ -1,69 +0,0 @@
-<ion-view view-title="统计结果">
-    <ion-content>
-        <!--反馈-->
-        <div ng-if="details.back_title != null && type == 0">
-            <div class="item item-divider">
-                <span class="notice-result-title">反馈统计</span>
-            </div>
-            <div class="item item-text-wrap">
-                <span>{{details.back_title}}</span>
-            </div>
-            <div class="item item-icon-right" ng-click="toResultDetails(3)">
-                <span>已反馈</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-                <span class="item-note">{{countData.backed}}人({{ countData.backed / (countData.backed + countData.unback + countData.backgiveup) | percentage }})</span>
-            </div>
-            <div class="item item-icon-right" ng-click="countData.unback != 0 ? toResultDetails(2) : null">
-                <span>未反馈</span>
-                <i class="icon ion-chevron-right icon-accessory" ng-if="countData.unback != 0"></i>
-                <span class="item-note">{{countData.unback}}人({{ countData.unback / (countData.backed + countData.unback + countData.backgiveup) | percentage }})</span>
-            </div>
-            <div class="item item-icon-right" ng-if="countData.backgiveup != 0" ng-click="toResultDetails(4)">
-                <span>放弃反馈</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-                <span class="item-note">{{countData.backgiveup}}人({{ countData.backgiveup / (countData.backed + countData.unback + countData.backgiveup) | percentage }})</span>
-            </div>
-        </div>
-        <!--投票-->
-        <div ng-if="details.vote_title != null">
-            <div class="item item-divider">
-                <span class="notice-result-title">投票统计{{details.vote_selecttype == 1 ? '(单选)' : '(多选)'}}</span>
-            </div>
-            <div class="item item-text-wrap">
-                <span>投票标题</span>
-                <span class="item-note">{{details.vote_title}}</span>
-            </div>
-            <div class="item item-icon-right" ng-repeat="item in selectData track by $index" ng-click="type == 0 ? toResultDetails(7,[$index]) : null">
-                <span>{{item}}</span>
-                <i class="icon ion-chevron-right icon-accessory" ng-if="type == 0"></i>
-                <span class="item-note">{{countData.votecount[$index]}}人({{ countData.votecount[$index] / usrvotecount | percentage }})</span>
-            </div>
-            <div class="item item-icon-right" ng-click="countData.unvote != 0 && type == 0 ? toResultDetails(5) : null">
-                <span>未投票</span>
-                <i class="icon ion-chevron-right icon-accessory" ng-if="countData.unvote != 0 && type == 0"></i>
-                <span class="item-note">{{countData.unvote}}人({{ countData.unvote / usrvotecount | percentage }})</span>
-            </div>
-            <div class="item item-icon-right" ng-if="countData.votegiveup != 0" ng-click="type == 0 ? toResultDetails(6) : null">
-                <span>放弃投票</span>
-                <i class="icon ion-chevron-right icon-accessory" ng-if="type == 0"></i>
-                <span class="item-note">{{countData.votegiveup}}人({{ countData.votegiveup / usrvotecount | percentage }})</span>
-            </div>
-        </div>
-        <!--阅读-->
-        <div ng-if="type == 0">
-            <div class="item item-divider">
-                <span class="notice-result-title">阅读统计</span>
-            </div>
-            <div class="item item-icon-right" ng-click="toResultDetails(1)">
-                <span>已看</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-                <span class="item-note">{{countData.readed}}人({{ countData.readed / (countData.readed + countData.unread) | percentage }})</span>
-            </div>
-            <div class="item item-icon-right" ng-click="toResultDetails(0)">
-                <span>未看</span>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-                <span class="item-note">{{countData.unread}}人({{ countData.unread / (countData.readed + countData.unread) | percentage }})</span>
-            </div>
-        </div>
-    </ion-content>
-</ion-view>

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

@@ -1,36 +0,0 @@
-<ion-view view-title="公告">
-    <ion-nav-buttons side="left">
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="goBack()">&nbsp;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toper()" ng-if="roleid==1">权限&nbsp;&nbsp;</button>
-        <button class="button button-clear" ng-click="toadd()" ng-show="createstate==1">
-            <i class="icon ion-android-add"></i>
-        </button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <a class="item item-icon-right" href="#/notice-posted">发布的公告
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider">收到的公告</div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div ng-if="!loading">
-            <div class="list">
-                <div class="item item-avatar item-icon-right" ng-repeat="data in Notice.results" ng-click="todetails(data.id)">
-                    <img ng-src="../../../img/panda.png" ng-click="showcardinfo(data.usrid.id)">
-                    <span>{{data.title}}</span>
-                    <p>{{data.content}}</p>
-                    <p>{{data.update_dd == null ? data.create_dd : data.update_dd | date:'MM-dd'}}&nbsp;
-                        <span ng-hide="(data.readtimes == 0 || data.readtimes == null) || (data.commenttimes == 0 || data.commenttimes == null)">|</span>&nbsp;
-                        <span ng-hide="data.readtimes == 0 || data.readtimes == null">{{data.readtimes}}看</span>&nbsp;
-                        <span ng-hide="data.commenttimes == 0 || data.commenttimes == null">{{data.commenttimes}}评</span>
-                    </p>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </div>
-            </div>
-        </div>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <h4 class="stable center" ng-show="Notice&& Notice.next == null&&Notice.results.length>=10">没有更多了</h4>
-    </ion-content>
-</ion-view>

+ 0 - 53
www/apps/notice/templates/postnotice.html

@@ -1,53 +0,0 @@
-<ion-view hide-back-button="true">
-    <ion-nav-title>{{isNew?'发布通知':'编辑通知'}}</ion-nav-title>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click='ok("notice");'>完成</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click='cancel("notice");'>取消</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="list notice-input">
-            <label class="item item-input" ng-click="toselect();">
-                <span class="input-label">发送:</span>
-                <span for="" class='notice-resvicename item-text-wrap'>{{usernames}}</span>
-            </label>
-            <div class="row input-btn-row">
-                <div class="col col-67">
-                    <label class="item item-input" ng-click="test($event)">
-                        <span class="input-label">标题:</span>
-                        <input type="text" placeholder="输入标题" ng-model="noticedata.title" focus-me=true>
-                    </label>
-                </div>
-                <div class="col col-35">
-                    <button class="button button-energized" ng-class="{true:'',false:'button-outline'}[noticedata.setbtnstyle.vote]" ng-click="set_voteback('vote',$event)">
-                        投票
-                    </button>
-                </div>
-                <div class="col col-35">
-                    <button class="button button-energized" ng-class="{true:'',false:'button-outline'}[noticedata.setbtnstyle.back]" ng-click="set_voteback('back',$event)">
-                        反馈
-                    </button>
-                </div>
-            </div>
-            <div class="comment-box notice-content">
-                <div ng-if="noticedata.address!=null" class="div-address"><i class="ion-ios-location"></i>{{noticedata.address}}</div>
-                <textarea placeholder="输入内容..." ng-model="noticedata.content"></textarea>
-                <div class="row row-wrap">
-                    <div  ng-repeat="image in noticedata.noticefiles">
-                        <img ng-src={{image.file_thumbnail_path}} ng-click="shouBigImage(image.file_full_path)" class="img-popver-pad"/>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </ion-content>
-    <div class="bar bar-footer postnotice-footer">
-        <div class="notice-first-ion" ng-click="Camera();"><i class="ion-android-camera" style=""></i></div>
-        <div class="notice-right-ion" ng-click="imagePicker();"><i class="ion-android-image"></i></div>
-        <div class="notice-right-ion" ng-click="getaddress();"><i class="ion-ios-location"></i></div>
-    </div>
-    <div ng-show="commons.bigImage" class="popover-backdrop1">
-        <img class="fullscreen-image" ng-click="hideBigImage()" ng-src="{{Url}}" ng-pinch-zoom/>
-        <i class="ion-ios-trash-outline" ng-click="deleteimage();"></i>
-    </div>
-</ion-view>

+ 0 - 46
www/apps/notice/templates/power-set.html

@@ -1,46 +0,0 @@
-<ion-view view-title="权限设置">
-    <ion-nav-buttons style="border:none" side="right">
-        <button class="button button-icon ion-ios-more" ng-if="isshowdelete.showDelete!=true && !loading" ng-click="popover.show($event)"></button>
-        <button class="button button-clear" ng-if="isshowdelete.showDelete && !loading" ng-click="ok();">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider dividercolor">允许发通知的成员</div>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-list ng-if="!loading">
-            <ion-item class="rj-contacts-item">
-                <div ng-repeat="result in resultdata  track by $index">
-                    <div class="rj-contacts-index-bar item-remove-animate" id="index_{{result.sortchar}}">{{result.sortchar}}</div>
-                    <ion-list class="rj-list item-icon-right">
-                        <ion-item class="rj-item item-remove-animate" ng-repeat="person in result.persons track by $index">
-                            <div class="rj-contacts-pic">
-                                <img src="../../../img/panda.png">
-                            </div>
-                            <i ng-if="isshowdelete.showDelete" ng-click="removeItem(person.nid,result.sortchar);" class="icon ion-android-remove-circle" style="color:red;"></i>
-                            <h2>{{person.username}}</h2>
-                        </ion-item>
-                    </ion-list>
-                </div>
-            </ion-item>
-            <ion-item class="item-border">
-            </ion-item>
-        </ion-list>
-    </ion-content>
-    <div class="rj-contacts-right-bar" rj-position-middle on-drag="contacts_right_bar_swipe($event)">
-        <div>&uarr;</div>
-        <div>☆</div>
-        <div ng-repeat="char in sortchars" ng-click="sortByChar(char,'index_{{char}}')">{{char}}</div>
-    </div>
-    <div class="rj-contacts-middle-bar" ng-show="Isshowmiddle">
-        {{sortchar}}
-    </div>
-    <script id="templates/add.html" type="text/ng-template">
-        <ion-popover-view class="popver_view">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="toadd();">添加成员</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="displayremove();">移除成员</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 18
www/apps/notice/templates/result-details.html

@@ -1,18 +0,0 @@
-<ion-view view-title="{{titleArr[type]}}{{countDetails.usrCountList.length}}人">
-    <!--<ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="towarn()">提醒</button>
-    </ion-nav-buttons>-->
-    <ion-content>
-        <div class="item item-energized item-text-wrap" ng-if="type == 7">
-            <span>{{countDetails.selectItem}}</span>
-        </div>
-        <ion-list>
-            <div class="item item-avatar" ng-repeat="item in countDetails.usrCountList">
-                <img src="../../../img/cat.png" ng-click="showcardinfo({{item.user_id}})"/>
-                <span>{{item.username}}</span>
-                <p>{{item.degree}}</p>
-                <p>{{item.content}}</p>
-            </div>
-        </ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 54
www/apps/pay/index.html

@@ -1,54 +0,0 @@
-<!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/chineseTopinyin.js"></script>
-
-    <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>
-

+ 0 - 1593
www/apps/pay/js/controllers.js

@@ -1,1593 +0,0 @@
-starter.controller('PayCtrl', function ($rootScope, $scope, $state, $ionicPopover, global, Member, Pay, Tool) {
-    beforeEnter = $scope.$on("$ionicView.beforeEnter", function (event, data) {
-        global.fetch_user().then(function () {
-            if ($scope.recordlist == undefined) getpaydata();
-            set_step_data();
-        });
-    });
-
-    Member.selectedemplst = [];
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.toman = function () {
-        $state.go('payman');
-    };
-
-    $scope.torecord = function (record) {
-        if (record) {
-            Pay.recordItem = _.clone(record);
-            $state.go('pay-record', {
-                id: record.id
-            });
-        } else {
-            $scope.popover.hide();
-            $state.go('pay-record', {
-                id: -1
-            });
-        }
-    };
-
-    $scope.addpaybill = function () {
-        $scope.popover.hide();
-        $state.go('pay-bill', {
-            type: 0,
-            id: -1
-        })
-    };
-
-    $scope.toauditstep = function () {
-        $scope.popover.hide();
-        Member.customerop = null;
-        if ($scope.is_have_step) {
-            $state.go('auditstep', {
-                "id": 0
-            });
-        } else {
-            Member.selectedemplst.push({
-                "user_id": global.user.usrid,
-                "username": global.user.usrname
-            });
-            Member.dialogresult = 1;
-            Member.customerop = 1;
-            $state.go('auditstep', {
-                "id": -1
-            });
-        }
-    };
-
-    $ionicPopover.fromTemplateUrl('templates/paymenu.html', {
-        scope: $scope
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpaydata();
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.recordlist != undefined && $scope.recordlist.next != null) {
-            Tool.get($scope.recordlist.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.recordlist.results.push(item);
-                });
-                $scope.recordlist.next = data.next;
-                $scope.recordlist.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    };
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.recordlist != undefined && $scope.recordlist.next != null;
-    };
-
-    function getpaydata() {
-        if (global.user.token != "") {
-            if ($scope.recordlist == undefined) {
-                $scope.loading = true;
-            }
-            Pay.record.get(function (res) {
-                Pay.recordList = _.clone(res.results);
-                $scope.recordlist = res;
-                $scope.roleid = global.user.roleid;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    PayRecordDoRefresh = $rootScope.$on('PayRecordDoRefresh', function (event, data) {
-        getpaydata();
-    });
-
-    $scope.is_have_step = false;
-
-    function set_step_data() {
-        Pay.auditstep.query({"userid": global.user.usrid}, function (data) {
-            Pay.personstepdata = data;
-            $scope.is_have_step = data.length > 0;
-        }, function (err) {
-            alert(JSON.stringify(err));
-        })
-    }
-
-    $scope.$on("$destroy", function () {
-        PayRecordDoRefresh();
-        Pay.auditstepdata = [];
-        $scope.popover.remove();
-    });
-})
-
-.controller('TypeSetCtrl', function ($rootScope, $scope, $state, $ionicHistory, global, showPopup, Pay, Tool) {
-    $scope.ordering = false;
-    global.fetch_user().then(function () {
-        gettypedata();
-    });
-
-    $scope.toaddtype = function () {
-        $state.go("addtype", {
-            "id": -1
-        });
-    };
-
-    $scope.toedittype = function (item) {
-        Pay.typeItem = _.clone(item);
-        $state.go("addtype", {
-            "id": item.id
-        });
-    };
-
-    $scope.reorderItem = function (item, fromIndex, toIndex) {
-        $scope.types.splice(fromIndex, 1);
-        $scope.types.splice(toIndex, 0, item);
-    };
-
-    $scope.ok = function () {
-        $scope.ordering = !$scope.ordering;
-        if (!$scope.ordering) {
-            var data = [];
-            for (var i = 0; i < $scope.types.length; i++) {
-                data.push({
-                    'id': $scope.types[i].id,
-                    'ordering': i
-                });
-            }
-            Pay.type.patch(data, function (data) {
-                $scope.doRefresh();
-            })
-        }
-    };
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        gettypedata();
-    }
-
-    function gettypedata() {
-        if (global.user.token != "") {
-            if ($scope.types == undefined) {
-                $scope.loading = true;
-            }
-            Pay.type.get(function (res) {
-                $scope.types = res;
-                Pay.typeList = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    PayTypeDoRefresh = $rootScope.$on('PayTypeDoRefresh', function (event, data) {
-        gettypedata();
-    });
-
-    $scope.$on("$destroy", function () {
-        PayTypeDoRefresh();
-    });
-})
-
-.controller('AuditStepSetCtrl', function ($rootScope, $scope, $state, $ionicPopover, $timeout, $location, $ionicScrollDelegate, $ionicHistory, global, showPopup, Member, Pay) {
-    $ionicPopover.fromTemplateUrl('templates/add.html', {
-        scope: $scope
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        getPayStepMflist();
-    });
-
-    $scope.sortchars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#'];
-    $scope.sortchar = 'A';
-    $scope.is_show_middle = false;
-    $scope.is_show_delete = false;
-
-    $scope.sortByChar = function (char, id) {
-        $scope.sortchar = char;
-        $scope.is_show_middle = true;
-        $location.hash(id);
-        $ionicScrollDelegate.anchorScroll();
-        $timeout(function () {
-            $scope.is_show_middle = false;
-        }, 200);
-    };
-
-    $scope.displayremove = function () {
-        $scope.is_show_delete = !$scope.is_show_delete;
-        $scope.popover.hide();
-    };
-
-    $scope.ok = function () {
-        $scope.popover.hide();
-        $scope.is_show_delete = false;
-        var data = {"U": [], "D": delete_data, "C": []};
-        if (delete_data.length > 0) {
-            Pay.auditstep.patch(data, function (data) {
-                console.log(data);
-            }, function (err) {
-                // alert('delete error');
-            }).$promise.finally(function (f) {
-                delete_data = [];
-            });
-            Pay.auditstepdata = _.filter(Pay.auditstepdata, function (item) {
-                return !_.contains(delete_data, item.id);
-            });
-        }
-    };
-
-    $scope.toadd = function () {
-        Member.resourcemember = [];
-        Member.selectedemplst = [];
-        Member.disabled = true;
-        Member.resourcemember = _.map(_.pluck(Pay.auditstepdata, 'create_user'), function (m) {
-            return {"user_id": m.id, "username": m.username};
-        });
-        Member.showall = false;
-        Member.showgroup = false;
-        Member.customerop = 1;
-        Member.titlename = "选择添加的成员";
-        Member.routename = "auditstep";
-        Member.routeparams = {
-            "id": -1
-        };
-
-        $scope.popover.hide();
-        $state.go('selectmember');
-    };
-
-    var delete_data = [];
-    $scope.removeItem = function (user, _char) {
-        var ids = _.pluck(_.filter(Pay.auditstepdata, function (item) {
-            return item.create_user.id == user.id;
-        }), 'id');
-        delete_data = delete_data.concat(ids);
-        for (var i = 0; i < $scope.resultdata.length; i++) {
-            if ($scope.resultdata[i].sortchar == _char) {
-                for (var j = 0; j < $scope.resultdata[i].persons.length; j++) {
-                    if ($scope.resultdata[i].persons[j].emp.id == user.id) {
-                        $scope.resultdata[i].persons.splice(j, 1);
-                        if ($scope.resultdata[i].persons.length == 0) {
-                            $scope.resultdata.splice(i, 1);
-                        }
-                        break;
-                    }
-                }
-                break;
-            }
-        }
-    };
-
-    $scope.toedit = function (usrid) {
-        Member.customerop = null;
-        $state.go('auditstep', {
-            "id": usrid
-        });
-    };
-
-    $scope.doRefresh = function () {
-        getPayStepMflist();
-    };
-
-    function getPayStepMflist() {
-        if ($scope.resultdata == undefined) {
-            showPopup.showLoading(1, '正在加载', false);
-        }
-        Pay.auditstep.query(function (data) {
-            Pay.auditstepdata = angular.copy(data);
-            $scope.resultdata = [];
-            var chars = _.map(data, function (item) {
-                return _.indexOf($scope.sortchars, getCamelChar(item.create_user.username)) >= 0 ? getCamelChar(item.create_user.username) : '#';
-            });
-            chars = _.sortBy(_.uniq(chars));
-            for (var i = 0; i < chars.length; i++) {
-                var d = {
-                    "sortchar": chars[i],
-                    "persons": []
-                };
-                var users = _.map(_.uniq(_.map(_.pluck(data, 'create_user'), JSON.stringify)), JSON.parse);
-                for (var j = 0; j < users.length; j++) {
-                    var char = _.indexOf($scope.sortchars, getCamelChar(users[j].username)) >= 0 ? getCamelChar(users[j].username) : '#';
-                    if (char == chars[i]) {
-                        var p = {"emp": users[j], "checknames": ""};
-                        var steps = _.sortBy(_.filter(data, function (v) {
-                            return v.create_user.id == users[j].id && !v.is_teller;
-                        }), 'ordering');
-                        var newsteps = steps.length > 3 ? steps.slice(0, 3) : steps;
-                        p.checknames = _.pluck(_.pluck(newsteps, 'verifier'), 'username').join('→');
-                        if (steps.length > 3) p.checknames += '...';
-                        d.persons.push(p)
-                    }
-                }
-                $scope.resultdata.push(d);
-            }
-            var index = _.pluck($scope.resultdata, 'sortchar').indexOf('#');
-            if (index >= 0) {
-                var item = $scope.resultdata[index];
-                $scope.resultdata.splice(index, 1);
-                $scope.resultdata.push(item);
-            }
-            showPopup.hideLoading();
-        }, function (err) {
-            showPopup.hideLoading();
-        }).$promise.finally(function (f) {
-            $scope.$broadcast('scroll.refreshComplete');
-        });
-    }
-
-    function getCamelChar(str) {
-        return pinyin.getCamelChars(str).toUpperCase().charAt(0)
-    }
-})
-
-.controller('AddTypeCtrl', function ($rootScope, $scope, $state, $ionicHistory, global, showPopup, Pay, Tool) {
-    var icon = {icon: null}, iconcolor = null, isModified = false;
-    $scope.typeid = $state.params['id'];
-    $scope.title = $scope.typeid > 0 ? '编辑' : '添加';
-    $scope.data = {
-        "name": "",
-        "icon": "",
-        "icon_color": "",
-        "ordering": 0
-    };
-    $scope.iconcolordata = [{
-        'background': "#FCB232",
-        'isacitve': false
-    }, {
-        'background': "#F89E79",
-        'isacitve': false
-    }, {
-        'background': "#FB7B7A",
-        'isacitve': false
-    }, {
-        'background': "#F393C3",
-        'isacitve': false
-    }, {
-        'background': "#DF9FF3",
-        'isacitve': false
-    }, {
-        'background': "#C08CCE",
-        'isacitve': false
-    }, {
-        'background': "#609BF5",
-        'isacitve': false
-    }, {
-        'background': "#4BB1FB",
-        'isacitve': false
-    }, {
-        'background': "#89cff0",
-        'isacitve': false
-    }, {
-        'background': "#68D3C9",
-        'isacitve': false
-    }, {
-        'background': "#87CC79",
-        'isacitve': false
-    }, {
-        'background': "#4AD592",
-        'isacitve': false
-    }, {
-        'background': "#C8BEBD",
-        'isacitve': false
-    }, {
-        'background': "#CBA7AB",
-        'isacitve': false
-    }, {
-        'background': "#868CA6",
-        'isacitve': false
-    }, {
-        'background': "#8299CF",
-        'isacitve': false
-    }, {
-        'background': "#A0C7E6",
-        'isacitve': false
-    }, {
-        'background': "#90B1B6",
-        'isacitve': false
-    }];
-
-    $scope.icondata = [{
-        'background': "#fff",
-        'icon': "ion-android-bus",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-cart",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-telephone",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-home",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-fork",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "icon-money",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-android-film",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-umbrella",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-game-controller-b",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-android-print",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-tshirt",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-medkit",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-outlet",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-android-bicycle",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-pulse-strong",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-trophy",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-android-favorite",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-ios-cloud-download",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-plane",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-android-bar",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-nuclear",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-film-marker",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-icecream",
-        'isacitve': false
-    }, {
-        'background': "#fff",
-        'icon': "ion-flag",
-        'isacitve': false
-    }];
-
-    global.fetch_user().then(function () {
-        if ($scope.typeid > 0) {
-            $scope.data = angular.copy(Pay.typeItem);
-            iconcolor = _.find($scope.iconcolordata, function (item) {
-                if (item.background == $scope.data.icon_color) {
-                    item.isacitve = true;
-                    return item;
-                }
-            });
-            iconcolor = iconcolor.background;
-            icon = _.find($scope.icondata, function (item) {
-                if (item.icon == $scope.data.icon) {
-                    item.isacitve = true;
-                    item.background = $scope.data.icon_color;
-                    return item;
-                }
-            });
-        } else {
-            $scope.data.ordering = Pay.typeList.length;
-            $scope.iconcolordata[0].isacitve = true;
-            $scope.icondata[0].background = '#FCB232';
-            $scope.icondata[0].isacitve = true;
-            iconcolor = $scope.iconcolordata[0].background;
-            icon.icon = $scope.icondata[0].icon;
-        }
-    });
-
-    if ($scope.typeid > 0) {
-        watch = $scope.$watch('data', function (n, o) {
-            if (n == o)
-                return;
-            isModified = true;
-        }, true);
-    }
-
-    $scope.selecticon = function (iconitem) {
-        _.find($scope.icondata, function (item) {
-            if (item.isacitve) {
-                item.isacitve = false;
-                item.background = '#fff';
-                return item;
-            }
-        });
-        iconitem.isacitve = true;
-        iconitem.background = iconcolor;
-        icon = iconitem;
-    };
-
-    $scope.selectcolor = function (coloritem) {
-        _.find($scope.iconcolordata, function (item) {
-            if (item.isacitve) {
-                item.isacitve = false;
-                return item;
-            }
-        });
-        coloritem.isacitve = true;
-        icon.background = coloritem.background;
-        iconcolor = coloritem.background;
-    };
-
-    $scope.ok = function () {
-        if ($scope.data.name == "") {
-            return showPopup.PopupWindow(0, '类型名称不能为空!');
-        }
-        $scope.data.icon = icon.icon;
-        $scope.data.icon_color = iconcolor;
-        var type = null;
-        if ($scope.typeid > 0) {
-            if (isModified) {
-                type = _.find(Pay.typeList, function (item) {
-                    if (item.id != $scope.typeid && item.name == $scope.data.name) {
-                        showPopup.PopupWindow(0, '类型名称不能重复!');
-                        return item;
-                    }
-                });
-                if (!type) {
-                    showPopup.showLoading(1, '正在上传');
-                    Pay.type.update($scope.data, function () {
-                        $scope.$emit('PayTypeDoRefresh');
-                        showPopup.hideLoading();
-                        $scope.back();
-                    });
-                }
-            } else {
-                $scope.back();
-            }
-        } else {
-            type = _.find(Pay.typeList, function (item) {
-                if (item.name == $scope.data.name) {
-                    showPopup.PopupWindow(0, '类型名称不能重复!');
-                    return item;
-                }
-            });
-            if (!type) {
-                showPopup.showLoading(1, '正在上传');
-                Pay.type.save($scope.data, function () {
-                    $scope.$emit('PayTypeDoRefresh');
-                    showPopup.hideLoading();
-                    $scope.back();
-                });
-            }
-        }
-    };
-
-    $scope.deltype = function () {
-        showPopup.confirm('确定删除该类型吗?', '确定', '取消').then(function (res) {
-            if (res) {
-                showPopup.showLoading(1, '正在删除');
-                Pay.type.delete({'id': $scope.typeid}, function () {
-                    $scope.$emit('PayTypeDoRefresh');
-                    showPopup.hideLoading();
-                    $scope.back();
-                });
-            }
-        });
-    };
-
-    $scope.back = function () {
-        $ionicHistory.goBack();
-    };
-
-    $scope.$on('$destroy', function () {
-        if ($scope.typeid > 0) {
-            watch();
-        }
-    })
-})
-
-.controller('AuditStepCtrl', function ($rootScope, $scope, $state, $ionicHistory, $timeout, global, Member, showPopup, Pay, Tool) {
-    $scope.create_users = [];
-    $scope.step_users = [];
-    $scope.teller = null;
-    $scope.op_id = 0;
-    var beforeEnter = $scope.$on("$ionicView.enter", function () {
-        $scope.op_id = $state.params['id'];
-        if ($scope.op_id != 0) Tool.removeBackView(['selectmember', 'selectsinglemember', 'auditstep']);
-        var back = $ionicHistory.backView();
-        if ($scope.op_id > 0) {
-            $scope.titlename = "编辑审批步骤";
-            if (Member.customerop == null) {
-                $scope.create_users = [_.find(Pay.auditstepdata, function (item) {
-                    return item.create_user.id == $scope.op_id;
-                }).create_user];
-                setusers(Pay.auditstepdata, $scope.op_id);
-            } else seteditdata();
-        } else if ($scope.op_id < 0) {
-            $scope.titlename = "添加审批步骤";
-            setdata();
-            if (back.stateName == 'pay' && Member.customerop == null && Pay.personstepdata.length > 0) setusers(Pay.personstepdata, Pay.personstepdata[0].create_user.id);
-        } else if ($scope.op_id == 0) { //修改当前登录人的审批步骤
-            $scope.titlename = "编辑审批步骤";
-            if (Member.customerop == null) {
-                if (Pay.personstepdata.length == 0) {
-                    Pay.auditstep.query({"userid": global.user.usrid}, function (data) {
-                        $scope.step_data = angular.copy(data);
-                        $scope.create_users.push({"id": global.user.usrid, "username": global.user.usrname});
-                        setusers(data, global.user.usrid);
-                    });
-                } else {
-                    $scope.create_users = [{"id": global.user.usrid, "username": global.user.usrname}];
-                    setusers(Pay.personstepdata, Pay.personstepdata[0].create_user.id);
-                }
-            } else setdata();
-            $scope.showbar = true;
-        }
-        $scope.is_current_user = (global.user.usrid == formatusers($scope.create_users)[0].user_id && back.stateName == "pay");
-    });
-
-    $scope.$on("$destroy", function () {
-        Pay.personstepdata = [];
-        Member.selectedemplst = [];
-        Member.unenabledata = [];
-        beforeEnter = null;
-    });
-
-    $scope.add_teller = function () {
-        set_member_option(false, $scope.teller == null ? [] : [$scope.teller], 3, "选择出纳人员", "selectsinglemember");
-    };
-
-    $scope.add_step_user = function () {
-        set_member_option(true, $scope.step_users, 2, "选择审批人", "selectsinglemember");
-    };
-
-    $scope.add_create_user = function () {
-        set_member_option(false, $scope.create_users, 1, "选择添加的成员", "selectmember");
-        Member.unenabledata = formatusers(_.pluck(Pay.auditstepdata, "create_user"));
-    };
-
-    $scope.ok = function () {
-        if ($scope.step_users.length == 0) {
-            showPopup.PopupWindow(0, "请选择审批人!", false);
-            return;
-        }
-        if ($scope.teller == null) {
-            showPopup.PopupWindow(0, "请选择出纳人!", false);
-            return;
-        }
-        showPopup.showLoading(1, '正在提交', false);
-        if ($scope.op_id >= 0) {//edit
-            Pay.auditstep.patch({"C": [], "D": [], "U": get_upload_data()}, function (data) {
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            }, function (err) {
-                showPopup.hideLoading();
-                // alert(JSON.stringify(err))
-                $ionicHistory.goBack();
-            })
-        } else if ($scope.op_id < 0) { //add
-            Pay.auditstep.save(get_upload_data(), function (data) {
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            }, function (err) {
-                alert(JSON.stringify(err));
-            })
-        }
-    };
-
-    $scope.goback = function () {
-        $ionicHistory.goBack();
-    };
-
-    $scope.toSeeList = function () {
-        $state.go("seestepmflist");
-    };
-
-    function set_member_option(is_disabled, data, op, titlename, route) {
-        Member.selectedemplst = [];
-        Member.disabled = is_disabled;
-        Member.resourcemember = formatusers(data);
-        Member.customerop = op;
-        Member.titlename = titlename;
-        $state.go(route);
-    }
-
-    function seteditdata() {
-        $scope.titlename = "编辑审批步骤";
-        if (Member.customerop == null) $scope.create_users = Member.selectedemplst;
-        setdata();
-    }
-
-    function setdata() {
-        if (Member.customerop == 1) { //申请
-            if (Member.dialogresult == 1) $scope.create_users = Member.selectedemplst;
-        } else if (Member.customerop == 2) { //审核
-            if (Member.selectedemplst.length > 0) $scope.step_users.push(Member.selectedemplst[0])
-        } else if (Member.customerop == 3) {//出纳
-            if (Member.selectedemplst.length > 0) $scope.teller = Member.selectedemplst[0]
-        }
-    }
-
-    function get_upload_data() {
-        var data = [];
-        _.each($scope.create_users, function (c_user) {
-            data = data.concat(_.map($scope.step_users, function (s_user, index) {
-                return {"create_user": getuserid(c_user), "verifier": getuserid(s_user), "is_teller": false, "ordering": index + 1};
-            }));
-            data.push({"create_user": getuserid(c_user), "verifier": getuserid($scope.teller), "is_teller": true, "ordering": $scope.step_users.length + 1})
-        });
-        return data;
-    }
-
-    function getuserid(user) {
-        return _.has(user, 'id') ? user.id : user.user_id;
-    }
-
-    function setusers(data, userid) {
-        $scope.step_users = _.pluck(_.sortBy(_.filter(data, function (item) {
-            return item.create_user.id == userid && !item.is_teller;
-        }), "ordering"), 'verifier');
-        $scope.teller = _.find(data, function (item) {
-            return item.create_user.id == userid && item.is_teller;
-        }).verifier;
-    }
-
-    function formatusers(data) {
-        return _.map(data, function (item) {
-            return {"user_id": _.has(item, 'id') ? item.id : item.user_id, "username": item.username}
-        })
-    }
-})
-
-.controller('SeeStepMfListCtrl', function ($rootScope, $scope, $state, $ionicHistory, $cordovaDatePicker, $timeout, global, Pay, Member, showPopup) {
-    doRefresh();
-    $scope.usestep = function (step) {
-        Member.customerop = null;
-        Pay.personstepdata = _.filter($scope.step_data_copy, function (item) {
-            return item.create_user.id == step.create_user.id;
-        });
-        $ionicHistory.goBack();
-    };
-
-    $scope.doRefresh = function () {
-        doRefresh();
-    };
-
-    function doRefresh() {
-        if ($scope.step_datas == undefined) showPopup.showLoading(1, '正在加载', false);
-        Pay.auditstep.query(function (data) {
-            $scope.step_datas = [];
-            $scope.step_data_copy = angular.copy(data);
-            var users = _.map(_.uniq(_.map(_.pluck(data, 'create_user'), JSON.stringify)), JSON.parse);
-            _.each(users, function (user) {
-                if (user.id != global.user.usrid) {
-                    var step_users = _.pluck(_.sortBy(_.filter(data, function (item) {
-                        return item.create_user.id == user.id && !item.is_teller;
-                    }), 'ordering'), 'verifier');
-                    var step_usernames = _.pluck(step_users, 'username').join('→');
-                    var teller = _.find(data, function (item) {
-                        return item.create_user.id == user.id && item.is_teller;
-                    }).verifier;
-                    $scope.step_datas.push({"create_user": user, "step_users": step_users, "teller": teller, "step_usernames": step_usernames})
-                }
-            })
-        }, function (err) {
-            showPopup.hideLoading();
-            alert(JSON.stringify(err));
-        }).$promise.finally(function () {
-            $scope.$broadcast('scroll.refreshComplete');
-            showPopup.hideLoading();
-        });
-    }
-
-    $scope.goback = function () {
-        $ionicHistory.goBack();
-    };
-})
-
-.controller('PayRecordCtrl', function ($rootScope, $scope, $state, $cordovaDatePicker, $timeout, $ionicModal, $ionicHistory, $q, ImageManage, global, showPopup, Pay, Tool) {
-    showPopup.modalTemplate('templates/modal-paytype.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.select_pay_type = modal;
-    });
-    $scope.recordid = $state.params['id'];
-    $scope.titleArr = ['新建', '编辑'];
-    $scope.popup = {
-        isPopup: false
-    };
-    $scope.record = {
-        "amount": null,
-        "pay_type": null,
-        "type_modal": null,
-        "spend_date": null,
-        "description": null,
-        "files": []
-    };
-    var isModified = false;
-
-    Pay.type.get(function (res) {
-        $scope.types = res;
-        Pay.typeList = res;
-        _.each($scope.types, function (type) {
-            type.color = {
-                'color': type.icon_color
-            };
-            type.selected = false;
-        });
-    }, function (err) {
-        alert(JSON.stringify(err));
-    });
-
-    if ($scope.recordid > 0) {
-        $scope.record = angular.copy(Pay.recordItem);
-        $scope.record.amount = parseFloat($scope.record.amount);
-    }
-
-    $scope.ok = function () {
-        if ($scope.record.amount == null) {
-            showPopup.PopupWindow(0, "请填写金额", false);
-            return
-        } else if ($scope.record.type_modal == null) {
-            showPopup.PopupWindow(0, "请选择消费类型", false);
-            return
-        } else if ($scope.record.spend_date == null) {
-            showPopup.PopupWindow(0, "请选择消费日期", false);
-            return
-        }
-        showPopup.showLoading(1, '正在提交', true);
-        if ($scope.record.description == null || $scope.record.description == '')
-            $scope.record.description = $scope.record.type_modal.name;
-        if ($scope.recordid > 0) {
-            if (isModified) {
-                Pay.record.update($scope.record, function () {
-                    _.each($scope.deleteimage_list, function (imageID) {
-                        Pay.recordfile.delete({id: imageID});
-                    });
-                    var imagefiles = [];
-                    _.each($scope.record.files, function (image) {
-                        if (!image.id)
-                            imagefiles.push(image.file_full_path);
-                    });
-                    postimg(imagefiles, $scope.recordid);
-                });
-            }
-        } else {
-            Pay.record.save($scope.record, function (data) {
-                var imagefiles = [];
-                _.each($scope.record.files, function (image) {
-                    if (!image.id)
-                        imagefiles.push(image.file_full_path);
-                });
-                postimg(imagefiles, data.id);
-            }, function (err) {
-                alert('post Record error' + err);
-            });
-        }
-    }
-
-    $scope.selectSpendDate = function (spend_date) {
-        var options = {
-            mode: 'date',
-            date: spend_date ? new Date(spend_date) : new Date(),
-            androidTheme: 3
-        };
-        $cordovaDatePicker.show(options).then(function (date) {
-            if (date == undefined) return;
-            $scope.record.spend_date = date;
-        });
-    }
-
-    $scope.selectPayType = function () {
-        $scope.select_pay_type.show();
-        $rootScope.commons.modal = $scope.select_pay_type;
-    }
-
-
-    $scope.cancel = function (op) {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.checkType = function (type) {
-        $scope.pay_type = type.id;
-        $scope.record.type_modal = type;
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.deleteRecord = function () {
-        showPopup.confirm("是否删除该消费记录?", '是', '否').then(function (res) {
-            if (res) {
-                Pay.record.delete({id: $scope.recordid}, function () {
-                    $scope.$emit('PayRecordDoRefresh');
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.addphoto = function () {
-        if ($scope.record.files.length < 5) {
-            $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-            $scope.popup.isPopup = true;
-        } else {
-            showPopup.PopupWindow(0, "上传图片数量需小于等于5!", false);
-        }
-    };
-
-    var ImagePicker = function () { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount - $scope.record.files.length).then(function (data) {
-            $q.all(data).then(function (res) {
-                console.log(res);
-                $scope.record.files = $scope.record.files.concat(_.map(res, function (value) {
-                    return {"file_thumbnail_path": value, "file_full_path": value};
-                }));
-            }, function (error) {
-                alert(error);
-            });
-        });
-    };
-
-    var Camera = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture(true).then(function (result) {
-            $scope.record.files.push({
-                "file_thumbnail_path": result,
-                "file_full_path": result
-            });
-        });
-    };
-
-    function postimg(imgfiles, id) {
-        if (imgfiles.length > 0) {
-            ImageManage.uploadImage(imgfiles, 'pay', id, 'payrecordfile').then(function (res) {
-                $q.all(res).then(function (data) {
-                    $scope.$emit('PayRecordDoRefresh');
-                    showPopup.hideLoading();
-                    $ionicHistory.goBack();
-                })
-            }, function (err) {
-                alert(JSON.stringify(error));
-                showPopup.PopupWindow(0, 'upload image fail');
-            })
-        } else {
-            $scope.$emit('PayRecordDoRefresh');
-            showPopup.hideLoading();
-            $ionicHistory.goBack();
-        }
-    }
-
-    $scope.deleteimage_list = [];
-    $scope.shouBigImage = function (imageUrl) {
-        $scope.Url = imageUrl;
-        $rootScope.commons.bigImage = true;
-    };
-
-    $rootScope.commons.bigImage = false;
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.deleteimage = function () {
-        var img = _.find($scope.record.files, function (image) {
-            return image.file_full_path == $scope.Url;
-        });
-        if (img) {
-            $scope.record.files.splice(_.indexOf($scope.record.files, img), 1);
-            if (img.id)
-                $scope.deleteimage_list.push(img.id);
-        }
-        $rootScope.commons.bigImage = false;
-    };
-
-    if ($scope.recordid > 0) {
-        watch = $scope.$watch('record', function (n, o) {
-            if (n == o)
-                return;
-            isModified = true;
-        }, true);
-    }
-
-    $scope.$on("$destroy", function () {
-        $scope.select_pay_type.remove();
-        if ($scope.recordid > 0) {
-            watch();
-        }
-    });
-})
-
-.controller('PayBillCtrl', function ($rootScope, $scope, $state, $ionicHistory, $ionicModal, global, showPopup, Pay, Tool) {
-    $scope.select_record = showPopup.modalTemplate('templates/modal-selectrecord.html', 'slide-in-right', $scope);
-    var isFirst = false;
-    $scope.type = $state.params['type'];
-    $scope.billid = $state.params['id']
-    $scope.titleArr = ['新建', '编辑'];
-    $scope.amountSum = 0;
-    $scope.bill = {
-        "title": null,
-        "note": null,
-        "status": null,
-        "record": [],
-        "record_old": []
-    }
-    $scope.records = [];
-
-    global.fetch_user().then(function () {
-        Pay.auditstep.get({userid: global.user.usrid}, function (data) {
-            $scope.checkusrdata = data;
-        });
-        if ($scope.billid < 0) {
-            $scope.recordlist = angular.copy(Pay.recordList);
-            $scope.select_record.then(function (modal) {
-                $scope.select_record = modal;
-                $rootScope.commons.modal = modal;
-                $scope.select_record.show();
-            });
-            isFirst = true;
-        } else {
-            $scope.select_record.then(function (modal) {
-                $scope.select_record = modal;
-                $rootScope.commons.modal = modal;
-            });
-            $scope.bill = angular.copy(Pay.detailItem);
-            $scope.recordlist = angular.copy(Pay.recordList);
-            $scope.records = $scope.bill.record;
-            $scope.bill.record_old = _.map($scope.bill.record, function (record) {
-                return record.id;
-            });
-            _.each($scope.records.reverse(), function (record) {
-                record.selected = true;
-                $scope.recordlist.splice(0, 0, record);
-            });
-            $scope.amountSum = $scope.bill.total_amount;
-        }
-    });
-
-    $scope.selectRecord = function (recorditem) {
-        if (recorditem.selected) {
-            $scope.amountSum = parseFloat($scope.amountSum) + parseFloat(recorditem.amount);
-        } else {
-            $scope.amountSum = parseFloat($scope.amountSum) - parseFloat(recorditem.amount);
-        }
-        $scope.amountSum = $scope.amountSum.toFixed(2);
-    };
-
-    $scope.toEditRecord = function () {
-        $scope.select_record.show();
-        $rootScope.commons.modal = $scope.select_record;
-    };
-
-    $scope.cancel = function (op) {
-        if (op == 'm') {
-            if (isFirst) {
-                $ionicHistory.goBack();
-            }
-            $rootScope.commons.modal.hide();
-            $rootScope.commons.modal = undefined;
-        } else {
-            $ionicHistory.goBack();
-        }
-
-    };
-
-    $scope.ok = function (op) {
-        if (op == 'bill') {
-            if ($scope.bill.title == null) {
-                showPopup.PopupWindow(0, "请填写标题", false);
-                return;
-            }
-            $scope.bill.record = _.map($scope.records, function (item) {
-                return item.id;
-            });
-            showPopup.showLoading(1, '正在提交', false);
-            if ($scope.billid < 0) {
-                Pay.billdetail.save($scope.bill, function (data) {
-                    showPopup.hideLoading();
-                    $state.go('paybilldetails', {
-                        id: data.id
-                    });
-                }, function (err) {
-                    alert(JSON.stringify(err))
-                });
-            } else {
-                $scope.bill = _.pick($scope.bill, 'id', 'title', 'note', 'status', 'record', 'record_old');
-                Pay.billdetail.update($scope.bill, function (data) {
-                    showPopup.hideLoading();
-                    $state.go('paybilldetails', {
-                        id: data.id
-                    });
-                }, function (err) {
-                    alert(JSON.stringify(err))
-                });
-            }
-        } else {
-            $scope.records = _.filter($scope.recordlist, function (item) {
-                return item.selected;
-            });
-            $rootScope.commons.modal.hide();
-        }
-    }
-
-    $scope.$on("$destroy", function () {
-        $scope.select_record.remove();
-    });
-})
-
-.controller('BillListCtrl', function ($rootScope, $scope, $state, global, Pay) {
-    var type = $state.params['type'];
-    global.fetch_user().then(function () {
-        getpaylistdata();
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpaylistdata();
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.bills != undefined && $scope.bills.next != null) {
-            Tool.get($scope.bills.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.bills.results.push(item);
-                });
-                $scope.bills.next = data.next;
-                $scope.bills.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    };
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.bills != undefined && $scope.bills.next != null;
-    };
-
-    PayBillDoRefresh = $rootScope.$on('PayBillListDoRefresh', function (event, data) {
-       getpaylistdata();
-    });
-
-    function getpaylistdata() {
-        if (global.user.token != "") {
-            if ($scope.bills == undefined) {
-                $scope.loading = true;
-            }
-            Pay.bill.get({type: type}, function (data) {
-                $scope.bills = data;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    $scope.$on("$destroy", function () {
-        PayBillDoRefresh();
-    });
-})
-
-.controller('BillApproveCtrl', function ($rootScope, $scope, $state, global, Pay) {
-    var type = $state.params['type'];
-    global.fetch_user().then(function () {
-        getpaylistdata();
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpaylistdata();
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.bills != undefined && $scope.bills.next != null) {
-            Tool.get($scope.bills.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.bills.results.push(item);
-                });
-                $scope.bills.next = data.next;
-                $scope.bills.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    };
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.bills != undefined && $scope.bills.next != null;
-    };
-
-    function getpaylistdata() {
-        if (global.user.token != "") {
-            if ($scope.bills == undefined) {
-                $scope.loading = true;
-            }
-            Pay.bill.get({type: type}, function (data) {
-                $scope.bills = data;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-})
-
-.controller('BillApprovedCtrl', function ($rootScope, $scope, $state, global, Pay, Member, Tool) {
-    var type = $state.params['type'];
-    $scope.centerdata = [
-        {"key": null, "name": "全部状态", "check": true},
-        {"key": 0, "name": "已驳回", "check": false},
-        {"key": 1, "name": "已支付", "check": false},
-        {"key": 2, "name": "未支付", "check": false},
-        {"key": 3, "name": "处理中", "check": false}];
-    var beforeenter = $scope.$on('$ionicView.beforeEnter', function () {
-        $scope.user_id = Member.selectedemplst.length > 0 ? Member.selectedemplst[0].user_id : 0;
-    });
-    global.fetch_user().then(function () {
-        getpaylistdata(null, null, null, null);
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpaylistdata();
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.bills != undefined && $scope.bills.next != null) {
-            Tool.get($scope.bills.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.bills.results.push(item);
-                });
-                $scope.bills.next = data.next;
-                $scope.bills.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    };
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.bills != undefined && $scope.bills.next != null;
-    };
-
-    $scope.selectClick = function (date, status, user_id) {
-        var year = date == null ? date : (date.length > 4 ? date.substr(0, 4) : date);
-        var month = date == null ? date : (date.length == 4 ? null : date.substr(5, date.length - 5));
-        getpaylistdata(status == null ? status : parseInt(status), year, month, user_id);
-    };
-
-    $scope.setUser = function () {
-        $scope.user_id = 0;
-    };
-
-    function getpaylistdata(status, year, month, create_user) {
-        if (global.user.token != "") {
-            if ($scope.bills == undefined) {
-                $scope.loading = true;
-            }
-            Pay.bill.get({"type": type, "status": status, "year": year, "month": month, "create_user": create_user}, function (data) {
-                $scope.bills = data;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    $scope.$on('$destroy', function () {
-        beforeenter = null;
-        Member.selectedemplst = [];
-    });
-})
-
-.controller('BillPayCtrl', function ($rootScope, $scope, $state, global, Pay) {
-    var type = $state.params['type'];
-    global.fetch_user().then(function () {
-        getpaylistdata();
-    });
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getpaylistdata();
-    };
-
-    $scope.toAnalyse = function () {
-        $state.go('pay-analyse');
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.bills != undefined && $scope.bills.next != null) {
-            Tool.get($scope.bills.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.bills.results.push(item);
-                });
-                $scope.bills.next = data.next;
-                $scope.bills.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    };
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.bills != undefined && $scope.bills.next != null;
-    };
-
-    function getpaylistdata() {
-        if (global.user.token != "") {
-            if ($scope.bills == undefined) {
-                $scope.loading = true;
-            }
-            Pay.bill.get({type: type}, function (data) {
-                $scope.bills = data;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-})
-
-.controller('PayBillDetailsCtrl', function ($rootScope, $scope, $state, $ionicPopup, $ionicHistory, $cordovaDialogs, global, Pay, showPopup, Tool) {
-    showPopup.modalTemplate('templates/modal-stepReject.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.step_reject = modal;
-    });
-    $scope.index = null;
-    var paybillid = $state.params["id"];
-    Tool.removeBackView('pay-bill');
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    global.fetch_user().then(function () {
-        $scope.user = global.user.usrid;
-        getbilldata();
-    });
-
-    $scope.toedit = function () {
-        $state.go('pay-bill', {
-            type: 1,
-            id: paybillid
-        });
-    }
-
-    $scope.deleteBill = function () {
-        $cordovaDialogs.confirm('是否撤销该报销单', '提示', ['是', '否']).then(function (buttonIndex) {
-            if (buttonIndex == 1) {
-                showPopup.showLoading(1, '撤销中');
-                Pay.billdetail.delete({id: paybillid}, function () {
-                    $scope.$emit('PayBillListDoRefresh');
-                    $scope.$emit('PayRecordDoRefresh');
-                    showPopup.hideLoading();
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.audit = function (op) {
-        $scope.data = {};
-        if (op == 0) {
-            setPopup('驳回', '请输入驳回理由(必填)', op);
-        } else if (op == 1) {
-            setPopup('同意', '请输入备注(选填)', op);
-        } else if (op == 2) {
-            showPopup.showLoading(1, '提交中');
-            Pay.billdetail.update({id: paybillid, status: 2}, function (data) {
-                getbilldata();
-                showPopup.hideLoading();
-            });
-        }
-    }
-
-    $scope.ok = function () {
-        $scope.data.ordering = $scope.index;
-        postHistory($scope.data);
-        $scope.cancel();
-    }
-
-    $scope.cancel = function () {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.changeIndex = function (item) {
-        $scope.index = item.ordering;
-        $scope.data.im_usrid = item.verifier.im_usrid;
-    }
-
-    function getbilldata() {
-        if (global.user.token != "") {
-            if ($scope.bill == undefined) {
-                $scope.loading = true;
-            }
-            Pay.billdetail.get({id: paybillid}, function (res) {
-                $scope.loading = false;
-                $scope.bill = res;
-                Pay.detailItem = _.clone(res);
-                console.log(res);
-                $scope.billhistorydata = [];
-                _.each(res.history, function (item) {
-                    var historyitem = {};
-                    historyitem.date = item.create_date;
-                    historyitem.title = item.create_user.username;
-                    historyitem.profilePicture = "../../../img/panda.png";
-                    historyitem.text = item.content;
-                    historyitem.icon = item.status == 0 ? "ion-ios-undo assertive" : "ion-ios-checkmark balanced"
-                    $scope.billhistorydata.push(historyitem);
-                });
-                if (!$scope.bill.verifier.is_teller) {
-                    $scope.billhistorydata.push({
-                        icon: 'ion-load-c task-create-member-p',
-                        title: $scope.bill.status == 0 ? $scope.user == $scope.bill.create_user.id ? '等待我处理' : '当前处理人:' + $scope.bill.create_user.username : $scope.user == $scope.bill.verifier.verifier_id ? '等待我处理' : '当前处理人:' + $scope.bill.verifier.verifier__username,
-                        profilePicture: "../../../img/panda.png"
-                    });
-                }
-                $scope.billhistorydata.reverse();
-            })
-        }
-    }
-
-    function setPopup(title, placeholdertext, op) {
-        $cordovaDialogs.prompt(placeholdertext, title, ['确定', '取消']).then(function (result) {
-            var input = result.input1;
-            var btnIndex = result.buttonIndex;
-            if (btnIndex == 1) {
-                if (input == '' && op == 0) {
-                    $cordovaDialogs.alert('请填写驳回理由', '提示', '确定');
-                } else {
-                    $scope.data = {
-                        status: op,
-                        content: input == '' ? null : input,
-                        pay_bill_id: paybillid,
-                        ordering: null,
-                        im_usrid:null,
-                        count:$scope.bill.step.length - 1
-                    }
-                    if (op == 1) {
-                        flag = _.find($scope.bill.step, function (item) {
-                            if (item.verifier.id == global.user.usrid)
-                                return item;
-                        });
-                        item = _.find($scope.bill.step, function (item) {
-                            if (item.ordering == flag.ordering + 1)
-                                return item;
-                        });
-                        $scope.data.im_usrid = item.verifier.im_usrod
-                        postHistory($scope.data);
-                    } else if (op == 0) {
-                        $scope.step = getStep($scope.bill.step);
-                        if ($scope.step.length >= 1) {
-                            $scope.step.reverse();
-                            $scope.step.push({
-                                ordering: 0,
-                                verifier: {
-                                    username: $scope.bill.create_user.username
-                                }
-                            });
-                            $scope.index = $scope.step[0].ordering;
-                            $scope.step_reject.show();
-                            $rootScope.commons.modal = $scope.step_reject;
-                        } else {
-                            $scope.data.im_usrid = $scope.bill.step[0].verifier.im_usrid;
-                            postHistory($scope.data);
-                        }
-                    }
-                }
-            }
-        });
-    }
-
-    function postHistory(data) {
-        showPopup.showLoading(1, '提交中');
-        Pay.billhistory.save(data, function (data) {
-            getbilldata();
-            showPopup.hideLoading();
-        })
-    }
-
-    function getStep(step) {
-        return _.filter(step, function (item) {
-            return item.is_approved;
-        });
-    }
-
-    $scope.$on("$destroy", function () {
-        $scope.step_reject.remove();
-    });
-})
-
-.controller('PayAnalyseCtrl', function ($rootScope, $scope, $filter, $state, global, Pay) {
-    global.fetch_user().then(function () {
-        getanalysedata();
-    });
-
-    function getanalysedata() {
-        if (global.user.token != "") {
-            if ($scope.data == undefined) {
-                $scope.loading = true;
-            }
-            Pay.analyse.get(function (res) {
-                $scope.loading = false;
-                $scope.data = res;
-                _.each($scope.data.result, function (item) {
-                    item.percentage = $filter('percentage')(item.count / $scope.data.count, 2, "%");
-                })
-            })
-        }
-    }
-})

+ 0 - 90
www/apps/pay/js/directive.js

@@ -1,90 +0,0 @@
-starter.directive('payBillList', function () {
-    return {
-        restrict: "E",
-        scope: {
-            bills: "=bills",
-            loading: "=loading"
-        },
-        templateUrl: 'templates/template-payBillList.html',
-        controller: function ($scope, $state, global) {
-            $scope.user = global.user.usrid;
-            $scope.todetails = function (id) {
-                $state.go('paybilldetails', {
-                    id: id
-                })
-            }
-        }
-    }
-})
-
-.directive('filterBar', function () {
-    return {
-        restrict: "E",
-        scope: {
-            setuser: "&",
-            selClick: "&",
-            centerData: "=",
-            userId: "="
-        },
-        templateUrl: "templates/template-filterbar.html",
-        controller: function ($scope, $state, formatFilter, Member) {
-            setdata();
-            $scope.$watch('userId', function (newValue, oldValue) {
-                if (newValue === oldValue) return;
-                if (Member.selectedemplst.length > 0) {
-                    $scope.values.user_id = Member.selectedemplst[0].user_id;
-                    $scope.right_title = Member.selectedemplst[0].username;
-                    $scope.right_data[1].name = "选择单个成员" + formatFilter("({0})", Member.selectedemplst[0].username);
-                    $scope.selClick($scope.values);
-                }
-            });
-
-            $scope.selectclick = function (item, index) {
-                $scope.acitve_indexs[$scope.key] = index;
-                $scope.Ishidded = !$scope.Ishidded;
-                if ($scope.key == "R" && index == 1) {
-                    Member.routename = "";
-                    Member.titlename = "选择单个成员";
-                    Member.selectedemplst = [];
-                    $state.go('selectsinglemember');
-                    return;
-                } else if ($scope.key == "R" && index == 0) {
-                    Member.selectedemplst = [];
-                    $scope.setuser();
-                    $scope.right_title = $scope.right_data[0].name = "全部成员";
-                    $scope.right_data[1].name = "选择单个成员";
-                }
-                $scope.key == "L" ? $scope.values.date = $scope.left_data[index].key : ($scope.key == "C" ? $scope.values.status = $scope.centerData[index].key : $scope.values.user_id = $scope.right_data[index].key);
-                $scope.selClick($scope.values);
-            };
-
-            $scope.headerclick = function (key) {
-                if ($scope.key == key) {
-                    $scope.Ishidded = !$scope.Ishidded;
-                } else {
-                    $scope.key = key;
-                    $scope.Ishidded = false;
-                }
-            };
-
-            function setdata() {
-                $scope.acitve_indexs = {"L": 0, "C": 0, "R": 0};
-                $scope.key = "L";
-                $scope.Ishidded = true;
-                $scope.left_data = [];
-                var year = new Date().getFullYear();
-                $scope.left_data.push({"key": null, "name": "全部时间", "check": true});
-                for (var y = year; y >= year - 1; y--) {
-                    $scope.left_data.push({"key": formatFilter('{0}', y), "name": formatFilter('{0}年 全年', y), "check": false});
-                    for (var m = 1; m < 13; m++) {
-                        $scope.left_data.push({"key": formatFilter('{0}-{1}', y, m), "name": formatFilter('{0}年 {1}月', y, m), "check": false})
-                    }
-                }
-                $scope.right_data = [{"key": null, "name": "全部成员", "check": true}, {"key": null, "name": "选择单个成员", "check": false}];
-                $scope.data = {"L": $scope.left_data, "C": $scope.centerData, "R": $scope.right_data};
-                $scope.values = {"date": _.find($scope.left_data, {check: true}).key, "status": _.find($scope.centerData, {check: true}).key, "user_id": _.find($scope.right_data, {check: true}).key};
-                $scope.right_title = $scope.right_data[0].name;
-            }
-        }
-    }
-})

+ 0 - 23
www/apps/pay/js/factory.js

@@ -1,23 +0,0 @@
-starter.factory('Pay', function ($resource, cfg, formatFilter, Tool, showPopup) {
-    var pay = {};
-
-    pay.typeList = [];
-    pay.typeItem = {};
-    pay.recordItem = {};
-    pay.recordList = [];
-    pay.detailItem = {};
-    pay.auditstepdata = [];
-    pay.personstepdata = [];
-
-    pay.type = $resource(formatFilter('{0}pay/type/:id/', cfg.api), {}, {'get': {method: 'GET', isArray: true}, 'patch': {method: 'PATCH', isArray: true}});
-    pay.record = $resource(formatFilter('{0}pay/record/:id/', cfg.api));
-    pay.recordfile = $resource(formatFilter('{0}pay/recordfile/:id/', cfg.api));
-    pay.auditstep = $resource(formatFilter('{0}pay/auditstep/:id/', cfg.api), {}, {'save': {method: 'POST', isArray: true}, 'get': {method: 'GET', isArray: true}});
-    pay.bill = $resource(formatFilter('{0}pay/bill/', cfg.api));
-    pay.billdetail = $resource(formatFilter('{0}pay/billdetail/:id/', cfg.api));
-    pay.stepcopy = $resource(formatFilter('{0}pay/stepcopy/:id/', cfg.api));
-    pay.billhistory = $resource(formatFilter('{0}pay/billhistory/:id/', cfg.api));
-    pay.analyse = $resource(formatFilter('{0}pay/analyse/', cfg.api));
-
-    return pay;
-});

+ 0 - 90
www/apps/pay/js/route.js

@@ -1,90 +0,0 @@
-starter.config(function ($stateProvider) {
-    $stateProvider.state('pay', {
-        url: '/index',
-        templateUrl: 'templates/pay.html',
-        controller: 'PayCtrl'
-    })
-
-    .state('payman', {
-        url: '/payman',
-        templateUrl: 'templates/payman.html'
-    })
-
-    .state('typeset', {
-        url: '/typeset',
-        templateUrl: 'templates/typeset.html',
-        controller: 'TypeSetCtrl'
-    })
-
-    .state('auditstepset', {
-        url: '/auditstepset',
-        templateUrl: 'templates/auditstepset.html',
-        controller: 'AuditStepSetCtrl'
-    })
-
-    .state('addtype', {
-        url: '/addtype/:id',
-        templateUrl: 'templates/addtype.html',
-        controller: 'AddTypeCtrl'
-    })
-
-    .state('pay-record', {
-        url: '/pay-record/:type&:id',
-        templateUrl: 'templates/pay-record.html',
-        controller: 'PayRecordCtrl'
-    })
-
-    .state('pay-bill', {
-        url: '/pay-bill/:type&:id',
-        templateUrl: 'templates/pay-bill.html',
-        controller: 'PayBillCtrl'
-    })
-
-    .state('auditstep', {
-        url: '/auditstep/:id',
-        templateUrl: 'templates/auditstep.html',
-        controller: 'AuditStepCtrl'
-    })
-
-    .state('seestepmflist', {
-        url: '/seestepmflist',
-        templateUrl: 'templates/seestepmflist.html',
-        controller: 'SeeStepMfListCtrl'
-    })
-
-    .state('billlist', {
-        url: '/billlist/:type',
-        templateUrl: 'templates/billlist.html',
-        controller: 'BillListCtrl'
-    })
-
-    .state('paybilldetails', {
-        url: '/paybilldetails/:id',
-        templateUrl: 'templates/paybilldetails.html',
-        controller: 'PayBillDetailsCtrl'
-    })
-
-    .state('billapprove', {
-        url: '/billapprove/:type',
-        templateUrl: 'templates/billapprove.html',
-        controller: 'BillApproveCtrl'
-    })
-
-    .state('billapproved', {
-        url: '/billapproved/:type',
-        templateUrl: 'templates/billapproved.html',
-        controller: 'BillApprovedCtrl'
-    })
-
-    .state('billpay', {
-        url: '/billpay/:type',
-        templateUrl: 'templates/billpay.html',
-        controller: 'BillPayCtrl'
-    })
-
-    .state('pay-analyse', {
-        url: '/pay-analyse',
-        templateUrl: 'templates/pay-analyse.html',
-        controller: 'PayAnalyseCtrl'
-    })
-});

+ 0 - 32
www/apps/pay/templates/addtype.html

@@ -1,32 +0,0 @@
-<ion-view view-title="{{title}}消费类型" hide-back-button="true">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click='ok();'>确定</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click='back();'>取消</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class=" item item-divider"></div>
-        <label class="item item-input">
-            <input type="text" placeholder="类型名称" ng-model="data.name">
-        </label>
-        <div class="item item-divider divider-font">选择图标颜色</div>
-        <ul class='ul-imgs dept-icon type-icon'>
-            <li ng-repeat="data in iconcolordata" style="background-color: {{data.background}}" ng-click="selectcolor(data)"><i ng-if="data.isacitve" class="ion-ios-checkmark-empty"></i></li>
-        </ul>
-        <div class="item item-divider divider-font">选择图标</div>
-        <ul class='ul-imgs dept-icon type-icon type-icon-bg'>
-            <li ng-repeat="item in icondata" style="background-color: {{item.background}}" ng-click="selecticon(item)"><i class="iconassertive {{item.icon}}" ng-class="{true:'acitvecolor',false:'unacitvecolor'}[item.isacitve]"></i></li>
-        </ul>
-        <!-- <ion-list>
-            <ion-item class="item item-icon-right item-group item-comp">
-                <label class="compname">图标</label>
-                <i class="icon ion-ios-compose-outline positive"></i>
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-        </ion-list> -->
-    </ion-content>
-    <div class="bar bar-footer assertive footer" ng-if="typeid>0" ng-click="deltype()">
-        <div class="title">删除</div>
-    </div>
-</ion-view>

+ 0 - 46
www/apps/pay/templates/auditstep.html

@@ -1,46 +0,0 @@
-<ion-view hide-back-button="true">
-    <ion-nav-title>{{titlename}}</ion-nav-title>
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="goback()">取消</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="ok()">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class=" item item-divider" ng-if="op_id<0&&!is_current_user"></div>
-        <ion-item class="item item-icon-right over-flow-auto item-text-wrap" ng-click="add_create_user();" ng-if="op_id<0&&!is_current_user">
-            已选成员
-            <p class="label-right-text">{{create_users.length==1?create_users[0].username:create_users.length+"人"}}</p>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </ion-item>
-        <div class=" item item-divider"></div>
-        <ion-item class="item auditemp-box">
-            请添加完整的报销审批步骤
-            <div class="item auditstepbox">
-                <div class="audit-member-div">
-                    <img src="../../../img/panda.png" alt="">
-                    <p>{{create_users[0].username}}</p>
-                </div>
-                <div class="audit-member-div" ng-repeat="checkusr in step_users">
-                    <i class="icon ion-ios-close" ng-click="step_users.splice($index,1)"></i>
-                    <img src="../../../img/panda.png" alt="">
-                    <p>{{checkusr.username}}</p>
-                </div>
-                <div class="audit-member-div member-add">
-                    <i class="icon ion-ios-plus-outline" ng-click="add_step_user();"></i>
-                    <p>审批人</p>
-                </div>
-            </div>
-        </ion-item>
-        <div class=" item item-divider"></div>
-        <ion-item class="item item-icon-right over-flow-auto item-text-wrap" ng-click="add_teller();">
-            出纳人员
-            <p class="label-right-text">{{teller==null?"必填":teller.username}}</p>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </ion-item>
-        <div class="desctext">将报销单抄送给出纳人员</div>
-    </ion-content>
-    <div class="bar bar-footer footer" ng-click="toSeeList()" ng-if="op_id<=0&&is_current_user">
-        <div class="title calm">看一看同事的报销审批步骤</div>
-    </div>
-</ion-view>

+ 0 - 44
www/apps/pay/templates/auditstepset.html

@@ -1,44 +0,0 @@
-<ion-view view-title="审批步骤设置" hide-tabs="true">
-    <ion-nav-buttons style="border:none" side="right">
-        <button class="button button-icon ion-ios-more" ng-if="is_show_delete!=true" ng-click="popover.show($event)"></button>
-        <button class="button button-clear" ng-if="is_show_delete" ng-click="ok();">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider dividercolor">可以设置每个人的审批步骤</div>
-        <ion-refresher pulling-text="下拉刷新" pulling-icon="ion-ios-arrow-thin-down" on-refresh="doRefresh()"></ion-refresher>
-        <ion-list class="audit-list" show-delete="is_show_delete">
-            <div ng-repeat="result in resultdata track by $index">
-                <div class="rj-contacts-index-bar item-remove-animate" id="index_{{result.sortchar}}">{{result.sortchar}}</div>
-                <ion-item ng-repeat="person in result.persons track by $index" ng-click="toedit(person.emp.id)" class="item-thumbnail-left item-icon-right over-flow-auto item-text-wrap">
-                    <img ng-src="../../../img/panda.png">
-                    <h2>{{person.emp.username}}</h2>
-                    <p ng-style="">{{person.emp.degree}}</p>
-                    <ion-delete-button class="ion-minus-circled" ng-click="removeItem(person.emp,result.sortchar)">
-                    </ion-delete-button>
-                    <p class="label-right-text">{{person.checknames}}</p>
-                    <i class="icon ion-chevron-right icon-accessory"></i>
-                </ion-item>
-            </div>
-            <ion-item class="item-border">
-            </ion-item>
-        </ion-list>
-    </ion-content>
-    <div class="rj-contacts-right-bar" rj-position-middle on-drag="contacts_right_bar_swipe($event)">
-        <div>&uarr;</div>
-        <div>☆</div>
-        <div ng-repeat="char in sortchars" ng-click="sortByChar(char,'index_{{char}}')">{{char}}</div>
-    </div>
-    <div class="rj-contacts-middle-bar" ng-show="is_show_middle">
-        {{sortchar}}
-    </div>
-    <script id="templates/add.html" type="text/ng-template">
-        <ion-popover-view class="popver_view">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="toadd();">添加成员</ion-item>
-                    <ion-item class="item item-button" type="item-text-wrap" ng-click="displayremove();">移除成员</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 12
www/apps/pay/templates/billapprove.html

@@ -1,12 +0,0 @@
-<ion-view view-title="需要我审批的报销单">
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <a class="item item-icon-right" ng-href="#/billapproved/2">已审批的报销单
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider">需要我审批的({{bills.results.length}})</div>
-        <pay-bill-list  bills="bills.results" loading="loading"></pay-bill-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-</ion-view>

+ 0 - 11
www/apps/pay/templates/billapproved.html

@@ -1,11 +0,0 @@
-<ion-view view-title="已审批的报销单">
-    <ion-content>
-        <filter-bar sel-click="selectClick(date,status,user_id)" center-data="centerdata" user-id="user_id" setuser="setUser()"></filter-bar>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-scroll style="height: 90%">
-            <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-            <pay-bill-list bills="bills.results" loading="loading"></pay-bill-list>
-        </ion-scroll>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-</ion-view>

+ 0 - 8
www/apps/pay/templates/billlist.html

@@ -1,8 +0,0 @@
-<ion-view view-title="我提交的报销单">
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <pay-bill-list  bills="bills.results" loading="loading"></pay-bill-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-</ion-view>

+ 0 - 11
www/apps/pay/templates/billpay.html

@@ -1,11 +0,0 @@
-<ion-view view-title="需要我支付的报销单">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toAnalyse()">分析</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>
-        <pay-bill-list  bills="bills.results" loading="loading"></pay-bill-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-</ion-view>

+ 0 - 13
www/apps/pay/templates/modal-paytype.html

@@ -1,13 +0,0 @@
-<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>
-        <button class="button button-clear button-calm" ng-click="ok();">完成</button>
-    </ion-header-bar>
-    <ion-content>
-        <ion-radio class="item-icon-left item-icon-right" ng-model="record.pay_type" ng-click="checkType(type)" ng-value="type.id" ng-repeat="type in types">
-            <i style="color:{{type.icon_color}}" class="icon" ng-class="type.icon"></i>
-            <span style="padding-left: 38px">{{type.name}}</span>
-        </ion-radio>
-    </ion-content>
-</ion-modal-view>

+ 0 - 24
www/apps/pay/templates/modal-selectrecord.html

@@ -1,24 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar class="bar bar-header">
-        <button class="button button-clear button-calm" ng-click="cancel('m');">取消</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 item-icon-right" ng-repeat="record in recordlist">
-                <i class="icon" style="color:{{record.type_modal.icon_color}}" ng-class="record.type_modal.icon"></i>
-                {{record.description}}
-                <span class="item-note assertive">¥{{record.amount}}</span>
-                <p>{{record.spend_date | date:'yyyy-MM-dd'}}</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>

+ 0 - 10
www/apps/pay/templates/modal-stepReject.html

@@ -1,10 +0,0 @@
-<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>
-        <button class="button button-clear button-calm" ng-click="ok()">完成</button>
-    </ion-header-bar>
-    <ion-content>
-        <ion-radio ng-model="index" ng-value="s.ordering" ng-click="changeIndex(s)" ng-repeat="s in step">{{s.ordering == 0 ? '提交报销单' : '第'+ s.ordering + '步审批'}}({{s.verifier.username}})</ion-radio>
-    </ion-content>
-</ion-modal-view>

+ 0 - 17
www/apps/pay/templates/pay-analyse.html

@@ -1,17 +0,0 @@
-<ion-view view-title="需支付的报销金额">
-    <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" class="item item-divider">
-            ¥{{data.count}}
-        </div>
-        <div ng-if="!loading" class="item item-divider" style="overflow: auto;">
-            <div ng-repeat="item in data.result" style="float: left; width: {{item.percentage}}; height: 12px; background-color: {{item.type_modal.icon_color}}"></div>
-        </div>
-        <div ng-if="!loading" class="item item-icon-left item-icon-right" ng-repeat="item in data.result" ng-click="torecord(record)">
-            <i class="icon icon-style" style="background-color:{{item.type_modal.icon_color}}" ng-class="item.type_modal.icon"></i>{{item.type_modal.name}}({{item.percentage}})
-            <p>¥{{item.count}}</p>
-            <!--<i class="icon ion-chevron-right icon-accessory"></i>-->
-        </div>
-    </ion-content>
-</ion-view>

+ 0 - 64
www/apps/pay/templates/pay-bill.html

@@ -1,64 +0,0 @@
-<ion-view view-title="{{titleArr[type]}}报销单" cache-view="false" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="cancel();">取消</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="ok('bill');">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <label class="item item-input text-input">
-            <span class="input-label">标题</span>
-            <input type="text" placeholder="输入报销单名称" ng-model="bill.title"/>
-        </label>
-        <div class="item item-divider"></div>
-        <ion-item class="item auditemp-box">
-            需报销的消费({{records.length}})
-            <label for="" class="edit-text-label positive" ng-click="toEditRecord()">修改</label>
-            <div class="item item-text-wrap bill-record-box">
-                <div class="item item-icon-left" ng-repeat="item in records">
-                    <i class="icon icon-style" ng-class="item.type_modal.icon" style="background-color:{{item.type_modal.icon_color}}"></i>{{item.description}}
-                    <span class="item-note ">¥{{item.amount}}</span>
-                    <p>{{item.spend_date | date:'yyyy-MM-dd'}}</p>
-                </div>
-            </div>
-
-            <div class="bill-sum ">共计:
-                <label class="assertive">¥{{amountSum}}</label>
-            </div>
-        </ion-item>
-        <div class="item item-divider"></div>
-        <!--<label class="item item-input text-input">-->
-            <!--<span class="input-label">补助&nbsp;¥</span>-->
-            <!--<input type="number" ng-model="bill.grant" placeholder="输入金额(选填)" ng-pattern="/^([1-9][\d]{0,8}|0)(\.[\d]{1,2})?$/">-->
-        <!--</label>-->
-        <label class="item item-input text-input">
-            <span class="input-label">备注</span>
-            <input type="text" ng-model="bill.note" placeholder="输入备注(选填)"/>
-        </label>
-        <div class="item item-divider"></div>
-        <ion-item class="item">
-            报销审批步骤
-        </ion-item>
-        <ion-list class="audit-list bill-auditlist-box">
-            <ion-item class="bill-audit-item item-thumbnail-left item-text-wrap">
-                <img ng-src="../../../img/panda.png">
-                <h2>{{checkusrdata[0].create_user.username}}</h2>
-                <p>申请</p>
-                <ion-delete-button class="ion-minus-circled" ng-click="onItemDelete(item)">
-                </ion-delete-button>
-            </ion-item>
-            <div class=" "></div>
-            <ion-item class="bill-audit-item item-thumbnail-left item-text-wrap" ng-repeat="checkusr in checkusrdata">
-                <img ng-src="../../../img/panda.png">
-                <h2>{{checkusr.verifier.username}}</h2>
-                <p>{{checkusr.verifier.degree}}</p>
-                <ion-delete-button class="ion-minus-circled" ng-click="onItemDelete(item)">
-                </ion-delete-button>
-            </ion-item>
-            <div class=" "></div>
-            <ion-item class="item-border">
-            </ion-item>
-            <ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 46
www/apps/pay/templates/pay-record.html

@@ -1,46 +0,0 @@
-<ion-view view-title="{{titleArr[recordid == -1 ? 0 : 1]}}消费记录">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="ok();">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <label class="item item-input text-input">
-            <span class="input-label">金额&nbsp;¥</span>
-            <input type="number" ng-model="record.amount" placeholder="输入金额" ng-pattern="/^([1-9][\d]{0,8}|0)(\.[\d]{1,2})?$/">
-        </label>
-        <div class=" item item-divider"></div>
-        <ion-item class="item item-icon-right over-flow-auto item-text-wrap" ng-click="selectPayType();">
-            消费类型
-            <p class="label-right-text">{{record.type_modal.name}}</p>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </ion-item>
-        <ion-item class="item item-icon-right over-flow-auto item-text-wrap" ng-click="selectSpendDate(record.spend_date)">
-            消费日期
-            <p class="label-right-text">{{record.spend_date | date:"y年MM月dd日"}}</p>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </ion-item>
-        <div class=" item item-divider"></div>
-        <div class="item">票据图片</div>
-        <div class="item camera-item">
-            <div ng-repeat="img in record.files" ng-click="shouBigImage(img.file_full_path)">
-                <img ng-src="{{img.file_thumbnail_path}}"/>
-            </div>
-            <div class="center" ng-click="addphoto()">
-                <i class="icon ion-image"></i>
-            </div>
-        </div>
-        <div class=" item item-divider"></div>
-        <label class="item item-input text-input">
-            <span class="input-label">描述</span>
-            <input type="text" ng-model="record.description" placeholder="输入描述"/>
-        </label>
-        <div class=" item item-divider" ng-if="recordid>0"></div>
-        <ion-item class="item assertive" type="item-text-wrap" ng-if="recordid>0" ng-click="deleteRecord();" style="text-align:center">
-            删除
-        </ion-item>
-    </ion-content>
-    <div ng-show="commons.bigImage" class="popover-backdrop1">
-        <img class="fullscreen-image" ng-click="hideBigImage()" ng-src="{{Url}}" ng-pinch-zoom/>
-        <i class="ion-ios-trash-outline" ng-click="deleteimage();"></i>
-    </div>
-</ion-view>

+ 0 - 45
www/apps/pay/templates/pay.html

@@ -1,45 +0,0 @@
-<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;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toman()" ng-if="roleid==1">管理&nbsp;&nbsp;</button>
-        <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>
-        <a class="item item-icon-right" ng-href="#/billlist/0">我提交的报销单
-            <i class="icon ion-chevron-right icon-accessory"></i>
-            <!--<span class="badge badge-assertive">1</span>-->
-        </a>
-        <a class="item item-icon-right" ng-href="#/billapprove/1">需要我审批的报销单
-            <i class="icon ion-chevron-right icon-accessory"></i>
-            <!--<span class="badge badge-assertive">1</span>-->
-        </a>
-        <a class="item item-icon-right" ng-href="#/billpay/3">需要我支付的报销单
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider">消费记录({{recordlist.results.length}})</div>
-        <ion-list>
-            <div class="item item-icon-left" ng-repeat="record in recordlist.results" ng-click="torecord(record)">
-                <i class="icon icon-style" style="background-color:{{record.type_modal.icon_color}}" ng-class="record.type_modal.icon"></i>{{record.description}}
-                <span class="item-note assertive">¥{{record.amount}}</span>
-                <p>{{record.spend_date | date:'yyyy-MM-dd'}}</p>
-            </div>
-        </ion-list>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-    </ion-content>
-    <script id="templates/paymenu.html" type="text/ng-template">
-        <ion-popover-view ng-class="{'true':'details-popup','false':'popver_view'}[is_have_step]">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" ng-click="torecord()">添加消费记录</ion-item>
-                    <ion-item class="item item-button" ng-click="addpaybill()" ng-if="is_have_step">创建报销单</ion-item>
-                    <ion-item class="item item-button" ng-click="toauditstep()">{{is_have_step?"修改审批人":"添加审批步骤"}}</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 87
www/apps/pay/templates/paybilldetails.html

@@ -1,87 +0,0 @@
-<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;返回</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div ng-if="!loading">
-            <ion-item class="mission-header item item-avatar " type="item-text-wrap">
-                <img ng-src="../../../img/panda.png" style="">
-                <span class="item-note">{{bill.create_date | date:'MM-dd'}}</span>
-                <h2>{{bill.create_user.username}}</h2>
-                <p>{{bill.create_user.degree}}</p>
-            </ion-item>
-            <div class="item item-text-wrap bill-details-item">
-                {{bill.title}}
-                <p> 报销金额:
-                    <label for="" class="energized">{{bill.total_amount}}元 </label>
-                </p>
-                <p> 备注:
-                    <label for="" class="dark">{{bill.note}}</label>
-                </p>
-                <!--<p style="float:right">报销单号:{{bill.billno}}</p>-->
-            </div>
-            <div class="item item-divider"></div>
-            <ion-item class="item auditemp-box">
-                消费详情
-                <label for="" class="edit-text-label positive">{{bill.record.length}}笔消费</label>
-                <div class="item item-text-wrap bill-record-box">
-                    <div class="item item-icon-left" ng-repeat="rd in bill.record">
-                        <i class="icon icon-style {{rd.type_modal.icon}}" style="background-color:{{rd.type_modal.icon_color}}"></i>{{rd.type_modal.name}}
-                        <span class="item-note ">¥{{rd.amount}}</span>
-                        <p>{{rd.spend_date | date:'yyyy-MM-dd'}}</p>
-                        <p>{{rd.description}}</p>
-                        <div class="blob"><image-popover all-images="rd.files"></image-popover></div>
-                        <!-- <hr> -->
-                    </div>
-                </div>
-                <!--<div class="bill-grant">-->
-                    <!--<p><i class="ion-android-add"></i>&nbsp;补助-->
-                        <!--<la bel class="assertive">¥ {{bill.grant}}</label>-->
-                    <!--</p>-->
-                <!--</div>-->
-            </ion-item>
-            <div class="item item-divider"></div>
-            <ion-item class="item">审批信息
-                <span ng-if="bill.status == 1" class="item-note energized">未支付</span>
-            </ion-item>
-            <section id="cd-timeline" class="cd-container">
-                <div ng-repeat="hs in billhistorydata">
-                    <div class="cd-timeline-block">
-                        <div class="cd-timeline-picture">
-                            <img ng-src={{hs.profilePicture}} />
-                        </div>
-                        <!-- cd-timeline-img -->
-                        <div class="cd-timeline-content">
-                            <h5 class="marginBottom0 marginTop0">
-                                <i class="{{hs.icon}}"></i>
-                                <span ng-class="{true:'task-create-member-p'}[$index == 0 && !bill.verifier.is_teller]">{{hs.title}}</span>
-                                <label class="cd-author">{{hs.date | date: "yyyy年MM月dd日 HH:mm"}}</label>
-                            </h5>
-                            <p class="timelineText">{{hs.text}}</p>
-                        </div>
-                    </div>
-                </div>
-            </section>
-            <button ng-if="user == bill.create_user.id && user != bill.verifier.verifier_id && (bill.status == 0 || bill.history.length == 0)" class="button button-full button-assertive" ng-click="deleteBill()">撤销</button>
-        </div>
-        <ion-item ng-if="user == bill.verifier.verifier_id || user == bill.create_user.id && bill.status == 0" class="item"></ion-item>
-    </ion-content>
-    <ion-footer-bar ng-if="(!bill.status && user == bill.verifier.verifier_id) || (user == bill.create_user.id && bill.status == 0) || (user == bill.verifier.verifier_id && bill.status == 1)">
-        <div class="bar bar-footer" ng-if="user == bill.verifier.verifier_id && !bill.status">
-            <button class="button button-balanced col-40" ng-click="audit(1)">同意</button>
-            <div class="col-20"></div>
-            <button class="button button-energized col-40" ng-click="audit(0)">驳回</button>
-        </div>
-        <div class="bar bar-footer" ng-if="user == bill.create_user.id && bill.status == 0">
-            <div class="col-10"></div>
-            <button class="button button-energized col-80" ng-click="toedit()">已被驳回,请修改报销单</button>
-            <div class="col-10"></div>
-        </div>
-        <div class="bar bar-footer" ng-if="user == bill.verifier.verifier_id && bill.status == 1">
-            <div class="col-10"></div>
-            <button class="button button-balanced col-80" ng-click="audit(2)">标记为已支付</button>
-            <div class="col-10"></div>
-        </div>
-    </ion-footer-bar>
-</ion-view>

+ 0 - 19
www/apps/pay/templates/payman.html

@@ -1,19 +0,0 @@
-<ion-view view-title="报销管理" hide-tabs="true">
-    <ion-content>
-        <div class=" item item-divider"></div>
-        <ion-list>
-            <ion-item class="item item-icon-right" type="item-text-wrap" href="#/typeset">
-                消费类型设置
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <div class="item item-divider dividertext">
-                <label>自定义消费类型,比如:交通、住宿、餐饮...</label>
-            </div>
-            <ion-item class="item item-icon-right" type="item-text-wrap" href="#/auditstepset">
-                审批步骤设置
-                <i class="icon ion-chevron-right icon-accessory"></i>
-            </ion-item>
-            <div class="desctext">设置每个员工的报销审批步骤</div>
-        </ion-list>
-    </ion-content>
-</ion-view>

+ 0 - 33
www/apps/pay/templates/seestepmflist.html

@@ -1,33 +0,0 @@
-<ion-view view-title="同事的报销审批步骤" hide-tabs="true" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="goback()">取消</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" pulling-icon="ion-ios-arrow-thin-down" on-refresh="doRefresh()"></ion-refresher>
-        <div ng-repeat="step_item in step_datas">
-            <div class=" item item-divider"></div>
-            <ion-item class="stepmfitembox">
-                <ion-item class="item-avatar item stepmfitem">
-                    <img ng-src="../../../img/panda.png"/>
-                    <span>{{step_item.create_user.username}}</span>
-                    <p>{{step_item.create_user.degree}}</p>
-                    <button class="button button-calm" ng-click="usestep(step_item)">使用</button>
-                </ion-item>
-                <div class="item auditstepbox mission-create-member stepmfitemdiv item-text-wrap">
-                    <p>审批步骤:&nbsp;&nbsp;<label for="">{{step_item.step_usernames}}</label></p>
-                    <p>出纳人员:&nbsp;&nbsp;<label for="">{{step_item.teller.username}}</label></p>
-                </div>
-            </ion-item>
-        </div>
-        <!--<ul>-->
-            <!--<li class="h-li">1</li>-->
-            <!--<li class="h-li">2</li>-->
-            <!--<li class="h-li">8</li>-->
-            <!--<li class="h-li active-li">9</li>-->
-            <!--<li class="h-li">10</li>-->
-            <!--<li class="h-li">11</li>-->
-            <!--<li class="h-li">12</li>-->
-            <!--<li class="h-li">13</li>-->
-        <!--</ul>-->
-    </ion-content>
-</ion-view>

+ 0 - 23
www/apps/pay/templates/template-filterbar.html

@@ -1,23 +0,0 @@
-<div class="row item item-row">
-    <div class="col col-33" ng-click="headerclick('L')">
-        {{data["L"][acitve_indexs['L']].name}}&nbsp;&nbsp;<i ng-class="{false:'ion-android-arrow-dropdown',true:'ion-android-arrow-dropup updown-color'}[key=='L'&&!Ishidded]"></i>
-    </div>
-    <label class="v-line">|</label>
-    <div class="col col-33" ng-click="headerclick('C');">
-        {{data["C"][acitve_indexs['C']].name}}&nbsp;&nbsp;<i ng-class="{false:'ion-android-arrow-dropdown',true:'ion-android-arrow-dropup updown-color'}[key=='C'&&!Ishidded]"></i>
-    </div>
-    <label class="v-line">|</label>
-    <div class="col col-33" ng-click="headerclick('R');">
-        {{right_title}}&nbsp;&nbsp;<i ng-class="{false:'ion-android-arrow-dropdown',true:'ion-android-arrow-dropup updown-color'}[key=='R'&&!Ishidded]"></i>
-    </div>
-</div>
-<div style="overflow-y: scroll" class="select-div" ng-class="{true:'hidden-item',false:''}[Ishidded]">
-    <ul class="list" ng-class="{true:'hidden-item',false:''}[headerion.leftion]">
-        <li class="item-sort">
-            <ion-radio ng-model="item.check" ng-value="true" ng-repeat="item in data[key]" ng-click="selectclick(item,$index)">
-                {{item.name}}
-            </ion-radio>
-        </li>
-    </ul>
-</div>
-<div class="select-back" ng-class="{true:'hidden-item',false:''}[Ishidded]" ng-click="Ishidded=true"></div>

+ 0 - 13
www/apps/pay/templates/template-payBillList.html

@@ -1,13 +0,0 @@
-<div class="item" ng-if="!loading" ng-repeat="bill in bills" ng-click="todetails(bill.id)">
-    {{bill.title}}
-    <span class="item-note">{{bill.create_date | date:'MM-dd'}}</span>
-    <p> {{bill.create_user.username}}:报销¥{{bill.total_amount}} </p>
-    <p class="task-create-member-p"> 状态:
-        {{bill.status == 0 ? '已驳回' : bill.verifier.is_teller ? null : bill.verifier.verifier__username}}
-        {{bill.status != 0 ? !bill.verifier.is_teller ? '正在审核中' : '审批完成' : null}}
-        <label for="" class="assertive float-right">
-            {{bill.status==1?'未支付':null}}
-            {{bill.status==2?'已支付':null}}
-        </label>
-    </p>
-</div>

+ 0 - 20
www/apps/pay/templates/typeset.html

@@ -1,20 +0,0 @@
-<ion-view view-title="消费类型设置">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="ok()">{{ordering ?'完成':'排序'}}</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher ng-if="!ordering" pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <ion-list ng-if="!loading" show-reorder="ordering" can-swipe="true" class="typelist">
-            <ion-item class="item item-icon-left" ng-repeat="type in types" ng-click="toedittype(type)">
-                <i class="icon" ng-class="type.icon" style="color:{{type.icon_color}}"></i>
-                <h2>{{type.name}}<i class="ion-edit ion-ios-compose-outline positive"></i></h2>
-                <ion-reorder-button class="ion-navicon" on-reorder="reorderItem(type, $fromIndex, $toIndex)">
-                </ion-reorder-button>
-            </ion-item>
-        </ion-list>
-    </ion-content>
-    <div class="calm bar bar-footer footer" ng-click="toaddtype();">
-        <div class="title">添加消费类型&nbsp;<i class="ion-plus"></i></div>
-    </div>
-</ion-view>

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

@@ -1,52 +0,0 @@
-<!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.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>
-

+ 0 - 593
www/apps/schedule/js/controllers.js

@@ -1,593 +0,0 @@
-starter.controller('ScheduleCtrl', function ($rootScope, $scope, $state, $cordovaCalendar, global, Schedule, Tool) {
-    $scope.goBack = function () {
-        global.goBack();
-    }
-
-    global.fetch_user().then(function () {
-        getscheduledata();
-    })
-
-    $scope.toadd = function () {
-        $state.go('schedule-create', {
-            id: -1
-        });
-    }
-
-    $scope.toman = function () {
-        $state.go('schedule-man');
-    }
-
-    $scope.todetails = function (details) {
-        Schedule.scheduleDetails = details;
-        $state.go('schedule-details', {
-            id: details.id
-        });
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getscheduledata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.schedules != undefined && $scope.schedules.next != null) {
-            Tool.get($scope.schedules.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.schedules.results.push(item);
-                })
-                $scope.schedules.next = data.next;
-                $scope.schedules.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.schedules != undefined && $scope.schedules.next != null ? true : false;
-    }
-
-    function getscheduledata() {
-        if (global.user.token != "") {
-            if ($scope.schedules == undefined) {
-                $scope.loading = true;
-            }
-            Schedule.schedule.get({'type': 'receive'}, function (res) {
-                $scope.schedules = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    ScheduleDoRefresh = $rootScope.$on('ScheduleDoRefresh', function (event, data) {
-        getscheduledata();
-    });
-
-    $scope.$on("$destroy", function () {
-        ScheduleDoRefresh();
-    });
-})
-
-.controller('SchedulePostedCtrl', function ($rootScope, $scope, $state, global, Schedule, Tool) {
-    global.fetch_user().then(function () {
-        getscheduledata();
-    })
-
-    $scope.toadd = function () {
-        $state.go('schedule-create');
-    }
-
-    $scope.todetails = function (id) {
-        $state.go('schedule-details', {
-            id: id
-        });
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getscheduledata();
-    }
-
-    $scope.loadMore = function () {
-        if ($scope.schedules != undefined && $scope.schedules.next != null) {
-            Tool.get($scope.schedules.next).then(function (data) {
-                _.each(data.results, function (item) {
-                    $scope.schedules.results.push(item);
-                })
-                $scope.schedules.next = data.next;
-                $scope.schedules.previous = data.previous;
-            }).finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        } else {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }
-    }
-
-    $scope.moreCanBeLoaded = function () {
-        return $scope.schedules != undefined && $scope.schedules.next != null ? true : false;
-    }
-
-    function getscheduledata() {
-        if (global.user.token != "") {
-            if ($scope.schedules == undefined) {
-                $scope.loading = true;
-            }
-            Schedule.schedule.get({'type': 'release'}, function (res) {
-                $scope.schedules = res;
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    ScheduleDoRefresh = $rootScope.$on('ScheduleDoRefresh', function (event, data) {
-        getscheduledata();
-    });
-
-    $scope.$on("$destroy", function () {
-        ScheduleDoRefresh();
-    });
-})
-
-.controller('ScheduleCreateCtrl', function ($rootScope, $scope, $state, $ionicHistory, $cordovaDatePicker, $cordovaCalendar, global, Schedule, Member, showPopup, Tool) {
-    var id = $state.params['id'];
-    var isModified = false;
-    $scope.repeatfreqWeekDayHt = {
-        "1": false,
-        "2": false,
-        "3": false,
-        "4": false,
-        "5": false,
-        "6": false,
-        "0": false
-    }
-
-    $scope.repeatfreqMonthDayHt = {
-        "1": false,
-        "2": false,
-        "3": false,
-        "4": false,
-        "5": false,
-        "6": false,
-        "7": false,
-        "8": false,
-        "9": false,
-        "10": false,
-        "11": false,
-        "12": false,
-        "13": false,
-        "14": false,
-        "15": false,
-        "16": false,
-        "17": false,
-        "18": false,
-        "19": false,
-        "20": false,
-        "21": false,
-        "22": false,
-        "23": false,
-        "24": false,
-        "25": false,
-        "26": false,
-        "27": false,
-        "28": false,
-        "29": false,
-        "30": false,
-        "31": false
-    }
-    
-    $scope.data = {
-        content: null,
-        start_date: getDateTimeYMDHM(1),
-        start_date_title: null,
-        repeat_type: 0,
-        freq: '',
-        repeat_freq_title: '不重复',
-        end_date: null,
-        repeat_end_date_type: 1,
-        notification_type: 1,
-        schedulemembers: []
-    }
-
-    $scope.popup = {
-        isPopup: false
-    }
-
-    if (id > 0) {
-        $scope.data = angular.copy(Schedule.scheduleDetails);
-        $scope.data.freq = $scope.data.freq.split(',');
-        if ($scope.data.repeat_type == 2) {
-            setRepeatByFreq($scope.data.freq, $scope.repeatfreqWeekDayHt);
-        } else if ($scope.data.repeat_type == 3) {
-            setRepeatByFreq($scope.data.freq, $scope.repeatfreqMonthDayHt);
-        }
-        $scope.data.repeat_freq_title = Schedule.getRepeatFreqTitle($scope.data.repeat_type, $scope.data.freq);
-        if ($scope.data.end_date == null) {
-            $scope.data.repeat_end_date_type = 1;
-        } else {
-            $scope.data.repeat_end_date_type = 2;
-        }
-        var content_old = $scope.data.content;
-        var date_old = $scope.data.start_date;
-    }
-
-    $scope.data.start_date_title = Schedule.getDateTimeTitle($scope.data.start_date);
-    $scope.warningHt = Schedule.notificationType;
-    $scope.repeatHt = Schedule.repeatType;
-    $scope.weekDayHt = Schedule.weekDay;
-
-    $scope.repeatfreqstyleunactive = {
-        "border": "1px solid #ddd",
-        "background-color": "#fff"
-    }
-
-    $scope.repeatfreqstyleactive = {
-        "border": "1px solid #ddd",
-        "background-color": "red"
-    }
-
-    $scope.goBack = function () {
-        if (id < 0 && ($scope.data.content != null || $scope.data.schedulemembers.length > 0)) {
-            showPopup.confirm('是否取消创建?', '是', '否').then(function (res) {
-                if (res)
-                    global.goBack();
-            });
-        } else {
-            global.goBack();
-        }
-    }
-
-    $scope.selectmember = function () {
-        Member.resourcemember = [];
-        _.each($scope.data.schedulemembers, function (user) {
-            Member.resourcemember.push(user);
-        })
-        Member.titlename = '选择成员'
-        Member.disabled = false;
-        $state.go('selectmember');
-    }
-
-    //选择重复 重复类型(0:永不,1:每天 2:每周,3:每月,4:每年)
-    showPopup.modalTemplate('templates/modal-selectrepeatid.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.repeat_id_modal = modal;
-    });
-
-    $scope.showRepeatIdModal = function () {
-        $scope.repeat_id_modal.show();
-        $rootScope.commons.modal = $scope.repeat_id_modal;
-    }
-
-    $scope.closeRepeatIdModal = function () {
-        //0:永不,1:每天 2:每周,3:每月,4:每年
-        if ($scope.data.repeat_type == "2") {
-            $scope.data.freq = getFreqByRepeat($scope.repeatfreqWeekDayHt);
-        } else if ($scope.data.repeat_type == "3") {
-            $scope.data.freq = getFreqByRepeat($scope.repeatfreqMonthDayHt);
-        }
-        $scope.data.repeat_freq_title = Schedule.getRepeatFreqTitle($scope.data.repeat_type, $scope.data.freq);
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.changeRepeatId = function (repeat_type) {
-        //0:永不,1:每天 2:每周,3:每月,4:每年
-        if (repeat_type == "1") {
-            $scope.data.freq = 1;
-        } else if (repeat_type == "2") {
-            $scope.repeatfreqWeekDayHt[new Date().getDay()] = true;
-        } else if (repeat_type == "3") {
-            $scope.repeatfreqMonthDayHt[new Date().getDate()] = true;
-        }
-        $scope.data.repeat_type = repeat_type;
-    }
-
-    $scope.changeDayRepeatfreqIdColor = function (freq) {
-        $scope.data.freq = freq;
-    }
-
-    $scope.changeWeekDayRepeatfreqIdColor = function (freq) {
-        if (!(_.compact($scope.repeatfreqWeekDayHt).length == 1 && $scope.repeatfreqWeekDayHt[freq]))
-            $scope.repeatfreqWeekDayHt[freq] = !$scope.repeatfreqWeekDayHt[freq];
-    }
-
-    $scope.changeMonthDayRepeatfreqIdColor = function (freq) {
-        if (!(_.compact($scope.repeatfreqMonthDayHt).length == 1 && $scope.repeatfreqMonthDayHt[freq]))
-            $scope.repeatfreqMonthDayHt[freq] = !$scope.repeatfreqMonthDayHt[freq];
-    }
-
-    //选择结束重复(null:一直重复)
-    showPopup.modalTemplate('templates/modal-selectrepeatenddd.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.repeat_end_dd_modal = modal;
-    });
-
-    $scope.showRepeatendddModal = function () {
-        $scope.repeat_end_dd_modal.show();
-        $rootScope.commons.modal = $scope.repeat_end_dd_modal;
-    }
-
-    $scope.closeRepeatendddModal = function () {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.changeRepeatendddId = function (repeat_end_date_type) {
-        $scope.data.repeat_end_date_type = repeat_end_date_type;
-        $scope.data.end_date = null;
-        $scope.closeRepeatendddModal();
-    }
-
-    //选择提醒 提醒类型(0:不提醒,1:事件发生时,2:提前5分钟,3:提前15分钟,4:提前30分钟,5:提前1小时,6:提前2小时,7:提前5小时)
-    showPopup.modalTemplate('templates/modal-selectwarningid.html', 'slide-in-right', $scope).then(function (modal) {
-        $scope.warning_id_modal = modal;
-    });
-
-    $scope.showWarningIdModal = function () {
-        $scope.warning_id_modal.show();
-        $rootScope.commons.modal = $scope.warning_id_modal;
-    }
-
-    $scope.closeWarningIdModal = function () {
-        $rootScope.commons.modal.hide();
-    }
-
-    $scope.changeWarningId = function (notification_type) {
-        $scope.data.notification_type = notification_type;
-        $scope.closeWarningIdModal();
-    }
-
-    $scope.addSchedule = function () {
-        if (Schedule.checkSchedule($scope.data)) {
-            showPopup.showLoading(1, '正在提交');
-            if (id < 0) {
-                createSchdule();
-            } else {
-//              if (isModified) { // todo :edit change is modified
-                Schedule.deleteEvent(content_old, date_old);
-                createSchdule();
-//              }
-            }
-        }
-    }
-
-    $scope.chooseDate = function () {
-        var options = {
-            mode: 'date',
-            date: $scope.data.end_date != null ? new Date($scope.data.end_date) : new Date(),
-            androidTheme: 3
-        };
-        $cordovaDatePicker.show(options).then(function (date) {
-            if (date == undefined) return;
-            $scope.data.end_date = date;
-            $scope.data.repeat_end_date_type = 2;
-            $scope.closeRepeatendddModal();
-        }, function (cancel) {
-            $scope.data.end_date = null;
-            $scope.data.repeat_end_date_type = 1;
-        });
-    }
-
-    $scope.chooseStartddDate = function () {
-        var options = {
-            mode: 'datetime',
-            date: new Date($scope.data.start_date),
-            androidTheme: 3
-        };
-        $cordovaDatePicker.show(options).then(function (date) {
-            if (date == undefined) return;
-            $scope.data.start_date = date;
-            $scope.data.start_date_title = Schedule.getDateTimeTitle($scope.data.start_date);
-        });
-    }
-
-    var watch = $scope.$watch('data', function (n, o) {
-        if (n == o)
-            return;
-        isModified = true;
-    }, true);
-
-    var enter = $scope.$on("$ionicView.enter", function () {
-        selectMember();
-    });
-
-    $scope.$on("$destroy", function () {
-        if ($rootScope.commons.modal)
-            $rootScope.commons.modal = null;
-        $scope.repeat_end_dd_modal.remove();
-        $scope.warning_id_modal.remove();
-        $scope.repeat_id_modal.remove();
-        enter = null;
-        watch();
-    })
-
-    function createSchdule() {
-        if ($scope.data.repeat_end_date_type == 1)
-            $scope.data.end_date = null;
-        var data = _.pick($scope.data, 'content', 'start_date', 'repeat_type', 'freq', 'end_date', 'notification_type', 'schedulemembers');
-        if (data.freq.length > 0)
-            data.freq = data.freq.join(',');
-        data.schedulemembers = _.map(data.schedulemembers, function (user) {
-            return user.user_id;
-        })
-        if (id < 0) {
-            Schedule.schedule.save(data, function (data) {
-                $scope.$emit('ScheduleDoRefresh');
-                Schedule.createEventWithOptions($scope.data.content, $scope.data.start_date, $scope.data.end_date, $scope.data.repeat_type, $scope.data.freq, $scope.data.notification_type);
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            })
-        } else {
-            data.id = id;
-            Schedule.schedule.update(data, function (data) {
-                $scope.$emit('ScheduleDetailDoRefresh');
-                $scope.$emit('ScheduleDoRefresh');
-                Schedule.createEventWithOptions($scope.data.content, $scope.data.start_date, $scope.data.end_date, $scope.data.repeat_type, $scope.data.freq, $scope.data.notification_type);
-                showPopup.hideLoading();
-                $ionicHistory.goBack();
-            })
-        }
-    }
-
-    function getFreqByRepeat(repeat) {
-        var freq = []
-        _.each(repeat, function (value, key) {
-            if (value) freq.push(parseInt(key));
-        })
-        return freq;
-    }
-
-    function setRepeatByFreq(freq, repeat) {
-        _.each(freq, function (f) {
-            repeat[f] = !repeat[f];
-        })
-    }
-
-    function selectMember() {
-        if (Member.selectedemplst.length > 0) {
-            $scope.data.schedulemembers = [];
-            console.log(Member.selectedemplst);
-            _.each(Member.selectedemplst, function (item) {
-                $scope.data.schedulemembers.push({
-                    user_id: item.user_id,
-                    username: item.username,
-                    deptname: item.depname,
-                    degree: item.degree
-                })
-
-            });
-            $scope.sel_member_names = Schedule.getMemberTitle($scope.data.schedulemembers);
-            Member.selectedemplst = [];
-        }
-    }
-
-    function getDateTimeYMDHM(add_hours) {
-        var date = new Date()
-        date.setHours(date.getHours() + add_hours);
-        date.setMinutes(0);
-        return date;
-    }
-})
-
-.controller('ScheduleDetailsCtrl', function ($rootScope, $scope, $state, $ionicHistory, $ionicPopover, Schedule, global, showPopup, Tool) {
-    var id = $state.params['id'];
-    $scope.popup = {
-        isPopup: false,
-    }
-    var view = $ionicHistory.backView();
-
-    global.fetch_user().then(function () {
-        if (view) {
-            $scope.details = Schedule.scheduleDetails;
-//              $scope.execute_dd_title = Schedule.getDateTimeTitle(res.execute_dd);
-            $scope.scheduleMemberNames = Schedule.getMemberTitle($scope.details.schedulemembers);
-            $scope.repeat_req_title = Schedule.getRepeatFreqTitle($scope.details.repeat_type, $scope.details.freq);
-            $scope.isShowRemoveMember = _.find($scope.details.schedulemembers, function (user) {
-                return user.user_id == global.user.usrid;
-            });
-            $scope.isOver = false;
-            if ($scope.details.end_date != null && new Date() > new Date($scope.details.end_date))
-                $scope.isOver = true;
-        } else {
-            getscheduledetails();
-        }
-    });
-
-    $ionicPopover.fromTemplateUrl('templates/detailsmenu.html', {
-        scope: $scope,
-    }).then(function (popover) {
-        $scope.popover = popover;
-    });
-
-    $scope.deleteSchedule = function () {
-        $scope.popover.hide();
-        $scope.popup.isPopup = true;
-        showPopup.confirm('是否删除该日程?', '是', '否').then(function (res) {
-            if (res) {
-                Schedule.deleteEvent($scope.details.content, $scope.details.start_date);
-                Schedule.schedule.delete({'id': id}, function () {
-                    $scope.$emit('ScheduleDoRefresh');
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.deleteMember = function () {
-        $scope.popup.isPopup = true;
-        showPopup.confirm('退出后,你将不再参与该日程', '是', '否').then(function (res) {
-            if (res) {
-                Schedule.deleteEvent($scope.details.content, $scope.details.start_date);
-                Schedule.schedulemenber.delete({'schedule_id': id}).then(function () {
-                    $scope.$emit('ScheduleDoRefresh');
-                    $ionicHistory.goBack();
-                });
-            }
-        });
-    }
-
-    $scope.edit = function () {
-        $scope.popover.hide();
-        $state.go('schedule-create', {
-            'id': $scope.details.id
-        })
-    }
-
-    $scope.doRefresh = function () {
-        global.refresh = true;
-        getscheduledetails();
-    }
-
-    function getscheduledetails() {
-        if (global.user.token != "") {
-            if ($scope.details == undefined) {
-                $scope.loading = true;
-            }
-            Schedule.schedule.get({'id': id}, function (res) {
-                Schedule.scheduleDetails = _.clone(res);
-                console.log(res);
-                $scope.details = res;
-//              $scope.execute_dd_title = Schedule.getDateTimeTitle(res.execute_dd);
-                $scope.scheduleMemberNames = Schedule.getMemberTitle(res.schedulemembers);
-                $scope.repeat_req_title = Schedule.getRepeatFreqTitle(res.repeat_type, res.freq);
-                $scope.isShowRemoveMember = _.find(res.schedulemembers, function (user) {
-                    return user.user_id == global.user.usrid;
-                });
-                $scope.isOver = false;
-                if ($scope.details.end_date != null && new Date() > new Date($scope.details.end_date))
-                    $scope.isOver = true;
-//              //是否过期
-//              var currentDateTime = new Date();
-//              var executeddTime = new Date(Date.parse($scope.data.execute_dd));
-//              if (($scope.data.end_date != null && new Date(Date.parse($scope.data.end_date)) < currentDateTime) && currentDateTime > executeddTime ||
-//                      ($scope.data.repeat_type == 0 && $scope.data.start_date != null && new Date(Date.parse($scope.data.start_date)) < currentDateTime)) {
-//                  $scope.isOver = true;
-//              } else {
-//                  $scope.isOver = false;
-//              }
-            }, function (err) {
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.refreshComplete');
-                $scope.loading = false;
-            })
-        }
-    }
-
-    ScheduleDetailDoRefresh = $rootScope.$on('ScheduleDetailDoRefresh', function (event, data) {
-       getscheduledetails();
-    });
-
-    $scope.$on("$destroy", function () {
-        $scope.popover.remove();
-        ScheduleDetailDoRefresh();
-    });
-});

+ 0 - 53
www/apps/schedule/js/directive.js

@@ -1,53 +0,0 @@
-starter.directive('schedule', [
-    function () {
-        return {
-            restrict: "E",
-            scope: {
-                data: "=source",
-            },
-            templateUrl: 'templates/template-schedule.html',
-            controller: function ($scope, Schedule) {
-                if ($scope.data.start_date != null) {
-                    var datetitle = "";
-                    $scope.isOver = false;
-                    if ($scope.data.end_date != null && new Date() > new Date($scope.data.end_date))
-                    	$scope.isOver = true;
-//                  var currentDateTime = new Date();
-//                  var executeddTime = new Date(Date.parse($scope.data.execute_dd));
-//                  if (($scope.data.end_date != null && new Date(Date.parse($scope.data.end_date)) < currentDateTime) && currentDateTime > executeddTime ||
-//                          ($scope.data.repeat_type == 0 && $scope.data.start_date != null && new Date(Date.parse($scope.data.start_date)) < currentDateTime)) {
-//                      $scope.isOver = true;
-//                  } else {
-//                      $scope.isOver = false;
-//                  }
-//                  
-//                  if ($scope.data.execute_dd != null) {
-//                      var execute_temp = new Date(Date.parse($scope.data.execute_dd));
-//                      var minutes_str = execute_temp.getMinutes().toString();
-//                      var hours_str = execute_temp.getHours().toString();
-//                      if (parseInt(minutes_str) < 10) {
-//                          minutes_str = "0" + minutes_str;
-//                      }
-//                      if (parseInt(hours_str) < 10) {
-//                          hours_str = "0" + hours_str;
-//                      }
-//                      if (currentDateTime.getFullYear() == executeddTime.getFullYear() && currentDateTime.getMonth() == executeddTime.getMonth() &&
-//                              currentDateTime.getDate() == executeddTime.getDate()) {
-//                          datetitle = '今天' + " " + hours_str + ":" + minutes_str;
-//                      } else {
-//                          var year_str = "";
-//                          if (currentDateTime.getFullYear() != executeddTime.getFullYear()) {
-//                              year_str = executeddTime.getFullYear() + "年";
-//                          }
-//                          var Week = ['日', '一', '二', '三', '四', '五', '六'];
-//                          datetitle = year_str + (execute_temp.getMonth() + 1) + "月" + execute_temp.getDate() + "日 " + " 周" + Week[execute_temp.getDay()] + " " + hours_str + ":" + minutes_str;
-//                      }
-//                  }
-                    
-//                  $scope.execute_dd_title = datetitle;
-                    $scope.repeat_req_title = Schedule.getRepeatFreqTitle($scope.data.repeat_type, $scope.data.freq);
-                }
-            }
-        }
-    }
-]);

+ 0 - 176
www/apps/schedule/js/factory.js

@@ -1,176 +0,0 @@
-starter.factory('Schedule', function ($resource, $cordovaCalendar, $q, cfg, formatFilter, showPopup) {
-    var schedule = {};
-    var recurrenceByDayData = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
-    var week = ['日', '一', '二', '三', '四', '五', '六'];
-    
-    function getRecurrenceByDay (days) {
-        var arr = [];
-        _.each(days, function (item) {
-            arr.push(recurrenceByDayData[item])
-        })
-        return arr.join(',');
-    }
-    
-    function createEventOptions (content, start_date, end_date, repeat_type, freq, notification_type) {
-        var options = {
-            title: content,
-            notes: 'Linker+',
-            startDate: new Date(start_date),
-            endDate: new Date(start_date)
-        }
-        
-        if (repeat_type == 1) {
-            options.recurrence = 'daily';
-            options.recurrenceInterval = freq;
-        } else if (repeat_type == 2) {
-            options.recurrence = 'weekly';
-            options.recurrenceByDay = getRecurrenceByDay(freq);
-        } else if (repeat_type == 3) {
-            options.recurrence = 'monthly'
-            options.recurrenceByMonthDay = freq.join(',');
-        } else if (repeat_type == 4) {
-            options.recurrence = 'yearly'
-        }
-        
-        if (notification_type == 1) {
-            options.firstReminderMinutes = 0;
-        } else if (notification_type == 2) {
-            options.firstReminderMinutes = 5;
-        } else if (notification_type == 3) {
-            options.firstReminderMinutes = 15;
-        } else if (notification_type == 4) {
-            options.firstReminderMinutes = 30;
-        } else if (notification_type == 5) {
-            options.firstReminderMinutes = 60;
-        } else if (notification_type == 6) {
-            options.firstReminderMinutes = 120;
-        } else if (notification_type == 7) {
-            options.firstReminderMinutes = 300;
-        }
-        
-        if (end_date) {
-            if (!(end_date instanceof Date)) {
-            	end_date = new Date(end_date);
-            }
-            options.recurrenceEndDate = end_date;
-        }
-        
-        return options;
-    }
-    
-    schedule.scheduleDetails = {};
-    
-    schedule.schedule = $resource(formatFilter('{0}schedule/schedule/:id/', cfg.api));
-    schedule.schedulemember = $resource(formatFilter('{0}schedule/schedule/:id/', cfg.api));
-    
-    schedule.notificationType = {
-        "0":"不提醒",
-        "1":"事件发生时",
-        "2":"提前5分钟",
-        "3":"提前15分钟",
-        "4":"提前30分钟",
-        "5":"提前1小时",
-        "6":"提前2小时",
-        "7":"提前5小时"
-    }
-    
-    schedule.repeatType = {
-        "0":"永不",
-        "1":"每天",
-        "2":"每周",
-        "3":"每月",
-        "4":"每年"
-    }
-
-    schedule.weekDay = {
-        "1":"周一",
-        "2":"周二",
-        "3":"周三",
-        "4":"周四",
-        "5":"周五",
-        "6":"周六",
-        "0":"周日"
-    }
-    
-    schedule.checkSchedule = function (schedules) {
-        if (schedules.content == null && schedules.content == '') {
-            showPopup.PopupWindow(0, '请输入日程内容', false);
-            return false;
-//      } else if (schedules.schedulemembers.length == 0) {
-//          showPopup.PopupWindow(0, '请选择成员', false);
-//          return false;
-        } else {
-            return true;
-        }
-    }
-    
-    schedule.createEventWithOptions = function (content, start_date, end_date, repeat_type, freq, notification_type) {
-        var deferred = $q.defer();
-        var options = createEventOptions(content, start_date, end_date, repeat_type, freq, notification_type);
-        $cordovaCalendar.createEventWithOptions(options).then(function (result) {
-            deferred.resolve(true);
-        }, function (err) {
-            showPopup.PopupWindow(0, '日程创建失败,请重试');
-            deferred.resolve(false);
-        });
-        return deferred.promise;
-    }
-    
-    schedule.deleteEvent = function (content, start_date) {
-        var deferred = $q.defer();
-        var options = createEventOptions(content, start_date);
-        options.endDate = options.endDate.setMonth(options.endDate.getMonth() + 1);
-        $cordovaCalendar.deleteEvent(options);
-    }
-    
-    schedule.getRepeatFreqTitle = function (type, freq) {
-        var title = '';
-        //0:永不,1:每天 2:每周,3:每月,4:每年
-        if (typeof freq === 'string')
-        	freq = freq.split(',');
-        if (type == '0') {
-            title = '不重复';
-        } else if (type == '1') {
-            title = '每' + freq + '天一次';
-        } else if (type == '2') {
-            _.each(freq, function (item) {
-                title += '周' + week[item] + '、';
-            })
-            title = '每' + title.substring(0, title.lastIndexOf('、'));
-        } else if (type == '3') {
-            _.each(freq, function (item) {
-                title += item + '日、';
-            })
-//          title = '每月' + freq.join('日、');
-            title = '每月' + title.substring(0, title.lastIndexOf('、'));
-        } else if (type == '4') {
-            title = '每年';
-        }
-        return title;
-    }
-    
-    schedule.getDateTimeTitle = function (date) {
-        var title = '';
-        if (!(date instanceof Date))
-        	date = new Date(date);
-        var minutes_str = date.getMinutes().toString();
-        var hours_str = date.getHours().toString();
-        if (parseInt(minutes_str) < 10) {
-            minutes_str = '0' + minutes_str;
-        }
-        if (parseInt(hours_str) < 10) {
-            hours_str = '0' + hours_str;
-        }
-        year_str = date.getFullYear() + '年';
-        title = year_str + (date.getMonth() + 1) + '月' + date.getDate() + '日 ' + ' 周' + week[date.getDay()] + ' ' + hours_str + ':' + minutes_str;
-        return title;
-    }
-    
-    schedule.getMemberTitle = function (member) {
-        return _.map(member, function(user) {
-            return user.username;
-        }).join('、');
-    }
-    
-    return schedule;
-});

+ 0 - 25
www/apps/schedule/js/route.js

@@ -1,25 +0,0 @@
-starter.config(function ($stateProvider) {
-    $stateProvider.state('schedule', {
-        url: '/index',
-        templateUrl: 'templates/schedule.html',
-        controller: 'ScheduleCtrl'
-    })
-
-    .state('schedule-posted', {
-        url: '/schedule/schedule-posted',
-        templateUrl: 'templates/schedule-posted.html',
-        controller: 'SchedulePostedCtrl'
-    })
-
-    .state('schedule-create', {
-        url: '/schedule-create/:id',
-        templateUrl: 'templates/schedule-create.html',
-        controller: 'ScheduleCreateCtrl'
-    })
-
-    .state('schedule-details', {
-        url: '/schedule/schedule-details/:id',
-        templateUrl: 'templates/schedule-details.html',
-        controller: 'ScheduleDetailsCtrl'
-    })
-});

+ 0 - 13
www/apps/schedule/templates/modal-selectrepeatenddd.html

@@ -1,13 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar>
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="closeRepeatendddModal(ok)">&nbsp;返回</button>
-        <h1 class="title">结束重复</h1>
-    </ion-header-bar>
-    <ion-content>
-        <ion-list>
-            <!-- <ion-radio ng-model="data.repeatenddd_id"  ng-click="changerepeatenddd(key)" ng-value="key" ng-repeat="(key,value) in repeatendddHt">{{value}}</ion-radio> -->
-            <ion-radio ng-model="data.repeat_end_date_type" ng-value="'1'" ng-click="changeRepeatendddId('1')">一直重复</ion-radio>
-            <ion-radio ng-model="data.repeat_end_date_type" ng-value="'2'" ng-click="chooseDate()">结束日期 {{data.end_date == null ? "" : data.end_date | date:'yyyy-MM-dd' }}</ion-radio>
-        </ion-list>
-    </ion-content>
-</ion-modal-view>

+ 0 - 102
www/apps/schedule/templates/modal-selectrepeatid.html

@@ -1,102 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar>
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="closeRepeatIdModal(ok)">&nbsp;返回</button>
-        <h1 class="title">重复</h1>
-    </ion-header-bar>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <div class="item item-icon-right">提醒
-            <span class="item-note">{{ repeatHt[data.repeat_type] }}</span>
-        </div>
-        <ion-list>
-            <ion-radio ng-model="data.repeat_type" ng-click="changeRepeatId(key)" ng-value="key" ng-repeat="(key,value) in repeatHt">{{value}}</ion-radio>
-        </ion-list>
-        <div ng-show="data.repeat_type == 1">
-            <div style="padding:10px">
-                <span style="font-size:12px;">选择重复频率</span>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[data.freq == item ]"
-                     ng-repeat="item in [1,2,3]" ng-click="changeDayRepeatfreqIdColor(item)">
-                    每{{item}}天
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[data.freq == 4 ]"
-                     ng-click="changeDayRepeatfreqIdColor('4')">
-                    每4天
-                </div>
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[data.freq == 5 ]"
-                     ng-click="changeDayRepeatfreqIdColor('5')">
-                    每5天
-                </div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-            </div>
-
-        </div>
-        <div ng-show="data.repeat_type == 2">
-            <div style="padding:10px">
-                <span style="font-size:12px;">选择每周哪几天,日程重复</span>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqWeekDayHt[item]]"
-                     ng-repeat="item in [1,2,3,4,5]" ng-click="changeWeekDayRepeatfreqIdColor(item)">
-                    {{ weekDayHt[item] }}
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqWeekDayHt['6']]"
-                     ng-click="changeWeekDayRepeatfreqIdColor('6')">{{ weekDayHt["6"] }}
-                </div>
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqWeekDayHt['0']]"
-                     ng-click="changeWeekDayRepeatfreqIdColor('0')">{{ weekDayHt["0"] }}
-                </div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-
-            </div>
-        </div>
-        <div ng-show="data.repeat_type == 3">
-            <div style="padding:10px">
-                <span style="font-size:12px;">选择每月哪几天,日程重复</span>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt[item]]"
-                     ng-click="changeMonthDayRepeatfreqIdColor(item)" ng-repeat="item in [1,2,3,4,5,6,7]">{{item}}
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt[item]]"
-                     ng-click="changeMonthDayRepeatfreqIdColor(item)" ng-repeat="item in [8,9,10,11,12,13,14]">{{item}}
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt[item]]"
-                     ng-click="changeMonthDayRepeatfreqIdColor(item)" ng-repeat="item in [15,16,17,18,19,20,21]">{{item}}
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt[item]]"
-                     ng-click="changeMonthDayRepeatfreqIdColor(item)" ng-repeat="item in [22,23,24,25,26,27,28]">{{item}}
-                </div>
-            </div>
-            <div class="row">
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt['29']]"
-                     ng-click="changeMonthDayRepeatfreqIdColor('29')">29
-                </div>
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt['30']]"
-                     ng-click="changeMonthDayRepeatfreqIdColor('30')">30
-                </div>
-                <div class="col center" ng-style="{true:repeatfreqstyleactive,false:repeatfreqstyleunactive}[repeatfreqMonthDayHt['31']]"
-                     ng-click="changeMonthDayRepeatfreqIdColor('31')">31
-                </div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-                <div class="col center" style="border:1px solid #ddd;background-color: #fff;"></div>
-            </div>
-        </div>
-
-    </ion-content>
-</ion-modal-view>

+ 0 - 11
www/apps/schedule/templates/modal-selectwarningid.html

@@ -1,11 +0,0 @@
-<ion-modal-view>
-    <ion-header-bar>
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="closeWarningIdModal(ok)">&nbsp;返回</button>
-        <h1 class="title">提醒</h1>
-    </ion-header-bar>
-    <ion-content>
-        <ion-list>
-            <ion-radio ng-model="data.notification_type" ng-click="changeWarningId(key)" ng-value="key" ng-repeat="(key,value) in warningHt">{{value}}</ion-radio>
-        </ion-list>
-    </ion-content>
-</ion-modal-view>

+ 0 - 40
www/apps/schedule/templates/schedule-create.html

@@ -1,40 +0,0 @@
-<ion-view view-title="新建日程" hide-back-button="true">
-    <ion-nav-buttons side="left">
-        <button class="button button-clear" ng-click="goBack()">取消</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="addSchedule()">完成</button>
-    </ion-nav-buttons>
-    <ion-content>
-        <div class="item item-divider"></div>
-        <div class="mission-create-content">
-            <div class="item item-input">
-                <textarea rows="6" ng-model="data.content" placeholder="输入日程内容"></textarea>
-            </div>
-        </div>
-        <div class="item item-divider"></div>
-        <a class="item item-icon-right" ng-click="chooseStartddDate()">时间
-            <span class="item-note">{{data.start_date_title}}</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <a class="item item-icon-right item-text-wrap over-flow-auto" ng-click="showRepeatIdModal()">
-            <span>重复</span>
-            <span class="item-note max-width-45">{{data.repeat_freq_title}}</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <a class="item item-icon-right" ng-click="showRepeatendddModal()" ng-show="data.repeat_type != 0">结束重复
-            <span class="item-note">{{data.end_date == null ? "一直重复" : data.end_date | date:'yyyy-MM-dd' }}</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider"></div>
-        <!--<a class="item item-icon-right" ng-click="selectmember()">成员
-            <span class="item-note">{{ sel_member_names }}</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-        <div class="item item-divider"></div>-->
-        <a class="item item-icon-right" ng-click="showWarningIdModal()">提醒
-            <span class="item-note">{{ warningHt[data.notification_type] }}</span>
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>
-    </ion-content>
-</ion-view>

+ 0 - 41
www/apps/schedule/templates/schedule-details.html

@@ -1,41 +0,0 @@
-<ion-view view-title="日程详情">
-    <ion-nav-buttons side="right">
-        <button class="button button-icon ion-ios-more" ng-click="popover.show($event)"></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-class="{true:'item-icon-right schedule-details-header-disable',false:'item-icon-right schedule-details-header'}[isOver]">
-            <!--<p>{{execute_dd_title}}</p>-->
-            <!--<span>{{details.create_user_name}}安排的日程</span>-->
-            <span>我的日程</span>
-            <i class="icon icon-Expired1 schedule-icon-position1" ng-if="isOver"></i>
-        </ion-item>
-        <ion-item ng-if="!loading" class="item-icon-right">
-            <p ng-bind-html="details.content | SwitchHtmlContent"></p>
-        </ion-item>
-        <!--<ion-item class="item-icon-left">
-            <i class="icon ion-ios-person-outline"></i>
-            <p>日程人员:{{scheduleMemberNames}}</p>
-        </ion-item>-->
-        <ion-item ng-if="!loading" class="item-icon-left item-text-wrap" ng-show="details.repeat_type != 0">
-            <i class="icon ion-ios-infinite-outline"></i>
-            <p>{{ details.repeat_type != "0" ? repeat_req_title + "重复" : ""}} {{ details.end_date == null ? "" : details.end_date | date:'yyyy-MM-dd' }}
-                {{details.end_date == null ? "" : "结束" | date:'yyyy-MM-dd' }}</p>
-        </ion-item>
-    </ion-content>
-    <div class="tabs tabs-icon-left schedule-details-footer" ng-show="isShowRemoveMember">
-        <button class="button button-full button-light account-botton" ng-click="deleteMember(removeSchdulememberId)">退出日程
-        </button>
-    </div>
-    <script id="templates/detailsmenu.html" type="text/ng-template">
-        <ion-popover-view ng-class="{true:'details-popup',false:'details-popup-other'}[cssstyle]" style="width:100px;height:100px">
-            <ion-content>
-                <ion-list>
-                    <ion-item class="item item-button" ng-click="edit()" ng-show="!isOver">编辑</ion-item>
-                    <ion-item class="item item-button" ng-click="deleteSchedule()">删除</ion-item>
-                </ion-list>
-            </ion-content>
-        </ion-popover-view>
-    </script>
-</ion-view>

+ 0 - 16
www/apps/schedule/templates/schedule-posted.html

@@ -1,16 +0,0 @@
-<ion-view view-title="我安排的日程">
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toadd()">
-            <i class="icon ion-android-add"></i>
-        </button>
-    </ion-nav-buttons>
-    <ion-content ng-class="{true:'overflow-hidden',false:''}[!Ishidded]">
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div class="schedule-data" ng-if="!loading">
-            <schedule source="schedule" ng-repeat="schedule in schedules.results" ng-click="todetails(schedule.id)"></schedule>
-        </div>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <h4 class="stable center" ng-show="schedules != undefined && schedules.next == null && schedules.results.length > 10">没有更多了</h4>
-    </ion-content>
-</ion-view>

+ 0 - 23
www/apps/schedule/templates/schedule.html

@@ -1,23 +0,0 @@
-<ion-view view-title="日程提醒">
-    <ion-nav-buttons side="left">
-        <button class="button ion-chevron-left button-clear button-dark" ng-click="goBack()">&nbsp;返回</button>
-    </ion-nav-buttons>
-    <ion-nav-buttons side="right">
-        <button class="button button-clear" ng-click="toadd()">
-            <i class="icon ion-android-add">&nbsp;&nbsp;</i>
-        </button>
-    </ion-nav-buttons>
-    <ion-content>
-        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
-        <!--<a class="item item-icon-right" href="#/schedule/schedule-posted">我安排的日程
-            <i class="icon ion-chevron-right icon-accessory"></i>
-        </a>-->
-        <ion-spinner ng-if="loading" class="center init-load" icon="android"></ion-spinner>
-        <div class="item item-divider schedule-data-receive">我的日程</div>
-        <div ng-if="!loading">
-            <schedule source="schedule" ng-repeat="schedule in schedules.results" ng-click="todetails(schedule)"></schedule>
-        </div>
-        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
-        <h4 class="stable center" ng-show="schedules != undefined && schedules.next == null && schedules.results.length > 10">没有更多了</h4>
-    </ion-content>
-</ion-view>

+ 0 - 13
www/apps/schedule/templates/template-schedule.html

@@ -1,13 +0,0 @@
-<div class="item" ng-class="{true:'item-stable',false:'item-click-active'}[isOver]">
-    <p class="schedule-template-1">
-        {{execute_dd_title}}
-    </p>
-    <p class="schedule-template-2" ng-bind-html="data.content | SwitchHtmlContent">
-    </p>
-    <p class="schedule-template-3" ng-show="!isOver">
-        <i class="icon ion-ios-infinite-outline" ng-if="data.repeat_type != 0"></i>
-        {{ data.repeat_type != "0" ? repeat_req_title : ""}} {{ data.end_date == null ? "" : data.end_date | date:'yyyy-MM-dd' }}
-        {{data.end_date == null ? "" : "结束" | date:'yyyy-MM-dd' }}
-    </p>
-    <i class="icon icon-Expired schedule-icon-position" ng-if="isOver"></i>
-</div>

+ 0 - 49
www/apps/task/index.html

@@ -1,49 +0,0 @@
-<!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">
-        返回
-    </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>

+ 0 - 1192
www/apps/task/js/controllers.js

@@ -1,1192 +0,0 @@
-starter.controller('TaskCtrl', function ($rootScope, $scope, $state, _, global, Task) {
-    $scope.nexturl = null;
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.toadd = function () {
-        $state.go('task-create');
-    };
-
-    $scope.toman = function () {
-        $state.go('task-man');
-    };
-
-    $scope.todetails = function (item) {
-        $state.go('task-details', {
-            id: item.id
-        });
-    };
-
-    $scope.totansfer = function () {
-        $state.go('transfer');
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.nexturl != null) {
-            gettaskdata();
-        }
-    };
-
-    function gettaskdata() {
-        if (global.user.token != "") {
-            Task.task($scope.nexturl).get({'type': 'received'}, function (res) {
-                var olddata = [];
-                if ($scope.nexturl != null) {
-                    olddata = _.map($scope.Task, _.clone);
-                }
-                $scope.nexturl = res.next;
-                res.results = _.sortBy(res.results, 'create_date').reverse();
-                res.results = _.sortBy(res.results, 'is_completed');
-                $scope.Task = res.results;
-                $scope.Task = olddata.concat($scope.Task);
-            }, function (err) {
-                $scope.loading = false;
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                alert(JSON.stringify(err));
-            }).$promise.finally(function () {
-                $scope.$broadcast('scroll.infiniteScrollComplete');
-                $scope.loading = false;
-            });
-        }
-    }
-
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        if ($scope.Task == undefined) $scope.loading = true;
-        global.fetch_user().then(function () {
-            gettaskdata();
-            $scope.roleid = global.user.roleid;
-        }, function (err) {
-            alert(JSON.stringify(err));
-            $scope.loading = false;
-        });
-    });
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-    })
-})
-
-.controller('TaskManCtrl', function ($rootScope, $scope, $ionicModal, Task, global) {
-    var modal = $ionicModal.fromTemplateUrl('templates/taskruleset-modal.html', {
-        scope: $scope,
-        animation: 'slide-in-right'
-    });
-
-    var old_data = null;
-    $scope.openModal = function () {
-        modal.then(function (m) {
-            $rootScope.commons.modal = m;
-            $rootScope.commons.modal.show();
-            $scope.itemdata = _.clone(old_data);
-        })
-    };
-
-    $scope.init = function () {
-        global.fetch_user().then(function (data) {
-            Task.taskpreferences.get({'key': 'task_rule'}, function (data) {
-                old_data = _.clone(data);
-            }, function (err) {
-                old_data = {'key': 'task_rule', 'value': 1};
-            }).$promise.finally(function () {
-                $scope.itemdata = _.clone(old_data);
-            });
-        });
-    };
-
-    $scope.closeModal = function () {
-        $rootScope.commons.modal.hide();
-    };
-
-    $scope.$on('$destroy', function () {
-        $rootScope.commons.modal.remove();
-    });
-
-    $scope.ok = function () {
-        $scope.closeModal();
-        if (old_data.value == $scope.itemdata.value)
-            return;
-        Task.taskpreferences.save($scope.itemdata, function (data) {
-            old_data = _.clone(data);
-            $scope.itemdata = _.clone(old_data);
-        });
-    };
-})
-
-.controller('PostedTaskCtrl', function ($rootScope, $scope, $state, $ionicHistory, $ionicScrollDelegate, Task, Member, global) {
-    $scope.nexturl = null;
-    var taskall = [];
-    $scope.totalcount = 0;
-    $scope.Ishidded = true;
-    $scope.headerion = {
-        leftion: true,
-        rightion: true
-    };
-    $scope.leftdata = [{
-        id: 0,
-        name: '最新发布',
-        check: true,
-        key: 'create_date'
-    }, {
-        id: 1,
-        name: '最近更新',
-        check: false,
-        key: 'last_modified'
-    }, {
-        id: 2,
-        name: '截止时间',
-        check: false,
-        key: 'end_dd'
-    }];
-    $scope.rightdata = [{
-        id: 0,
-        name: '全部成员',
-        check: true,
-        key: ''
-    }, {
-        id: 1,
-        name: '选择单个成员',
-        check: false
-    }];
-    $scope.title = [{
-        id: 0,
-        name: '最新发布'
-    }, {
-        id: 1,
-        name: '全部成员'
-    }];
-
-    var beforeenter = $scope.$on('$ionicView.beforeEnter', function () {
-        $rootScope.goBackRoute = 'postedtask';
-        if ($scope.Task == undefined) $scope.loading = true;
-        global.fetch_user().then(function () {
-            if (Member.selectedemplst.length > 0) {
-                $scope.rightdata[1].name = '选择单个成员(' + Member.selectedemplst[0].username + ')';
-                $scope.title[1].name = Member.selectedemplst[0].username;
-                getdata(Member.selectedemplst[0].user_id);
-                Member.selectedemplst = [];
-            } else {
-                //打开的selecetmemer 页面但是点了取消
-                if ($scope.rightdata[1].name.length > 6) {
-                    setrightcheck(false, true);
-                } else {
-                    setrightcheck(true, false);
-                    getdata();
-                }
-            }
-        });
-    });
-
-    $scope.leftdisplay = function () {
-        setdisplay('rightion', 'leftion');
-    };
-    $scope.rightdisplay = function () {
-        setdisplay('leftion', 'rightion');
-    };
-
-    $scope.toadd = function () {
-        $state.go('task-create');
-    };
-
-    $scope.backhide = function () {
-        $scope.headerion = {
-            leftion: true,
-            rightion: true
-        };
-        $scope.Ishidded = !$scope.Ishidded;
-    };
-
-    $scope.change = function (op, item) {
-        if (op == 'f') {
-            if ($scope.title[0].name != item.name) {
-                $scope.title[0].name = item.name;
-                $scope.Task = _.sortBy(_.sortBy($scope.Task, item.key).reverse(), 'is_completed');
-                $scope.rightdata[0].key = item.key;
-            }
-        } else {
-            if ($scope.rightdata[1].id == item.id) {
-                setrightcheck(false, true);
-                Member.titlename = "选择单个成员";
-                Member.routename = 'postedtask';
-                Member.selectedemplst = [];
-                $state.go('selectsinglemember');
-            } else {
-                $scope.nexturl = null;
-                getdata();//all
-                $scope.title[1].name = "全部成员";
-                $scope.rightdata[1].name = '选择单个成员';
-                setrightcheck(true, false);
-            }
-        }
-        $scope.backhide();
-    };
-
-    $scope.todetails = function (item) {
-        $state.go('task-details', {
-            id: item.id
-        });
-    };
-
-    $scope.loadMore = function () {
-        if ($scope.nexturl != null) getdata();
-    };
-
-    function setrightcheck(allcheck, singlecheck) {
-        $scope.rightdata[0].check = allcheck;
-        $scope.rightdata[1].check = singlecheck;
-    }
-
-    function getdata(usrid) {
-        var data = {'type': 'posted'};
-        if (usrid != undefined) {
-            data.usrid = usrid;
-            $scope.nexturl = null;
-        }
-        Task.task($scope.nexturl).get(data, function (res) {
-            $scope.Task = usrid != undefined ? [] : $scope.Task;
-            $scope.totalcount = res.count;
-            var olddata = [];
-            if ($scope.nexturl != null)
-                olddata = _.map($scope.Task, _.clone);
-            $scope.nexturl = res.next;
-            $scope.Task = olddata.concat(_.sortBy(res.results, 'is_completed'));
-            $scope.loading = false;
-        }, function (err) {
-            console.log(err);
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        }).$promise.finally(function () {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-            $ionicScrollDelegate.resize();
-            $scope.loading = false;
-        });
-    }
-
-    function setdisplay(key1, key2) {
-        // $scope.headerion[key1] = $scope.headerion[key1] ? true : false;
-        if (!$scope.Ishidded) {
-            $scope.headerion[key1] = !$scope.headerion[key1];
-        } else {
-            $scope.Ishidded = !$scope.Ishidded;
-        }
-
-        if (!$scope.headerion[key2] && !$scope.Ishidded) {
-            $scope.backhide();
-        } else {
-            $scope.headerion[key2] = !$scope.headerion[key2];
-        }
-    }
-
-    $scope.$on('$destroy', function () {
-        beforeenter = null;
-        Member.selectedemplst = [];
-    });
-})
-
-.controller('TaskCreateCtrl', function ($rootScope, $scope, $state, $ionicHistory, $ionicPopup,
-                                        $cordovaDatePicker, $timeout, $q, _, Task, Member, showPopup, ImageManage, Tool, formatFilter) {
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        $scope.popup = {
-            isPopup: false
-        };
-        if (Member.selectedemplst.length > 0) {
-            _.each(Member.selectedemplst, function (item) {
-                item.is_leader = 'F';
-                $scope.task.task_members.push(item);
-            });
-            Member.selectedemplst = [];
-        } else {
-            if (!$scope.task) {
-                init_task();
-            }
-        }
-    });
-
-    $scope.goback = function () {
-        if ($scope.task.content != null && $scope.task.content != '' || $scope.task.task_members.length > 0) {
-            showPopup.confirm('是否取消创建?', '是', '否').then(function (res) {
-                if (res) {
-                    $ionicHistory.goBack()
-                }
-            })
-        } else {
-            $ionicHistory.goBack();
-        }
-    };
-
-    $scope.selectmember = function () {
-        $scope.isremove = false;
-        Member.titlename = '选择任务成员';
-        Member.routename = '';
-        Member.resourcemember = $scope.task.task_members;
-        $state.go('selectmember');
-    };
-
-    $scope.remove = function (user, index) {
-        $scope.task.task_members.splice(index, 1);
-        if ($scope.task.task_members.length == 0) $scope.isremove = false;
-    };
-
-    $scope.isremove = false;
-    $scope.changeRemove = function (flag) {
-        $scope.isremove = !flag;
-    };
-
-    $scope.showModal = function () {
-        showPopup.modalTemplate('templates/modal-selectadmin.html', 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        });
-    };
-
-    $scope.closeModal = function () {
-        $rootScope.commons.modal.hide();
-    };
-
-    $scope.changeAdmin = function (item, index) {
-        $scope.isremove = false;
-        $scope.closeModal();
-        $scope.task.task_members.splice(index, 1);
-        $scope.task.task_members.splice(0, 0, item);
-    };
-
-    $scope.addTask = function () {
-        if (Task.check($scope.task)) {
-            showPopup.showLoading(1, '正在提交', true, $scope.image_list.length > 0 ? 20000 : 10000);
-            var task = angular.copy($scope.task);
-            task.leader = task.task_members[0].user_id;
-            task.task_members[0].is_leader = 'T';
-            task.task_members = _.map(task.task_members, function (m) {
-                return {'user': m.user_id, 'is_leader': m.is_leader}
-            });
-            Task.task(null).save(task, function (data) {
-                if ($scope.image_list.length == 0) {
-                    showPopup.hideLoading();
-                    godetail(data.id);
-                    init_task();
-                    return;
-                }
-                ImageManage.uploadImage($scope.image_list, 'task', data.id, 'taskfile').then(function (res) {
-                    $q.all(res).then(function (res1) {
-                        showPopup.hideLoading();
-                        godetail(data.id);
-                        init_task();
-                    }, function (err) {
-                        showPopup.hideLoading();
-                        alert(JSON.stringify(err));
-                    });
-                }, function (err) {
-                    showPopup.hideLoading();
-                    showPopup.PopupWindow(1, 'get upload token fail!');
-                });
-            }, function (err) {
-                console.log(err);
-                showPopup.hideLoading()
-            });
-        }
-    };
-
-    var flag = true;
-    $scope.chooseDate = function () {
-        if (flag) {
-            flag = false;
-            var options = {
-                mode: 'date',
-                date: $scope.task.end_dd == null ? new Date() : $scope.task.end_dd,
-                androidTheme: 3
-            };
-            $cordovaDatePicker.show(options).then(function (date) {
-                if (date == undefined) return;
-                $scope.task.end_dd = date;
-                flag = true;
-            }, function (cancel) {
-                flag = true;
-            });
-        }
-    };
-
-    $scope.shouBigImage = function (imageName) { //传递一个参数(图片的URl)
-        $scope.Url = imageName; //$scope定义一个变量Url,这里会在大图出现后再次点击隐藏大图使用
-        $rootScope.commons.bigImage = true; //显示大图
-    };
-
-    $rootScope.commons.bigImage = false; //初始默认大图是隐藏的
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.deleteimage = function () {
-        $scope.image_list.splice(_.indexOf($scope.image_list, $scope.Url), 1);
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.image_list = [];
-    $scope.addphoto = function () {
-        if ($scope.image_list.length == $rootScope.commons.upload_maxcount) {
-            showPopup.PopupWindow(0, formatFilter('最多可上传{0}张!', $rootScope.commons.upload_maxcount), false);
-            return;
-        }
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isPopup = true;
-    };
-
-    var ImagePicker = function () { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount - $scope.image_list.length).then(function (promises) {
-            $q.all(promises).then(function (res) {
-                $scope.image_list = $scope.image_list.concat(res);
-            }, function (error) {
-                alert(error);
-            });
-        });
-    };
-
-    var Camera = function () {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture().then(function (result) {
-            $scope.image_list.push(result);
-        });
-    };
-
-    function godetail(id) {
-        $ionicHistory.goBack();
-        $timeout(function () {
-            $state.go('task-details', {
-                id: id
-            })
-        });
-        Member.resourcemember = [];
-    }
-
-    function init_task() {
-        $scope.task = {
-            content: null,
-            end_dd: null,
-            create_date: null,
-            is_completed: 0,
-            task_members: []
-        };
-        $scope.image_list = [];
-    }
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-        if ($rootScope.commons.modal != null) $rootScope.commons.modal.remove();
-        Member.resourcemember = [];
-    })
-})
-
-.controller('TaskDetailsCtrl', function ($rootScope, $scope, $state, $stateParams, $ionicSlideBoxDelegate,
-                                         $ionicPopup, $ionicScrollDelegate, $timeout, $cordovaDatePicker, $ionicHistory, $q, showPopup, global, ImageManage, Member, Tool, Task, formatFilter) {
-    $scope.activeIndex = 0;
-    $scope.change = function (index) {
-        $scope.activeIndex = index;
-    };
-
-    $scope.goBack = function () {
-        global.goBack();
-    };
-
-    $scope.taskcomments = [];
-    $scope.taskhistory = [];
-    $scope.childtask = init_childtask();
-    $scope.postcommentdata = init_comment();
-    $scope.data = {};
-    $scope.childtasks = [];
-    $scope.lockSlide = function () {
-        $ionicSlideBoxDelegate.enableSlide(false);
-    };
-
-    var beforeenter = $scope.$on('$ionicView.beforeEnter', function () {
-        if ($scope.task == undefined) $scope.loading = true;
-        global.fetch_user().then(function () {
-            getTaskDetails();
-            getTaskComments();
-            gettaskhistory();
-        }, function (err) {
-            alert(JSON.stringify(err));
-        });
-        $scope.popup = {
-            isPopup: false
-        };
-    });
-
-    $scope.deletecomment = function (comment, index) {
-        if (comment.create_user.id == global.user.usrid) {
-            $scope.popup.optionsPopup = $ionicPopup.show({
-                template: '<div class="center customer-op" rj-close-back-drop><h4>用户操作</h4></div>',
-                scope: $scope,
-                buttons: [{
-                    text: '删除',
-                    type: 'button-positive',
-                    onTap: function (e) {
-                        $scope.taskcomments.splice(index, 1);
-                        Task.taskcomment(null).delete({'id': comment.id}, function (res) {
-
-                        });
-                    }
-                }]
-            });
-            $scope.popup.isPopup = true;
-        }
-    };
-
-    $scope.closeModal = function (op) {
-        if (op == 'select') {//选择负责人
-            $rootScope.commons.modal.hide();
-            return;
-        }
-        showPopup.confirm('是否取消创建?', '是', '否').then(function (res) {
-            if (res) {
-                $rootScope.commons.modal.hide();
-            }
-        });
-    };
-
-    // Cleanup the modal when we're done with it!
-    $scope.$on('$destroy', function () {
-        beforeenter = null;
-        if ($rootScope.commons.modal != null) $rootScope.commons.modal.remove();
-    });
-
-    //子任务复选框
-    $scope.changecheck = function (childtask) {
-        childtask.parent = $scope.task.id;
-        marktask(childtask, childtask.is_completed);
-    };
-
-    $scope.tocomment = function () {
-        $scope.postcommentdata = init_comment();
-        $scope.image_list = [];
-        $rootScope.commons.bigImage = false;
-        showPopup.modalTemplate('templates/modal-taskcomment.html', 'slide-in-up', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        })
-    };
-
-    var addchildmodal = null;
-    $scope.toaddchildtask = function () {
-        $scope.childtask = init_childtask();
-        showPopup.modalTemplate('templates/modal-addchildtask.html', 'slide-in-up', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-            addchildmodal = _.clone(modal);
-        });
-    };
-
-    $scope.addchildtask = function () {
-        if (Tool.trim($scope.childtask.content).length == 0) {
-            showPopup.PopupWindow(0, '请输入任务内容!', false);
-            return;
-        }
-        showPopup.showLoading(1, '正在提交', true);
-        var leader = $scope.childtask.leader;
-        if ($scope.childtask.leader != null) {
-            $scope.childtask.leader = $scope.childtask.leader.id;
-        }
-        Task.task(null).save($scope.childtask, function (data) {
-            showPopup.hideLoading();
-            data.leader = leader;
-            $scope.childtasks.splice(0, 0, data);
-            $scope.nexturl.history = null;
-            gettaskhistory();
-            $rootScope.commons.modal.hide();
-        }, function (error) {
-            showPopup.hideLoading();
-            alert("add childtask error:" + JSON.stringify(error));
-        });
-    };
-
-    var flag_end_dd = true;
-    $scope.checkend_dd = function () {
-        if (flag_end_dd) {
-            flag_end_dd = false;
-            var options = {
-                mode: 'date',
-                date: new Date($scope.childtask.end_dd == null ? new Date() : $scope.childtask.end_dd),
-                androidTheme: 3
-            };
-            $cordovaDatePicker.show(options).then(function (date) {
-                $timeout(function () {
-                    if (date == undefined) return;
-                    $scope.childtask.end_dd = date;
-                });
-                flag_end_dd = true;
-            });
-        }
-    };
-
-    $scope.setTask = function () {
-        Task.taskdetail = $scope.task;
-        Task.taskdetail.childtasks = $scope.childtasks;
-        Member.selectedemplst = [];
-        $state.go('task-set', {
-            id: $stateParams.id,
-            isheader: $scope.Isheader ? 1 : 0
-        });
-    };
-
-    $scope.postcomment = function () {
-        if ($scope.postcommentdata.content == '') {
-            showPopup.PopupWindow(0, '请输入评论内容!', false);
-            return;
-        }
-        showPopup.showLoading(1, '正在提交', true, $scope.image_list.length > 0 ? 20000 : 10000);
-        Task.taskcomment(null).save({'task_id': $stateParams.id}, $scope.postcommentdata, function (data) {
-            $scope.taskcomments.splice(0, 0, data);
-            if ($scope.image_list.length == 0) {
-                showPopup.hideLoading();
-                $rootScope.commons.modal.hide();
-                return;
-            }
-            ImageManage.uploadImage($scope.image_list, 'task', data.id, 'taskcommentfile').then(function (res) {
-                $q.all(res).then(function (res1) {
-                    data.task_comment_files = _.sortBy(_.map(res1, function (item) {
-                        return JSON.parse(item.response);
-                    }), 'id');
-                    showPopup.hideLoading();
-                    $rootScope.commons.modal.hide();
-                })
-            }, function (err) {
-                alert('upload image error' + err);
-                showPopup.hideLoading();
-            });
-        }, function (err) {
-            alert('commnet fail!');
-        });
-    };
-
-    $scope.toeditchildtask = function (id) {
-        if (($scope.data.leader.id == global.user.usrid) || ($scope.data.create_user.id == global.user.usrid)) {
-            Task.taskdetail = $scope.task;
-            Task.taskdetail.childtasks = $scope.childtasks;
-            $state.go('editchildtask', {
-                'id': id
-            });
-        }
-    };
-
-    $scope.checkheader = function () {
-        showPopup.modalTemplate('templates/modal-selectadmin.html', 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        });
-    };
-
-//标记任务完成或未完成
-    $scope.marktask = function (completeid) {
-        if (completeid == 1) {
-            if (_.findWhere($scope.childtasks, {is_completed: false}) == undefined) {
-                marktask($scope.data, completeid);
-                return;
-            }
-            showPopup.confirm('还有未完成的子任务,确定要完成吗?', '确定', '取消').then(function (res) {
-                if (res) {
-                    marktask($scope.data, completeid);
-                }
-            });
-        } else {
-            marktask($scope.data, completeid);
-        }
-    };
-
-    $scope.changeAdmin = function (user) {
-        $scope.childtask.leader = user.user;
-        $rootScope.commons.modal.hide();
-        $rootScope.commons.modal = addchildmodal;
-    };
-
-    $scope.image_list = [];
-    $scope.imagePicker = function () { //打开相册
-        if (!check_image()) return;
-        ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount).then(function (promises) {
-            $q.all(promises).then(function (res) {
-                $scope.image_list = $scope.image_list.concat(res);
-            }, function (error) {
-                alert(error);
-            });
-        });
-    };
-    $scope.Camera = function () {
-        if (!check_image()) return;
-        ImageManage.Camera_getPicture().then(function (result) {
-            $scope.image_list.push(result);
-        });
-    };
-    $scope.shouBigImage = function (imageName, event) { //传递一个参数(图片的URl)
-        if (event != undefined) {
-            event.stopPropagation();
-        }
-        $scope.Url = imageName;
-        $rootScope.commons.bigImage = true;
-    };
-
-    $scope.stopPropagation = function (event) {
-        if (event != undefined) {
-            event.stopPropagation();
-        }
-    }
-
-    $rootScope.commons.bigImage = false; //初始默认大图是隐藏的
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.deleteimage = function () {
-        $scope.image_list.splice(_.indexOf($scope.image_list, $scope.Url), 1);
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.nexturl = {'comment': null, 'history': null};
-    $scope.loadMore = function (type) {
-        if (type == 'history') {
-            gettaskhistory();
-        } else {
-            getTaskComments();
-        }
-    };
-
-    function check_image() {
-        if ($scope.image_list.length >= $rootScope.commons.upload_maxcount) {
-            showPopup.PopupWindow(0, formatFilter('最多可上传{0}张', $rootScope.commons.upload_maxcount), false);
-            return false
-        }
-        return true;
-    }
-
-    function getTaskDetails() {
-        Task.task(null).get({'id': $stateParams.id}, function (data) {
-            $scope.data = angular.copy(data);
-            var members = _.filter(data.task_members, function (item) {
-                return data.leader.id != item.user.id;
-            });
-            data.membernames = _.map(members, function (m) {
-                if (data.leader.id != m.user.id) return m.user.username;
-            }).join('、');
-            $scope.task = data;
-            $scope.Isheader = ($scope.task.create_user.id == global.user.usrid);
-            if ((data.create_user.id == global.user.usrid) || (data.leader.id == global.user.usrid)) {
-                $scope.is_disabledmark = false;
-            } else {
-                Task.taskpreferences.get({'key': 'task_rule'}, function (data) {
-                    $scope.is_disabledmark = data.value == '1';
-                });
-            }
-        }, function (err) {
-            console.log(err)
-        }).$promise.finally(function (res) {
-            $scope.loading = false;
-        });
-        //get child task
-        Task.taskchild.get({'id': $stateParams.id}, function (res) {
-            $scope.childtasks = _.sortBy(res.results, 'is_completed');
-        })
-    }
-
-    function marktask(data, is_completed) {
-        var task = angular.copy(data);
-        task.leader = task.leader.id;
-        task = _.omit(task, 'create_user', 'childtasks', 'task_files');
-        task.task_members = _.map(task.task_members, function (item) {
-            return {'is_leader': item.is_leader, 'user': item.user.id};
-        });
-        task.is_completed = is_completed;
-        showPopup.showLoading(1, '', false);
-        Task.task(null).update({'id': task.id}, task, function (data) {
-            $scope.nexturl.history = null;
-            gettaskhistory();
-            $scope.childtasks = _.sortBy($scope.childtasks, 'is_completed');
-            if (data.parent == null) $scope.task.is_completed = is_completed;
-        }, function (err) {
-            showPopup.PopupWindow(0, 'mark task fail!', false);
-        }).$promise.finally(function (res) {
-            showPopup.hideLoading();
-        })
-    }
-
-    function init_childtask() {
-        var childtask = {
-            content: '',
-            end_dd: null,
-            is_completed: 0,
-            leader: null,
-            parent: parseInt($stateParams.id),
-            task_members: []
-        };
-        return childtask;
-    }
-
-    function init_comment() {
-        return {"content": ''};
-    }
-
-    function getTaskComments() {
-        Task.taskcomment($scope.nexturl.comment).get({'task_id': $stateParams.id}, function (res) {
-            if ($scope.nexturl.comment != null)
-                $scope.taskcomments = $scope.taskcomments.concat(res.results);
-            else
-                $scope.taskcomments = res.results;
-            $scope.nexturl.comment = res.next;
-        }).$promise.finally(function (f) {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        });
-    }
-
-    function gettaskhistory() {
-        Task.taskhistory($scope.nexturl.history).get({'task_id': $stateParams.id}, function (res) {
-            if ($scope.nexturl.history != null)
-                $scope.taskhistory = $scope.taskhistory.concat(res.results);
-            else
-                $scope.taskhistory = res.results;
-            $scope.nexturl.history = res.next;
-        }).$promise.finally(function (f) {
-            $scope.$broadcast('scroll.infiniteScrollComplete');
-        });
-    }
-})
-
-.controller('TaskSetCtrl', function ($rootScope, $scope, $state, $cordovaDatePicker, $ionicHistory,
-                                     $timeout, $q, _, global, showPopup, Task, Member, ImageManage, Tool, formatFilter) {
-    var id = $state.params['id'];
-    var beforeEnter = $scope.$on("$ionicView.beforeEnter", function () {
-        $scope.popup = {
-            isPopup: false,
-            isSetPopup: false
-        };
-        if (Member.selectedemplst.length > 0) {
-            _.each(Member.selectedemplst, function (item) {
-                item.is_leader = 'F';
-                $scope.task.task_members.push(item)
-            });
-            Member.selectedemplst = [];
-            update_task();
-        } else {
-            $scope.task = angular.copy(Task.taskdetail);
-            $scope.user = global.user;
-            $scope.task.task_members = _.sortBy(_.map($scope.task.task_members, function (item) {
-                return {'user_id': item.user.id, 'username': item.user.username, 'is_leader': item.is_leader};
-            }), 'is_leader').reverse();
-            $scope.contentdata = $scope.task.content;
-        }
-        //获取是否为发布人
-        $scope.Isheader = $state.params['isheader'] == '1';
-    });
-
-    $scope.showModal = function (type) {
-        $scope.isremove = false;
-        var templateurl = type == 'select' ? 'templates/modal-selectadmin.html' : 'templates/modal-content.html';
-        showPopup.modalTemplate(templateurl, 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-            if (type == "content") $rootScope.commons.fun = clear_change;
-        })
-    };
-
-    $scope.closeModal = function (type, flag) {
-        $rootScope.commons.fun = null;
-        $rootScope.commons.modal.hide();
-        if (flag) clear_change();
-    };
-
-    $scope.selectmember = function () {
-        $scope.isremove = false;
-        Member.resourcemember = $scope.task.task_members;
-        Member.routename = '';
-        Member.titlename = '选择任务成员';
-        $state.go('selectmember');
-    };
-
-    $scope.remove = function (_user, index) {
-        if ($scope.task.task_members.length == 1) {
-            showPopup.PopupWindow(0, '负责人不能为空', false);
-            $scope.isremove = false;
-            return;
-        }
-        $scope.task.task_members.splice(index, 1);
-        update_task();
-    };
-
-    $scope.isremove = false;
-    $scope.changeRemove = function (flag) {
-        $scope.isremove = !flag;
-    };
-
-    $scope.changeAdmin = function (_user, index) {
-        $scope.isremove = false;
-        $scope.task.task_members.splice(index, 1);
-        $scope.task.task_members.splice(0, 0, _user);
-        _.each($scope.task.task_members, function (item) {
-            item.is_leader = 'F';
-        });
-        _user.is_leader = 'T';
-        $scope.task.leader.id = _user.user_id;
-        update_task();
-    };
-
-    $scope.updatecontent = function () {
-        if ($scope.image_list.length > 0) {
-            showPopup.showLoading(1, '', false, 20000);
-            ImageManage.uploadImage($scope.image_list, 'task', $scope.task.id, 'taskfile').then(function (res) {
-                $q.all(res).then(function (res1) {
-                    $scope.image_list = [];
-                    $scope.task.task_files = _.sortBy($scope.task.task_files.concat(_.map(res1, function (item) {
-                        return JSON.parse(item.response);
-                    })), 'id');
-                });
-                update_task();
-            })
-        } else {
-            update_task();
-        }
-        $rootScope.commons.fun = null;
-    };
-
-    var flag = true;
-    $scope.chooseDate = function () {
-        if (flag) {
-            flag = false;
-            var options = {
-                mode: 'date',
-                date: $scope.task.end_dd == null ? new Date() : new Date($scope.task.end_dd),
-                androidTheme: 3
-            };
-            $cordovaDatePicker.show(options).then(function (date) {
-                if (date == undefined) return;
-                $scope.task.end_dd = date;
-                update_task();
-                flag = true;
-            }, function (cancel) {
-                flag = true;
-            });
-        }
-    };
-
-    $scope.deleteTask = function () {
-        if ($scope.Isheader) {
-            $scope.popup.isPopup = true;
-            showPopup.confirm('是否删除该任务?', '是', '否').then(function (res) {
-                if (res) {
-                    showPopup.showLoading(1, '', false);
-                    Task.task(null).delete({'id': $scope.task.id}, function (data) {
-                        $ionicHistory.goBack(-2);
-                    }, function (err) {
-                        showPopup.PopupWindow(0, 'delete task fail!', false);
-                    }).$promise.finally(function (f) {
-                        showPopup.hideLoading();
-                    });
-                }
-            })
-        } else {
-            //任务成员退出任务
-            $scope.task.task_members.splice(_.findIndex($scope.task.task_members, {'user_id': global.user.usrid}), 1);
-            update_task();
-            $ionicHistory.goBack(-2);
-        }
-    };
-
-    $scope.image_list = [];
-    $scope.del_image_list = [];
-    $scope.shouBigImage = function (imageName) {
-        $scope.Url = imageName;
-        $rootScope.commons.bigImage = true;
-    };
-
-    $rootScope.commons.bigImage = false;
-    $scope.hideBigImage = function () {
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.deleteimage = function () {
-        if (_.indexOf($scope.image_list, $scope.Url) >= 0) {
-            $scope.image_list.splice(_.indexOf($scope.image_list, $scope.Url), 1);
-        } else {
-            var index = _.findIndex($scope.task.task_files, {'file_full_path': $scope.Url});
-            $scope.del_image_list.push($scope.task.task_files[index].id);
-            $scope.task.task_files.splice(index, 1);
-        }
-        $rootScope.commons.bigImage = false;
-    };
-
-    $scope.addphoto = function () {
-        if (($scope.image_list.length + $scope.task.task_files.length) == $rootScope.commons.upload_maxcount) {
-            showPopup.PopupWindow(0, formatFilter('最多可上传{0}张!', $rootScope.commons.upload_maxcount), false);
-            return;
-        }
-        $scope.popup.optionsPopup = showPopup.showSelectImgPopup(Camera, ImagePicker, $scope);
-        $scope.popup.isSetPopup = true;
-    };
-
-    function ImagePicker() { //打开相册
-        $scope.popup.optionsPopup.close();
-        ImageManage.ImagePicker_getPictures($rootScope.commons.upload_maxcount - ($scope.image_list.length + $scope.task.task_files.length)).then(function (promises) {
-            if (promises.length == 0) return;
-            $q.all(promises).then(function (res) {
-                $scope.image_list = $scope.image_list.concat(res);
-            }, function (error) {
-                alert(error);
-            });
-        });
-    }
-
-    function Camera() {
-        $scope.popup.optionsPopup.close();
-        ImageManage.Camera_getPicture().then(function (result) {
-            $scope.image_list.push(result);
-        });
-    }
-
-    function update_task() {
-        var task = angular.copy($scope.task);
-        task.task_files = $scope.del_image_list;
-        task.leader = task.leader.id;
-        task = _.omit(task, 'create_user', 'childtasks', 'membernames');
-        task.task_members = _.map(task.task_members, function (item) {
-            return {'is_leader': item.is_leader, 'user': item.user_id};
-        });
-        showPopup.showLoading(1, '', false);
-        Task.task(null).update({'id': task.id}, task, function (data) {
-            if ($rootScope.commons.modal != null) {
-                $rootScope.commons.modal.hide();
-                $rootScope.commons.modal = null;
-            }
-        }, function (err) {
-            showPopup.PopupWindow(0, 'update task fail!', false);
-        }).$promise.finally(function (f) {
-            showPopup.hideLoading();
-        });
-    }
-
-    function clear_change() {
-        $scope.task.content = Task.taskdetail.content;
-        $scope.task.task_files = angular.copy(Task.taskdetail.task_files);
-        $scope.image_list = [];
-        if ($rootScope.commons.bigImage) {
-            $rootScope.commons.bigImage = false;
-        } else {
-            $rootScope.commons.modal.hide();
-            $rootScope.commons.modal = null;
-        }
-    }
-
-    $scope.$on("$destroy", function () {
-        beforeEnter = null;
-        if ($rootScope.commons.modal != null) $rootScope.commons.modal.remove();
-        Member.resourcemember = [];
-        $rootScope.commons.fun = null;
-    })
-})
-
-.controller('EditChildTaskCtrl', function ($scope, $state, $stateParams, $cordovaDatePicker, $timeout, $ionicHistory, $rootScope, Task, Member, showPopup, formatFilter, Tool) {
-    $scope.data = _.pick(Task.taskdetail, 'childtasks', 'task_members');
-    $scope.task = _.find($scope.data.childtasks, function (c) {
-        return parseInt(c.id) == parseInt($stateParams.id)
-    });
-    $scope.task.task_members = $scope.data.task_members;
-    $scope.childcontent = $scope.task.content;
-    $scope.openmodal = function (type) {
-        if (type == 'childcontent') $rootScope.commons.fun = clear_change;
-        showPopup.modalTemplate(formatFilter('templates/modal-{0}.html', type), 'slide-in-right', $scope).then(function (modal) {
-            $rootScope.commons.modal = modal;
-            $rootScope.commons.modal.show();
-        })
-    };
-
-    $scope.closeModal = function () {
-        $rootScope.commons.modal.hide();
-        $rootScope.commons.fun = null;
-    };
-
-    // Cleanup the modal when we're done with it!
-    $scope.$on('$destroy', function () {
-        if ($rootScope.commons.modal != null) {
-            $rootScope.commons.modal.remove();
-            $rootScope.commons.modal = null;
-        }
-    });
-
-    $scope.checkend_dd = function () {
-        var options = {
-            mode: 'date',
-            date: $scope.task.end_dd == null ? new Date() : $scope.task.end_dd,
-            androidTheme: 3
-        };
-        $cordovaDatePicker.show(options).then(function (date) {
-            $timeout(function () {
-                if (date == undefined) return;
-                $scope.task.end_dd = date;
-                showPopup.showLoading(1, '', false);
-                Task.task(null).update({'id': $scope.task.id}, set_task(), function (data) {
-                    $rootScope.commons.modal.hide();
-                }, function (err) {
-                    showPopup.PopupWindow(0, 'fail', false);
-                }).$promise.finally(function (f) {
-                    showPopup.hideLoading();
-                });
-            });
-        });
-    };
-
-    $scope.changeAdmin = function (user) {
-        var task = set_task();
-        task.leader = user.user.id;
-        showPopup.showLoading(1, '', false);
-        Task.task(null).update({'id': task.id}, task, function (data) {
-            $scope.task.leader = data.leader;
-        }, function (err) {
-            showPopup.PopupWindow(0, 'fail', false);
-        }).$promise.finally(function (f) {
-            $scope.closeModal();
-            showPopup.hideLoading();
-        });
-    };
-
-    $scope.cancel = function () {
-        $scope.task.content = $scope.childcontent;
-        $rootScope.commons.modal.hide();
-    };
-
-    $scope.ok = function () {
-        if ($scope.task.content == '') {
-            showPopup.PopupWindow(0, '请输入任务内容!', false);
-            return;
-        }
-        showPopup.showLoading(1, '', false);
-        Task.task(null).update({'id': $scope.task.id}, set_task(), function (data) {
-            $scope.closeModal();
-        }, function (err) {
-            showPopup.PopupWindow(0, 'fail', false);
-        }).$promise.finally(function (f) {
-            showPopup.hideLoading();
-        });
-    };
-
-    $scope.deletechildTask = function () {
-        showPopup.confirm('是否删除该任务?', '是', '否').then(function (res) {
-            if (res) {
-                showPopup.showLoading(1, '', false);
-                Task.task(null).delete({'id': $stateParams.id}, function (data) {
-                    $scope.data.childtasks.splice(_.indexOf($scope.data.childtasks, $scope.task), 1);
-                    $ionicHistory.goBack();
-                }, function (err) {
-                    showPopup.PopupWindow(0, 'fail', false);
-                }).$promise.finally(function (f) {
-                    showPopup.hideLoading();
-                });
-            }
-        })
-    };
-
-    function clear_change() {
-        $scope.task.content = $scope.childcontent;
-        $rootScope.commons.modal.hide();
-        $rootScope.commons.modal.remove();
-        $rootScope.commons.modal = null;
-    }
-
-    function set_task() {
-        var task = angular.copy($scope.task);
-        task.leader = task.leader.id;
-        task.task_members = [];
-        return task;
-    }
-})

Some files were not shown because too many files changed in this diff