Commit 308a8089c9b5c966a7e9f21d8d499a6a42bbf438
1 parent
1ffc6b4d
文件上传
Showing
7 changed files
with
4158 additions
and
359 deletions
commons/api/entranceFeeBillList.py
@@ -95,86 +95,86 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): | @@ -95,86 +95,86 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): | ||
95 | """缴费金额获取 | 95 | """缴费金额获取 |
96 | :params kwargs: | 96 | :params kwargs: |
97 | protocolId: | 97 | protocolId: |
98 | -pwd: | ||
99 | -clientRedirectTag: | ||
100 | -viewType:pay | ||
101 | -optType:${optType} | ||
102 | -optUrl: | ||
103 | -correctInfo:${correctInfo} | ||
104 | -weightType:${weightType} | ||
105 | -id:${orderId} | ||
106 | -goodsId:${goodsId} | ||
107 | -number:${number} | ||
108 | -modified:${__time(yyyy-MM-dd HH:mm:ss,)} | ||
109 | -status:${status} | ||
110 | -source:${source} | ||
111 | -updateFeeItems: | ||
112 | -correctDiscount:${correctDiscount} | ||
113 | -totalAmount: | ||
114 | -customerId:0 | ||
115 | -fundAccount: | ||
116 | -ic: | ||
117 | -customerName: | ||
118 | -customerPhone: | ||
119 | -payway:刷卡 | ||
120 | -plate:${plate} | ||
121 | -autocomplete-cartype:${carTypeCode}(${carTypeName}) | ||
122 | -carTypeName:${carTypeName} | ||
123 | -carTypeCode:${carTypeCode} | ||
124 | -carTypeId:${carTypeId} | ||
125 | -carTypeWeight:${carTypeWeight} | ||
126 | -storeTareWeight: | ||
127 | -proveType:${proveTypeCode} | ||
128 | -grossWeight:${grossWeight} | ||
129 | -tareWeight:${tareWeight} | ||
130 | -weight:${grossWeight} | ||
131 | -goodsNum: | ||
132 | -itemWeight: | ||
133 | -productPrice:1 | ||
134 | -unitPrice:${unitPrice} | ||
135 | -depName:${feeDepName} | ||
136 | -calcDepId:${feeDepId} | ||
137 | -regionName: | ||
138 | -regionId:0 | ||
139 | -productName:${productName} | ||
140 | -productId:${productId} | ||
141 | -productArea:万州区 | ||
142 | -parentId: | ||
143 | -levelType: | ||
144 | -originId:${originId} | ||
145 | -tradeTypeId:${tradeTypeId} | ||
146 | -chargeTotalAmount: | ||
147 | -chargeTotalAmountYuan: | ||
148 | -freezeMoneySymbol: | ||
149 | -comparisonFreezeAmount: | ||
150 | -created:${created} | ||
151 | -remark: | ||
152 | -goodsTagIds:${goodsTagIds} | ||
153 | -shareRatio:${shareRatio} | ||
154 | -handlingTeam: | ||
155 | -handlingRatio: | ||
156 | -handActualAmount: | ||
157 | -handManageAmount: | ||
158 | -handCollectionAmount: | ||
159 | -receivableAmount: | ||
160 | -categoryName:${productName} | ||
161 | -categoryId:${productId} | ||
162 | -driverTel: | ||
163 | -grossWeightDate:${grossWeightDate} | ||
164 | -tareWeightDate:${tareWeightDate} | ||
165 | -grossPathName: | ||
166 | -grossPathId: | ||
167 | -tarePathId: | ||
168 | -goodsRemark: | ||
169 | -inGreeterName: | ||
170 | -inGreeterId:0 | ||
171 | -outGreeterId: | ||
172 | -sumPrice:${sumPrice} | ||
173 | -shipperName: | ||
174 | -shipperId: | ||
175 | -shipperPhone: | ||
176 | -feeDepName: | ||
177 | -calcFeeDepId: | 98 | + pwd: |
99 | + clientRedirectTag: | ||
100 | + viewType:pay | ||
101 | + optType:${optType} | ||
102 | + optUrl: | ||
103 | + correctInfo:${correctInfo} | ||
104 | + weightType:${weightType} | ||
105 | + id:${orderId} | ||
106 | + goodsId:${goodsId} | ||
107 | + number:${number} | ||
108 | + modified:${__time(yyyy-MM-dd HH:mm:ss,)} | ||
109 | + status:${status} | ||
110 | + source:${source} | ||
111 | + updateFeeItems: | ||
112 | + correctDiscount:${correctDiscount} | ||
113 | + totalAmount: | ||
114 | + customerId:0 | ||
115 | + fundAccount: | ||
116 | + ic: | ||
117 | + customerName: | ||
118 | + customerPhone: | ||
119 | + payway:刷卡 | ||
120 | + plate:${plate} | ||
121 | + autocomplete-cartype:${carTypeCode}(${carTypeName}) | ||
122 | + carTypeName:${carTypeName} | ||
123 | + carTypeCode:${carTypeCode} | ||
124 | + carTypeId:${carTypeId} | ||
125 | + carTypeWeight:${carTypeWeight} | ||
126 | + storeTareWeight: | ||
127 | + proveType:${proveTypeCode} | ||
128 | + grossWeight:${grossWeight} | ||
129 | + tareWeight:${tareWeight} | ||
130 | + weight:${grossWeight} | ||
131 | + goodsNum: | ||
132 | + itemWeight: | ||
133 | + productPrice:1 | ||
134 | + unitPrice:${unitPrice} | ||
135 | + depName:${feeDepName} | ||
136 | + calcDepId:${feeDepId} | ||
137 | + regionName: | ||
138 | + regionId:0 | ||
139 | + productName:${productName} | ||
140 | + productId:${productId} | ||
141 | + productArea:万州区 | ||
142 | + parentId: | ||
143 | + levelType: | ||
144 | + originId:${originId} | ||
145 | + tradeTypeId:${tradeTypeId} | ||
146 | + chargeTotalAmount: | ||
147 | + chargeTotalAmountYuan: | ||
148 | + freezeMoneySymbol: | ||
149 | + comparisonFreezeAmount: | ||
150 | + created:${created} | ||
151 | + remark: | ||
152 | + goodsTagIds:${goodsTagIds} | ||
153 | + shareRatio:${shareRatio} | ||
154 | + handlingTeam: | ||
155 | + handlingRatio: | ||
156 | + handActualAmount: | ||
157 | + handManageAmount: | ||
158 | + handCollectionAmount: | ||
159 | + receivableAmount: | ||
160 | + categoryName:${productName} | ||
161 | + categoryId:${productId} | ||
162 | + driverTel: | ||
163 | + grossWeightDate:${grossWeightDate} | ||
164 | + tareWeightDate:${tareWeightDate} | ||
165 | + grossPathName: | ||
166 | + grossPathId: | ||
167 | + tarePathId: | ||
168 | + goodsRemark: | ||
169 | + inGreeterName: | ||
170 | + inGreeterId:0 | ||
171 | + outGreeterId: | ||
172 | + sumPrice:${sumPrice} | ||
173 | + shipperName: | ||
174 | + shipperId: | ||
175 | + shipperPhone: | ||
176 | + feeDepName: | ||
177 | + calcFeeDepId: | ||
178 | """ | 178 | """ |
179 | url = host + "/calculate/index.action" | 179 | url = host + "/calculate/index.action" |
180 | headers = dct.urlCode() | 180 | headers = dct.urlCode() |
@@ -238,16 +238,12 @@ def do_doPay(host="",autocompletecartype=None,fee_str="",**kwargs): | @@ -238,16 +238,12 @@ def do_doPay(host="",autocompletecartype=None,fee_str="",**kwargs): | ||
238 | "shipperPhone": "", "feeDepName": "", "calcFeeDepId": "", "feeDepId": "","accountId":""} | 238 | "shipperPhone": "", "feeDepName": "", "calcFeeDepId": "", "feeDepId": "","accountId":""} |
239 | data["autocomplete-cartype"] = autocompletecartype | 239 | data["autocomplete-cartype"] = autocompletecartype |
240 | data = dict(data, **kwargs) | 240 | data = dict(data, **kwargs) |
241 | - print("get_calculateRes", data) | ||
242 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str | 241 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
243 | - # data_uc = urllib.parse.urlencode(data)+"&"+fee_str | ||
244 | - print(data_uc) | ||
245 | - # data_uc = urllib.parse.quote(data_uc) | ||
246 | print("================开始请求================") | 242 | print("================开始请求================") |
247 | res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | 243 | res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) |
248 | return res | 244 | return res |
249 | 245 | ||
250 | -def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032"): | 246 | +def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111"): |
251 | a = listPage(host=host, attrName=attrName, attrValue=attrValue) | 247 | a = listPage(host=host, attrName=attrName, attrValue=attrValue) |
252 | print("listPage", a.json()) | 248 | print("listPage", a.json()) |
253 | orderId = a.json()["rows"][0]["id"] | 249 | orderId = a.json()["rows"][0]["id"] |
@@ -256,26 +252,51 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | @@ -256,26 +252,51 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | ||
256 | print(orderId) | 252 | print(orderId) |
257 | 253 | ||
258 | # # 订单详情获取 | 254 | # # 订单详情获取 |
259 | - | ||
260 | resOrderDetails = get_OrderDetails(host=host, orderId=orderId) | 255 | resOrderDetails = get_OrderDetails(host=host, orderId=orderId) |
261 | - unitPrice = re.findall('name="unitPrice" value="(.*?)" id', resOrderDetails.text)[0] | ||
262 | - goodsId = re.findall('id="goodsId" value="(.*?)">', resOrderDetails.text)[0] | ||
263 | - status = re.findall('"status" name="status" value="(.*?)">', resOrderDetails.text)[0] | ||
264 | - source = re.findall('id="source" name="source" value="(.*?)">', resOrderDetails.text)[0] | ||
265 | - optType = re.findall('id="optType" name="optType" value="(.*?)">', resOrderDetails.text)[0] | ||
266 | - correctInfo = re.findall('d="correctInfo" name="correctInfo" value="(.*?)">', resOrderDetails.text)[0] | ||
267 | - weightType = re.findall('name="weightType" id="weightType" value="(.*?)">', resOrderDetails.text)[0] | ||
268 | - correctDiscount = re.findall('id="correctDiscount" name="correctDiscount" value="(.*?)">', resOrderDetails.text)[0] | 256 | + |
257 | + # 正则取值 | ||
269 | regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] | 258 | regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] |
270 | - goodsTagIds = \ | ||
271 | - re.findall('<input name="goodsTagIds" type="radio" value="(.*?)" readonly checked>', resOrderDetails.text)[0] | ||
272 | - sumPrice = re.findall('<input type="hidden" name="sumPrice" value="(.*?)" id="sumPrice">', resOrderDetails.text)[0] | ||
273 | - calcFeeDepId = re.findall('<input type="hidden" name="calcFeeDepId" value="(.*?)">', resOrderDetails.text)[0] | ||
274 | - tradeTypeId = \ | ||
275 | - re.findall('input type="hidden" class="form-control" name="tradeTypeId" value="(.*?)" >', resOrderDetails.text)[0] | ||
276 | - shareRatio = \ | ||
277 | - re.findall('input type="hidden" id="shareRatioVal" name="shareRatio" value="(.*?)"', resOrderDetails.text)[0] | ||
278 | - regionName = re.findall('" bind-name="(.*?)"', resOrderDetails.text)[0] | 259 | + |
260 | + # bs取值 | ||
261 | + orderDetailsList = BeautifulSoup(resOrderDetails.text, "html.parser").findAll("input") | ||
262 | + orderDetailsDict = {i.get("name"): i.get("value") for i in orderDetailsList} | ||
263 | + print("orderDetailsDict",orderDetailsDict) | ||
264 | + unitPrice = orderDetailsDict["unitPrice"] | ||
265 | + goodsId = orderDetailsDict["goodsId"] | ||
266 | + status = orderDetailsDict["status"] | ||
267 | + source = orderDetailsDict["source"] | ||
268 | + optType = orderDetailsDict["optType"] | ||
269 | + correctInfo = orderDetailsDict["correctInfo"] | ||
270 | + weightType = orderDetailsDict["weightType"] | ||
271 | + correctDiscount = orderDetailsDict["correctDiscount"] | ||
272 | + goodsTagIds = orderDetailsDict["goodsTagIds"] | ||
273 | + sumPrice = orderDetailsDict["sumPrice"] | ||
274 | + tradeTypeId = orderDetailsDict["tradeTypeId"] | ||
275 | + shareRatio = orderDetailsDict["shareRatio"] | ||
276 | + regionName=orderDetailsDict["regionName"] | ||
277 | + plate = orderDetailsDict["plate"] | ||
278 | + carTypeName = orderDetailsDict["carTypeName"] | ||
279 | + carTypeCode = orderDetailsDict["carTypeCode"] | ||
280 | + carTypeId = orderDetailsDict["carTypeId"] | ||
281 | + carTypeWeight = orderDetailsDict["carTypeWeight"] | ||
282 | + proveType = orderDetailsDict["proveType"] | ||
283 | + grossWeight = orderDetailsDict["grossWeight"] | ||
284 | + tareWeight = orderDetailsDict["tareWeight"] | ||
285 | + depName = orderDetailsDict["depName"] | ||
286 | + feeDepId = orderDetailsDict["calcDepId"] | ||
287 | + productName = orderDetailsDict["productName"] | ||
288 | + productId = orderDetailsDict["productId"] | ||
289 | + grossWeightDate = orderDetailsDict["grossWeightDate"] | ||
290 | + tareWeightDate = orderDetailsDict["tareWeightDate"] | ||
291 | + weight = orderDetailsDict["weight"] | ||
292 | + calcDepId = orderDetailsDict["calcDepId"] | ||
293 | + categoryName = orderDetailsDict["categoryName"] | ||
294 | + categoryId = orderDetailsDict["categoryId"] | ||
295 | + inGreeterName = orderDetailsDict["inGreeterName"] | ||
296 | + inGreeterId = orderDetailsDict["inGreeterId"] | ||
297 | + productArea = orderDetailsDict["productArea"] | ||
298 | + productPrice = orderDetailsDict["productPrice"] | ||
299 | + | ||
279 | 300 | ||
280 | # 用户信息获取 | 301 | # 用户信息获取 |
281 | ic = 888810032426 | 302 | ic = 888810032426 |
@@ -290,38 +311,15 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | @@ -290,38 +311,15 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | ||
290 | res = get_city(host=host, name="万州") | 311 | res = get_city(host=host, name="万州") |
291 | print(res.text) | 312 | print(res.text) |
292 | originId = res.json()["suggestions"][0]["id"] | 313 | originId = res.json()["suggestions"][0]["id"] |
293 | - parentId = res.json()["suggestions"][0]["parentId"] | ||
294 | - value = res.json()["suggestions"][0]["value"] | ||
295 | - | ||
296 | - # 获取缴费金额 | ||
297 | - # host = "http://test.jmsf.diligrp.com:8385" | ||
298 | - plate = re.findall('name="plate" class="form-control" value="(.*?)" id="plate"', resOrderDetails.text)[0] | ||
299 | - modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | ||
300 | - carTypeName = re.findall('name="carTypeName" id="carTypeName" value="(.*?)" ', resOrderDetails.text)[0] | ||
301 | - carTypeCode = re.findall('name="carTypeCode" id="carTypeCode" value="(.*?)" ', resOrderDetails.text)[0] | ||
302 | - carTypeId = re.findall('name="carTypeId" id="carTypeId" value="(.*?)" ', resOrderDetails.text)[0] | ||
303 | - carTypeWeight = "333" | ||
304 | - proveType = re.findall(' value="(.*?)" id="proveType" name="proveType"', resOrderDetails.text)[0] | ||
305 | - proveTypeCode = proveType | ||
306 | - grossWeight = re.findall('name="grossWeight" id="grossWeight" value="(.*?)"', resOrderDetails.text)[0] | ||
307 | - newWeight = re.findall('name="weight" readonly value="(.*?)" id="weight"', resOrderDetails.text)[0] | ||
308 | - tareWeight = re.findall('name="tareWeight" id="tareWeight" value="(.*?)"', resOrderDetails.text)[0] | ||
309 | - depName = re.findall('id="depName" name="depName" value="(.*?)"', resOrderDetails.text)[0] | ||
310 | - feeDepId = re.findall('name="calcDepId" value="(.*?)"', resOrderDetails.text)[0] | ||
311 | - productName = re.findall('name="productName" value="(.*?)"', resOrderDetails.text)[0] | ||
312 | - productId = re.findall('id="productId" value="(.*?)"', resOrderDetails.text)[0] | ||
313 | - grossWeightDate = re.findall('name="grossWeightDate" value="(.*?)"', resOrderDetails.text)[0] | ||
314 | - tareWeightDate = re.findall('name="tareWeightDate" value="(.*?)"', resOrderDetails.text)[0] | ||
315 | - weight = re.findall('name="weight" readonly value="(.*?)"', resOrderDetails.text)[0] | ||
316 | - calcDepId = re.findall('name="calcDepId" value="(.*?)"', resOrderDetails.text)[0] | ||
317 | - categoryName = "水果" | ||
318 | - categoryId = "14436" | ||
319 | - inGreeterName = re.findall('id="inGreeterName" value="(.*?)"', resOrderDetails.text)[0] | ||
320 | - inGreeterId = re.findall('name="inGreeterId" id="inGreeterId" value="(.*?)"', resOrderDetails.text)[0] | 314 | + # parentId = res.json()["suggestions"][0]["parentId"] |
315 | + # value = res.json()["suggestions"][0]["value"] | ||
321 | 316 | ||
317 | + # # 获取缴费金额 | ||
322 | autocompletecartype = f"{carTypeCode}({carTypeName})" | 318 | autocompletecartype = f"{carTypeCode}({carTypeName})" |
323 | print(autocompletecartype) | 319 | print(autocompletecartype) |
320 | + modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | ||
324 | 321 | ||
322 | + # 获取缴费金额 | ||
325 | res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | 323 | res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, |
326 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, | 324 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
327 | status=status, | 325 | status=status, |
@@ -337,50 +335,33 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | @@ -337,50 +335,33 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | ||
337 | tareWeightDate=tareWeightDate, sumPrice=sumPrice, calcDepId=calcDepId, weight=weight, | 335 | tareWeightDate=tareWeightDate, sumPrice=sumPrice, calcDepId=calcDepId, weight=weight, |
338 | inGreeterName=inGreeterName, inGreeterId=inGreeterId) | 336 | inGreeterName=inGreeterName, inGreeterId=inGreeterId) |
339 | 337 | ||
340 | - # backSkinTwo = re.findall('name="backSkinTwo" value="(.*?)" >',res.text)[0] | ||
341 | # 缴费信息 | 338 | # 缴费信息 |
342 | totalMoney = re.findall('name="totalMoney" value="(.*?)">', res.text)[0] | 339 | totalMoney = re.findall('name="totalMoney" value="(.*?)">', res.text)[0] |
343 | discountAmount = re.findall('name="discountAmount" value="(.*?)">', res.text)[0] | 340 | discountAmount = re.findall('name="discountAmount" value="(.*?)">', res.text)[0] |
344 | - collectionPrice = re.findall('" name="collectionPrice" value="(.*?)">', res.text)[0] | ||
345 | handReceivableAmount = re.findall('name="handReceivableAmount" value="(.*?)">', res.text)[0] | 341 | handReceivableAmount = re.findall('name="handReceivableAmount" value="(.*?)">', res.text)[0] |
346 | correctDiscount = re.findall('id="correctDiscount" name="correctDiscount" value="(.*?)">', res.text)[0] | 342 | correctDiscount = re.findall('id="correctDiscount" name="correctDiscount" value="(.*?)">', res.text)[0] |
347 | - billItemCheckIds = re.findall('" name="billItemCheckIds" value="(.*?)" ', res.text)[0] | ||
348 | - billItemCheckIdsV = re.findall('" maxlength="15" data-old="(.*?)"', res.text)[0] | ||
349 | receivable = re.findall('id="creceivableLong" name="receivable" value="(.*?)">', res.text)[0] | 343 | receivable = re.findall('id="creceivableLong" name="receivable" value="(.*?)">', res.text)[0] |
344 | + collectionPrice = re.findall('name="collectionPrice" value="(.*?)"', res.text)[0] | ||
350 | 345 | ||
351 | - soup = BeautifulSoup(res.text, "html.parser") | ||
352 | # 查找dl标签class为包含'ui-font-'字符的所有dl标签 | 346 | # 查找dl标签class为包含'ui-font-'字符的所有dl标签 |
347 | + soup = BeautifulSoup(res.text, "html.parser") | ||
353 | fee_str = "correctDiscount=1&billItems=&billItemsDic=" | 348 | fee_str = "correctDiscount=1&billItems=&billItemsDic=" |
354 | fee_int = 0 | 349 | fee_int = 0 |
355 | discount_amount = 0 | 350 | discount_amount = 0 |
356 | for tag in soup.findAll("div", class_="d-flex align-items-center"): | 351 | for tag in soup.findAll("div", class_="d-flex align-items-center"): |
357 | - print("=============================================") | ||
358 | c = tag.findAll("input") | 352 | c = tag.findAll("input") |
359 | for i in c: | 353 | for i in c: |
360 | - print(i) | ||
361 | if i.get("name") != None: | 354 | if i.get("name") != None: |
362 | fee_str = fee_str + "&" + i.get("name") + "=" + urllib.parse.quote(i.get("value")) | 355 | fee_str = fee_str + "&" + i.get("name") + "=" + urllib.parse.quote(i.get("value")) |
363 | if i.get("type") == "text": | 356 | if i.get("type") == "text": |
364 | - print("---------------- f 2 s----------------") | ||
365 | - print(i) | ||
366 | - print(i.get("value")) | ||
367 | fee_int = fee_int + int(float(i.get("value"))) | 357 | fee_int = fee_int + int(float(i.get("value"))) |
368 | - print("---------------- f 2 e----------------") | ||
369 | if "优惠" in i.get("value"): | 358 | if "优惠" in i.get("value"): |
370 | discount_amount = discount_amount + int(json.loads(i.get("value"))["receivable"]) / 100 | 359 | discount_amount = discount_amount + int(json.loads(i.get("value"))["receivable"]) / 100 |
371 | - # fee_int = fee_int+int(i.get("value")) | ||
372 | - # print(fee_str) | ||
373 | - # print(fee_int) | ||
374 | - # print("discount_amount",discount_amount) | ||
375 | - # print("discountAmount",discountAmount) | ||
376 | 360 | ||
377 | - pwd = "111111" | ||
378 | id = orderId | 361 | id = orderId |
379 | totalAmount = totalMoney | 362 | totalAmount = totalMoney |
380 | customerPhone = mobile | 363 | customerPhone = mobile |
381 | - productPrice = "1.00000" | ||
382 | dep = feeDepId | 364 | dep = feeDepId |
383 | - productArea = "重庆,重庆市,万州区" | ||
384 | chargeTotalAmount = totalMoney | 365 | chargeTotalAmount = totalMoney |
385 | chargeTotalAmountYuan = fee_int - int(discount_amount) | 366 | chargeTotalAmountYuan = fee_int - int(discount_amount) |
386 | freezeMoneySymbol = fee_int | 367 | freezeMoneySymbol = fee_int |
@@ -388,10 +369,10 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | @@ -388,10 +369,10 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | ||
388 | modified = created | 369 | modified = created |
389 | firmCode = my.userInfo["data"]["user"]["firmCode"] | 370 | firmCode = my.userInfo["data"]["user"]["firmCode"] |
390 | marketFlag = firmCode | 371 | marketFlag = firmCode |
391 | - collectionPrice = 0 | ||
392 | itemReceivableAmount = receivable | 372 | itemReceivableAmount = receivable |
393 | receivableAmount = receivable | 373 | receivableAmount = receivable |
394 | tareWeightDate = tareWeightDate | 374 | tareWeightDate = tareWeightDate |
375 | + | ||
395 | aa = do_doPay(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | 376 | aa = do_doPay(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, |
396 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, | 377 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
397 | source=source, | 378 | source=source, |
@@ -418,165 +399,4 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | @@ -418,165 +399,4 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" | ||
418 | print(aa.text) | 399 | print(aa.text) |
419 | return aa | 400 | return aa |
420 | 401 | ||
421 | -# do_payOrder(attrValue="202108060900035") | ||
422 | - | ||
423 | - | ||
424 | -""" | ||
425 | -a = listPage(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032") | ||
426 | -print("listPage",a.json()) | ||
427 | -orderId = a.json()["rows"][0]["id"] | ||
428 | -number = a.json()["rows"][0]["number"] | ||
429 | -created = a.json()["rows"][0]["created"] | ||
430 | -print(orderId) | ||
431 | - | ||
432 | -# # 订单详情获取 | ||
433 | - | ||
434 | -resOrderDetails = get_OrderDetails(host="http://test.jmsf.diligrp.com:8385",orderId=orderId) | ||
435 | -unitPrice = re.findall('name="unitPrice" value="(.*?)" id',resOrderDetails.text)[0] | ||
436 | -goodsId = re.findall('id="goodsId" value="(.*?)">',resOrderDetails.text)[0] | ||
437 | -status = re.findall('"status" name="status" value="(.*?)">',resOrderDetails.text)[0] | ||
438 | -source = re.findall('id="source" name="source" value="(.*?)">',resOrderDetails.text)[0] | ||
439 | -optType = re.findall('id="optType" name="optType" value="(.*?)">',resOrderDetails.text)[0] | ||
440 | -correctInfo = re.findall('d="correctInfo" name="correctInfo" value="(.*?)">',resOrderDetails.text)[0] | ||
441 | -weightType = re.findall('name="weightType" id="weightType" value="(.*?)">',resOrderDetails.text)[0] | ||
442 | -correctDiscount = re.findall('id="correctDiscount" name="correctDiscount" value="(.*?)">',resOrderDetails.text)[0] | ||
443 | -regionId = re.findall('<option value="(.*?)" bind-name="',resOrderDetails.text)[0] | ||
444 | -goodsTagIds = re.findall('<input name="goodsTagIds" type="radio" value="(.*?)" readonly checked>',resOrderDetails.text)[0] | ||
445 | -sumPrice = re.findall('<input type="hidden" name="sumPrice" value="(.*?)" id="sumPrice">',resOrderDetails.text)[0] | ||
446 | -calcFeeDepId = re.findall('<input type="hidden" name="calcFeeDepId" value="(.*?)">',resOrderDetails.text)[0] | ||
447 | -tradeTypeId = re.findall('input type="hidden" class="form-control" name="tradeTypeId" value="(.*?)" >',resOrderDetails.text)[0] | ||
448 | -shareRatio = re.findall('input type="hidden" id="shareRatioVal" name="shareRatio" value="(.*?)"',resOrderDetails.text)[0] | ||
449 | -regionName = re.findall('" bind-name="(.*?)"',resOrderDetails.text)[0] | ||
450 | - | ||
451 | - | ||
452 | -# 用户信息获取 | ||
453 | -ic=888810032426 | ||
454 | -res = get_icCheck(host="http://test.jmsf.diligrp.com:8385",ic=ic) | ||
455 | -print(res.text) | ||
456 | -customerId = res.json()["data"]["aInfo"]["customerId"] | ||
457 | -customerName = res.json()["data"]["aInfo"]["customerName"] | ||
458 | -accountId = res.json()["data"]["aInfo"]["accountId"] | ||
459 | -mobile = res.json()["data"]["aInfo"]["mobile"] | ||
460 | - | ||
461 | -# 省市区获取 | ||
462 | -res = get_city(host="http://test.jmsf.diligrp.com:8385",name="万州") | ||
463 | -print(res.text) | ||
464 | -originId = res.json()["suggestions"][0]["id"] | ||
465 | -parentId = res.json()["suggestions"][0]["parentId"] | ||
466 | -value = res.json()["suggestions"][0]["value"] | ||
467 | - | ||
468 | -# 获取缴费金额 | ||
469 | -host="http://test.jmsf.diligrp.com:8385" | ||
470 | -plate= re.findall('name="plate" class="form-control" value="(.*?)" id="plate"',resOrderDetails.text)[0] | ||
471 | -modified=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | ||
472 | -carTypeName= re.findall('name="carTypeName" id="carTypeName" value="(.*?)" ',resOrderDetails.text)[0] | ||
473 | -carTypeCode = re.findall('name="carTypeCode" id="carTypeCode" value="(.*?)" ',resOrderDetails.text)[0] | ||
474 | -carTypeId = re.findall('name="carTypeId" id="carTypeId" value="(.*?)" ',resOrderDetails.text)[0] | ||
475 | -carTypeWeight = "333" | ||
476 | -proveType = re.findall(' value="(.*?)" id="proveType" name="proveType"',resOrderDetails.text)[0] | ||
477 | -proveTypeCode = proveType | ||
478 | -grossWeight = re.findall('name="grossWeight" id="grossWeight" value="(.*?)"',resOrderDetails.text)[0] | ||
479 | -newWeight = re.findall('name="weight" readonly value="(.*?)" id="weight"',resOrderDetails.text)[0] | ||
480 | -tareWeight=re.findall('name="tareWeight" id="tareWeight" value="(.*?)"',resOrderDetails.text)[0] | ||
481 | -depName = re.findall('id="depName" name="depName" value="(.*?)"',resOrderDetails.text)[0] | ||
482 | -feeDepId = re.findall('name="calcDepId" value="(.*?)"',resOrderDetails.text)[0] | ||
483 | -productName = re.findall('name="productName" value="(.*?)"',resOrderDetails.text)[0] | ||
484 | -productId=re.findall('id="productId" value="(.*?)"',resOrderDetails.text)[0] | ||
485 | -grossWeightDate=re.findall('name="grossWeightDate" value="(.*?)"',resOrderDetails.text)[0] | ||
486 | -tareWeightDate = re.findall('name="tareWeightDate" value="(.*?)"',resOrderDetails.text)[0] | ||
487 | -weight = re.findall('name="weight" readonly value="(.*?)"',resOrderDetails.text)[0] | ||
488 | -calcDepId=re.findall('name="calcDepId" value="(.*?)"',resOrderDetails.text)[0] | ||
489 | -categoryName="水果" | ||
490 | -categoryId="14436" | ||
491 | -inGreeterName = re.findall('id="inGreeterName" value="(.*?)"',resOrderDetails.text)[0] | ||
492 | -inGreeterId = re.findall('name="inGreeterId" id="inGreeterId" value="(.*?)"',resOrderDetails.text)[0] | ||
493 | - | ||
494 | - | ||
495 | -autocompletecartype = f"{carTypeCode}({carTypeName})" | ||
496 | -print(autocompletecartype) | ||
497 | - | ||
498 | -res = get_calculateRes(host=host,autocompletecartype=autocompletecartype,optType=optType,correctInfo=correctInfo, | ||
499 | - weightType=weightType,id=orderId,goodsId=goodsId,number=number,modified=modified,status=status, | ||
500 | - source=source,correctDiscount=correctDiscount,plate=plate,carTypeName=carTypeName,carTypeCode=carTypeCode, | ||
501 | - carTypeId=carTypeId,carTypeWeight=carTypeWeight,proveType=proveType,grossWeight=grossWeight, | ||
502 | - tareWeight=tareWeight,unitPrice=unitPrice,depName=depName,productName=productName, | ||
503 | - productId=productId,originId=originId,tradeTypeId=tradeTypeId,created=created,goodsTagIds=goodsTagIds, | ||
504 | - shareRatio=shareRatio,categoryName=categoryName,categoryId=categoryId,grossWeightDate=grossWeightDate, | ||
505 | - tareWeightDate=tareWeightDate,sumPrice=sumPrice,calcDepId=calcDepId,weight=weight, | ||
506 | - inGreeterName=inGreeterName,inGreeterId=inGreeterId) | ||
507 | - | ||
508 | -# backSkinTwo = re.findall('name="backSkinTwo" value="(.*?)" >',res.text)[0] | ||
509 | -# 缴费信息 | ||
510 | -totalMoney = re.findall('name="totalMoney" value="(.*?)">',res.text)[0] | ||
511 | -discountAmount = re.findall('name="discountAmount" value="(.*?)">',res.text)[0] | ||
512 | -collectionPrice = re.findall('" name="collectionPrice" value="(.*?)">',res.text)[0] | ||
513 | -handReceivableAmount = re.findall('name="handReceivableAmount" value="(.*?)">',res.text)[0] | ||
514 | -correctDiscount = re.findall('id="correctDiscount" name="correctDiscount" value="(.*?)">',res.text)[0] | ||
515 | -billItemCheckIds = re.findall('" name="billItemCheckIds" value="(.*?)" ',res.text)[0] | ||
516 | -billItemCheckIdsV = re.findall('" maxlength="15" data-old="(.*?)"',res.text)[0] | ||
517 | -receivable = re.findall('id="creceivableLong" name="receivable" value="(.*?)">',res.text)[0] | ||
518 | - | ||
519 | - | ||
520 | - | ||
521 | -soup = BeautifulSoup(res.text, "html.parser") | ||
522 | -# 查找dl标签class为包含'ui-font-'字符的所有dl标签 | ||
523 | -fee_str = "correctDiscount=1&billItems=&billItemsDic=" | ||
524 | -fee_int = 0 | ||
525 | -discount_amount = 0 | ||
526 | -for tag in soup.findAll("div", class_="d-flex align-items-center"): | ||
527 | - print("=============================================") | ||
528 | - c = tag.findAll("input") | ||
529 | - for i in c: | ||
530 | - print(i) | ||
531 | - if i.get("name") != None: | ||
532 | - fee_str = fee_str + "&" + i.get("name") + "=" + urllib.parse.quote(i.get("value")) | ||
533 | - if i.get("type") == "text": | ||
534 | - print("---------------- f 2 s----------------") | ||
535 | - print(i) | ||
536 | - print(i.get("value")) | ||
537 | - fee_int = fee_int+int(float(i.get("value"))) | ||
538 | - print("---------------- f 2 e----------------") | ||
539 | - if "优惠" in i.get("value"): | ||
540 | - discount_amount = discount_amount+int(json.loads(i.get("value"))["receivable"])/100 | ||
541 | - # fee_int = fee_int+int(i.get("value")) | ||
542 | -# print(fee_str) | ||
543 | -# print(fee_int) | ||
544 | -# print("discount_amount",discount_amount) | ||
545 | -# print("discountAmount",discountAmount) | ||
546 | - | ||
547 | -pwd = "111111" | ||
548 | -id = orderId | ||
549 | -totalAmount = totalMoney | ||
550 | -customerPhone=mobile | ||
551 | -productPrice="1.00000" | ||
552 | -dep=feeDepId | ||
553 | -productArea = "重庆,重庆市,万州区" | ||
554 | -chargeTotalAmount = totalMoney | ||
555 | -chargeTotalAmountYuan = fee_int-int(discount_amount) | ||
556 | -freezeMoneySymbol = fee_int | ||
557 | -comparisonFreezeAmount = fee_int | ||
558 | -modified = created | ||
559 | -firmCode = "sy" | ||
560 | -marketFlag=firmCode | ||
561 | -collectionPrice=0 | ||
562 | -itemReceivableAmount=receivable | ||
563 | -receivableAmount=receivable | ||
564 | -tareWeightDate=tareWeightDate | ||
565 | -aa = do_doPay(host=host,autocompletecartype=autocompletecartype,fee_str=fee_str,pwd=pwd,optType=optType, | ||
566 | - weightType=weightType,id=id,goodsId=goodsId,number=number,created=created,status=status,source=source, | ||
567 | - correctDiscount=correctDiscount,totalAmount=totalAmount,customerId=customerId,fundAccount=accountId, | ||
568 | - accountId=accountId,ic=ic,customerName=customerName,customerPhone=customerPhone,plate=plate, | ||
569 | - carTypeName=carTypeName,carTypeCode=carTypeCode,carTypeId=carTypeId,carTypeWeight=carTypeWeight, | ||
570 | - proveType=proveType,grossWeight=grossWeight,tareWeight=tareWeight,weight=weight,productPrice=productPrice, | ||
571 | - unitPrice=unitPrice,depName=depName,calcDepId=calcDepId,dep=dep,regionName=regionName,regionId=regionId, | ||
572 | - productName=productName,productId=productId,productArea=productArea,originId=originId, | ||
573 | - tradeTypeId=tradeTypeId,correctInfo=correctInfo,chargeTotalAmount=chargeTotalAmount, | ||
574 | - freezeMoneySymbol=freezeMoneySymbol,comparisonFreezeAmount=comparisonFreezeAmount,modified=modified, | ||
575 | - goodsTagIds=goodsTagIds,marketFlag=marketFlag,totalMoney=totalMoney,receivable=receivable, | ||
576 | - collectionPrice=collectionPrice,discountAmount=discountAmount,handReceivableAmount=handReceivableAmount, | ||
577 | - itemReceivableAmount=itemReceivableAmount,receivableAmount=receivableAmount,categoryName=categoryName, | ||
578 | - categoryId=carTypeId,grossWeightDate=grossWeightDate,tareWeightDate=tareWeightDate,sumPrice=sumPrice, | ||
579 | - chargeTotalAmountYuan=chargeTotalAmountYuan) | ||
580 | - | ||
581 | -print(aa.text) | ||
582 | -""" | ||
583 | \ No newline at end of file | 402 | \ No newline at end of file |
403 | +do_payOrder(attrValue="202108100900016") | ||
584 | \ No newline at end of file | 404 | \ No newline at end of file |
report/test.log
1 | -[2021-08-06 17:59:01] [INFO] : ====================================================================================== | ||
2 | -[2021-08-06 17:59:01] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
3 | -{'data': None, 'json': {'userName': 'sy_chen', 'password': 'lsWZHfMAgFdA1giqEGJYul8opwYuR43hQpevsvVb43uipM2lnt6JdkBKNUOQqglnozlTCnVQGSo1jClpGUlPrf5vZRqa0pGL+bkt7JeXJEn+PWX6YwcReS35AZjjVMkvte914ZiwNkOhgMS6S/mQeJc6fjJX34NkbMG2yE2jK6w='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | 1 | +[2021-08-10 15:28:58] [INFO] : ====================================================================================== |
2 | +[2021-08-10 15:28:58] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
3 | +{'data': None, 'json': {'userName': 'sy_chen', 'password': 'VCXTzDLTCJoE5Ap1Eubd7jpUa+bMkJUS8pP0W6Rw2+gslSOnRoe+hUKXJvO9ZgN9Arg6fOSqYAMRd3M+GUn2A6BjJ8N8dkAmLhVFBy6niPkO9yS1yVnDOOIZuBXt51zT6t/XDulohPCs7D3UhkFupgyPunQrNYQWr0SDGm8h/EQ='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | ||
4 | 4 | ||
5 | -[2021-08-06 17:59:01] [INFO] : ====================================================================================== | ||
6 | -[2021-08-06 17:59:01] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
7 | -{'data': None, 'json': {'userName': 'sygangda', 'password': 'NDKNIWWSXVpWHh9IK/ZgUt60b1DTN6k3jNED6lGBp3Hreemne5supQ8BeLwwxSoRxxt/Ko1Ejg2tLAOBpcsU7yxIvdEBDnuCof8d3OSmsCP83tMGnu/qIe94hIpfz6Pmo5dCQmXK3R83xhFE4FxVhQhL2z1j+QR6iBUWSXnAizU='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | 5 | +[2021-08-10 15:28:59] [INFO] : ====================================================================================== |
6 | +[2021-08-10 15:28:59] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
7 | +{'data': None, 'json': {'userName': 'sygangda', 'password': 'j0KGGo/lplX7i7ey1ejk+RFWiua+UVH+MhmhrC60YeNWiGEMxaaS4u5qtsLxllm68Z683sl/qG0HvVlq78CeD8VcYRN8MhEYkpkZ2w5aP/bK5T4wAmc/ZL4jrFWMe+KE1RRzJxZ2sONNJWObGpHx6KAn4b9nLq30PGIpmhLd4MA='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | ||
8 | 8 | ||
9 | -[2021-08-06 17:59:01] [INFO] : ====================================================================================== | ||
10 | -[2021-08-06 17:59:01] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType | ||
11 | -{"businessCode": "jmsf"} | 9 | +[2021-08-10 15:28:59] [INFO] : ====================================================================================== |
10 | +[2021-08-10 15:28:59] [INFO] : http://test.jmsf.diligrp.com:8385/entranceFeeBill/listPage.action | ||
11 | +{'rows': '10', 'page': '1', 'sort': 'et.created', 'order': 'desc', 'metadata[created]': '{"provider": "datetimeProvider", "index": 10, "field": "created"}', 'metadata[totalPrice]': '{"provider": "moneyProvider", "index": 20, "field": "totalPrice"}', 'metadata[paymentTime]': '{"provider": "datetimeProvider", "index": 30, "field": "paymentTime"}', 'metadata[type]': '{"provider": "entranceFeeBillTypeProvider", "index": 40, "field": "type"}', 'metadata[status]': '{"provider": "entranceFeeBillStateProvider", "index": 50, "field": "status"}', 'attr': 'number', 'attrValue': '202108100900016'} | ||
12 | {} | 12 | {} |
13 | 13 | ||
14 | -[2021-08-06 17:59:02] [INFO] : ====================================================================================== | ||
15 | -[2021-08-06 17:59:02] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree | ||
16 | -{"marketId": 9, "state": 1, "keyword": "\u852c\u83dc"} | ||
17 | -{} | ||
18 | - | ||
19 | -[2021-08-06 17:59:02] [INFO] : ====================================================================================== | ||
20 | -[2021-08-06 17:59:02] [INFO] : http://test.gateway.diligrp.com:8285/dili-uap/userApi/listByExample.api | ||
21 | -{"firmCode": "sy", "departmentId": 58, "keyword": ""} | ||
22 | -{} | ||
23 | - | ||
24 | -[2021-08-06 17:59:02] [INFO] : ====================================================================================== | ||
25 | -[2021-08-06 17:59:02] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/tradeType/query | ||
26 | -{"pageNum": 100, "pageSize": 100, "marketId": 9} | ||
27 | -{} | ||
28 | - | ||
29 | -[2021-08-06 17:59:02] [INFO] : ====================================================================================== | ||
30 | -[2021-08-06 17:59:02] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | 14 | +[2021-08-10 15:28:59] [INFO] : ====================================================================================== |
15 | +[2021-08-10 15:28:59] [INFO] : http://test.jmsf.diligrp.com:8385/entranceFeeBill/pay/3793.action | ||
31 | None | 16 | None |
32 | -{'params': {'pid': 'goods_tag'}} | ||
33 | - | ||
34 | -[2021-08-06 17:59:03] [INFO] : ====================================================================================== | ||
35 | -[2021-08-06 17:59:03] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/address | ||
36 | -{"province": "C", "city": null, "area": null} | ||
37 | {} | 17 | {} |
38 | 18 | ||
39 | -[2021-08-06 17:59:03] [INFO] : ====================================================================================== | ||
40 | -[2021-08-06 17:59:03] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/dep | 19 | +[2021-08-10 15:29:01] [INFO] : ====================================================================================== |
20 | +[2021-08-10 15:29:01] [INFO] : http://test.jmsf.diligrp.com:8385/api/jmsf/ajax/icCheck?ic=888810032426 | ||
41 | None | 21 | None |
42 | -{'params': {'keyword': ''}} | 22 | +{} |
43 | 23 | ||
44 | -[2021-08-06 17:59:03] [INFO] : ====================================================================================== | ||
45 | -[2021-08-06 17:59:03] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | 24 | +[2021-08-10 15:29:01] [INFO] : ====================================================================================== |
25 | +[2021-08-10 15:29:01] [INFO] : http://test.jmsf.diligrp.com:8385/api/jmsf/ajax/city/?name=万州&query=万州 | ||
46 | None | 26 | None |
47 | -{'params': {'pid': 'prove_type'}} | 27 | +{} |
48 | 28 | ||
49 | -[2021-08-06 17:59:04] [INFO] : ====================================================================================== | ||
50 | -[2021-08-06 17:59:04] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/appCommon/duplicateToken.action | ||
51 | -None | 29 | +[2021-08-10 15:29:01] [INFO] : ====================================================================================== |
30 | +[2021-08-10 15:29:01] [INFO] : http://test.jmsf.diligrp.com:8385/calculate/index.action | ||
31 | +{'protocolId': '', 'pwd': '', 'clientRedirectTag': '', 'viewType': 'pay', 'optType': '0', 'optUrl': '', 'correctInfo': '1', 'weightType': '1', 'id': 3793, 'goodsId': '3807', 'number': '202108100900016', 'modified': '2021-08-10 15:29:01', 'status': '2', 'source': '1', 'updateFeeItems': '', 'correctDiscount': '1', 'totalAmount': '', 'customerId': '0', 'fundAccount': '', 'accountId': '', 'ic': '', 'customerName': '', 'customerPhone': '', 'payway': '刷卡', 'plate': '川B00001', 'autocomplete-cartype': '003(板车)', 'carTypeName': '板车', 'carTypeCode': '003', 'carTypeId': '53', 'carTypeWeight': '333', 'storeTareWeight': '', 'proveType': '1621', 'grossWeight': '353', 'tareWeight': '333', 'weight': '20', 'goodsNum': '', 'itemWeight': '', 'productPrice': '1.00000', 'unitPrice': '100.0', 'depName': '接车部', 'calcDepId': '103', 'regionName': '', 'regionId': '0', 'productName': '雪莲果', 'productId': '14158', 'productArea': '重庆,重庆市,万州区', 'parentId': '', 'levelType': '', 'originId': 500101, 'tradeTypeId': '71', 'chargeTotalAmount': '', 'chargeTotalAmountYuan': '', 'freezeMoneySymbol': '', 'comparisonFreezeAmount': '', 'created': '2021-08-10 15:28:37', 'remark': 'false', 'goodsTagIds': '1900', 'shareRatio': '0', 'handlingTeam': '', 'handlingRatio': '', 'handActualAmount': '', 'handManageAmount': '', 'handCollectionAmount': '', 'receivableAmount': '', 'categoryName': '水果', 'categoryId': '14436', 'driverTel': '', 'grossWeightDate': '2021-08-10 15:28:37', 'tareWeightDate': '2021-08-10 15:28:37', 'grossPathName': '', 'grossPathId': '', 'tarePathId': '', 'goodsRemark': '', 'inGreeterName': '通用测试', 'inGreeterId': '274', 'outGreeterId': '', 'sumPrice': '2000', 'shipperName': '', 'shipperId': '', 'shipperPhone': '', 'feeDepName': '', 'calcFeeDepId': ''} | ||
52 | {} | 32 | {} |
53 | 33 | ||
54 | -[2021-08-06 17:59:04] [INFO] : ====================================================================================== | ||
55 | -[2021-08-06 17:59:04] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/wholeCarWeighSave | ||
56 | -{"carTypeCode": "003", "carTypeId": 53, "carTypeName": "\u677f\u8f66", "carTypeWeight": 333, "plate": "\u5dddA12323", "inGreeterId": 223, "inGreeterName": "\u6d4b\u8bd5\u6c88\u9633", "productId": 14152, "productName": "\u852c\u83dc", "proveTypeCode": 665, "proveTypeName": "\u98df\u54c1\u5b89\u5168", "weighRemark": "\u5907\u6ce8", "weighmanRecord": {"grossWeight": 401, "grossWeightDate": "2021-08-06 17:59:04", "newWeight": 68, "tareWeight": 333, "tareWeightDate": null, "weighImgs": []}, "productCode": null, "trailerNumber": "\u5dddA12323", "pathAddress": "A4-BB-6D-0A-F4-13", "haveTruckWeight": false, "source": 4, "entryPlateInputType": 1, "dep": 58, "depName": "\u6c34\u679c\u90e8", "cateId": 14152, "notice": 0, "backSkinTwo": -1, "recordOriginId": 0, "recordOriginName": null, "recordProductId": 0, "recordProductName": null, "recordWeight": null, "codeIc": null, "codeId": 0, "difference": 0, "bindRecordSign": 0, "recordDesc": null, "hasCodeItems": false, "customerId": 0, "customerName": "", "driverIc": null, "driverName": null, "totalPrice": null, "originId": 500101, "origin": "\u4e07\u5dde\u533a", "originCode": "023", "tradeType": "9001", "tradeTypeName": "\u6c88\u96331\u53f7", "weight": 2.0, "pwd": "", "type": 1, "ic": "", "boothNumber": "210728154359", "productState": "1", "accountId": 0, "passCheckId": 0, "passCheckName": null, "tradeTypeId": 70, "id": 0, "protocolId": null, "goodsTagId": 663} | 34 | +[2021-08-10 15:29:02] [INFO] : ====================================================================================== |
35 | +[2021-08-10 15:29:02] [INFO] : http://test.jmsf.diligrp.com:8385/entranceTrade/doPay.action | ||
36 | +protocolId=&pwd=111111&clientRedirectTag=&viewType=pay&optType=0&optUrl=&correctInfo=1&weightType=1&id=3793&goodsId=3807&number=202108100900016&modified=2021-08-10%2015%3A28%3A37&status=2&source=1&updateFeeItems=&correctDiscount=1&totalAmount=800&customerId=389&fundAccount=105847&ic=888810032426&customerName=%E9%95%BF%E6%AD%8C%E4%B9%B0%E5%AE%B6%E7%9C%81%E5%86%85%E5%95%8A%E5%95%8A%E5%95%8A%E5%98%BF&customerPhone=18011501258&payway=%E5%88%B7%E5%8D%A1&plate=%E5%B7%9DB00001&autocomplete-cartype=003%28%E6%9D%BF%E8%BD%A6%29&carTypeName=%E6%9D%BF%E8%BD%A6&carTypeCode=003&carTypeId=53&carTypeWeight=333&storeTareWeight=&proveType=1621&grossWeight=353&tareWeight=333&weight=20&goodsNum=&itemWeight=&productPrice=1.00000&unitPrice=100.0&depName=%E6%8E%A5%E8%BD%A6%E9%83%A8&calcDepId=103&dep=103®ionName=®ionId=72&productName=%E9%9B%AA%E8%8E%B2%E6%9E%9C&productId=14158&productArea=%E9%87%8D%E5%BA%86%2C%E9%87%8D%E5%BA%86%E5%B8%82%2C%E4%B8%87%E5%B7%9E%E5%8C%BA&parentId=&levelType=&originId=500101&tradeTypeId=71&chargeTotalAmount=800&chargeTotalAmountYuan=8&freezeMoneySymbol=13&comparisonFreezeAmount=13&created=2021-08-10%2015%3A28%3A37&remark=&goodsTagIds=1900&marketFlag=sy&totalMoney=800&receivable=1300&collectionPrice=0&discountAmount=500&handReceivableAmount=0&itemReceivableAmount=1300&shareRatio=0&handlingTeam=&handActualAmount=0&handManageAmount=0&handCollectionAmount=0&receivableAmount=1300&categoryName=%E6%B0%B4%E6%9E%9C&categoryId=53&driverTel=&grossWeightDate=2021-08-10%2015%3A28%3A37&tareWeightDate=2021-08-10%2015%3A28%3A37&grossPathName=&grossPathId=&tarePathId=&goodsRemark=&inGreeterName=&inGreeterId=0&outGreeterId=&sumPrice=2000&shipperName=&shipperId=&shipperPhone=&feeDepName=&calcFeeDepId=&feeDepId=&accountId=105847&correctDiscount=1&billItems=&billItemsDic=&billItemCheckIds=103&103=10.00&billItems=%7B%22discount%22%3A500%2C%22id%22%3A103%2C%22name%22%3A%22%E4%BA%A4%E6%98%93%E7%AE%A1%E7%90%86%E8%B4%B9%22%2C%22receivable%22%3A1000%2C%22require%22%3A1%7D&billItemDicCheckIds=105&billItemsDic=%7B%22discount%22%3A0%2C%22id%22%3A105%2C%22name%22%3A%22%E4%BC%98%E6%83%A0%E6%94%B6%E8%B4%B9%22%2C%22receivable%22%3A500%2C%22require%22%3A0%7D&billItemCheckIds=106&106=3.00&billItems=%7B%22discount%22%3A0%2C%22id%22%3A106%2C%22name%22%3A%22%E6%A3%80%E6%B5%8B%E8%B4%B9%22%2C%22receivable%22%3A300%2C%22require%22%3A1%7D | ||
57 | {} | 37 | {} |
58 | 38 |
testcase/test_ZC/demo.html
0 → 100644
1 | +HTTP/1.1 200 | ||
2 | +Server: nginx/1.14.2 | ||
3 | +Date: Fri, 06 Aug 2021 10:26:05 GMT | ||
4 | +Content-Type: text/html;charset=UTF-8 | ||
5 | +Connection: keep-alive | ||
6 | +Access-Control-Expose-Headers: UAP_accessToken | ||
7 | +Cache-Control: no-store | ||
8 | +Content-Language: en-US | ||
9 | +Content-Length: 151406 | ||
10 | + | ||
11 | +<!doctype html> | ||
12 | +<html lang="zh-ch"> | ||
13 | +<head> | ||
14 | + <!-- Required meta tags --> | ||
15 | + <meta charset="utf-8"> | ||
16 | + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
17 | + <!-- Bootstrap CSS --> | ||
18 | + <link rel="stylesheet" href="/resources/bui/lib/bootstrap-4.4.1-dist/css/bootstrap.min.css" > | ||
19 | + <link rel="stylesheet" href="/resources/bui/lib/font-awesome-4.7.0/css/font-awesome.min.css"> | ||
20 | + <link rel="stylesheet" href="/resources/bui/lib/bootstrap4pop/css/bs4.pop.css"> | ||
21 | + <link rel="stylesheet" href="/resources/bui/lib/bootstrap-table/dist/bootstrap-table.min.css"/> | ||
22 | + <link rel="stylesheet" href="/resources/bui/lib/select2-4.0.13/dist/css/select2.min.css"/> | ||
23 | + <link rel="stylesheet" href="/resources/bui/css/common.css"> | ||
24 | + <script src="/resources/bui/lib/jquery/jquery-3.2.1.min.js"></script> | ||
25 | + <script src="/resources/bui/js/datetimer.js"></script> | ||
26 | + <title>bui</title> | ||
27 | + <script> | ||
28 | + let loggerContextPath = 'http://test.logger.diligrp.com:8283'; | ||
29 | + $(function () { $(document).on("change", "input[type=text]:not(:disabled), textarea:not(:disabled)", function () { $(this).val($.trim($(this).val())) }) }) | ||
30 | + // 全局登陆超时拦截 | ||
31 | + $.ajaxSetup({ | ||
32 | + statusCode: { | ||
33 | + 401: function() { | ||
34 | + bs4pop.alert('登陆超时', {type: 'error', closeBtn: false}, function () { | ||
35 | + window.top.postMessage('toLogin','http://test.uap.diligrp.com'); | ||
36 | + }); | ||
37 | + } | ||
38 | + } | ||
39 | + }); | ||
40 | + </script> | ||
41 | +</head> | ||
42 | +<body> | ||
43 | + | ||
44 | +<style> | ||
45 | + .container-fluid { | ||
46 | + font-weight: 700; | ||
47 | + } | ||
48 | + | ||
49 | + .container-fluid, | ||
50 | + .form-control, | ||
51 | + .btn, | ||
52 | + .input-group-text { | ||
53 | + font-size: 18px; | ||
54 | + } | ||
55 | + .freezePriceError{ | ||
56 | + width: 100%; | ||
57 | + margin-top: .25rem; | ||
58 | + font-size: 80%; | ||
59 | + color: #dc3545; | ||
60 | + } | ||
61 | +</style> | ||
62 | +<!-- main-container start --> | ||
63 | +<div class="container-fluid"> | ||
64 | + <form class="form-search form-add" role="form" id="feeForm" targetId="3769"> | ||
65 | + <input type="hidden" name="protocolId" id="protocolId" value=""> | ||
66 | + <input type="hidden" name="pwd" value="" id="pwd"> | ||
67 | + <input type="hidden" id="clientRedirectTag" name="clientRedirectTag" value=""> | ||
68 | + <input type="hidden" id="viewType" name="viewType" value="pay"> | ||
69 | + <input type="hidden" id="optType" name="optType" value="0"> | ||
70 | + <input type="hidden" id="optUrl" name="optUrl" value=""> | ||
71 | + <input type="hidden" id="correctInfo" name="correctInfo" value="1"> | ||
72 | + | ||
73 | + <input type="hidden" name="weightType" id="weightType" value="1"> | ||
74 | + <input type="hidden" name="id" id="idFee" value="3769"> | ||
75 | + <input type="hidden" name="goodsId" id="goodsId" value="3783"> | ||
76 | + <input type="hidden" name="number" id="number" value="202108060900043"> | ||
77 | + <input type="hidden" id="modified" name="modified" value="2021-08-06 18:25:36"> | ||
78 | + <input type="hidden" id="status" name="status" value="2"> | ||
79 | + | ||
80 | + <input type="hidden" id="operatorName" value="沈阳"> | ||
81 | + <input type="hidden" id="tollName" value=""> | ||
82 | + <input type="hidden" id="source" name="source" value="1"> | ||
83 | + <input type="hidden" id="updateFeeItems" name="updateFeeItems" value=""> | ||
84 | + <input type="hidden" id="correctDiscount" name="correctDiscount" value="1"> | ||
85 | + <input type="hidden" id="market_short" value="$!codeUtil.getByDdNotes(8000)"> | ||
86 | + | ||
87 | + <h5 class="row row-cols-6 red ml-2"> | ||
88 | + <strong class="fz16">车号川B00001</strong> | ||
89 | + <strong class="fz16">收费单号202108060900043</strong> | ||
90 | + <strong class="fz16">总金额<span id="totalAmountSymbol" class="bold"></span></strong> | ||
91 | + <input type="hidden" name="totalAmount" id="totalAmount"> | ||
92 | + <input type="hidden" name="" id="totalAmountYuan"> | ||
93 | + </h5> | ||
94 | + <div class="breadcrumb"> | ||
95 | + 基础信息 | ||
96 | + <a href="javascript:;" class="ml-auto" data-toggle="collapse" data-target="#baseInfo" | ||
97 | + aria-expanded="true" aria-controls="baseInfo">收起 <i class="fa fa-angle-double-up" | ||
98 | + aria-hidden="true"></i></a> | ||
99 | + </div> | ||
100 | + <div class="row row-cols-6 collapse show form-group-wrap" id="baseInfo"> | ||
101 | + <div class="form-group col-4"> | ||
102 | + <label class=" text-primary">客户卡号∗</label> | ||
103 | + <input type="hidden" name="customerId" value="0" id="customerId"> | ||
104 | + <input type="hidden" name="fundAccount" value="" id="fundAccount"> | ||
105 | + <input type="hidden" name="accountId" value="" id="accountId"> | ||
106 | + <div class="input-group"> | ||
107 | + <input type="text" class="form-control " name="ic" id="ic" maxlength="14" value="" title="" onkeyup="onKeyUpEnter(event)" required> | ||
108 | + <div class="input-group-prepend"> | ||
109 | + <span class="input-group-text card-btn text-primary getidcard" id="icReader"><a href="javascript:;">园区卡</a></span> | ||
110 | + </div> | ||
111 | + <span class="input-group-text card-btn red getidcard" id="bankReader"><a href="javascript:;">银行卡</a></span> | ||
112 | + </div> | ||
113 | + </div> | ||
114 | + <div class="form-group col"> | ||
115 | + <label>客户姓名</label> | ||
116 | + <input type="text" name="customerName" id="customerName" class="form-control" readonly value=""> | ||
117 | + </div> | ||
118 | + <div class="form-group col"> | ||
119 | + <label>手机号码</label> | ||
120 | + <input type="text" name="customerPhone" id="customerPhone" class="form-control " readonly | ||
121 | + value=""> | ||
122 | + </div> | ||
123 | + <div class="form-group col"> | ||
124 | + <label>卡余额</label> | ||
125 | + <input type="text" class="form-control red bold fz17" value="" | ||
126 | + title="" id="balance" size="11" readonly> | ||
127 | + </div> | ||
128 | + | ||
129 | + <div class="form-group col red"> | ||
130 | + <label class="text-right ">支付方式</label> | ||
131 | + <input type="text" name="payway" class="form-control" readonly value="刷卡"> | ||
132 | + </div> | ||
133 | + | ||
134 | + <div class="form-group col"> | ||
135 | + <label>车号</label> | ||
136 | + <input type="text" name="plate" class="form-control" value="川B00001" id="plate"> | ||
137 | + </div> | ||
138 | + <div class="form-group col"> | ||
139 | + <label>挂号</label> | ||
140 | + <input type="text" class="form-control" id="trailerNumber" value="川B00001"> | ||
141 | + </div> | ||
142 | + | ||
143 | + <div class="form-group col"> | ||
144 | + <label class="text-right text-primary" tlog>车型*</label> | ||
145 | + <input type="text" tlog class="form-control" name="autocomplete-cartype" value="003(板车)" /> | ||
146 | + <input type="hidden" name="carTypeName" id="carTypeName" value="板车" /> | ||
147 | + <input type="hidden" name="carTypeCode" id="carTypeCode" value="003" /> | ||
148 | + <input type="hidden" name="carTypeId" id="carTypeId" value="53" /> | ||
149 | + <label class="error defi-error red" id="autocomplete-cartype-error"></label> | ||
150 | + </div> | ||
151 | + <div class="form-group col"> | ||
152 | + <label>车型自重</label> | ||
153 | + <input type="text" class="form-control" name="carTypeWeight" readonly id="ctypew" | ||
154 | + value="333"> | ||
155 | + </div> | ||
156 | + <div class="form-group col"> | ||
157 | + <label>存皮重量</label> | ||
158 | + <input type="text" class="form-control" name="storeTareWeight" readonly value=""> | ||
159 | + </div> | ||
160 | + <div class="form-group col"> | ||
161 | + <label>证明类型</label> | ||
162 | + <input type="hidden" class="form-control" readonly value="1621" id="proveType" name="proveType"> | ||
163 | + <input type="text" class="form-control" readonly value="绿色蔬菜" id="proveTypeName"> | ||
164 | + | ||
165 | + </div> | ||
166 | + <div class="form-group col text-primary"> | ||
167 | + <label tlog>毛重 ∗ </label> | ||
168 | + <input required type="text" tlog class="form-control" name="grossWeight" id="grossWeight" value="353" > | ||
169 | + <label class="error defi-error" id="grossWeighterror"></label> | ||
170 | + </div> | ||
171 | + <div class="form-group col"> | ||
172 | + <label tlog>皮重 ∗ </label> | ||
173 | + <input type="text" required class="form-control" name="tareWeight" id="tareWeight" value="333" > | ||
174 | + <label class="error defi-error red" id="tareWeighterror"></label> | ||
175 | + </div> | ||
176 | + <div class="form-group col"> | ||
177 | + <label tlog>净重</label> | ||
178 | + <input type="text" class="form-control " readonly name="weight" readonly value="20" id="weight"> | ||
179 | + </div> | ||
180 | + <div class="form-group col"> | ||
181 | + <label tlog>件数</label> | ||
182 | + <input type="text" class="form-control isInt" range="0 999999" name="goodsNum" id="goodsNum" value="" readonly > | ||
183 | + </div> | ||
184 | + <div class="form-group col"> | ||
185 | + <label tlog>件重</label> | ||
186 | + <input type="text" class="form-control isInt" range="0 999999" name="itemWeight" | ||
187 | + id="itemWeight" value="" readonly > | ||
188 | + </div> | ||
189 | + <div class="form-group col text-primary"> | ||
190 | + <label>单价</label> | ||
191 | + <input type="text" class="form-control" readonly value="1.00000" name="productPrice"id="unitPriceSymbol"> | ||
192 | + <input type="hidden" name="unitPrice" value="100.0" id="unitPrice"> | ||
193 | + </div> | ||
194 | + <!--hr ----> | ||
195 | + <div class="form-group col"> | ||
196 | + <label>接车部门∗</label> | ||
197 | + <input type="hidden" id="depName" name="depName" value="接车部"> | ||
198 | + <input type="hidden" name="calcDepId" value="103"> | ||
199 | + | ||
200 | + <select id="dep" name="dep" class="form-control" ></select> | ||
201 | +<script> | ||
202 | + $(function () { | ||
203 | + //_logTable 动态标签元素计数器 | ||
204 | + let $table = $('#dep').parents('[_logTable]'); | ||
205 | + if(typeof(Log) !== 'undefined' && $table.length > 0){ | ||
206 | + if(typeof(Log.tableItemTagCount) == 'undefined'){ | ||
207 | + Log.tableItemTagCount = 0; | ||
208 | + } | ||
209 | + ++Log.tableItemTagCount; | ||
210 | + } | ||
211 | + | ||
212 | + let option = $.extend( | ||
213 | + {}, | ||
214 | + {} | ||
215 | + ); | ||
216 | + $.ajax($.extend(true,{ | ||
217 | + type: "post", | ||
218 | + url: '/provider/getLookupList.action', | ||
219 | + data: { | ||
220 | + provider: 'departmentProvider', | ||
221 | + queryParams: '{emptyText:"请选择",required:"true"}' | ||
222 | + }, | ||
223 | + dataType: "json", | ||
224 | + success: function (result) { | ||
225 | + let data; | ||
226 | + if(result instanceof Array){ | ||
227 | + data = result; | ||
228 | + }else if (typeof (result) == 'object') { | ||
229 | + if(result.success){ | ||
230 | + data = result.data; | ||
231 | + }else{ | ||
232 | + bs4pop.alert(result.message, {type: 'error'}); | ||
233 | + return; | ||
234 | + } | ||
235 | + } | ||
236 | + | ||
237 | + $.map(data, function (dataItem) { | ||
238 | + $('#dep').append(template('optionItem', $.extend(dataItem, { | ||
239 | + selected: '103' == dataItem.value + '', | ||
240 | + value:dataItem["value"], | ||
241 | + text:dataItem["text"] | ||
242 | + }))); | ||
243 | + }); | ||
244 | + | ||
245 | + | ||
246 | + option.onLoadSuccess && option.onLoadSuccess(data); | ||
247 | + }, | ||
248 | + error: function () { | ||
249 | + console.log('数据接口异常'); | ||
250 | + } | ||
251 | + },option)); | ||
252 | + }) | ||
253 | +</script> | ||
254 | + | ||
255 | + </div> | ||
256 | + <div class="form-group col-4"> | ||
257 | + <label tlog>货区∗</label> | ||
258 | + | ||
259 | + <input type="hidden" id="regionName" name="regionName" value="" > | ||
260 | + <div class="input-group"> | ||
261 | + <input type="text" class="form-control district-no" value=""> | ||
262 | + <select name="regionId" class="form-control district-name" required tlog id="district" autocomplete='off'> | ||
263 | + <option value="0">--请选择--</option> | ||
264 | + <option value="72" bind-name="A1区" bind-index="001" >001|A1区</option> | ||
265 | + <option value="96" bind-name="TTR" bind-index="9007" >9007|TTR</option> | ||
266 | + <option value="200" bind-name="yesbug" bind-index="yesb" >yesb|yesbug</option> | ||
267 | + <option value="213" bind-name="区域0419" bind-index="0419" >0419|区域0419</option> | ||
268 | + <option value="240" bind-name="A1yfc区域1" bind-index="A1yf" >A1yf|A1yfc区域1</option> | ||
269 | + </select> | ||
270 | + </div> | ||
271 | + | ||
272 | + </div> | ||
273 | + <div class="form-group col text-primary"> | ||
274 | + <label tlog>商品*</label> | ||
275 | + | ||
276 | + <input type="text" tlog required class="form-control" readonly name="productName" value="雪莲果"> | ||
277 | + <input type="hidden" name="productId" id="productId" value="14158"> | ||
278 | + </div> | ||
279 | + <div class="form-group col"> | ||
280 | + <label>货物产地∗</label> | ||
281 | + <input type="text" name="productArea" id="productArea" class="form-control" value="重庆,重庆市,万州区"required /> | ||
282 | + <label class="error defi-error"></label> | ||
283 | + <input type="hidden" name="parentId" id="parentId" value=""> | ||
284 | + <input type="hidden" name="levelType" id="levelType" value=""> | ||
285 | + <input type="hidden" name="originId" id="originId" value="500101"> | ||
286 | + </div> | ||
287 | + <div> | ||
288 | + <label>交易类型</label> | ||
289 | + | ||
290 | + | ||
291 | + <input type="text" class="form-control" readonly value="沈阳2号" > | ||
292 | + <input type="hidden" class="form-control" name="tradeTypeId" value="71" > | ||
293 | + </div> | ||
294 | + <div class="form-group col"> | ||
295 | + <label>有无摊位</label> | ||
296 | + <input type="text" class="form-control" readonly value="无" id="goodsAllocation"> | ||
297 | + </div> | ||
298 | + <!--hr---> | ||
299 | + <div class="form-group col"> | ||
300 | + <label>收费总额</label> | ||
301 | + <div class="input-group"> | ||
302 | + <input type="text" id="chargeTotalAmountSymbol" class="form-control red bold fz17" size="11" | ||
303 | + readonly value="434.00"> | ||
304 | + <input type="hidden" id="chargeTotalAmount" name="chargeTotalAmount"> | ||
305 | + <input type="hidden" id="chargeTotalAmountYuan" name="chargeTotalAmountYuan"> | ||
306 | + <div class="input-group-prepend" id="cal"> | ||
307 | + <span class="input-group-text calculate text-primary font-weight-bold"><a href="javascript:;" >计算</a></span> | ||
308 | + </div> | ||
309 | + | ||
310 | + </div> | ||
311 | + </div> | ||
312 | + <div class="form-group col"> | ||
313 | + <input type="hidden" id="printViewYuan" value="0"> | ||
314 | + <input type="hidden" id="printViewSymbol" value="0"> | ||
315 | + <label>冻结金额*</label> | ||
316 | + <input name="freezeMoneySymbol" type="text" id="freezeMoneySymbol" class="form-control red bold fz17 isIntRMB" required value=""> | ||
317 | + <input type="hidden" id="freezePriceVal" name="comparisonFreezeAmount"> | ||
318 | + <label class="freezePriceError" id="freezePriceError"></label> | ||
319 | + </div> | ||
320 | + <div class="form-group col"> | ||
321 | + <label>状态</label> | ||
322 | + <input type="text" class="form-control" name="" readonly id="" value="待交费"> | ||
323 | + </div> | ||
324 | + <div class="form-group col"> | ||
325 | + <label>进场时间</label> | ||
326 | + <input type="text" class="form-control" readonly name="created" | ||
327 | + value="2021-08-06 18:25:36"> | ||
328 | + </div> | ||
329 | + <div class="form-group col"> | ||
330 | + <label>收费时间</label> | ||
331 | + <input type="text" class="form-control" name="" readonly value=""> | ||
332 | + </div> | ||
333 | + <!--hr---> | ||
334 | + <div class="form-group col"> | ||
335 | + <label>收费员</label> | ||
336 | + <input type="text" class="form-control" name="" readonly value=""> | ||
337 | + </div> | ||
338 | + <div class="form-group col"> | ||
339 | + <label>二次回皮</label> | ||
340 | + | ||
341 | + <input type="text" class="form-control" readonly value="否"> | ||
342 | + | ||
343 | + </div> | ||
344 | + <div class="form-group col"> | ||
345 | + <label>持卡人</label> | ||
346 | + <input type="text" class="form-control" name="" readonly value=""> | ||
347 | + </div> | ||
348 | + <div class="form-group col"> | ||
349 | + <label>持卡人电话</label> | ||
350 | + <input type="text" class="form-control" name="" readonly value=""> | ||
351 | + </div> | ||
352 | + <div class="form-group col-4"> | ||
353 | + <label tlog>备注</label> | ||
354 | + <textarea class="form-control" id="remark" cols="30" rows="1" tlog maxlength="50" name="remark" | ||
355 | + title="备注">备注</textarea> | ||
356 | + </div> | ||
357 | + <!--hr---> | ||
358 | + <div class="col-12"> | ||
359 | + <label>货物标签</label> | ||
360 | + <input type="hidden" id="tags" value="货物标签测试"> | ||
361 | + | ||
362 | + | ||
363 | + | ||
364 | + <div class="checkbox goods-tags"> | ||
365 | + <label >有机食品 </label> | ||
366 | + <label >无 </label> | ||
367 | + <label ><input name="goodsTagIds" type="radio" value="1900" readonly checked>货物标签测试</label> | ||
368 | + </div> | ||
369 | + | ||
370 | + | ||
371 | + | ||
372 | + | ||
373 | + </div> | ||
374 | + | ||
375 | + | ||
376 | + </div> | ||
377 | + <!--hr---> | ||
378 | + <div class="breadcrumb"> | ||
379 | + 装卸费用 | ||
380 | + <a href="javascript:;" class="ml-auto" data-toggle="collapse" data-target="#steveInfo" | ||
381 | + aria-expanded="true" aria-controls="steveInfo">收起 <i class="fa fa-angle-double-up" | ||
382 | + aria-hidden="true"></i></a> | ||
383 | + </div> | ||
384 | + <div class="row row-cols-6 collapse show form-group-wrap" id="steveInfo"> | ||
385 | + <div class="form-group col text-primary"> | ||
386 | + <label>装卸队</label> | ||
387 | + <input type="hidden" id="shareRatioVal" name="shareRatio" value="0"> | ||
388 | + <input type="hidden" id="handlingTeam" name="handlingTeam" value=""> | ||
389 | + <input type="hidden" id="steveTeamId" value=""> | ||
390 | + <select name="handlingTeamId" id="steveTeams" class="form-control"></select> | ||
391 | + | ||
392 | + <input type="hidden" id="steveTeamIdSelect" value="1"> | ||
393 | + <label class="steveTeamIdError" id="steveTeamIdError"></label> | ||
394 | + </div> | ||
395 | + <div class="form-group col text-primary"> | ||
396 | + <label>卸货比例</label> | ||
397 | + <input type="hidden" id="handlingRatioVal" value=""> | ||
398 | + <input type="hidden" id="handlingRatioOld" value=""> | ||
399 | + <select name="handlingRatio" id="handlingRatio" class="form-control"> | ||
400 | + <option value="">请选择</option> | ||
401 | + <option value="0" >0%</option> | ||
402 | + | ||
403 | + <option class="handlingRatioHidden" value="10">10%</option> | ||
404 | + <option class="handlingRatioHidden" value="20">20%</option> | ||
405 | + <option class="handlingRatioHidden" value="30">30%</option> | ||
406 | + <option class="handlingRatioHidden" value="40">40%</option> | ||
407 | + <option class="handlingRatioHidden" value="50">50%</option> | ||
408 | + <option class="handlingRatioHidden" value="60">60%</option> | ||
409 | + <option class="handlingRatioHidden" value="70">70%</option> | ||
410 | + <option class="handlingRatioHidden" value="80">80%</option> | ||
411 | + <option class="handlingRatioHidden" value="90"> 90%</option> | ||
412 | + | ||
413 | + <option value="100" >100%</option> | ||
414 | + </select> | ||
415 | + </div> | ||
416 | + <div class="form-group col"> | ||
417 | + <label>装卸费</label> | ||
418 | + <input type="text" id="handActualAmountSymbol" class="form-control" readonly value=""> | ||
419 | + <input type="hidden" id="handActualAmount" name="handActualAmount" value=""> | ||
420 | + </div> | ||
421 | + <div class="form-group col"> | ||
422 | + <label>应收装卸费</label> | ||
423 | + <input type="text" id="handReceivableAmountSymbol" class="form-control" readonly value=""> | ||
424 | + </div> | ||
425 | + <div class="form-group col"> | ||
426 | + <label>装卸管理费</label> | ||
427 | + <input type="text" id="handManageAmountSymbol" class="form-control" readonly value=""> | ||
428 | + <input type="hidden" id="handManageAmount" name="handManageAmount"> | ||
429 | + </div> | ||
430 | + <div class="form-group col"> | ||
431 | + <label>代收装卸费</label> | ||
432 | + <input type="text" id="handCollectionAmountSymbol" class="form-control" readonly value=""> | ||
433 | + <input type="hidden" id="handCollectionAmount" name="handCollectionAmount"> | ||
434 | + </div> | ||
435 | + | ||
436 | + <!--hr---> | ||
437 | + <div class="col-12 feeitemedit" id="feeitemedit"> | ||
438 | + </div> | ||
439 | + </div> | ||
440 | + <!---hr---> | ||
441 | + <div class="breadcrumb"> | ||
442 | + 其他信息 | ||
443 | + <a href="javascript:;" class="ml-auto" data-toggle="collapse" data-target="#otherInfo" | ||
444 | + aria-expanded="true" aria-controls="otherInfo">收起 <i class="fa fa-angle-double-up"aria-hidden="true"></i></a> | ||
445 | + </div> | ||
446 | + <div class="row row-cols-6 collapse show form-group-wrap height0" id="otherInfo"> | ||
447 | + <div class="form-group col"> | ||
448 | + <label>应收金额</label> | ||
449 | + <input type="text" id="receivableAmountSymbol" class="form-control red bold fz17" | ||
450 | + value="" readonly> | ||
451 | + <input name="receivableAmount" type="hidden" id="receivableAmount"> | ||
452 | + </div> | ||
453 | + <div class="form-group col"> | ||
454 | + <label class="text-right red">优惠金额</label> | ||
455 | + <input type="text" id="discountAmountSymbol" class="form-control red bold fz17" readonly | ||
456 | + value="-"> | ||
457 | + </div> | ||
458 | + <div class="form-group col"> | ||
459 | + | ||
460 | + <label>返点金额</label> | ||
461 | + | ||
462 | + <input type="text" id="collectionAmountSymbol" class="form-control red bold fz17" readonly | ||
463 | + value=""> | ||
464 | + </div> | ||
465 | + | ||
466 | + <div class="form-group col"> | ||
467 | + <label>商品品类</label> | ||
468 | + <input type="text" class="form-control" name="categoryName" id="parentName" readonly | ||
469 | + value="水果"> | ||
470 | + <input type="hidden" class="form-control" name="categoryId" id="categoryId" | ||
471 | + value="14436"> | ||
472 | + </div> | ||
473 | + <div class="form-group col"> | ||
474 | + <label>司机手机</label> | ||
475 | + <input type="text" class="form-control " readonly name="driverTel" value=""> | ||
476 | + </div> | ||
477 | + <div class="form-group col"> | ||
478 | + <label>称重员</label> | ||
479 | + <input type="text" class="form-control" readonly value="沈阳"> | ||
480 | + </div> | ||
481 | + <!---hr ---> | ||
482 | + <div class="form-group col"> | ||
483 | + <label>称重类型</label> | ||
484 | + <input type="text" class="form-control" readonly value="整车称重"> | ||
485 | + </div> | ||
486 | + <div class="form-group col"> | ||
487 | + <label>毛重时间</label> | ||
488 | + <input type="text" class="form-control" readonly name="grossWeightDate" value="2021-08-06 18:25:36" > | ||
489 | + | ||
490 | + </div> | ||
491 | + <div class="form-group col"> | ||
492 | + <label>皮重时间</label> | ||
493 | + <input type="text" class="form-control " readonly name="tareWeightDate" value="2021-08-06 18:25:36"> | ||
494 | + </div> | ||
495 | + <div class="form-group col"> | ||
496 | + <label>毛重通道</label> | ||
497 | + <input type="text" name="grossPathName" class="form-control" readonly value=""> | ||
498 | + <input type="hidden" name="grossPathId" class="form-control" readonly value=""> | ||
499 | + </div> | ||
500 | + <div class="form-group col"> | ||
501 | + <label>皮重通道</label> | ||
502 | + <input type="text" class="form-control" readonly value=""> | ||
503 | + <input type="hidden" name="tarePathId" class="form-control" readonly value=""> | ||
504 | + </div> | ||
505 | + <div class="form-group col"> | ||
506 | + <label>皮重员</label> | ||
507 | + <input type="text" class="form-control" readonly value=""> | ||
508 | + </div> | ||
509 | + <!---hr---> | ||
510 | + <div class="form-group col"> | ||
511 | + <label>带货回皮</label> | ||
512 | + | ||
513 | + <input type="text" class="form-control" readonly value="否"> | ||
514 | + | ||
515 | + </div> | ||
516 | + | ||
517 | + <div class="form-group col-4"> | ||
518 | + <label tlog>称重备注</label> | ||
519 | + <textarea class="form-control" cols="30" rows="1" maxlength="50" id="goodsRemark" name="goodsRemark" | ||
520 | + title="备注" >备注</textarea> | ||
521 | + </div> | ||
522 | + <div class="form-group col"> | ||
523 | + <label class="text-right text-primary" tlog>进门接车员</label> | ||
524 | + <input type="text" class="form-control" tlog name="inGreeterName" | ||
525 | + id="inGreeterName" value="通用测试"> | ||
526 | + <input type="hidden" name="inGreeterId" id="inGreeterId" value="274"> | ||
527 | + <label class="error defi-error"></label> | ||
528 | + </div> | ||
529 | + <div class="form-group col"> | ||
530 | + <label tlog>出门接车员</label> | ||
531 | + <input type="text" class="form-control" tlog name="outGreeterName" id="outGreeterName" | ||
532 | + value=""> | ||
533 | + <input type="hidden" name="outGreeterId" id="outGreeterId" value=""> | ||
534 | + <label class="error defi-error"></label> | ||
535 | + </div> | ||
536 | + <div class="col"> | ||
537 | + <a href="javascript:viewImgNew();" class="lookPound ml-2">查看称重图片</a> | ||
538 | + <input type="hidden" id="imgs" value='[]'> | ||
539 | + </div> | ||
540 | + <!----hr --> | ||
541 | + <div class="form-group col"> | ||
542 | + <label>交易额</label> | ||
543 | + <input type="text" id="sumPriceSymbol" class="form-control" readonly value="20.00"> | ||
544 | + <input type="hidden" name="sumPrice" value="2000" id="sumPrice"> | ||
545 | + </div> | ||
546 | + | ||
547 | + <div class="form-group col"> | ||
548 | + <label>货主姓名</label> | ||
549 | + <input type="text" name="shipperName" id="goodsCusName" class="form-control" maxlength="22" | ||
550 | + value=""> | ||
551 | + <input type="hidden" name="shipperId" id="shipperId" value=""> | ||
552 | + </div> | ||
553 | + <div class="form-group col"> | ||
554 | + <label>货主手机</label> | ||
555 | + <input type="text" name="shipperPhone" id="goodsCusTel" class="form-control isMobile" | ||
556 | + value=""> | ||
557 | + </div> | ||
558 | + <div class="form-group col"> | ||
559 | + <label>收费部门</label> | ||
560 | + <input type="hidden" id="feeDepName" name="feeDepName" value=""> | ||
561 | + <input type="hidden" name="calcFeeDepId" value=""> | ||
562 | + <select id="feeDepId" name="feeDepId" class="form-control" ></select> | ||
563 | +<script> | ||
564 | + $(function () { | ||
565 | + //_logTable 动态标签元素计数器 | ||
566 | + let $table = $('#feeDepId').parents('[_logTable]'); | ||
567 | + if(typeof(Log) !== 'undefined' && $table.length > 0){ | ||
568 | + if(typeof(Log.tableItemTagCount) == 'undefined'){ | ||
569 | + Log.tableItemTagCount = 0; | ||
570 | + } | ||
571 | + ++Log.tableItemTagCount; | ||
572 | + } | ||
573 | + | ||
574 | + let option = $.extend( | ||
575 | + {}, | ||
576 | + {} | ||
577 | + ); | ||
578 | + $.ajax($.extend(true,{ | ||
579 | + type: "post", | ||
580 | + url: '/provider/getLookupList.action', | ||
581 | + data: { | ||
582 | + provider: 'departmentProvider', | ||
583 | + queryParams: '{required:false}' | ||
584 | + }, | ||
585 | + dataType: "json", | ||
586 | + success: function (result) { | ||
587 | + let data; | ||
588 | + if(result instanceof Array){ | ||
589 | + data = result; | ||
590 | + }else if (typeof (result) == 'object') { | ||
591 | + if(result.success){ | ||
592 | + data = result.data; | ||
593 | + }else{ | ||
594 | + bs4pop.alert(result.message, {type: 'error'}); | ||
595 | + return; | ||
596 | + } | ||
597 | + } | ||
598 | + | ||
599 | + $.map(data, function (dataItem) { | ||
600 | + $('#feeDepId').append(template('optionItem', $.extend(dataItem, { | ||
601 | + selected: '' == dataItem.value + '', | ||
602 | + value:dataItem["value"], | ||
603 | + text:dataItem["text"] | ||
604 | + }))); | ||
605 | + }); | ||
606 | + | ||
607 | + | ||
608 | + option.onLoadSuccess && option.onLoadSuccess(data); | ||
609 | + }, | ||
610 | + error: function () { | ||
611 | + console.log('数据接口异常'); | ||
612 | + } | ||
613 | + },option)); | ||
614 | + }) | ||
615 | +</script> | ||
616 | + </div> | ||
617 | + </div> | ||
618 | +</div> | ||
619 | +</form> | ||
620 | +</div> | ||
621 | + | ||
622 | +<!-- Optional JavaScript --> | ||
623 | +<!-- jQuery first, then Popper.js, then Bootstrap JS --> | ||
624 | +<script src="/resources/bui/lib/bootstrap-4.4.1-dist/js/bootstrap.bundle.min.js"></script> | ||
625 | +<script src="/resources/bui/lib/bootstrap4pop/js/bs4.pop.js"></script> | ||
626 | +<script src="/resources/bui/lib/bootstrap-table/dist/bootstrap-table.min.js"></script> | ||
627 | +<script src="/resources/bui/lib/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script> | ||
628 | +<script src="/resources/bui/lib/laydate/laydate.js"></script> | ||
629 | +<script src="/resources/bui/lib/jquery-validation-1.19.1/jquery.validate.min.js"></script> | ||
630 | +<script src="/resources/bui/lib/jquery-validation-1.19.1/jquery.validate-extend.js"></script> | ||
631 | +<script src="/resources/bui/lib/jquery/jquery.autocomplete.min.js"></script> | ||
632 | +<script src="/resources/bui/lib/select2-4.0.13/dist/js/select2.full.min.js"></script> | ||
633 | +<script src="/resources/bui/lib/select2-4.0.13/dist/js/i18n/zh-CN.js"></script> | ||
634 | +<script src="/resources/bui/lib/moment/moment-with-locales.min.js"></script> | ||
635 | +<script src="/resources/bui/lib/vendor/art-template.js"></script> | ||
636 | +<script src="/resources/bui/lib/log/logger.js"></script> | ||
637 | +<script src="/resources/bui/js/common.js"></script> | ||
638 | +<script src="/resources/bui/js/global.js"></script> | ||
639 | +</body> | ||
640 | +<script id="radioItem" type="text/html"> | ||
641 | + <div class="custom-control custom-radio custom-control-inline"> | ||
642 | + <input type="radio" {{_log?index == 0? '_log='+_log : '' : ''}} id="r_{{containerId}}{{value}}" value="{{value}}" name="{{name}}" class="custom-control-input" {{checked ? | ||
643 | + 'checked':''}} {{required ? 'required':''}}> | ||
644 | + <label class="custom-control-label" for="r_{{containerId}}{{value}}">{{text}}</label> | ||
645 | + </div> | ||
646 | +</script> | ||
647 | +<script id="checkboxItem" type="text/html"> | ||
648 | + <div class="custom-control custom-checkbox custom-control-inline"> | ||
649 | + <input type="checkbox" {{_log?index == 0? '_log='+_log : '' : ''}} id="c_{{containerId}}{{value}}" value="{{value}}" name="{{name}}" class="custom-control-input" {{checked | ||
650 | + ? 'checked':''}} {{required ? 'required':''}}> | ||
651 | + <label class="custom-control-label" for="c_{{containerId}}{{value}}">{{text}}</label> | ||
652 | + </div> | ||
653 | +</script> | ||
654 | +<script id="optionItem" type="text/html"> | ||
655 | + <option value="{{value}}" {{selected ? 'selected':''}}>{{text}}</option> | ||
656 | +</script> | ||
657 | +<script type="text/javascript"> | ||
658 | + /*********************************************** 页面组件驱动执行 begin ***********************************************************/ | ||
659 | + $(function () { | ||
660 | + //表单jquery对象获取提交字段的json信息 | ||
661 | + $.fn.serializeObject = function (containsNull) { | ||
662 | + var o = {}; | ||
663 | + var a = this.serializeArray(); | ||
664 | + $.each(a, function () { | ||
665 | + if (o[this.name] !== undefined) { | ||
666 | + if (!o[this.name].push && o[this.name] != null && o[this.name] != "") { | ||
667 | + o[this.name] = [o[this.name]]; | ||
668 | + o[this.name].push(this.value || ''); | ||
669 | + } else if (this.value != null) { | ||
670 | + o[this.name].push(this.value || ''); | ||
671 | + } else { | ||
672 | + if (containsNull && containsNull == true) { | ||
673 | + o[this.name].push(''); | ||
674 | + } | ||
675 | + } | ||
676 | + } else { | ||
677 | + if (this.value != null && this.value != "") { | ||
678 | + o[this.name] = this.value || ''; | ||
679 | + } else { | ||
680 | + if (containsNull && containsNull == true) { | ||
681 | + o[this.name] = ''; | ||
682 | + } | ||
683 | + } | ||
684 | + } | ||
685 | + }); | ||
686 | + return o; | ||
687 | + }; | ||
688 | + | ||
689 | + $('.date').each(function () { | ||
690 | + let self = this; | ||
691 | + laydate.render({ | ||
692 | + elem: self,//或 elem: document.getElementById('test')、elem: lay('#test') 等 | ||
693 | + type: 'datetime', | ||
694 | + theme: '#007bff', | ||
695 | + trigger:'click' | ||
696 | + }); | ||
697 | + }); | ||
698 | + }); | ||
699 | + /*********************************************** 页面组件驱动执行 end ***********************************************************/ | ||
700 | + | ||
701 | + /*********************************************** 页面组件变量及处理函数 begin ***********************************************************/ | ||
702 | + var bui = (function () { | ||
703 | + /** | ||
704 | + * table button icon | ||
705 | + * **/ | ||
706 | + let icons = { | ||
707 | + paginationSwitchDown: 'fa-caret-square-o-down', | ||
708 | + paginationSwitchUp: 'fa-caret-square-o-up', | ||
709 | + refresh: 'fa-refresh', | ||
710 | + toggleOff: 'fa-toggle-off', | ||
711 | + toggleOn: 'fa-toggle-on', | ||
712 | + columns: 'fa-th-list', | ||
713 | + fullscreen: 'fa-arrows-alt', | ||
714 | + detailOpen: 'fa-plus', | ||
715 | + detailClose: 'fa-minus', | ||
716 | + export: 'fa-download' | ||
717 | + }; | ||
718 | + | ||
719 | + | ||
720 | + let loading = (function () { | ||
721 | + //弹出加载层 | ||
722 | + function show(text) { | ||
723 | + $("#loading-text").text(text || "loading..."); | ||
724 | + $("#loading").show(); | ||
725 | + } | ||
726 | + | ||
727 | + //取消加载层 | ||
728 | + function hide() { | ||
729 | + $("#loading").hide(); | ||
730 | + } | ||
731 | + | ||
732 | + function initLoading() { | ||
733 | + $("body").append(` | ||
734 | + <div id="loading" class="loading" style="display: none;"> | ||
735 | + <div class="cover"></div> | ||
736 | + <aside class="loading-wrapper"> | ||
737 | + <div> | ||
738 | + <div class="loading-animation"> | ||
739 | + <span></span> | ||
740 | + <span></span> | ||
741 | + <span></span> | ||
742 | + <span></span> | ||
743 | + <span></span> | ||
744 | + </div> | ||
745 | + <div><span id="loading-text"></span></div> | ||
746 | + </div> | ||
747 | + </aside> | ||
748 | + </div>` | ||
749 | + ); | ||
750 | + } | ||
751 | + | ||
752 | + //初始化遮罩层 | ||
753 | + initLoading(); | ||
754 | + return {show, hide}; | ||
755 | + })(); | ||
756 | + | ||
757 | + /******************************** excel导出函数定义 begin *********************************/ | ||
758 | + let bexport = (function () { | ||
759 | + function S4() { | ||
760 | + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||
761 | + }; | ||
762 | + | ||
763 | + //token生成器 | ||
764 | + function guid() { | ||
765 | + return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||
766 | + }; | ||
767 | + | ||
768 | + //通过token判断导出是否完成 | ||
769 | + function checkFinished(token) { | ||
770 | + let exporterPath = 'http://test.exporter.diligrp.com:8288'; | ||
771 | + let url = exporterPath == "" ? "/export/isFinished.action?token=" + token : exporterPath + "/exporter/isFinished.action?token=" + token; | ||
772 | + $.ajax({ | ||
773 | + type: "POST", | ||
774 | + url: url, | ||
775 | + processData: true, | ||
776 | + dataType: "json", | ||
777 | + success: function (data) { | ||
778 | + if (data == true || data == "true") { | ||
779 | + bui.loading.hide(); | ||
780 | + } | ||
781 | + }, | ||
782 | + error: function (XMLHttpRequest, textStatus, errorThrown) { | ||
783 | + bs4pop.alert('远程访问失败:' + XMLHttpRequest.status + XMLHttpRequest.statusText + "," + textStatus, {type: 'error'}); | ||
784 | + } | ||
785 | + }); | ||
786 | + } | ||
787 | + | ||
788 | + /*** | ||
789 | + * grid **tableID | ||
790 | + * formId **查询参数表单ID | ||
791 | + * exportUrl 导出URL | ||
792 | + * extendQueryParams 导出扩展参数 | ||
793 | + * */ | ||
794 | + function doExport(gridId, formId, exportUrl , extendQueryParams) { | ||
795 | + var opts = $('#' + gridId).bootstrapTable('getOptions'); | ||
796 | + //没有url就没有查询过,不作导出 | ||
797 | + if (opts.url == null || opts.url == '') | ||
798 | + return; | ||
799 | + var _gridExportQueryParams; | ||
800 | + if (formId == null || formId === '') { | ||
801 | + try { | ||
802 | + _gridExportQueryParams = $.table.bindGridMeta2Form(null); | ||
803 | + } catch (e) { | ||
804 | + console.log('未引入VUE。。。') | ||
805 | + } | ||
806 | + } else { | ||
807 | + _gridExportQueryParams = bindGridMeta2Form(gridId, formId); | ||
808 | + } | ||
809 | + _gridExportQueryParams["sort"] = opts.sortName; | ||
810 | + _gridExportQueryParams["order"] = opts.sortOrder; | ||
811 | + var param = {}; | ||
812 | + //多表头遍历 | ||
813 | + for (let cols of opts.columns) { | ||
814 | + for (let col of cols) { | ||
815 | + if (col.checkbox || col.radio) { | ||
816 | + col['hidden'] = true; | ||
817 | + } else { | ||
818 | + col['hidden'] = !col.visible; | ||
819 | + } | ||
820 | + | ||
821 | + //opts.sortName默认取到的是fieldName | ||
822 | + if (col.field === opts.sortName) { | ||
823 | + _gridExportQueryParams["sort"] = col.sortName || opts.sortName; | ||
824 | + } | ||
825 | + } | ||
826 | + } | ||
827 | + param.columns = JSON.stringify(opts.columns); | ||
828 | + param.queryParams = JSON.stringify($.extend(_gridExportQueryParams, extendQueryParams)); | ||
829 | + param.title = opts.title; | ||
830 | + var serverPath = 'http://test.jmsf.diligrp.com:8385'; | ||
831 | + param.url = serverPath + opts.url; | ||
832 | + param.contentType = opts.contentType; | ||
833 | + param.token = guid(); | ||
834 | + exportByUrl(param); | ||
835 | + } | ||
836 | + | ||
837 | + /** | ||
838 | + * 根据controller url导出 | ||
839 | + * controller方法调用ExportUtils完成导出, 示例: | ||
840 | + * @RequestMapping("/export") | ||
841 | + * public @ResponseBody void export( HttpServletRequest request, HttpServletResponse response, @RequestParam("queryParams") String queryParams){...} | ||
842 | + * @param exportUrl | ||
843 | + * @param params | ||
844 | + */ | ||
845 | + function exportByUrl(param) { | ||
846 | + var exporterPath = 'http://test.exporter.diligrp.com:8288'; | ||
847 | + //如果配置了exporter.contextPath, 则使用导出器 | ||
848 | + var exportUrl = exporterPath == "" ? '/export/serverExport.action' : exporterPath+'/exporter/serverExport.action'; | ||
849 | + if ($("#_exportForm").length <= 0) { | ||
850 | + var formStr = "<div id='_exportFormDiv'><form id='_exportForm' action='" + exportUrl + "' method='post' target=''>" + | ||
851 | + "<input type='hidden' id='columns' name='columns'/>" + | ||
852 | + "<input type='hidden' id='queryParams' name='queryParams'/>" + | ||
853 | + "<input type='hidden' id='title' name='title'/>" + | ||
854 | + "<input type='hidden' id='url' name='url'/>" + | ||
855 | + "<input type='hidden' id='token' name='token'/>" + | ||
856 | + "<input type='hidden' id='contentType' name='contentType'/>" + | ||
857 | + "</form></div>"; | ||
858 | + $(formStr).appendTo("body"); | ||
859 | + } | ||
860 | + $('#columns').val(param.columns); | ||
861 | + $('#queryParams').val(param.queryParams); | ||
862 | + $('#title').val(param.title); | ||
863 | + $('#url').val(param.url); | ||
864 | + $('#token').val(param.token); | ||
865 | + $('#contentType').val(param.contentType); | ||
866 | + // 显示进度条 | ||
867 | + bui.loading.show('数据导出中,请稍候。。。'); | ||
868 | + checkFinished(param.token); | ||
869 | + $('#_exportForm').submit(); | ||
870 | + } | ||
871 | + | ||
872 | + return {doExport, exportByUrl,guid}; | ||
873 | + })(); | ||
874 | + /******************************** excel导出函数定义 end *********************************/ | ||
875 | + | ||
876 | + //表单回显数据,加载json数据到表单 | ||
877 | + let loadFormData = function (jsonStr) { | ||
878 | + var obj = typeof (jsonStr) == 'string' ? eval("(" + jsonStr + ")") : jsonStr; | ||
879 | + var key, value, tagName, type, arr; | ||
880 | + for (x in obj) { | ||
881 | + key = x; | ||
882 | + value = obj[x]; | ||
883 | + | ||
884 | + $("[name='" + key + "'],[name='" + key + "[]']").each(function () { | ||
885 | + tagName = $(this)[0].tagName; | ||
886 | + type = $(this).attr('type'); | ||
887 | + if (tagName == 'INPUT') { | ||
888 | + if (type == 'radio') { | ||
889 | + $(this).attr('checked', $(this).val() == value); | ||
890 | + } else if (type == 'checkbox') { | ||
891 | + arr = value.split(','); | ||
892 | + for (var i = 0; i < arr.length; i++) { | ||
893 | + if ($(this).val() == arr[i]) { | ||
894 | + $(this).attr('checked', true); | ||
895 | + break; | ||
896 | + } | ||
897 | + } | ||
898 | + } else { | ||
899 | + $(this).val(value); | ||
900 | + } | ||
901 | + } else if (tagName == 'SELECT' || tagName == 'TEXTAREA') { | ||
902 | + $(this).val(value); | ||
903 | + } | ||
904 | + | ||
905 | + }); | ||
906 | + } | ||
907 | + } | ||
908 | + | ||
909 | + //从后台获取原始值的key的前缀 | ||
910 | + let orginal_key_prefix = '$_'; | ||
911 | + | ||
912 | + //获取datagrid行数据中的原始值(有orginal_key_prefix开头的key的值),用于form load | ||
913 | + function getOriginalData(json) { | ||
914 | + var obj = {}; | ||
915 | + for (key in json) { | ||
916 | + if (key.startsWith(orginal_key_prefix)) { | ||
917 | + continue; | ||
918 | + } | ||
919 | + //如果已有orginal_key_prefix为前缀的同名原始属性,则使用原始属性 | ||
920 | + if (json.hasOwnProperty(orginal_key_prefix + key)) { | ||
921 | + obj[key] = json[orginal_key_prefix + key]; | ||
922 | + } else { | ||
923 | + obj[key] = json[key]; | ||
924 | + } | ||
925 | + } | ||
926 | + return obj; | ||
927 | + } | ||
928 | + | ||
929 | + //为json对象key中添加开始字符串,如果已经是以startStr开始,则跳过 | ||
930 | + // 主要是为了获取下拉框等有provider的字段的原值 | ||
931 | + // 如var json = {id:1, name:"value"}; | ||
932 | + // addKeyStartWith(json, "_") | ||
933 | + // 结果是:{_id:1, _name:"value"}; | ||
934 | + function addKeyStartWith(json, startStr) { | ||
935 | + for (key in json) { | ||
936 | + if (key.startsWith(startStr)) { | ||
937 | + continue; | ||
938 | + } | ||
939 | + //如果已有add startStr后的同名属性,则跳过,并且移除key | ||
940 | + if (json.hasOwnProperty(startStr + key)) { | ||
941 | + delete json[key]; | ||
942 | + continue; | ||
943 | + } | ||
944 | + json[startStr + key] = json[key]; | ||
945 | + delete json[key]; | ||
946 | + } | ||
947 | + return json; | ||
948 | + } | ||
949 | + | ||
950 | + //删除json对象key中的开始字符串, | ||
951 | + // 如var json = {_id:1, _name:"value"}; | ||
952 | + // 调用removeByStart(json, "_") | ||
953 | + // 结果是:{id:1, name:"value"}; | ||
954 | + function removeKeyStartWith(json, startStr) { | ||
955 | + for (key in json) { | ||
956 | + if (key.startsWith(startStr)) { | ||
957 | + //如果已有remove掉startStr后的同名属性,则跳过,并且移除key | ||
958 | + if (json.hasOwnProperty(key.slice(startStr.length))) { | ||
959 | + delete json[key]; | ||
960 | + continue; | ||
961 | + } | ||
962 | + json[key.slice(startStr.length)] = json[key]; | ||
963 | + delete json[key]; | ||
964 | + } | ||
965 | + } | ||
966 | + return json; | ||
967 | + } | ||
968 | + | ||
969 | + /** | ||
970 | + * 初始化自动完成框 | ||
971 | + */ | ||
972 | + function initAutoComplete(option) { | ||
973 | + $(option.selector).on('input', function () { | ||
974 | + $(this).siblings('input').val(''); | ||
975 | + }); | ||
976 | + //产地联系输入 | ||
977 | + $(option.selector).autocomplete($.extend(true, { | ||
978 | + type: 'get', | ||
979 | + noCache: 1, | ||
980 | + deferRequestBy: 300, | ||
981 | + autoFill: true, | ||
982 | + dataType: 'json', | ||
983 | + width: 'auto', | ||
984 | + paramName: 'value', | ||
985 | + onSearchComplete: function (query, suggestions) { | ||
986 | + }, | ||
987 | + showNoSuggestionNotice: true, | ||
988 | + noSuggestionNotice: "无匹配结果" | ||
989 | + }, option)); | ||
990 | + } | ||
991 | + | ||
992 | + /** | ||
993 | + * 为表单绑定表格的metadata,保持原有的meta信息 | ||
994 | + * 返回绑定好的对象 | ||
995 | + * @param gridId | ||
996 | + * @param formId | ||
997 | + * @returns {*} | ||
998 | + */ | ||
999 | + function bindGridMeta2Form(gridId, formId, containsNull) { | ||
1000 | + var param = bindMetadata(gridId); | ||
1001 | + if (!formId) return param; | ||
1002 | + var formData = $("#" + formId).serializeObject(containsNull); | ||
1003 | + return $.extend(param, formData); | ||
1004 | + } | ||
1005 | + | ||
1006 | + /** | ||
1007 | + * 绑定实体的metadata信息,用于提供者转换 | ||
1008 | + * @param gridId datagrid Id | ||
1009 | + * @returns {queryParams|{provider}|*|string|{}} | ||
1010 | + */ | ||
1011 | + function bindMetadata(gridId) { | ||
1012 | + var opts = $("#" + gridId).bootstrapTable('getOptions'); | ||
1013 | + return bindColumnsMetadata(opts.columns); | ||
1014 | + } | ||
1015 | + | ||
1016 | + /** | ||
1017 | + * originColumns 表头 (获取实际字段的表头(可能是多表头)) | ||
1018 | + * */ | ||
1019 | + function bindColumnsMetadata(originColumns) { | ||
1020 | + var columns = originColumns.flat().filter(item => item["field"]); | ||
1021 | + //赋默认值 | ||
1022 | + var params = {}; | ||
1023 | + params["metadata"] = {}; | ||
1024 | + //提供者的默认排序索引 | ||
1025 | + var index = 10; | ||
1026 | + for (var column in columns) { | ||
1027 | + var _provider = columns[column]["provider"]; | ||
1028 | + var _data = columns[column]["data"]; | ||
1029 | + //优先解析直接数据的_data属性 | ||
1030 | + if (_data != null) { | ||
1031 | + var field = columns[column]["field"]; | ||
1032 | + var fieldMetadata = {}; | ||
1033 | + fieldMetadata["provider"] = "simpleDataProvider"; | ||
1034 | + fieldMetadata["data"] = _data; | ||
1035 | + params["metadata"][field] = JSON.stringify(fieldMetadata); | ||
1036 | + continue; | ||
1037 | + } | ||
1038 | + //没有_data属性,则解析_table,_valueField和_textField等其它属性 | ||
1039 | + var _table = columns[column]["table"]; | ||
1040 | + //如果有_table属性,则按simpleValueProvider处理 | ||
1041 | + if (_table != null) { | ||
1042 | + _provider = "simpleValueProvider"; | ||
1043 | + } | ||
1044 | + if (_provider != null) { | ||
1045 | + //设值 | ||
1046 | + var field = columns[column]["field"]; | ||
1047 | + var fieldMetadata = {}; | ||
1048 | + fieldMetadata["provider"] = _provider; | ||
1049 | + fieldMetadata["table"] = _table; | ||
1050 | + fieldMetadata["valueField"] = columns[column]["valueField"]; | ||
1051 | + fieldMetadata["textField"] = columns[column]["textField"]; | ||
1052 | + fieldMetadata["queryParams"] = columns[column]["queryParams"]; | ||
1053 | + fieldMetadata["index"] = columns[column]["index"] == null ? index : columns[column]["index"]; | ||
1054 | + fieldMetadata["field"] = field; | ||
1055 | + //设置通用批量提供者参数 | ||
1056 | + fieldMetadata["_escapeFileds"] = columns[column]["escapeFileds"]; | ||
1057 | + fieldMetadata["_relationTablePkField"] = columns[column]["relationTablePkField"]; | ||
1058 | + fieldMetadata["_relationTable"] = columns[column]["relationTable"]; | ||
1059 | + fieldMetadata["_fkField"] = columns[column]["fkField"]; | ||
1060 | + params["metadata"][field] = JSON.stringify(fieldMetadata); | ||
1061 | + index += 10; | ||
1062 | + } | ||
1063 | + } | ||
1064 | + return params; | ||
1065 | + } | ||
1066 | + | ||
1067 | + /** | ||
1068 | + * table-export科学计算法处理 | ||
1069 | + * @param cell | ||
1070 | + * @param row | ||
1071 | + * @param col | ||
1072 | + * @returns {string} | ||
1073 | + * @constructor | ||
1074 | + */ | ||
1075 | + function doOnMsoNumberFormat(cell, row, col) { | ||
1076 | + var result = ""; | ||
1077 | + if (row > 0 && col == 0) | ||
1078 | + result = "\\@"; | ||
1079 | + return result; | ||
1080 | + } | ||
1081 | + | ||
1082 | + /** | ||
1083 | + * 为表单number类型进行元转分 | ||
1084 | + * @param obj 数据对象 如:$('form').serializeObject()得到number数据为 | ||
1085 | + * @returns {*} | ||
1086 | + */ | ||
1087 | + function yuanToCentForMoneyEl(obj){ | ||
1088 | + for(let field in obj){ | ||
1089 | + let value = obj[field]; | ||
1090 | + if($('[name='+field+']').hasClass('money')){ | ||
1091 | + if(value instanceof Array){ | ||
1092 | + value.forEach(function(val,index,arr){ | ||
1093 | + arr[index] = Number(val).mul(100); | ||
1094 | + }) | ||
1095 | + }else{ | ||
1096 | + obj[field] = Number(value).mul(100); | ||
1097 | + } | ||
1098 | + } | ||
1099 | + } | ||
1100 | + return obj; | ||
1101 | + } | ||
1102 | + | ||
1103 | + /** | ||
1104 | + * 反转义html | ||
1105 | + * @param str | ||
1106 | + * @returns {*} | ||
1107 | + */ | ||
1108 | + function HTMLDecode(str) { | ||
1109 | + var s = ""; | ||
1110 | + if (str.length == 0) return ""; | ||
1111 | + s = str.replace(/&/g, "&"); | ||
1112 | + s = s.replace(/</g, "<"); | ||
1113 | + s = s.replace(/>/g, ">"); | ||
1114 | + s = s.replace(/ /g, " "); | ||
1115 | + s = s.replace(/'/g, "\'"); | ||
1116 | + s = s.replace(/"/g, "\""); | ||
1117 | + s = s.replace(/<br\/>/g, "\n"); | ||
1118 | + return s; | ||
1119 | + } | ||
1120 | + | ||
1121 | + /** | ||
1122 | + * fn [function] 需要防抖的函数 | ||
1123 | + * wait [number] 毫秒,防抖期限值 | ||
1124 | + * immediate 是否立即执行 | ||
1125 | + */ | ||
1126 | + const debounce = (fn, wait, immediate = false) => { | ||
1127 | + let timer; | ||
1128 | + | ||
1129 | + return function() { | ||
1130 | + if(timer) clearTimeout(timer); | ||
1131 | + if(immediate) { | ||
1132 | + let trigger = !timer; | ||
1133 | + timer = setTimeout(() => { | ||
1134 | + timer = null; | ||
1135 | + }, wait); | ||
1136 | + | ||
1137 | + if(trigger) { | ||
1138 | + return fn.apply(this, arguments); | ||
1139 | + } | ||
1140 | + return false; | ||
1141 | + } | ||
1142 | + | ||
1143 | + timer = setTimeout(() => { | ||
1144 | + return fn.apply(this, arguments); | ||
1145 | + }, wait); | ||
1146 | + return false; | ||
1147 | + } | ||
1148 | + }; | ||
1149 | + | ||
1150 | + | ||
1151 | + return { | ||
1152 | + variable: { | ||
1153 | + icons | ||
1154 | + }, | ||
1155 | + util: { | ||
1156 | + //自动完成框初始化 | ||
1157 | + initAutoComplete, | ||
1158 | + //构建Meta(provider)和Form 字段信息 | ||
1159 | + bindGridMeta2Form, | ||
1160 | + //构建meta信息 | ||
1161 | + bindMetadata, | ||
1162 | + //构建列meta信息 | ||
1163 | + bindColumnsMetadata, | ||
1164 | + //table-export科学计算法处理 | ||
1165 | + doOnMsoNumberFormat, | ||
1166 | + bexport, | ||
1167 | + //列表页导出 | ||
1168 | + doExport: debounce(bexport.doExport,1000,true), | ||
1169 | + //URL导出 | ||
1170 | + exportByUrl: debounce(bexport.exportByUrl,1000,true), | ||
1171 | + //表单回显数据,加载json数据到表单 | ||
1172 | + loadFormData, | ||
1173 | + //获取table-row原始数据 | ||
1174 | + getOriginalData, | ||
1175 | + //data字段添加key前缀 | ||
1176 | + addKeyStartWith, | ||
1177 | + //移除data字段添加的前缀 | ||
1178 | + removeKeyStartWith, | ||
1179 | + //为表单number类型进行元转分 | ||
1180 | + yuanToCentForMoneyEl, | ||
1181 | + //反转义HTML | ||
1182 | + HTMLDecode, | ||
1183 | + //防抖 | ||
1184 | + debounce | ||
1185 | + }, | ||
1186 | + //遮罩层 | ||
1187 | + loading | ||
1188 | + } | ||
1189 | + })(); | ||
1190 | + /*********************************************** 页面组件变量及处理函数 end ***********************************************************/ | ||
1191 | + | ||
1192 | +</script> | ||
1193 | + | ||
1194 | +</html><!-- main-container end --> | ||
1195 | + | ||
1196 | +<script> | ||
1197 | + $(function () { | ||
1198 | + // update/view/pay/correct/amend/invalid/refund/unfreeze | ||
1199 | + | ||
1200 | + var viewType = $("#viewType").val(); | ||
1201 | + if(viewType =="pay"){ | ||
1202 | + | ||
1203 | + $("#plate").attr("readonly","true"); | ||
1204 | + $("#trailerNumber").attr("readonly","true"); | ||
1205 | + $("#product").attr("readonly","true"); | ||
1206 | + $("#grossWeight").attr("readonly","true"); | ||
1207 | + $("#tareWeight").attr("readonly","true"); | ||
1208 | + $("#autocomplete-cartype").attr("readonly","true"); | ||
1209 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1210 | + $("#outGreeterName").attr("disabled","true"); | ||
1211 | + $("#inGreeterName").attr("readonly","true"); | ||
1212 | + $("#goodsRemark").attr("readonly","true"); | ||
1213 | + console.info("-----------this pay"); | ||
1214 | + | ||
1215 | + }else if(viewType =="view"){ | ||
1216 | + $("#ic").attr("readonly","true"); | ||
1217 | + $("#plate").attr("readonly","true"); | ||
1218 | + $("#trailerNumber").attr("readonly","true"); | ||
1219 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1220 | + $("#grossWeight").attr("readonly","true"); | ||
1221 | + $("#tareWeight").attr("readonly","true"); | ||
1222 | + $("#regionCode").attr("readonly","true"); | ||
1223 | + $("#autocomplete-cartype").attr("readonly","true"); | ||
1224 | + $("#productArea").attr("readonly","true"); | ||
1225 | + $("#outGreeterName").attr("disabled","true"); | ||
1226 | + $("#inGreeterName").attr("readonly","true"); | ||
1227 | + $("#goodsCusName").attr("readonly","true"); | ||
1228 | + $("#goodsCusTel").attr("readonly","true"); | ||
1229 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1230 | + $("#remark").attr("readonly","true"); | ||
1231 | + $("#goodsRemark").attr("readonly","true"); | ||
1232 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1233 | + console.info("------------this view"); | ||
1234 | + }else if(viewType =="update"){ | ||
1235 | + $("#ic").attr("readonly","true"); | ||
1236 | + $("#plate").attr("readonly","true"); | ||
1237 | + $("#trailerNumber").attr("readonly","true"); | ||
1238 | + $("#product").attr("readonly","true"); | ||
1239 | + $("#grossWeight").attr("readonly","true"); | ||
1240 | + $("#tareWeight").attr("readonly","true"); | ||
1241 | + $("#regionCode").attr("readonly","true"); | ||
1242 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1243 | + /*$("#productArea").attr("readonly","true");*/ | ||
1244 | + $("#outGreeterName").attr("disabled","true"); | ||
1245 | + $("#inGreeterName").attr("readonly","true"); | ||
1246 | + $("#goodsCusName").attr("readonly","true"); | ||
1247 | + $("#goodsCusTel").attr("readonly","true"); | ||
1248 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1249 | + $("#goodsRemark").attr("readonly","true"); | ||
1250 | + console.info("----------this modify"); | ||
1251 | + }else if(viewType =="correct"){ | ||
1252 | + $("#ic").attr("readonly","true"); | ||
1253 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1254 | + console.info("----------this gengzheng"); | ||
1255 | + }else if(viewType =="amend"){ | ||
1256 | + $("#ic").attr("readonly","true"); | ||
1257 | + | ||
1258 | + //$("#trailerNumber").attr("readonly","true"); | ||
1259 | + $("#product").attr("readonly","true"); | ||
1260 | + $("#grossWeight").attr("readonly","true"); | ||
1261 | + $("#tareWeight").attr("readonly","true"); | ||
1262 | + $("#regionCode").attr("readonly","true"); | ||
1263 | + //$("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1264 | + $("#productArea").attr("readonly","true"); | ||
1265 | + $("#outGreeterName").attr("disabled","true"); | ||
1266 | + $("#inGreeterName").attr("readonly","true"); | ||
1267 | + $("#goodsCusName").attr("readonly","true"); | ||
1268 | + $("#goodsCusTel").attr("readonly","true"); | ||
1269 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1270 | + $("#goodsRemark").attr("readonly","true"); | ||
1271 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1272 | + console.info("--------------this xiuzheng"); | ||
1273 | + }else if(viewType =="refund"){ | ||
1274 | + $("#ic").attr("readonly","true"); | ||
1275 | + $("#goodsNum").attr("readonly","true"); | ||
1276 | + $("#itemWeight").attr("readonly","true"); | ||
1277 | + $("#plate").attr("readonly","true"); | ||
1278 | + $("#trailerNumber").attr("readonly","true"); | ||
1279 | + $("#autocomplete-category").attr("readonly","true"); | ||
1280 | + $("#grossWeight").attr("readonly","true"); | ||
1281 | + $("#tareWeight").attr("readonly","true"); | ||
1282 | + $("#regionCode").attr("readonly","true"); | ||
1283 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1284 | + $("#productArea").attr("readonly","true"); | ||
1285 | + $("#outGreeterName").attr("disabled","true"); | ||
1286 | + $("#inGreeterName").attr("readonly","true"); | ||
1287 | + $("#goodsCusName").attr("readonly","true"); | ||
1288 | + $("#goodsCusTel").attr("readonly","true"); | ||
1289 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1290 | + /*$("#remark").attr("readonly","true");*/ | ||
1291 | + $("#goodsRemark").attr("readonly","true"); | ||
1292 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1293 | + console.info("-----this refund"); | ||
1294 | + }else if(viewType =="invalid"){ | ||
1295 | + $("#ic").attr("readonly","true"); | ||
1296 | + $("#plate").attr("readonly","true"); | ||
1297 | + $("#trailerNumber").attr("readonly","true"); | ||
1298 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1299 | + $("#grossWeight").attr("readonly","true"); | ||
1300 | + $("#tareWeight").attr("readonly","true"); | ||
1301 | + $("#regionCode").attr("readonly","true"); | ||
1302 | + $("#autocomplete-cartype").attr("readonly","true"); | ||
1303 | + $("#productArea").attr("readonly","true"); | ||
1304 | + $("#outGreeterName").attr("disabled","true"); | ||
1305 | + $("#inGreeterName").attr("readonly","true"); | ||
1306 | + $("#goodsCusName").attr("readonly","true"); | ||
1307 | + $("#goodsCusTel").attr("readonly","true"); | ||
1308 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1309 | + /*$("#remark").attr("readonly","true");*/ | ||
1310 | + $("#goodsRemark").attr("readonly","true"); | ||
1311 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1312 | + console.info("this invalid"); | ||
1313 | + }else if(viewType =="unfreeze"){ | ||
1314 | + $("#ic").attr("readonly","true"); | ||
1315 | + $("#plate").attr("readonly","true"); | ||
1316 | + $("#trailerNumber").attr("readonly","true"); | ||
1317 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1318 | + $("#grossWeight").attr("readonly","true"); | ||
1319 | + $("#tareWeight").attr("readonly","true"); | ||
1320 | + $("#regionCode").attr("readonly","true"); | ||
1321 | + $("#autocomplete-cartype").attr("readonly","true"); | ||
1322 | + $("#productArea").attr("readonly","true"); | ||
1323 | + $("#outGreeterName").attr("disabled","true"); | ||
1324 | + $("#inGreeterName").attr("readonly","true"); | ||
1325 | + $("#goodsCusName").attr("readonly","true"); | ||
1326 | + $("#goodsCusTel").attr("readonly","true"); | ||
1327 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1328 | + //$("#remark").attr("readonly","true"); | ||
1329 | + $("#goodsRemark").attr("readonly","true"); | ||
1330 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1331 | + console.info("this unfreeze"); | ||
1332 | + }else if(viewType =="back"){ | ||
1333 | + //$("#ic").attr("readonly","true"); | ||
1334 | + $("#plate").attr("readonly","true"); | ||
1335 | + $("#trailerNumber").attr("readonly","true"); | ||
1336 | + $("#autocomplete-category").attr("readonly","true"); | ||
1337 | + $("#grossWeight").attr("readonly","true"); | ||
1338 | + $("#tareWeight").attr("readonly","true"); | ||
1339 | + $("#regionCode").attr("readonly","true"); | ||
1340 | + $("input[name='autocomplete-cartype']").attr("readonly","true"); | ||
1341 | + $("#productArea").attr("readonly","true"); | ||
1342 | + $("#outGreeterName").attr("disabled","true"); | ||
1343 | + $("#inGreeterName").attr("readonly","true"); | ||
1344 | + $("#goodsCusName").attr("readonly","true"); | ||
1345 | + $("#goodsCusTel").attr("readonly","true"); | ||
1346 | + $("#freezeMoneySymbol").attr("readonly","true"); | ||
1347 | + $("#remark").attr("readonly","true"); | ||
1348 | + $("#goodsRemark").attr("readonly","true"); | ||
1349 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
1350 | + console.info("this back"); | ||
1351 | + } | ||
1352 | + | ||
1353 | + $('input[readonly],input[disabled],textarea[readonly],textarea[disabled]').attr('tabindex', -1); | ||
1354 | + }); | ||
1355 | + | ||
1356 | + function calculate() { | ||
1357 | + console.info("this -new- calculate"); | ||
1358 | + $.post("/calculate/index.action", | ||
1359 | + $('#feeForm').serialize(), | ||
1360 | + function (data, status) { | ||
1361 | + $("#feeitemedit").html(data); | ||
1362 | + showAllAmount(); | ||
1363 | +// 计算后触发重新校验冻结金额 | ||
1364 | + $('#freezeMoneySymbol').blur(); | ||
1365 | + $("#goodsAllocation").val($("#goodsAllocationText").val()); | ||
1366 | + }); | ||
1367 | + } | ||
1368 | + | ||
1369 | + function icCheck() { | ||
1370 | + var ic = $("#ic").val(); | ||
1371 | + console.info(ic+"this ic check"); | ||
1372 | + $.ajax({ | ||
1373 | + type: 'get', | ||
1374 | + url: '/api/jmsf/ajax/icCheck?ic='+ic, | ||
1375 | + dataType: 'json', | ||
1376 | + async: false, | ||
1377 | + success: function (ret) { | ||
1378 | + if (ret.code == "success") { | ||
1379 | + var aInfo = ret.data.aInfo; | ||
1380 | + $("#customerName").val(aInfo.name); | ||
1381 | + $("#customerPhone").val(aInfo.mobile); | ||
1382 | + $("#customerId").val(aInfo.customerId); | ||
1383 | + $("#accountId").val(aInfo.accountId); | ||
1384 | + $("#balance").val(aInfo.balanceSymbol); | ||
1385 | + $("#fundAccount").val(aInfo.fundAccountId); | ||
1386 | + calcTotalPrice(); | ||
1387 | + } else { | ||
1388 | + $("#ic").val(""); | ||
1389 | + $("#customerName").val(""); | ||
1390 | + $("#customerPhone").val(""); | ||
1391 | + $("#customerId").val(""); | ||
1392 | + $("#ic").attr("icstatus", "-1"); | ||
1393 | + $("#balance").val(""); | ||
1394 | + showWarning('此卡无效,不能交易!'); | ||
1395 | + return false; | ||
1396 | + } | ||
1397 | + } | ||
1398 | + }); | ||
1399 | + } | ||
1400 | + | ||
1401 | + /** 错误消息提示框 */ | ||
1402 | + function showError(message) { | ||
1403 | + bs4pop.alert(message, {type : "error"}); | ||
1404 | + } | ||
1405 | + | ||
1406 | + /** 提示消息弹出框 */ | ||
1407 | + function showInfo(message) { | ||
1408 | + bs4pop.alert(message, {type : "info"}); | ||
1409 | + } | ||
1410 | + | ||
1411 | + /** 警示消息框 */ | ||
1412 | + function showWarning(message) { | ||
1413 | + bs4pop.alert(message, {type : "warning"}); | ||
1414 | + } | ||
1415 | + | ||
1416 | + function viewImgNew() { | ||
1417 | + var imsg = $("#imgs").val(); | ||
1418 | + console.info(imsg); | ||
1419 | + if (typeof (callbackObj) == "undefined") return; | ||
1420 | + callbackObj.showPictureView(imsg); | ||
1421 | + } | ||
1422 | + | ||
1423 | +</script> | ||
1424 | +<script> | ||
1425 | + $(()=>{ | ||
1426 | + // 必填边框加红晚上看不到 | ||
1427 | + $('.form-control[required]').addClass('border border-danger') | ||
1428 | + }) | ||
1429 | + function cancel(){ | ||
1430 | + var clientRedirectTag = $("#clientRedirectTag").val(); | ||
1431 | + if(clientRedirectTag=="true"){ | ||
1432 | + winHrefList(); | ||
1433 | + }else { | ||
1434 | + var source=$("#source").val(); | ||
1435 | + history.go(-source); | ||
1436 | + } | ||
1437 | + } | ||
1438 | + //合并时,接受沈阳版本 | ||
1439 | + //产地联系输入 | ||
1440 | + $("#productArea").autocomplete({ | ||
1441 | + noCache: 1, | ||
1442 | + serviceUrl: '/api/jmsf/ajax/city/', //数据地址 | ||
1443 | + //lookup: countries, 本地测试模拟数据使用结合上面的var countries | ||
1444 | + dataType: 'json', | ||
1445 | + onSearchComplete: function (query, suggestions) { | ||
1446 | + | ||
1447 | + if ($(this).data('selectVal') != $('#productArea').val()) { | ||
1448 | + //console.log("1:"+$(this).data('selectVal')+"2:"+$('#productArea').val()) | ||
1449 | + $("#originId").val(""); | ||
1450 | + $("#parentId").val(""); | ||
1451 | + } | ||
1452 | + }, | ||
1453 | + showNoSuggestionNotice: true, | ||
1454 | + noSuggestionNotice: "不存在,请重输!", | ||
1455 | + onSelect: function (suggestion) { | ||
1456 | + $(this).data('selectVal', suggestion.value); | ||
1457 | + setTimeout(function () { | ||
1458 | + $("#productArea").val(suggestion.value); | ||
1459 | + $("#originId").val(suggestion.id); | ||
1460 | + $("#parentId").val(suggestion.parentId); | ||
1461 | + calcTotalPrice(); | ||
1462 | + }, 50); | ||
1463 | + } | ||
1464 | + }); | ||
1465 | + | ||
1466 | + // 货主姓名联想输入 | ||
1467 | + $('#goodsCusName').autocomplete({ | ||
1468 | + dataType: 'json', | ||
1469 | + noCache: 1, | ||
1470 | + serviceUrl: '/api/jmsf/ajax/customerForEntrance', //数据地址 | ||
1471 | + showNoSuggestionNotice: true, | ||
1472 | + noSuggestionNotice: "不存在,请重输!", | ||
1473 | + onSearchComplete: function (query, suggestions) { | ||
1474 | + if($(this).data('selectVal')!=$('#goodsCusName').val()){ | ||
1475 | + $('#shipperId').val(''); | ||
1476 | + $('#goodsCusTel').val(""); | ||
1477 | + } | ||
1478 | + }, | ||
1479 | + onSelect: function (suggestion) { | ||
1480 | + $(this).data('selectVal', suggestion.value); | ||
1481 | + setTimeout(function () { | ||
1482 | + $('#goodsCusName').val(suggestion.name); | ||
1483 | + $('#goodsCusTel').val(suggestion.contactsPhone); | ||
1484 | + $('#shipperId').val(suggestion.id); | ||
1485 | + //$('#goodsCusTel').trigger("blur") | ||
1486 | + calcTotalPrice(); | ||
1487 | + }, 50); | ||
1488 | + } | ||
1489 | + }); | ||
1490 | + $('#goodsCusName').blur(function () { | ||
1491 | + if($(this).val()==""){ | ||
1492 | + $('#shipperId').val(''); | ||
1493 | + calcTotalPrice(); | ||
1494 | + } | ||
1495 | + }); | ||
1496 | + | ||
1497 | + //计算金额 | ||
1498 | + $('.calculate').on("click", function () { | ||
1499 | + console.log("-1--点击计算-------") | ||
1500 | + $('#updateFeeItems').val(1); | ||
1501 | + $('#correctDiscount').val(1); | ||
1502 | + $("#gz-tag").hide(); | ||
1503 | + calcTotalPrice(); | ||
1504 | + | ||
1505 | + }); | ||
1506 | + | ||
1507 | + function calcTotalPrice() { | ||
1508 | + console.log("-触发计算-------") | ||
1509 | + calculate(); | ||
1510 | + } | ||
1511 | + | ||
1512 | + $('[name="dep"]').change(function () { | ||
1513 | + $("#unitPrice").val(""); | ||
1514 | + var departId = $(this).val(); | ||
1515 | + var depName = $(this).children('option:selected').html(); | ||
1516 | + $("#depName").val(depName); | ||
1517 | + $("#district").empty(); | ||
1518 | + $(".district-no").val(""); | ||
1519 | + var defaultHtml = '<option value="">请选择</option>'; | ||
1520 | + $("#district").append(defaultHtml); | ||
1521 | + //console.info("-------------清空区域") | ||
1522 | + findDistrict(departId); | ||
1523 | + var goodId = $("#goodsId").val(); | ||
1524 | + getUnitPrice(departId, goodId); | ||
1525 | + calcTotalPrice(); | ||
1526 | + }); | ||
1527 | + $("#grossWeight").blur(function(){ | ||
1528 | + calcTotalPrice(); | ||
1529 | + }); | ||
1530 | + $("#tareWeight").blur(function () { | ||
1531 | + calcTotalPrice(); | ||
1532 | + }) | ||
1533 | + $('[name="feeDepId"]').change(function () { | ||
1534 | + calcTotalPrice(); | ||
1535 | + }); | ||
1536 | + $('[name="regionId"]').change(function () { | ||
1537 | + calcTotalPrice(); | ||
1538 | + }); | ||
1539 | + | ||
1540 | + | ||
1541 | + | ||
1542 | + $(".district-name").change(function () { | ||
1543 | + var ss = $(this).children('option:selected'); | ||
1544 | + if (ss.html() != "请选择") { | ||
1545 | + var reName = ss.attr("bind-name"); | ||
1546 | + $("#regionName").val(reName); | ||
1547 | + $(".district-no").val(ss.attr('bind-index')); | ||
1548 | + } | ||
1549 | + }); | ||
1550 | + | ||
1551 | + //$('[name="dep"]').trigger('change'); | ||
1552 | + //选择货区 | ||
1553 | + | ||
1554 | + $('.district-no').on('input', function(){ | ||
1555 | + this.value = this.value.replace(/[^\d]/g, ''); | ||
1556 | + var thisVal = $(this).val(); | ||
1557 | + if( thisVal !=='' && $('.district-name').find('option[bind-index=' + thisVal + ']').length ) { | ||
1558 | + $('.district-name option').prop('selected', false); | ||
1559 | + $('.district-name').find('option[bind-index=' + thisVal + ']').prop('selected', true); | ||
1560 | + } else { | ||
1561 | + $('.district-name option').prop('selected', false); | ||
1562 | + $('.district-name option:first-child').prop('selected', true); | ||
1563 | + } | ||
1564 | + | ||
1565 | + }); | ||
1566 | + | ||
1567 | + function findDistrict(depId) { | ||
1568 | + $.ajax({ | ||
1569 | + type: 'get', | ||
1570 | + url: '/api/jmsf/ajax/district/search.action', | ||
1571 | + data: {depId: depId}, | ||
1572 | + dataType: 'json', | ||
1573 | + async: false, | ||
1574 | + success: function (data) { | ||
1575 | + if (data.code == "200") { | ||
1576 | + var array = []; | ||
1577 | + var data = $.map(data.data, function (obj) { | ||
1578 | + obj.text = obj.text || obj.name; | ||
1579 | + return obj; | ||
1580 | + }); | ||
1581 | + for (var x = 0;x < data.length; x++) { | ||
1582 | + array.push(data[x]); | ||
1583 | + } | ||
1584 | + | ||
1585 | + } | ||
1586 | + ret=array; | ||
1587 | + for (var index = 0;index < array.length; index++){ | ||
1588 | + var preTxt = ""; | ||
1589 | + if(ret[index].number){ | ||
1590 | + preTxt = ret[index].number + " | "; | ||
1591 | + } | ||
1592 | + var optionItemHtml = '<option bind-name="'+ret[index].name+'" + bind-index="' + ( ret[index].number==undefined ? '' :ret[index].number ) + '" value="' + ret[index].id + '">' + preTxt + ret[index].name + '</option>'; | ||
1593 | + $("#district").append(optionItemHtml); | ||
1594 | + } | ||
1595 | + } | ||
1596 | + }); | ||
1597 | + } | ||
1598 | + | ||
1599 | + function getUnitPrice(depId, goodsId) { | ||
1600 | + var productId = $("#productId").val(); | ||
1601 | + console.info("getUnitPrice depId:"+depId+",productId:"+productId) | ||
1602 | + $.ajax({ | ||
1603 | + type: 'get', | ||
1604 | + url: '/api/jmsf/ajax/unitPrice', | ||
1605 | + data: {depId: depId, goodsId: goodsId,productId:productId}, | ||
1606 | + dataType: 'json', | ||
1607 | + async: false, | ||
1608 | + success: function (ret) { | ||
1609 | + //console.log("ret:"+ret.price+":"+ret.priceSymbol+":"+ret.sumPrice+":"+ret.sumPriceSymbol); | ||
1610 | + var priceAndSumPrice = ret.priceAndSumPrice; | ||
1611 | + if(priceAndSumPrice.productPrice=="0"){ | ||
1612 | + $("#unitPriceSymbol").val(""); | ||
1613 | + $("#sumPriceSymbol").val(""); | ||
1614 | + showWarning("当前商品单价为空"); | ||
1615 | + }else{ | ||
1616 | + $("#unitPrice").val(priceAndSumPrice.productPrice); | ||
1617 | + $("#sumPrice").val(priceAndSumPrice.sumPriceLong); | ||
1618 | + $("#unitPriceSymbol").val(priceAndSumPrice.productPriceView); | ||
1619 | + $("#sumPriceSymbol").val(priceAndSumPrice.sumPriceDoubleView); | ||
1620 | + } | ||
1621 | + | ||
1622 | + //$("#weight").val(ret.weight); | ||
1623 | + | ||
1624 | + } | ||
1625 | + }); | ||
1626 | + } | ||
1627 | + | ||
1628 | + $("#icReader").click(function () { | ||
1629 | + var ic = reader(); | ||
1630 | + if (typeof(ic) == "undefined") { | ||
1631 | + showWarning('请检查读卡的设备是否已连接!'); | ||
1632 | + } else if (ic == -1) { | ||
1633 | + showWarning('读卡异常,请重新放置卡!'); | ||
1634 | + } else { | ||
1635 | + icCheck(); | ||
1636 | + } | ||
1637 | + | ||
1638 | + }); | ||
1639 | + $("#bankReader").click(function () { | ||
1640 | + var ic = bankReader(); | ||
1641 | + if (typeof(ic) == "undefined") { | ||
1642 | + showWarning('请检查读卡的设备是否已连接!'); | ||
1643 | + } else if (ic == -1) { | ||
1644 | + showWarning('读卡异常,请重新放置卡!'); | ||
1645 | + } else { | ||
1646 | + icCheck(); | ||
1647 | + } | ||
1648 | + | ||
1649 | + }); | ||
1650 | + | ||
1651 | + // 读园区卡 | ||
1652 | + function readerIc() { | ||
1653 | + if (typeof(callbackObj) == "undefined") return false; | ||
1654 | + var json = JSON.parse(callbackObj.readCardNumber()); | ||
1655 | + var result = { | ||
1656 | + message: json.message, | ||
1657 | + card: '' | ||
1658 | + } | ||
1659 | + if(json.code == 0){ | ||
1660 | + result['card'] = json.data; | ||
1661 | + } | ||
1662 | + return result; | ||
1663 | + }; | ||
1664 | + function reader() { | ||
1665 | + var ic = readerIc() | ||
1666 | + if(ic.card) { | ||
1667 | + $("#ic").val(ic.card); | ||
1668 | + return ic.card; | ||
1669 | + } else { | ||
1670 | + bs4pop.alert(ic.message, {type : "error"}); | ||
1671 | + } | ||
1672 | + return card; | ||
1673 | + }; | ||
1674 | + // 读银行卡 | ||
1675 | + function readerBankIc() { | ||
1676 | + if (typeof(callbackObj) == "undefined") return false; | ||
1677 | + var json = JSON.parse(callbackObj.readBackCardNumber()); | ||
1678 | + var result = { | ||
1679 | + message: json.message, | ||
1680 | + card: '' | ||
1681 | + } | ||
1682 | + if(json.code == 0){ | ||
1683 | + result['card'] = json.data; | ||
1684 | + } | ||
1685 | + return result; | ||
1686 | + }; | ||
1687 | + function bankReader() { | ||
1688 | + var ic = readerBankIc() | ||
1689 | + if(ic.card) { | ||
1690 | + $("#ic").val(ic.card); | ||
1691 | + return ic.card; | ||
1692 | + } else { | ||
1693 | + bs4pop.alert(ic.message, {type : "error"}); | ||
1694 | + } | ||
1695 | + return card; | ||
1696 | + } | ||
1697 | + | ||
1698 | + //园区卡输入 | ||
1699 | + function onKeyUpEnter(e) { | ||
1700 | + | ||
1701 | + if (e.keyCode == 13) { | ||
1702 | + checkCardAndCalc(); | ||
1703 | + } | ||
1704 | + } | ||
1705 | + function checkCardAndCalc() { | ||
1706 | + var ic = $("#ic").val(); | ||
1707 | + if(ic == ""){ | ||
1708 | + $("#ic").val(""); | ||
1709 | + $("#customerName").val(""); | ||
1710 | + $("#customerPhone").val(""); | ||
1711 | + $("#customerId").val(""); | ||
1712 | + $("#accountId").val(""); | ||
1713 | + $("#ic").attr("icstatus", "-1"); | ||
1714 | + $("#balance").val(""); | ||
1715 | + calcTotalPrice(); | ||
1716 | + } | ||
1717 | + icCheck(); | ||
1718 | + } | ||
1719 | + function checkCard() { | ||
1720 | + var ic = $("#ic").val(); | ||
1721 | + if(ic == ""){ | ||
1722 | + $("#ic").val(""); | ||
1723 | + $("#customerName").val(""); | ||
1724 | + $("#customerPhone").val(""); | ||
1725 | + $("#customerId").val(""); | ||
1726 | + $("#accountId").val(""); | ||
1727 | + $("#ic").attr("icstatus", "-1"); | ||
1728 | + $("#balance").val(""); | ||
1729 | + } | ||
1730 | + icCheck(); | ||
1731 | + } | ||
1732 | + $("#ic").blur(function(){ | ||
1733 | + var viewType = $("#viewType").val(); | ||
1734 | + if(viewType =="pay"){ | ||
1735 | + checkCard() | ||
1736 | + } | ||
1737 | + }); | ||
1738 | + $("#freezeMoneySymbol").blur(function () { | ||
1739 | + freezeGtTotal(); | ||
1740 | + }) | ||
1741 | + | ||
1742 | + String.prototype.replaceAll = function(s1,s2){ | ||
1743 | + return this.replace(new RegExp(s1,"gm"),s2); | ||
1744 | + } | ||
1745 | + // 展开收起] | ||
1746 | + $('.switchshow-btn').on('click', function() { | ||
1747 | + if($(this).text() === '收起') { | ||
1748 | + $(this).text('展开') | ||
1749 | + } else { | ||
1750 | + $(this).text('收起') | ||
1751 | + } | ||
1752 | + $(this).parent().siblings('.form-group-wrap').toggleClass('height0'); | ||
1753 | + }) | ||
1754 | + function myFixed(str){ | ||
1755 | + var r = /^([0-9]+\.\d{2})5[0]*$/g; | ||
1756 | + var r1 = /^([0-9]+\.\d{2})5[0-9]*[1-9][0-9]*$/g; | ||
1757 | + if(r.test(str)){ | ||
1758 | + str = str.replace(r,"$1"); | ||
1759 | + } | ||
1760 | + else if(r1.test(str)){ | ||
1761 | + str = str.replace(r1,"$16"); | ||
1762 | + } | ||
1763 | + str = parseFloat(str).toFixed(0); | ||
1764 | + return str; | ||
1765 | + } | ||
1766 | + function viewImg(){ | ||
1767 | + if (typeof(callbackObj) == "undefined"){ | ||
1768 | + showWarning('请检查设备是否已连接!'); | ||
1769 | + return; | ||
1770 | + }else{ | ||
1771 | + var imgInfo = new Object(); | ||
1772 | + imgInfo.image1=$("#image1").val(); | ||
1773 | + imgInfo.image2=$("#image2").val(); | ||
1774 | + imgInfo.image3=$("#image3").val(); | ||
1775 | + imgInfo.image4=$("#image4").val(); | ||
1776 | + imgInfo.image5=$("#image5").val(); | ||
1777 | + imgInfo.image6=$("#image6").val(); | ||
1778 | + var result =JSON.stringify(imgInfo); | ||
1779 | + callbackObj.doorCaptureShow(result); | ||
1780 | + } | ||
1781 | + } | ||
1782 | + | ||
1783 | + | ||
1784 | + | ||
1785 | + | ||
1786 | + | ||
1787 | + function accDiv(arg1,arg2){ | ||
1788 | + var t1=0,t2=0,r1,r2; | ||
1789 | + try{ | ||
1790 | + t1=arg1.toString().split(".")[1].length}catch(e){ | ||
1791 | + }try{ | ||
1792 | + t2=arg2.toString().split(".")[1].length}catch(e){} | ||
1793 | + with(Math){ r1=Number(arg1.toString().replace(".","")) | ||
1794 | + r2=Number(arg2.toString().replace(".","")) | ||
1795 | + return (r1/r2)*pow(10,t2-t1); } | ||
1796 | + } | ||
1797 | + function accMul(arg1,arg2){ | ||
1798 | + var m=0,s1=arg1.toString(), | ||
1799 | + s2=arg2.toString(); | ||
1800 | + try{ | ||
1801 | + m+=s1.split(".")[1].length}catch(e){} | ||
1802 | + try{ | ||
1803 | + m+=s2.split(".")[1].length}catch(e){} | ||
1804 | + return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m | ||
1805 | + )} | ||
1806 | + function accAdd(arg1,arg2){ | ||
1807 | + var r1,r2,m; | ||
1808 | + try{ | ||
1809 | + r1=arg1.toString().split(".")[1].length | ||
1810 | + }catch(e){ | ||
1811 | + r1=0} try{ | ||
1812 | + r2=arg2.toString().split(".")[1].length}catch(e){r2=0} m=Math.pow(10,Math.max(r1,r2)) | ||
1813 | + return (arg1*m+arg2*m)/m | ||
1814 | + } | ||
1815 | + Number.prototype.div = function (arg){ | ||
1816 | + return accDiv(this, arg); | ||
1817 | + } | ||
1818 | + Number.prototype.mul = function (arg){ | ||
1819 | + return accMul(arg, this); | ||
1820 | + } | ||
1821 | + Number.prototype.add = function (arg){ | ||
1822 | + return accAdd(arg,this); | ||
1823 | + } | ||
1824 | +</script><script> | ||
1825 | + var weightType= $("#weightType").val(); | ||
1826 | + function checkPoundWeight(weightVal, errorbox) { | ||
1827 | + $("#weight").val(""); | ||
1828 | + var valid = true; | ||
1829 | + var grossWeight = $("#grossWeight").val(); | ||
1830 | + var tareWeight = $("#tareWeight").val(); | ||
1831 | + if (weightVal === ''|| weightVal ==undefined) { | ||
1832 | + errorbox.html("必填"); | ||
1833 | + valid = false; | ||
1834 | + } else if (!checkWeightInt(grossWeight, 'grossWeight')) { | ||
1835 | + $('#grossWeight + .defi-error').html("请输整数"); | ||
1836 | + valid = false; | ||
1837 | + } else if (!checkWeightInt(tareWeight, 'tareWeight')) { | ||
1838 | + $('#tareWeight + .defi-error').html("请输整数"); | ||
1839 | + valid = false; | ||
1840 | + } else if (0 <= weightVal && weightVal <= 999999) { | ||
1841 | + if (parseInt(grossWeight) <= parseInt(tareWeight)) { | ||
1842 | + errorbox.html("毛重需大于皮重"); | ||
1843 | + valid = false; | ||
1844 | + } else { | ||
1845 | + $("#weight").val(parseInt(grossWeight) - parseInt(tareWeight)); | ||
1846 | + $('#grossWeight + .defi-error, #tareWeight + .defi-error').html(""); | ||
1847 | + } | ||
1848 | + } else { | ||
1849 | + errorbox.html("请输0到999999之间数"); | ||
1850 | + valid = false; | ||
1851 | + } | ||
1852 | + return valid; | ||
1853 | + } | ||
1854 | + | ||
1855 | + | ||
1856 | + function checkWeightInt(weight, iderror) { | ||
1857 | + var valid = false; | ||
1858 | + if (/^\d+$/.test(weight)) { | ||
1859 | + $('#' + iderror + ' + .defi-error').html(""); | ||
1860 | + valid = true; | ||
1861 | + } | ||
1862 | + return valid; | ||
1863 | + } | ||
1864 | + | ||
1865 | + | ||
1866 | + function sumWeight() { | ||
1867 | + var num = $("#goodsNum").val(); | ||
1868 | + var itemW = $("#itemWeight").val(); | ||
1869 | + $("#weight").val(num * itemW); | ||
1870 | + } | ||
1871 | + | ||
1872 | + | ||
1873 | + if (weightType== 1) { //整车称重 | ||
1874 | + $("#grossWeight").change(function () { | ||
1875 | + checkPoundWeight($(this).val(), $("#grossWeighterror")) | ||
1876 | + }); | ||
1877 | + | ||
1878 | + $("#tareWeight").change(function () { | ||
1879 | + checkPoundWeight($(this).val(), $("#tareWeighterror")) | ||
1880 | + | ||
1881 | + }); | ||
1882 | + } else { | ||
1883 | + $("#goodsNum").keyup(function () { | ||
1884 | + sumWeight(); | ||
1885 | + }); | ||
1886 | + $("#itemWeight").keyup(function () { | ||
1887 | + sumWeight(); | ||
1888 | + }); | ||
1889 | + } | ||
1890 | + | ||
1891 | + | ||
1892 | + // 验证-- | ||
1893 | + $('form').validate(); | ||
1894 | + | ||
1895 | + $("#save_btn").click(function () { | ||
1896 | + //checkCard(); | ||
1897 | + var viewType= $("#viewType").val(); | ||
1898 | + if(viewType=='pay' ||viewType=='update'){ | ||
1899 | + if($("#handReceivableAmountLong").val()>0){ | ||
1900 | + var steveTeams = $("#steveTeams").children('option:selected').val(); | ||
1901 | + if(steveTeams==undefined || steveTeams == ""){ | ||
1902 | + flag = true; | ||
1903 | + bs4pop.confirm('请选择装卸队!', { | ||
1904 | + type: 0, | ||
1905 | + title: '提示', | ||
1906 | + btn: ['确定'] | ||
1907 | + }); | ||
1908 | + return true; | ||
1909 | + } | ||
1910 | + } | ||
1911 | + } | ||
1912 | + | ||
1913 | + | ||
1914 | + if ($("#customerId").val() == "" && $("#ic").val() != "") { | ||
1915 | + $("#customerId + label.error").text("不存在,请重输") | ||
1916 | + return; | ||
1917 | + } | ||
1918 | + | ||
1919 | + var fp = $("#freezePriceError").html(); | ||
1920 | + if (fp!=undefined && fp != "") { | ||
1921 | + return; | ||
1922 | + } | ||
1923 | + var fp = $("#freezeMoneySymbol-error").html(); | ||
1924 | + if (fp!=undefined && fp != "") { | ||
1925 | + return; | ||
1926 | + } | ||
1927 | + | ||
1928 | + if ($("#feeForm").validate().form() === true) { | ||
1929 | + var canSubmit = true; | ||
1930 | + if ($("#productArea").val() == "" || ($("#productArea").val() != "" && $("#originId").val() != "")) { | ||
1931 | + | ||
1932 | + } else { | ||
1933 | + $("#productArea + label.error").text("不存在,请重输") | ||
1934 | + canSubmit = false; | ||
1935 | + } | ||
1936 | + | ||
1937 | + if (weightType != "2") { | ||
1938 | + if ($("#carType").val() != "") { | ||
1939 | + } else { | ||
1940 | + $("#carType + label.error").text("不存在,请重输") | ||
1941 | + | ||
1942 | + canSubmit = false; | ||
1943 | + } | ||
1944 | + } | ||
1945 | + if ($("#productId").val() != "") { | ||
1946 | + | ||
1947 | + } else { | ||
1948 | + $("#productId+ label.error").text("不存在,请重输") | ||
1949 | + canSubmit = false; | ||
1950 | + } | ||
1951 | + | ||
1952 | + if ($("#inGreeterId").val() != "") { | ||
1953 | + } else { | ||
1954 | + $("#inGreeterId + label.error").text("不存在,请重输") | ||
1955 | + | ||
1956 | + canSubmit = false; | ||
1957 | + } | ||
1958 | + if ($("#outGreeterName").val() != "" && $("#outGreeterId").val() == "") { | ||
1959 | + $("#outGreeterId + label.error").text("不存在,请重输") | ||
1960 | + canSubmit = false; | ||
1961 | + } | ||
1962 | + $('.feeitemedit .fees').each(function(){ | ||
1963 | + if(this.value === '') { | ||
1964 | + bs4pop.alert("项目收费金额不能为空或小于0", {type: 0}); | ||
1965 | + canSubmit = false; | ||
1966 | + } | ||
1967 | + }) | ||
1968 | + if(optType=="gz" && weightType==1){ | ||
1969 | + if (!checkPoundWeight($("#grossWeight").val(), $("#grossWeighterror")) || !checkPoundWeight($("#tareWeight").val(), $("#tareWeighterror"))) { | ||
1970 | + canSubmit = false; | ||
1971 | + } | ||
1972 | + } | ||
1973 | + | ||
1974 | + | ||
1975 | + var itemErrorCount = $('#feeitemedit .singleRealfee.red').length; | ||
1976 | + console.log("itemErrorCount:"+itemErrorCount); | ||
1977 | + if(itemErrorCount>0){ | ||
1978 | + canSubmit = false; | ||
1979 | + bs4pop.confirm('收费项目实收栏目,有为负的金额,请调整收费项或相应计费规则!', { | ||
1980 | + type: 0, | ||
1981 | + title: '提示', | ||
1982 | + btn: ['确定'] | ||
1983 | + }); | ||
1984 | + return true; | ||
1985 | + } | ||
1986 | + if('sy'==$("#marketFlag").val()){ | ||
1987 | + var carTypeID = $("#carType").val(); | ||
1988 | + if(carTypeID==5||carTypeID==6){ | ||
1989 | + var trailerNumber =$("#trailerNumber").val(); | ||
1990 | + if(trailerNumber == ""){ | ||
1991 | + canSubmit = false; | ||
1992 | + bs4pop.confirm('该车型需要填挂号!', { | ||
1993 | + type: 0, | ||
1994 | + title: '提示', | ||
1995 | + btn: ['确定'] | ||
1996 | + }); | ||
1997 | + return true; | ||
1998 | + } | ||
1999 | + } | ||
2000 | + } | ||
2001 | + | ||
2002 | + if (canSubmit) { | ||
2003 | + $.ajax({ | ||
2004 | + type: 'post', | ||
2005 | + url: '/entranceFeeBill/edit', | ||
2006 | + data: $('#feeForm').serialize(), | ||
2007 | + dataType: 'json', | ||
2008 | + async: false, | ||
2009 | + success: function (ret) { | ||
2010 | + if (ret.success == true) { | ||
2011 | + //TLOG.component.editNewData($('#feeForm'),$("#number").val()); | ||
2012 | + bs4pop.alert(ret.msg, {type: 0}, function () { | ||
2013 | + history.go(-1); | ||
2014 | + }); | ||
2015 | + }else{ | ||
2016 | + bs4pop.alert(ret.msg, {type: 0}); | ||
2017 | + } | ||
2018 | + }, | ||
2019 | + error: function () { | ||
2020 | + bs4pop.alert("修改失败,请稍后重试!", {type: 0}, function () { | ||
2021 | + history.go(-1); | ||
2022 | + }); | ||
2023 | + } | ||
2024 | + }); | ||
2025 | + } | ||
2026 | + } | ||
2027 | + }); | ||
2028 | + | ||
2029 | + | ||
2030 | + $("#proveType").change(function () { | ||
2031 | + var ss = $(this).children('option:selected'); | ||
2032 | + $("#proveTypeName").val(ss.html()); | ||
2033 | + calcTotalPrice(); | ||
2034 | + }); | ||
2035 | + $('[name="goodsTagIds"]').change(function () { | ||
2036 | + calcTotalPrice(); | ||
2037 | + }); | ||
2038 | + | ||
2039 | + // 车型联想 | ||
2040 | + $('#autocomplete-cartype').autocomplete({ | ||
2041 | + dataType: 'json', | ||
2042 | + noCache: 1, | ||
2043 | + serviceUrl: '/api/jmsf/ajax/ctc', //数据地址 | ||
2044 | + showNoSuggestionNotice: true, | ||
2045 | + noSuggestionNotice: "不存在,请重输!", | ||
2046 | + onSearchComplete: function (query, suggestions) { | ||
2047 | + var has = false; | ||
2048 | + if (suggestions && suggestions.length > 0) { | ||
2049 | + for (var i = 0; i < suggestions.length; i++) { | ||
2050 | + if (suggestions[i].value == $('#autocomplete-cartype').val()) { | ||
2051 | + has = true; | ||
2052 | + break; | ||
2053 | + } | ||
2054 | + } | ||
2055 | + } | ||
2056 | + if ($(this).data('selectVal') != $('#autocomplete-cartype').val() && !has) { | ||
2057 | + $("#carType").val(""); | ||
2058 | + $("#ctypew").val(""); | ||
2059 | + } | ||
2060 | +// if (suggestions.length == 0) { | ||
2061 | +// $('.autocomplete-suggestions').eq(0).show(); | ||
2062 | +// $('.autocomplete-suggestions').eq(0).html('<span>该车型名称不存在,请重新输入</span>'); | ||
2063 | +// } | ||
2064 | + }, | ||
2065 | + onSelect: function (suggestion) { | ||
2066 | + $(this).data('selectVal', suggestion.value); | ||
2067 | + $("#autocomplete-cartype").val(suggestion.value); | ||
2068 | + $("#carTypeId").val(suggestion.id); | ||
2069 | + $("#ctypew").val(suggestion.data); | ||
2070 | + $("#carTypeName").val(suggestion.name); | ||
2071 | + $("#carTypeCode").val(suggestion.code); | ||
2072 | + $("#autocomplete-cartype-error").text(""); | ||
2073 | + if('' == 1){ | ||
2074 | + console.info("hasBackSkin true"); | ||
2075 | + }else { | ||
2076 | + console.info("hasBackSkin false"); | ||
2077 | + if (weightType== 1) { //整车称重 | ||
2078 | + $("#tareWeight").val(suggestion.data); | ||
2079 | + if(suggestion.data ==undefined){ | ||
2080 | + $("#autocomplete-cartype-error").text("公共车型自重未配置"); | ||
2081 | + } | ||
2082 | + checkPoundWeight(suggestion.data, $("#tareWeighterror")) | ||
2083 | + } | ||
2084 | + } | ||
2085 | + | ||
2086 | + calcTotalPrice(); | ||
2087 | + } | ||
2088 | + }); | ||
2089 | + | ||
2090 | + //商品联想 | ||
2091 | + $('#autocomplete-category').autocomplete({ | ||
2092 | + serviceUrl: '/api/jmsf/ajax/category', | ||
2093 | + dataType: 'json', | ||
2094 | + noCache: 1, | ||
2095 | + params: {'allFlag': false}, | ||
2096 | + showNoSuggestionNotice: true, | ||
2097 | + noSuggestionNotice: "不存在,请重输!", | ||
2098 | + onSearchComplete: function (query, suggestions) { | ||
2099 | + var has = false; | ||
2100 | + if (suggestions && suggestions.length > 0) { | ||
2101 | + for (var i = 0; i < suggestions.length; i++) { | ||
2102 | + if (suggestions[i].value == $('#autocomplete-category').val()) { | ||
2103 | + has = true; | ||
2104 | + break; | ||
2105 | + } | ||
2106 | + } | ||
2107 | + } | ||
2108 | + if ($(this).data('selectVal') != $('#autocomplete-category').val() && !has) { | ||
2109 | + $("#productId").val(""); | ||
2110 | + } | ||
2111 | + | ||
2112 | + }, | ||
2113 | + onSelect: function (suggestion) { | ||
2114 | + $(this).data('selectVal', suggestion.value); | ||
2115 | + $("#autocomplete-category").val(suggestion.value); | ||
2116 | + $("#productId").val(suggestion.id); | ||
2117 | + $("#parentName").val(suggestion.parentName); | ||
2118 | + if(suggestion.parent==0){ | ||
2119 | + $("#categoryId").val(suggestion.id); | ||
2120 | + }else { | ||
2121 | + $("#categoryId").val(suggestion.parent); | ||
2122 | + } | ||
2123 | + $("#autocomplete-category + label.error").text(""); | ||
2124 | + calcTotalPrice(); | ||
2125 | + findHandTeam(); | ||
2126 | + } | ||
2127 | + }); | ||
2128 | + | ||
2129 | + $("#autocomplete-cartype").keyup(function () { | ||
2130 | + if ($(this).val() == "" && '1' == 1) { | ||
2131 | + $("#ctypew").val(""); | ||
2132 | + } | ||
2133 | + }); | ||
2134 | + | ||
2135 | + $('#inGreeterName').autocomplete({ | ||
2136 | + serviceUrl: '/api/jmsf/ajax/greeteName', | ||
2137 | + dataType: 'json', | ||
2138 | + noCache: 1, | ||
2139 | + params: {'allFlag': false}, | ||
2140 | + showNoSuggestionNotice: true, | ||
2141 | + noSuggestionNotice: "不存在,请重输!", | ||
2142 | + onSearchComplete: function (query, suggestions) { | ||
2143 | + var has = false; | ||
2144 | + if (suggestions && suggestions.length > 0) { | ||
2145 | + for (var i = 0; i < suggestions.length; i++) { | ||
2146 | + if (suggestions[i].value == $('#inGreeterName').val()) { | ||
2147 | + has = true; | ||
2148 | + break; | ||
2149 | + } | ||
2150 | + } | ||
2151 | + } | ||
2152 | + if ($(this).data('selectVal') != $('#inGreeterName').val() && !has) { | ||
2153 | + $("#inGreeterId").val(""); | ||
2154 | + } | ||
2155 | + }, | ||
2156 | + onSelect: function (suggestion) { | ||
2157 | + $(this).data('selectVal', suggestion.value); | ||
2158 | + $("#inGreeterName").val(suggestion.name); | ||
2159 | + $("#inGreeterId").val(suggestion.data); | ||
2160 | + $("#inGreeterName + label.error").text(""); | ||
2161 | + | ||
2162 | + } | ||
2163 | + }); | ||
2164 | + | ||
2165 | + $('#outGreeterName').autocomplete({ | ||
2166 | + serviceUrl: '/api/jmsf/ajax/greeteName', | ||
2167 | + dataType: 'json', | ||
2168 | + noCache: 1, | ||
2169 | + params: {'allFlag': false}, | ||
2170 | + showNoSuggestionNotice: true, | ||
2171 | + noSuggestionNotice: "不存在,请重输!", | ||
2172 | + onSearchComplete: function (query, suggestions) { | ||
2173 | + var has = false; | ||
2174 | + if (suggestions && suggestions.length > 0) { | ||
2175 | + for (var i = 0; i < suggestions.length; i++) { | ||
2176 | + if (suggestions[i].value == $('#outGreeterName').val()) { | ||
2177 | + has = true; | ||
2178 | + break; | ||
2179 | + } | ||
2180 | + } | ||
2181 | + } | ||
2182 | + if ($(this).data('selectVal') != $('#outGreeterName').val() && !has) { | ||
2183 | + $("#outGreeterId").val(""); | ||
2184 | + } | ||
2185 | + console.log(suggestions.length); | ||
2186 | + }, | ||
2187 | + onSelect: function (suggestion) { | ||
2188 | + $(this).data('selectVal', suggestion.value); | ||
2189 | + $("#outGreeterName").val(suggestion.name); | ||
2190 | + $("#outGreeterId").val(suggestion.data); | ||
2191 | + $("#outGreeterName + label.error").text(""); | ||
2192 | + | ||
2193 | + } | ||
2194 | + }); | ||
2195 | + | ||
2196 | + // 修改项目金额时仅收费项目可改 | ||
2197 | + $('.modify-feeitem').on('click', function() { | ||
2198 | + $('#feeitemedit .chargeitem :checked').siblings('.fees').attr('readonly', false); | ||
2199 | + /*$('#feeitemedit .chargeitem :checked').next('.fees').each(function () { | ||
2200 | + $(this).attr("readonly", false); | ||
2201 | + })*/ | ||
2202 | + $('#updateFeeItems').val(2); | ||
2203 | + $('#correctDiscount').val(2); | ||
2204 | + $("input[name='billItemCheckIds']").each(function () { | ||
2205 | + $(this).attr("onclick", "return false"); | ||
2206 | + }) | ||
2207 | + }) | ||
2208 | + | ||
2209 | + | ||
2210 | + /*****************************************自定义事件区 end**************************************/ | ||
2211 | +</script><script> | ||
2212 | + | ||
2213 | + function winHrefList(){ | ||
2214 | + window.location.href = "http://jmsf.diligrp.com/entranceFeeBill/list.html" | ||
2215 | + } | ||
2216 | + // 验证-- | ||
2217 | + $('form').validate(); | ||
2218 | + $('#pay-btn').on('click', function(){ | ||
2219 | + $("#optType").val(1); | ||
2220 | + doBiz(1,""); | ||
2221 | + }); | ||
2222 | + // 仅冻结页面校验冻结金额>缴费金额 | ||
2223 | + function freezeGtTotal() { | ||
2224 | + if($("#marketFlag").val()=='cc'){ | ||
2225 | + freezeGtTotalCC(); | ||
2226 | + }else { | ||
2227 | + freezeGtTotalSY(); | ||
2228 | + } | ||
2229 | + } | ||
2230 | + function freezeGtTotalSY() { | ||
2231 | + var price = $("#freezeMoneySymbol").val(); | ||
2232 | + if(price == undefined || price == ""){ | ||
2233 | + $("#freezeMoneySymbol").val("0"); | ||
2234 | + price = "0"; | ||
2235 | + } | ||
2236 | + price=price.replace(new RegExp(",", 'g'), "") | ||
2237 | + var freezePrice = new Number(price); | ||
2238 | + var totalFreeze = $("#freezePriceVal").val(); | ||
2239 | + totalFreeze=totalFreeze.replace(new RegExp(",", 'g'),""); | ||
2240 | + var totalPrice = new Number(totalFreeze); | ||
2241 | + if(freezePrice<totalPrice){ | ||
2242 | + var error = $("#freezeMoneySymbol-error"); | ||
2243 | + if(error==undefined || error.text()==""){ | ||
2244 | + $("#freezePriceError").html("不能小于所有费用项的应收金额之和") | ||
2245 | + $("#freezeMoneySymbol").attr("aria-invalid",true); | ||
2246 | + $("#freezeMoneySymbol").removeClass("is-valid"); | ||
2247 | + $("#freezeMoneySymbol").addClass("is-invalid"); | ||
2248 | + return false; | ||
2249 | + }else { | ||
2250 | + $("#freezePriceError").html(""); | ||
2251 | + } | ||
2252 | + }else { | ||
2253 | + $("#freezePriceError").html("") | ||
2254 | + } | ||
2255 | + $("#freezePrice").val(price) | ||
2256 | + } | ||
2257 | + | ||
2258 | + // 仅冻结页面校验冻结金额>缴费金额 | ||
2259 | + function freezeGtTotalCC() { | ||
2260 | + var price = $("#freezeMoneySymbol").val(); | ||
2261 | + if(price == undefined || price == ""){ | ||
2262 | + $("#freezeMoneySymbol").val("0"); | ||
2263 | + price = "0"; | ||
2264 | + } | ||
2265 | + price=price.replace(new RegExp(",", 'g'), "") | ||
2266 | + var freezePrice = new Number(price); | ||
2267 | + if (freezePrice<=0){ | ||
2268 | + var error = $("#freezeMoneySymbol-error"); | ||
2269 | + if(error==undefined || error.text()==""){ | ||
2270 | + $("#freezePriceError").html("冻结金额不能小于1") | ||
2271 | + return false; | ||
2272 | + }else { | ||
2273 | + $("#freezePriceError").html(""); | ||
2274 | + } | ||
2275 | + }else { | ||
2276 | + $("#freezePriceError").html("") | ||
2277 | + } | ||
2278 | + $("#freezePrice").val(price) | ||
2279 | + } | ||
2280 | + | ||
2281 | + $('#freeze-btn-auth').on('click', function(){ | ||
2282 | + freezeGtTotal(); | ||
2283 | + $("#optType").val(2); | ||
2284 | + doBiz(2,""); | ||
2285 | + }); | ||
2286 | + $('#freeze-btn').on('click', function(){ | ||
2287 | + $("#optType").val(2); | ||
2288 | + doBiz(2,""); | ||
2289 | + }); | ||
2290 | + $('#unfreeze-btn').on('click', function(){ | ||
2291 | + $("#optType").val(3); | ||
2292 | + doBiz(3,""); | ||
2293 | + }); | ||
2294 | + | ||
2295 | + function checkInfo(type) { | ||
2296 | + var flag = false; | ||
2297 | + var parea =$("#productArea").val(); | ||
2298 | + var fp = $("#freezePriceError").html(); | ||
2299 | + if (fp!=undefined && fp != "") { | ||
2300 | + return true; | ||
2301 | + } | ||
2302 | + | ||
2303 | + $("#feeForm").validate(); | ||
2304 | + if($("#feeForm").validate().form() != true){ | ||
2305 | + return true; | ||
2306 | + } | ||
2307 | + | ||
2308 | + if(parea!=undefined && parea.length>0){ | ||
2309 | + var oid= $("#originId").val(); | ||
2310 | + if(oid!=null && oid.length == 0){ | ||
2311 | + flag = true; | ||
2312 | + showWarning('请选择正确的货物产地!'); | ||
2313 | + //bs4pop.alert('请选择正确的货物产地!', {type: 'error'}); | ||
2314 | + } | ||
2315 | + } | ||
2316 | + if(flag){ | ||
2317 | + return true; | ||
2318 | + } | ||
2319 | + if(type == 1){ | ||
2320 | + if($("#handReceivableAmountLong").val()>0){ | ||
2321 | + var steveRatio = $("#handlingRatio").children('option:selected').val(); | ||
2322 | + if(steveRatio==undefined || steveRatio == ""){ | ||
2323 | + flag = true; | ||
2324 | + showWarning('请选择卸货比例!'); | ||
2325 | + return true; | ||
2326 | + } | ||
2327 | + } | ||
2328 | + } | ||
2329 | + if(flag){ | ||
2330 | + return true; | ||
2331 | + } | ||
2332 | + if(type!=3){//type为3是解冻 | ||
2333 | + | ||
2334 | + if($("#handReceivableAmountLong").val()>0){ | ||
2335 | + | ||
2336 | + var steveTeams = $("#steveTeams").children('option:selected').val(); | ||
2337 | + if(steveTeams==undefined || steveTeams == ""){ | ||
2338 | + flag = true; | ||
2339 | + showWarning('请选择装卸队!'); | ||
2340 | + return true; | ||
2341 | + } | ||
2342 | + } | ||
2343 | + | ||
2344 | + | ||
2345 | + var checkItemAllZero = $("#checkItemAllZero").val(); | ||
2346 | + | ||
2347 | + if (!$("#unitPrice").val() || $("#unitPrice").val() == 0) { | ||
2348 | + flag = true; | ||
2349 | + //bs4pop.alert('当前商品单价为空', {type: 0}); | ||
2350 | + showWarning('当前商品单价为空!'); | ||
2351 | + return true; | ||
2352 | + } | ||
2353 | + | ||
2354 | + if(checkItemAllZero == "0"){ | ||
2355 | + flag = true; | ||
2356 | + showWarning('收费项目,没有匹配任何计费规则!'); | ||
2357 | + return true; | ||
2358 | + } | ||
2359 | + var itemErrorCount = $('#feeitemedit .singleRealfee.red').length; | ||
2360 | + console.log("itemErrorCount:"+itemErrorCount); | ||
2361 | + if(itemErrorCount>0){ | ||
2362 | + flag = true; | ||
2363 | + showWarning('收费项目实收栏目,有为负的金额,请调整收费项或相应计费规则!'); | ||
2364 | + //bs4pop.alert('收费项目实收栏目,有为负的金额,请调整收费项或相应计费规则!', {type: 'error'}); | ||
2365 | + | ||
2366 | + return true; | ||
2367 | + } | ||
2368 | + //变更 | ||
2369 | + var totalMoney = $("#totalAmount").val(); | ||
2370 | + var freezePrice = $("#freezePrice").val(); | ||
2371 | + var receivable = $("#receivableAmount").val(); | ||
2372 | + var discount = $("#discountAmountLong").val(); | ||
2373 | + var receivableNum = new Number(receivable); | ||
2374 | + var discountNum = new Number(discount); | ||
2375 | + console.log("应收:"+receivableNum+",优惠:"+discountNum+",实收:"+totalMoney+",代收:"+$("#handCollectionAmount").val()); | ||
2376 | + if(receivableNum<discountNum){ | ||
2377 | + flag = true; | ||
2378 | + showWarning('优惠总额已超出应收金额,无法交费!'); | ||
2379 | + //bs4pop.alert('优惠总额已超出应收金额,无法交费!', {type: 'error'}); | ||
2380 | + return true; | ||
2381 | + } | ||
2382 | + } | ||
2383 | + if(flag){ | ||
2384 | + return true; | ||
2385 | + } | ||
2386 | + /*var shipperId = $("#shipperId").val(); | ||
2387 | + if(shipperId==""){ | ||
2388 | + flag = true; | ||
2389 | + bs4pop.confirm('该货主不存在!', { | ||
2390 | + type: 0, | ||
2391 | + title: '提示', | ||
2392 | + btn: ['确定'] | ||
2393 | + }); | ||
2394 | + } | ||
2395 | + if(flag){ | ||
2396 | + return true; | ||
2397 | + }*/ | ||
2398 | + var actualMoneySymbol = $("#actualMoneySymbol").val(); | ||
2399 | + var ic = $("#ic").val(); | ||
2400 | + var id = $("#idFee").val(); | ||
2401 | + | ||
2402 | + var icstatus = $("#ic").attr("icstatus"); | ||
2403 | + if(icstatus != 1){ | ||
2404 | + flag = true; | ||
2405 | + showWarning('此卡异常,不能交易!'); | ||
2406 | + } | ||
2407 | + if(flag){ | ||
2408 | + return true; | ||
2409 | + } | ||
2410 | + if(type!=3) { | ||
2411 | + icCheck(); | ||
2412 | + } | ||
2413 | + if(flag){ | ||
2414 | + return true; | ||
2415 | + }else { | ||
2416 | + return false; | ||
2417 | + } | ||
2418 | + } | ||
2419 | + | ||
2420 | + function doBiz(type,authIc){ | ||
2421 | + if(checkInfo(type)) { | ||
2422 | + return; | ||
2423 | + } | ||
2424 | + if(type==2){//"冻结" | ||
2425 | + //授权需注释掉 | ||
2426 | + openFrame(2,"");return; | ||
2427 | + layer.open({ | ||
2428 | + area: ['400px', '200px'], | ||
2429 | + title: '冻结授权', | ||
2430 | + content: ['/entranceFeeBill/auth.do', 'no'], //iframe的url | ||
2431 | + btn: ['确定', '取消'], | ||
2432 | + yes: function (index, layero) { | ||
2433 | + //var ic = "aaa"; | ||
2434 | + var ic = reader(); | ||
2435 | + if (typeof(ic) == "undefined") { | ||
2436 | + showWarning('请检查读卡的设备是否已连接!'); | ||
2437 | + } else if (ic == -1) { | ||
2438 | + showWarning('读卡异常,请重新放置卡!'); | ||
2439 | + } else { | ||
2440 | + var u = ic; | ||
2441 | + $.ajax({ | ||
2442 | + url: "http://mg.nong12.com/loginControl/doLoginForNumber.do", | ||
2443 | + dataType: 'jsonp', | ||
2444 | + data: {number: ic, type: 1}, | ||
2445 | + jsonp: 'callback', | ||
2446 | + async:true, | ||
2447 | + success: function (result) { | ||
2448 | + var status = $("#status").val(); | ||
2449 | + var id = $("#idFee").val(); | ||
2450 | + if (result.success == true) { | ||
2451 | + var url = '/entranceFeeBillPay/toPayOpt/2/1?id=' + id + '&status=' + status + "&ic=" + ic; | ||
2452 | + $.ajax({ | ||
2453 | + type: 'get', | ||
2454 | + url: url + "&authKey=" + result.sessionId, | ||
2455 | + success: function (ret) { | ||
2456 | + openFrame(2,ic); | ||
2457 | + }, | ||
2458 | + error: function () { | ||
2459 | + showWarning('该用户当前无冻结操作权限,请先确认已开通!'); | ||
2460 | + } | ||
2461 | + }); | ||
2462 | + | ||
2463 | + } else { | ||
2464 | + showWarning('该用户当前无冻结操作权限,请先确认已开通!'); | ||
2465 | + } | ||
2466 | + }, | ||
2467 | + timeout: 3000 | ||
2468 | + }); | ||
2469 | + } | ||
2470 | + //按钮【确认】的回调 | ||
2471 | +// layer.close(index); | ||
2472 | + }, | ||
2473 | + btn2: function (index, layero) { | ||
2474 | + layer.close(index); | ||
2475 | + } | ||
2476 | + }); | ||
2477 | + }else{ | ||
2478 | + //交费 | ||
2479 | + var uItem =$("#updateFeeItems").val(); | ||
2480 | + if(uItem == 2 && type==1){ | ||
2481 | + $("#gz-tag").show(); | ||
2482 | + | ||
2483 | + bs4pop.confirm('当前收费单系统记录提示更正过收费项目费用,因此各收费项费用和收费总额不会自动更新,请确认是否按照当前费用进行交费?', { | ||
2484 | + type: 0, | ||
2485 | + title: '提示', | ||
2486 | + btn: ['确定', '取消'], | ||
2487 | + yes: function (index, layero) { | ||
2488 | + openFrame(type,authIc); | ||
2489 | + }, | ||
2490 | + btn2: function (index, bs4popo) { | ||
2491 | + | ||
2492 | + } | ||
2493 | + }) | ||
2494 | + }else{ | ||
2495 | + openFrame(type,authIc); | ||
2496 | + } | ||
2497 | + } | ||
2498 | + | ||
2499 | + } | ||
2500 | + function openFrame(type,authIc) { | ||
2501 | + var status = $("#status").val(); | ||
2502 | + var height = "450px"; | ||
2503 | + | ||
2504 | + var iccategroy = $("#ic").attr("iccategroy"); | ||
2505 | + if(iccategroy == 30){ | ||
2506 | + var height = "360px"; | ||
2507 | + | ||
2508 | + } | ||
2509 | + var opttext = "交费"; | ||
2510 | + var id=$("#idFee").val(); | ||
2511 | + var totalMoney = $("#totalAmount").val(); | ||
2512 | + if(totalMoney == ""){ | ||
2513 | + totalMoney = 0; | ||
2514 | + } | ||
2515 | + var freezePrice = $("#freezeMoneySymbol").val(); | ||
2516 | + var ic = $("#ic").val(); | ||
2517 | + var id = $("#idFee").val(); | ||
2518 | + var pwdUrl ='/entranceFeeBill/payPassword.action?id='+id+'&totalMoney='+totalMoney+"&ic="+ic+"&type="+type+"&icAuth="+authIc+"&freezePrice="+freezePrice; | ||
2519 | + var doUrl='/entranceTrade/doPay.action' | ||
2520 | + | ||
2521 | + if(type==2){ | ||
2522 | + opttext="冻结" | ||
2523 | + }else if(type==3){ | ||
2524 | + opttext="解冻" | ||
2525 | + doUrl='/entranceTrade/unfreeze.action'; | ||
2526 | + } | ||
2527 | + $("#optUrl").val(doUrl); | ||
2528 | + var flag = false; | ||
2529 | + payClickHandler(pwdUrl) | ||
2530 | + } | ||
2531 | + function printDirect1(id,type) { | ||
2532 | + console.info("不用了。。。payJs printDirect") | ||
2533 | + if($("#marketFlag").val()=='cc'){ | ||
2534 | + printDirectCC(id,type); | ||
2535 | + }else { | ||
2536 | + printDirectSY(id,type); | ||
2537 | + } | ||
2538 | + } | ||
2539 | + function printDirectCC(id,type){ | ||
2540 | + | ||
2541 | + var isPreview=2;// 1 预览,0:打印;2:直接打印 | ||
2542 | + var reprint = 0;//1补打;0:打印 | ||
2543 | + var status = $("#status").val(); | ||
2544 | + if(typeof callbackObj != 'undefined'){ | ||
2545 | + window.printFinish=function(){ | ||
2546 | + if(isPreview == "2"){ | ||
2547 | + if(type == 1){ | ||
2548 | + /* bs4pop.alert("交费成功", {type: 0}, function () { | ||
2549 | + history.go(-source); | ||
2550 | + });*/ | ||
2551 | + bs4pop.confirm('交费成功', { | ||
2552 | + icon: 1, | ||
2553 | + type: 0, | ||
2554 | + title: '提示', | ||
2555 | + btn: ['前往称重', '继续交费'], | ||
2556 | + yes: function(index, layero){ | ||
2557 | + //cancel(); | ||
2558 | + callbackObj.doorWeightShow("http://jmsf.diligrp.com:8385/entranceFeeBill/list.html"); | ||
2559 | + }, | ||
2560 | + btn2: function(index, layero){ | ||
2561 | + cancel(); | ||
2562 | + } | ||
2563 | + }); | ||
2564 | + }else if(type == 2){ | ||
2565 | + /*layer.alert("冻结成功", {type: 0}, function () { | ||
2566 | + history.go(-source); | ||
2567 | + });*/ | ||
2568 | + bs4pop.confirm('冻结成功', { | ||
2569 | + icon: 1, | ||
2570 | + type: 0, | ||
2571 | + title: '提示', | ||
2572 | + btn: ['前往称重', '继续交费'], | ||
2573 | + yes: function(index, layero){ | ||
2574 | + callbackObj.doorWeightShow("http://jmsf.diligrp.com:8385/entranceFeeBill/list.html"); | ||
2575 | + }, | ||
2576 | + btn2: function(index, layero){ | ||
2577 | + cancel(); | ||
2578 | + } | ||
2579 | + }); | ||
2580 | + }else{ | ||
2581 | + bs4pop.alert("解冻成功", {type: 0}, function () { | ||
2582 | + cancel(); | ||
2583 | + }); | ||
2584 | + | ||
2585 | + } | ||
2586 | + } | ||
2587 | + } | ||
2588 | + | ||
2589 | + var paramStr =""; | ||
2590 | + if(isPreview == "1"){ | ||
2591 | + paramStr = loadPrintHtmlData(); | ||
2592 | + }else{ | ||
2593 | + var data=loadPrintData(id,reprint); | ||
2594 | + if(!data){ | ||
2595 | + return; | ||
2596 | + } | ||
2597 | + paramStr = JSON.stringify(data.item); | ||
2598 | + } | ||
2599 | + if(paramStr==""){ | ||
2600 | + return; | ||
2601 | + } | ||
2602 | + console.log("--:"+paramStr); | ||
2603 | + callbackObj.printDirect(paramStr,"DoorStatementsDocument"); | ||
2604 | + | ||
2605 | + if(type == 1){ | ||
2606 | + var feedbackAmount = $("#collectionAmount").val(); | ||
2607 | + if(feedbackAmount>0){ | ||
2608 | + var dataFeedbackOrderStr= loadFeedbackPrintData(id,reprint); | ||
2609 | + if(!dataFeedbackOrderStr){ | ||
2610 | + }else{ | ||
2611 | + var paramFeedbackOrderStr = JSON.stringify(dataFeedbackOrderStr.item); | ||
2612 | + callbackObj.printDirect(paramFeedbackOrderStr,"DoorStatementsDocument"); | ||
2613 | + } | ||
2614 | + } | ||
2615 | + } | ||
2616 | + }else{ | ||
2617 | + showWarning('请检查打印的设备是否已连接'); | ||
2618 | + } | ||
2619 | + } | ||
2620 | + function printDirectSY(id,type){ | ||
2621 | + var source=$("#source").val(); | ||
2622 | + | ||
2623 | + var isPreview=2;// 1 预览,0:打印;2:直接打印 | ||
2624 | + var reprint = 0;//1补打;0:打印 | ||
2625 | + var status = $("#status").val(); | ||
2626 | + if(typeof callbackObj != 'undefined'){ | ||
2627 | + window.printFinish=function(){ | ||
2628 | + if(isPreview == "2"){ | ||
2629 | + if(type == 1){ | ||
2630 | + bs4pop.alert("交费成功", {type: 0}, function () { | ||
2631 | + history.go(-source); | ||
2632 | + }); | ||
2633 | + }else if(type == 2){ | ||
2634 | + bs4pop.alert("冻结成功", {type: 0}, function () { | ||
2635 | + history.go(-source); | ||
2636 | + }); | ||
2637 | + }else{ | ||
2638 | + bs4pop.alert("解冻成功", {type: 0}, function () { | ||
2639 | + history.go(-1); | ||
2640 | + }); | ||
2641 | + } | ||
2642 | + } | ||
2643 | + } | ||
2644 | + | ||
2645 | + var paramStr =""; | ||
2646 | + if(isPreview == "1"){ | ||
2647 | + paramStr = loadPrintHtmlData(); | ||
2648 | + console.log("-1-打印预览信息:"+paramStr); | ||
2649 | + callbackObj.printDirect(paramStr,"DoorStatementsDocument"); | ||
2650 | + return | ||
2651 | + }else{ | ||
2652 | + var data=loadPrintData(id,reprint); | ||
2653 | + if(!data){ | ||
2654 | + return; | ||
2655 | + } | ||
2656 | + paramStr = JSON.stringify(data.item); | ||
2657 | + } | ||
2658 | + if(paramStr==""){ | ||
2659 | + return; | ||
2660 | + } | ||
2661 | + console.log("-1-打印信息:"+paramStr); | ||
2662 | + callbackObj.printDirect(paramStr,"DoorStatementsDocument"); | ||
2663 | + if(type == 1){ | ||
2664 | + var handCollectionAmount = $("#handCollectionAmount").val(); | ||
2665 | + if(handCollectionAmount>0){ | ||
2666 | + var dataSteveOrderStr= loadPrintSteveOrderData(id,reprint); | ||
2667 | + if(!dataSteveOrderStr){ | ||
2668 | + }else{ | ||
2669 | + var paramSteveOrderStr = JSON.stringify(dataSteveOrderStr.item); | ||
2670 | + callbackObj.printDirect(paramSteveOrderStr,"DoorStatementsDocument"); | ||
2671 | + } | ||
2672 | + } | ||
2673 | + | ||
2674 | + if($("#marketFlag").val()=='qd'){ | ||
2675 | + return; | ||
2676 | + } | ||
2677 | + var feedbackAmount = $("#ccollectionLong").val(); | ||
2678 | + if(feedbackAmount>0){ | ||
2679 | + var dataFeedbackOrderStr= loadFeedbackPrintData(id,reprint); | ||
2680 | + if(!dataFeedbackOrderStr){ | ||
2681 | + }else{ | ||
2682 | + var paramFeedbackOrderStr = JSON.stringify(dataFeedbackOrderStr.item); | ||
2683 | + callbackObj.printDirect(paramFeedbackOrderStr,"DoorStatementsDocument"); | ||
2684 | + } | ||
2685 | + } | ||
2686 | + } | ||
2687 | + }else{ | ||
2688 | + showWarning('请检查打印的设备是否已连接'); | ||
2689 | + } | ||
2690 | + } | ||
2691 | + function print(id,isPreview){ | ||
2692 | + //var result = loadPrintSteveOrderData(582,1);console.log("--result:"+result); | ||
2693 | + //var isPreview=0;// 1 预览,0:打印;2:直接打印 | ||
2694 | + var reprint = 0;//1补打;0:打印 | ||
2695 | + var status = $("#status").val(); | ||
2696 | + if(typeof callbackObj != 'undefined'){ | ||
2697 | + window.printFinish=function(){ | ||
2698 | + if(isPreview == "2"){ | ||
2699 | + if(status == 2 || status == 3){ | ||
2700 | + bs4pop.alert("交费成功", {type: 0}, function () { | ||
2701 | + history.go(-1); | ||
2702 | + }); | ||
2703 | + }else{ | ||
2704 | + bs4pop.alert("冻结成功", {type: 0}, function () { | ||
2705 | + history.go(-1); | ||
2706 | + }); | ||
2707 | + } | ||
2708 | + } | ||
2709 | + } | ||
2710 | + | ||
2711 | + var paramStr =""; | ||
2712 | + if(isPreview == "1"){ | ||
2713 | + paramStr = loadPrintHtmlData(); | ||
2714 | + console.log("打印预览信息--:"+paramStr); | ||
2715 | + callbackObj.printPreview(paramStr,isPreview,"DoorStatementsDocument",reprint); | ||
2716 | + return; | ||
2717 | + }else{ | ||
2718 | + var data=loadPrintData(id,reprint); | ||
2719 | + if(!data){ | ||
2720 | + return; | ||
2721 | + } | ||
2722 | + paramStr = JSON.stringify(data.item); | ||
2723 | + } | ||
2724 | + if(paramStr==""){ | ||
2725 | + return; | ||
2726 | + } | ||
2727 | + console.log("打印信息--:"+paramStr); | ||
2728 | + callbackObj.printPreview(paramStr,isPreview,"DoorStatementsDocument",reprint); | ||
2729 | + var handCollectionAmount = $("#handCollectionAmount").val(); | ||
2730 | + if(handCollectionAmount>0){ | ||
2731 | + var dataSteveOrderStr= loadPrintSteveOrderData(id,reprint); | ||
2732 | + if(!dataSteveOrderStr){ | ||
2733 | + return; | ||
2734 | + } | ||
2735 | + var paramSteveOrderStr = JSON.stringify(dataSteveOrderStr.item); | ||
2736 | + callbackObj.printPreview(paramSteveOrderStr,isPreview,"DoorStatementsDocument",reprint); | ||
2737 | + } | ||
2738 | + }else{ | ||
2739 | + showWarning('请检查打印的设备是否已连接'); | ||
2740 | + } | ||
2741 | + } | ||
2742 | + //加载打印数据 | ||
2743 | + function loadPrintData(id,reprint){ | ||
2744 | + console.log("调用打印信息:"+id); | ||
2745 | + var result; | ||
2746 | + $.ajax({ | ||
2747 | + url:'/entrancePrint/loadPrintData.action?id='+id+'&reprint='+reprint, | ||
2748 | + type:'GET', | ||
2749 | + dataType:'json', | ||
2750 | + async:false, | ||
2751 | + success:function(data){ | ||
2752 | + if(data.code != '0'){ | ||
2753 | + bs4pop.alert(data.msg,{type:0,title:"提示"}); | ||
2754 | + return; | ||
2755 | + } | ||
2756 | + result=data; | ||
2757 | + }, | ||
2758 | + error:function(){ | ||
2759 | + showWarning('加载打印数据出错'); | ||
2760 | + } | ||
2761 | + }); | ||
2762 | + return result; | ||
2763 | + } | ||
2764 | + function loadPrintSteveOrderData(id,reprint){ | ||
2765 | + var result; | ||
2766 | + $.ajax({ | ||
2767 | + url:'/entrancePrint/loadPrintSteveOrderData.action?id='+id+'&reprint='+reprint, | ||
2768 | + type:'GET', | ||
2769 | + dataType:'json', | ||
2770 | + async:false, | ||
2771 | + success:function(data){ | ||
2772 | + if(data.code != '0'){ | ||
2773 | + bs4pop.alert(data.msg,{type:0,title:"提示"}); | ||
2774 | + return; | ||
2775 | + } | ||
2776 | + if(data.msg == 0){ | ||
2777 | + return; | ||
2778 | + } | ||
2779 | + result=data; | ||
2780 | + }, | ||
2781 | + error:function(){ | ||
2782 | + showWarning('加载打印数据出错'); | ||
2783 | + } | ||
2784 | + }); | ||
2785 | + return result; | ||
2786 | + } | ||
2787 | + function loadFeedbackPrintData(id,reprint){ | ||
2788 | + var result; | ||
2789 | + $.ajax({ | ||
2790 | + url:'/entrancePrint/loadFeedbackPrintData.action?id='+id+'&reprint='+reprint, | ||
2791 | + type:'GET', | ||
2792 | + dataType:'json', | ||
2793 | + async:false, | ||
2794 | + success:function(data){ | ||
2795 | + if(data.code != '0'){ | ||
2796 | + showWarning(data.msg); | ||
2797 | + return; | ||
2798 | + } | ||
2799 | + if(data.msg == 0){ | ||
2800 | + return; | ||
2801 | + } | ||
2802 | + result=data; | ||
2803 | + }, | ||
2804 | + error:function(){ | ||
2805 | + showWarning('加载打印数据出错'); | ||
2806 | + } | ||
2807 | + }); | ||
2808 | + return result; | ||
2809 | + } | ||
2810 | + //加载打印数据 | ||
2811 | + function loadPrintHtmlData(){ | ||
2812 | + var printInfo = new Object(); | ||
2813 | + var statusText = "" | ||
2814 | + if($("#optType").val()==2){ | ||
2815 | + statusText="(已冻结)" | ||
2816 | + }else{ | ||
2817 | + statusText="(已交费)" | ||
2818 | + } | ||
2819 | + var number = $("#market_short").val()+"JMSF" + $("#number").val()+statusText; | ||
2820 | + printInfo.number=number; | ||
2821 | + var c = $("#customerName").val(); | ||
2822 | + var ic = $("#ic").val() | ||
2823 | + var customer =""; | ||
2824 | + if(c=="" || ic==""){ | ||
2825 | + customer = c+ic; | ||
2826 | + }else{ | ||
2827 | + customer = c+"("+ic+")" | ||
2828 | + } | ||
2829 | + printInfo.customer=customer | ||
2830 | + printInfo.productName=$("#product").val(); | ||
2831 | + var grossWeight=$("#grossWeight").val() | ||
2832 | + if(grossWeight==0){ | ||
2833 | + grossWeight =""; | ||
2834 | + } | ||
2835 | + | ||
2836 | + printInfo.grossWeight=grossWeight;// 毛重 | ||
2837 | + var tareWeight = $("#tareWeight").val(); | ||
2838 | + printInfo.tareWeight=tareWeight;//皮重 | ||
2839 | + //var myselect=$("#dep"); | ||
2840 | + var myselect=document.getElementById("dep"); | ||
2841 | + var depName = $("#depName").val(); | ||
2842 | + if(depName == ""){ | ||
2843 | + depName ="请选择部门"; | ||
2844 | + } | ||
2845 | + /*var index=myselect.selectedIndex ; | ||
2846 | + if(index != undefined){ | ||
2847 | + if(myselect.options[index].text != "请选择"){ | ||
2848 | + depName = myselect.options[index].text; | ||
2849 | + } | ||
2850 | + }else{ | ||
2851 | + depName = $("#depName").val(); | ||
2852 | + }*/ | ||
2853 | + var regionName = $("#regionName").val(); | ||
2854 | + printInfo.receiveDept= depName +" "+ regionName; | ||
2855 | + printInfo.phone=$("#customerPhone").val(); | ||
2856 | + var producerName = $("#productArea").val(); | ||
2857 | + var strs= new Array(); | ||
2858 | + strs=producerName.split(","); //字符分割 | ||
2859 | + var producer = strs[0] | ||
2860 | + if(strs.length>1){ | ||
2861 | + producer=producer +strs[strs.length-1] | ||
2862 | + } | ||
2863 | + printInfo.producer=producer;// 产地 | ||
2864 | + printInfo.weight=$("#weight").val();// 净重 | ||
2865 | + printInfo.carTypeName=$("#carTypeShow").val();// 车型 | ||
2866 | + printInfo.plate=$("#plate").val();// 车号 | ||
2867 | + printInfo.qty=$("#goodsNum").val();// 件数 | ||
2868 | + printInfo.itemWeight=$("#itemWeight").val();// 件重 | ||
2869 | + printInfo.statementsDate=$("#paydate").val();// 结算时间 | ||
2870 | + var itemfees = $("#itemFee").val(); | ||
2871 | + //var receivedInWords =$("#receivedInWords").val(); | ||
2872 | + printInfo.itemFee=itemfees;// 交易管理费 | ||
2873 | + var proveTypeName = $("#proveTypeName").val(); | ||
2874 | + printInfo.proveTypeName = proveTypeName;//证明 | ||
2875 | + var tags =""; | ||
2876 | + $("input[name=goodsTagIds]").each(function () { | ||
2877 | + if($(this).is(":checked")){ | ||
2878 | + //当前为选中状态 | ||
2879 | + if(tags!=""){ | ||
2880 | + tags = tags +","+$(this).parent().text(); | ||
2881 | + }else { | ||
2882 | + tags = $(this).parent().text(); | ||
2883 | + } | ||
2884 | + } | ||
2885 | + }); | ||
2886 | + //printInfo.tags = tags;//标签 | ||
2887 | + | ||
2888 | + var myselect=document.getElementById("feeDepId"); | ||
2889 | + var feeDepName = $("#feeDepName").val(); | ||
2890 | + if(feeDepName == "" || feeDepName == undefined){ | ||
2891 | + feeDepName="请选择收费部门" | ||
2892 | + } | ||
2893 | + /*var index=myselect.selectedIndex ; | ||
2894 | + if(index != undefined){ | ||
2895 | + if(myselect.options[index].text != "请选择"){ | ||
2896 | + feeDepName = myselect.options[index].text; | ||
2897 | + } | ||
2898 | + }else{ | ||
2899 | + feeDepName = $("#feeDepName").val(); | ||
2900 | + }*/ | ||
2901 | + printInfo.tags =feeDepName; | ||
2902 | + var trailerNumber = $("#trailerNumber").val(); | ||
2903 | + if(trailerNumber!=""){ | ||
2904 | + trailerNumber ="【"+trailerNumber+"】" | ||
2905 | + } | ||
2906 | + printInfo.remark=$("#remark").val()+trailerNumber;// 备注+" "+$("#goodsRemark").val() | ||
2907 | + var totalAmountYuan =$("#printViewYuan").val(); | ||
2908 | + printInfo.amountInWords =DX(totalAmountYuan);//大写 | ||
2909 | + printInfo.accountInFigures =$("#printViewSymbol").val();//小写 | ||
2910 | + printInfo.greeterName=$("#inGreeterName").val();// 接车员 | ||
2911 | + printInfo.operatorName=$("#operatorName").val();// 司磅操作员 | ||
2912 | + printInfo.tollName=$("#tollName").val();// 收费员 | ||
2913 | + | ||
2914 | + var result =JSON.stringify(printInfo); | ||
2915 | + //console.log("--result:"+result); | ||
2916 | + return result; | ||
2917 | + } | ||
2918 | + | ||
2919 | + function DX(n) { | ||
2920 | + if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) | ||
2921 | + return ""; | ||
2922 | + if(n>0){ | ||
2923 | + var unit = "仟佰拾亿仟佰拾万仟佰拾圆角分", str = ""; | ||
2924 | + n += "00"; | ||
2925 | + var p = n.indexOf('.'); | ||
2926 | + if (p >= 0) | ||
2927 | + n = n.substring(0, p) + n.substr(p+1, 2); | ||
2928 | + unit = unit.substr(unit.length - n.length); | ||
2929 | + for (var i=0; i < n.length; i++) | ||
2930 | + str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i); | ||
2931 | + return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|圆)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^圆零?|零分/g, "").replace(/圆$/g, "圆整"); | ||
2932 | + }else{ | ||
2933 | + return ""; | ||
2934 | + } | ||
2935 | + } | ||
2936 | + | ||
2937 | + /** | ||
2938 | + * 交费点击事件处理 | ||
2939 | + */ | ||
2940 | + function payClickHandler(url) { | ||
2941 | + bs4pop.dialog({ | ||
2942 | + id:'dialog-add', | ||
2943 | + content:''+url, | ||
2944 | + title:'交费', | ||
2945 | + isIframe:true, | ||
2946 | + width:700, | ||
2947 | + height:450, | ||
2948 | + btns:[ | ||
2949 | + {label: '确定',className: 'btn-primary',onClick:payCertainClickHandler}, | ||
2950 | + {label: '取消',className: 'btn-secondary'} | ||
2951 | + ] | ||
2952 | + }); | ||
2953 | + } | ||
2954 | + | ||
2955 | + /** | ||
2956 | + * 交费点击事件处理 | ||
2957 | + */ | ||
2958 | + function payCertainClickHandler(e, $iframe) { | ||
2959 | + if (!$iframe.contents().find("#pwdForm").valid()) { | ||
2960 | + return false; | ||
2961 | + } | ||
2962 | + | ||
2963 | + //按钮【确认】的回调 | ||
2964 | + var body = $iframe.contents().find("body"); //iframe的body获取方式 | ||
2965 | + var password = $(body).find("#password").val(); | ||
2966 | + /*if(iccategroy != 30){ | ||
2967 | + if(password == undefined || password == ""){ | ||
2968 | + flag = true; | ||
2969 | + showWarning('请输入密码!'); | ||
2970 | + } | ||
2971 | + } | ||
2972 | + if(flag){ | ||
2973 | + flag = false | ||
2974 | + return; | ||
2975 | + }*/ | ||
2976 | + bui.loading.show('努力提交中,请稍候。。。'); | ||
2977 | + $(this).trigger("onblur"); | ||
2978 | + var bodyParent = $(window.document) | ||
2979 | + $(bodyParent).find("#pwd").val(password); | ||
2980 | + var doUrl =$(bodyParent).find("#optUrl").val(); | ||
2981 | + var optType =$(bodyParent).find("#optType").val(); | ||
2982 | + var id =$(bodyParent).find("#idFee").val(); | ||
2983 | + console.log(password+"操作"+doUrl) | ||
2984 | + $.ajax({ | ||
2985 | + type : 'post', | ||
2986 | + url :doUrl, | ||
2987 | + data : $(bodyParent).find('#feeForm').serialize(), | ||
2988 | + dataType : 'json', | ||
2989 | + async: false, | ||
2990 | + success : function(ret){ | ||
2991 | + bui.loading.hide(); | ||
2992 | + if(ret.code == '200'){ | ||
2993 | + //TLOG.component.editNewData($("#feeForm")); | ||
2994 | + //TLOG.component.operateLog(opttext,"收费管理","【收费单号】:"+$!enFee.number,"$!enFee.number"); | ||
2995 | + if(optType == 3){ | ||
2996 | + bs4pop.alert("解冻成功", {type: 0}, function () { | ||
2997 | + history.go(-1); | ||
2998 | + //window.location.href="/entranceFeeBillPay/toPayOpt/1/2?status=2&id="+id | ||
2999 | + }) | ||
3000 | + | ||
3001 | + }else{ | ||
3002 | + printDirect(id,optType); | ||
3003 | + } | ||
3004 | + | ||
3005 | + }else{ | ||
3006 | + //TLOG.component.operateLog(opttext,"收费管理",opttext+"提交失败:"+ret.result,"$!enFee.number"); | ||
3007 | + if(ret.code=='5000'){ | ||
3008 | + bs4pop.alert("系统异常,请重试,或者联系管理员", {type: 0}, function () { | ||
3009 | + window.location.href='http://jmsf.diligrp.com/entranceFeeBill/list'; | ||
3010 | + }); | ||
3011 | + } | ||
3012 | + var modified = ret.data.modified; | ||
3013 | + var showPwdIn = ret.data.showPwdIn; | ||
3014 | + if(showPwdIn == 1){ | ||
3015 | + $(body).find("#pwdInput").show() | ||
3016 | + } | ||
3017 | + if(modified!=undefined && modified!=""){ | ||
3018 | + $("#modified").val(modified); | ||
3019 | + showWarning(ret.result); | ||
3020 | + }else{ | ||
3021 | + bs4pop.alert(ret.result, {type: 0}, function () { | ||
3022 | + window.location.href='http://jmsf.nong12.com/entranceFeeBill/list'; | ||
3023 | + }); | ||
3024 | + } | ||
3025 | + } | ||
3026 | + }, | ||
3027 | + error:function(){ | ||
3028 | + bui.loading.hide(); | ||
3029 | + showError("系统异常,请稍后重试"); | ||
3030 | + } | ||
3031 | + }); | ||
3032 | + } | ||
3033 | + var resubmitFlag = false; | ||
3034 | + $("#undo_btn").click(function () { | ||
3035 | + if($("#settlementState").val()==2){ | ||
3036 | + bs4pop.alert("代收装卸费已结账,不能撤销收费单!", {type: 0}, function () { | ||
3037 | + window.location.href = window.location.href; | ||
3038 | + }); | ||
3039 | + return | ||
3040 | + } | ||
3041 | + if($("#feedbackOrderStatus").val()==2){ | ||
3042 | + bs4pop.alert("收费项返点已结转,不能撤销收费单!", {type: 0}, function () { | ||
3043 | + window.location.href = window.location.href; | ||
3044 | + }); | ||
3045 | + return | ||
3046 | + } | ||
3047 | + if(resubmitFlag){ | ||
3048 | + bs4pop.alert("请不要重复提交!", {type: 0}, function () { | ||
3049 | + window.location.href = window.location.href; | ||
3050 | + }); | ||
3051 | + return | ||
3052 | + }else { | ||
3053 | + resubmitFlag = true; | ||
3054 | + bui.loading.show('努力提交中,请稍候。。。'); | ||
3055 | + $.ajax({ | ||
3056 | + type: 'post', | ||
3057 | + url: '/entranceTrade/doUndo.action', | ||
3058 | + data: $('#feeForm').serialize(), | ||
3059 | + success: function (ret) { | ||
3060 | + bui.loading.hide(); | ||
3061 | + if (ret.code == 'success') { | ||
3062 | + //TLOG.component.operateLog(TLOG.operates.undo, "收费管理", "【收费单号】"+$!billgoods.number, "$!billgoods.number"); | ||
3063 | + bs4pop.alert("撤销成功", {type: 0}, function () { | ||
3064 | + history.go(-1); | ||
3065 | + }); | ||
3066 | + }else{ | ||
3067 | + bs4pop.alert(ret.result, {type: 0}, function () { | ||
3068 | + history.go(-1); | ||
3069 | + }); | ||
3070 | + } | ||
3071 | + }, | ||
3072 | + error: function () { | ||
3073 | + bui.loading.hide(); | ||
3074 | + bs4pop.alert("撤销失败,请稍后重试!", {type: 0}, function () { | ||
3075 | + window.location.href = window.location.href; | ||
3076 | + }); | ||
3077 | + } | ||
3078 | + }); | ||
3079 | + } | ||
3080 | + }); | ||
3081 | + | ||
3082 | + $(".invalid-btn").click(function () { | ||
3083 | + //var id=$("#idFee").val(); | ||
3084 | + //var mod=$("#modified").val(); | ||
3085 | + //var remark=$("#remark").val(); | ||
3086 | + var number = $("#number").val(); | ||
3087 | + $.ajax({ | ||
3088 | + type: 'post', | ||
3089 | + url: '/entranceFeeBill/doInvalid.action', | ||
3090 | + data: $('#feeForm').serialize(), | ||
3091 | + success: function (ret) { | ||
3092 | + if (ret.success == true) { | ||
3093 | + //TLOG.component.operateLog(TLOG.operates.invalid, "收费管理", "【收费单号】:"+number,number); | ||
3094 | + } | ||
3095 | + bs4pop.alert(ret.msg, {type: 0}, function () { | ||
3096 | + history.go(-1); | ||
3097 | + }); | ||
3098 | + }, | ||
3099 | + error: function () { | ||
3100 | + bs4pop.confirm("该用户当前无作废操作权限,请先确认已开通!", { | ||
3101 | + type: 0, | ||
3102 | + title: '提示', | ||
3103 | + btn: ['确定'] | ||
3104 | + }); | ||
3105 | + } | ||
3106 | + }); | ||
3107 | + }); | ||
3108 | +</script><script> | ||
3109 | + $('#pay-back-btn').on('click', function(){ | ||
3110 | + var handReceivableAmount = $("#handReceivableAmountLong").val(); | ||
3111 | + if(handReceivableAmount==undefined || handReceivableAmount==0){ | ||
3112 | + bs4pop.alert('该收费单未匹配到装卸费补录的任何规则!', {type: 0}, function () { | ||
3113 | + history.go(-1); | ||
3114 | + }); | ||
3115 | + }else{ | ||
3116 | + var handlingRatio = $("#handlingRatioVal").val(); | ||
3117 | + if(handlingRatio==0){ | ||
3118 | + bs4pop.confirm('当前收费单卸货比例为0%,请确认是否进行交费?', { | ||
3119 | + type: 0, | ||
3120 | + title: '提示', | ||
3121 | + btn: ['确定', '取消'], | ||
3122 | + yes: function (index, layero) { | ||
3123 | + openBackFrame(1,""); | ||
3124 | + }, | ||
3125 | + btn2: function (index, layero) { | ||
3126 | + | ||
3127 | + } | ||
3128 | + }) | ||
3129 | + }else{ | ||
3130 | + openBackFrame(1,""); | ||
3131 | + } | ||
3132 | + } | ||
3133 | + }); | ||
3134 | + function openBackFrame(type,authIc) { | ||
3135 | + var status = $("#status").val(); | ||
3136 | + var height = "490px"; | ||
3137 | + var iccategroy = $("#ic").attr("iccategroy"); | ||
3138 | + if(iccategroy == 30){ | ||
3139 | + var height = "400px"; | ||
3140 | + | ||
3141 | + } | ||
3142 | + var id=$("#idFee").val(); | ||
3143 | + var handManageAmount = $("#handManageAmount").val(); | ||
3144 | + if(handManageAmount == ""){ | ||
3145 | + handManageAmount = 0; | ||
3146 | + } | ||
3147 | + var handCollectionAmount = $("#handCollectionAmount").val(); | ||
3148 | + if(handCollectionAmount == ""){ | ||
3149 | + handCollectionAmount = 0; | ||
3150 | + } | ||
3151 | + var freezePrice = $("#freezeMoneySymbol").val(); | ||
3152 | + var ic = $("#ic").val(); | ||
3153 | + var id = $("#idFee").val(); | ||
3154 | + var pwdBackUrl ='/entranceFeeBill/paySteveBackPassword?id='+id+'&collectionAmount='+handCollectionAmount+"&mangeAmount="+handManageAmount; | ||
3155 | + | ||
3156 | + payBackClickHandler(pwdBackUrl) | ||
3157 | + } | ||
3158 | + | ||
3159 | + /** | ||
3160 | + * 交费点击事件处理 | ||
3161 | + */ | ||
3162 | + function payBackClickHandler(url) { | ||
3163 | + bs4pop.dialog({ | ||
3164 | + id:'dialog-add', | ||
3165 | + content:''+url, | ||
3166 | + title:'交费', | ||
3167 | + isIframe:true, | ||
3168 | + width:700, | ||
3169 | + height:450, | ||
3170 | + btns:[ | ||
3171 | + {label: '确定',className: 'btn-primary',onClick:payBackCertainClickHandler}, | ||
3172 | + {label: '取消',className: 'btn-secondary'} | ||
3173 | + ] | ||
3174 | + }); | ||
3175 | + } | ||
3176 | + | ||
3177 | + /** | ||
3178 | + * 交费点击事件处理 | ||
3179 | + */ | ||
3180 | + function payBackCertainClickHandler(e, $iframe) { | ||
3181 | + var doUrl='/entranceTrade/doPaySteveBack' | ||
3182 | + if (!$iframe.contents().find("#pwdForm").valid()) { | ||
3183 | + return false; | ||
3184 | + } | ||
3185 | + var body = layer.getChildFrame('body', index); //iframe的body获取方式 | ||
3186 | + var password = $(body).find("#password").val(); | ||
3187 | + var ic = $(body).find("#ic").val(); | ||
3188 | + //按钮【确认】的回调 | ||
3189 | + var bodyParent = $(window.document) | ||
3190 | + $(bodyParent).find("#pwd").val(password); | ||
3191 | + $(bodyParent).find("#fundAccount").val(fundAccount); | ||
3192 | + $(bodyParent).find("#ic").val(ic); | ||
3193 | + $.ajax({ | ||
3194 | + type : 'post', | ||
3195 | + url :doUrl, | ||
3196 | + data : $(bodyParent).find('#feeForm').serialize(), | ||
3197 | + dataType : 'json', | ||
3198 | + async: false, | ||
3199 | + success : function(ret){ | ||
3200 | + if(ret.code == 'success'){ | ||
3201 | + //TLOG.component.editNewData($("#feeForm")); | ||
3202 | + //TLOG.component.operateLog("补录","收费管理","【收费单号】:"+$!billgoods.number,"$!billgoods.number"); | ||
3203 | + printBackDirect(id,type); | ||
3204 | + }else{ | ||
3205 | + TLOG.component.operateLog("补录","收费管理",opttext+"提交失败:"+ret.result,"$!billgoods.number"); | ||
3206 | + if(ret.errorCode=='000'){ | ||
3207 | + bs4pop.alert(ret.errorMsg+",请重试,或者联系管理员", {type: 0}, function () { | ||
3208 | + window.location.href=''+'/entranceFeeBill/list.html'; | ||
3209 | + }); | ||
3210 | + } | ||
3211 | + if(ret.result == "该单据未完全交费成功,请到装卸费管理对该补录单据继续交费!"){ | ||
3212 | + bs4pop.alert(ret.result, {type: 0}, function () { | ||
3213 | + window.location.href=''+"/steveManage/list.html" | ||
3214 | + }); | ||
3215 | + }else{ | ||
3216 | + var modified = ret.data.modified; | ||
3217 | + var showPwdIn = ret.data.showPwdIn; | ||
3218 | + if(showPwdIn == 1){ | ||
3219 | + $(body).find("#pwdInput").show() | ||
3220 | + } | ||
3221 | + if(modified!=undefined && modified!=""){ | ||
3222 | + $("#modified").val(modified); | ||
3223 | + bs4pop.confirm(ret.result, { | ||
3224 | + type: 0, | ||
3225 | + title: '提示', | ||
3226 | + btn: ['确定'] | ||
3227 | + }); | ||
3228 | + }else{ | ||
3229 | + bs4pop.alert(ret.result, {type: 0}, function () { | ||
3230 | + window.location.href=''+'/entranceFeeBill/list.html'; | ||
3231 | + }); | ||
3232 | + } | ||
3233 | + } | ||
3234 | + | ||
3235 | + } | ||
3236 | + } | ||
3237 | + }); | ||
3238 | + } | ||
3239 | + | ||
3240 | + function printBackDirect(id,type){ | ||
3241 | + var source=$("#source").val(); | ||
3242 | + | ||
3243 | + var isPreview=2;// 1 预览,0:打印;2:直接打印 | ||
3244 | + var reprint = 0;//1补打;0:打印 | ||
3245 | + var status = $("#status").val(); | ||
3246 | + if(typeof callbackObj != 'undefined'){ | ||
3247 | + window.printFinish=function(){ | ||
3248 | + if(isPreview == "2"){ | ||
3249 | + if(type == 1){ | ||
3250 | + bs4pop.alert("交费成功", {type: 0}, function () { | ||
3251 | + window.location.href=''+'/entranceFeeBill/list.html'; | ||
3252 | + }); | ||
3253 | + } | ||
3254 | + } | ||
3255 | + } | ||
3256 | + | ||
3257 | + var paramStr =""; | ||
3258 | + if(isPreview == "1"){ | ||
3259 | + // paramStr = loadPrintHtmlData(); | ||
3260 | + }else{ | ||
3261 | + var data=loadBackPrintData(id,reprint); | ||
3262 | + if(!data){ | ||
3263 | + window.location.href=''+'entranceFeeBill/list.html'; | ||
3264 | + return; | ||
3265 | + } | ||
3266 | + paramStr = JSON.stringify(data.item); | ||
3267 | + } | ||
3268 | + if(paramStr==""){ | ||
3269 | + window.location.href=''+'/entranceFeeBill/list.html'; | ||
3270 | + return; | ||
3271 | + } | ||
3272 | + //console.log("--:"+paramStr); | ||
3273 | + callbackObj.printDirect(paramStr,"DoorStatementsDocument"); | ||
3274 | + if(type == 1){ | ||
3275 | + var handCollectionAmount = $("#handCollectionAmount").val(); | ||
3276 | + if(handCollectionAmount>0){ | ||
3277 | + var dataSteveOrderStr= loadPrintSteveOrderData(id,reprint); | ||
3278 | + if(!dataSteveOrderStr){ | ||
3279 | + window.location.href=''+'/entranceFeeBill/list.html'; | ||
3280 | + }else{ | ||
3281 | + var paramSteveOrderStr = JSON.stringify(dataSteveOrderStr.item); | ||
3282 | + callbackObj.printDirect(paramSteveOrderStr,"DoorStatementsDocument"); | ||
3283 | + } | ||
3284 | + } | ||
3285 | + | ||
3286 | + | ||
3287 | + } | ||
3288 | + }else{ | ||
3289 | + layer.confirm('请检查打印的设备是否已连接', { | ||
3290 | + type: 0, | ||
3291 | + title: '提示', | ||
3292 | + btn: ['确定'] | ||
3293 | + }); | ||
3294 | + } | ||
3295 | + } | ||
3296 | + function loadBackPrintData(id,reprint){ | ||
3297 | + var result; | ||
3298 | + $.ajax({ | ||
3299 | + url:'/entranceFeeBillPay/loadBackRecordPrintData?id='+id+'&reprint='+reprint, | ||
3300 | + type:'GET', | ||
3301 | + dataType:'json', | ||
3302 | + async:false, | ||
3303 | + success:function(data){ | ||
3304 | + if(data.code != '0'){ | ||
3305 | + layer.alert(data.msg,{type:0,title:"提示"}); | ||
3306 | + return; | ||
3307 | + } | ||
3308 | + if (data.msg == 0) { | ||
3309 | + //不打印代收为0的单子 | ||
3310 | + return; | ||
3311 | + } | ||
3312 | + result=data; | ||
3313 | + }, | ||
3314 | + error:function(){ | ||
3315 | + layer.alert("加载打印数据出错",{type:0,title:"提示"}); | ||
3316 | + } | ||
3317 | + }); | ||
3318 | + return result; | ||
3319 | + } | ||
3320 | + function loadPrintSteveOrderData(id,reprint){ | ||
3321 | + var result; | ||
3322 | + $.ajax({ | ||
3323 | + url:'/entranceFeeBillPay/loadPrintSteveOrderData?id='+id+'&reprint='+reprint, | ||
3324 | + type:'GET', | ||
3325 | + dataType:'json', | ||
3326 | + async:false, | ||
3327 | + success:function(data){ | ||
3328 | + if(data.code != '0'){ | ||
3329 | + layer.alert(data.msg,{type:0,title:"提示"}); | ||
3330 | + return; | ||
3331 | + } | ||
3332 | + if(data.msg == 0){ | ||
3333 | + return; | ||
3334 | + } | ||
3335 | + result=data; | ||
3336 | + }, | ||
3337 | + error:function(){ | ||
3338 | + layer.alert("加载打印数据出错",{type:0,title:"提示"}); | ||
3339 | + } | ||
3340 | + }); | ||
3341 | + return result; | ||
3342 | + } | ||
3343 | +</script> | ||
3344 | + | ||
3345 | +<script> | ||
3346 | + $(function(){ | ||
3347 | + if($("#bskinWithGoods").val()==1){ | ||
3348 | + //带货回皮只能选择 | ||
3349 | + var handlingRatioOld =$("#handlingRatioOld").val(); | ||
3350 | + if(handlingRatioOld == 100 || handlingRatioOld == 0){}else{ | ||
3351 | + $("#handlingRatio").val(""); | ||
3352 | + $("#handlingRatioVal").val(0); | ||
3353 | + } | ||
3354 | + $(".handlingRatioHidden").hide(); | ||
3355 | + }else{ | ||
3356 | + $(".handlingRatioHidden").show(); | ||
3357 | + } | ||
3358 | + calculate(); | ||
3359 | + if(!waitPayStatus()){ | ||
3360 | + if(!steveBack()){ | ||
3361 | + console.log("--2---状态不需要装卸费查询日志") | ||
3362 | + return; | ||
3363 | + } | ||
3364 | + } | ||
3365 | + var handReceivableAmount = $("#handReceivableAmountLong").val(); | ||
3366 | + if(handReceivableAmount>0){ | ||
3367 | + findHandTeam(); | ||
3368 | + var steveTeamId = $("#steveTeamId").val(); | ||
3369 | + var slength = $("#steveTeams").children().length; | ||
3370 | + //console.info("ss-") | ||
3371 | + $("#steveTeams option").each(function(){ | ||
3372 | + //console.info("this team id "+$(this).val()+",old id "+steveTeamId); | ||
3373 | + if(slength >= 2){//只有一个项是,是默认选中的 | ||
3374 | + if($(this).val() == steveTeamId){ | ||
3375 | + //console.info("selceted team id"+steveTeamId); | ||
3376 | + $(this).attr("selected", true); | ||
3377 | + var shareRatioVal = $(this).attr("bind-shareRatio"); | ||
3378 | + $("#shareRatioVal").val(shareRatioVal); | ||
3379 | + //console.info("sdds-"+steveTeamId) | ||
3380 | + }else{ | ||
3381 | + $("#steveTeams").val( $("#steveTeams").find('option')[1].value); | ||
3382 | + $("#shareRatioVal").val(ret[0].shareRatio); | ||
3383 | + $("#handlingTeam").val(ret[0].teamName); | ||
3384 | + } | ||
3385 | + } | ||
3386 | + }); | ||
3387 | + } | ||
3388 | + | ||
3389 | + }) | ||
3390 | + $("#ic").blur(function(){ | ||
3391 | + //findHandTeam(); | ||
3392 | + }); | ||
3393 | + $("#product").blur(function(){ | ||
3394 | + //findHandTeam(); | ||
3395 | + }); | ||
3396 | + $("#dep").change(function(){ | ||
3397 | + //findHandTeam(); | ||
3398 | + }); | ||
3399 | + $("#handlingRatio").change(function(){ | ||
3400 | + $("#handlingRatioVal").val($(this).children('option:selected').val()); | ||
3401 | + showAllAmount(); | ||
3402 | + }); | ||
3403 | + $("#steveTeams").change(function(){ | ||
3404 | + $("#steveTeamIdSelect").val(2); | ||
3405 | + var ss = $(this).children('option:selected'); | ||
3406 | + var shareRatioVal =0; | ||
3407 | + if (ss.html() != "请选择") { | ||
3408 | + shareRatioVal = ss.attr("bind-shareRatio"); | ||
3409 | + $("#handlingTeam").val(ss.html()); | ||
3410 | + } | ||
3411 | + $("#shareRatioVal").val(shareRatioVal); | ||
3412 | + showAllAmount(); | ||
3413 | + }); | ||
3414 | + $("#bskinWithGoods").change(function(){ | ||
3415 | + if($(this).val()==1){ | ||
3416 | + | ||
3417 | + $(".handlingRatioHidden").hide(); | ||
3418 | + $("#handlingRatio").val(""); | ||
3419 | + $("#handlingRatioVal").val(0); | ||
3420 | + }else{ | ||
3421 | + | ||
3422 | + $("#handlingRatio").val($("#handlingRatioOld").val()); | ||
3423 | + $("#handlingRatioVal").val($("#handlingRatioOld").val()); | ||
3424 | + $(".handlingRatioHidden").show(); | ||
3425 | + } | ||
3426 | + }); | ||
3427 | + function c() { | ||
3428 | + $.post("/entranceFeeBillPay/c", | ||
3429 | + $('#feeForm').serialize(), | ||
3430 | + function(data,status){ | ||
3431 | + $("#feeitemedit").html(data); | ||
3432 | + showAllAmount(); | ||
3433 | +// 计算后触发重新校验冻结金额 | ||
3434 | + $('#freezeMoneySymbol').blur(); | ||
3435 | + }); | ||
3436 | + } | ||
3437 | + function showAllAmount(){ | ||
3438 | + calculateFlag(); | ||
3439 | + var status = $("#status").val(); | ||
3440 | + var backRecord=false; | ||
3441 | + /*if(status!=2){ | ||
3442 | + var itemView = $("#itemView").val(); | ||
3443 | + if(itemView==undefined || itemView==1){ | ||
3444 | + console.info("return showAllAmount(),status:"+status); | ||
3445 | + return; | ||
3446 | + }else if(itemView==-1){ | ||
3447 | + backRecord=true; | ||
3448 | + } | ||
3449 | + }*/ | ||
3450 | + console.info("showAllAmount()"); | ||
3451 | + var handReceivableAmountVal = new Number(handReceivableAmount()); | ||
3452 | + if(handReceivableAmountVal>0){ | ||
3453 | + $("#steveTeams").attr("disabled",false); | ||
3454 | + $("#handlingRatio").attr("disabled",false); | ||
3455 | + }else{ | ||
3456 | + $("#handActualAmount").val(0); | ||
3457 | + $("#handActualAmountSymbol").val('0.00'); | ||
3458 | + $("#handManageAmount").val(0); | ||
3459 | + $("#handManageAmountSymbol").val('0.00'); | ||
3460 | + $("#handCollectionAmount").val(0); | ||
3461 | + $("#handCollectionAmountSymbol").val('0.00'); | ||
3462 | + $("#steveTeams").val(""); | ||
3463 | + $("#handlingRatio").val(""); | ||
3464 | + $("#steveTeams").attr("disabled",true); | ||
3465 | + $("#handlingRatio").attr("disabled",true); | ||
3466 | + } | ||
3467 | + | ||
3468 | + if(backRecord){ | ||
3469 | + handCollectionAmount(); | ||
3470 | + handManageAmount(); | ||
3471 | + handActualAmount(); | ||
3472 | + }else{ | ||
3473 | + freezeMoney(); | ||
3474 | + totalAmount(); | ||
3475 | + } | ||
3476 | + handTeamReload(); | ||
3477 | + printView(); | ||
3478 | + } | ||
3479 | + var ONE_HUNDRED_NUMBER = new Number(100); | ||
3480 | + function totalAmount(){ | ||
3481 | + var totalAmount = chargeTotalAmount()+handCollectionAmount()+feedbackAmount()+handManageAmount(); | ||
3482 | + $("#totalAmount").val(totalAmount); | ||
3483 | + var targetNumber = new Number(totalAmount); | ||
3484 | + $("#totalAmountYuan").val(targetNumber.div(ONE_HUNDRED_NUMBER));//打印预览大学的转换 | ||
3485 | + $("#totalAmountSymbol").text(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3486 | + var resultNumber = new Number(totalAmount); | ||
3487 | + return resultNumber; | ||
3488 | + } | ||
3489 | + function chargeTotalAmount(){ | ||
3490 | + var chargeTotalAmount = receivableAmount()-discountAmount()-feedbackAmount(); | ||
3491 | + $("#chargeTotalAmount").val(chargeTotalAmount); | ||
3492 | + var targetNumber = new Number(chargeTotalAmount); | ||
3493 | + $("#chargeTotalAmountYuan").val(targetNumber.div(ONE_HUNDRED_NUMBER)); | ||
3494 | + $("#chargeTotalAmountSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3495 | + var resultNumber = new Number(chargeTotalAmount); | ||
3496 | + return resultNumber; | ||
3497 | + } | ||
3498 | + function receivableAmount(){ | ||
3499 | + var receivableAmount = itemReceivableAmount(); | ||
3500 | + $("#receivableAmount").val(receivableAmount); | ||
3501 | + var targetNumber = new Number(receivableAmount); | ||
3502 | + $("#receivableAmountSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3503 | + var resultNumber = new Number(receivableAmount); | ||
3504 | + return resultNumber; | ||
3505 | + } | ||
3506 | + function itemReceivableAmount(){ | ||
3507 | + var itemReceivableAmount = $("#itemReceivableAmountLong").val(); | ||
3508 | + var targetNumber = new Number(itemReceivableAmount); | ||
3509 | + $("#itemReceivableAmountSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3510 | + var resultNumber = new Number(itemReceivableAmount); | ||
3511 | + return resultNumber; | ||
3512 | + } | ||
3513 | + function freezeMoney(){ | ||
3514 | + var freezeAmount = itemReceivableAmount(); | ||
3515 | + if(steveFeeRequire()){ | ||
3516 | + freezeAmount =itemReceivableAmount()+handReceivableAmount(); | ||
3517 | + } | ||
3518 | + var targetNumber = new Number(freezeAmount); | ||
3519 | + $("#freezePriceVal").val(targetNumber.div(ONE_HUNDRED_NUMBER));//冻结对比需要 | ||
3520 | + $("#freezeMoneySymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3521 | + var resultNumber = new Number(freezeAmount); | ||
3522 | + return resultNumber; | ||
3523 | + } | ||
3524 | + function discountAmount(){ | ||
3525 | + var discountAmount = $("#discountAmountLong").val(); | ||
3526 | + var targetNumber = new Number(discountAmount); | ||
3527 | + $("#discountAmountSymbol").val("-"+toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3528 | + var resultNumber = new Number(discountAmount); | ||
3529 | + return resultNumber; | ||
3530 | + } | ||
3531 | + | ||
3532 | + function handReceivableAmount(){ | ||
3533 | + var handReceivableAmount = $("#handReceivableAmountLong").val(); | ||
3534 | + var targetNumber = new Number(handReceivableAmount); | ||
3535 | + var thousands =targetNumber.div(ONE_HUNDRED_NUMBER); | ||
3536 | + $("#handReceivableAmountSymbol").val(toThousands(thousands)); | ||
3537 | + var resultNumber = new Number(handReceivableAmount); | ||
3538 | + | ||
3539 | + return resultNumber; | ||
3540 | + } | ||
3541 | + function handActualAmount(){ | ||
3542 | + var handlingRatioVal=$("#handlingRatioVal").val(); | ||
3543 | + //console.info("handActualAmount():handlingRatioVal:"+handlingRatioVal); | ||
3544 | + if(handlingRatioVal==undefined){ | ||
3545 | + handlingRatioVal = 0; | ||
3546 | + } | ||
3547 | + var handlingRatio = new Number(handlingRatioVal); | ||
3548 | + //console.info("handlingRatioVal"+handlingRatioVal); | ||
3549 | + handlingRatio=handlingRatio.div(ONE_HUNDRED_NUMBER); | ||
3550 | + var targetNumber = new Number(handReceivableAmount()); | ||
3551 | + var handActualAmount = targetNumber.mul(handlingRatio); | ||
3552 | + | ||
3553 | + var thousands = handActualAmount.div(ONE_HUNDRED_NUMBER); | ||
3554 | + thousands = new Number(thousands); | ||
3555 | + thousands = thousands.toFixed(); | ||
3556 | + thousands = new Number(thousands); | ||
3557 | + $("#handActualAmount").val(thousands.mul(ONE_HUNDRED_NUMBER)); | ||
3558 | + $("#handActualAmountSymbol").val(toThousands(thousands)); | ||
3559 | + | ||
3560 | + var resultNumber = new Number(thousands.mul(ONE_HUNDRED_NUMBER)); | ||
3561 | + | ||
3562 | + return resultNumber; | ||
3563 | + } | ||
3564 | + function handManageAmount(){ | ||
3565 | + //console.info("handManageAmount()"); | ||
3566 | + var handManageAmount = handActualAmount()-handCollectionAmount(); | ||
3567 | + $("#handManageAmount").val(handManageAmount); | ||
3568 | + var targetNumber = new Number(handManageAmount); | ||
3569 | + $("#handManageAmountSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3570 | + var resultNumber = new Number(handManageAmount); | ||
3571 | + return resultNumber; | ||
3572 | + } | ||
3573 | + function handCollectionAmount(){ | ||
3574 | + var shareRatioVal =$("#shareRatioVal").val(); | ||
3575 | + //console.info("handCollectionAmount()-shareRatioVal:"+shareRatioVal); | ||
3576 | + if(shareRatioVal == undefined){ | ||
3577 | + shareRatioVal =0; | ||
3578 | + } | ||
3579 | + var shareRatio = new Number(shareRatioVal); | ||
3580 | + shareRatio = shareRatio.div(ONE_HUNDRED_NUMBER) | ||
3581 | + | ||
3582 | + var targetNumber = new Number(handActualAmount()); | ||
3583 | + var handCollectionAmount = targetNumber.mul(shareRatio); | ||
3584 | + | ||
3585 | + var thousands = handCollectionAmount.div(ONE_HUNDRED_NUMBER); | ||
3586 | + thousands = new Number(thousands); | ||
3587 | + thousands = thousands.toFixed(); | ||
3588 | + thousands = new Number(thousands); | ||
3589 | + $("#handCollectionAmount").val(thousands.mul(ONE_HUNDRED_NUMBER)); | ||
3590 | + $("#handCollectionAmountSymbol").val(toThousands(thousands)); | ||
3591 | + | ||
3592 | + var resultNumber = new Number(thousands.mul(ONE_HUNDRED_NUMBER)); | ||
3593 | + return resultNumber; | ||
3594 | + } | ||
3595 | + function feedbackAmount(){ | ||
3596 | + //console.info("discountAmount()"); | ||
3597 | + var collectionAmount = $("#ccollectionLong").val(); | ||
3598 | + var targetNumber = new Number(collectionAmount); | ||
3599 | + $("#collectionAmountSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3600 | + var resultNumber = new Number(collectionAmount); | ||
3601 | + return resultNumber; | ||
3602 | + } | ||
3603 | + | ||
3604 | + function toThousands(num) { | ||
3605 | + return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); | ||
3606 | + } | ||
3607 | + function handTeamReload(){ | ||
3608 | + if(!steveFeeRequire()){ | ||
3609 | + console.log("市场是不需要装卸费") | ||
3610 | + return; | ||
3611 | + } | ||
3612 | + var steveTeamIdSelect = $("#steveTeamIdSelect").val(); | ||
3613 | + if(steveTeamIdSelect==1){ | ||
3614 | + findHandTeam(); | ||
3615 | + var steveTeamId = $("#steveTeamId").val(); | ||
3616 | + var slength = $("#steveTeams").children().length; | ||
3617 | + //console.info("ss-") | ||
3618 | + $("#steveTeams option").each(function(){ | ||
3619 | + //console.info("this team id "+$(this).val()+",old id "+steveTeamId); | ||
3620 | + if(slength >= 2){//只有一个项是,是默认选中的 | ||
3621 | + if($(this).val() == steveTeamId){ | ||
3622 | + //console.info("selceted team id"+steveTeamId); | ||
3623 | + $(this).attr("selected", true); | ||
3624 | + var shareRatioVal = $(this).attr("bind-shareRatio"); | ||
3625 | + $("#shareRatioVal").val(shareRatioVal); | ||
3626 | + //console.info("sdds-"+steveTeamId) | ||
3627 | + }else{ | ||
3628 | + var one = $("#steveTeams").find('option')[1]; | ||
3629 | + $("#steveTeams").val( $(one).val()); | ||
3630 | + $("#shareRatioVal").val($(one).attr("bind-shareRatio")); | ||
3631 | + $("#handlingTeam").val($(one).text()); | ||
3632 | + } | ||
3633 | + } | ||
3634 | + }); | ||
3635 | + } | ||
3636 | + } | ||
3637 | + function findHandTeam() { | ||
3638 | + if(!waitPayStatus()){ | ||
3639 | + if(!steveBack()){ | ||
3640 | + console.log("-----状态不需要装卸费查询日志") | ||
3641 | + return; | ||
3642 | + } | ||
3643 | + } | ||
3644 | + if(!steveFeeRequire()){ | ||
3645 | + console.log("市场是不需要装卸费") | ||
3646 | + return; | ||
3647 | + } | ||
3648 | + $("#steveTeams").empty(); | ||
3649 | + $("#steveTeamIdSelect").val(1); | ||
3650 | + var productId = $("#productId").val(); | ||
3651 | + var customerId = $("#customerId").val(); | ||
3652 | + var departmentId = $("#dep").val(); | ||
3653 | + var regionId = $("#district").val(); | ||
3654 | + var handReceivableAmount = $("#handReceivableAmountLong").val(); | ||
3655 | + if(handReceivableAmount == 0){ | ||
3656 | + return; | ||
3657 | + } | ||
3658 | + console.log("市场是2222装卸费") | ||
3659 | + $.ajax({ | ||
3660 | + type: 'get', | ||
3661 | + url: '/api/jmsf/ajax/findHandTeam', | ||
3662 | + data: {productId: productId,customerId: customerId,departmentId: departmentId,regionId: regionId,handReceivableAmount:handReceivableAmount}, | ||
3663 | + dataType: 'json', | ||
3664 | + async: false, | ||
3665 | + success: function (data) { | ||
3666 | + var optionItemHtml ='<option value="">请选择</option>'; | ||
3667 | + if (data.code != "200"){ | ||
3668 | + $("#steveTeamIdError").html("没有匹配到装卸队") | ||
3669 | + $("#steveTeams").attr("aria-invalid",true); | ||
3670 | + $("#steveTeams").removeClass("is-valid"); | ||
3671 | + $("#steveTeams").addClass("is-invalid"); | ||
3672 | + return; | ||
3673 | + }else { | ||
3674 | + $("#steveTeamIdError").html("") | ||
3675 | + $("#steveTeams").attr("aria-invalid",false); | ||
3676 | + $("#steveTeams").addClass("is-valid"); | ||
3677 | + $("#steveTeams").removeClass("is-invalid"); | ||
3678 | + | ||
3679 | + } | ||
3680 | + var ret=data.data; | ||
3681 | + | ||
3682 | + /* var selected = ""; | ||
3683 | + if(ret.length == 1){ | ||
3684 | + selected = 'selected="selected"' | ||
3685 | + }*/ | ||
3686 | + for (var index = 0;index < ret.length;index++){ | ||
3687 | + optionItemHtml =optionItemHtml+ '<option bind-shareRatio="' + ret[index].shareRatio + '" value="' + ret[index].id + '">' + ret[index].teamName + '</option>'; | ||
3688 | + } | ||
3689 | + $("#steveTeams").append(optionItemHtml); | ||
3690 | + if(ret.length >= 1){ | ||
3691 | + console.info("teamName:"+ret[0].teamName); | ||
3692 | + | ||
3693 | + if($("#steveTeams").find('option')[1] == undefined){ | ||
3694 | + return; | ||
3695 | + } | ||
3696 | + $("#steveTeams").val( $("#steveTeams").find('option')[1].value); | ||
3697 | + //$("#steveTeams").children().eq(1).attr("selected", true); | ||
3698 | + $("#shareRatioVal").val(ret[0].shareRatio); | ||
3699 | + $("#handlingTeam").val(ret[0].teamName); | ||
3700 | + $("#steveTeamId").val(ret[0].id); | ||
3701 | + } | ||
3702 | + //console.info("size:"+$("#steveTeams").children().length); | ||
3703 | + } | ||
3704 | + }); | ||
3705 | + } | ||
3706 | + | ||
3707 | + function calculateFlag(){ | ||
3708 | + var viewType = $("#viewType").val(); | ||
3709 | + if(viewType=='pay'||viewType=='correct' ){ | ||
3710 | + | ||
3711 | + }else{ | ||
3712 | + $("#cal").hide(); | ||
3713 | + $(".no-require").each(function(){ | ||
3714 | + $('input:checkbox[name="billItemCheckIds"]').attr("onclick","return false"); | ||
3715 | + }); | ||
3716 | + /*$(".goods-tags").each(function(){ | ||
3717 | + $('input:checkbox[name="goodsTagIds"]').attr("onclick","return false"); | ||
3718 | + });*/ | ||
3719 | + | ||
3720 | + } | ||
3721 | + | ||
3722 | + } | ||
3723 | + function printView(){ | ||
3724 | + var chargeTotalAmount = receivableAmount()-discountAmount()-feedbackAmount(); | ||
3725 | + if($("#marketFlag").val()=="qd"){ | ||
3726 | + chargeTotalAmount = receivableAmount()-discountAmount(); | ||
3727 | + } | ||
3728 | + var targetNumber = new Number(chargeTotalAmount); | ||
3729 | + $("#printViewYuan").val(targetNumber.div(ONE_HUNDRED_NUMBER)); | ||
3730 | + $("#printViewSymbol").val(toThousands(targetNumber.div(ONE_HUNDRED_NUMBER))); | ||
3731 | + } | ||
3732 | + function steveFeeRequire(){ | ||
3733 | + if($("#marketFlag").val()=="qd" || $("#marketFlag").val()=="sy"){ | ||
3734 | + return true; | ||
3735 | + } | ||
3736 | + return false; | ||
3737 | + } | ||
3738 | + function waitPayStatus(){ | ||
3739 | + if($("#status").val()==2){ | ||
3740 | + return true; | ||
3741 | + } | ||
3742 | + return false; | ||
3743 | + } | ||
3744 | + function steveBack(){ | ||
3745 | + if($("#viewType").val()=="back"){ | ||
3746 | + return true; | ||
3747 | + } | ||
3748 | + return false; | ||
3749 | + } | ||
3750 | +</script> | ||
0 | \ No newline at end of file | 3751 | \ No newline at end of file |
testcase/test_ZC/demo.py
@@ -9,3 +9,15 @@ | @@ -9,3 +9,15 @@ | ||
9 | 9 | ||
10 | """ | 10 | """ |
11 | 11 | ||
12 | +import re | ||
13 | +from bs4 import BeautifulSoup | ||
14 | + | ||
15 | +with open('demo_b.html',encoding="utf-8") as con: | ||
16 | + data = con.read() | ||
17 | +soup = BeautifulSoup(data,"html.parser") | ||
18 | +all_list = soup.findAll("input") | ||
19 | +aa = {i.get("name"):i.get("value") for i in all_list} | ||
20 | +print(aa) | ||
21 | +# print(aa["autocomplete-cartype"]) | ||
22 | +# c = [i.get("value") for i in soup.findAll("input") if i.get("name")=="categoryName"] | ||
23 | +# print(c) | ||
12 | \ No newline at end of file | 24 | \ No newline at end of file |
testcase/test_ZC/demo_b.html
0 → 100644
1 | +HTTP/1.1 200 | ||
2 | +Server: nginx/1.14.2 | ||
3 | +Date: Tue, 10 Aug 2021 07:09:53 GMT | ||
4 | +Content-Type: text/html;charset=UTF-8 | ||
5 | +Connection: keep-alive | ||
6 | +Access-Control-Expose-Headers: UAP_accessToken | ||
7 | +Cache-Control: no-store | ||
8 | +Content-Language: zh-CN | ||
9 | +Content-Length: 8695 | ||
10 | + | ||
11 | +<style> | ||
12 | + .table-chrgeitem td, | ||
13 | + .table-chrgeitem th { | ||
14 | + padding: .5rem .45rem; | ||
15 | + height: auto; | ||
16 | + } | ||
17 | +</style> | ||
18 | +<input type="hidden" id="marketFlag" name="marketFlag" value="sy"> | ||
19 | +<input type="hidden" id="goodsAllocationText" value="无"> | ||
20 | + | ||
21 | +<input type="hidden" id="checkItemAllZero" value="1"> | ||
22 | +<input type="hidden" id="itemFee" value="交易管理费:¥5.00 检测费:¥3.00 "> | ||
23 | +<input type="hidden" id="receivedInWords" value="捌元整"> | ||
24 | +<input type="hidden" id="e" value=""> | ||
25 | +<input type="hidden" id="ctotal" value="8.00"> | ||
26 | +<input type="hidden" id="creceivable" value="13.00"> | ||
27 | +<input type="hidden" id="cdiscount" value="5.00"> | ||
28 | + | ||
29 | +<input type="hidden" id="ctotalLong" name="totalMoney" value="800"> | ||
30 | +<input type="hidden" id="creceivableLong" name="receivable" value="1300"> | ||
31 | +<input type="hidden" id="ccollectionLong" name="collectionPrice" value="0"> | ||
32 | +<input type="hidden" id="discountAmountLong" name="discountAmount" value="500"> | ||
33 | +<input type="hidden" id="handReceivableAmountLong" name="handReceivableAmount" value="0"> | ||
34 | +<input type="hidden" id="itemReceivableAmountLong" name="itemReceivableAmount" value="1300"> | ||
35 | +<input type="hidden" id="correctDiscount" name="correctDiscount" value="1"> | ||
36 | + | ||
37 | +<table class="table table-hover table-bordered mt-2 table-chrgeitem"> | ||
38 | + <tr class="row px-3"> | ||
39 | + <th class="col-3">收费项目应收<span id="gz-tag" style="display: none;color: red;">【已更正】</span></th> | ||
40 | + <th class="col-3">收费项目优惠1</th> | ||
41 | + <th class="col-3">收费项目优惠2</th> | ||
42 | + <th class="col-3">收费项目实收</th> | ||
43 | + </tr> | ||
44 | + <input type="hidden" name="billItems" value=''> | ||
45 | + <input type="hidden" name="billItemsDic" value=''> | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + <tr class="row px-3"> | ||
50 | + <td class="col-3"> | ||
51 | + <div class="itemwrap row"> | ||
52 | + <div class="col-auto item chargeitem"> | ||
53 | + <div class="form-group"> | ||
54 | + <div class="d-flex align-items-center"> | ||
55 | + <input type="checkbox" name="billItemCheckIds" value="103" data-name="交易管理费" | ||
56 | + data-req="1" checked readonly onclick="return false"> | ||
57 | + <div class="input-group-prepend"> | ||
58 | + 交易管理费: | ||
59 | + </div> | ||
60 | + <input type="text" title="规则ID:615,规则名:交易管理" class="form-control fees bold" | ||
61 | + name="103" maxlength="15" data-old="10.00" | ||
62 | + data-old-receivable="1000" value="10.00" readonly> | ||
63 | + <input type="hidden" name="billItems" value='{"discount":500,"id":103,"name":"交易管理费","receivable":1000,"require":1}'> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | + </td> | ||
69 | + <td class="col-3"> | ||
70 | + <div class="itemwrap row"> | ||
71 | + | ||
72 | + | ||
73 | + <div class="col-auto item offeritem red" data-req="0"> | ||
74 | + <div class="form-group"> | ||
75 | + <div class="d-flex align-items-center"> | ||
76 | + | ||
77 | + <input type="checkbox" name="billItemDicCheckIds" value="105" data-req="0" | ||
78 | + checked> | ||
79 | + <div class="input-group-prepend"> | ||
80 | + 优惠收费: | ||
81 | + </div> | ||
82 | + | ||
83 | + <input type="text" 规则ID:619,规则名:卡账户匹配 class="form-control fees bold" | ||
84 | + value="-5.00" readonly> | ||
85 | + <input type="hidden" name="billItemsDic" value='{"discount":0,"id":105,"name":"优惠收费","receivable":500,"require":0}'> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + | ||
90 | + </div> | ||
91 | + </td> | ||
92 | + <td class="col-3"> | ||
93 | + <div class="itemwrap row"> | ||
94 | + <div class="col-auto item offeritem" > | ||
95 | + <div class="form-group"> | ||
96 | + <div class="d-flex align-items-center"> | ||
97 | + 返点的钱 : | ||
98 | + <input type="text" class="form-control fees bold" | ||
99 | + value="0.00" readonly> | ||
100 | + </div> | ||
101 | + </div> | ||
102 | + </div> | ||
103 | + </div> | ||
104 | + </td> | ||
105 | + <td class="col-3"> | ||
106 | + <span class="bold singleRealfee">5.00</span> | ||
107 | + | ||
108 | + </td> | ||
109 | + </tr> | ||
110 | + | ||
111 | + | ||
112 | + <tr class="row px-3"> | ||
113 | + <td class="col-3"> | ||
114 | + <div class="itemwrap row"> | ||
115 | + <div class="col-auto item chargeitem"> | ||
116 | + <div class="form-group"> | ||
117 | + <div class="d-flex align-items-center"> | ||
118 | + <input type="checkbox" name="billItemCheckIds" value="106" data-name="检测费" | ||
119 | + data-req="1" checked readonly onclick="return false"> | ||
120 | + <div class="input-group-prepend"> | ||
121 | + 检测费: | ||
122 | + </div> | ||
123 | + <input type="text" title="规则ID:499,规则名:固定检测费" class="form-control fees bold" | ||
124 | + name="106" maxlength="15" data-old="3.00" | ||
125 | + data-old-receivable="300" value="3.00" readonly> | ||
126 | + <input type="hidden" name="billItems" value='{"discount":0,"id":106,"name":"检测费","receivable":300,"require":1}'> | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + </div> | ||
131 | + </td> | ||
132 | + <td class="col-3"> | ||
133 | + <div class="itemwrap row"> | ||
134 | + | ||
135 | + </div> | ||
136 | + </td> | ||
137 | + <td class="col-3"> | ||
138 | + <div class="itemwrap row"> | ||
139 | + <div class="col-auto item offeritem" > | ||
140 | + </div> | ||
141 | + </div> | ||
142 | + </td> | ||
143 | + <td class="col-3"> | ||
144 | + <span class="bold singleRealfee">3.00</span> | ||
145 | + | ||
146 | + </td> | ||
147 | + </tr> | ||
148 | + | ||
149 | + | ||
150 | + | ||
151 | + | ||
152 | +</table> | ||
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | ||
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | ||
162 | +<script> | ||
163 | + $(function () { | ||
164 | + /* 可选项的收费项目才能选择优惠项目 */ | ||
165 | + $('#feeitemedit .chargeitem [data-req="-1"]').each(function () { | ||
166 | + // offeritem所有优惠项目,offeritemReq必填优惠项目 | ||
167 | + var offeritem = $(this).closest('tr').find('.offeritem :checkbox'); | ||
168 | + var offeritemReq = $(this).closest('tr').find('.offeritem [data-req="1"]'); | ||
169 | + if ($(this).is(':checked')) { | ||
170 | + offeritem.not(offeritemReq).attr('disabled', false); | ||
171 | + offeritemReq.prop('checked', true); | ||
172 | + } else { | ||
173 | + offeritem.not(offeritemReq).attr('disabled', true); | ||
174 | + offeritem.prop('checked', false); | ||
175 | + } | ||
176 | + }) | ||
177 | + var uItem = $("#updateFeeItems").val(); | ||
178 | + if (uItem == 2) { | ||
179 | + $("#gz-tag").show(); | ||
180 | + } | ||
181 | + }) | ||
182 | + | ||
183 | + $('#feeitemedit :checkbox').change(function () { | ||
184 | + calculate(); | ||
185 | + }) | ||
186 | + // 收费项目金额千位分隔符四舍五入显示2位小数.00 | ||
187 | + $('#feeitemedit .chargeitem .fees').on('blur', function () { | ||
188 | + var old = $(this).attr("data-old"); | ||
189 | + var now = $(this).val(); | ||
190 | + //console.log("old:"+old+",new:"+now); | ||
191 | + if (old == now) { | ||
192 | + //没有变动 | ||
193 | + //console.log("没有变动old:"+old+",new:"+now); | ||
194 | + return; | ||
195 | + } | ||
196 | + | ||
197 | + var fees = parseFloat($(this).val().replace(/[^\d\.]/g, '')); | ||
198 | + var feesThousand; | ||
199 | + if (fees === '' || isNaN(fees) || fees < 0) { | ||
200 | + fees = 0 | ||
201 | + $(this).val('0.00') | ||
202 | + } else { | ||
203 | + fees = Math.round(fees).toFixed(2); | ||
204 | + feesThousand = fees.replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, "$1,"); | ||
205 | + $(this).val(feesThousand) | ||
206 | + } | ||
207 | + var price = new Number(fees); | ||
208 | + var temp1 = new Number(100); | ||
209 | + var receivable = price.mul(temp1); | ||
210 | + var old = $(this).attr("data-old-receivable"); | ||
211 | + if (old == receivable) { | ||
212 | + //没有变动 | ||
213 | + //console.log("没有变动old:"+old+",new:"+receivable); | ||
214 | + return; | ||
215 | + } | ||
216 | + | ||
217 | + var info = $(this).siblings()[0]; | ||
218 | + var req = $(info).attr("data-req"); | ||
219 | + var dateid = $(info).val(); | ||
220 | + var itemName = $(info).attr("data-name"); | ||
221 | + var feeItemParamHtml = new Object(); | ||
222 | + feeItemParamHtml.id = dateid; | ||
223 | + feeItemParamHtml.name = itemName; | ||
224 | + feeItemParamHtml.require = req; | ||
225 | + feeItemParamHtml.receivable = receivable; | ||
226 | + var result = JSON.stringify(feeItemParamHtml); | ||
227 | + $(this).next().val(result); | ||
228 | + if ($("#correctInfo").val() == 2) { | ||
229 | + $("#updateFeeItems").val(2); | ||
230 | + } | ||
231 | + calculate(); | ||
232 | + }) | ||
233 | + | ||
234 | + | ||
235 | +</script> | ||
0 | \ No newline at end of file | 236 | \ No newline at end of file |
testcase/test_ZC/test_ZC.py
@@ -127,8 +127,8 @@ class test_demo(unittest.TestCase): | @@ -127,8 +127,8 @@ class test_demo(unittest.TestCase): | ||
127 | userName="ty_test",transactionName="沈阳2号",newWeight=20, | 127 | userName="ty_test",transactionName="沈阳2号",newWeight=20, |
128 | depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜") | 128 | depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜") |
129 | print(cre_res.json()) | 129 | print(cre_res.json()) |
130 | - number = cre_res.json()["data"]["number"] | ||
131 | - aa = eFBL.do_payOrder(attrValue=number) | 130 | + # number = cre_res.json()["data"]["number"] |
131 | + # aa = eFBL.do_payOrder(attrValue=number) | ||
132 | # cre_res = zcA.create_jmsf(host=self.gatewayHost,plate="川B00002",newWeight=20) | 132 | # cre_res = zcA.create_jmsf(host=self.gatewayHost,plate="川B00002",newWeight=20) |
133 | # print(cre_res.json()) | 133 | # print(cre_res.json()) |
134 | 134 |
testcase/test_ZC/test_ZCCreate.py
@@ -124,4 +124,6 @@ class test_ZCCreate(unittest.TestCase): | @@ -124,4 +124,6 @@ class test_ZCCreate(unittest.TestCase): | ||
124 | productState=productState, | 124 | productState=productState, |
125 | tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId, | 125 | tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId, |
126 | inGreeterName=inGreeterName, dep=feeDepId, weighmanRecord=weighmanRecord) | 126 | inGreeterName=inGreeterName, dep=feeDepId, weighmanRecord=weighmanRecord) |
127 | - print(cre_res.json()) | ||
128 | \ No newline at end of file | 127 | \ No newline at end of file |
128 | + print(cre_res.json()) | ||
129 | + assert cre_res.json()["code"] == "200","创建整车进门单失败" | ||
130 | + assert "data" in cre_res.text,"创建整车进门单失败" | ||
129 | \ No newline at end of file | 131 | \ No newline at end of file |