repair_faultModel.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. class flow_repair_faultClassModel extends flowModel
  3. {
  4. public $hstate, $hcolor;
  5. public function initModel()
  6. {
  7. $this->hstate = array('未处理', '已处理');
  8. $this->hcolor = array('#ff6600','green');
  9. }
  10. // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
  11. public function flowrsreplace($rs, $lx=0)
  12. {
  13. $zt = $rs['handle_state'];
  14. // 将id转换为文字
  15. $rs['handle_state'] = $this->getstatezt($zt);
  16. return $rs;
  17. }
  18. // $ors当前单据操作信息,$crs提交过来的信息
  19. public function flowoptmenu($ors, $crs)
  20. {
  21. // 切换会议议题
  22. if ($ors['num'] == 'noup') {
  23. $sm = $crs['sm']; // 提交过来的说明
  24. $uname = $this->uname;
  25. $uid = $this->uid;
  26. // 更新说明
  27. $this->update([
  28. "explain"=>$sm,
  29. "repairer"=>$uname,
  30. "repairer_id"=>$uid,
  31. ], $this->id);
  32. }
  33. }
  34. public function getstatezt($zt)
  35. {
  36. if (isset($this->hstate[$zt])) {
  37. $html = '<font color="'.$this->hcolor[$zt].'">'.$this->hstate[$zt].'</font>';
  38. return $html;
  39. } else {
  40. return null;
  41. }
  42. }
  43. }