libCommissionAdd.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <html xmlns:th="http://www.thymeleaf.org">
  2. <head>
  3. <title>私塾家</title>
  4. <script th:include="sys/common/metaCSS" th:remove="tag"></script>
  5. <script th:include="sys/common/metaJS" th:remove="tag"></script>
  6. <script src="sys/js/jquery.validate.min.js" th:src="@{/static/sys/js/jquery.validate.min.js}"></script>
  7. <script src="sys/js/jquery-validation/messages_zh.js" th:src="@{/static/sys/js/jquery-validation/messages_zh.js}"></script>
  8. <style>
  9. .clearfix:after {
  10. visibility: hidden;
  11. display: block;
  12. font-size: 0;
  13. content: " ";
  14. clear: both;
  15. height: 0;
  16. }
  17. .clearfix { display: inline-table; }
  18. * html .clearfix { height: 1%; }
  19. .clearfix { display: block; }
  20. .fl{display:inline;float:left}
  21. clearfix >control-label-error{display:inline;float:left;marign-left:10px}
  22. label.control-label-error {
  23. color: Red;
  24. }
  25. .lispan {line-height: 34px;}
  26. .select1{
  27. width:100%;
  28. height: 32px;
  29. line-height: 32px;
  30. border-top: solid 1px #a7b5bc;
  31. border-left: solid 1px #a7b5bc;
  32. border-right: solid 1px #ced9df;
  33. border-bottom: solid 1px #ced9df;
  34. opacity:1;
  35. margin-bottom: 10px;
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <div class="place">
  41. <span>位置:</span>
  42. <ul class="placeul">
  43. <li><a href="#">后台系统管理</a></li>
  44. <li><a th:href="@{/sys/sales/libStaffingList.html}">销售提成配置</a></li>
  45. </ul>
  46. </div>
  47. <div class="formbody">
  48. <div class="formtitle"><span th:text="${commission.id} ? '修改提成配置' :'新增提成配置'">新增图书</span></div>
  49. <form id="submitFrom" method="post" class="form-horizontal form-validate">
  50. <input type="hidden" name="id" th:if="${commission.id}" th:value="${commission.id}"/>
  51. <input type="hidden" name="libId" th:value="${commission.libId}"/>
  52. <ul class="forminfo">
  53. <li class="clearfix">
  54. <label>销售人员类型:<b>*</b></label>
  55. <div class="vocation" style="margin-right: 5px; width: 346px">
  56. <select class="select1" name="type">
  57. <option th:each="sort:${sortlist}" th:selected="${commission.type eq sort.code }" th:value="${sort.code}">[[${sort.name}]]</option>
  58. </select>
  59. </div>
  60. </li>
  61. <li class="clearfix">
  62. <label>新签提成:<b>*</b></label>
  63. <input type="text" id="newSign" class="dfinput fl" name="newSign" th:value="${commission.newSign}"/>
  64. </li>
  65. <li class="clearfix">
  66. <label>续签提成:<b>*</b></label>
  67. <input type="text" id="xSign" class="dfinput fl" name="xSign" th:value="${commission.xSign}"/>
  68. </li>
  69. <li>
  70. <label>&nbsp;</label>
  71. <button type="submit" class="btn">保存</button>
  72. <button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
  73. </li>
  74. </ul>
  75. </form>
  76. </div>
  77. </body>
  78. <script type="text/javascript">
  79. $(function(){
  80. $("#submitFrom").validate({
  81. rules : {
  82. newSign : {
  83. required : true,
  84. digits:true,
  85. min:10
  86. },
  87. xSign : {
  88. required : true,
  89. digits:true,
  90. min:10
  91. }
  92. },
  93. messages: {
  94. newSign : {
  95. required : "不能为空",
  96. digits : "只能输入整数"
  97. },
  98. xSign : {
  99. required : "不能为空",
  100. digits : "只能输入整数"
  101. }
  102. },
  103. errorPlacement : function(error, element) {
  104. error.appendTo(element.parent());
  105. },
  106. submitHandler : function(form) {
  107. roleFrom();
  108. }
  109. });
  110. });
  111. function roleFrom(){
  112. var url="[[${sysUrl}]]/sys/sales/libCommissionSave";
  113. var params = $("#submitFrom").serialize();
  114. $.post(url,params,function(data){
  115. if(data != null){
  116. if(data.meta.success){
  117. layer.msg("操作成功!",{icon:1});
  118. setTimeout(function(){
  119. window.location.href ='[[${sysUrl}]]/sys/sales/libCommissionList.html';
  120. },1000);
  121. }else{
  122. layer.msg(data.meta.message,{icon:11});
  123. }
  124. }
  125. });
  126. }
  127. </script>
  128. </html>