edit.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>TODO supply a title</title>
  5. {include file="../application/manage/view/commons/headers.html" }
  6. <script >
  7. var institutionsData=new Array();
  8. var topInsData=new Array();
  9. topInsData["id"]="";
  10. topInsData["text"]="顶级节点(非机构)";
  11. {if isset($insJson) }
  12. topInsData["children"]={$insJson};
  13. {/if}
  14. institutionsData.push(topInsData);
  15. $(function(){
  16. $('#institution_id').combotree({
  17. required:true,multiple:false,
  18. valueField:'id',textField:'name',panelWidth: 550,
  19. data:institutionsData
  20. });
  21. });
  22. // 保存信息
  23. function save(){
  24. var data=$("#myform").serialize();
  25. $.ajax({
  26. url:"/manage/examclass/save",
  27. data:data,type:"get",
  28. success:function(rs){
  29. if(rs.indexOf("insert_ok")>=0){
  30. alert('新增成功');
  31. document.location.href="edit?id="+rs.split(";")[1];
  32. }else if(rs=="update_ok"){
  33. alert('保存成功');
  34. }else{
  35. alert("保存失败!");
  36. }
  37. },error:function(e,e1,e2){
  38. alert(e2);
  39. }
  40. });
  41. }
  42. </script>
  43. </head>
  44. <body>
  45. <form id="myform" action="" method="get" >
  46. <input name="id" type="hidden" value="{if isset($exam_class) }{$exam_class.id}{/if}" />
  47. <table class="editform" width="99%" border="0" style="margin: 5px auto;" cellpadding="1" cellspacing="1" >
  48. <tr>
  49. <th width="105" height="38" align="right" >属性&nbsp;</th>
  50. <th colspan="3" >信息</th>
  51. </tr>
  52. <tr>
  53. <th height="32" align="right" >检查类别:</th>
  54. <td colspan="3" >
  55. <input name="name" type="text" class="easyui-textbox" size="35" value="{if isset($exam_class) }{$exam_class.name}{/if}" />
  56. </td>
  57. </tr>
  58. <tr>
  59. <th height="32" align="right" >所在机构:</th>
  60. <td colspan="3" >
  61. <input id="institution_id" name="institution_id" value="{if isset($exam_class) }{$exam_class.institution_id}{/if}" />
  62. </td>
  63. </tr>
  64. <tr>
  65. <th height="32" >&nbsp;</th>
  66. <td>
  67. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-save'" icon="icon-save" onclick="save()" >保存</a>
  68. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="window.parent.closeEditWin('reload');" >关闭</a>
  69. </td>
  70. </tr>
  71. <tr >
  72. <th height="32" >&nbsp;</th>
  73. <td colspan="3" >
  74. &nbsp;
  75. </td>
  76. </tr>
  77. </table>
  78. </form>
  79. </body>
  80. </html>