complaintfundlist.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <!--[if lt IE 9]>
  10. <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
  11. <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
  12. <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
  13. <![endif]-->
  14. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
  15. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
  16. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
  17. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
  18. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
  19. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
  20. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  21. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  22. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  23. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  24. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  25. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  26. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  27. <script type="text/javascript" src="${ctx}/assets/lib/My97DatePicker/WdatePicker.js"></script>
  28. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  29. <!--[if IE 6]>
  30. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  31. <script>DD_belatedPNG.fix('*');</script>
  32. <![endif]-->
  33. <script type="text/javascript">
  34. $(function() {
  35. $(window).resize(function(){
  36. $("#tree").setGridWidth($(window).width()-40); 
  37. });
  38. $("#tree").jqGrid({
  39. caption:'投诉费用管理',
  40. url : '${ctx}/myconsole/complaint/fund/getFundPage',
  41. editurl:"${ctx}/myconsole/complaint/fund/saveUpdateFund",
  42. mtype : "POST",
  43. datatype : "json",
  44. sidx : "opttime",
  45. sord : "desc",
  46. prmNames : {
  47. id: "keyid", 
  48. oper:"oper",    
  49. addoper:"add",
  50. editoper:"edit",
  51. deloper:"del" 
  52. },
  53. colModel : [{
  54. label : '编号',
  55. name : 'keyid',
  56. hidden : true,
  57. key : true,
  58. width : 50,
  59. },{
  60. label : '年度',
  61. name : 'year',
  62. editable: true,
  63. width : 60,
  64. formoptions:{
  65. elmsuffix:"<span style='color:red'>年*<span>"
  66. }
  67. },{
  68. label : '总预算',
  69. name : 'summoney',
  70. width : 80,
  71. formoptions:{
  72. elmsuffix:"<span style='color:red'>元*<span>"
  73. },
  74. editable: true,
  75. edittype:"text",
  76. editrules:{required:true}
  77. },{
  78. label : '配置人员名称',
  79. name : 'username',
  80. width : 60,
  81. editable: false,
  82. edittype:"text"
  83. },{
  84. label : '配置时间',
  85. name : 'time',
  86. width : 60,
  87. editable: false,
  88. edittype:"text"
  89. }],
  90. rownumbers : true,//添加左侧行号
  91. viewrecords : true,//是否在浏览导航栏显示记录总数
  92. rowNum : 10,//每页显示记录数
  93. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  94. autowidth : true,
  95. height : 'auto',
  96. pager : "#pager",
  97. });
  98. jQuery('#tree').navGrid('#pager',
  99. {
  100. edit : true,
  101. add : true,
  102. del : true,
  103. search : false,
  104. refresh : false,
  105. view : false,
  106. position : "left",
  107. cloneToTop : true
  108. },
  109. //点击编辑触发的区域
  110. {
  111. closeAfterEdit : true,
  112. recreateForm : true,
  113. width:600,
  114. //在表单显示后触发此方法
  115. beforeShowForm:function(formid){
  116. var year = formid.find('#year');
  117. //设置输入框不可编辑和背景色
  118. year.attr('readOnly',true);
  119. year.css({'background':'#cccccc'});
  120. },
  121. //在提交数据到服务器前触发
  122. beforeSubmit: function(postdata, formid){
  123. //获取组件主键 ID
  124. var userid = postdata.tree_id;
  125. $.each(postdata,function (index, value) {
  126. if(index!="oper"){
  127. modifyJosnKey(postdata,index,"fund."+index);
  128. }
  129. })
  130. //重新为主键赋值
  131. postdata["fund.keyid"]=userid;
  132. return [true,'']; //返回值必须这么写 目前没找到原因,用true 和 返回对象都不好使。待查
  133. },
  134. //在提交数据到服务器后触发
  135. afterSubmit: function(response,postdata) //
  136. {
  137. var res=eval('(' + response.responseText + ')');
  138. if(res.flag)
  139. {
  140. parent.layer.alert(res.message, {
  141. skin: 'layui-layer-molv' //样式类名
  142. ,closeBtn: 0
  143. });
  144. return [true,res.message,''];
  145. }else{
  146. parent.layer.alert(res.message, {
  147. skin: 'layui-layer-molv' //样式类名
  148. ,closeBtn: 0
  149. });
  150. return [false,res.message,''];
  151. }
  152. },
  153. errorTextFormat : function(data) {
  154. return 'Error: ' + data.responseText
  155. }
  156. },{
  157. //新建工作区
  158. closeAfterAdd : true, //添加完成后关闭
  159. width:600,
  160. serializeEditData: function(postdata) { //保存数据前,加工数据
  161. //获取组件主键 ID
  162. var userid = postdata.userid;
  163. $.each(postdata,function(index,value){
  164. if(index!="oper"){
  165. modifyJosnKey(postdata,index,"fund."+index);
  166. }
  167. })
  168. postdata["fund.keyid"] = userid;
  169. return postdata;
  170. },
  171. //在表单显示后触发此方法
  172. beforeShowForm:function(formid){
  173. //单击显示日期控件
  174. $("#year").click(function(){
  175. WdatePicker({dateFmt:'yyyy'});
  176.   });
  177. },
  178. //在表单显示后触发,有一个参数为formid
  179. afterShowForm: function (formid){
  180. },
  181. //提交数据从服务器返回后触发
  182. afterSubmit: function(response,postdata)
  183. {
  184. var res=eval('(' + response.responseText + ')');
  185. if(res.flag)
  186. {
  187. parent.layer.alert(res.message, {
  188. skin: 'layui-layer-molv' //样式类名
  189. ,closeBtn: 0
  190. });
  191. return [true,res.message,''];
  192. }else{
  193. parent.layer.alert(res.message, {
  194. skin: 'layui-layer-molv' //样式类名
  195. ,closeBtn: 0
  196. });
  197. return [false,res.message,''];
  198. }
  199. },
  200. errorTextFormat : function(data) {
  201. return 'Error: ' + data.responseText
  202. }
  203. },{
  204. //删除工作区
  205. //提交数据从服务器返回后触发
  206. //在提交数据到服务器前触发
  207. afterSubmit: function(response,postdata)
  208. {
  209. var res=eval('(' + response.responseText + ')');
  210. if(res.flag)
  211. {
  212. parent.layer.alert(res.message, {
  213. skin: 'layui-layer-molv' //样式类名
  214. ,closeBtn: 0
  215. });
  216. return [true,res.message,''];
  217. }else{
  218. parent.layer.alert(res.message, {
  219. skin: 'layui-layer-molv' //样式类名
  220. ,closeBtn: 0
  221. });
  222. return [false,res.message,''];
  223. }
  224. },
  225. errorTextFormat : function(data) {
  226. return 'Error: ' + data.responseText
  227. }
  228. },{
  229. // search options 这里支持多条件查询
  230. multipleSearch: true,
  231. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  232. afterSubmit: function(r, data) {
  233. var messageString = r.responseText;
  234. var mesObj = eval('(' + messageString + ')');
  235. return [mesObj.state, mesObj.message];
  236. }
  237. }
  238. );
  239. /* jQuery('#tree').jqGrid('bindKeys'); */
  240. })
  241. //获取系统所有用户列表
  242. function getUserOptions() {
  243. //动态生成select内容
  244. var str="";
  245. $.ajax({
  246. type:"post",
  247. async:false,
  248. url:"${ctx}/myconsole/complaint/approve/getUserOptionsList",
  249. success:function(data){
  250. if (data != null) {
  251. var jsonobj=eval(data);
  252. var length=jsonobj.length;
  253. for(var i=0;i<length;i++){
  254. if(i!=length-1){
  255. //这里是拼装option里面的 value
  256. str+=jsonobj[i].username+":"+jsonobj[i].username+";";
  257. }else{
  258. str+=jsonobj[i].username+":"+jsonobj[i].username;
  259. }
  260. }
  261. }
  262. }
  263. });
  264. return str;
  265. }
  266. </script>
  267. <title>我的桌面</title>
  268. </head>
  269. <body>
  270. <div class="page-container">
  271. <table id="tree"></table>
  272. <div id="pager"></div>
  273. </div>
  274. <footer class="footer mt-20">
  275. <div class="container">
  276. <p></p>
  277. </div>
  278. </footer>
  279. </body>
  280. </html>