fanxw 2 lat temu
rodzic
commit
95627ff572

+ 165 - 16
src/main/resources/static/app/business/jsgl/controller/jsglCtrl.js

@@ -39,7 +39,10 @@ angular.module('app.business')
39 39
         $scope.loadData();
40 40
     }
41 41
 
42
-	//新增、查看、修改
42
+	/**
43
+	 * 新增、查看、修改
44
+	 * jslx: 0是入库,1是出库
45
+	 */
43 46
     $scope.edit = function(id, butType) {
44 47
     	$state.go('app.business.rkjslist.edit',{id:id, butType:butType, jslx: $stateParams.jslx});
45 48
     }
@@ -57,12 +60,13 @@ angular.module('app.business')
57 60
     }
58 61
 
59 62
 })
60
-.controller("jsglEditCtrl", function($scope, $http, $filter, $state, $rootScope, $stateParams, APP_CONFIG, jsglService, warehouseService) {
63
+.controller("jsglEditCtrl", function($scope, $http, $filter, $state, $rootScope, $stateParams, $uibModal, APP_CONFIG, jsglService, warehouseService, customerService ) {
61 64
     var id = $stateParams.id;
62 65
     var butType = $stateParams.butType;
63 66
     $scope.jslx = $stateParams.jslx;
64 67
     if ($scope.jslx == "0") {
65 68
     	$scope.top_title = "入库结算详情";
69
+    	
66 70
     } else if ($scope.jslx == "1") {
67 71
     	$scope.top_title = "出库结算详情";
68 72
     }
@@ -102,6 +106,147 @@ angular.module('app.business')
102 106
     } else {
103 107
     	$scope.jsgl.bcjssj = $filter('date')(new Date(), "yyyy-MM-dd HH:mm:ss");
104 108
     	$scope.jsgl.fkdw = $rootScope.orgInfo.orgName;
109
+    	$scope.jsgl.orgId = $rootScope.orgInfo.orgId;
110
+    	$scope.jsgl.jslx = $scope.jslx;
111
+    	$scope.jsgl.fpzt = "1"; //发票状态默认1正常
112
+    	$scope.jsgl.bcjsfs = "1"; //付款方式默认1转账
113
+    }
114
+	
115
+	$scope.getReceiveContract = function() {
116
+		var params = [];
117
+		if ($scope.jslx == "0") {//入库
118
+			params.htlx = "0";
119
+		} else if ($scope.jslx == "1") {//出库
120
+			params.htlx = "1";
121
+		} else {
122
+			alert("系统异常,请联系管理员!");
123
+			return;
124
+		}
125
+        var uibModalInstance = $uibModal.open({
126
+            size:'lg',
127
+            templateUrl: 'app/business/deliveryStorageNotice/views/receiveContract-list-modal.html',
128
+            controller: 'receiveContractListModalCtrl',
129
+            resolve: {
130
+                // items是一个回调函数
131
+                items: function () {
132
+                    // 这个值会被模态框的控制器获取到
133
+                    return params;
134
+                }
135
+            }
136
+        });
137
+        uibModalInstance.result.then(function (result) {
138
+            if (result != null) {
139
+                // 获取明细信息.
140
+            	$scope.jsgl.htid = result.id;
141
+           	    $scope.jsgl.htbh = result.htbh;
142
+           	    $scope.jsgl.htzsl = result.htzsl;
143
+           	    $scope.jsgl.yjssl = result.yjssl;
144
+           	    $scope.jsgl.houseId = result.houseId;
145
+           	    $scope.jsgl.warehouseId = result.warehouseId;
146
+           	    if (result.warehouseId != null) {
147
+           	    	$scope.loadWare(result.houseId);
148
+           	    }
149
+           	    $scope.jsgl.lypz = result.lypz;
150
+           	    $scope.jsgl.mxpz = result.mxpz;
151
+           	    $scope.jsgl.lyxz = result.lyxz;
152
+           	    $scope.jsgl.bcjsdj = result.htdj;
153
+           	    $scope.getCustomer(result.khid);
154
+            }
155
+        }, function (reason) {
156
+            console.log(reason);
157
+        });
158
+	}
159
+
160
+	/**
161
+	 * 获取客户信息
162
+	 * @param khid 客户ID
163
+	 */
164
+	$scope.getCustomer = function(khid) {
165
+		customerService.loadDataById(khid).then(function(data){
166
+			$scope.jsgl.customerId = data.id;
167
+			// 收付款人赋值客户姓名.
168
+            $scope.jsgl.sfkr = data.name;
169
+            //开户行名称
170
+            $scope.jsgl.khhmc = data.bankName;
171
+            //开户行号
172
+            $scope.jsgl.khhh = data.khhh;
173
+            //银行账号
174
+            $scope.jsgl.yhzh = data.accountNumber;
175
+            //收付款人身份证号赋值社会信用代码
176
+            $scope.jsgl.skrsfzh = data.socialCreditCode;
177
+            //付款单位
178
+            $scope.jsgl.fkdw = $rootScope.orgInfo.orgName;
179
+    	}, function (data) {
180
+			console.log(data);
181
+		});
182
+	}
183
+
184
+	/**
185
+	 * 计算本次结算金额 = 本次结算数量 * 本次结算单价
186
+	 * 保留两位小数
187
+	 */
188
+	$scope.calculate = function() {
189
+		var bcjssl = $scope.jsgl.bcjssl;
190
+		var bcjsdj = $scope.jsgl.bcjsdj;
191
+		var re = /^([0-9]+.[0-9]{3})[0-9]*/;
192
+		if(bcjssl !== undefined && bcjssl !== "" && bcjssl != null) {
193
+			bcjssl = bcjssl.toString().replace(re,"$1");
194
+			bcjssl = parseFloat(bcjssl);
195
+			$scope.jsgl.bcjssl = bcjssl;
196
+		} else {
197
+			return;
198
+		}
199
+		if(bcjsdj !== undefined && bcjsdj !== "" && bcjsdj != null) {
200
+			bcjsdj = bcjsdj.toString().replace(re,"$1");
201
+			bcjsdj = parseFloat(bcjsdj);
202
+			$scope.jsgl.bcjsdj = bcjsdj;
203
+		} else {
204
+			return;
205
+		}
206
+
207
+		/**
208
+		 * 
209
+		 */
210
+		var bcjsje = $scope.jsgl.bcjssl * 1000 * $scope.jsgl.bcjsdj * 1000 / 1000000;
211
+		$scope.jsgl.bcjsje = $scope.getMath(bcjsje, 2);
212
+	}
213
+
214
+	//将v四舍五入,且保留n位小数
215
+    $scope.getMath = function(v, n) {
216
+        if (isNaN(v) || v == "") {
217
+        	if (isNaN(n) || v == "") {
218
+        		v = "0.00";
219
+        	} else if (n == 0) {
220
+        		v = "0";
221
+        	} else {
222
+        		v = "";
223
+        		for (var i = 1; i <= n; i++) {
224
+            		if (i == 1) {
225
+            			v = "0.0";
226
+            		} else {
227
+            			v = v+"0";
228
+            		}
229
+            	}
230
+        	}
231
+        } else {
232
+            v = Math.round(v*100)/100;
233
+            v = v.toString();
234
+            var rs = v.indexOf('.');
235
+            if (rs < 0) {
236
+            	if (n > 0) {
237
+            		for (var i = 1; i <= n; i++) {
238
+            			if (i == 1) {
239
+                			v = v+".0";
240
+                		} else {
241
+                			v = v+"0";
242
+                		}
243
+            		}
244
+            	}
245
+            }else{
246
+                while(v.length <= rs + n){v += '0';}
247
+            }
248
+        }
249
+        return v;
105 250
     }
106 251
 	
107 252
 	// 返回.
@@ -117,22 +262,26 @@ angular.module('app.business')
117 262
         }
118 263
     }
119 264
 
265
+    var validator = $("#jsgl-form").validate();
266
+
120 267
     //保存(0:保存,1:提交)
121 268
     $scope.save = function(czlx) {
122 269
     	$scope.jsgl.dataStatus = czlx;
123
-    	jsglService.saveData($scope.jsgl).then(function(data){
124
-			if (data.status == "200") {
125
-				alert("操作成功!");
126
-			} else {
127
-				alert("操作失败!");
128
-			}
129
-			if ($scope.jslx=="0") {
130
-        		$state.go('app.business.rkjslist');
131
-        	} else if ($scope.jslx=="1") {
132
-        		$state.go('app.business.ckjslist');
133
-        	}
134
-	    },function(data){
135
-	        console.log(data);
136
-	    });
270
+    	if (validator.form()) {
271
+    		jsglService.saveData($scope.jsgl).then(function(data){
272
+    			if (data.status == "200") {
273
+    				alert("操作成功!");
274
+    			} else {
275
+    				alert("操作失败!");
276
+    			}
277
+    			if ($scope.jslx=="0") {
278
+            		$state.go('app.business.rkjslist');
279
+            	} else if ($scope.jslx=="1") {
280
+            		$state.go('app.business.ckjslist');
281
+            	}
282
+    	    },function(data){
283
+    	        console.log(data);
284
+    	    });
285
+    	}
137 286
     }
138 287
 })

+ 22 - 24
src/main/resources/static/app/business/jsgl/view/jsgl-edit.html

@@ -7,7 +7,7 @@
7 7
                     data-widget-custombutton="false">
8 8
                     <div>
9 9
                         <div class="widget-body no-padding">
10
-                            <form id="rksj-form" class="smart-form ng-pristine ng-valid" data-validator-option="validateOptions" novalidate="novalidate">
10
+                            <form id="jsgl-form" class="smart-form ng-pristine ng-valid" data-validator-option="validateOptions" novalidate="novalidate">
11 11
                                 <header>
12 12
 									<a href-void class="btn btn-default btn-xs" ng-click="retList()">
13 13
 										<i class="fa fa-angle-left"></i>&nbsp;返回&nbsp;
@@ -21,22 +21,21 @@
21 21
                                     <div class="row">
22 22
                                         <section class="col col-4">
23 23
                                             <label class="label">合同信息<span style="color: red;">*</span></label>
24
-                                            <label class="select"> 
25
-                                            	<select ng-model="jsgl.htid" ng-disabled="isEdit" name="htid"
26
-                                             	ng-options="enum.enumid as enum.enumname for enum in dicDataList[5498]" required >
27
-                                             		<option value="">--请选择合同--</option><i></i>
28
-                                             	</select><i></i>
24
+                                            <label class="input">
25
+                                                <input class="form-control" type="hidden" ng-model="jsgl.htid" name="htid" />
26
+                                             	<input class="form-control" type="text" ng-model="jsgl.htbh" name="htbh" ng-disabled="isEdit" 
27
+                                                ng-click="getReceiveContract()" placeholder="请选择接收合同" />
29 28
                                          	</label>
30 29
                                         </section>
31 30
                                         <section class="col col-4">
32
-                                            <label class="label">合同总数量(公斤)</label> 
31
+                                            <label class="label">合同总数量()</label> 
33 32
                                             <label class="input"> 
34 33
                                                 <input class="form-control" type="number" ng-model="jsgl.htzsl" ng-readonly="true"
35 34
                                                 name="htzsl" placeholder="" />
36 35
                                             </label>
37 36
                                         </section>
38 37
                                     	<section class="col col-4">
39
-                                            <label class="label">已结算数量(公斤)</label> 
38
+                                            <label class="label">已结算数量(吨)<span style="color: red;">不含本次</span></label> 
40 39
                                             <label class="input"> 
41 40
                                                 <input class="form-control" type="number" ng-model="jsgl.yjssl" ng-readonly="true"
42 41
                                                 name="yjssl" placeholder="" />
@@ -56,8 +55,8 @@
56 55
 										<section class="col col-4">
57 56
                                             <label class="label">货位名称<span style="color: red;">*</span></label>
58 57
                                             <label class="select"> 
59
-                                            	<select ng-model="jsgl.warehouseId" ng-disabled="true" name="warehouseId" 
60
-                                             	ng-options="ware.warehouseId as ware.warehouseName for ware in warehouseList" required >
58
+                                            	<select ng-model="jsgl.warehouseId" ng-disabled="true" name="warehouseId"
59
+                                             	ng-options="ware.warehouseId as ware.warehouseName for ware in warehouseList" required>
61 60
                                              		<option value="">--请选择--</option><i></i>
62 61
                                              	</select><i></i>
63 62
                                          	</label>
@@ -92,33 +91,33 @@
92 91
 											</label>
93 92
                                         </section>
94 93
                                         <section class="col col-4">
95
-                                            <label class="label">本次结算数量(公斤)<span style="color: red;">*</span></label>
94
+                                            <label class="label">本次结算数量()<span style="color: red;">*</span></label>
96 95
                                             <label class="input"> 
97
-                                                <input class="form-control" type="number" ng-model="jsgl.bcjssl" ng-readonly="isNotEdit"
98
-                                                name="yjssl" placeholder="" required />
96
+                                                <input class="form-control" type="text" ng-model="jsgl.bcjssl" ng-readonly="isNotEdit" ng-blur="calculate()"
97
+                                                name="yjssl" placeholder="" onkeyup="this.value=this.value.match(/\d+(\.\d{0,3})?/) ? this.value.match(/\d+(\.\d{0,3})?/)[0] : '' " required />
99 98
                                             </label>
100 99
                                         </section>
101 100
                                     </div>
102 101
                                     <div class="row">
103 102
                                         <section class="col col-4">
104
-                                            <label class="label">本次结算单价(元/公斤)<span style="color: red;">*</span></label>
103
+                                            <label class="label">本次结算单价(元/)<span style="color: red;">*</span></label>
105 104
                                             <label class="input"> 
106
-                                            	<input class="form-control" type="number" ng-model="jsgl.bcjsdj" ng-readonly="isNotEdit"
107
-                                                name="bcjsdj" placeholder="" required />
105
+                                            	<input class="form-control" type="text" ng-model="jsgl.bcjsdj" ng-readonly="isNotEdit" ng-blur="calculate()"
106
+                                                name="bcjsdj" placeholder="" onkeyup="this.value=this.value.match(/\d+(\.\d{0,3})?/) ? this.value.match(/\d+(\.\d{0,3})?/)[0] : '' " required />
108 107
                                             </label>
109 108
                                          	</label>
110 109
                                         </section>
111 110
                                         <section class="col col-4">
112 111
                                             <label class="label">本次结算金额(元)<span style="color: red;">*</span></label> 
113 112
                                             <label class="input"> 
114
-                                                <input class="form-control" type="number" ng-model="jsgl.bcjsje" ng-readonly="isNotEdit"
113
+                                                <input class="form-control" type="text" ng-model="jsgl.bcjsje" ng-readonly="isNotEdit"
115 114
                                                 name="bcjsje" placeholder="" required />
116 115
                                             </label>
117 116
                                         </section>
118 117
                                     	<section class="col col-4">
119 118
                                             <label class="label">本次结算时间<span style="color: red;">*</span></label> 
120 119
                                             <label class="input"> 
121
-                                                <input type="text" ng-model="jsgl.bcjssj" ng-readonly="isNotEdit" required
120
+                                                <input type="text" ng-model="jsgl.bcjssj" ng-disabled="isNotEdit" required
122 121
                                                 name="yjssl" placeholder="" onClick="WdatePicker({lang:'zh-cn', dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
123 122
                                             </label>
124 123
                                         </section>
@@ -163,7 +162,7 @@
163 162
                                         <label class="label">发票号码填写</label>
164 163
                                         <label class="textarea textarea-resizable"> 
165 164
                                           <textarea
166
-                                            rows="5" ng-model="drugInfo.cctj" name="cctj" ng-disabled="issyz" class="custom-scroll"
165
+                                            rows="5" ng-model="jsgl.fps" name="fps" ng-disabled="isNotEdit" class="custom-scroll"
167 166
                                             oninput="if(value.length>255) value=value.slice(0,255)" placeholder="多个发票号码填写,请用英文近号进行间隔。例如:1234567890,123456788,最大255个字符">
168 167
                                           </textarea>
169 168
                                         </label>
@@ -173,19 +172,18 @@
173 172
                                         <label class="label">发票状态</label>
174 173
                                         <label class="select"> 
175 174
                                         	<select ng-model="jsgl.fpzt" ng-disabled="isNotEdit" name="fpzt">
176
-                                         		<option value="">--请选择--</option>
177
-                                         		<option value="0">作废</option>
178 175
                                          		<option value="1">正常</option>
176
+                                         		<option value="0">作废</option>
179 177
                                          	</select>
180 178
                                      	</label>
181 179
                                     </section>
182 180
                                     </div>
183 181
                                 </fieldset>
184
-                                <header><strong>收付款信息</strong></header>
182
+                                <header><strong>收/付款信息</strong></header>
185 183
                                 <fieldset>
186 184
                                     <div class="row">
187 185
                                         <section class="col col-4">
188
-                                            <label class="label">收付款人<span style="color: red;">*</span></label>
186
+                                            <label class="label">收/付款人<span style="color: red;">*</span></label>
189 187
                                             <label class="input"> 
190 188
                                                 <input class="form-control" type="text" ng-model="jsgl.sfkr" ng-readonly="true"
191 189
                                                 name="sfkr" placeholder="" required />
@@ -194,7 +192,7 @@
194 192
                                         <section class="col col-4">
195 193
                                             <label class="label">开户行名称<span style="color: red;">*</span></label>
196 194
                                             <label class="input"> 
197
-                                                <input class="form-control" type="text" ng-model="jsgl.khhmc" ng-readonly="true"
195
+                                                <input class="form-control" type="text" ng-model="dicData[jsgl.khhmc]" ng-readonly="true"
198 196
                                                 name="khhmc" placeholder="" required />
199 197
                                             </label>
200 198
                                         </section>

+ 4 - 4
src/main/resources/static/app/business/jsgl/view/jsgl-list.html

@@ -16,12 +16,12 @@
16 16
 							<div class="dt-toolbar">
17 17
 								<div class="col-xs-12 col-sm-9">
18 18
 									<div class="form-group">
19
-										<a has-permission="707" class="btn btn-primary btn-sm" ng-click="edit()">
19
+										<a class="btn btn-primary btn-sm" ng-click="edit()">
20 20
 											<span class="fa fa-plus"></span>&nbsp;新&nbsp;增
21 21
 										</a>&emsp;
22 22
 										<label>
23 23
 											<select ng-model="search.houseId" class="form-control input-sm" 
24
-												ng-options="store.storehouseId as store.storehouseName for store in storelist" 
24
+												ng-options="store.storehouseId as store.storehouseName for store in store_tank_list" 
25 25
 												ng-change="loadWare(search.houseId)">
26 26
 												<option value="">--仓房名称--</option>
27 27
 											</select>&emsp;
@@ -77,8 +77,8 @@
77 77
 								<td>{{data.bcjssj}}</td>
78 78
 								<td>
79 79
 									<a href-void ng-click="edit(data.id, 'show')"><i class="fa fa-info-circle"></i>查看</a>&nbsp;&nbsp;
80
-                        			<a has-permission="517" href-void ng-click="edit(data.id, 'update')"><i class="fa fa-edit"></i>修改</a>&nbsp;&nbsp;
81
-                        			<a has-permission="518" href-void ng-click="remove(data.id)"><i class="fa fa-trash-o"></i>删除</a>
80
+                        			<a href-void ng-click="edit(data.id, 'update')" ng-hide="data.dataStatus=='1'"><i class="fa fa-edit"></i>修改</a>&nbsp;&nbsp;
81
+                        			<a href-void ng-click="remove(data.id)" ng-hide="data.dataStatus=='1'"><i class="fa fa-trash-o"></i>删除</a>
82 82
                         		</td>
83 83
                         	</tr>
84 84
                         </tbody>

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

@@ -322,14 +322,14 @@
322 322
                         </ul>
323 323
                     </li>
324 324
                     <li data-menu-collapse>
325
-                        <a has-func="0" href="#">
325
+                        <a has-func="479" href="#">
326 326
                             <i class="fa fa-lg fa-fw fa-folder-open"></i>结算管理
327 327
                         </a>
328 328
                         <ul>
329
-                            <li has-func="263" data-ui-sref-active="active">
329
+                            <li has-func="480" data-ui-sref-active="active">
330 330
                                 <a data-ui-sref="app.business.rkjslist">入库结算管理</a>
331 331
                             </li>
332
-                            <li has-func="263" data-ui-sref-active="active">
332
+                            <li has-func="481" data-ui-sref-active="active">
333 333
                                 <a data-ui-sref="app.business.ckjslist">出库结算管理</a>
334 334
                             </li>
335 335
                         </ul>

+ 0 - 2
src/main/resources/static/app/storage/controller/qualitycheckCtrl.js

@@ -843,7 +843,6 @@ angular.module('app.storage')
843 843
          * v:原数据值
844 844
          * n:要保留的小数位数
845 845
          */
846
-        
847 846
         $scope.checkJqos = function(v, n) {
848 847
         	if (!isNaN(v) && v != "") {
849 848
         	    var pos = v.toString().indexOf(".");
@@ -897,7 +896,6 @@ angular.module('app.storage')
897 896
         	return v;
898 897
         }
899 898
 
900
-       
901 899
         // 计算总量
902 900
         $scope.zjzl = function() {
903 901
 

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

@@ -572,7 +572,7 @@
572 572
                                             <tr ng-repeat="quailckCard in quailckCardListView">
573 573
                                                 <td class="text-center" colspan="3" height="50px" style="vertical-align: middle;text-align: center;">
574 574
                                                     <span ng-if="quailckCard.typeUpdate=='0'">粮食初检</span>
575
-                                                    <span ng-if="quailckCard.typeUpdate=='4'">日常检查</span>
575
+                                                    <span ng-if="quailckCard.typeUpdate=='4'">春秋普查</span>
576 576
                                                     <span ng-if="quailckCard.typeUpdate=='2' ">强检</span>
577 577
                                                     <span ng-if="quailckCard.typeUpdate=='1' ">第三方检验</span>
578 578
                                                     <span ng-if="quailckCard.typeUpdate=='3' ">出库检验</span>