123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/My97DatePicker/WdatePicker.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <!--[if IE 6]>
- <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
- <script>DD_belatedPNG.fix('*');</script>
- <![endif]-->
- <script type="text/javascript">
- $(function() {
- $(window).resize(function(){
- $("#tree").setGridWidth($(window).width()-40);
- });
- $("#tree").jqGrid({
- caption:'投诉费用管理',
- url : '${ctx}/myconsole/complaint/fund/getFundPage',
- editurl:"${ctx}/myconsole/complaint/fund/saveUpdateFund",
- mtype : "POST",
- datatype : "json",
- sidx : "opttime",
- sord : "desc",
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [{
- label : '编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 50,
- },{
- label : '年度',
- name : 'year',
- editable: true,
- width : 60,
- formoptions:{
- elmsuffix:"<span style='color:red'>年*<span>"
- }
- },{
- label : '总预算',
- name : 'summoney',
- width : 80,
- formoptions:{
- elmsuffix:"<span style='color:red'>元*<span>"
- },
- editable: true,
- edittype:"text",
- editrules:{required:true}
- },{
- label : '配置人员名称',
- name : 'username',
- width : 60,
- editable: false,
- edittype:"text"
- },{
- label : '配置时间',
- name : 'time',
- width : 60,
- editable: false,
- edittype:"text"
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- pager : "#pager",
- });
- jQuery('#tree').navGrid('#pager',
- {
- edit : true,
- add : true,
- del : true,
- search : false,
- refresh : false,
- view : false,
- position : "left",
- cloneToTop : true
- },
- //点击编辑触发的区域
- {
- closeAfterEdit : true,
- recreateForm : true,
- width:600,
- //在表单显示后触发此方法
- beforeShowForm:function(formid){
- var year = formid.find('#year');
- //设置输入框不可编辑和背景色
- year.attr('readOnly',true);
- year.css({'background':'#cccccc'});
-
- },
- //在提交数据到服务器前触发
- beforeSubmit: function(postdata, formid){
- //获取组件主键 ID
- var userid = postdata.tree_id;
- $.each(postdata,function (index, value) {
- if(index!="oper"){
- modifyJosnKey(postdata,index,"fund."+index);
- }
- })
- //重新为主键赋值
- postdata["fund.keyid"]=userid;
- return [true,'']; //返回值必须这么写 目前没找到原因,用true 和 返回对象都不好使。待查
- },
- //在提交数据到服务器后触发
- afterSubmit: function(response,postdata) //
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
- }else{
-
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
- }
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- //新建工作区
- closeAfterAdd : true, //添加完成后关闭
- width:600,
- serializeEditData: function(postdata) { //保存数据前,加工数据
- //获取组件主键 ID
- var userid = postdata.userid;
- $.each(postdata,function(index,value){
- if(index!="oper"){
- modifyJosnKey(postdata,index,"fund."+index);
- }
- })
- postdata["fund.keyid"] = userid;
- return postdata;
- },
- //在表单显示后触发此方法
- beforeShowForm:function(formid){
- //单击显示日期控件
- $("#year").click(function(){
- WdatePicker({dateFmt:'yyyy'});
- });
- },
- //在表单显示后触发,有一个参数为formid
- afterShowForm: function (formid){
-
- },
- //提交数据从服务器返回后触发
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
- }else{
-
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
- }
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- //删除工作区
- //提交数据从服务器返回后触发
- //在提交数据到服务器前触发
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
- }else{
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
- }
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
- /* jQuery('#tree').jqGrid('bindKeys'); */
- })
- //获取系统所有用户列表
- function getUserOptions() {
- //动态生成select内容
- var str="";
- $.ajax({
- type:"post",
- async:false,
- url:"${ctx}/myconsole/complaint/approve/getUserOptionsList",
- success:function(data){
- if (data != null) {
- var jsonobj=eval(data);
- var length=jsonobj.length;
- for(var i=0;i<length;i++){
- if(i!=length-1){
- //这里是拼装option里面的 value
- str+=jsonobj[i].username+":"+jsonobj[i].username+";";
- }else{
- str+=jsonobj[i].username+":"+jsonobj[i].username;
- }
- }
- }
- }
- });
- return str;
- }
- </script>
- <title>我的桌面</title>
- </head>
- <body>
- <div class="page-container">
- <table id="tree"></table>
- <div id="pager"></div>
- </div>
- <footer class="footer mt-20">
- <div class="container">
- <p></p>
- </div>
- </footer>
- </body>
- </html>
|