浏览代码

事件列表修改

seimin 1 年之前
父节点
当前提交
3ebc78a038

文件差异内容过多而无法显示
+ 0 - 1
assets/js/controllers/incident/incidentCtrl-1.js


+ 95 - 209
assets/js/controllers/incident/incidentCtrl.js

@@ -619,16 +619,19 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
619
     }
619
     }
620
     //状态
620
     //状态
621
     $scope.state = [];
621
     $scope.state = [];
622
-    api_wechatfile.getDictionary({
623
-        "type": "list",
624
-        "key": "incident_status"
625
-    }).then(function (response) {
626
-        if (response) {
627
-            if (response.status = 200) {
628
-                $scope.state = response;
622
+    $scope.getIncidentStatus = function(){
623
+        api_wechatfile.getDictionary({
624
+            "type": "list",
625
+            "key": "incident_status"
626
+        }).then(function (response) {
627
+            $scope.state = response || [];
628
+            if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
629
+                $scope.selectTypeChange();
630
+            }else{
631
+                $scope.refreshData('expand-right');
629
             }
632
             }
630
-        }
631
-    })
633
+        })
634
+    }
632
 
635
 
633
     $scope.clear = function () {
636
     $scope.clear = function () {
634
         $scope.searchkeys = {};
637
         $scope.searchkeys = {};
@@ -676,14 +679,8 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
676
         var transitiondata = angular.copy(item);
679
         var transitiondata = angular.copy(item);
677
         angular.extend(fildata.incident, transitiondata)
680
         angular.extend(fildata.incident, transitiondata)
678
         $scope.memoryfilterData = fildata;
681
         $scope.memoryfilterData = fildata;
679
-        // seimin
680
-        if($scope.searchstate === 'all_del'){
681
-            fildata.searchType = 'all';
682
-        }else{
683
-            fildata.searchType = $scope.searchstate;
684
-        }
685
         console.log(fildata,78777);
682
         console.log(fildata,78777);
686
-        if(fildata.searchType === 'all'){
683
+        if($scope.searchstate === 'all'){
687
             if(fildata.incident&&fildata.incident.selectType){
684
             if(fildata.incident&&fildata.incident.selectType){
688
                 fildata.incident.selectType = fildata.incident.selectType.id;
685
                 fildata.incident.selectType = fildata.incident.selectType.id;
689
             }
686
             }
@@ -2037,31 +2034,28 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2037
 
2034
 
2038
     if ($stateParams.model) {
2035
     if ($stateParams.model) {
2039
         if (JSON.parse($stateParams.model).searchType && JSON.parse($stateParams.model).searchType != null) {
2036
         if (JSON.parse($stateParams.model).searchType && JSON.parse($stateParams.model).searchType != null) {
2040
-            $scope.searchType = JSON.parse($stateParams.model).searchType;
2037
+            $scope.searchstate = JSON.parse($stateParams.model).searchType;
2041
         } else {
2038
         } else {
2042
-            $scope.searchType = "todo";
2039
+            $scope.searchstate = "todo";
2043
         }
2040
         }
2044
     } else {
2041
     } else {
2045
-        $scope.searchType = "todo";
2042
+        $scope.searchstate = "todo";
2046
     }
2043
     }
2047
 
2044
 
2048
     if ($rootScope.user.group) {
2045
     if ($rootScope.user.group) {
2049
         var defaultFilterData = {
2046
         var defaultFilterData = {
2050
-            "searchType": "todo",
2051
             "idx": 0,
2047
             "idx": 0,
2052
             "sum": mun
2048
             "sum": mun
2053
         };
2049
         };
2054
     } else {
2050
     } else {
2055
         var defaultFilterData = {
2051
         var defaultFilterData = {
2056
-            "searchType": "todo",
2057
             "idx": 0,
2052
             "idx": 0,
2058
             "sum": mun
2053
             "sum": mun
2059
         };
2054
         };
2060
     }
2055
     }
2061
 
2056
 
2062
     if (angular.isDefined($rootScope.search) && angular.isDefined($rootScope.search.incident)) {
2057
     if (angular.isDefined($rootScope.search) && angular.isDefined($rootScope.search.incident)) {
2063
-        defaultFilterData['searchType'] = $rootScope.search.incident;
2064
-        $scope.searchType = $rootScope.search.incident;
2058
+        $scope.searchstate = $rootScope.search.incident;
2065
     }
2059
     }
2066
 
2060
 
2067
     $scope.ldloading = {};
2061
     $scope.ldloading = {};
@@ -2073,15 +2067,9 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2073
     }else{
2067
     }else{
2074
         $scope.searchstate = 'todo';
2068
         $scope.searchstate = 'todo';
2075
     }
2069
     }
2076
-    $scope.onChange = function (searchType) {
2077
-        if(searchType === 'all_del'){
2078
-            var obj = $scope.state.find(function(v){return v.id == 1708});
2079
-            $scope.othcode = {state:obj};
2080
-            $scope.isDisabledState = true;
2081
-        }else{
2082
-            $scope.isDisabledState = false;
2083
-        }
2084
-        $scope.searchstate = searchType;
2070
+    $scope.onChange = function (searchstate) {
2071
+        $scope.isDisabledState = false;
2072
+        $scope.searchstate = searchstate;
2085
         $scope.chiceIncident($scope.searchkeys,$scope.othcode.state);
2073
         $scope.chiceIncident($scope.searchkeys,$scope.othcode.state);
2086
     }
2074
     }
2087
     // 是否逾期下拉框选择seimin
2075
     // 是否逾期下拉框选择seimin
@@ -2092,13 +2080,12 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2092
         }
2080
         }
2093
         var ids = $scope.searchkeys.selectType.id
2081
         var ids = $scope.searchkeys.selectType.id
2094
         if(defaultFilterData.incident){
2082
         if(defaultFilterData.incident){
2095
-            defaultFilterData.incident.selectType = ids;//seimin
2083
+            defaultFilterData.incident.selectType = ids;
2096
         }else{
2084
         }else{
2097
             defaultFilterData.incident = {
2085
             defaultFilterData.incident = {
2098
                 selectType:ids
2086
                 selectType:ids
2099
             };
2087
             };
2100
         }
2088
         }
2101
-        defaultFilterData.searchType = 'all';
2102
         console.log(defaultFilterData,2222)
2089
         console.log(defaultFilterData,2222)
2103
         $scope.onChange('all');
2090
         $scope.onChange('all');
2104
     }
2091
     }
@@ -2116,19 +2103,10 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2116
         $scope.ldloading[style.replace('-', '_')] = true;
2103
         $scope.ldloading[style.replace('-', '_')] = true;
2117
         if (angular.isUndefined(filterData)) {
2104
         if (angular.isUndefined(filterData)) {
2118
             filterData = defaultFilterData;
2105
             filterData = defaultFilterData;
2119
-                if ($scope.searchType) {
2120
-                    filterData.searchType = $scope.searchType;
2121
-                    if (filterData.searchType == 'overDate') {
2122
-                        $scope.searchstate = 'overDate';
2123
-                    }
2124
-                }
2125
                 if($state.params.tab){
2106
                 if($state.params.tab){
2126
                     $scope.searchstate = $state.params.tab;
2107
                     $scope.searchstate = $state.params.tab;
2127
-                    filterData.searchType = $state.params.tab;
2128
                     filterData.idx = 0;
2108
                     filterData.idx = 0;
2129
                     $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
2109
                     $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
2130
-                }else{
2131
-                    $scope.searchstate = filterData.searchType;
2132
                 }
2110
                 }
2133
                 if($state.params.date == 'today'){
2111
                 if($state.params.date == 'today'){
2134
                     $scope.othcode = {};
2112
                     $scope.othcode = {};
@@ -2136,16 +2114,14 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2136
                     $scope.searchkeys.acceptDateEnd = new Date();
2114
                     $scope.searchkeys.acceptDateEnd = new Date();
2137
                     filterData.incident = {acceptDate:moment().format('YYYY-MM-DD 00:00:00'),acceptDateEnd:moment().format('YYYY-MM-DD 23:59:59')};
2115
                     filterData.incident = {acceptDate:moment().format('YYYY-MM-DD 00:00:00'),acceptDateEnd:moment().format('YYYY-MM-DD 23:59:59')};
2138
                 }else{
2116
                 }else{
2139
-                    $scope.searchkeys.acceptDate = null;
2140
-                    $scope.searchkeys.acceptDateEnd = null;
2117
+                    $scope.searchkeys.acceptDate = undefined;
2118
+                    $scope.searchkeys.acceptDateEnd = undefined;
2141
                 }
2119
                 }
2142
                 if($state.params.state){
2120
                 if($state.params.state){
2143
                     var obj = $scope.state.find(function(v){return $state.params.state == v.id});
2121
                     var obj = $scope.state.find(function(v){return $state.params.state == v.id});
2144
                     $scope.othcode = {state:obj};
2122
                     $scope.othcode = {state:obj};
2145
                     filterData.incident = {statusId: $state.params.state};
2123
                     filterData.incident = {statusId: $state.params.state};
2146
                 }
2124
                 }
2147
-        } else {
2148
-            filterData.searchType = $scope.searchstate;
2149
         }
2125
         }
2150
         console.log(filterData,11111);
2126
         console.log(filterData,11111);
2151
         if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
2127
         if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
@@ -2162,187 +2138,97 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2162
         $scope.myData = [];
2138
         $scope.myData = [];
2163
         $scope.memoryfilterData = filterData;
2139
         $scope.memoryfilterData = filterData;
2164
         $scope.gridOptions['sum'] = filterData.sum;
2140
         $scope.gridOptions['sum'] = filterData.sum;
2165
-        // 如果是全部,则根据权限查询
2166
-        if(filterData.searchType == 'all'){
2167
-            if(!filterData.incident){
2168
-                filterData.incident = {};
2169
-            }
2170
-            if($rootScope.user.duty){
2171
-                // 当前的所属责任科室
2172
-                filterData.incident.duty = $rootScope.user.duty;
2173
-            }else if($rootScope.user.branch){
2174
-                // 当前的所属院区
2175
-                filterData.incident.branch = $rootScope.user.branch.id;
2176
-            }
2141
+        // 请求参数调整
2142
+        if(!filterData.incident){
2143
+            filterData.incident = {};
2177
         }
2144
         }
2178
-        if(filterData.searchType == 'all'){
2179
-            //全部事件
2180
-            api_user_data.fetchDataList('incident', filterData).then(function (data) {
2181
-                if (data.list) {
2182
-                    var myData = Restangular.stripRestangular(data);
2183
-                    $scope.gridOptions['totalItems'] = myData.totalNum;
2184
-                    $scope.myData = myData.list;
2185
-                    for (var i = 0; i < $scope.myData.length; i++) {
2186
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2187
-                    }
2188
-                } else {
2189
-                    SweetAlert.swal({
2190
-                        title: "系统错误",
2191
-                        text: "请稍后再试!",
2192
-                        type: "error"
2193
-                    });
2194
-                }
2195
-                $scope.ldloading[style.replace('-', '_')] = false;
2196
-
2197
-            }, function () {
2198
-                $scope.ldloading[style.replace('-', '_')] = false;
2199
-            });
2200
-        }else if(filterData.searchType == 'done'){
2201
-            //与我关联
2202
-            api_flow.owns(filterData).then(function (data) {
2203
-                if (data.data.data) {
2204
-                    var myData = Restangular.stripRestangular(data.data);
2205
-                    $scope.gridOptions['totalItems'] = myData.resultCount;
2206
-                    $scope.myData = myData.data;
2207
-                    for (var i = 0; i < $scope.myData.length; i++) {
2208
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2209
-                    }
2210
-                } else {
2211
-                    SweetAlert.swal({
2212
-                        title: "系统错误",
2213
-                        text: "请稍后再试!",
2214
-                        type: "error"
2215
-                    });
2216
-                }
2217
-                $scope.ldloading[style.replace('-', '_')] = false;
2218
-            }, function () {
2219
-                $scope.ldloading[style.replace('-', '_')] = false;
2220
-            });
2145
+        if($rootScope.user.duty){
2146
+            // 当前的所属责任科室
2147
+            filterData.incident.duty = $rootScope.user.duty;
2148
+        }else if($rootScope.user.branch){
2149
+            // 当前的所属院区
2150
+            filterData.incident.branch = $rootScope.user.branch.id;
2151
+        }
2152
+        filterData.incident.queryTask = $scope.searchstate;
2153
+        filterData.incident.assignee = loginUser.id;
2154
+        if($scope.searchstate === 'todo' || $scope.searchstate === 'owns'){
2155
+            filterData.incident.candidateGroups = loginuserGroup;
2221
         }else{
2156
         }else{
2222
-            // 非全部事件
2223
-            api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
2224
-                if (data.data) {
2225
-                    var myData = Restangular.stripRestangular(data);
2226
-                    $scope.gridOptions['totalItems'] = myData.resultCount;
2227
-                    $scope.myData = myData.data;
2228
-                    for (var i = 0; i < $scope.myData.length; i++) {
2229
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2230
-                    }
2231
-                } else {
2232
-                    SweetAlert.swal({
2233
-                        title: "系统错误",
2234
-                        text: "请稍后再试!",
2235
-                        type: "error"
2236
-                    });
2157
+            delete filterData.incident.candidateGroups;
2158
+        }
2159
+
2160
+        // 调用接口
2161
+        api_user_data.fetchDataList('incident', filterData).then(function (data) {
2162
+            if (data.list) {
2163
+                var myData = Restangular.stripRestangular(data);
2164
+                $scope.gridOptions['totalItems'] = myData.totalNum;
2165
+                $scope.myData = myData.list;
2166
+                for (var i = 0; i < $scope.myData.length; i++) {
2167
+                    $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2237
                 }
2168
                 }
2238
-                $scope.ldloading[style.replace('-', '_')] = false;
2169
+            } else {
2170
+                SweetAlert.swal({
2171
+                    title: "系统错误",
2172
+                    text: "请稍后再试!",
2173
+                    type: "error"
2174
+                });
2175
+            }
2176
+            $scope.ldloading[style.replace('-', '_')] = false;
2239
 
2177
 
2240
-            }, function () {
2241
-                $scope.ldloading[style.replace('-', '_')] = false;
2242
-            });
2243
-        }
2178
+        }, function () {
2179
+            $scope.ldloading[style.replace('-', '_')] = false;
2180
+        });
2244
     };
2181
     };
2245
     $scope.refreshData2 = function (style, filterData) {
2182
     $scope.refreshData2 = function (style, filterData) {
2246
 
2183
 
2247
         $scope.ldloading[style.replace('-', '_')] = true;
2184
         $scope.ldloading[style.replace('-', '_')] = true;
2248
         if (angular.isUndefined(filterData)) {
2185
         if (angular.isUndefined(filterData)) {
2249
             filterData = defaultFilterData;
2186
             filterData = defaultFilterData;
2250
-            if ($scope.searchType) {
2251
-                filterData.searchType = $scope.searchType;
2252
-                if (filterData.searchType == 'overDate') {
2253
-                    $scope.searchstate = 'overDate';
2254
-                }
2255
-            }
2256
-        }else{
2257
-            filterData.searchType = $scope.searchstate;
2258
         }
2187
         }
2259
         $scope.myData = [];
2188
         $scope.myData = [];
2260
         $scope.memoryfilterData = filterData;
2189
         $scope.memoryfilterData = filterData;
2261
         $scope.gridOptions['sum'] = filterData.sum;
2190
         $scope.gridOptions['sum'] = filterData.sum;
2262
-        // 如果是全部,则根据权限查询
2263
-        if(filterData.searchType == 'all'){
2264
-            if(!filterData.incident){
2265
-                filterData.incident = {};
2266
-            }
2267
-            if($rootScope.user.duty){
2268
-                // 当前的所属责任科室
2269
-                filterData.incident.duty = $rootScope.user.duty;
2270
-            }else if($rootScope.user.branch){
2271
-                // 当前的所属院区
2272
-                filterData.incident.branch = $rootScope.user.branch.id;
2273
-            }
2191
+        // 请求参数调整
2192
+        if(!filterData.incident){
2193
+            filterData.incident = {};
2274
         }
2194
         }
2275
-        if(filterData.searchType == 'all'){
2276
-            //全部事件
2277
-            api_user_data.fetchDataList('incident', filterData).then(function (data) {
2278
-                if (data.list) {
2279
-                    var myData = Restangular.stripRestangular(data);
2280
-                    $scope.gridOptions['totalItems'] = myData.totalNum;
2281
-                    $scope.myData = myData.list;
2282
-                    for (var i = 0; i < $scope.myData.length; i++) {
2283
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2284
-                    }
2285
-                } else {
2286
-                    SweetAlert.swal({
2287
-                        title: "系统错误",
2288
-                        text: "请稍后再试!",
2289
-                        type: "error"
2290
-                    });
2291
-                }
2292
-                $scope.ldloading[style.replace('-', '_')] = false;
2293
-            }, function () {
2294
-                $scope.ldloading[style.replace('-', '_')] = false;
2295
-            });
2296
-        }else if(filterData.searchType == 'done'){
2297
-            //与我关联
2298
-            api_flow.owns(filterData).then(function (data) {
2299
-                if (data.data.data) {
2300
-                    var myData = Restangular.stripRestangular(data.data);
2301
-                    $scope.gridOptions['totalItems'] = myData.resultCount;
2302
-                    $scope.myData = myData.data;
2303
-                    for (var i = 0; i < $scope.myData.length; i++) {
2304
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2305
-                    }
2306
-                } else {
2307
-                    SweetAlert.swal({
2308
-                        title: "系统错误",
2309
-                        text: "请稍后再试!",
2310
-                        type: "error"
2311
-                    });
2312
-                }
2313
-                $scope.ldloading[style.replace('-', '_')] = false;
2314
-            }, function () {
2315
-                $scope.ldloading[style.replace('-', '_')] = false;
2316
-            });
2195
+        if($rootScope.user.duty){
2196
+            // 当前的所属责任科室
2197
+            filterData.incident.duty = $rootScope.user.duty;
2198
+        }else if($rootScope.user.branch){
2199
+            // 当前的所属院区
2200
+            filterData.incident.branch = $rootScope.user.branch.id;
2201
+        }
2202
+        filterData.incident.queryTask = $scope.searchstate;
2203
+        filterData.incident.assignee = loginUser.id;
2204
+        if($scope.searchstate === 'todo' || $scope.searchstate === 'owns'){
2205
+            filterData.incident.candidateGroups = loginuserGroup;
2317
         }else{
2206
         }else{
2318
-            api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
2319
-                if (data.data) {
2320
-                    var myData = Restangular.stripRestangular(data);
2321
-                    $scope.gridOptions['totalItems'] = myData.resultCount;
2322
-                    $scope.myData = myData.data;
2323
-                    for (var i = 0; i < $scope.myData.length; i++) {
2324
-                        $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2325
-                    }
2326
-                } else {
2327
-                    SweetAlert.swal({
2328
-                        title: "系统错误",
2329
-                        text: "请稍后再试!",
2330
-                        type: "error"
2331
-                    });
2332
-                }
2333
-                $scope.ldloading[style.replace('-', '_')] = false;
2334
-            }, function () {
2335
-                $scope.ldloading[style.replace('-', '_')] = false;
2336
-            });
2207
+            delete filterData.incident.candidateGroups;
2337
         }
2208
         }
2338
-
2209
+        //调用接口
2210
+        api_user_data.fetchDataList('incident', filterData).then(function (data) {
2211
+            if (data.list) {
2212
+                var myData = Restangular.stripRestangular(data);
2213
+                $scope.gridOptions['totalItems'] = myData.totalNum;
2214
+                $scope.myData = myData.list;
2215
+                for (var i = 0; i < $scope.myData.length; i++) {
2216
+                    $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
2217
+                }
2218
+            } else {
2219
+                SweetAlert.swal({
2220
+                    title: "系统错误",
2221
+                    text: "请稍后再试!",
2222
+                    type: "error"
2223
+                });
2224
+            }
2225
+            $scope.ldloading[style.replace('-', '_')] = false;
2226
+        }, function () {
2227
+            $scope.ldloading[style.replace('-', '_')] = false;
2228
+        });
2339
     };
2229
     };
2340
     // 进入页面时111
2230
     // 进入页面时111
2341
-    if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
2342
-        $scope.selectTypeChange();
2343
-    }else{
2344
-        $scope.refreshData('expand-right');
2345
-    }
2231
+    $scope.getIncidentStatus();
2346
 
2232
 
2347
     $scope.timer = $interval(function () {
2233
     $scope.timer = $interval(function () {
2348
         $scope.jry_refresh()
2234
         $scope.jry_refresh()

+ 1 - 1
assets/js/main.js

@@ -715,7 +715,7 @@ app.factory('api_flow', ['FlowRestangular', function (FlowRestangular) {
715
     return {
715
     return {
716
         // 与我关联
716
         // 与我关联
717
         owns: function (data) {
717
         owns: function (data) {
718
-            return r_data.customPOST(data, 'owns', {});
718
+            return r_data.customPOST(data, 'incident/owns', {});
719
         },
719
         },
720
         // 建单
720
         // 建单
721
         accept: function (model, data) {
721
         accept: function (model, data) {

+ 6 - 2
assets/views/incident/list.html

@@ -16,8 +16,12 @@
16
                     ng-class="{'statecolor':searchstate=='all'}" ng-if="allFlag">全部事件</button>
16
                     ng-class="{'statecolor':searchstate=='all'}" ng-if="allFlag">全部事件</button>
17
                 <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='todo'}"
17
                 <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='todo'}"
18
                     ng-click="onChange('todo')">待我处理</button>
18
                     ng-click="onChange('todo')">待我处理</button>
19
-                <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='done'}"
20
-                    ng-click="onChange('done')">与我关联</button>
19
+                <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='owns'}"
20
+                    ng-click="onChange('owns')">与我关联</button>
21
+                <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='callback'}"
22
+                    ng-click="onChange('callback')">待回访</button>
23
+                <button class="btn btn-statebutton statebutton wt_btn2" ng-class="{'statecolor':searchstate=='storage'}"
24
+                    ng-click="onChange('storage')">暂存</button>
21
             </div>
25
             </div>
22
         </div>
26
         </div>
23
 
27