123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <%--
- time:2017-06-15 09:45:17
- desc:edit the SYS_GOODS_MAINTAIN
- --%>
- <%@page language="java" pageEncoding="UTF-8"%>
- <%@include file="/commons/include/html_doctype.html"%>
- <html>
- <head>
- <title>编辑 SYS_GOODS_MAINTAIN</title>
- <%@include file="/commons/include/form.jsp" %>
- <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
- <script type="text/javascript">
- $(function() {
- $("a.save").click(function() {
- if(!validateRepeat()) return;
- $("#sysGoodsMaintainForm").attr("action","save.ht");
- $("#saveData").val(1);
- submitForm();
- });
- });
- //提交表单
- function submitForm(){
- var options={};
- if(showResponse){
- options.success=showResponse;
- }
- var frm=$('#sysGoodsMaintainForm').form();
- frm.ajaxForm(options);
- if(frm.valid()){
- frm.submit();
- }
- }
-
- function showResponse(responseText) {
- var obj = new com.hotent.form.ResultMessage(responseText);
- if(!obj.isSuccess()){
- $.ligerDialog.err("提示信息"," SYS_GOODS_MAINTAIN保存失败!",obj.getMessage());
- return;
- }
- $.ligerDialog.confirm(obj.getMessage()+",是否继续操作","提示信息", function(rtn) {
- if(rtn){
- window.location.href = window.location.href;
- }else{
- window.location.href = "${ctx}/platform/system/sysGoodsMaintain/list.ht";
- }
- });
- }
-
- function validateRepeat(){
- var yes = true;
- var productid = "${sysGoodsMaintain.id}";
- var productname = $("#productname").val();
- var brand = $("#brand").val();
- var specification = $("#specification").val();
- if(productid == '') {
- if(productname && brand && specification) {
- var url = __ctx + "/platform/system/sysGoodsMaintain/repeat.ht";
- var rtn = {
- status : 0,
- msg : ""
- };
- $.ajax({
- url:url,
- data:{
- productname : productname,
- brand : brand,
- specification : specification
- },
- async:false
- }).done(function(data){
- if(data.status){
- rtn.status = -1;
- rtn.msg = data.msg;
- }
- }).fail(function(){
- rtn.status = -1;
- rtn.msg='后台出错!';
- yes = false;
- });
- if(rtn.status){
- if(rtn.msg){
- $.ligerDialog.warn(rtn.msg,"消息提示");
- yes = false;
- }
- }
- }
- }
- return yes;
- }
- </script>
- </head>
- <body>
- <div class="panel">
- <div class="panel-top">
- <div class="tbar-title">
- <c:choose>
- <c:when test="${sysGoodsMaintain.id !=null}">
- <span class="tbar-label"><span></span>编辑SYS_GOODS_MAINTAIN</span>
- </c:when>
- <c:otherwise>
- <span class="tbar-label"><span></span>添加SYS_GOODS_MAINTAIN</span>
- </c:otherwise>
- </c:choose>
- </div>
- <div class="panel-toolbar">
- <div class="toolBar">
- <div class="group"><a class="link save" id="dataFormSave" href="#"><span></span>保存</a></div>
- <div class="l-bar-separator"></div>
- <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
- </div>
- </div>
- </div>
- <div class="panel-body">
- <form id="sysGoodsMaintainForm" method="post" action="save.ht">
- <table class="table-detail" cellpadding="0" cellspacing="0" border="0" type="main">
- <tr>
- <th width="20%">物品编号: <span class="required red">*</span></th>
- <td><input type="text" id="productcode" name="productcode" value="${sysGoodsMaintain.productcode}" class="inputText" validate="{required:true,number:true}" /></td>
- </tr>
- <tr>
- <th width="20%">物品名称: <span class="required red">*</span></th>
- <td><input type="text" id="productname" name="productname" value="${sysGoodsMaintain.productname}" class="inputText" validate="{required:true,maxlength:128}" /></td>
- </tr>
- <tr>
- <th width="20%">品牌: <span class="required red">*</span></th>
- <td><input type="text" id="brand" name="brand" value="${sysGoodsMaintain.brand}" class="inputText" validate="{required:true,maxlength:32}" /></td>
- </tr>
- <tr>
- <th width="20%">规格: <span class="required red">*</span></th>
- <td><input type="text" id="specification" name="specification" value="${sysGoodsMaintain.specification}" class="inputText" validate="{required:true}" /></td>
- </tr>
- <tr>
- <th width="20%">价格: <span class="required red">*</span></th>
- <td><input type="text" id="price" name="price" value="${sysGoodsMaintain.price}" class="inputText" validate="{required:true,number:true,maxDecimalLen:2,maxIntLen:18}" /></td>
- </tr>
- <tr>
- <th width="20%">创建时间: </th>
- <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>
- </tr>
- <tr>
- <th width="20%">创建人: </th>
- <td><input type="text" id="creator" name="creator" value="${sysGoodsMaintain.creator}" class="inputText" validate="{required:true,maxlength:32}" readonly /></td>
- </tr>
- </table>
- <input type="hidden" name="id" value="${sysGoodsMaintain.id}" />
- <input type="hidden" name="saveData" id="saveData" />
- <input type="hidden" name="executeType" value="start" />
- </form>
-
- </div>
- </div>
- </body>
- </html>
|