rock_kaoqin_sjfp.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php if(!defined('HOST'))die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. {params}
  5. var gzdata=[],lobdds=false,type=params.type;if(!type)type='0';
  6. var a = $('#view_{rand}').bootstable({
  7. tablename:'kqdist',celleditor:true,fanye:true,params:{'type':type},
  8. url:publicstore('{mode}','{dir}'),storeafteraction:'kqdistafter',storebeforeaction:'kqdistbefore',
  9. columns:[{
  10. text:'针对人员',dataIndex:'recename',sortable:true
  11. },{
  12. text:'对应规则',dataIndex:'mid',sortable:true
  13. },{
  14. text:'开始日期',dataIndex:'startdt',sortable:true
  15. },{
  16. text:'截止日期',dataIndex:'enddt',sortable:true
  17. },{
  18. text:'状态',dataIndex:'status',type:'checkbox',editor:true,sortable:true
  19. },{
  20. text:'排序号',dataIndex:'sort',editor:true,sortable:true
  21. },{
  22. text:'ID',dataIndex:'id'
  23. }],
  24. itemclick:function(){
  25. btn(false);
  26. },
  27. beforeload:function(){
  28. btn(true);
  29. },
  30. load:function(d){
  31. gzdata=d.gzdata;
  32. if(!lobdds){
  33. js.setselectdata(get('sekw_{rand}'),gzdata,'id');
  34. }
  35. lobdds=true;
  36. }
  37. });
  38. function btn(bo){
  39. get('del_{rand}').disabled = bo;
  40. get('edit_{rand}').disabled = bo;
  41. }
  42. var c = {
  43. del:function(){
  44. a.del({url:js.getajaxurl('kqsjgzdatadel','{mode}','{dir}',{type:1})});
  45. },
  46. clickwin:function(o1,lx){
  47. var h = $.bootsform({
  48. title:'分配',height:320,width:400,
  49. tablename:'kqdist',isedit:lx,submitfields:'recename,receid,mid,startdt,enddt,sort',
  50. params:{otherfields:'type='+type+''},
  51. items:[{
  52. labelText:'针对人员',name:'recename',required:true,type:'changeuser',changeuser:{
  53. type:'deptusercheck',idname:'receid',title:'选择人员'
  54. },clearbool:true
  55. },{
  56. name:'receid',type:'hidden'
  57. },{
  58. labelText:'开始日期',name:'startdt',type:'date',view:'date',required:true
  59. },{
  60. labelText:'截止日期',name:'enddt',type:'date',view:'date',required:true
  61. },{
  62. labelText:'对应规则',name:'mid',type:'select',valuefields:'id',displayfields:'name',store:gzdata,required:true
  63. },{
  64. labelText:'排序号',name:'sort',type:'number',value:'0'
  65. }],
  66. success:function(){
  67. a.reload();
  68. }
  69. });
  70. if(lx==1){
  71. var d = a.changedata;d.mid=d.mids;
  72. h.setValues(d);
  73. }
  74. },
  75. search:function(){
  76. var s=get('key_{rand}').value;
  77. var gzid=get('sekw_{rand}').value;
  78. a.setparams({key:s,gzid:gzid},true);
  79. }
  80. };
  81. js.initbtn(c);
  82. });
  83. </script>
  84. <div>
  85. <table width="100%"><tr>
  86. <td nowrap>
  87. <button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
  88. </td>
  89. <td style="padding-left:10px">
  90. <input class="form-control" style="width:200px" id="key_{rand}" placeholder="针对人员/部门">
  91. </td>
  92. <td style="padding-left:10px">
  93. <select class="form-control" style="width:150px" id="sekw_{rand}" ><option value="0">-对应规则-</option></select>
  94. </td>
  95. <td style="padding-left:10px">
  96. <button class="btn btn-default" click="search" type="button">搜索</button>
  97. </td>
  98. <td width="100%"></td>
  99. <td align="right" nowrap>
  100. <button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button> &nbsp;
  101. <button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
  102. </td>
  103. </tr></table>
  104. </div>
  105. <div class="blank10"></div>
  106. <div id="view_{rand}"></div>
  107. <div class="tishi">排序号:数字越小优先级别越高。</div>
粤ICP备19079148号