syscomparisonyEdit.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <%--
  2. time:2019-08-21 17:05:24
  3. desc:edit the SYS_COMPARISONY
  4. --%>
  5. <%@page language="java" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html"%>
  7. <html>
  8. <head>
  9. <title>编辑档案</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" src="${ctx}/js/hotent/platform/form/AttachMent.js"></script>
  13. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/HtmlUploadDialog.js"></script>
  14. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/FlexUploadDialog.js"></script>
  15. <f:link href="form.css" ></f:link>
  16. <style>
  17. .tab_page img{
  18. width:100%;
  19. height:100%;
  20. }
  21. .sp_border{
  22. width:208px;
  23. height: 93px;
  24. /*border: 3px solid #b31a0d;*/
  25. float:right;
  26. position: absolute;
  27. position: absolute;
  28. top: 75%;
  29. margin-top: -47px;
  30. left: 50%;
  31. margin-left: -102px;
  32. cursor:pointer;
  33. -webkit-user-select:none;
  34. -moz-user-select:none;
  35. -ms-user-select:none;
  36. user-select:none;
  37. z-index:9;
  38. }
  39. .sp_border img{
  40. -moz-user-select: none;
  41. -webkit-user-select: none;
  42. -ms-user-select: none;
  43. -khtml-user-select: none;
  44. user-select: none;
  45. width:auto;
  46. height:auto;
  47. }
  48. .sp_border span{
  49. float:left;
  50. display: block;
  51. height:20px;
  52. line-height: 20px;
  53. }
  54. .sp_border span input{
  55. border: 0px;
  56. width: 100%;
  57. height: 14px;
  58. line-height: 18px;
  59. font-family: "楷体";
  60. font-size: 13px;
  61. font-weight: bold;
  62. color: #043487;
  63. text-align:center;
  64. background:none;
  65. }
  66. .tab_page{
  67. position:relative;
  68. width:21cm;
  69. min-height:29.7cm;
  70. /*padding:2cm; */
  71. margin:1cm auto;
  72. border:1px#D3D3D3 solid;
  73. }
  74. </style>
  75. <script type="text/javascript">
  76. $(function() {
  77. $("a.save").click(function() {
  78. if(!validateImg()) return;
  79. $("#syscomparisonyForm").attr("action","save.ht");
  80. $("#saveData").val(1);
  81. submitForm();
  82. });
  83. $("#btnSelectImg").click(function(){
  84. HtmlUploadDialog({max:1,callback:function(data){
  85. if(data.length==1){
  86. var fileId=data[0].fileId;
  87. var url=__ctx +"/platform/system/sysFile/file_"+fileId+".ht"
  88. $("#kz1").val(fileId);
  89. $("#columnImg").attr("src",url)
  90. }
  91. }});
  92. });
  93. });
  94. function csfz(){
  95. var fullname=document.getElementById("fullname").value;
  96. $("#rm").attr("value",fullname);//推荐这种写法,可正常赋值
  97. var num=document.getElementById("num").value;
  98. $("#ye").attr("value",num);
  99. var ctime=document.getElementById("ctime").value;
  100. ctime = ctime.replace(/-/g, '/'); //格式化日期
  101. // 创建日期对象
  102. var date = new Date(ctime);
  103. var yyyy=date.getFullYear(); //获取完整的年份(4位,1970-????)
  104. var mm=date.getMonth()+1; //获取当前月份(0-11,0代表1月)
  105. var dd=date.getDate(); //获取当前日(1-31)
  106. if(isNaN(yyyy)){
  107. $("#yyyy").attr("value","");
  108. $("#mm").attr("value","");
  109. $("#dd").attr("value","");
  110. }else if(!isNaN(yyyy)){
  111. $("#yyyy").attr("value",yyyy);
  112. $("#mm").attr("value",mm);
  113. $("#dd").attr("value",dd);
  114. }
  115. }
  116. function fzrm(){
  117. var fullname=document.getElementById("fullname").value;
  118. $("#rm").attr("value",fullname);
  119. }
  120. function fuzhi(){
  121. var num=document.getElementById("num").value;
  122. $("#ye").attr("value",num);
  123. }
  124. function fzsj(){
  125. var ctime=document.getElementById("ctime").value;
  126. ctime = ctime.replace(/-/g, '/'); //格式化日期
  127. // 创建日期对象
  128. var date = new Date(ctime);
  129. var yyyy=date.getFullYear(); //获取完整的年份(4位,1970-????)
  130. var mm=date.getMonth()+1; //获取当前月份(0-11,0代表1月)
  131. var dd=date.getDate(); //获取当前日(1-31)
  132. if(isNaN(yyyy)){
  133. $("#yyyy").attr("value","");
  134. $("#mm").attr("value","");
  135. $("#dd").attr("value","");
  136. }else if(!isNaN(yyyy)){
  137. $("#yyyy").attr("value",yyyy);
  138. $("#mm").attr("value",mm);
  139. $("#dd").attr("value",dd);
  140. }
  141. }
  142. //提交表单
  143. function submitForm(){
  144. var options={};
  145. var fullname=document.getElementById("fullname").value;
  146. var kz2=document.getElementById("kz2").value;
  147. var kz3=document.getElementById("kz3").value;
  148. var card=document.getElementById("card").value;
  149. var unit=document.getElementById("unit").value;
  150. if(fullname==null){
  151. alert("姓名不能为空,请重新填写!");
  152. return false;
  153. }
  154. if(card==null){
  155. alert("身份证号不能为空,请重新填写!");
  156. return false;
  157. }
  158. if(unit==null){
  159. alert("单位不能为空,请重新填写!");
  160. return false;
  161. }
  162. if(kz2==null){
  163. alert("档案号不能为空,请重新填写!");
  164. return false;
  165. }
  166. if(kz3==null){
  167. alert("业务类别不能为空,请重新填写!");
  168. return false;
  169. }
  170. //if(card.length!=18){
  171. // alert("身份证号不满足18位,请重新填写!");
  172. // return false;
  173. //}
  174. if(showResponse){
  175. options.success=showResponse;
  176. }
  177. var frm=$('#syscomparisonyForm').form();
  178. frm.ajaxForm(options);
  179. if(frm.valid()){
  180. frm.submit();
  181. }
  182. }
  183. function showResponse(responseText) {
  184. var obj = new com.hotent.form.ResultMessage(responseText);
  185. if(!obj.isSuccess()){
  186. $.ligerDialog.err("提示信息"," SYS_COMPARISON保存失败!",obj.getMessage());
  187. return;
  188. }
  189. $.ligerDialog.confirm(obj.getMessage()+",是否继续操作","提示信息", function(rtn) {
  190. if(rtn){
  191. window.location.href = window.location.href;
  192. }else{
  193. window.location.href = "${ctx}/platform/system/syscomparisony/list.ht";
  194. }
  195. });
  196. }
  197. function validateImg(){
  198. var yes=true;
  199. var imgurl=$("#kz1").val();
  200. /* if(imgurl.length==0){
  201. $.ligerDialog.warn("请上传会议室图片!","消息提示");
  202. yes=false;
  203. } */
  204. return yes;
  205. };
  206. function isUrgentClick(str){
  207. $("#kz4").val(str);
  208. }
  209. </script>
  210. </head>
  211. <body>
  212. <div class="panel">
  213. <div class="panel-top">
  214. <div class="tbar-title">
  215. <c:choose>
  216. <c:when test="${syscomparisony.id !=null}">
  217. <span class="tbar-label"><span></span>编辑SYS_COMPARISONY</span>
  218. </c:when>
  219. <c:otherwise>
  220. <span class="tbar-label"><span></span>添加SYS_COMPARISONY</span>
  221. </c:otherwise>
  222. </c:choose>
  223. </div>
  224. <div class="panel-toolbar">
  225. <div class="toolBar">
  226. <div class="group"><a class="link save" id="dataFormSave" href="#"><span></span>保存</a></div>
  227. <div class="l-bar-separator"></div>
  228. <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
  229. </div>
  230. </div>
  231. </div>
  232. <div class="panel-body">
  233. <form id="syscomparisonyForm" method="post" action="save.ht">
  234. <table class="table-detail" cellpadding="0" cellspacing="0" border="0" type="main">
  235. <tr>
  236. <th width="20%">档案号: </th>
  237. <td><input type="text" id="kz2" name="kz2" style="width:180px;" value="${syscomparisony.kz2}" class="inputText" validate="{required:false,maxlength:20}" /></td>
  238. </tr>
  239. <tr>
  240. <th width="20%">业务类别: </th>
  241. <td><input type="text" id="kz3" name="kz3" style="width:180px;" value="${syscomparisony.kz3}" class="inputText" validate="{required:false,maxlength:20}" /></td>
  242. </tr>
  243. <tr>
  244. <th width="20%">人员姓名: </th>
  245. <td><input type="text" id="fullname" style="width:180px;" name="fullname" value="${syscomparisony.fullname}" onblur="fzrm()" class="inputText" validate="{required:false,maxlength:20}" /></td>
  246. </tr>
  247. <tr>
  248. <th width="20%">身份证号: </th>
  249. <td><input type="text" id="card" style="width:180px;" name="card" value="${syscomparisony.card}" class="inputText" validate="{required:false,maxlength:50}" /></td>
  250. </tr>
  251. <tr>
  252. <th width="20%">单位: </th>
  253. <td><input type="text" id="unit" style="width:180px;" name="unit" value="${syscomparisony.unit}" class="inputText" validate="{required:false,maxlength:300}" /></td>
  254. </tr>
  255. <tr>
  256. <th width="20%">当前时间: </th>
  257. <td><input type="text" id="ctime" style="width:180px;" name="ctime" value="<fmt:formatDate value='${syscomparisony.ctime}' pattern='yyyy-MM-dd'/>" class="inputText date" validate="{date:true}" /></td>
  258. </tr>
  259. <tr>
  260. <th width="20%">页数: </th>
  261. <td><input type="text" id="num" style="width:180px;" name="num" value="${syscomparisony.num}" onblur="fuzhi()" class="inputText" validate="{required:false,maxlength:10}" /></td>
  262. </tr>
  263. <tr>
  264. <th width="20%">附件上传: </th>
  265. <td>
  266. <div name="div_attachment_container">
  267. <div class="attachement"></div>
  268. <textarea style="display: none" controltype="attachment"
  269. name="attachment" lablename="附件" validate="{}">${syscomparisony.attachment}</textarea>
  270. <a href="javascript:;" field="attachment" class="link selectFile"
  271. atype="select" onclick="AttachMent.addFile(this);">选择</a>
  272. </div>
  273. </td>
  274. <tr>
  275. <tr>
  276. <th width="20%">办理状态: </th>
  277. <td><input type="hidden" id="kz4" name="kz4" class="inputText" />
  278. <input type="radio" id="isUrgentYes" name="isUrgent" value="1" title="未办理" checked="checked" onclick="isUrgentClick(1)">未办理
  279. <input type="radio" id="isUrgentNo" name="isUrgent" value="2" title="已办理" onclick="isUrgentClick(2)">已办理
  280. </td>
  281. </tr>
  282. <tr>
  283. <th width="20%">备注: </th>
  284. <td><input type="text" id="kz5" name="kz5" style="width:500px;" value="${syscomparisony.kz5}" class="inputText" validate="{required:false,maxlength:200}" /></td>
  285. </tr>
  286. <td id="td_gz" colspan="2">
  287. <input type="hidden" id="kz1" name="kz1" value="${syscomparisony.kz1}">
  288. <div class="tab_page">
  289. <c:choose>
  290. <c:when test="${empty syscomparisony.kz1}">
  291. <img id="columnImg" alt="" src="" draggable="false">
  292. </c:when>
  293. <c:otherwise>
  294. <img id="columnImg" alt="" draggable="false" src="${ctx }/platform/system/sysFile/file_${syscomparisony.kz1}.ht">
  295. </c:otherwise>
  296. </c:choose>
  297. <input id="btnSelectImg" type="button" value="选择">
  298. <div class="sp_border" id="sp_border" onmousedown="small_down(event)">
  299. <span><img src="../../../commons/image/rsjdaqz.png" draggable="false"/></span>
  300. </div>
  301. </div>
  302. </td>
  303. </tr>
  304. </table>
  305. <input type="hidden" name="id" value="${syscomparisony.id}" />
  306. <input type="hidden" name="saveData" id="saveData" />
  307. <input type="hidden" name="executeType" value="start" />
  308. </form>
  309. </div>
  310. </div>
  311. </body>
  312. </html>