rock_fwork_bill.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php defined('HOST') or die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. {params}
  5. var atype=params.atype,zt=params.zt,mid=params.modeid;
  6. if(!zt)zt='';
  7. if(!mid)mid='0';
  8. var bools=false;
  9. var columns = [{
  10. text:'模块',dataIndex:'modename'
  11. },{
  12. text:'部门',dataIndex:'deptname'
  13. },{
  14. text:'申请人',dataIndex:'name'
  15. },{
  16. text:'单号',dataIndex:'sericnum'
  17. },{
  18. text:'申请日期',dataIndex:'applydt',sortable:true
  19. },{
  20. text:'摘要',dataIndex:'summary',align:'left',renderer:function(v){
  21. return '<div style="min-width:400px">'+v+'</div>';
  22. }
  23. },{
  24. text:'操作人',dataIndex:'optname',sortable:true
  25. }];
  26. if(companymode)columns.push({text:'所属单位※',dataIndex:'comidname'});
  27. columns.push({text:'状态',dataIndex:'status',sortable:true});
  28. columns.push({text:'',dataIndex:'caozuo',callback:'opegs{rand}'});
  29. var a = $('#view_{rand}').bootstable({
  30. tablename:'flow_bill',params:{'atype':atype,'zt':zt,'modeid':mid},fanye:true,
  31. url:publicstore('{mode}','{dir}'),checked:atype=='daib',
  32. storeafteraction:'flowbillafter',storebeforeaction:'flowbillbefore',
  33. columns:columns,
  34. celldblclick:function(){
  35. c.view();
  36. },
  37. load:function(a){
  38. if(!bools){
  39. var s = '<option value="0">-选择模块-</option>',len=a.flowarr.length,i,csd,types='';
  40. for(i=0;i<len;i++){
  41. csd = a.flowarr[i];
  42. if(types!=csd.type){
  43. if(types!='')s+='</optgroup>';
  44. s+='<optgroup label="'+csd.type+'">';
  45. }
  46. s+='<option value="'+csd.id+'">'+csd.name+'</option>';
  47. types = csd.type;
  48. }
  49. $('#mode_{rand}').html(s);
  50. if(mid>0)get('mode_{rand}').value=mid;
  51. }
  52. bools=true;
  53. },
  54. itemclick:function(){
  55. btn(false);
  56. },
  57. beforeload:function(){
  58. btn(true);
  59. }
  60. });
  61. function btn(bo){
  62. //get('xiang_{rand}').disabled = bo;
  63. }
  64. xing{rand}=function(oi){
  65. a.changedata = a.getData(oi);
  66. c.view();
  67. }
  68. var c = {
  69. reload:function(){
  70. a.reload();
  71. },
  72. view:function(){
  73. var d=a.changedata;
  74. openxiangs(d.modename,d.modenum,d.id,'opegs{rand}');
  75. },
  76. search:function(){
  77. a.setparams({
  78. key:get('key_{rand}').value,
  79. dt1:get('dt1_{rand}').value,
  80. dt2:get('dt2_{rand}').value,
  81. modeid:get('mode_{rand}').value
  82. },true);
  83. },
  84. clickdt:function(o1, lx){
  85. $(o1).rockdatepicker({initshow:true,view:'date',inputid:'dt'+lx+'_{rand}'});
  86. },
  87. daochu:function(){
  88. a.exceldown(nowtabs.name);
  89. },
  90. changlx:function(o1,lx){
  91. $("button[id^='state{rand}']").removeClass('active');
  92. $('#state{rand}_'+lx+'').addClass('active');
  93. a.setparams({zt:lx});
  94. this.search();
  95. },
  96. plliang:function(){
  97. if(this.plbool)return;
  98. var d = a.getcheckdata();
  99. if(d.length<=0){
  100. js.msg('msg','请先用复选框选中行');
  101. return;
  102. }
  103. this.checkd = d;
  104. js.prompt('批量处理同意','请输入批量处理同意说明(选填)',function(lxbd,msg){
  105. if(lxbd=='yes'){
  106. setTimeout(function(){c.plliangso(msg);},10);
  107. }
  108. });
  109. },
  110. plliangso:function(sm){
  111. this.plbool = true;
  112. this.plchusm = sm;
  113. this.cgshu = 0;
  114. this.sbshu = 0;
  115. js.wait('<span id="plchushumm"></span>');
  116. this.plliangsos(0);
  117. },
  118. plliangsos:function(oi){
  119. var len = this.checkd.length;
  120. $('#plchushumm').html('批量处理中('+len+'/'+(oi+1)+')...');
  121. if(oi>=len){
  122. $('#plchushumm').html('处理完成,成功<font color=green>'+this.cgshu+'</font>条,失败<font color=red>'+this.sbshu+'</font>条');
  123. this.reload();
  124. this.plbool=false;
  125. return;
  126. }
  127. var d = this.checkd[oi];
  128. var cns= {sm:this.plchusm,zt:1,modenum:d.modenum,mid:d.id};
  129. js.ajax(js.getajaxurl('check','flowopt','flow'),cns, function(ret){
  130. if(ret.success){
  131. c.cgshu++;
  132. }else{
  133. c.sbshu++;
  134. js.msg('msg','['+d.modename+']'+ret.msg+',不能使用批量来处理,请打开详情去处理。');
  135. }
  136. c.plliangsos(oi+1);
  137. },'post,json');
  138. }
  139. };
  140. js.initbtn(c);
  141. $('#mode_{rand}').change(function(){
  142. c.search();
  143. });
  144. opegs{rand}=function(){
  145. c.reload();
  146. }
  147. $('#key_{rand}').keyup(function(e){
  148. if(e.keyCode==13)c.search();
  149. });
  150. $('#state{rand}_'+zt+'').addClass('active');
  151. if(atype=='mywtg' || atype=='daiturn'){
  152. $('#stewwews{rand}').hide();
  153. }
  154. if(atype!='daib'){
  155. $('#tdleft_{rand}').hide();
  156. }else{
  157. $('#state{rand}_').html('全部待办');
  158. $('#state{rand}_0').remove();
  159. $('#state{rand}_1').remove();
  160. $('#state{rand}_2').remove();
  161. $('#state{rand}_5').remove();
  162. $('#state{rand}_6').remove();
  163. }
  164. if(atype!='my')$('#state{rand}_6').remove();
  165. });
  166. </script>
  167. <div>
  168. <table width="100%">
  169. <tr>
  170. <td style="padding-right:10px;" id="tdleft_{rand}" nowrap><button class="btn btn-primary" click="plliang,0" type="button">批量处理同意</button></td>
  171. <td nowrap>
  172. <select style="width:150px" id="mode_{rand}" class="form-control" ><option value="0">-选择模块-</option></select>
  173. </td>
  174. <td style="padding-left:10px">
  175. <input style="width:110px" onclick="js.changedate(this)" placeholder="申请日期" readonly class="form-control datesss" id="dt1_{rand}" >
  176. </td>
  177. <td nowrap>&nbsp;至&nbsp;</td>
  178. <td nowrap>
  179. <input style="width:110px" onclick="js.changedate(this)" readonly class="form-control datesss" id="dt2_{rand}" >
  180. </td>
  181. <td style="padding-left:10px">
  182. <input class="form-control" style="width:130px" id="key_{rand}" placeholder="单号/处理人/姓名/部门">
  183. </td>
  184. <td style="padding-left:10px">
  185. <button class="btn btn-default" click="search" type="button">搜索</button>
  186. </td>
  187. <td width="80%" style="padding-left:10px">
  188. <div id="stewwews{rand}" class="btn-group">
  189. <button class="btn btn-default" id="state{rand}_" click="changlx," type="button">全部状态</button>
  190. <button class="btn btn-default" id="state{rand}_0" click="changlx,0" type="button">待审核</button>
  191. <button class="btn btn-default" id="state{rand}_1" style="color:green" click="changlx,1" type="button">已审核</button>
  192. <button class="btn btn-default" id="state{rand}_2" style="color:red" click="changlx,2" type="button">未通过</button>
  193. <button class="btn btn-default" id="state{rand}_5" style="color:#888888" click="changlx,5" type="button">已作废</button>
  194. <button class="btn btn-default" id="state{rand}_6" style="color:#ff6600" click="changlx,6" type="button">待提交</button>
  195. </div>
  196. </td>
  197. <td align="right" nowrap>
  198. <button class="btn btn-default" click="daochu,1" type="button">导出</button>
  199. </td>
  200. </tr>
  201. </table>
  202. </div>
  203. <div class="blank10"></div>
  204. <div id="view_{rand}"></div>
粤ICP备19079148号