differencePriceForm.jsp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>申请付款</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th {
  9. text-align: center
  10. }
  11. .table td {
  12. text-align: center
  13. }
  14. .pay-table th {
  15. background: #f9f9f9
  16. }
  17. .pay-table tr:first-child th {
  18. background: #eee !important
  19. }
  20. .pay-table td {
  21. background: #fff !important
  22. }
  23. input[type="checkbox"]::before {
  24. content: '\a0';
  25. display: inline-block;
  26. vertical-align: .2em;
  27. width: .8em;
  28. height: .8em;
  29. margin-right: .2em;
  30. border-radius: .2em;
  31. text-indent: .15em;
  32. line-height: .65
  33. }
  34. .pay-more-func span:first-child {
  35. margin-right: 6px
  36. }
  37. .pay-more-func span:hover {
  38. color: #7aa9c3
  39. }
  40. .tips-popup-content p {
  41. text-align: center;
  42. padding: 80px;
  43. font-size: 20px
  44. }
  45. .revise-popup-content h4, .tips-popup-content h4 {
  46. padding-left: 10px;
  47. height: 40px;
  48. line-height: 40px;
  49. border-bottom: 1px solid #eee;
  50. margin-bottom: 20px
  51. }
  52. .revise-popup-content div {
  53. margin-top: 7px;
  54. text-align: center
  55. }
  56. .revise-popup-content label {
  57. width: 70px;
  58. text-align: right;
  59. vertical-align: text-bottom
  60. }
  61. .revise-popup-content button {
  62. width: 80px;
  63. height: 30px;
  64. -webkit-border-radius: 5px;
  65. -moz-border-radius: 5px;
  66. border-radius: 5px
  67. }
  68. .revise-popup-content > div:nth-of-type(4) > span:first-child {
  69. margin-left: -104px
  70. }
  71. .revise-popup-content > div:nth-of-type(4) > span:last-child {
  72. margin-left: 30px
  73. }
  74. .revise-popup-content > div:nth-of-type(4) > span span {
  75. margin-left: 10px
  76. }
  77. .revise-popup-content > div:last-child {
  78. text-align: center;
  79. margin-top: 20px
  80. }
  81. .revise-popup-content input {
  82. width: 100px;
  83. margin-bottom: 0px
  84. }
  85. .form-search label {
  86. width: 80px;
  87. text-align: left;
  88. margin-top: 12px
  89. }
  90. .remark-title span {
  91. color: red
  92. }
  93. .ul-form label {
  94. width: 90px;
  95. text-align: left;
  96. margin-top: 15px
  97. }
  98. .pay-status label {
  99. margin-left: 0
  100. }
  101. .pay-status label:first-child {
  102. margin-left: 10px
  103. }
  104. .controls{
  105. font-size: 0;
  106. }
  107. .controls .conList{
  108. display: inline-block;
  109. margin-right: 15px;
  110. }
  111. .conList .btn:nth-of-type(1){
  112. margin-left: 25px;
  113. }
  114. .upload-content {
  115. margin-top: -70px;
  116. display: inline-block;
  117. }
  118. .upload-content .conList .btn:nth-of-type(1) {
  119. width: 90px;
  120. height: 100px;
  121. border: 2px solid #eee;
  122. background: #fff;
  123. position: relative;
  124. }
  125. .upload-content .conList .btn:nth-of-type(1)>div {
  126. position: absolute;
  127. top: 50%;
  128. left: 50%;
  129. transform: translate(-50%, -50%);
  130. color: #666;
  131. }
  132. .upload-content .conList .btn:nth-of-type(1) span {
  133. font-size: 35px;
  134. }
  135. .upload-content .conList .btn:nth-of-type(1) h5 {
  136. color: #666;
  137. }
  138. .cancel-upload {
  139. background: transparent;
  140. border: none;
  141. box-shadow: none;
  142. position: relative;
  143. top: -38px;
  144. left: -25px;
  145. cursor: pointer;
  146. z-index: 100;
  147. }
  148. .upload-content .conList ol li {
  149. width: 114px;
  150. min-height: 80px;
  151. text-align: center;
  152. background: #fff;
  153. position: relative;
  154. top: 120px;
  155. margin-left: 2px;
  156. }
  157. .hide-pic {
  158. display: none !important;
  159. }
  160. .refund-methods{height:auto !important}
  161. .refund-methods>div{display:inline-block}
  162. .refund-methods label{vertical-align:top;line-height:50px}
  163. </style>
  164. <script type="text/javascript">
  165. $(document).ready(function() {
  166. $("#inputForm").validate({
  167. ignore:"",
  168. submitHandler: function (form) {
  169. var type = $("input[name='type']:checked").val();
  170. var differencePrice = $("#differencePrice").val();
  171. var waitPayShop = ${payShopDifference.waitPayShop};
  172. if (type == 2 && differencePrice > waitPayShop) {
  173. var refundCheckbox = $('.refund-checkbox:checked');
  174. var inputTotalAmount = 0;
  175. refundCheckbox.each(function () {
  176. var wrapper = $(this).closest('.refund-wrapper'),
  177. thisAmount = wrapper.find('.refund-amount');
  178. inputTotalAmount += Number(thisAmount.val());
  179. console.log('===', inputTotalAmount);
  180. });
  181. if (Number(differencePrice - inputTotalAmount - waitPayShop) > 0.1) {
  182. alertx("退款金额应等于差价与待付金额的差值");
  183. return false;
  184. }
  185. }
  186. if (type == 1 && ${payShopDifference.payStatus eq 3}){
  187. var bankAccountName = $("#bankAccountName").val();
  188. if (bankAccountName == '' || bankAccountName == null){
  189. alertx("开户名不能为空");
  190. return false;
  191. }
  192. var bankAccount = $("#bankAccount").val();
  193. if (bankAccount == '' || bankAccount == null){
  194. alertx("账号不能为空");
  195. return false;
  196. }
  197. var bankName = $("#bankName").val();
  198. if (bankName == '' || bankName == null){
  199. alertx("开户行不能为空");
  200. return false;
  201. }
  202. var payShopCheckbox = $('.payShop-checkbox:checked');
  203. var totalAmount = 0;
  204. payShopCheckbox.each(function () {
  205. if ($(this).val() == 1){
  206. totalAmount += Number($('input[name=transferPayFee]').val());
  207. }
  208. if ($(this).val() == 2){
  209. totalAmount += Number($('input[name=balancePayFee]').val());
  210. }
  211. });
  212. if (totalAmount != differencePrice){
  213. alertx("转账支付金额与欠款抵扣金额之和不等于差价,不能提交");
  214. return false;
  215. }
  216. }
  217. loading('正在提交,请稍等...');
  218. form.submit();
  219. },
  220. errorContainer: "#messageBox",
  221. errorPlacement: function(error, element) {
  222. $("#messageBox").text("输入有误,请先更正。");
  223. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  224. error.appendTo(element.parent().parent());
  225. } else {
  226. error.insertAfter(element);
  227. }
  228. }
  229. });
  230. });
  231. </script>
  232. </head>
  233. <body>
  234. <ul class="nav nav-tabs">
  235. <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
  236. <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
  237. <li class="active"><a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${payShopDifference.shopOrderId}">供应商差价</a></li>
  238. </ul>
  239. <form:form id="inputForm" modelAttribute="payShopDifference" action="${ctx}/order/cmPayShop/saveDifferencePrice" method="post" class="form-horizontal">
  240. <input type="hidden" id="ShopReceiptStatus" value="${payShopDifference.shopReceiptStatus}">
  241. <form:hidden path="shopOrderId"/>
  242. <br>
  243. <div class="control-group">
  244. <label class="control-label">差价类型:</label>&nbsp;&nbsp;&nbsp;
  245. <input type="radio" name="type" value="1" ${(payShopDifference.differencePrice > 0 && payShopDifference.type eq 2) ? 'disabled="disabled"':'checked="true"'} onclick="showInfo()">成本上升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  246. <input type="radio" name="type" value="2" ${(payShopDifference.differencePrice > 0 && payShopDifference.type eq 1) ? 'disabled="disabled"':'checked="true"'} onclick="showInfo()">成本降低&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  247. <img src="/static/images/info.jpg" style="height: 20px;width: 20px" onclick="alertx('“成本上升”指成本变高了,按旧成本付款的话相当于会少付供应商,\n'+
  248. '在已不能修改成本的情况下,通过补差价的方式来弥补;\n'+
  249. '\n'+
  250. '“成本降低”指成本变低了,按旧成本付款的话相当于会多付供应商,\n'+
  251. '在已不能修改成本的情况下,通过退差价的方式来弥补。\n'+
  252. '\n'+
  253. '特别注意:一个子订单可以申请多次供应商差价,但是每次只能选择同一种差价类型。若要修改差价类型,需要将该子订单的所有供应商差价付款单取消后才能操作')">
  254. </div>
  255. <div class="control-group">
  256. <label class="control-label"><font color='red'>*</font>付款单名称:</label>
  257. <div class="controls">
  258. <form:input path="name" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
  259. </div>
  260. </div>
  261. <div class="control-group">
  262. <label class="control-label"><font color='red'>*</font>差价金额:</label>
  263. <div class="controls">
  264. <input type="number" id="differencePrice" required name="differencePrice" onchange="showInfo()"/>
  265. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(目前子订单待付金额为¥${payShopDifference.waitPayShop})</label>
  266. </div>
  267. </div>
  268. <c:if test="${payShopDifference.payStatus eq 3}">
  269. <div id="payShopShow">
  270. <div class="control-group">
  271. <label class="control-label"><font color='red'>*</font>付款方式:</label>
  272. <input type="checkbox" class="payShop-checkbox" value="1" checked>转账支付
  273. </div>
  274. <div style="margin-left: 80px">
  275. <div class="control-group">
  276. <label class="control-label"><font color='red'>*</font>转账金额:</label>
  277. <div class="controls">
  278. <input type="number" name="transferPayFee" value="" onchange="changeShouldPay(this)"/>
  279. </div>
  280. </div>
  281. <div class="control-group">
  282. <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
  283. <form:input path="bankAccountName" id="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
  284. <label><font color='red'>*</font>账号:</label>
  285. <form:input path="bankAccount" id="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge"/>
  286. </div>
  287. <div class="control-group">
  288. <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
  289. <form:input path="bankName" id="bankName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
  290. <label><font color='red'>*</font>账户类型:</label>
  291. <form:select path="bankType" class="select-ele input-xlarge">
  292. <form:option value="0" label="公账"/>
  293. <form:option value="1" label="私账"/>
  294. </form:select>
  295. </div>
  296. </div>
  297. <div style="margin-left: 160px">
  298. <div class="control-group">
  299. <input type="checkbox" class="payShop-checkbox" value="2">欠款抵扣
  300. </div>
  301. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总欠款:<span id="rebateAmount">${payShopDifference.rebateAmount}</span>,
  302. 可用抵扣欠款:<span id="ableRebateAmount">${payShopDifference.ableRebateAmount}</span>,
  303. 使用:<input type="number" value="${payShopDifference.balancePayFee}" name="balancePayFee" class="used-amount">,
  304. 剩余:<span id="remainingBalance">${payShopDifference.ableRebateAmount}</span>
  305. </div>
  306. </div><br>
  307. </c:if>
  308. <div class="control-group" id="refundShow" hidden>
  309. <div class="refund-methods">
  310. <label class="control-label">接收退款方式:</label>
  311. <div>
  312. <div class="refund-wrapper">
  313. <input type="checkbox" class="refund-checkbox" name="refundWay" value="1" checked>线下转账&nbsp
  314. <select name="refundType" id="refundType">
  315. <option value="1">建设银行7297</option>
  316. <option value="2">中信银行0897</option>
  317. <option value="3">中信银行7172</option>
  318. <option value="4">广发银行0115</option>
  319. <option value="5">广发银行5461</option>
  320. <option value="6">虚拟银行0000</option>
  321. </select>
  322. <input type="number" name="refundAmount" class="refund-amount" value="0.00">
  323. </div><br>
  324. <div class="refund-wrapper">
  325. <input type="checkbox" class="refund-checkbox" name="refundWay" value="2">欠款账簿
  326. <input type="number" name="refundBalanceAmount" class="refund-amount" value="0.00">
  327. </div><br>
  328. <font color="red">注意:两种退款方式金额之和应该等于差价金额与待付金额的差值</font>
  329. </div>
  330. </div>
  331. </div>
  332. <div class="control-group">
  333. <label class="control-label"><font color='red'>*</font>备注内容:</label>
  334. <div class="controls">
  335. <textarea type="text" name="remark" placeholder="请详细说明造成付供应商差价的原因" style="position: relative;height: 100px; width: 450px;" maxlength="500" required ></textarea>
  336. </div>
  337. </div>
  338. <div class="control-group">
  339. <label class="control-label">图片:</label>
  340. <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
  341. <div class="conList">
  342. <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  343. <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  344. </div>
  345. <div class="conList hide-pic">
  346. <form:hidden id="remarkImage2" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  347. <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  348. </div>
  349. <div class="conList hide-pic">
  350. <form:hidden id="remarkImage3" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  351. <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  352. </div>
  353. <div class="conList hide-pic">
  354. <form:hidden id="remarkImage4" path="" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  355. <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  356. </div>
  357. <div class="conList hide-pic">
  358. <form:hidden id="remarkImage5" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  359. <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  360. </div>
  361. <div class="conList hide-pic">
  362. <form:hidden id="remarkImage6" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  363. <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  364. </div>
  365. <div class="conList hide-pic">
  366. <form:hidden id="remarkImage7" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  367. <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  368. </div>
  369. <div class="conList hide-pic">
  370. <form:hidden id="remarkImage8" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  371. <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  372. </div>
  373. <div class="conList hide-pic">
  374. <form:hidden id="remarkImage9" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  375. <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  376. </div>
  377. <div class="conList hide-pic">
  378. <form:hidden id="remarkImage10" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
  379. <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
  380. </div>
  381. </div>
  382. </div>
  383. <div class="form-actions">
  384. <input id="btnSubmit" style="margin-left: 150px" class="btn btn-primary" type="submit" value="确认"/>&nbsp;&nbsp;&nbsp;&nbsp;
  385. <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
  386. </div>
  387. </form:form>
  388. <sys:message content="${message}"/>
  389. <script>
  390. //图片初始化
  391. $(function () {
  392. $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
  393. $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
  394. $('.upload-content .conList').find('.cancel-upload').hide();
  395. var observeEle = document.getElementsByClassName('upload-content')[0];
  396. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
  397. var MutationObserverConfig={
  398. childList: true,
  399. subtree: true,
  400. characterData: true
  401. };
  402. var observer = new MutationObserver(function(mutations){
  403. $.each(mutations, function(index,item) {
  404. if (item.type === 'childList') {
  405. // 在创建新的 element 时调用
  406. var target = $(item.target),
  407. thisWrapper = target.closest('.conList'),
  408. nextEle = thisWrapper.next();
  409. thisWrapper.find('li').css('z-index',99);
  410. thisWrapper.find('.cancel-upload').show();
  411. if(nextEle.hasClass('hide-pic')) {
  412. nextEle.removeClass('hide-pic');
  413. }
  414. }
  415. })
  416. });
  417. observer.observe(observeEle,MutationObserverConfig);
  418. $('body').on('click','.upload-content li',function() {
  419. var index = $(this).closest('.conList').index() + 1,
  420. str = 'remarkImage'+index+'FinderOpen';
  421. eval(str+'()');
  422. });
  423. $('body').on('click', '.cancel-upload',function() {
  424. var wrapper = $(this).closest('.conList');
  425. wrapper.find('li').css('z-index','-1');
  426. wrapper.find('input').val('');
  427. $(this).hide();
  428. if ($('.cancel-upload:visible').length < 9) {
  429. wrapper.addClass("hide-pic");
  430. }else{
  431. wrapper.removeClass("hide-pic");
  432. }
  433. wrapper.parent().append(wrapper.clone());
  434. wrapper.remove();
  435. $(".conList").each(function(i,ele){
  436. if($(ele).find("input.input-xlarge").val()){
  437. $(ele).next().removeClass("hide-pic")
  438. }
  439. })
  440. });
  441. $(window).on("load", function(){
  442. setTimeout(function(){
  443. $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
  444. if($(ele).val()){
  445. $(ele).next().find("li").css("z-index","99");
  446. $(ele).parents(".conList").find(".cancel-upload").show();
  447. $(ele).parents(".conList").next().removeClass("hide-pic")
  448. }
  449. })
  450. },500);
  451. });
  452. //使用余额<总余额
  453. $('body').on('input propertychange','.used-amount',function() {
  454. var thisEle = $(this),
  455. thisVal = Number(thisEle.val()),
  456. totalAmount = Number($('#differencePrice').val()),
  457. ableRebateAmount = Number($('#ableRebateAmount').text());
  458. if (totalAmount === 0){
  459. alertx("请输入差价金额");
  460. thisEle.val(0);
  461. }else if (thisVal > ableRebateAmount || thisVal > totalAmount){
  462. thisEle.val(0);
  463. }else {
  464. $('#remainingBalance').text(ableRebateAmount - thisVal);
  465. }
  466. });
  467. showInfo();
  468. });
  469. /**
  470. * @param obj
  471. * jquery控制input只能输入数字
  472. */
  473. function onlynum(obj) {
  474. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  475. }
  476. function showInfo() {
  477. debugger
  478. var type = $("input[name='type']:checked").val();
  479. var ShopReceiptStatus=$('#ShopReceiptStatus').val();
  480. console.log(ShopReceiptStatus)
  481. if (type == 1){
  482. $("#refundShow").hide();
  483. $("#payShopShow").show();
  484. } else if(ShopReceiptStatus!=2){
  485. $("#payShopShow").hide();
  486. var differencePrice = $("#differencePrice").val();
  487. var waitPayShop = ${payShopDifference.waitPayShop};
  488. if (differencePrice > waitPayShop) {
  489. $("#refundShow").show();
  490. }else {
  491. $("#refundShow").hide();
  492. }
  493. }
  494. }
  495. </script>
  496. </body>
  497. </html>