123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- starter.controller('ProcessCtrl', function ($scope, $state) {
- $scope.toman = function () {
- $state.go('process-manage');
- }
- $scope.toapply = function () {
- $state.go('process-apply');
- }
- })
- .controller('ProcessManageCtrl', function ($scope) {
- })
- .controller('ProcessApplyCtrl', function ($scope) {
- })
- .controller('ProcessCreateCtrl', function ($scope, $stateParams, $state, $ionicSlideBoxDelegate, $ionicHistory, Process) {
- $scope.datatext = {
- leftbtn: [{
- text: '取消',
- click: "cancel",
- params: "c"
- }, {
- text: '上一步',
- click: 'back'
- }],
- rightbtn: [{
- text: '下一步',
- click: 'down'
- }, {
- text: '完成',
- click: 'ok'
- }]
- };
- $scope.titleName = ['填写流程名称', '选择流程模板', '创建审批人步骤', '添加流程介绍'];
- $scope.leftIndex = 0;
- $scope.rightIndex = 0;
- $scope.activeIndex = 0;
- //下一步
- $scope.down = function () {
- $ionicSlideBoxDelegate.next();
- console.log($ionicSlideBoxDelegate.currentIndex());
- $scope.activeIndex = $ionicSlideBoxDelegate.currentIndex();
- if ($scope.activeIndex >= 1) {
- $scope.leftIndex = 1;
- $scope.rightIndex = 0;
- if ($scope.activeIndex == 3) {
- $scope.rightIndex = 1;
- }
- } else {
- $scope.leftIndex = 0;
- $scope.rightIndex = 1;
- }
- };
- $scope.cancel = function (op) {
- $ionicHistory.goBack();
- };
- $scope.back = function () {
- if ($scope.activeIndex != 0) {
- $ionicSlideBoxDelegate.previous();
- $scope.activeIndex = $ionicSlideBoxDelegate.currentIndex();
- $scope.rightIndex = 0;
- if ($scope.activeIndex == 0) {
- $scope.leftIndex = 0;
- }
- } else {
- $ionicHistory.goBack();
- }
- };
- $scope.lockSlide = function () {
- $ionicSlideBoxDelegate.enableSlide(false);
- };
- $scope.setitems = [{
- id: 1,
- show: false
- }, {
- id: 2,
- show: false
- }, {
- id: 3,
- show: false
- }, {
- id: 4,
- show: false
- }, {
- id: 5,
- show: true
- }];
- $scope.checkmoban = function (op) {
- var items = _.filter($scope.setitems, function (_item) {
- return _item.id == parseInt(op);
- });
- if (!items[0].show) {
- items[0].show = true;
- }
- _.each($scope.setitems, function (_item) {
- if (_item.id != parseInt(op)) {
- _item.show = false;
- }
- });
- };
- $scope.toSetItem = function () {
- $state.go('process-setfielditem', {
- id: -1
- });
- };
- })
- .controller('ProcessSetFieldItemCtrl', function ($scope, $ionicHistory) {
- $scope.cancel = function () {
- $ionicHistory.goBack();
- };
- });
|