updateShouldPay.jsp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. <script type="text/javascript">
  8. $(document).ready(function() {
  9. //$("#name").focus();
  10. $("#inputForm").validate({
  11. ignore:"",
  12. submitHandler: function(form){
  13. loading('正在提交,请稍等...');
  14. form.submit();
  15. },
  16. errorContainer: "#messageBox",
  17. errorPlacement: function(error, element) {
  18. $("#messageBox").text("输入有误,请先更正。");
  19. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  20. error.appendTo(element.parent().parent());
  21. } else {
  22. error.insertAfter(element);
  23. }
  24. }
  25. });
  26. });
  27. function updateShouldPay() {
  28. var shopFee = $(".shopFee").val();
  29. var otherFee = $(".otherFee").val();
  30. if(null == shopFee || "" == shopFee){
  31. alertx("应付供应商不能为空")
  32. return;
  33. }
  34. if(null == otherFee || "" == otherFee){
  35. alertx("应付第三方不能为空")
  36. return;
  37. }
  38. var shouldPayTax = $("#shouldPayTax").val();
  39. var shouldPayTotal = $("#shouldPayTotal").val();
  40. //应付采美=应付总额-应付供应商-第三方-总税费
  41. var cmFee = shouldPayTotal - shopFee - otherFee - shouldPayTax;
  42. $(".cmFee").text(cmFee);
  43. }
  44. function submit(){
  45. var shopFee = $(".shopFee").val();
  46. var otherFee = $(".otherFee").val();
  47. return shopFee+","+otherFee;
  48. }
  49. </script>
  50. </head>
  51. <body>
  52. <form:form id="inputForm" modelAttribute="shouldPay" action="${ctx}/bulkpurchase/shouldPay/" method="post" class="form-horizontal">
  53. <sys:message content="${message}"/>
  54. <input type="hidden" id="id" maxlength="20" value="${id}" class="input-medium required kong" />
  55. <input type="hidden" id="shopFee" maxlength="20" value="${shopFee}" class="input-medium required kong" />
  56. <input type="hidden" id="otherFee" maxlength="20" value="${otherFee}" class="input-medium required kong" />
  57. <input type="hidden" id="cmFee" maxlength="20" value="${cmFee}" class="input-medium required kong" />
  58. <input type="hidden" id="shouldPayTax" maxlength="20" value="${shouldPayTax}" class="input-medium required kong" />
  59. <input type="hidden" id="shouldPayTotal" maxlength="20" value="${shouldPayTotal}" class="input-medium required kong" />
  60. <div style=" width:100% ;text-align:right">
  61. <%--<span><p class="control-label">应付总金额:</p></span>--%>
  62. <span><p class="shouldPayTotal" text-aligin="right" maxlength="11">应付总金额:<fmt:formatNumber value="${shouldPayTotal}" type="currency" pattern="0.00"/></p></span>
  63. </div>
  64. <div>
  65. <span><label class="control-label">付供应商:</label></span>
  66. <span><input class="shopFee" onclick="updateShouldPay()" maxlength="11" class="required" value="<fmt:formatNumber value="${shopFee}" type="currency" pattern="0.00"/>"/></span>
  67. </div>
  68. <div>
  69. <span><label class="control-label">付第三方:</label></span>
  70. <span><input class="otherFee" onclick="updateShouldPay()" maxlength="11" class="required" value="<fmt:formatNumber value="${otherFee}" type="currency" pattern="0.00"/>"/></span>
  71. </div>
  72. <div>
  73. <span><label class="control-label">应付采美:</label></span>
  74. <span><p class="cmFee" maxlength="11"><fmt:formatNumber value="${cmFee}" type="currency" pattern="0.00"/></p></span>
  75. </div>
  76. </form:form>
  77. </body>
  78. </html>