seimin 1 年間 前
コミット
6e97bc1834
共有2 個のファイルを変更した20 個の追加84 個の削除を含む
  1. 18 82
      assets/js/controllers/incident/incidentCtrl.js
  2. 2 2
      assets/views/incident/incidentDetail.html

+ 18 - 82
assets/js/controllers/incident/incidentCtrl.js

@@ -626,9 +626,9 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
626
         }).then(function (response) {
626
         }).then(function (response) {
627
             $scope.state = response || [];
627
             $scope.state = response || [];
628
             if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
628
             if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
629
-                $scope.selectTypeChange();
629
+                $scope.selectTypeChange(true);
630
             }else{
630
             }else{
631
-                $scope.refreshData('expand-right');
631
+                $scope.refreshData('expand-right', undefined, true);
632
             }
632
             }
633
         })
633
         })
634
     }
634
     }
@@ -638,6 +638,10 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
638
         $scope.othcode = {};
638
         $scope.othcode = {};
639
 
639
 
640
         $scope.try_async_load();
640
         $scope.try_async_load();
641
+        defaultFilterData = {
642
+            idx: 0,
643
+            sum: mun
644
+        }
641
         $scope.refreshData('expand-right');
645
         $scope.refreshData('expand-right');
642
         $interval.cancel($scope.timer);
646
         $interval.cancel($scope.timer);
643
         $scope.timer = $interval(function () {
647
         $scope.timer = $interval(function () {
@@ -652,12 +656,12 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
652
         }
656
         }
653
         fildata.idx = $scope.jry_idx;
657
         fildata.idx = $scope.jry_idx;
654
         fildata.sum = $scope.jry_sum;
658
         fildata.sum = $scope.jry_sum;
655
-        $scope.refreshData2('expand-right', fildata);
659
+        $scope.refreshData('expand-right', fildata);
656
         console.log($scope.cifilter_classic);
660
         console.log($scope.cifilter_classic);
657
 
661
 
658
     }
662
     }
659
     // 搜索
663
     // 搜索
660
-    $scope.chiceIncident = function (item, stateid) {
664
+    $scope.chiceIncident = function (item, stateid, isInit) {
661
         if (stateid && stateid.id) {
665
         if (stateid && stateid.id) {
662
             item.statusId = stateid.id;
666
             item.statusId = stateid.id;
663
         } else {
667
         } else {
@@ -690,7 +694,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
690
             }
694
             }
691
         }
695
         }
692
         // /seimin
696
         // /seimin
693
-        $scope.refreshData('expand-right', fildata);
697
+        $scope.refreshData('expand-right', fildata, isInit);
694
         $interval.cancel($scope.timer);
698
         $interval.cancel($scope.timer);
695
         $scope.timer = $interval(function () {
699
         $scope.timer = $interval(function () {
696
             $scope.jry_refresh()
700
             $scope.jry_refresh()
@@ -1926,7 +1930,6 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1926
                                 // 当前的所属责任科室
1930
                                 // 当前的所属责任科室
1927
                                 $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
1931
                                 $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
1928
                                 $scope.assign.duty = $rootScope.user.duty;
1932
                                 $scope.assign.duty = $rootScope.user.duty;
1929
-                                $scope.changeDuty();
1930
                             }else if($rootScope.user.branch){
1933
                             }else if($rootScope.user.branch){
1931
                                 // 当前的所属院区
1934
                                 // 当前的所属院区
1932
                                 $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
1935
                                 $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
@@ -2067,13 +2070,13 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2067
     }else{
2070
     }else{
2068
         $scope.searchstate = 'todo';
2071
         $scope.searchstate = 'todo';
2069
     }
2072
     }
2070
-    $scope.onChange = function (searchstate) {
2073
+    $scope.onChange = function (searchstate, isInit) {
2071
         $scope.isDisabledState = false;
2074
         $scope.isDisabledState = false;
2072
         $scope.searchstate = searchstate;
2075
         $scope.searchstate = searchstate;
2073
-        $scope.chiceIncident($scope.searchkeys,$scope.othcode.state);
2076
+        $scope.chiceIncident($scope.searchkeys,$scope.othcode.state, isInit);
2074
     }
2077
     }
2075
-    // 是否逾期下拉框选择seimin
2076
-    $scope.selectTypeChange = function(){
2078
+    // 是否逾期下拉框选择
2079
+    $scope.selectTypeChange = function(isInit){
2077
         console.log($scope.searchkeys.selectType,66666);
2080
         console.log($scope.searchkeys.selectType,66666);
2078
         if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
2081
         if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
2079
             $scope.searchkeys.selectType = {id:'2',name:'是'};
2082
             $scope.searchkeys.selectType = {id:'2',name:'是'};
@@ -2087,22 +2090,14 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2087
             };
2090
             };
2088
         }
2091
         }
2089
         console.log(defaultFilterData,2222)
2092
         console.log(defaultFilterData,2222)
2090
-        $scope.onChange('all');
2093
+        $scope.onChange('all', isInit);
2091
     }
2094
     }
2092
     //获取列表数据
2095
     //获取列表数据
2093
-    $scope.refreshData = function (style, filterData) {
2094
-        console.log(filterData,9090)
2095
-
2096
-        if (filterData && filterData.incident && filterData.incident.area) {
2097
-            filterData.incident.place = {
2098
-                id: filterData.incident.place ? filterData.incident.place.id : '',
2099
-                area: filterData.incident.area
2100
-            }
2101
-            delete filterData.incident.area
2102
-        }
2096
+    $scope.refreshData = _.debounce(function (style, filterData, isInit) {
2103
         $scope.ldloading[style.replace('-', '_')] = true;
2097
         $scope.ldloading[style.replace('-', '_')] = true;
2104
         if (angular.isUndefined(filterData)) {
2098
         if (angular.isUndefined(filterData)) {
2105
             filterData = defaultFilterData;
2099
             filterData = defaultFilterData;
2100
+            if(isInit){
2106
                 if($state.params.tab){
2101
                 if($state.params.tab){
2107
                     $scope.searchstate = $state.params.tab;
2102
                     $scope.searchstate = $state.params.tab;
2108
                     filterData.idx = 0;
2103
                     filterData.idx = 0;
@@ -2122,18 +2117,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2122
                     $scope.othcode = {state:obj};
2117
                     $scope.othcode = {state:obj};
2123
                     filterData.incident = {statusId: $state.params.state};
2118
                     filterData.incident = {statusId: $state.params.state};
2124
                 }
2119
                 }
2125
-        }
2126
-        console.log(filterData,11111);
2127
-        if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
2128
-            $scope.searchkeys.selectType = {id:'2',name:'是'};
2129
-            if(filterData.incident&&filterData.incident.selectType){
2130
-                filterData.incident.selectType = '2';
2131
-            }else{
2132
-                filterData.incident = {
2133
-                    selectType : '2'
2134
-                }
2135
             }
2120
             }
2136
-            window.sessionStorage.removeItem('isGoyuqi');
2137
         }
2121
         }
2138
         $scope.myData = [];
2122
         $scope.myData = [];
2139
         $scope.memoryfilterData = filterData;
2123
         $scope.memoryfilterData = filterData;
@@ -2178,56 +2162,8 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2178
         }, function () {
2162
         }, function () {
2179
             $scope.ldloading[style.replace('-', '_')] = false;
2163
             $scope.ldloading[style.replace('-', '_')] = false;
2180
         });
2164
         });
2181
-    };
2182
-    $scope.refreshData2 = function (style, filterData) {
2183
-
2184
-        $scope.ldloading[style.replace('-', '_')] = true;
2185
-        if (angular.isUndefined(filterData)) {
2186
-            filterData = defaultFilterData;
2187
-        }
2188
-        $scope.myData = [];
2189
-        $scope.memoryfilterData = filterData;
2190
-        $scope.gridOptions['sum'] = filterData.sum;
2191
-        // 请求参数调整
2192
-        if(!filterData.incident){
2193
-            filterData.incident = {};
2194
-        }
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;
2206
-        }else{
2207
-            delete filterData.incident.candidateGroups;
2208
-        }
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
-        });
2229
-    };
2230
-    // 进入页面时111
2165
+    }, 500);
2166
+    // 进入页面时
2231
     $scope.getIncidentStatus();
2167
     $scope.getIncidentStatus();
2232
 
2168
 
2233
     $scope.timer = $interval(function () {
2169
     $scope.timer = $interval(function () {

+ 2 - 2
assets/views/incident/incidentDetail.html

@@ -178,7 +178,7 @@
178
                                             <div class="row pull-left ">登记时间:</div>
178
                                             <div class="row pull-left ">登记时间:</div>
179
                                         </div>
179
                                         </div>
180
                                         <div class="control-label col-xs-6 col-0   fontsizes-14 formheardpad">
180
                                         <div class="control-label col-xs-6 col-0   fontsizes-14 formheardpad">
181
-                                            <div>{{model.acceptDate}}
181
+                                            <div>{{model.acceptDate | date:"yyyy-MM-dd HH:mm:ss"}}
182
                                             </div>
182
                                             </div>
183
                                         </div>
183
                                         </div>
184
                                     </div>
184
                                     </div>
@@ -214,7 +214,7 @@
214
                                         </div>
214
                                         </div>
215
                                         <div class="control-label col-xs-6 col-0   fontsizes-14 formheardpad">
215
                                         <div class="control-label col-xs-6 col-0   fontsizes-14 formheardpad">
216
 
216
 
217
-                                            <div>{{model.overdueTime||'--'}}</div>
217
+                                            <div>{{model.overdueTime | date:"yyyy-MM-dd HH:mm:ss"}}</div>
218
                                         </div>
218
                                         </div>
219
                                     </div>
219
                                     </div>
220
                                     <div class="col-md-12 ">
220
                                     <div class="col-md-12 ">