rock_flow_cname.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?php if(!defined('HOST'))die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. var mid;
  5. var at = $('#optionview_{rand}').bootstable({
  6. tablename:'flow_cname',defaultorder:'`sort`',where:'and `pid`=0',celleditor:true,
  7. modedir:'{mode}:{dir}',
  8. columns:[{
  9. text:'名称',dataIndex:'name'
  10. },{
  11. text:'编号',dataIndex:'num'
  12. },{
  13. text:'审核人',dataIndex:'checkname'
  14. },{
  15. text:'排序号',dataIndex:'sort'
  16. },{
  17. text:'ID',dataIndex:'id'
  18. }],
  19. itemdblclick:function(ad,oi,e){
  20. $('#downshow_{rand}').html('审核人员组<b>['+ad.num+'.'+ad.name+']</b>下的规则');
  21. mid=ad.id;
  22. a.search("and `pid`="+ad.id+"");
  23. get('add_{rand}').disabled=false;
  24. },
  25. itemclick:function(d){
  26. btns(false);
  27. },
  28. beforeload:function(){
  29. btns(true);
  30. }
  31. });
  32. function btn(bo){
  33. get('edit_{rand}').disabled = bo;
  34. get('del_{rand}').disabled = bo;
  35. }
  36. function btns(bo){
  37. get('edits_{rand}').disabled = bo;
  38. get('dels_{rand}').disabled = bo;
  39. }
  40. var a = $('#view_{rand}').bootstable({
  41. tablename:'flow_cname',celleditor:true,defaultorder:'`sort`',
  42. autoLoad:false,where:'and `pid`=-1',modedir:'{mode}:{dir}',
  43. columns:[{
  44. text:'适用对象',dataIndex:'recename'
  45. },{
  46. text:'编号',dataIndex:'num'
  47. },{
  48. text:'审核人',dataIndex:'checkname'
  49. },{
  50. text:'排序号',dataIndex:'sort',editor:true
  51. },{
  52. text:'ID',dataIndex:'id'
  53. }],
  54. load:function(d){
  55. },
  56. itemclick:function(d){
  57. btn(false);
  58. },
  59. beforeload:function(){
  60. btn(true);
  61. }
  62. });
  63. var c = {
  64. reload:function(){
  65. a.reload();
  66. },
  67. del:function(){
  68. a.del();
  69. },
  70. dels:function(){
  71. at.del();
  72. },
  73. clickwin:function(o1,lx){
  74. var h = $.bootsform({
  75. title:'审核人员组下规则',height:400,width:400,
  76. tablename:'flow_cname',isedit:lx,beforesaveaction:'savebeforecname',
  77. params:{int_filestype:'sort,pid'},url:publicsave('{mode}','{dir}'),
  78. submitfields:'sort,num,checkid,checkname,recename,receid,pid',
  79. items:[{
  80. labelText:'编号',name:'num',required:true
  81. },{
  82. labelText:'适用对象',type:'changeuser',changeuser:{
  83. type:'deptusercheck',idname:'receid',title:'选择适用对象'
  84. },name:'recename',clearbool:true,required:true
  85. },{
  86. labelText:'审核人',type:'changeuser',changeuser:{
  87. type:'usercheck',idname:'checkid',title:'选择审核人'
  88. },name:'checkname',clearbool:true,required:true
  89. },{
  90. name:'receid',type:'hidden',value:'0'
  91. },{
  92. name:'checkid',type:'hidden',value:'0'
  93. },{
  94. name:'pid',value:'0'
  95. },{
  96. labelText:'序号',name:'sort',type:'number',value:'0'
  97. }],
  98. success:function(){
  99. a.reload();
  100. }
  101. });
  102. if(lx==1){
  103. h.setValues(a.changedata);
  104. }
  105. h.getField('pid').value = mid;
  106. },
  107. clickwins:function(o1, lx){
  108. var h = $.bootsform({
  109. title:'审核人员组',height:400,width:400,beforesaveaction:'savebeforecname',
  110. tablename:'flow_cname',isedit:lx,url:publicsave('{mode}','{dir}'),
  111. params:{int_filestype:'sort'},
  112. submitfields:'name,sort,num,checkid,checkname',
  113. items:[{
  114. labelText:'名称',name:'name',required:true
  115. },{
  116. labelText:'编号',name:'num',required:true
  117. },{
  118. labelText:'审核人',type:'changeuser',changeuser:{
  119. type:'usercheck',idname:'checkid',title:'选择审核人'
  120. },name:'checkname',clearbool:true,required:true
  121. },{
  122. name:'checkid',type:'hidden',value:'0'
  123. },{
  124. labelText:'序号',name:'sort',type:'number',value:'0'
  125. }],
  126. success:function(){
  127. at.reload();
  128. }
  129. });
  130. if(lx==1){
  131. h.setValues(at.changedata);
  132. }
  133. h.getField('name').focus();
  134. }
  135. };
  136. js.initbtn(c);
  137. $('#optionview_{rand}').css('height',''+(viewheight-62-50)+'px');
  138. });
  139. </script>
  140. <table width="100%">
  141. <tr valign="top">
  142. <td width="45%">
  143. <table width="100%">
  144. <tr>
  145. <td align="left" nowrap>
  146. <button class="btn btn-warning" click="clickwins,0" type="button"><i class="icon-plus"></i> 新增组</button>
  147. </td>
  148. <td align="left" style="padding:0px 10px;">
  149. </td>
  150. <td width="90%">
  151. </td>
  152. <td align="right" nowrap>
  153. <button class="btn btn-info" id="edits_{rand}" click="clickwins,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>&nbsp;
  154. <button class="btn btn-danger" click="dels" disabled id="dels_{rand}" type="button"><i class="icon-trash"></i> 删除</button>
  155. </td>
  156. </tr>
  157. </table>
  158. <div class="blank10"></div>
  159. <div class="panel panel-info" style="margin:0px">
  160. <div class="panel-heading">
  161. <h3 class="panel-title">审核人员组(双击显示对应设置)</h3>
  162. </div>
  163. <div id="optionview_{rand}" style="height:400px;overflow:auto"></div>
  164. </div>
  165. </td>
  166. <td width="10"></td>
  167. <td>
  168. <div>
  169. <ul class="floats">
  170. <li class="floats70">
  171. <button class="btn btn-primary" click="clickwin,0" disabled id="add_{rand}" type="button"><i class="icon-plus"></i> 新增组下规则</button>&nbsp;&nbsp;
  172. <span id="downshow_{rand}"></span>
  173. </li>
  174. <li class="floats30" style="text-align:right">
  175. <button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button> &nbsp;
  176. <button class="btn btn-danger" id="del_{rand}" disabled click="del" type="button"><i class="icon-trash"></i> 删除</button>
  177. </li>
  178. </ul>
  179. </div>
  180. <div class="blank10"></div>
  181. <div id="view_{rand}"></div>
  182. </td>
  183. </tr>
  184. </table>
粤ICP备19079148号