flowoptAction.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. class flowoptClassAction extends Action
  3. {
  4. public function addlogAjax()
  5. {
  6. $sm = $this->post('sm');
  7. $mid = (int)$this->post('mid');
  8. $modenum= $this->post('modenum');
  9. $name = $this->post('name');
  10. $zt = $this->post('zt');
  11. $ztid = $this->post('ztid','1');
  12. $ztcolor= $this->post('ztcolor');
  13. m('flow')->addlog($modenum, $mid,$name,array(
  14. 'explain' => $sm,
  15. 'statusname' => $zt,
  16. 'status' => $ztid,
  17. 'color' => $ztcolor
  18. ));
  19. $this->showreturn('ok');
  20. }
  21. public function delflowAjax()
  22. {
  23. $mid = (int)$this->post('mid');
  24. $modenum= $this->post('modenum');
  25. $sm = $this->post('sm');
  26. $msg = m('flow')->opt('deletebill', $modenum, $mid, $sm);
  27. if($msg != 'ok')$this->showreturn('', $msg, 201);
  28. $this->showreturn('ok');
  29. }
  30. //审核
  31. public function checkAjax()
  32. {
  33. $mid = (int)$this->post('mid');
  34. $zt = (int)$this->post('zt');
  35. $modenum= $this->post('modenum');
  36. $sm = $this->post('sm');
  37. $msg = m('flow')->opt('check', $modenum, $mid, $zt, $sm);
  38. if($msg=='ok'){
  39. return returnsuccess('处理成功');
  40. }else{
  41. return returnerror($msg);
  42. }
  43. }
  44. //单据获取操作菜单
  45. public function getoptnumAjax()
  46. {
  47. $mid = (int)$this->post('mid');
  48. $num = $this->post('num');
  49. $arr = m('flow')->getoptmenu($num, $mid, 0);
  50. $this->showreturn($arr);
  51. }
  52. public function yyoptmenuAjax()
  53. {
  54. $num = $this->post('modenum');
  55. $sm = $this->post('sm');
  56. $optid = (int)$this->post('optmenuid');
  57. $zt = (int)$this->post('statusvalue');
  58. $mid = (int)$this->post('mid');
  59. $msg = m('flow')->optmenu($num, $mid, $optid, $zt, $sm);
  60. if($msg != 'ok')$this->showreturn('', $msg, 201);
  61. $this->showreturn('');
  62. }
  63. public function chehuiAjax()
  64. {
  65. $mid = (int)$this->post('mid');
  66. $modenum= $this->post('modenum');
  67. $sm = $this->post('sm');
  68. $msg = m('flow')->opt('chehui', $modenum, $mid, $sm);
  69. if($msg != 'ok')$this->showreturn('', $msg, 201);
  70. $this->showreturn('');
  71. }
  72. /**
  73. * 模块统计
  74. */
  75. public function flowtotalAjax()
  76. {
  77. $modenum= $this->post('modenum');
  78. $rows = m('flow')->initflow($modenum)->flowtotal();
  79. $barr['rows'] = $rows;
  80. echo json_encode($barr);
  81. }
  82. /**
  83. * 将异常单据标识已完成
  84. */
  85. public function oksuccessAjax()
  86. {
  87. $mid = (int)$this->post('mid');
  88. $modenum= $this->post('modenum');
  89. $sm = $this->post('sm');
  90. $lx = $this->post('lx','1');
  91. $flow = m('flow')->initflow($modenum, $mid);
  92. $msg = $flow->checkerror($lx, $sm);
  93. return $msg;
  94. }
  95. /**
  96. * 引用签名图片
  97. */
  98. public function qianyinAjax()
  99. {
  100. $path = $this->option->getval('qmimgstr_'.$this->adminid.'');
  101. if(isempt($path))return returnerror('你并没有设置签名图片,可到[个人设置]下添加签名图片');
  102. if(!file_exists($path)){
  103. return returnerror('签名图片不存在了,可到[个人设置]下重新设置签名图片');
  104. }
  105. return returnsuccess($path);
  106. }
  107. /**
  108. * 回执确认
  109. */
  110. public function receiptcheckAjax()
  111. {
  112. $mid = (int)$this->post('mid');
  113. $modenum = $this->post('modenum');
  114. $sm = $this->post('sm');
  115. $receiptid = (int)$this->post('receiptid','0');
  116. $flow = m('flow')->initflow($modenum, $mid);
  117. return $flow->receiptcheck($receiptid, $sm);
  118. }
  119. /**
  120. * 读取字段
  121. */
  122. public function getfieldsAjax()
  123. {
  124. $modenum = $this->get('modenum');
  125. $flow = m('flow')->initflow($modenum);
  126. $farr = array();
  127. foreach($flow->fieldsarra as $k=>$rs){
  128. $farr[] = array(
  129. 'fields' => $rs['fields'],
  130. 'name' => $rs['name'],
  131. 'islb' => $rs['islb'],
  132. );
  133. }
  134. return array(
  135. 'fieldsarr' => $farr,
  136. 'isflow' => $flow->isflow,
  137. 'modenames' => $flow->moders['names'],
  138. );
  139. }
  140. /**
  141. * 提交评论
  142. */
  143. public function pinglunAjax()
  144. {
  145. $sm = $this->post('sm');
  146. $mid = (int)$this->post('mid');
  147. $modenum= $this->post('modenum');
  148. $flow = m('flow')->initflow($modenum, $mid);
  149. $flow->optmenu(-15,0, $sm);
  150. $this->showreturn('ok');
  151. }
  152. public function savetopdfAjax()
  153. {
  154. $imgbase64 = $this->post('imgbase64');
  155. if(isempt($imgbase64))return returnerror('无数据');
  156. $path = ''.UPDIR.'/logs/'.date('Y-m').'/abc.png';
  157. $bo = $this->rock->createtxt($path, base64_decode($imgbase64));
  158. if(!$bo)return returnerror(''.UPDIR.'目录无写入权限');
  159. $pa1 = ''.ROOT_PATH.'/include/fpdf/fpdf.php';
  160. if(!file_exists($pa1))return returnerror('没有安装fpdf插件');
  161. include_once($pa1);
  162. $fpdf = new FPDF();
  163. $fpdf->AddPage();
  164. $fpdf->Image($path,0,0);
  165. $fpdf->Output('F',''.UPDIR.'/logs/'.date('Y-m').'/to.pdf');
  166. $this->showreturn('ok:'.$fpdf->GetPageHeight().'');
  167. }
  168. /**
  169. * 获取修改记录
  170. */
  171. public function editcontAjax()
  172. {
  173. $mid = (int)$this->get('mid');
  174. $modenum= $this->get('modenum');
  175. $optdt = (int)$this->get('optdt');
  176. $uid = (int)$this->get('uid');
  177. $db = m('edit');
  178. $optdt1 = date('Y-m-d H:i:s', $optdt);
  179. $table = m('mode')->getmou('`table`',"`num`='$modenum'");
  180. $rows = $db->getall("`table`='$table' and `mid`=$mid and `optid`=$uid and `optdt`='$optdt1'",'*','`id` asc');
  181. if(!$rows)return '无修改记录';
  182. return c('html')->createrows($rows,'fieldsname,字段,left@oldval,原来值,left@newval,新值,left','#888888');
  183. }
  184. }
粤ICP备19079148号