Kaynağa Gözat

'报表前端计算及ie日期bug修改'g

GaoYuPeng 3 yıl önce
ebeveyn
işleme
f69b229ab2

+ 1 - 0
src/main/resources/static/app/app.js

@@ -131,6 +131,7 @@ angular.module('app', [
131 131
     	return angular.isObject(data) && String(data) !== '[object File]' ? $.param(data) : data;
132 132
     }];
133 133
     
134
+  
134 135
     //$httpProvider.defaults.withCredentials = true;跨越session失效
135 136
 
136 137
     // 默认表单验证参数

+ 101 - 13
src/main/resources/static/app/business/reportMonthly/controller/reportMonthlyCtrl.js

@@ -8,10 +8,10 @@ angular.module('app.business')
8 8
         $scope.search = {id:""};
9 9
         $scope.loadData = function () {
10 10
             // console.log('列表数据')
11
-            console.log($scope.searchCondition,'$scope.searchCondition')
11
+            // console.log($scope.searchCondition,'$scope.searchCondition')
12 12
             reportMonthlyService.loadData($scope.pageInfo.pageNum, $scope.pageInfo.pageSize,$scope.searchCondition.reportPeriod,$scope.searchCondition.status,$scope.searchCondition.filledTime)
13 13
                 .then(function(data){
14
-                    console.log(data,'pageInfoData--monthData')
14
+                    // console.log(data,'pageInfoData--monthData')
15 15
                     $scope.pageInfoData = data;
16 16
 
17 17
                 },function(data){
@@ -23,7 +23,7 @@ angular.module('app.business')
23 23
         $scope.auditList = [];
24 24
         $scope.reportMonthly.status = null
25 25
 
26
-        console.log($stateParams,'$stateParams')
26
+        // console.log($stateParams,'$stateParams')
27 27
         //获取当前登陆人所在单位
28 28
         $scope.reportMonthly.orgName=$rootScope.orgInfo.orgName;
29 29
         $scope.reportMonthly.filledUnit=$rootScope.orgInfo.orgName;
@@ -34,7 +34,7 @@ angular.module('app.business')
34 34
         //获取当前时间
35 35
         var nowTime=new Date();
36 36
         $scope.year = nowTime.getFullYear()
37
-        console.log($scope.year,'year')
37
+        // console.log($scope.year,'year')
38 38
         $scope.reportMonthly.monthlyTime = nowTime;
39 39
         $scope.reportMonthly.filledTime=$rootScope.now;
40 40
         // console.log($rootScope.now,'$rootScope.now')
@@ -73,10 +73,10 @@ angular.module('app.business')
73 73
                 $scope.reportMonthly.companyOrgCode=$rootScope.orgInfo.companyOrgCode;//组织机构代码
74 74
                 // console.log($scope.reportMonthly.monthlyTime,$("input[name='monthlyTime']").val(),'月报表日期')
75 75
                 // $scope.reportMonthly.monthlyTime = $("input[name='monthlyTime']").val();
76
-                // console.log($scope.reportMonthly,'reportMonthly')
76
+                // console.log($scope.reportMonthly,'reportMonthly-查看保存数据')
77 77
                 reportMonthlyService.saveData(angular.toJson($scope.reportMonthly),orgId)
78 78
                     .then(function (data) {
79
-                        console.log(data,'data')
79
+                        // console.log(data,'data')
80 80
                         //alertService.showSuccess("操作成功");
81 81
                         alert("保存成功!");
82 82
                         $state.go('app.business.reportMonthly-list');
@@ -88,7 +88,26 @@ angular.module('app.business')
88 88
             }
89 89
         }
90 90
         
91
-       
91
+      //  计算比例
92
+        $scope.proport = function(a,b,c) {
93
+        // console.log('计划:'+a,'交易量:'+b,'类型:'+ c)
94
+        if(b!=0) {
95
+          // console.log('商不能为0!')
96
+          if(c == 1) {
97
+            // console.log('省级')
98
+            $scope.reportMonthly.provincePlanProportion = (b/a).toFixed(4)*100
99
+          }else if(c ==2 ){
100
+            // console.log('市级')
101
+            $scope.reportMonthly.municipalPlanProportion = (b/a).toFixed(4)*100
102
+
103
+          }else if(c == 3) {
104
+            // console.log("县级")
105
+            $scope.reportMonthly.countyPlanProportion = (b/a).toFixed(4)*100
106
+
107
+          }
108
+        }
109
+        
110
+      }
92 111
         
93 112
         $scope.loadMonthlyData = function () {
94 113
             $scope.type  = $stateParams.type
@@ -134,7 +153,7 @@ angular.module('app.business')
134 153
         if( $stateParams.id != undefined && $stateParams.id != null && $stateParams.id != '' &&  $stateParams.id != 0){
135 154
             $scope.loadMonthlyData();
136 155
         }
137
-        
156
+
138 157
         
139 158
         
140 159
         // 点击上报,修改其状态
@@ -151,13 +170,13 @@ angular.module('app.business')
151 170
                 reportMonthlys.orgName=$rootScope.orgInfo.orgName;
152 171
                 reportMonthlys.companyOrgCode=$rootScope.orgInfo.companyOrgCode;//组织机构代码
153 172
 
154
-                console.log(reportMonthlys,'reportMonthlys')
173
+                // console.log(reportMonthlys,'reportMonthlys')
155 174
                 reportMonthlyService.reportMonthly(reportMonthlys).then(function(data){
156
-                    console.log(data,"----上报结果");
175
+                    // console.log(data,"----上报结果");
157 176
                     if(data.status=="success"){
158 177
                         //alert("点击上报后不可再取消,确认上报");
159 178
                         reportMonthlyService.updateStatusm(id).then(function(data){
160
-                            console.log(data,"上报状态修改返回");
179
+                            // console.log(data,"上报状态修改返回");
161 180
                             if(data.status=="success"){
162 181
                                 // $scope.reportMonthly.status = 0
163 182
                                 $scope.loadData();
@@ -168,9 +187,12 @@ angular.module('app.business')
168 187
                             console.log(data);
169 188
                         });
170 189
 
171
-                    }else{
172
-                        alert("省级平台接收数据有误,尽快与其联系!");
190
+                    }else if(data.infoCode == 303){
191
+                        console.log(data.msg,data.status,'重复提交报错信息')
192
+                        alert("当前机构已提交过该月报表,请勿重复提交!");
173 193
                         // $scope.saveFlag = false ;
194
+                    }else if(data.infoCode == 500) {
195
+                      alert("服务异常")
174 196
                     }
175 197
 
176 198
                 },function(data){
@@ -217,4 +239,70 @@ angular.module('app.business')
217 239
         },"请输入大于0的数字,最多三位小数!");
218 240
 
219 241
 
242
+         //  计算汇总(合计)
243
+         $scope.subTotal = function(num1,num2,num3,category,level) {
244
+          // console.log('小麦:'+num1,'玉米:'+num2,'食用油:'+ num3,'类别:'+category, '级别:'+level)
245
+          if(category == 'plan') {
246
+            // 计划
247
+            if(level == 3) {
248
+              // 省级
249
+              $scope.reportMonthly.provincePlanTotal =Number(num1) +Number(num2) + Number(num3)
250
+            }else if(level ==2) {
251
+               // 市级
252
+               $scope.reportMonthly.municipalPlanTotal =Number(num1) +Number(num2) + Number(num3)
253
+            }else if(level == 1) {
254
+              // 县级 
255
+              $scope.reportMonthly.countyPlanTotal =Number(num1) +Number(num2) + Number(num3)
256
+            }
257
+          }else if(category == 'out') {
258
+            // 本周轮出
259
+            if(level == 3) {
260
+              // 省级
261
+              $scope.reportMonthly.provinceOutTotal =Number(num1) +Number(num2) + Number(num3)
262
+            }else if(level == 2) {
263
+              // 市级
264
+              $scope.reportMonthly.municipalOutTotal =Number(num1) +Number(num2) + Number(num3)
265
+            }else if (level == 1) {
266
+              // 县级
267
+              $scope.reportMonthly.countyOutTotal =Number(num1) +Number(num2) + Number(num3)
268
+            }
269
+          }else if(category == 'outCumulative') {
270
+            // 累计轮出
271
+            if(level == 3) {
272
+              // 省级
273
+              $scope.reportMonthly.provinceOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
274
+            }else if(level == 2) {
275
+              // 市级
276
+              $scope.reportMonthly.municipalOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
277
+            }else if(level == 1 ) {
278
+              // 县级
279
+              $scope.reportMonthly.countyOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
280
+            }
281
+          }else if(category == 'in') {
282
+            // 本周轮入
283
+            if(level == 3) {
284
+              // 省级
285
+              $scope.reportMonthly.provinceInTotal =Number(num1) +Number(num2) + Number(num3)
286
+            }else if(level == 2) {
287
+              // 市级
288
+              $scope.reportMonthly.municipalInTotal =Number(num1) +Number(num2) + Number(num3)
289
+            }else if(level == 1) {
290
+              // 县级
291
+              $scope.reportMonthly.countyInTotal =Number(num1) +Number(num2) + Number(num3)
292
+            }
293
+          }else if(category == 'inCumulative') {
294
+            // 累计轮入
295
+            if(level == 3) {
296
+              // 省级
297
+              $scope.reportMonthly.provinceInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
298
+            }else if(level == 2) {
299
+              // 市级
300
+              $scope.reportMonthly.municipalInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
301
+            }else if(level == 1) {
302
+              // 县级
303
+              $scope.reportMonthly.countyInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
304
+            }
305
+          } 
306
+        }
307
+
220 308
     })

Dosya farkı çok büyük olduğundan ihmal edildi
+ 988 - 1068
src/main/resources/static/app/business/reportMonthly/views/reportMonthly-edit.html


+ 97 - 20
src/main/resources/static/app/business/reportWeekly/controller/reportWeeklyCtrl.js

@@ -3,13 +3,13 @@
3 3
 angular.module('app.business')
4 4
     .controller("reportWeeklyCtrl", function($scope, $state,$rootScope, $stateParams, enumService,reportWeeklyService, APP_CONFIG) {
5 5
         // 获取列表数据
6
-        $scope.pageInfo = {pageNum : 1, pageSize : 10};
6
+        $scope.pageInfo = {pageNum : 1, pageSize : 25};
7 7
         $scope.searchCondition = {reportPeriod:'',status:'',filledTime:''};
8 8
         $scope.search = {id:""};
9 9
         $scope.loadData = function () {
10 10
             reportWeeklyService.loadData($scope.pageInfo.pageNum, $scope.pageInfo.pageSize,$scope.searchCondition.reportPeriod,$scope.searchCondition.status,$scope.searchCondition.filledTime)
11 11
                 .then(function(data){
12
-                    console.log(data,'pageInfoData---loadData')
12
+                    // console.log(data,'pageInfoData---loadData')
13 13
                     
14 14
                     $scope.pageInfoData = data;
15 15
 
@@ -34,11 +34,13 @@ angular.module('app.business')
34 34
         //获取当前时间
35 35
         var nowTime=new Date();
36 36
         var date = new Date(nowTime);
37
-        $scope.year = nowTime.getFullYear()
38
-        console.log($scope.year,'years')
39
-        nowTime=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() /* + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() */; 
40
-
41
-        $scope.reportWeekly.filledTime= nowTime;
37
+        $scope.year = new Date().getFullYear()
38
+        // console.log($scope.year,'years')
39
+        nowTime=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()/*  + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() */; 
40
+        $scope.reportWeekly.filledTime=new Date()
41
+        // console.log($rootScope.now,'now')
42
+        // console.log($scope.reportWeekly.filledTime,'现在时间')
43
+        // $scope.reportWeekly.filledTime= nowTime;
42 44
 
43 45
         // 翻页
44 46
         $scope.goPage = function(pageNum) {
@@ -72,17 +74,18 @@ angular.module('app.business')
72 74
         
73 75
         // 新增提交
74 76
         $scope.saveWeeklyData = function () {
75
-            
76
-            
77 77
             if(validator.form()) {
78
-                console.log('校验成功')
78
+                // console.log('校验成功')
79 79
                 var orgId = $rootScope.userInfo.orgId;//当前登录者的库id
80 80
                 $scope.reportWeekly.companyOrgCode=$rootScope.orgInfo.companyOrgCode;//组织机构代码
81 81
                 // $scope.reportWeekly.filledTime = $("input[name='filledTime']").val();
82
-                $scope.reportWeekly.filledTime = new Date($scope.reportWeekly.filledTime) 
83
-                $scope.reportWeekly.weeklyTimeStart = new Date($('#weeklyTimeStart').val())
84
-                $scope.reportWeekly.weeklyTimeEnd = new Date($('#weeklyTimeEnd').val())
85
-                // console.log($scope.reportWeekly,'reportWeekly')
82
+                // $scope.reportWeekly.filledTime = new Date($scope.reportWeekly.filledTime) 
83
+                // 在ie中不支持‘-’格式,需要把日期转为 "/"  var date= new Date(Date.parse(a.replace(/-/g,'/' )) )
84
+                $scope.reportWeekly.weeklyTimeStart = new Date(Date.parse(( $('#weeklyTimeStart').val()).replace(/-/g,'/' ) ))
85
+                $scope.reportWeekly.weeklyTimeEnd = new Date(Date.parse(( $('#weeklyTimeEnd').val()).replace(/-/g,'/' ) ))
86
+                // console.log($scope.reportWeekly,'reportWeekly-查看周报表保存数据')
87
+                // console.log($scope.reportWeekly.weeklyTimeStart,$scope.reportWeekly.weeklyTimeEnd,'$scope.reportWeekly.weeklyTimeStart,$scope.reportWeekly.weeklyTimeEnd,')
88
+ 
86 89
                 reportWeeklyService.saveData(angular.toJson($scope.reportWeekly),orgId)
87 90
                     .then(function (data) {
88 91
                         // console.log(data,'data')
@@ -113,13 +116,13 @@ angular.module('app.business')
113 116
                     var reportWeeklys = angular.fromJson(angular.toJson(data));
114 117
                     reportWeeklys.orgName= $rootScope.orgInfo.orgName;
115 118
                     reportWeeklys.companyOrgCode= $rootScope.orgInfo.companyOrgCode;//组织机构代码
116
-                    console.log(reportWeeklys,'reportWeeklys---111--22')
119
+                    // console.log(reportWeeklys,'reportWeeklys---111--22')
117 120
                     reportWeeklyService.reportWeekly(reportWeeklys).then(function(data){
118
-                        console.log(data +"----上报结果");
121
+                        // console.log(data +"----上报结果");
119 122
                         if(data.status=="success"){
120 123
                             //alert("点击上报后不可再取消,确认上报");
121 124
                             reportWeeklyService.updateStatusw(id).then(function(data){
122
-                                console.log(data,"上报状态修改返回值");
125
+                                // console.log(data,"上报状态修改返回值");
123 126
                                 if(data.status=="success"){
124 127
                                     // $scope.reportWeekly.status = 0
125 128
                                     $scope.loadData();
@@ -130,9 +133,12 @@ angular.module('app.business')
130 133
                                 console.log(data);
131 134
                             });
132 135
 
133
-                        }else{
134
-                            alert("省级平台接收数据有误,尽快与其联系!");
136
+                        }else if(data.infoCode == 303){
137
+                            console.log(data.msg,data.status,'重复提交报错信息')
138
+                            alert("当前机构已提交过该周报表,请勿重复提交!");
135 139
                             $scope.saveFlag = false ;
140
+                        }else if(data.infoCode == 500){
141
+                          alert("服务异常")
136 142
                         }
137 143
 
138 144
                     },function(data){
@@ -164,10 +170,11 @@ angular.module('app.business')
164 170
                     $scope.reportWeekly = data;
165 171
                     // reportWeekly.weeklyTimeStart
166 172
                     // console.log(data,'data')
173
+                    // console.log(data.weeklyTimeStart,'datdata.weeklyTimeStarta')
167 174
                     // endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate()
168 175
                     $scope.reportWeekly.weeklyTimeStart = new Date(data.weeklyTimeStart).getFullYear() + '-' + (new Date(data.weeklyTimeStart).getMonth() + 1) + '-' + new Date(data.weeklyTimeStart).getDate()
169 176
                     $scope.reportWeekly.weeklyTimeEnd = new Date(data.weeklyTimeEnd).getFullYear() + '-' + (new Date(data.weeklyTimeEnd).getMonth() + 1) + '-' + new Date(data.weeklyTimeEnd).getDate()
170
-                    console.log($scope.reportWeekly.weeklyTimeStart,'$scope.reportWeekly.weeklyTimeStart')
177
+                    // console.log($scope.reportWeekly.weeklyTimeStart,'$scope.reportWeekly.weeklyTimeStart')
171 178
                     // console.log($scope.reportWeekly,'$scope.reportWeekly0000000')
172 179
                     // $scope.reportWeekly.monthlyTime = $filter('date')($scope.reportWeekly.monthlyTime, "yyyy-MM-dd");
173 180
 
@@ -226,4 +233,74 @@ angular.module('app.business')
226 233
             var checkNumber = /^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,3})?$/;
227 234
             return this.optional(element)||(checkNumber.test(value));
228 235
         },"请输入大于0的数字,最多三位小数!");
236
+
237
+         //  计算汇总(小计)
238
+         $scope.subTotal = function(num1,num2,num3,category,level) {
239
+          // console.log('小麦:'+num1,'玉米:'+num2,'食用油:'+ num3,'类别:'+category, '级别:'+level)
240
+          if(category == 'plan') {
241
+            // 计划
242
+            if(level == 3) {
243
+              // 省级
244
+              $scope.reportWeekly.provincePlanTotal =Number(num1) +Number(num2) + Number(num3)
245
+            }else if(level ==2) {
246
+               // 市级
247
+               $scope.reportWeekly.municipalPlanTotal =Number(num1) +Number(num2) + Number(num3)
248
+            }else if(level == 1) {
249
+              // 县级 
250
+              $scope.reportWeekly.countyPlanTotal =Number(num1) +Number(num2) + Number(num3)
251
+            }
252
+          }else if(category == 'out') {
253
+            // 本周轮出
254
+            if(level == 3) {
255
+              // 省级
256
+              $scope.reportWeekly.provinceOutTotal =Number(num1) +Number(num2) + Number(num3)
257
+            }else if(level == 2) {
258
+              // 市级
259
+              $scope.reportWeekly.municipalOutTotal =Number(num1) +Number(num2) + Number(num3)
260
+            }else if (level == 1) {
261
+              // 县级
262
+              $scope.reportWeekly.countyOutTotal =Number(num1) +Number(num2) + Number(num3)
263
+            }
264
+          }else if(category == 'outCumulative') {
265
+            // 累计轮出
266
+            if(level == 3) {
267
+              // 省级
268
+              $scope.reportWeekly.provinceOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
269
+            }else if(level == 2) {
270
+              // 市级
271
+              $scope.reportWeekly.municipalOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
272
+            }else if(level == 1 ) {
273
+              // 县级
274
+              $scope.reportWeekly.countyOutTotalCumulative =Number(num1) +Number(num2) + Number(num3)
275
+            }
276
+          }else if(category == 'in') {
277
+            // 本周轮入
278
+            if(level == 3) {
279
+              // 省级
280
+              $scope.reportWeekly.provinceInTotal =Number(num1) +Number(num2) + Number(num3)
281
+            }else if(level == 2) {
282
+              // 市级
283
+              $scope.reportWeekly.municipalInTotal =Number(num1) +Number(num2) + Number(num3)
284
+            }else if(level == 1) {
285
+              // 县级
286
+              $scope.reportWeekly.countyInTotal =Number(num1) +Number(num2) + Number(num3)
287
+            }
288
+          }else if(category == 'inCumulative') {
289
+            // 累计轮入
290
+            if(level == 3) {
291
+              // 省级
292
+              $scope.reportWeekly.provinceInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
293
+            }else if(level == 2) {
294
+              // 市级
295
+              $scope.reportWeekly.municipalInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
296
+            }else if(level == 1) {
297
+              // 县级
298
+              $scope.reportWeekly.countyInTotalCumulative =Number(num1) +Number(num2) + Number(num3)
299
+            }
300
+          } 
301
+        }
302
+
303
+
229 304
         })
305
+
306
+       

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1324 - 1345
src/main/resources/static/app/business/reportWeekly/views/reportWeekly-edit.html


+ 15 - 1
src/main/resources/static/styles/css/home/home-1.css

@@ -417,4 +417,18 @@
417 417
 /*===========远程监管new======*/
418 418
 .camera-body.no-padding{ margin: -13px 0px 0px 0px;}
419 419
 .camera-body.no-padding > .row{ margin: 0px;}
420
-.camera-body .jarviswidget{ margin-bottom:0px;}
420
+.camera-body .jarviswidget{ margin-bottom:0px;}
421
+
422
+.smart-form .table .table-algin {
423
+  text-align: center;
424
+  vertical-align: middle;
425
+}
426
+#reportMonthlyTable>tbody>tr>td, #reportMonthlyTable>tbody>tr>th, #reportMonthlyTable>tfoot>tr>td, #reportMonthlyTable>tfoot>tr>th, #reportMonthlyTable>thead>tr>td, #reportMonthlyTable>thead>tr>th {
427
+  padding: 0;
428
+}
429
+#reportWeeklyTable>tbody>tr>td, #reportWeeklyTable>tbody>tr>th, #reportWeeklyTable>tfoot>tr>td, #reportWeeklyTable>tfoot>tr>th, #reportWeeklyTable>thead>tr>td, #reportWeeklyTable>thead>tr>th {
430
+  padding: 0;
431
+}
432
+
433
+
434
+

Dosya farkı çok büyük olduğundan ihmal edildi
+ 8083 - 9
src/main/resources/static/styles/css/smartadmin-production-plugins.min.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 18899 - 3
src/main/resources/static/styles/css/smartadmin-production.min.css