defendList-add.jsp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>设备档案</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
  9. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  10. <script src="plug-in/layer/layer.js"></script>
  11. <script>
  12. </script>
  13. <script type="text/javascript">
  14. //编写自定义JS代码
  15. </script>
  16. </head>
  17. <body>
  18. <t:formvalid formid="formobj" dialog="true" usePlugin="password" beforeSubmit="checkSplit" layout="table" action="deviceDefendController.do?doAdd">
  19. <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
  20. <tr>
  21. <td align="right">
  22. <label class="Validform_label">
  23. <span color="red" class="requiredIcon">*</span>设备编码:
  24. </label>
  25. </td>
  26. <td class="value">
  27. <input id="deviceCode" name="deviceCode" type="text" style="width: 150px" class="inputxt" readonly onclick="openDeviceSelect()"/>
  28. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="userSearch" onclick="openDeviceSelect()">选择</a>
  29. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="userRedo" onclick="callbackClean()">清空</a>
  30. <span class="Validform_checktip"></span>
  31. <label class="Validform_label" style="display: none;">设备编码</label>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td align="right">
  36. <label class="Validform_label">
  37. <span color="red" class="requiredIcon">*</span>设备类型:
  38. </label>
  39. </td>
  40. <td class="value">
  41. <t:dictSelect id="typeId" field="typeId" type="list" dictTable="p_device_type" dictField="type_code" dictText="type_name" hasLabel="false" title="设备类型"></t:dictSelect>
  42. <span class="Validform_checktip"></span>
  43. <label class="Validform_label" style="display: none;">设备类型</label>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td align="right">
  48. <label class="Validform_label">
  49. <span color="red" class="requiredIcon">*</span>养护类型:
  50. </label>
  51. </td>
  52. <td class="value">
  53. <t:dictSelect id="type" field="type" type="list" typeGroupCode="defendType" hasLabel="false" title="养护类型"></t:dictSelect>
  54. <span class="Validform_checktip"></span>
  55. <label class="Validform_label" style="display: none;">养护类型</label>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td align="right">
  60. <label class="Validform_label">
  61. 养护时间:
  62. </label>
  63. </td>
  64. <td class="value">
  65. <input id="defendDate" name="defendDate" type="text" style="width: 150px" class="Wdate"
  66. onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*" ignore="checked"/>
  67. <span class="Validform_checktip"></span>
  68. <label class="Validform_label" style="display: none;">养护时间</label>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td align="right">
  73. <label class="Validform_label">
  74. <span color="red" class="requiredIcon">*</span>下次养护时间间隔:
  75. </label>
  76. </td>
  77. <td class="value">
  78. <input id="defendSplit" name="defendSplit" type="text" style="width: 150px" datatype="*" ignore="checked"/>
  79. <span class="Validform_checktip"></span>
  80. <label class="Validform_label" style="display: none;">下次养护时间间隔</label>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td align="right">
  85. <label class="Validform_label">
  86. 备注:
  87. </label>
  88. </td>
  89. <td class="value">
  90. <input id="remark" name="remark" type="text" style="width: 150px"/>
  91. <span class="Validform_checktip"></span>
  92. <label class="Validform_label" style="display: none;">备注</label>
  93. </td>
  94. </tr>
  95. </table>
  96. </t:formvalid>
  97. </body>
  98. <script type="text/javascript">
  99. function callbackClean() {
  100. $("#deviceCode").val("");
  101. $("#typeId").val("");
  102. }
  103. function openDeviceSelect() {
  104. $.dialog({
  105. content: 'url:deviceController?list&flg=select', zIndex: getzIndex(), title: '设备类型', lock: true, width: '1000px', height: '650px', opacity: 0.4, button: [
  106. {name: '确定', callback: function (){
  107. var iframe = this.iframe.contentWindow;
  108. if(iframe.getSelectedRow().length>0){
  109. var strData = eval(iframe.getSelectedRow());
  110. $("#deviceCode").val(strData[0].code);
  111. $("#typeId").val(strData[0].typeId);
  112. $("#typeId").attr("disabled","disabled");
  113. }
  114. }, focus: true},
  115. {name: '取消', callback: function (){}}
  116. ]}).zindex();
  117. }
  118. function checkSplit() {
  119. if(isNumber($('#defendSplit').val())){
  120. return true;
  121. }
  122. alert("下次养护时间间隔只能填数字");
  123. return false;
  124. }
  125. function isNumber(val){
  126. var regPos = /^\d+(\.\d+)?$/; //非负浮点数
  127. var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
  128. if(regPos.test(val) || regNeg.test(val)){
  129. return true;
  130. }else{
  131. return false;
  132. }
  133. }
  134. </script>