Commit 8ea17da5eba786e50ed580c9f11a36b7c7cdc13c

Authored by wenleiming
2 parents cf904d3d e5edbd8a

Merge branch 'master' of git3.nong12.com:autotest/jmsf-re

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