sysGoodsMaintainEdit.jsp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <%--
  2. time:2017-06-15 09:45:17
  3. desc:edit the SYS_GOODS_MAINTAIN
  4. --%>
  5. <%@page language="java" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html"%>
  7. <html>
  8. <head>
  9. <title>编辑 SYS_GOODS_MAINTAIN</title>
  10. <%@include file="/commons/include/form.jsp" %>
  11. <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
  12. <script type="text/javascript">
  13. $(function() {
  14. $("a.save").click(function() {
  15. if(!validateRepeat()) return;
  16. $("#sysGoodsMaintainForm").attr("action","save.ht");
  17. $("#saveData").val(1);
  18. submitForm();
  19. });
  20. });
  21. //提交表单
  22. function submitForm(){
  23. var options={};
  24. if(showResponse){
  25. options.success=showResponse;
  26. }
  27. var frm=$('#sysGoodsMaintainForm').form();
  28. frm.ajaxForm(options);
  29. if(frm.valid()){
  30. frm.submit();
  31. }
  32. }
  33. function showResponse(responseText) {
  34. var obj = new com.hotent.form.ResultMessage(responseText);
  35. if(!obj.isSuccess()){
  36. $.ligerDialog.err("提示信息"," SYS_GOODS_MAINTAIN保存失败!",obj.getMessage());
  37. return;
  38. }
  39. $.ligerDialog.confirm(obj.getMessage()+",是否继续操作","提示信息", function(rtn) {
  40. if(rtn){
  41. window.location.href = window.location.href;
  42. }else{
  43. window.location.href = "${ctx}/platform/system/sysGoodsMaintain/list.ht";
  44. }
  45. });
  46. }
  47. function validateRepeat(){
  48. var yes = true;
  49. var productid = "${sysGoodsMaintain.id}";
  50. var productname = $("#productname").val();
  51. var brand = $("#brand").val();
  52. var specification = $("#specification").val();
  53. if(productid == '') {
  54. if(productname && brand && specification) {
  55. var url = __ctx + "/platform/system/sysGoodsMaintain/repeat.ht";
  56. var rtn = {
  57. status : 0,
  58. msg : ""
  59. };
  60. $.ajax({
  61. url:url,
  62. data:{
  63. productname : productname,
  64. brand : brand,
  65. specification : specification
  66. },
  67. async:false
  68. }).done(function(data){
  69. if(data.status){
  70. rtn.status = -1;
  71. rtn.msg = data.msg;
  72. }
  73. }).fail(function(){
  74. rtn.status = -1;
  75. rtn.msg='后台出错!';
  76. yes = false;
  77. });
  78. if(rtn.status){
  79. if(rtn.msg){
  80. $.ligerDialog.warn(rtn.msg,"消息提示");
  81. yes = false;
  82. }
  83. }
  84. }
  85. }
  86. return yes;
  87. }
  88. </script>
  89. </head>
  90. <body>
  91. <div class="panel">
  92. <div class="panel-top">
  93. <div class="tbar-title">
  94. <c:choose>
  95. <c:when test="${sysGoodsMaintain.id !=null}">
  96. <span class="tbar-label"><span></span>编辑SYS_GOODS_MAINTAIN</span>
  97. </c:when>
  98. <c:otherwise>
  99. <span class="tbar-label"><span></span>添加SYS_GOODS_MAINTAIN</span>
  100. </c:otherwise>
  101. </c:choose>
  102. </div>
  103. <div class="panel-toolbar">
  104. <div class="toolBar">
  105. <div class="group"><a class="link save" id="dataFormSave" href="#"><span></span>保存</a></div>
  106. <div class="l-bar-separator"></div>
  107. <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="panel-body">
  112. <form id="sysGoodsMaintainForm" method="post" action="save.ht">
  113. <table class="table-detail" cellpadding="0" cellspacing="0" border="0" type="main">
  114. <tr>
  115. <th width="20%">物品编号: <span class="required red">*</span></th>
  116. <td><input type="text" id="productcode" name="productcode" value="${sysGoodsMaintain.productcode}" class="inputText" validate="{required:true,number:true}" /></td>
  117. </tr>
  118. <tr>
  119. <th width="20%">物品名称: <span class="required red">*</span></th>
  120. <td><input type="text" id="productname" name="productname" value="${sysGoodsMaintain.productname}" class="inputText" validate="{required:true,maxlength:128}" /></td>
  121. </tr>
  122. <tr>
  123. <th width="20%">品牌: <span class="required red">*</span></th>
  124. <td><input type="text" id="brand" name="brand" value="${sysGoodsMaintain.brand}" class="inputText" validate="{required:true,maxlength:32}" /></td>
  125. </tr>
  126. <tr>
  127. <th width="20%">规格: <span class="required red">*</span></th>
  128. <td><input type="text" id="specification" name="specification" value="${sysGoodsMaintain.specification}" class="inputText" validate="{required:true}" /></td>
  129. </tr>
  130. <tr>
  131. <th width="20%">价格: <span class="required red">*</span></th>
  132. <td><input type="text" id="price" name="price" value="${sysGoodsMaintain.price}" class="inputText" validate="{required:true,number:true,maxDecimalLen:2,maxIntLen:18}" /></td>
  133. </tr>
  134. <tr>
  135. <th width="20%">创建时间: </th>
  136. <td><input type="text" id="createtime" name="createtime" value="<fmt:formatDate value='${sysGoodsMaintain.createtime}' pattern='yyyy-MM-dd HH:mm:ss'/>" class="inputText" style="width:150px" validate="{date:true}" readonly /></td>
  137. </tr>
  138. <tr>
  139. <th width="20%">创建人: </th>
  140. <td><input type="text" id="creator" name="creator" value="${sysGoodsMaintain.creator}" class="inputText" validate="{required:true,maxlength:32}" readonly /></td>
  141. </tr>
  142. </table>
  143. <input type="hidden" name="id" value="${sysGoodsMaintain.id}" />
  144. <input type="hidden" name="saveData" id="saveData" />
  145. <input type="hidden" name="executeType" value="start" />
  146. </form>
  147. </div>
  148. </div>
  149. </body>
  150. </html>