fanxw %!s(int64=2) %!d(string=hai) anos
pai
achega
49282f2eac

+ 2 - 1
src/main/resources/static/app/business/contractReceive/service/contractReceiveService.js

@@ -2,7 +2,7 @@
2 2
 
3 3
 angular.module('app.business').service("contractReceiveService", function($http, $q, APP_CONFIG,$rootScope) {
4 4
     //盘点列表
5
-	this.getPageInfo = function(pageNum, pageSize, htbh, houseId, warehouseId){
5
+	this.getPageInfo = function(pageNum, pageSize, htbh, houseId, warehouseId, htlx){
6 6
 		var d = $q.defer();
7 7
 		$http({
8 8
 			method : 'GET',
@@ -13,6 +13,7 @@ angular.module('app.business').service("contractReceiveService", function($http,
13 13
 				htbh: htbh,
14 14
                 houseId: houseId,
15 15
                 warehouseId: warehouseId,
16
+                htlx: htlx,
16 17
                 orgId: $rootScope.userInfo.orgId
17 18
 			}
18 19
 		}).then(function successCallback(response) {

+ 40 - 0
src/main/resources/static/app/business/deliveryStorageNotice/controller/receiveContractListModalCtrl.js

@@ -0,0 +1,40 @@
1
+angular.module('app.business').controller("receiveContractListModalCtrl", 
2
+    function($scope, $uibModalInstance, $filter, $http, $uibModal,$rootScope, contractReceiveService, APP_CONFIG, items) {
3
+
4
+	$scope.pageInfo = {pageNum: 1, pageSize: 10};
5
+    $scope.search = {htbh: "", houseId: "", warehouseId: ""};
6
+
7
+    $scope.loadData = function () {
8
+    	contractReceiveService.getPageInfo($scope.pageInfo.pageNum, 
9
+    			$scope.pageInfo.pageSize, 
10
+    			null,
11
+    			items.houseId,
12
+    			items.warehouseId,
13
+    			items.htlx).then(function (data) {
14
+            $scope.pageInfo = data;
15
+        }, function (data) {
16
+            console.log(data);
17
+        });
18
+    }
19
+
20
+    $scope.loadData();
21
+
22
+    // 翻页
23
+    $scope.goPage = function(pageNum) {
24
+        if ($scope.pageInfo.pageNum != pageNum && pageNum > 0) {
25
+             $scope.pageInfo.pageNum = pageNum;
26
+             $scope.loadData();
27
+         }
28
+    }
29
+    
30
+    // 关闭模态窗口
31
+    $scope.cancel = function() {
32
+        $uibModalInstance.close();
33
+    }
34
+    
35
+    // 选择.
36
+    $scope.selectContractReceive = function(contractReceive) {
37
+        $uibModalInstance.close(contractReceive);
38
+    }
39
+
40
+});

+ 3 - 3
src/main/resources/static/app/business/deliveryStorageNotice/controller/receiveNoticeCtrl.js

@@ -37,9 +37,9 @@ angular.module('app.business').controller("receiveNoticeCtrl", function($scope,
37 37
  	}
38 38
  	
39 39
  	
40
-    // 查看页面
41
-    $scope.showView = function(id) {
42
-        $state.go("app.business.grainReservesManage-receiveNotice-view", {id : id});
40
+    // 编辑页面
41
+    $scope.edit = function(id, btnType) {
42
+        $state.go("app.business.grainReservesManage-receiveNotice-view", {id : id, btnType: btnType});
43 43
     }
44 44
     
45 45
     

+ 72 - 18
src/main/resources/static/app/business/deliveryStorageNotice/controller/receiveNoticeSaveCtrl.js

@@ -13,35 +13,89 @@ angular.module('app.business').controller("receiveNoticeSaveCtrl",
13 13
 	        	 $scope.businessNoticeReceive.crktype = "出库";
14 14
 	         }
15 15
 	         
16
-	         if($scope.businessNoticeReceive.ywtype == 1){//<!-- 1竞买2 销售 3轮换 --> 
17
-	        	 $scope.businessNoticeReceive.ywtype = "竞买";
18
-	         }else if($scope.businessNoticeReceive.ywtype == 2){//<!-- 1竞买2 销售 3轮换 --> 
19
-	        	 $scope.businessNoticeReceive.ywtype = "销售";
20
-	         }else if($scope.businessNoticeReceive.ywtype == 3){//<!-- 1竞买2 销售 3轮换 --> 
21
-	        	 $scope.businessNoticeReceive.ywtype = "轮换";
16
+	         $scope.ywlx = "";
17
+	         if ($scope.businessNoticeReceive.ywtype == 1 || $scope.businessNoticeReceive.ywtype == 2) {//<!-- 1竞买=竞价,2 销售=竞价 3轮换=包干 --> 
18
+	        	 $scope.ywlx = "竞价";
19
+	         } else if ($scope.businessNoticeReceive.ywtype == 3){
20
+	        	 $scope.ywlx = "包干";
22 21
 	         }
23
-	         
24
-	         //单位转化
25
-	         //$scope.businessNoticeReceive.count = commonUtilService.accDiv($scope.businessNoticeReceive.count,1000);
26 22
 	     },function(data){
27 23
 	    	 console.log(data);
28 24
 	     });
29 25
          
30 26
 	 }
27
+	 
28
+	 // 选择市平台下发的合同
29
+	 $scope.getReceiveContract = function(businessNoticeReceive) {
30
+         var params = [];
31
+         params.houseId = businessNoticeReceive.houseId;
32
+ 		 params.warehouseId = businessNoticeReceive.wareHouseId;
33
+ 		 if (businessNoticeReceive.crktype == "出库") {//销售
34
+ 			 params.htlx = "1";
35
+ 		 } else if (businessNoticeReceive.crktype == "入库") {//采购
36
+ 			 params.htlx = "0";
37
+ 		 }
38
+         var uibModalInstance = $uibModal.open({
39
+             size:'lg',
40
+             templateUrl: 'app/business/deliveryStorageNotice/views/receiveContract-list-modal.html',
41
+             controller: 'receiveContractListModalCtrl',
42
+             resolve: {
43
+                 // items是一个回调函数
44
+                 items: function () {
45
+                     // 这个值会被模态框的控制器获取到
46
+                     return params;
47
+                 }
48
+             }
49
+         });
50
+         uibModalInstance.result.then(function (result) {
51
+             if (result != null) {
52
+                 // 获取明细信息.
53
+            	 $scope.businessNoticeReceive.htbh = result.htbh;
54
+             }
55
+         }, function (reason) {
56
+             console.log(reason);
57
+         });
58
+     }
59
+
60
+	 $scope.removeHtbh = function() {
61
+		 if (true) {
62
+			 $scope.businessNoticeReceive.htbh = null;
63
+		 }
64
+     }
31 65
 
32 66
 	 
33 67
 	 //返回
34 68
 	 $scope.retList = function () {
35
-       $state.go("app.business.grainReservesManage-receiveNotice");
36
-    }
37
-    
38
-	 
39
-	 if($stateParams.id != 0){
40
-	   	  $scope.loadDataById($stateParams.id);
41
-	   	  $scope.isNotEdit = true ;
69
+         $state.go("app.business.grainReservesManage-receiveNotice");
70
+     }
71
+
72
+	 if ($stateParams.id != 0){
73
+	   	 $scope.loadDataById($stateParams.id);
74
+	   	 $scope.isNotEdit = true ;
75
+	   	 $scope.htbhNotEdit = true;
76
+	   	 if ($stateParams.btnType == 'glht') {
77
+	   		 $scope.htbhNotEdit = false;
78
+	   	 }
42 79
      }
43 80
 
44
-       
81
+	 var validator = $("#deliveryStorageNotice-form").validate();
45 82
 
46
-       
83
+	 $scope.save = function() {
84
+		 if (validator.form()) {
85
+			 $scope.noticeReceive = {};
86
+			 $scope.noticeReceive.htbh = $scope.businessNoticeReceive.htbh;
87
+			 $scope.noticeReceive.id = $scope.businessNoticeReceive.id;
88
+			 $scope.noticeReceive.orgId = $scope.businessNoticeReceive.orgId;
89
+			 receiveNoticeService.updateHtbh($scope.noticeReceive).then(function(data){
90
+				 if (data.status == "200") {
91
+					 alert("操作成功");
92
+					 $scope.retList();
93
+				 } else {
94
+					 alert("操作失败");
95
+				 }
96
+		     },function(data){
97
+		    	 console.log(data);
98
+		     });
99
+		 }
100
+	 }
47 101
 });

+ 22 - 6
src/main/resources/static/app/business/deliveryStorageNotice/service/receiveNoticeService.js

@@ -34,7 +34,7 @@ angular.module('app.business').service("receiveNoticeService", function($http,$r
34 34
             d.reject("error");
35 35
         });
36 36
         return d.promise;
37
-    }  
37
+    }
38 38
 
39 39
 
40 40
     //根据id加载数据
@@ -83,9 +83,8 @@ angular.module('app.business').service("receiveNoticeService", function($http,$r
83 83
             d.reject("error");
84 84
         });
85 85
         return d.promise;
86
-    }  
87
-    
88
-    
86
+    }
87
+
89 88
     this.audit = function(receiveNotice,content) {
90 89
         var d = $q.defer();
91 90
         $http({
@@ -107,8 +106,7 @@ angular.module('app.business').service("receiveNoticeService", function($http,$r
107 106
             d.reject("error");
108 107
         });
109 108
         return d.promise;
110
-    } 
111
-    
109
+    }
112 110
 
113 111
     this.getAuditById = function(id) {
114 112
         var d = $q.defer();
@@ -125,4 +123,22 @@ angular.module('app.business').service("receiveNoticeService", function($http,$r
125 123
         return d.promise;
126 124
     }
127 125
 
126
+    this.updateHtbh = function(receiveNotice) {
127
+        var d = $q.defer();
128
+        $http({
129
+            method : 'POST',
130
+            url : APP_CONFIG.businessUrl + '/depot/business/receiveNotice/updateHtbh',
131
+            data: {
132
+            	notice : angular.toJson(receiveNotice)
133
+            }
134
+        }).then(function successCallback(response) {
135
+            // 请求成功执行代码
136
+          
137
+            d.resolve(response.data);
138
+        }, function errorCallback(response) {
139
+            // 请求失败执行代码
140
+            d.reject("error");
141
+        });
142
+        return d.promise;
143
+    }
128 144
 })

+ 58 - 0
src/main/resources/static/app/business/deliveryStorageNotice/views/receiveContract-list-modal.html

@@ -0,0 +1,58 @@
1
+<div class="modal-content">
2
+    <div class="modal-header">
3
+        <button type="button" class="close" ng-click="cancel()">
4
+            &times;
5
+        </button>
6
+        <h4 class="modal-title" id="myModalLabel">接收合同列表</h4>
7
+    </div>
8
+    <div class="modal-body">
9
+        <div>
10
+            <div class="widget-body no-padding">
11
+                <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
12
+                    <div class="dt-toolbar">
13
+                        <div class="col-xs-12 col-sm-6">
14
+                            <div class="dataTables_filter">
15
+                                <label>
16
+                                </label>
17
+                            </div>
18
+                        </div>
19
+                    </div>
20
+    
21
+                    <table class="table table-striped table-bordered table-hover" width="100%">
22
+                        <thead>
23
+                            <tr>
24
+                                <th>合同编号</th>
25
+                                <th>合同类型</th>
26
+                                <th>仓房名称</th>
27
+                                <th>货位名称</th>
28
+                                <th>合同数量(吨)</th>
29
+                                <th>明细品种</th>
30
+                                <th>客户名称</th>
31
+                                <th>操作</th>
32
+                            </tr>
33
+                        </thead>
34
+                        
35
+                        <tbody>
36
+                            <tr ng-repeat="contractReceive in pageInfo.list">
37
+                                <td>{{ contractReceive.htbh }}</td>
38
+                                <td>{{ contractReceive.htlx==0?"采购":"销售" }}</td>
39
+                                <td>{{ storehouseObj[contractReceive.houseId].storehouseName }}</td>
40
+                                <td>{{ wares[contractReceive.warehouseId].warehouseName }}</td>
41
+                                <td>{{ contractReceive.htzsl }}</td>
42
+                                <td>{{ dicData[contractReceive.mxpz] }}</td>
43
+                                <td>{{ contractReceive.khmc }}</td>
44
+                                <td>
45
+                                    <a href-void ng-click="selectContractReceive(contractReceive)"><i class="fa fa-edit"></i>选择</a>
46
+                                </td>
47
+                            </tr>
48
+                        </tbody>
49
+                    </table>
50
+                    <div smart-include="app/layout/partials/page.tpl.html"></div>
51
+                </div>
52
+            </div>
53
+        </div>
54
+    </div>
55
+    <div class="modal-footer">
56
+        <button type="button" class="btn btn-default" ng-click="cancel()"> 取消 </button>
57
+    </div>
58
+</div>

+ 35 - 35
src/main/resources/static/app/business/deliveryStorageNotice/views/receiveNotice-edit.html

@@ -37,7 +37,10 @@
37 37
 											</label>
38 38
 										</section>
39 39
 										<section class="col col-3">
40
-											<label class="label">协议编号/合同编号:</label>
40
+											<label class="label">
41
+											    <span ng-if="businessNoticeReceive.ywtype=='3'">协议编号</span>
42
+											    <span ng-if="businessNoticeReceive.ywtype!='3'">合同编号</span>
43
+											</label>
41 44
 											<label class="input">
42 45
 												<input type="text" ng-model="businessNoticeReceive.contractNumber" name="contractNumber" ng-disabled="isNotEdit">
43 46
 											</label>
@@ -47,7 +50,7 @@
47 50
                               		<section class="col col-3">
48 51
 											<label class="label">业务类型:</label>
49 52
 											<label class="input">
50
-												<input type="text" ng-model="businessNoticeReceive.ywtype" name="ywtype" ng-disabled="isNotEdit">
53
+												<input type="text" ng-model="ywlx" name="ywlx" ng-disabled="isNotEdit">
51 54
 											</label>
52 55
 										</section>
53 56
 										<section class="col col-3">
@@ -95,51 +98,48 @@
95 98
 										<section class="col col-3">
96 99
 											<label class="label">计划数量(吨):</label>
97 100
 											<label class="input">
98
-												<input type="text" ng-model="businessNoticeReceive.count" name="count" ng-disabled="isNotEdit"
99
-													   >
101
+												<input type="text" ng-model="businessNoticeReceive.count" name="count" ng-disabled="isNotEdit" />
100 102
 											</label>
101 103
 										</section>
102 104
                               	</div>
103 105
                               	<div>
104 106
                               		<section class="col col-3">
105
-											<label class="label">出库期限:</label>
107
+										<label class="label">出库期限:</label>
108
+										<label class="input">
109
+											<input type="text" ng-model="businessNoticeReceive.outgoingPeriod" name="outgoingPeriod" ng-readonly="isNotEdit" />
110
+												   
111
+										</label>
112
+									</section>
113
+									<span ng-if="businessNoticeReceive.forwardingUnit != null">
114
+										 <section class="col col-3">
115
+											<label class="label">发/收货单位:</label>
116
+											<label class="input">
117
+												<input type="text" ng-model="businessNoticeReceive.forwardingUnit" name="forwardingUnit" ng-readonly="isNotEdit" />
118
+											</label>
119
+									     </section> 					
120
+									</span>
121
+									<span ng-if="businessNoticeReceive.receiveUnit != null">
122
+										<section class="col col-3">
123
+											<label class="label">发/收货单位:</label>
106 124
 											<label class="input">
107
-												<input type="text" ng-model="businessNoticeReceive.outgoingPeriod" name="outgoingPeriod" ng-disabled="isNotEdit">
108
-													   
125
+												<input type="text" ng-model="businessNoticeReceive.receiveUnit" name="receiveUnit" ng-readonly="isNotEdit" />
109 126
 											</label>
110 127
 										</section>
111
-										<span ng-if="businessNoticeReceive.forwardingUnit != null">
112
-											 <section class="col col-3">
113
-												<label class="label">发/收货单位:</label>
114
-												<label class="input">
115
-													<input type="text" ng-model="businessNoticeReceive.forwardingUnit" name="forwardingUnit" ng-disabled="isNotEdit" >
116
-												</label>
117
-										     </section> 					
118
-										</span>
119
-										<span ng-if="businessNoticeReceive.receiveUnit != null">
120
-											<section class="col col-3">
121
-												<label class="label">发/收货单位:</label>
122
-												<label class="input">
123
-													<input type="text" ng-model="businessNoticeReceive.receiveUnit" name="receiveUnit" ng-disabled="isNotEdit" >
124
-												</label>
125
-											</section>
126
-										</span>
128
+									</span>
127 129
                               	</div>
128
-								<span ng-if="businessNoticeReceive.inApplication=='4' || businessNoticeReceive.inApplication=='3'" >
129
-									<table width="100%">
130
-										<tr>
131
-											<th>
132
-												<label class="label" style="font-size:18px;margin-top:15px"><strong>暂停或终止原因:</strong></label>
133
-												<label class="input">
134
-													<input type="text" ng-model="businessNoticeReceive.resion" name="resion" ng-readonly="isNotEdit">
135
-												</label>
136
-											</th>
137
-										</tr>
138
-									</table>
139
-								</span>
130
+								<div ng-show="businessNoticeReceive.ywtype=='3'">
131
+								    <section class="col col-3">
132
+										<label class="label">合同编号:<span style="color: red;">*</span></label>
133
+										<label class="input">
134
+                                            <input class="form-control" type="text" ng-model="businessNoticeReceive.htbh" ng-disabled="htbhNotEdit" 
135
+                                            name='htbh' ng-click="getReceiveContract(businessNoticeReceive)" placeholder="请选择接收合同" />
136
+										</label>
137
+									</section>
138
+								</div>
140 139
                                 </fieldset>
141 140
                                 <div><!--class="form-actions"-->
142 141
                                     <footer class="text-align-center">
142
+                                        <button type="button" class="btn btn btn-primary" ng-hide="htbhNotEdit" ng-click="save()">保存</button>
143 143
                                         <button type="button" class="btn btn-default" ng-click="retList()">返回</button>
144 144
                                     </footer>
145 145
                                 </div>

+ 7 - 25
src/main/resources/static/app/business/deliveryStorageNotice/views/receiveNotice-list.html

@@ -70,8 +70,8 @@
70 70
 		                            <th> 粮油品种</th>
71 71
 		                            <th> 等级</th>
72 72
 		                            <th> 计划数量(吨)</th>
73
-		                            <!-- <th> 状态</th> -->
74 73
 		                            <th> 接收日期</th>
74
+		                            <th> 合同编号</th>
75 75
 		                            <th> 操作</th>
76 76
 		                        </tr>
77 77
 	                        </thead>
@@ -90,9 +90,9 @@
90 90
 	                                
91 91
 	                                <td>
92 92
 	                                	<div ng-switch="{{receiveNotice.ywtype}}"><!-- 1竞买2 销售 3轮换 -->
93
-		                                    <div ng-switch-when="1">竞</div>
94
-		                                    <div ng-switch-when="2">销售</div>
95
-		                                    <div ng-switch-when="3">轮换</div>
93
+		                                    <div ng-switch-when="1">竞</div>
94
+		                                    <div ng-switch-when="2">竞价</div>
95
+		                                    <div ng-switch-when="3">包干</div>
96 96
 	                                    </div>
97 97
 	                                </td>
98 98
 	                                <td>{{storehouseObj[receiveNotice.houseId].storehouseName}}</td>
@@ -103,29 +103,11 @@
103 103
 	                                <td>{{dicData[receiveNotice.grainKind]}}</td>
104 104
 	                                <td>{{dicData[receiveNotice.grainGrade]}}</td>
105 105
 	                                <td>{{receiveNotice.count}}</td>
106
-	                                <!-- <td>
107
-	                                	<div ng-switch="{{receiveNotice.inApplication}}">
108
-		                                    <div ng-switch-when="1">启用</div>
109
-		                                    <div ng-switch-when="2"><span style='color:#EE9A49;'>暂停</span></div>
110
-		                                    <div ng-switch-when="3"><span style='color:red;'>终止</span></div>
111
-	                                    </div>
112
-	                                </td> -->
113 106
 	                                <td>{{receiveNotice.receiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
114
-	                                <!-- <td>
115
-	                                	<div ng-switch="{{receiveNotice.inApplication}}">
116
-	                                		<a href-void ng-click="showView(receiveNotice.id)"><i class="fa fa-info-circle"></i>查看</a>
117
-		                                     <div ng-switch-when="1">1:启用 2暂停 3终止
118
-		                                    	<a has-permission="" href-void ng-click="discontinue(receiveNotice.id)"><i class="fa fa-pause"></i>暂停</a>&emsp;
119
-		                                    	<a has-permission="" href-void ng-click="finish(receiveNotice.id)"><i class="fa fa-times"></i>终止</a>
120
-		                                    </div>
121
-		                                    <div ng-switch-when="2">
122
-		                                    	<a has-permission="" href-void ng-click="application(receiveNotice.id)"><i class="fa fa-play"></i>启用</a>&emsp;
123
-		                                    	<a has-permission="" href-void ng-click="finish(receiveNotice.id)"><i class="fa fa-times"></i>终止</a>
124
-		                                    </div> 
125
-	                                    </div>
126
-	                                </td> -->
107
+	                                <td>{{receiveNotice.htbh}}</td>
127 108
 	                                <td>
128
-	                                	<a href-void ng-click="showView(receiveNotice.id)"><i class="fa fa-info-circle"></i>查看</a>
109
+	                                	<a href-void ng-click="edit(receiveNotice.id, 'show')"><i class="fa fa-info-circle"></i>查看</a>
110
+	                                	<a ng-show="receiveNotice.ywtype==3" href-void ng-click="edit(receiveNotice.id, 'glht')"><i class="fa fa-info-circle"></i>关联合同</a>
129 111
 	                                </td>
130 112
 	                            </tr>
131 113
 	                        </tbody>

+ 2 - 2
src/main/resources/static/app/business/module.js

@@ -3447,9 +3447,9 @@ angular.module('app.business')
3447 3447
         })
3448 3448
         
3449 3449
         .state('app.business.grainReservesManage-receiveNotice-view', {
3450
-            url: '/business/grainReservesManage-receiveNotice-view/:id',
3450
+            url: '/business/grainReservesManage-receiveNotice-view/:id/:btnType',
3451 3451
             data: {
3452
-                title: '接收通知单查看'
3452
+                title: '接收通知单详情'
3453 3453
             },
3454 3454
             params:{
3455 3455
                     isNotEdit : true

+ 1 - 1
src/main/resources/static/app/layout/partials/navigation.tpl.html

@@ -139,7 +139,7 @@
139 139
                             <i class="fa fa-fw fa-folder-open"></i>储备粮管理
140 140
                         </a>
141 141
                         <ul>
142
-                            <li has-func="272" data-ui-sref-active="active">
142
+                            <li has-func="478" data-ui-sref-active="active">
143 143
                                 <a data-ui-sref="app.business.grainReservesManage-contractReceiveList">接收合同</a>
144 144
                             </li>
145 145
                             <li has-func="273" data-ui-sref-active="active">

+ 1 - 1
src/main/resources/static/app/storage/grainCard/views/grainCarAdd.html

@@ -19,7 +19,7 @@
19 19
                                     <a href-void class="btn btn-default btn-xs" ng-click="retList()">
20 20
                                         <i class="fa fa-angle-left"></i>&nbsp;返回&nbsp;
21 21
                                     </a>
22
-                                    &nbsp;<strong>原粮粮情卡编辑</strong>
22
+                                    &nbsp;<strong>原粮粮情卡编辑</strong>
23 23
                                     <span class="pull-right font-xs" style="color: red;">注意:建卡前请先做自检业务!</span>
24 24
                                 </header>
25 25
                                 <fieldset>