seimin 3 anni fa
parent
commit
e96615095b

+ 2 - 1
assets/js/config.constant.js

@@ -121,10 +121,11 @@ app.constant('JS_REQUIRES', {
121 121
         'jry_open_indexesCtrl':'assets/js/controllers/file/jry_open_indexesCtrl.js',//引入文档
122 122
         //任务管理
123 123
         'taskFormCtr':'assets/js/controllers/task/taskFormCtr.js',//新建任务
124
-        'workingFormCtr':'assets/js/controllers/working/workingFormCtr.js',//上下班管理
125 124
         'moonTaskCtrl':'assets/js/controllers/task/moonTaskCtrl.js',//月度任务
126 125
         'taskListCtrl':'assets/js/controllers/task/taskListCtrl.js',//任务列表
127 126
         'taskDetailedCtr':'assets/js/controllers/task/taskDetailedCtrl.js',//任务清单
127
+        'workingFormCtr':'assets/js/controllers/working/workingFormCtr.js',//上下班管理
128
+        'workingHistoryFormCtr':'assets/js/controllers/working/workingHistoryFormCtr.js',//每日上下班记录
128 129
         //*** outside service
129 130
         'dnsmanageCtrl': 'assets/js/controllers/externalservice/dnsmanageCtrl.js',
130 131
         'emailhandleCtrl': 'assets/js/controllers/externalservice/emailhandleCtrl.js',

+ 10 - 0
assets/js/config.router.js

@@ -504,6 +504,16 @@ app.config(['$authProvider', '$httpProvider', '$stateProvider', '$urlRouterProvi
504 504
                 ncyBreadcrumb: {
505 505
                     label: 'incident list'
506 506
                 }
507
+            }).state('app.working.history', {
508
+                url: '/history',
509
+                templateUrl: "assets/views/working/list.html",
510
+                resolve: loadSequence('jquery-sparkline', 'spin', 'ladda', 'angular-ladda', 'ui.grid', 'moment', 'angularPrint', 'angularFileUpload', 'ui.select', 'multi.select.tree', 'angularBootstrapNavTree', 'workingHistoryFormCtr'),
511
+                title: 'incident.LIST',
512
+                pdKey: 'bpm_incident',
513
+                icon: 'ti-list',
514
+                ncyBreadcrumb: {
515
+                    label: 'incident list'
516
+                }
507 517
             }).state('app.incident.editor', {
508 518
                 url: '/editor/{taskId}/{processInstanceId}/{dataId}',
509 519
                 templateUrl: "assets/views/customform/index.html",

+ 209 - 0
assets/js/controllers/working/workingHistoryFormCtr.js

@@ -0,0 +1,209 @@
1
+'use strict';
2
+
3
+app.controller('workingHistoryFormCtr', ["$scope", "moment", "SweetAlert", "api_user_data", function ($scope, moment, SweetAlert, api_user_data) {
4
+  //上班记录状态
5
+  $scope.statesOn = [
6
+    { name: '全部', value: '0' },
7
+    { name: '实到', value: '1' },
8
+    { name: '迟到', value: '2' },
9
+    { name: '未打卡', value: '4' }
10
+  ];
11
+  // 下班记录状态
12
+  $scope.statesOff = [
13
+    { name: '全部', value: '0' },
14
+    { name: '早退', value: '3' },
15
+    { name: '未打卡', value: '4' }
16
+  ];
17
+  // 查询条件
18
+  $scope.searchkeys = {
19
+    state: $scope.statesOn[0],
20
+    date: moment().format('YYYY-MM-DD')
21
+  }
22
+  // 查询的重置条件
23
+  $scope.resetSearchkeys = {
24
+    state: $scope.statesOn[0],
25
+    date: moment().format('YYYY-MM-DD')
26
+  }
27
+  // 最大日期
28
+  $scope.maxDate = moment();
29
+  //列表数据
30
+  $scope.myData = [];
31
+  $scope.itemsSaveNoOn = [];
32
+  $scope.itemsSaveNoOff = [];
33
+  //表格相关
34
+  $scope.gridOptions = {};
35
+  $scope.gridOptions.data = 'myData';
36
+  $scope.gridOptions.enableColumnResizing = true;
37
+  $scope.gridOptions.enableFiltering = false;
38
+  $scope.gridOptions.enableGridMenu = true;
39
+  $scope.gridOptions.enableSelectAll = true;
40
+  $scope.gridOptions.enableRowSelection = true;
41
+  $scope.gridOptions.showGridFooter = true;
42
+  $scope.gridOptions.showColumnFooter = false;
43
+  $scope.gridOptions.fastWatch = true;
44
+  $scope.gridOptions.enableSorting = true;
45
+  $scope.gridOptions.useExternalSorting = true;
46
+  $scope.gridOptions.useExternalFiltering = false;
47
+  $scope.gridOptions.useExternalPagination = true;
48
+  $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
49
+  $scope.gridOptions.paginationPageSize = 10;
50
+  $scope.gridOptions.multiSelect = true;
51
+  $scope.gridOptions.columnDefs = [
52
+    {
53
+      name: 'item',
54
+      displayName: '序号',
55
+      width: '7%',
56
+      minWidth: '45',
57
+      cellTemplate: '<div>' +
58
+        '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
59
+        '</div>'
60
+    },
61
+    {
62
+      name: 'userName',
63
+      displayName: '打卡人姓名',
64
+      width: '15%',
65
+      minWidth: '70',
66
+      enableSorting: false
67
+    },
68
+    {
69
+      name: 'extra2',
70
+      displayName: '状态',
71
+      width: '15%',
72
+      minWidth: '70',
73
+      enableSorting: false,
74
+      cellTemplate: '<div>' +
75
+        '<div class="ui-grid-cell-contents" ng-style="{color:(row.entity.extra2 === \'正常\' && row.entity.opValue) ? \'green\' : \'red\'}">{{row.entity.opValue?row.entity.extra2:\'未打卡\'}}</div>' +
76
+        '</div>'
77
+    },
78
+    {
79
+      name: 'opTime',
80
+      displayName: '打卡时间',
81
+      width: '20%',
82
+      minWidth: '140',
83
+      enableFiltering: false,
84
+      cellTemplate: '<div>' +
85
+        '<div class="ui-grid-cell-contents">{{row.entity.opTime?(row.entity.opTime|date:\'HH:mm\'):\'无\'}}</div>' +
86
+        '</div>'
87
+    },
88
+    {
89
+      name: 'extra1',
90
+      displayName: '打卡地址',
91
+      width: '43%',
92
+      minWidth: '280',
93
+      enableFiltering: false,
94
+      cellTemplate: '<div>' +
95
+        '<div class="ui-grid-cell-contents">{{row.entity.extra1 || \'无\'}}</div>' +
96
+        '</div>'
97
+    }
98
+  ];
99
+  //默认选择上班记录
100
+  $scope.searchstate = 'on';
101
+  $scope.states = $scope.statesOn;
102
+  // 切换tab
103
+  $scope.onChange = function (searchType) {
104
+    $scope.searchstate = searchType;
105
+    switch (searchType) {
106
+      case 'on':
107
+        $scope.states = $scope.statesOn;
108
+        $scope.searchkeys.state = $scope.statesOn[0];
109
+        break;
110
+      case 'off':
111
+        $scope.states = $scope.statesOff;
112
+        $scope.searchkeys.state = $scope.statesOff[0];
113
+        break;
114
+    }
115
+    $scope.refreshData();
116
+  }
117
+  // 点击日期框
118
+  $scope.startOpen = function ($event) {
119
+    $event.preventDefault();
120
+    $event.stopPropagation();
121
+    $scope.startOpened = !$scope.startOpened;
122
+  };
123
+  // 选择日期
124
+  $scope.changeDate = function(){
125
+    $scope.searchkeys.date = moment($scope.searchkeys.date).format('YYYY-MM-DD');
126
+  }
127
+  // 重置
128
+  $scope.clear = function () {
129
+    $scope.searchkeys = angular.copy($scope.resetSearchkeys);
130
+    $scope.refreshData();
131
+  }
132
+  //处理过滤数据
133
+  $scope.stateChange = function(data){
134
+    var arr = [];
135
+    //过滤上班记录或下班记录
136
+    if ($scope.searchstate === "on") {
137
+      //上班记录
138
+      arr = data.filter(v => v.opValue === "1");
139
+    } else if ($scope.searchstate === "off") {
140
+      //下班记录
141
+      arr = data.filter(v => v.opValue === "0");
142
+    }
143
+    // 过滤状态
144
+    if ($scope.searchkeys.state.value === "1") {
145
+      //实到
146
+      let arr1 = arr.filter(v => v.extra2 == "迟到");
147
+      let arr2 = arr.filter(v => v.extra2 == "正常");
148
+      $scope.myData = [...arr1,...arr2];
149
+    } else if ($scope.searchkeys.state.value === "2") {
150
+      //迟到
151
+      $scope.myData = arr.filter(v => v.extra2 == "迟到");
152
+    } else if ($scope.searchkeys.state.value === "3") {
153
+      //早退
154
+      $scope.myData = arr.filter(v => v.extra2 == "早退");
155
+    } else if ($scope.searchkeys.state.value === "4") {
156
+      //未打卡
157
+      if($scope.searchstate === 'on'){
158
+        // 上班
159
+        $scope.myData = angular.copy($scope.itemsSaveNoOn);
160
+      }else if($scope.searchstate === 'off'){
161
+        // 下班
162
+        $scope.myData = angular.copy($scope.itemsSaveNoOff);
163
+      }
164
+    } else if ($scope.searchkeys.state.value === "0") {
165
+      //全部
166
+      if($scope.searchstate === 'on'){
167
+        // 上班
168
+        $scope.myData = angular.copy(arr.concat($scope.itemsSaveNoOn));
169
+      }else if($scope.searchstate === 'off'){
170
+        // 下班
171
+        $scope.myData = angular.copy(arr.concat($scope.itemsSaveNoOff));
172
+      }
173
+    }
174
+    //添加序号
175
+    $scope.myData.forEach((v, i) => {
176
+      v.item = i + 1;
177
+    })
178
+  }
179
+  //获取列表数据
180
+  $scope.refreshData = function () {
181
+    $scope.myData = [];
182
+    $scope.itemsSaveNoOn = [];
183
+    $scope.itemsSaveNoOff = [];
184
+    api_user_data.getOnlineInfo($scope.searchkeys.date).then(function (result) {
185
+      if (result.data) {
186
+        if (result.data.length) {
187
+          $scope.itemsSaveNoOn = result.unOnlineList || [];
188
+          $scope.itemsSaveNoOff = result.unOfflineList || [];
189
+          // 处理过滤数据
190
+          $scope.stateChange(result.data);
191
+        }
192
+      } else {
193
+        SweetAlert.swal({
194
+          title: "系统错误",
195
+          text: "请稍后再试!",
196
+          type: "error"
197
+        });
198
+      }
199
+    }, function () {
200
+      SweetAlert.swal({
201
+        title: "系统错误",
202
+        text: "请稍后再试!",
203
+        type: "error"
204
+      });
205
+    });
206
+  };
207
+  //进入页面初次渲染页面
208
+  $scope.refreshData();
209
+}]);

+ 3 - 0
assets/js/main.js

@@ -601,6 +601,9 @@ app.factory('api_user_data', ['UserRestangular', function (UserRestangular) {
601 601
         },
602 602
         getMenu: function (data, model) {
603 603
             return userService.customPOST(data, 'getMenu', {});
604
+        },
605
+        getOnlineInfo: function (date) {
606
+            return userService.customPOST({}, 'onlineInfo/' + date, {});
604 607
         }
605 608
     };
606 609
 }]);

+ 299 - 0
assets/views/working/list.html

@@ -0,0 +1,299 @@
1
+<div ng-controller="workingHistoryFormCtr" class="">
2
+  <section id="page-title">
3
+    <div class="row">
4
+      <div class="col-sm-8">
5
+        <h1 class="mainTitle">每日上下班记录
6
+          <i tooltip='每日上下班记录,点击操作处理任务' tooltip-placement="right"
7
+            class="fa  ti-help-alt margin-left-10 fontcolor-five pointfont"></i>
8
+        </h1>
9
+      </div>
10
+    </div>
11
+  </section>
12
+  <div class="listbote">
13
+    <div class="list-controls clearfix">
14
+      <div class="btn-group">
15
+        <button class="btn btn-statebutton statebutton  keepleftbottom wt_btn2" ng-click="onChange('on')"
16
+          ng-class="{'statecolor':searchstate=='on'}">上班记录</button>
17
+        <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='off'}"
18
+          ng-click="onChange('off')">下班记录</button>
19
+      </div>
20
+    </div>
21
+
22
+    <div style="background: #F9F9F9 !important;padding-left: 16px;padding-right: 0px;">
23
+      <div class="row wt_searchlistback" id="searchid">
24
+        <div class="col-xs-10" style="padding-right: 0px !important;padding-bottom: 10px;">
25
+          <form class="form-inline incidentsearchsize" style='padding-top: 8px'>
26
+            <div class="form-group incidentsearch wt_width">
27
+              <div class="">
28
+                <div class="control-label pull-left margin-top-5">打卡时间:</div>
29
+                <input type="text" class=" incidentsearchsize wt_width5" datepicker-popuptime="yyyy-MM-dd"
30
+                  ng-model="searchkeys.date" ng-change="changeDate()" max-date="maxDate" is-open="startOpened" hour-time=true
31
+                  ng-init="startOpened = false" close-text="关闭" ng-click="startOpen($event)" placeholder="" />
32
+              </div>
33
+            </div>
34
+            <div class="form-group incidentsearch  wt_width">
35
+              <div class="control-label pull-left margin-top-5">状态:</div>
36
+              <ui-select class="pull-right selectzise wt_width1 wt_width3" ng-model="searchkeys.state"
37
+                theme="bootstrap">
38
+                <ui-select-match placeholder="">
39
+                  {{$select.selected.name}}
40
+                </ui-select-match>
41
+                <ui-select-choices repeat="item in states | filter: $select.search">
42
+                  <div ng-bind-html="item.name | highlight: $select.search"></div>
43
+                </ui-select-choices>
44
+              </ui-select>
45
+            </div>
46
+          </form>
47
+        </div>
48
+        <div class="col-xs-2 wt_pad">
49
+          <div class="" style='padding-top: 8px'>
50
+            <div class="pull-left margin-top-10 searchBtnBox">
51
+              <div class=" wt_btns">
52
+                <div class="btn btn_search" ng-click="refreshData()" type="button">搜索</div>
53
+              </div>
54
+
55
+              <div class=" wt_btns">
56
+                <div class="btn btn_clean" ng-click="clear()" type="button">重置</div>
57
+              </div>
58
+            </div>
59
+          </div>
60
+        </div>
61
+      </div>
62
+    </div>
63
+    <div class="wt_list">
64
+      <div ui-i18n="{{lang}}" style="background: #fff;">
65
+        <div id="grid" style="border-radius: 2px !important;" ui-grid="gridOptions" external-scopes="$scope"
66
+          ui-grid-resize-columns ui-grid-auto-resize class="grid"></div>
67
+      </div>
68
+    </div>
69
+  </div>
70
+</div>
71
+
72
+<style>
73
+  @media screen and (max-width: 1750px) {
74
+    .wt_width {
75
+      width: 30% !important;
76
+    }
77
+
78
+    .wt_width1 {
79
+      width: 60% !important;
80
+    }
81
+
82
+    .wt_width4 {
83
+      width: 27% !important;
84
+    }
85
+
86
+    .wt_width5 {
87
+      width: 60% !important;
88
+      border-color: #dedede;
89
+      float: right;
90
+    }
91
+
92
+  }
93
+
94
+  .selectzise {
95
+    width: 160px;
96
+  }
97
+
98
+  .wt_width {
99
+    width: 20%;
100
+    margin-right: 16px;
101
+    min-width: 275px !important;
102
+  }
103
+
104
+  .wt_width1 {
105
+    width: 160px;
106
+  }
107
+
108
+  .wt_margin-top {
109
+    margin-top: 35px !important;
110
+  }
111
+
112
+  .form-inline .form-control {
113
+    border-radius: 2px;
114
+  }
115
+
116
+  .wt_width3 {
117
+    width: 160px;
118
+    height: 28px !important;
119
+    border-radius: 2px !important;
120
+  }
121
+
122
+  .wt_width4 {
123
+    width: 20%;
124
+  }
125
+
126
+  .wt_width5 {
127
+    width: 160px;
128
+    border-color: #dedede;
129
+    float: right;
130
+    height: 28px;
131
+    border-radius: 2px !important;
132
+  }
133
+
134
+  .wt_width6 {
135
+    display: inline-block;
136
+    padding-top: 0px;
137
+    position: relative;
138
+    top: 4px;
139
+    /* left: 10px; */
140
+    width: 8.2%;
141
+    text-align: left;
142
+  }
143
+
144
+  .ui-select-bootstrap .ui-select-toggle {
145
+    height: 28px;
146
+  }
147
+
148
+  /* 
149
+    .wt_width {
150
+        width: 20%;
151
+        margin-right: 1%;
152
+        padding: 0px;
153
+    }
154
+
155
+    .wt_width1 {
156
+        width: 100% !important;
157
+        padding: 0px;
158
+    } */
159
+
160
+  .wt_width2 {
161
+    width: 50% !important;
162
+  }
163
+
164
+  .wt_pad {
165
+    padding: 0px;
166
+  }
167
+
168
+  .wt_btns {
169
+    display: inline-block;
170
+    margin-right: 8px;
171
+  }
172
+
173
+  .wt_btn1 {
174
+    width: 60px;
175
+    height: 28px !important;
176
+    border-radius: 2px;
177
+    line-height: 28px;
178
+    font-size: 14px;
179
+    padding: 0px !important;
180
+    font-size: 14px !important;
181
+  }
182
+
183
+  .btn.steelbutton.wt_btn1 {
184
+    padding: 0px !important;
185
+  }
186
+
187
+  .wt_btnColor {
188
+    background: #4A90E2 !important;
189
+  }
190
+
191
+  /* .btn{
192
+        padding: 0px!important;
193
+    } */
194
+
195
+
196
+  .wt_btnColor:hover {
197
+    background: #fff !important;
198
+    color: #2B5EB8 !important;
199
+    border: 1px solid #2B5EB8;
200
+  }
201
+
202
+  .wt_btnColor2:hover {
203
+    background: #fff !important;
204
+    color: #2B5EB8 !important;
205
+    border: 1px solid #2B5EB8;
206
+  }
207
+
208
+  .wt_btn2 {
209
+    width: 100px;
210
+    height: 34px !important;
211
+    border-radius: 2px !important;
212
+  }
213
+
214
+  .wt_list {
215
+    padding: 15px;
216
+    background: #F9F9F9;
217
+  }
218
+
219
+  .ui-grid-render-container:hover {
220
+    background: #fff !important;
221
+  }
222
+
223
+  .wt_btnColor1 {
224
+    background: #fff !important;
225
+    color: #2B5EB8 !important;
226
+    border: 1px solid #2B5EB8;
227
+  }
228
+
229
+  .wt_btnColor1:hover {
230
+    background: #4A90E2 !important;
231
+    color: #fff !important;
232
+    border: 1px solid #4A90E2 !important;
233
+  }
234
+
235
+  div.ui-grid-row.ng-scope:hover {
236
+    cursor: pointer;
237
+    background: #fff !important;
238
+  }
239
+
240
+  .wt_searchlistback {
241
+    margin-top: 1px;
242
+    margin-bottom: 8px;
243
+    border-top-left-radius: 0px !important;
244
+    border-top-right-radius: 8px !important;
245
+    border-bottom-left-radius: 8px !important;
246
+    border-bottom-right-radius: 8px !important;
247
+  }
248
+
249
+  .ui-grid-row:nth-child(even) .ui-grid-cell {
250
+    background: #fafafa !important;
251
+  }
252
+
253
+  .searchBtnBox>.wt_btns {
254
+    margin: 0 8px 10px 0;
255
+  }
256
+
257
+  /* 故障地点 */
258
+  .address-wrap {
259
+    position: relative;
260
+    height: 28px;
261
+  }
262
+
263
+  #bx_address {
264
+    height: 100%;
265
+  }
266
+
267
+  #bx_address_ul {
268
+    position: absolute;
269
+    top: 28px;
270
+    left: 0;
271
+    width: 100%;
272
+    max-height: 136px;
273
+    overflow-y: auto;
274
+    background-color: #fff;
275
+    border: 1px solid #d1d1d1;
276
+    border-top: none;
277
+    z-index: 9999;
278
+  }
279
+
280
+  #bx_address_ul li {
281
+    height: 34px;
282
+    border-bottom: 1px solid #d1d1d1;
283
+    line-height: 32px;
284
+    padding: 0 16px;
285
+    cursor: pointer;
286
+    overflow: hidden;
287
+    text-overflow: ellipsis;
288
+    white-space: nowrap;
289
+  }
290
+
291
+  #bx_address_ul li:hover {
292
+    /* background-color: #005395; */
293
+    /* color: #fff; */
294
+  }
295
+
296
+  #bx_address_ul li:last-child {
297
+    border-bottom: none;
298
+  }
299
+</style>