Commit c239d7fd27ccf01ab451632038936992e2370c7d

Authored by liujiqiang
1 parent 1c95301b

文件上传

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