Просмотр исходного кода

周报表新增修改前端页面的编写

mengy лет назад: 3
Родитель
Сommit
84d03a4a1d

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

@@ -18,7 +18,7 @@ angular.module('app.business')
18 18
         $scope.reportMonthly = {};
19 19
 
20 20
         //获取当前登陆人所在单位
21
-        $scope.reportMonthly.orgId=$rootScope.userInfo.orgName;
21
+        $scope.reportMonthly.orgName=$rootScope.userInfo.orgName;
22 22
 
23 23
         //获取当前时间
24 24
         var nowTime=new Date();

+ 55 - 0
src/main/resources/static/app/business/reportMonthly/views/reportMonthly-edit.html

@@ -916,6 +916,61 @@
916 916
 
917 917
 
918 918
                                     </table>
919
+                                    <div class="row">
920
+                                        <table class="table table-striped table-bordered table-hover" width="100%">
921
+                                            <tr>
922
+                                                <th width='15%'>
923
+                                                    <label class="label" style="margin-top: 9px;text-align: center;">填报人:</label>
924
+                                                </th>
925
+                                                <th width='20%'>
926
+                                                    <section>
927
+                                                        <label class="input" style="margin-top: 9px;">
928
+                                                            {{ reportMonthly.filledName }}
929
+                                                        </label>
930
+                                                    </section>
931
+                                                </th>
932
+                                                <th width='15%'>
933
+                                                    <label class="label" style="margin-top: 9px;text-align: center;">填报单位:</label>
934
+                                                </th>
935
+                                                <th>
936
+                                                    <section>
937
+                                                        <label class="input">
938
+                                                            <input class="form-control" type="text"
939
+                                                                   ng-model="reportMonthly.filledUnit"
940
+                                                                   name="filledUnit">
941
+                                                        </label>
942
+                                                    </section>
943
+                                                </th>
944
+                                                <th>
945
+                                                    <label label class="label"
946
+                                                           style="margin-top: 9px;text-align: center;">填报日期:</label>
947
+                                                    <section>
948
+                                                        <label class="input" style="margin-top: 9px;">
949
+                                                            {{ reportMonthly.filledTime | date:'yyyy-MM-dd' }}
950
+                                                        </label>
951
+                                                    </section>
952
+                                                </th>
953
+
954
+                                            </tr>
955
+                                            <!--										<section class="col col-3">-->
956
+                                            <!--											<label class="control-label">单位(汇总):  </label>-->
957
+                                            <!--											<label class="input">-->
958
+                                            <!--												<input type="text" class="form-control" id="keeps" ng-model="reportMonthly.orgId" name="orgId" maxlength="20"   >-->
959
+                                            <!--											</label>-->
960
+                                            <!--										</section>-->
961
+                                            <!--										<section class="col col-3">-->
962
+                                            <!--											<label class="label">日期:</label>-->
963
+                                            <!--											<label class="input">-->
964
+                                            <!--												<input type="text" ng-model="reportMonthly.monthlyTime"-->
965
+                                            <!--													   class="form-control datepicker" onClick="WdatePicker({lang:'zh-cn'})"-->
966
+                                            <!--													   name="usedate"  >-->
967
+                                            <!--											</label>-->
968
+                                            <!--										</section>-->
969
+                                            <!--										<section class="col col-3">-->
970
+                                            <!--											<label class="control-label">单位:吨</label>-->
971
+                                            <!--										</section>-->
972
+                                        </table>
973
+                                    </div>
919 974
                                 </fieldset>
920 975
                                 <footer class="modal-footer text-align-center">
921 976
                                     <a class="btn btn-default" href-void="" href="#" ng-click="retList()">取消</a>

+ 0 - 64
src/main/resources/static/app/business/reportWeekly/controller/reportWeeklyCtrl.js

@@ -39,67 +39,3 @@ angular.module('app.business')
39 39
         $scope.editPage = function (id) {$state.go('app.business.reportWeekly.edit',{id:id}); }
40 40
 
41 41
     })
42
-    .controller("reportWeeklyEditCtrl", function($scope,$filter,$rootScope,$state, $stateParams,alertService, reportWeeklyService, APP_CONFIG) {
43
-        // 获取数据
44
-
45
-        $scope.loadData = function () {
46
-            reportWeeklyService.loadDataById($stateParams.id)
47
-                .then(function(data){
48
-                    $scope.reportWeekly = data;
49
-                    $scope.reportWeekly.weeklyTime = $filter('date')($scope.reportWeekly.weeklyTime, "yyyy-MM-dd");
50
-                    var disabled = false;
51
-
52
-                    //用于控制修改和新增页面的提交按钮隐藏和显示
53
-                    if(disabled){
54
-                        $("#cancel").hide();
55
-                    }else {
56
-                        $("#cancel").show();
57
-                    }
58
-
59
-                },function(data){
60
-                    console.log(data);
61
-                });
62
-        };
63
-        $scope.reportWeekly = {};
64
-
65
-        if($stateParams.id != 0){
66
-            $scope.loadData();
67
-        }
68
-
69
-
70
-        var validator = $("#reportWeekly-form").validate();
71
-        $scope.saveData = function () {
72
-            if(validator.form()) {
73
-                var orgId = $rootScope.userInfo.orgId;//当前登录者的库id
74
-                $scope.reportWeekly.weeklyTime = $("input[name='weeklyTime']").val();
75
-                reportWeeklyService.saveData(angular.toJson($scope.reportWeekly),orgId)
76
-                    .then(function (data) {
77
-                        //alertService.showSuccess("操作成功");
78
-                        alert("保存成功!");
79
-                        $state.go('app.storage.reportWeekly.list');
80
-                    }, function (data) {
81
-                        console.log(data);
82
-                    })
83
-            }
84
-        }
85
-
86
-        //排除不是数字的
87
-        $scope.clearNoNum = function(obj,attr){
88
-        	//先把非数字的都替换掉,除了数字和.
89
-        	obj[attr] = obj[attr].replace(/[^\d.]/g,"");
90
-        	//必须保证第一个为数字而不是.
91
-        	obj[attr] = obj[attr].replace(/^\./g,"");
92
-        	//保证只有出现一个.而没有多个.
93
-        	obj[attr] = obj[attr].replace(/\.{2,}/g,"");
94
-        	//保证.只出现一次,而不能出现两次以上
95
-        	obj[attr] = obj[attr].replace(".","$#$").replace(/\./g,"").replace("$#$",".");
96
-
97
-        	if(obj.price !=null && obj.price != "" && typeof obj.price != "undefined" &&
98
-                obj.number !=null && obj.number != "" && typeof obj.number != "undefined" ){
99
-                $scope.allPrice = Math.round(obj.price * obj.number * 100) / 100;
100
-            }
101
-
102
-        }
103
-        
104
-        $scope.retList = function () { $state.go('app.business.reportWeekly.list'); }
105
-    })

Разница между файлами не показана из-за своего большого размера
+ 1299 - 875
src/main/resources/static/app/business/reportWeekly/views/reportWeekly-edit.html


+ 1 - 1
src/main/resources/static/app/business/reportWeekly/views/reportWeekly-list.html

@@ -15,7 +15,7 @@
15 15
 							<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
16 16
 								<div class="dt-toolbar">
17 17
 									<label>
18
-										<a has-permission="620" href-void class="btn btn-primary btn-sm" ng-click="showStorageNoticeAdd()"><i class="fa fa-plus"></i>&nbsp;新增</a>
18
+										<a has-permission="620" href-void class="btn btn-primary btn-sm" ng-click="showWeeklyAdd()"><i class="fa fa-plus"></i>&nbsp;新增</a>
19 19
 									</label>&emsp;
20 20
 
21 21
 									<div class="col-sm-2 col-xs-2 hidden-xs">