public function getPrintField($reportname = '') { if ($reportname == '') { return ''; } switch ($reportname) { case 'instocksbill': $field = "code,goodsName,spec,voltage1,current1,inqty"; $action = new StocksManagerAction(); $struct = $action->getStruct(); //如果字段不是全部的,则把必须的字段替换 if ($field != '*') { $field = explode(',', $field); $visible = array("_type_" => "INCLUDE", "data" => $field); $struct["visible"] = $visible; $struct["item"] = $field; $width = array("code" => 80, 'goodsName' => 170, 'spec' => 90, 'voltage1' => 50, 'current1' => 70); $struct["width"] = $width; } break; case 'outstocksbill': $field = "code,goodsName,spec,voltage1,current1,outqty"; $action = new StocksManagerAction(); $struct = $action->getStruct(); //如果字段不是全部的,则把必须的字段替换 if ($field != '*') { $field = explode(',', $field); $visible = array("_type_" => "INCLUDE", "data" => $field); $struct["visible"] = $visible; $struct["item"] = $field; $width = array("code" => 80, 'goodsName' => 170, 'spec' => 90, 'voltage1' => 50, 'current1' => 70); $struct["width"] = $width; } break; default: return ''; } return $struct; }
/** * 获取Datawindow结构 * */ public function getStruct($type = '') { try { $stocks = new StocksManagerAction(); $result = $stocks->getStruct(); if (!$result) { $result = $stocks->getError(); return $result; } switch ($type) { case 'instocks': $field = "station,code,factoryNo,goodsName,spec,inqty,voltage1,current1," . "direct,constant,grade,madeIn,madeDate,memo,place"; break; case 'outstocks': $field = "station,code,factoryNo,goodsName,spec,outqty,voltage1,current1," . "direct,constant,grade,madeIn,madeDate,memo,place,station"; break; case 'reject': $field = "station,code,factoryNo,goodsName,spec,outqty,voltage1,current1," . "direct,constant,grade,madeIn,madeDate,memo,place,station"; break; default: $field = '*'; } //如果字段不是全部的,则把必须的字段替换 if ($field != '*') { $field = explode(',', $field); $visible = array("_type_" => "INCLUDE", "data" => $field); $result["visible"] = $visible; $result["item"] = $field; } return $result; } catch (Executive $e) { system_out("StocksManager.getStruct Exception:{$e}"); throw new Exception($e); } }
public function queryLocationDetail($code = '') { $table = StocksIndexAction::getTableNameByCode($code); $volist = new VoList(); $dao = new StocksDao(); //开始查询 for ($i = 0; $i < sizeof($table); $i++) { $tablename = $table[$i]; $result = $dao->findAll("code='{$code}'", $tablename, '*', 'id'); $volist->addAll($result); } $field = "billType,billNo,billDate,goodsName,madeIn,code,factoryNo,spec,client,inqty,outqty,voltage1,current1," . "direct,constant,grade,madeDate,memo,place,station"; $action = new StocksManagerAction(); $struct = $action->getStruct(); //如果字段不是全部的,则把必须的字段替换 if ($field != '*') { $field = explode(',', $field); $visible = array("_type_" => "INCLUDE", "data" => $field); $struct["visible"] = $visible; $struct["item"] = $field; } //返回值 $rtn["struct"] = $struct; $rtn["data"] = $volist->toResultSet(); return $rtn; }