charge_first.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <title>违章车辆初次登记</title>
  2. <div class="layui-card layadmin-header">
  3. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  4. <a lay-href="">主页</a>
  5. <a><cite>违章车辆管理</cite></a>
  6. <a><cite>违章车辆初次登记</cite></a>
  7. </div>
  8. </div>
  9. <div class="layui-fluid">
  10. <div class="layui-card">
  11. <!--<div class="layui-card-body" id="getInfo">-->
  12. <!--<button class="layui-btn" data-type="getCarInfo" id="LAY_layer_iframe_demo">获取数据</button>-->
  13. <!--</div>-->
  14. <div class="layui-card-body" style="padding: 15px;">
  15. <form class="layui-form" action="" lay-filter="component-form-group">
  16. <div class="layui-form-item">
  17. <div class="layui-inline">
  18. <label class="layui-form-label">车牌号码</label>
  19. <div class="layui-input-inline">
  20. <input type="text" name="license" lay-verify="required" autocomplete="off" class="layui-input" id="LAY_license" style="text-transform:uppercase;">
  21. </div>
  22. </div>
  23. <div class="layui-inline">
  24. <label class="layui-form-label">环保检测</label>
  25. <div class="layui-input-inline layui-form" lay-filter="detectionSelect">
  26. <select name="EP_type" lay-verify="required" lay-search="" lay-filter="detectionChangeType" id="detectionSelect">
  27. </select>
  28. </div>
  29. </div>
  30. <div class="layui-inline">
  31. <label class="layui-form-label">环检应收</label>
  32. <div class="layui-input-inline">
  33. <input type="text" class="layui-input" name="EP_receivable" id="HJYS" value="200" readonly unselectable="on" style="background-color: #e4e4e4">
  34. </div>
  35. </div>
  36. <div class="layui-inline">
  37. <label class="layui-form-label">挂账客户</label>
  38. <div class="layui-input-inline layui-form" lay-filter="customerSelect">
  39. <select name="customer" lay-search="" id="customerSelect"></select>
  40. </div>
  41. </div>
  42. <div class="layui-inline">
  43. <label class="layui-form-label">车型判断</label>
  44. <div class="layui-input-inline layui-form" lay-filter="carTypeSelect">
  45. <select name="car_type" lay-verify="required" lay-search="" lay-filter="carChangeType" id="carTypeSelect"></select>
  46. </div>
  47. </div>
  48. <div class="layui-inline">
  49. <label class="layui-form-label">安检应收</label>
  50. <div class="layui-input-inline">
  51. <input type="text" name="Safe_receivable" class="layui-input" id="AJYS" value="150" readonly unselectable="on" style="background-color: #e4e4e4">
  52. </div>
  53. </div>
  54. <div class="layui-inline">
  55. <label class="layui-form-label">应收总和</label>
  56. <div class="layui-input-inline" >
  57. <input type="text" name="receivable" class="layui-input" id="YSZH" value="350" readonly unselectable="on" style="background-color: #e4e4e4">
  58. </div>
  59. </div>
  60. <div class="layui-inline">
  61. <label class="layui-form-label">支付宝金额</label>
  62. <div class="layui-input-inline" >
  63. <input type="text" name="ali_pay" lay-verify="ali_pay" class="layui-input" id="ali_pay" autocomplete="off" placeholder="0" >
  64. </div>
  65. </div>
  66. <div class="layui-inline">
  67. <label class="layui-form-label">挂账金额</label>
  68. <div class="layui-input-inline" >
  69. <input type="text" name="on_account" lay-verify="on_account" class="layui-input" id="on_account" autocomplete="off" placeholder="0" >
  70. </div>
  71. </div>
  72. <div class="layui-inline">
  73. <label class="layui-form-label">实收总和</label>
  74. <div class="layui-input-inline" >
  75. <input type="text" name="cost" class="layui-input" id="SSZH" value="350">
  76. </div>
  77. </div>
  78. <div class="layui-inline">
  79. <label class="layui-form-label">手机</label>
  80. <div class="layui-input-inline">
  81. <input type="tel" name="telephone" autocomplete="off" class="layui-input"><!--lay-verify="phone"-->
  82. </div>
  83. </div>
  84. <!--<div class="layui-inline">-->
  85. <!--<label class="layui-form-label">日期</label>-->
  86. <!--<div class="layui-input-inline">-->
  87. <!--<input type="text" name="date" id="LAY-component-form-group-date" lay-verify="date" autocomplete="off" class="layui-input" style="background-color: #e4e4e4">-->
  88. <!--</div>-->
  89. <!--</div>-->
  90. </div>
  91. <div class="layui-form-item layui-form-text">
  92. <label class="layui-form-label">备注</label>
  93. <div class="layui-input-block">
  94. <textarea name="text" placeholder="请输入内容" class="layui-textarea" style="width: 80%"></textarea>
  95. </div>
  96. </div>
  97. <div class="layui-form-item">
  98. <div class="layui-input-block">
  99. <div class="layui-footer">
  100. <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
  101. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  102. </div>
  103. </div>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. <script>
  110. layui.use(['admin', 'form', 'laydate'], function(){
  111. var $ = layui.$
  112. ,admin = layui.admin
  113. ,element = layui.element
  114. ,layer = layui.layer
  115. ,laydate = layui.laydate
  116. ,form = layui.form;
  117. form.render(null, 'component-form-group');
  118. // laydate.render({
  119. // elem: '#LAY-component-form-group-date',
  120. // value: new Date(),
  121. // format:'yyyy-MM-dd',
  122. // });
  123. form.verify({
  124. on_account:function (value) {
  125. if (value==="") {
  126. $('#on_account').val(0)//为空自动赋值0
  127. }else {
  128. if (isNaN(value)){
  129. return "请输入数字!"
  130. }
  131. }
  132. },
  133. ali_pay:function (value) {
  134. if (value==="") {
  135. $('#ali_pay').val(0)//为空自动赋值0
  136. }else {
  137. if (isNaN(value)){
  138. return "请输入数字!"
  139. }
  140. }
  141. }
  142. });
  143. $('#on_account').focus(function () {
  144. if($('#customerSelect').val()===""){
  145. $('#on_account').val(0)//为空自动赋值0
  146. layer.msg("需要先选择挂账客户!")
  147. }
  148. })
  149. //常用挂账客户
  150. $.ajax({
  151. url:"/customer/getCustomer",
  152. success:function (res) {
  153. var data = res;
  154. $.each(data,function (index,item) {
  155. if (index===0){
  156. $('#customerSelect').append('<option value="">'+item.name+'</option>');
  157. }else {
  158. $('#customerSelect').append('<option value="'+item.name+'">'+item.name+'</option>');
  159. }
  160. });
  161. form.render('select', 'customerSelect');
  162. }
  163. });
  164. //环检下拉
  165. $.ajax({
  166. url:"/chargingStandard/getSelect",
  167. type:'POST',
  168. data:{"project":"环检"},
  169. success:function (res) {
  170. var data = res;
  171. $.each(data,function (index,item) {
  172. $('#detectionSelect').append('<option value="'+item.carType+'">'+item.carType+'</option>');
  173. });
  174. form.render('select', 'detectionSelect');
  175. }
  176. });
  177. //安检下拉
  178. $.ajax({
  179. url:"/chargingStandard/getSelect",
  180. type:'POST',
  181. data:{"project":"安检"},
  182. success:function (res) {
  183. var data = res;
  184. $.each(data,function (index,item) {
  185. $('#carTypeSelect').append('<option value="'+item.carType+'">'+item.carType+'</option>');
  186. });
  187. form.render('select', 'carTypeSelect');
  188. }
  189. });
  190. //根据carType(安检)改变,联动默认价格
  191. form.on('select(carChangeType)',function (data) {
  192. $.ajax({
  193. url:"/chargingStandard/getSelect",
  194. type:'POST',
  195. data:{"carType":data.value},
  196. success:function (res) {
  197. $('#AJYS').val(res[0].cost);
  198. $('#YSZH').val(parseInt($('#AJYS').val()) + parseInt($('#HJYS').val()));//应收总和
  199. $('#SSZH').val($('#YSZH').val());
  200. }
  201. })
  202. });
  203. //根据EP_type(环检)改变,联动默认价格
  204. form.on('select(detectionChangeType)',function (data) {
  205. $.ajax({
  206. url:"/chargingStandard/getSelect",
  207. type:'POST',
  208. data:{"carType":data.value},
  209. success:function (res) {
  210. $('#HJYS').val(res[0].cost);
  211. $('#YSZH').val(parseInt($('#AJYS').val()) + parseInt($('#HJYS').val()))//应收总和
  212. $('#SSZH').val($('#YSZH').val());
  213. }
  214. })
  215. });
  216. /* 监听提交 */
  217. form.on('submit(component-form-demo1)', function(data){
  218. // layer.alert(JSON.stringify(data.field), {
  219. // title: '最终的提交信息'
  220. // })
  221. // return false;
  222. var field = data.field;
  223. field.license = field.license.toUpperCase()
  224. admin.req({
  225. url:"/charge/saveCharge",
  226. type:'POST',
  227. data:field,
  228. done:function (res) {
  229. if (res.code===0){
  230. layer.msg("提交成功")
  231. }else {
  232. layer.msg(res.msg)
  233. }
  234. }
  235. })
  236. });
  237. //
  238. var active = {
  239. getCarInfo: function(){
  240. layer.open({
  241. type: 2,
  242. area: ['700px', '650px'],
  243. fixed: false,
  244. maxmin: true,
  245. content: layui.setter.base + 'views/detection/layer/getCarInfo.html'
  246. });
  247. }
  248. }
  249. $('#getInfo .layui-btn').on('click', function(){
  250. var type = $(this).data('type');
  251. active[type] && active[type].call(this);
  252. });
  253. });
  254. </script>