diaoboModel.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. //调拨单
  3. class flow_diaoboClassModel extends flowModel
  4. {
  5. public $minwidth = 600;//子表最小宽
  6. public $goodsobj,$cangobj;
  7. public function initModel()
  8. {
  9. $this->goodsobj = m('goods');
  10. $this->cangobj = m('godepot');
  11. }
  12. //审核完成处理,要通知仓库管理员出入库
  13. protected function flowcheckfinsh($zt){
  14. }
  15. //子表数据替换处理
  16. protected function flowsubdata($rows, $lx=0){
  17. $db = m('goods');
  18. foreach($rows as $k=>$rs){
  19. $one = $db->getone($rs['aid']);
  20. if($one){
  21. $name = $one['name'];
  22. if(!isempt($one['xinghao']))$name.='('.$one['xinghao'].')';
  23. if($lx==1)$rows[$k]['aid'] = $name; //1展示时
  24. $rows[$k]['temp_aid'] = $name;
  25. }
  26. }
  27. return $rows;
  28. }
  29. //$lx,0默认,1详情展示,2列表显示
  30. public function flowrsreplace($rs,$lx=0)
  31. {
  32. $rs['states']= $rs['state'];
  33. $rs['state'] = $this->goodsobj->crkstate($rs['state']);
  34. if(!isempt($rs['custname'])){
  35. $rs['custid'] = $rs['custname'];
  36. }else{
  37. $rs['custid']= $this->cangobj->getmou('depotname', $rs['custid']);
  38. }
  39. //读取物品
  40. if($lx==2){
  41. $rs['wupinlist'] = $this->goodsobj->getgoodninfo($rs['id'], 1);
  42. }
  43. return $rs;
  44. }
  45. }
粤ICP备19079148号