edit.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 constantsData=new Array();
  8. var topInsData=new Array();
  9. topInsData["id"]="";
  10. topInsData["text"]="顶级节点";
  11. {if isset($insJson) }
  12. topInsData["children"]={$insJson};
  13. {/if}
  14. constantsData.push(topInsData);
  15. $(function(){
  16. $('#parent_id').combotree({
  17. required:true,multiple:false,
  18. valueField:'id',textField:'name',
  19. data:constantsData
  20. });
  21. });
  22. // 保存信息
  23. function save(){
  24. var data=$("#myform").serialize();
  25. $.ajax({
  26. url:"/manage/constant/save",
  27. data:data,type:"get",
  28. success:function(rs){
  29. if(rs.indexOf("insert_ok")>=0){
  30. document.location.href="edit?id="+rs.split(";")[1];
  31. }else if(rs=="update_ok"){
  32. document.location.reload();
  33. }else{
  34. alert("保存失败!");
  35. }
  36. },error:function(e,e1,e2){
  37. alert(e2);
  38. }
  39. });
  40. }
  41. </script>
  42. </head>
  43. <body>
  44. <form id="myform" action="" method="get" >
  45. <input name="id" type="hidden" value="{if isset($constant) }{$constant.id}{/if}" />
  46. <table class="editform" width="99%" border="0" style="margin: 5px auto;" cellpadding="1" cellspacing="1" >
  47. <tr>
  48. <th width="105" height="38" align="right" >属性&nbsp;</th>
  49. <th>信息</th>
  50. </tr>
  51. <tr>
  52. <th height="32" align="right" >名称:</th>
  53. <td>
  54. <input name="name" type="text" size="55" class="easyui-textbox" value="{if isset($constant) }{$constant.name}{/if}" />
  55. </td>
  56. </tr>
  57. <tr>
  58. <th height="32" align="right" >上级机构:</th>
  59. <td>
  60. <input name="parent_id" id="parent_id" type="text" size="55" value="{if isset($constant) }{$constant.parent_id}{/if}" />
  61. </td>
  62. </tr>
  63. <tr>
  64. <th height="32" align="right" >Key:</th>
  65. <td>
  66. <input name="constant_key" id="constant_key" class="easyui-textbox" type="text" size="55" value="{if isset($constant) }{$constant.constant_key}{/if}" />
  67. </td>
  68. </tr>
  69. <tr>
  70. <th height="32" align="right" >Value:</th>
  71. <td>
  72. <input name="constant_value" id="sid" type="text" class="easyui-textbox" size="55" value="{if isset($constant) }{$constant.constant_value}{/if}" />
  73. </td>
  74. </tr>
  75. <tr>
  76. <th height="32" align="right" >排序号:</th>
  77. <td>
  78. <input name="ordernum" id="sid" type="text" class="easyui-textbox" size="25" value="{if isset($constant) }{$constant.ordernum}{/if}" />
  79. </td>
  80. </tr>
  81. <tr>
  82. <th height="32" align="right" >备注:</th>
  83. <td>
  84. <textarea name="remark" cols="55" rows="3" class="easyui-textbox" data-options="multiline:true" style="height:60px;" >{if isset($constant) }{$constant.remark}{/if}</textarea>
  85. </td>
  86. </tr>
  87. <tr>
  88. <th height="32" align="right" >是否为父节点:</th>
  89. <td>
  90. <input type="radio" name="sign" id="sign1" value="1" {if isset($constant) && $constant.sign==1 }checked{/if} /><label for="sign1" >是父节点</label>
  91. <input type="radio" name="sign" id="sign0" value="0" {if isset($constant) && $constant.sign!=1 }checked{/if} /><label for="sign0" >非父节点</label>
  92. </td>
  93. </tr>
  94. <tr>
  95. <th height="50" >&nbsp;</th>
  96. <td>
  97. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-save'" icon="icon-save" onclick="save()" >保存</a>
  98. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="window.parent.closeEditWin('reload');" >关闭</a>
  99. {if isset($constant) && $constant['id'] != null }
  100. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="deleteData('${keywords.id}');" >删除</a>
  101. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="document.location='/manage/constant/edit'" >添加</a>
  102. <script >
  103. function deleteData(id){
  104. if(confirm('你真的要删除这条信息吗?')){
  105. $.ajax({
  106. url:"delete.page",data:"id="+id+"&t="+new Date(),
  107. success:function(rs){
  108. if(rs=="delete_ok"){
  109. alert("删除操作成功!");
  110. window.parent.closeEditWin("reload");
  111. }else{
  112. alert("删除操作失败!");
  113. }
  114. }
  115. });
  116. }
  117. }
  118. </script>
  119. {/if}
  120. </td>
  121. </tr>
  122. <tr >
  123. <th height="32" >&nbsp;</th>
  124. <td>
  125. &nbsp;
  126. </td>
  127. </tr>
  128. </table>
  129. </form>
  130. </body>
  131. </html>