开分页之后返回~无法关掉dialog,有人知道蛇麽问题吗??

ericrock 发布于 2015/09/30 16:42
阅读 179
收藏 0


有人知道我下面的状况~就是我点画面上的打印按钮~我让他跳到另一页去打印~不过每次只要返回得时候~按确定或取消的时后~就会让原来dialog上的关掉dialog那个X~无法关掉dialog~请问有人知道这是啥问题吗?

<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="springform" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<meta name="description" content="edit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />


<!-- basic styles -->

        <link rel="stylesheet" href="<%=request.getContextPath()%>/css/ems.css">
        <link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/bootstrap.min.css"  /> 
        <link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/font-awesome.min.css" />    
 
<link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/ace-fonts.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/ace.min.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/ace-skins.min.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/jquery-ui-1.10.3.full.min.css" />

<script src="<%=request.getContextPath()%>/external/jquery/jquery-1.11.0.js" type="text/javascript"></script>    
<script src="<%=request.getContextPath()%>/external/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/assets/js/jquery-ui-1.10.3.full.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/assets/js/ace-extra.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/assets/js/json/json2.js" type="text/javascript"></script>

<!-- fancybox -->
<%-- <link rel="stylesheet" href="<%=request.getContextPath()%>plugins/fancybox/fancybox.css"> --%>
<%-- <link rel="stylesheet" href="<%=request.getContextPath()%>plugins/fancybox/main.css"> --%>
<%--         <script src="<%=request.getContextPath()%>plugins/fancybox/jquery.fancybox-1.3.1.pack.js" type="text/javascript"></script> --%>
<!-- <script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script> -->
        
<!--[if IE 7]>
 <link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/font-awesome-ie7.min.css" />
<![endif]-->
<!--[if lte IE 8]>
 <link rel="stylesheet" href="<%=request.getContextPath()%>/assets/css/ace-ie.min.css" />
<![endif]-->



<!--[if lt IE 9]>
<script src="<%=request.getContextPath()%>/assets/js/html5shiv.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/respond.min.js"></script>
<![endif]-->

<style>
      * {
          color:#7F7F7F;
          font-family:Arial,sans-serif;
          font-size:12px;
          font-weight:normal;
      }    
      #config{
          overflow: auto;
          margin-bottom: 10px;
      }
      .config{
          float: left;
          width: 200px;
          height: 50px;
          border: 1px solid #000;
          margin-left: 10px;
      }
      .config1{
          float: left;
          width: 50px;
          height: 25px;
          border: 1px solid #000;
          margin-left: 10px;
      
      
      }
      .config .title{
          font-weight: bold;
          text-align: center;
      }
      .config .barcode2D,
      #miscCanvas{
        display: none;
      }
      #submit{
          clear: both;
      }
      #barcodeTarget,
      #canvasTarget{
        margin-top: 20px;
      } 
      
    .div1
{
width: 100px; height: 100px; float: left
}
.div2
{
width: 100px; height: 100px; float: left
}
.div3
{
width: 100px; height: 100px; float: left
}
             
    </style>
    <script type="text/javascript"  src="<%=request.getContextPath()%>/plugins/barcode/jquery.min.js"></script>
    <script type="text/javascript"  src="<%=request.getContextPath()%>/plugins/barcode/jquery-barcode.min.js"></script>
    
    <script type="text/javascript">
      var dataUrl;
      function generateBarcode(){
        var value = $("#barcodeValue").val();
        var value2= $('#barcodeloc').val();
        var btype = $("input[name=btype]:checked").val();
        var renderer = $("input[name=renderer]:checked").val();
        
var quietZone = false;
        if ($("#quietzone").is(':checked') || $("#quietzone").attr('checked')){
          quietZone = true;
        }

        var settings = {
          output:renderer,
          bgColor: $("#bgColor").val(),
          color: $("#color").val(),
          barWidth: $("#barWidth").val(),
          barHeight: $("#barHeight").val(),
          moduleSize: $("#moduleSize").val(),
          posX: $("#posX").val(),
          posY: $("#posY").val(),
          addQuietZone: $("#quietZoneSize").val()
        };
        if ($("#rectangular").is(':checked') || $("#rectangular").attr('checked')){
          value = {code:value, rect: true};
          value2 ={code:value2, rect: true};
        }
        if (renderer == 'canvas'){
          clearCanvas();
          $("#barcodeTarget").hide();
          $("#canvasTarget").show().barcode(value, btype, settings);
       
        } else {
          $("#canvasTarget").hide();
          $("#barcodeTarget").html("").show().barcode(value, btype, settings);
          //$("#a2").html($("#barcodeloc").html());
          //$("#barcodeloc").html("").show().barcode(value2, btype, settings);
          
          var html = $('#barcodeTxt').val();
          var a2=$('#a2').val();
          if(a2 !=""){
         
         $('#a2').val('');


          }else {


          $('#a2').append(html);
          
          }
          
          //$('#a2').attr('hidden',true);


        }
        
        
        
      }
      
      function printdiv(printpage)
      {
      var headstr = "<html><head><title></title></head><body>";
      var footstr = "</body>";
      var newstr = document.all.item(printpage).innerHTML;
      var oldstr = document.body.innerHTML;
      document.body.innerHTML = headstr+newstr+footstr;
      window.print();
      document.body.innerHTML = oldstr;
      return false;
      }
      
      function showConfig1D(){
        $('.config .barcode1D').show();
        $('.config .barcode2D').hide();
      }
      
      function showConfig2D(){
        $('.config .barcode1D').hide();
        $('.config .barcode2D').show();
      }
      
      function clearCanvas(){
        var canvas = $('#canvasTarget').get(0);
        var ctx = canvas.getContext('2d');
        ctx.lineWidth = 1;
        ctx.lineCap = 'butt';
        ctx.fillStyle = '#FFFFFF';
        ctx.strokeStyle  = '#000000';
        ctx.clearRect (0, 0, canvas.width, canvas.height);
        ctx.strokeRect (0, 0, canvas.width, canvas.height);
      }
      
      $(function(){
        $('input[name=btype]').click(function(){
          if ($(this).attr('id') == 'datamatrix') showConfig2D(); else showConfig1D();
        });
        $('input[name=renderer]').click(function(){
          if ($(this).attr('id') == 'canvas') $('#miscCanvas').show(); else $('#miscCanvas').hide();
        });
        generateBarcode();
      });
     
      $(function() {
       $( "#dialog" ).dialog();
     });
      
      
    </script>

<script>
     
function btn() {




   var data='<b>你好</b><br>測試';
  
   $('#dialog').html( data );




   $('#dialog').css({display:'inline'});


   $("#dialog").dialog({
       title: '資料',
       bgiframe: true,
       width: 350,
       height: 350,
       modal: true,
       draggable: true,
       resizable: false,
       overlay:{opacity: 0.7, background: "#FF8899" },


       buttons: {
           '關閉': function() {
               $(this).dialog('close');
           }
       }
   });




}
     </script>
</head>
<body>


     <div id="signup-box" class="signup-box widget-box no-border">
<div class="widget-body">
<div class="widget-main">

<springform:form   method="post"  modelAttribute="breaker" class="form-horizontal" role="form">

<springform:input type="hidden" id='idTxt'  path="id" class="form-control"  />
<springform:input type="hidden" id='versionTxt'  path="version" class="form-control"  />
<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 断路器编码</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='codeTxt'  path="code" class="form-control" placeholder="Breaker Code" />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>


<div class="form-group">
<label for="nameCnTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 <spring:message code='Label.chineseName'/></label>


<div class="col-xs-10 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text"  id='nameCnTxt' path="nameCn"  placeholder="Chinese name"  class="form-control "  />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="nameEnTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 <spring:message code='Label.englishName'/></label>


<div class="col-xs-10 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text"  id='nameEnTxt' path="nameEn"  placeholder="English Name"  class="form-control "  />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
条形码</label>
<div class="col-xs-12 col-sm-5" id="barcodeloc">
<span class="block input-icon input-icon-right" >
<springform:input type="text" id='barcodeTxt'  path="barcode" class="form-control"  />
</span>
</div>

 
 
 <div id="generator">
 <div >
                条码号:<input type="text" id="barcodeValue" value="CN20150921">
      </div>
      <div id="submit" class="config1">
        <input type="button" onclick="generateBarcode();" value="产生条码&nbsp;">
      </div>
      
      <div class="config1"> 
          <input name="b_print" type="button" class="ipt" onClick="printdiv('printbarcode');" value="打印">
      </div>
     
     
     
    
    
    <div id="printbarcode" class="printbarcode">


    <div id="barcodeTarget" class="barcodeTarget">
    
    </div>
    
    <div id="a2" class="a2">
    </div>
    
    </div>
                                                         


</div>


<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
额定电压(kv)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedValtageTxt'  path="ratedValtage" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 工作耐受电压(kv)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='withstandVoltageTxt'  path="withstandVoltage" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 额定电流(A)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedCurrentTxt'  path="ratedCurrent" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 雷电冲击耐受电压(KV)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='impulseWithstandVoltageTxt'  path="impulseWithstandVoltage" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 额定频率(Hz)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedFrequencyTxt'  path="ratedFrequency" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 断路耐受频率</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedBreakingwithstandcurrentTxt'  path="ratedBreakingwithstandcurrent" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 额定关合电流(峰值)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedMakingcurrentTxt'  path="ratedMakingcurrent" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
分闸最短时间(ms)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='openingMintimeTxt'  path="openingMintime" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 分闸最大时间(ms)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='openingMaxtimeTxt'  path="openingMaxtime" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
 合闸最短时间(ms)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='closingMintimeTxt'  path="closingMintime" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
合闸最大时间(ms)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='closingMaxtimeTxt'  path="closingMaxtime" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
额定峰值耐受电流(KA)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedPeakwithstandCurrentTxt'  path="ratedPeakwithstandCurrent" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
额定短路电流持续时间(s)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedShortcuttimeTxt'  path="ratedShortcuttime" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
额定短时耐受电流(KA)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='ratedWithstandCurrentTxt'  path="ratedWithstandCurrent" class="form-control" 
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
相间距(mm)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='poleDistanceTxt'  path="poleDistance" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
外观长度(mm)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='outerLengthTxt'  path="outerLength" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
外观宽度(mm)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='outerWidthTxt'  path="outerWidth" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
外观高度(mm)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='outerHeightTxt'  path="outerHeight" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>

<div class="form-group">
<label for="codeTxt" class="col-xs-12 col-sm-3 control-label no-padding-right">
重量(kg)</label>


<div class="col-xs-12 col-sm-5">
<span class="block input-icon input-icon-right">
<springform:input type="text" id='weightTxt'  path="weight" class="form-control"  
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

</span>
</div>
<div class="help-block col-xs-12 col-sm-reset inline">

</div>
</div>



       
<div class="clearfix form-actions" style='text-align:center'>
      <!-- <div class="col-md-offset-3  col-md-9">-->         
   <button type="button"   class=" btn btn-sm btn-primary" id="saveBtn">
<spring:message code="button.save"/>
<i class="icon-ok bigger-110"></i>
</button>


    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
    <button type="reset" class="btn btn-sm">
<spring:message code='button.reset'/>
<i class="icon-undo"></i>
</button>

     
     
     <div id='messageDiv'></div>

  </div>

</springform:form >
</div>



</div><!-- /widget-body -->
</div><!-- /signup-box -->



<!--一维条码设定值,为了不影响最上面的界面所,隐藏在最保存取消底下 -->
<div id="config"  style="visibility:hidden;"><!--13种一维条码编码方式,目前使用code128条码形式 -->
        <div class="config">
          <div class="title">Type</div>
<!--           <input type="radio" name="btype" id="ean8" value="ean8" checked="checked"><label for="ean8">EAN 8</label><br /> -->
<!--  <input type="radio" name="btype" id="ean13" value="ean13"><label for="ean13">EAN 13</label><br />
<!--  <input type="radio" name="btype" id="upc" value="upc"><label for="upc">UPC</label><br /> -->
<!--           <input type="radio" name="btype" id="std25" value="std25"><label for="std25">standard 2 of 5 (industrial)</label><br /> -->
<!--           <input type="radio" name="btype" id="int25" value="int25"><label for="int25">interleaved 2 of 5</label><br /> -->
<!--           <input type="radio" name="btype" id="code11" value="code11"><label for="code11">code 11</label><br /> -->
<!--            <input type="radio" name="btype" id="code39" value="code39"  checked="checked"><label for="code39">code 39</label><br />  -->
<!--           <input type="radio" name="btype" id="code93" value="code93"><label for="code93" checked="checked">code 93</label><br />  -->
               <input type="radio" name="btype" id="code128" value="code128" checked="checked"><label for="code128">code 128</label><br />
<!--           <input type="radio" name="btype" id="codabar" value="codabar"><label for="codabar">codabar</label><br /> -->
<!--           <input type="radio" name="btype" id="msi" value="msi"><label for="msi">MSI</label><br /> -->
<!--           <input type="radio" name="btype" id="datamatrix" value="datamatrix"><label for="datamatrix">Data Matrix</label><br /><br /> -->
        </div>
        
          
        <div class="config" style="visibility:hidden;"><!--条码大小调整Div-->
          <div class="title">Misc</div>
            Background : <input type="hidden" id="bgColor" value="#FFFFFF" size="7"><br />
            "1" Bars : <input type="hidden" id="color" value="#000000" size="7"><br />
          <div class="barcode1D">
            bar width: <input type="hidden" id="barWidth" value="2" size="1" ><br />
            bar height: <input type="hidden" id="barHeight" value="50" size="1"><br />
          </div>
          <div class="barcode2D"><!--二维条码条码大小调整Div,暂时没有用到-->
            Module Size: <input type="text" id="moduleSize" value="5" size="3"><br />
            Quiet Zone Modules: <input type="text" id="quietZoneSize" value="1" size="3"><br />
            Form: <input type="checkbox" name="rectangular" id="rectangular"><label for="rectangular">Rectangular</label><br />
          </div>
          <div id="miscCanvas">
            x : <input type="text" id="posX" value="10" size="3"><br />
            y : <input type="text" id="posY" value="20" size="3"><br />
          </div>
        </div>
            
        <div class="config"  style="visibility:hidden;"><!--选择CSS形式-->
          <div class="title">Format</div>
          <input type="radio" id="css" name="renderer" value="css" checked="checked"><label for="css">CSS</label><br />
<!--           <input type="radio" id="bmp" name="renderer" value="bmp"><label for="bmp">BMP (not usable in IE)</label><br /> -->
<!--           <input type="radio" id="svg" name="renderer" value="svg"><label for="svg">SVG (not usable in IE)</label><br /> -->
<!--           <input type="radio" id="canvas" name="renderer" value="canvas"><label for="canvas">Canvas (not usable in IE)</label><br /> -->
        </div>
      </div>
        
      
    </div>
<script type='text/javascript'>
jQuery(function($){
         $( "#saveBtn" ).on('click', function(e){


                    var  formdata = new FormData();
                    formdata.append('code',$('#codeTxt').val());
                    formdata.append('nameCn',$('#nameCnTxt').val());
                    formdata.append('nameEn',$('#nameEnTxt').val());
                    formdata.append('id',$('#idTxt').val());
                    formdata.append('version',$('#versionTxt').val());
                    formdata.append('barcode',$('#barcodeTxt').val());
                    formdata.append('ratedValtage',$('#ratedValtageTxt').val());
                    formdata.append('withstandVoltage',$('#withstandVoltageTxt').val());
                    formdata.append('ratedCurrent',$('#ratedCurrentTxt').val());
                    formdata.append('impulseWithstandVoltage',$('#impulseWithstandVoltageTxt').val());
                    formdata.append('ratedFrequency',$('#ratedFrequencyTxt').val());
                    formdata.append('ratedBreakingwithstandcurrent',$('#ratedBreakingwithstandcurrentTxt').val());
                    formdata.append('ratedMakingcurrent',$('#ratedMakingcurrentTxt').val());
                    formdata.append('openingMintime',$('#openingMintimeTxt').val());
                    formdata.append('openingMaxtime',$('#openingMaxtimeTxt').val());
                    formdata.append('closingMintime',$('#closingMintimeTxt').val());
                    formdata.append('closingMaxtime',$('#closingMaxtimeTxt').val());
                    formdata.append('ratedPeakwithstandCurrent',$('#ratedPeakwithstandCurrentTxt').val());
                    formdata.append('ratedShortcuttime',$('#ratedShortcuttimeTxt').val());
                    formdata.append('ratedWithstandCurrent',$('#ratedWithstandCurrentTxt').val());
                    formdata.append('poleDistance',$('#poleDistanceTxt').val());
                    formdata.append('outerLength',$('#outerLengthTxt').val());
                    formdata.append('outerWidth',$('#outerWidthTxt').val());
                    formdata.append('outerHeight',$('#outerHeightTxt').val());
                    formdata.append('weight',$('#weightTxt').val());
                   


                    var actionUrl= "<%=request.getContextPath()%>/dev/ajaxSaveBreakerDetail.ef";
                        jQuery.ajax( {  
type:"POST",
       url : actionUrl,  
       data : formdata , /*formdata,*/  
       user : "json",  
       cache : false,  
       processData : false,
       contentType : false,  
       error : function() {                
           alert("操作不成功!");
       },  
       success : function(data) {
        data=JSON.parse(data);
        if(data.resultCode.localeCompare("success")!=0){
        errstr="<table><tr><th align='center'>错误属性</th><th align='center'>错误代码</th><th align='center'>错误信息</th></tr>";
        errstr= errstr+"<tr><td align='left'>数据错误</td><td align='left'>"+data.resultCode +"</td><td align='left'>"+data.message+"</td></tr>";
        //if(typeof(data.baseErrors)!="undefined")
        if(data.baseErrors)
        for(i=0 ;i< data.baseErrors.length;i++){
        ferror= data.baseErrors[i];
        errstr= errstr+"<tr><td align='left'>"+ferror.fieldName+"</td><td align='left'>"+ferror.codeName+"</td><td align='left'>"+ferror.description+"</td></tr>";
          
           }
        errstr=errstr+"</table>";
        $('#messageDiv').html(errstr);
        }else{
          $('#messageDiv').html('保存成功');
            }  
       
       }  
   });   
          });//end click
});//end ready


</script>


</body>

</html>

加载中
0
徐舟
徐舟
排个版再发出来
返回顶部
顶部