Przeglądaj źródła

出库结算管理

hanqingsong 1 rok temu
rodzic
commit
7f897406b8

+ 3 - 2
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, htlx){
5
+	this.getPageInfo = function(pageNum, pageSize, htbh, houseId, warehouseId, htlx, surplus){
6 6
 		var d = $q.defer();
7 7
 		$http({
8 8
 			method : 'GET',
@@ -14,7 +14,8 @@ angular.module('app.business').service("contractReceiveService", function($http,
14 14
                 houseId: houseId,
15 15
                 warehouseId: warehouseId,
16 16
                 htlx: htlx,
17
-                orgId: $rootScope.userInfo.orgId
17
+                orgId: $rootScope.userInfo.orgId,
18
+                surplus: surplus
18 19
 			}
19 20
 		}).then(function successCallback(response) {
20 21
 			// 请求成功执行代码

+ 2 - 1
src/main/resources/static/app/business/deliveryStorageNotice/controller/receiveContractListModalCtrl.js

@@ -10,7 +10,8 @@ angular.module('app.business').controller("receiveContractListModalCtrl",
10 10
     			null,
11 11
     			items.houseId,
12 12
     			items.warehouseId,
13
-    			items.htlx).then(function (data) {
13
+    			items.htlx,
14
+                items.surplus).then(function (data) {
14 15
             $scope.pageInfo = data;
15 16
         }, function (data) {
16 17
             console.log(data);

+ 61 - 1
src/main/resources/static/app/business/jsgl/controller/jsglCtrl.js

@@ -73,9 +73,14 @@ angular.module('app.business')
73 73
     $scope.jslx = $stateParams.jslx;
74 74
     if ($scope.jslx == "0") {
75 75
     	$scope.top_title = "入库结算详情";
76
+        $scope.sectionHide = true;
76 77
     	
77 78
     } else if ($scope.jslx == "1") {
78 79
     	$scope.top_title = "出库结算详情";
80
+    	$scope.sectionHide = false;
81
+        // 非必填
82
+        $('#remarks').attr("required", "true");
83
+        $scope.isNotHide = true;
79 84
     }
80 85
     var isNotEdit = false;//大多数文本框
81 86
     var isEdit = false;//少数要控制的文本框
@@ -87,6 +92,7 @@ angular.module('app.business')
87 92
 			$scope.jsgl = data;
88 93
 			$scope.jsgl.orgId = $rootScope.orgInfo.orgId;
89 94
 			$scope.loadWare($scope.jsgl.houseId);
95
+            $scope.remarksChange();
90 96
 	    },function(data){
91 97
 	        console.log(data);
92 98
 	    });
@@ -124,8 +130,11 @@ angular.module('app.business')
124 130
 		var params = [];
125 131
 		if ($scope.jslx == "0") {//入库
126 132
 			params.htlx = "0";
133
+			// 非字段条件-业务特殊需求(剩余数量为“0”的合同不展示在列表中)
134
+			params.surplus = "0";
127 135
 		} else if ($scope.jslx == "1") {//出库
128 136
 			params.htlx = "1";
137
+            params.surplus = "1";
129 138
 		} else {
130 139
 			alert("系统异常,请联系管理员!");
131 140
 			return;
@@ -193,6 +202,43 @@ angular.module('app.business')
193 202
 	 * 计算本次结算金额 = 本次结算数量 * 本次结算单价
194 203
 	 * 保留两位小数
195 204
 	 */
205
+    //将v四舍五入,且保留n位小数
206
+    $scope.getMath_N = function(v, n) {
207
+        if (isNaN(v) || v == "") {
208
+            if (isNaN(n) || v == "") {
209
+                v = "0.00";
210
+            } else if (n == 0) {
211
+                v = "0";
212
+            } else {
213
+                v = "";
214
+                for (var i = 1; i <= n; i++) {
215
+                    if (i == 1) {
216
+                        v = "0.0";
217
+                    } else {
218
+                        v = v+"0";
219
+                    }
220
+                }
221
+            }
222
+        } else {
223
+            v = Math.round(v*100)/100;
224
+            v = v.toString();
225
+            var rs = v.indexOf('.');
226
+            if (rs < 0) {
227
+                if (n > 0) {
228
+                    for (var i = 1; i <= n; i++) {
229
+                        if (i == 1) {
230
+                            v = v+".0";
231
+                        } else {
232
+                            v = v+"0";
233
+                        }
234
+                    }
235
+                }
236
+            }else{
237
+                while(v.length <= rs + n){v += '0';}
238
+            }
239
+        }
240
+        return v;
241
+    };
196 242
 	$scope.calculate = function() {
197 243
 		var bcjssl = $scope.jsgl.bcjssl;
198 244
 		var bcjsdj = $scope.jsgl.bcjsdj;
@@ -217,7 +263,21 @@ angular.module('app.business')
217 263
 		 */
218 264
 		var bcjsje = $scope.jsgl.bcjssl * 1000 * $scope.jsgl.bcjsdj * 1000 / 1000000;
219 265
 		$scope.jsgl.bcjsje = $scope.getMath_N(bcjsje, 2);
220
-	}
266
+	};
267
+
268
+    // 备注必填效验
269
+    $scope.remarksChange = function() {
270
+        // 本次结算单价,本次结算金额
271
+		if ($scope.jsgl.bcjsdj==='0' || $scope.jsgl.bcjsje==='0' || $scope.jsgl.bcjsje==='0.00') {
272
+			// 备注必填
273
+			$('#remarks').attr("required", "false");
274
+            $scope.isNotHide = false;
275
+		} else {
276
+            // 非必填
277
+            $('#remarks').attr("required", "true");
278
+            $scope.isNotHide = true;
279
+		}
280
+    };
221 281
 
222 282
 	// 返回.
223 283
     $scope.retList = function () {

+ 9 - 3
src/main/resources/static/app/business/jsgl/views/jsgl-edit.html

@@ -102,16 +102,15 @@
102 102
                                         <section class="col col-4">
103 103
                                             <label class="label">本次结算单价(元/吨)<span style="color: red;">*</span></label>
104 104
                                             <label class="input"> 
105
-                                            	<input class="form-control" type="text" ng-model="jsgl.bcjsdj" ng-readonly="isNotEdit" ng-blur="calculate()"
105
+                                            	<input class="form-control" type="text" ng-model="jsgl.bcjsdj" ng-readonly="isNotEdit" ng-blur="calculate()" ng-change="remarksChange()"
106 106
                                                 name="bcjsdj" placeholder="" onkeyup="this.value=this.value.match(/\d+(\.\d{0,3})?/) ? this.value.match(/\d+(\.\d{0,3})?/)[0] : '' " required />
107 107
                                             </label>
108
-                                         	</label>
109 108
                                         </section>
110 109
                                         <section class="col col-4">
111 110
                                             <label class="label">本次结算金额(元)<span style="color: red;">*</span></label> 
112 111
                                             <label class="input"> 
113 112
                                                 <input class="form-control" type="text" ng-model="jsgl.bcjsje" ng-readonly="isNotEdit"
114
-                                                name="bcjsje" placeholder="" required />
113
+                                                name="bcjsje" placeholder="" ng-change="remarksChange()" required />
115 114
                                             </label>
116 115
                                         </section>
117 116
                                     	<section class="col col-4">
@@ -133,6 +132,13 @@
133 132
                                              	</select>
134 133
                                          	</label>
135 134
                                         </section>
135
+                                        <section class="col col-8" ng-hide="sectionHide">
136
+                                            <label class="label">备注<span ng-hide="isNotHide" style="color: red;">*</span></label>
137
+                                            <label class="input">
138
+                                                <input id="remarks" class="form-control" type="text" ng-model="jsgl.remarks" ng-readonly="isNotEdit"
139
+                                                       name="remarks" placeholder="备注"/>
140
+                                            </label>
141
+                                        </section>
136 142
                                     </div>
137 143
                                 </fieldset>
138 144
                                 <header><strong>发票信息</strong></header>