Пример #1
0
 public function view_waitWeighingList()
 {
     $pagesize = 100;
     //页面大小
     $statusar = array(PKS_WWEIGHING, PKS_WWEIGHING_EX, PKS_INLANDWWEIGHING);
     $statusstr = implode(',', $statusar);
     $packing_obj = new PackingOrderModel();
     $count = $packing_obj->getRecordsNumByStatus($statusar);
     //获得当前状态为待包装的发货单总数量
     $pager = new Page($count, $pagesize);
     //分页对象
     $billlist = $packing_obj->getBillList(' and orderStatus in (' . $statusstr . ') order by po.id ' . $pager->limit);
     $this->smarty->assign('billlist', $billlist);
     $ShipingTypeList = CommonModel::getShipingTypeListKeyId();
     $count = count($billlist);
     for ($i = 0; $i < $count; $i++) {
         $billlist[$i]['shipingname'] = isset($ShipingTypeList[$billlist[$i]['transportId']]) ? $ShipingTypeList[$billlist[$i]['transportId']] : '';
     }
     $acc_id_arr = array();
     foreach ($billlist as $key => $valbil) {
         if (!in_array($valbil['accountId'], $acc_id_arr)) {
             array_push($acc_id_arr, $valbil['accountId']);
         }
     }
     $salesaccountinfo = CommonModel::getAccountInfo($acc_id_arr);
     $this->smarty->assign('salesaccountinfo', $salesaccountinfo);
     if ($count > $pagesize) {
         //分页链接
         $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pager->fpage(array(0, 2, 3));
     }
     $this->smarty->assign('pagestr', $pagestr);
     $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '待包装称重'));
     $this->smarty->assign('navlist', $navlist);
     $toptitle = '待包装称重';
     //顶部链接
     $this->smarty->assign('toptitle', $toptitle);
     $toplevel = 2;
     //顶层菜单
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = '26';
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('secnev', 3);
     //二级导航
     $this->smarty->display('waitweighinglist.htm');
 }
Пример #2
0
 public function view_showForm()
 {
     global $memc_obj;
     $pagesize = 200;
     //页面大小
     $whereSql = $this->buildWhereSql();
     //echo $whereSql;exit;
     $packorder_obj = new PackingOrderModel();
     $rownumber = $packorder_obj->getRowAllNumber($whereSql . ' group by po.id ');
     //获得所有的行数
     $pager = new Page($rownumber, $pagesize);
     $billlist = $packorder_obj->getBillList($whereSql . ' group by po.id order by pd.pName ' . $pager->limit);
     //更具条件获得发货单
     $packorder_obj->buildOrderinfo($billlist);
     /*
             //去除重复的
             $currentid = NULL;
             $prekey = 0;
             foreach ($billlist as $key=>$valbill){
                 if ($currentid == $valbill['id']) {
                 	$billlist[$prekey]['originOrderId'] .= ', '.$valbill['originOrderId'];
                 	unset($billlist[$key]);
                 }else {
                     $prekey = $key;
                     $currentid = $valbill['id'];
                 }
             }
     */
     $materInfo = CommonModel::getMaterInfoAll();
     //获取包材信息
     $materInfo = reverse_array($materInfo, 'pmName', 'id');
     $shipingtyplist = CommonModel::getShipingTypeList();
     //运输方式列表
     $shipingtyplist = reverse_array($shipingtyplist, 'carrierNameCn', 'id');
     $salesaccountlist = CommonModel::getSalesaccountList();
     //获取销售帐号
     $salesaccountlist = reverse_array($salesaccountlist, 'account', 'id');
     //print_r($salesaccountlist);exit;
     $platformList = CommonModel::getPlatformInfo();
     //获取平台帐号
     $platformList = reverse_array($platformList, 'platform', 'id');
     $this->smarty->assign('shipingtypelist', $shipingtyplist);
     $this->smarty->assign('salesaccountlist', $salesaccountlist);
     $this->smarty->assign('platformList', $platformList);
     foreach ($billlist as $key => $valbil) {
         $tracknumber = '';
         $str_info = OmAvailableModel::getTNameList("wh_order_tracknumber", "tracknumber", "where shipOrderId='{$valbil['id']}' and is_delete=0");
         if (!empty($str_info)) {
             $tracknumber = $str_info[0]['tracknumber'];
         }
         $billlist[$key]['tracknumber'] = $tracknumber;
         $originOrder_arr = array();
         $originOrder_str = '';
         $originOrder_info = OmAvailableModel::getTNameList("wh_shipping_order_relation", "originOrderId", "where shipOrderId='{$valbil['id']}'");
         if (!empty($originOrder_info)) {
             foreach ($originOrder_info as $originOrder) {
                 $originOrder_arr[] = $originOrder['originOrderId'];
             }
             $originOrder_str = implode(',', $originOrder_arr);
         }
         $billlist[$key]['originOrder'] = $originOrder_str;
         //运输方式
         $billlist[$key]['shipingname'] = $shipingtyplist[$valbil['transportId']];
         //包材
         $billlist[$key]['materName'] = $materInfo[$valbil['pmId']];
         //平台
         $billlist[$key]['platformName'] = $platformList[$valbil['platformId']];
         //销售账号
         $billlist[$key]['salesaccountinfo'] = $salesaccountlist[$valbil['accountId']];
     }
     if ($rownumber > $pagesize) {
         //分页
         $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pager->fpage(array(0, 2, 3));
     }
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign('billlist', $billlist);
     //发货单列表
     $this->smarty->assign('secnev', 3);
     $libstu_obj = new LibraryStatusModel();
     //出库状态类型
     $libstatuslist = $libstu_obj->getAllLibStatusList(' and groupId in (4 ,5)');
     $this->smarty->assign('outstatuslist', $libstatuslist);
     $toptitle = '订单查询';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $storeId = isset($_GET['storeId']) ? intval($_GET['storeId']) : 0;
     if ($storeId == 1) {
         $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询'), array('url' => '', 'title' => 'A仓发货单'));
     } elseif ($storeId == 2) {
         $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询'), array('url' => '', 'title' => 'B仓发货单'));
     } else {
         $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询'));
     }
     $this->smarty->assign('navlist', $navlist);
     $toplevel = 2;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = isset($_GET['secondlevel']) ? trim($_GET['secondlevel']) : '';
     if (empty($secondlevel)) {
         $secondlevel = '21';
         //当前的二级菜单
     }
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('platLists', $_SESSION['platformList']);
     $this->smarty->assign('accounts', $_SESSION['accountList']);
     $this->smarty->assign('shippingList', $_SESSION['shippingList']);
     $this->smarty->display('dispatchbillquery.htm');
 }
Пример #3
0
 public function act_addBatchPrintLists()
 {
     $appnum = intval(trim($_POST['appnum']));
     $num = $appnum > 0 ? $appnum : 2000;
     $storeId = isset($_POST['storeId']) ? trim($_POST['storeId']) : 1;
     $where = " and po.orderStatus=400 and po.storeId={$storeId}";
     //订单状态
     $ordertimestart = isset($_POST['ordertimestart']) ? trim($_POST['ordertimestart']) : '';
     //下单日期 开始
     if ($ordertimestart != 0) {
         //开始时间
         $ordertimestart_int = strtotime($ordertimestart);
         $where .= " and po.createdTime >= {$ordertimestart_int}";
     }
     $ordertimeend = isset($_POST['ordertimeend']) ? trim($_POST['ordertimeend']) : '';
     //下单日期 结束
     if ($ordertimeend != 0) {
         //结束时间
         $ordertimeend_int = strtotime($ordertimeend);
         //$ordertimeend_int += 86400;
         $where .= " and po.createdTime < {$ordertimeend_int}";
     }
     $goodsouttimestart = isset($_POST['goodsouttimestart']) ? trim($_POST['goodsouttimestart']) : '';
     //出库日期 开始
     if ($goodsouttimestart != 0) {
         //出库开始时间
         $goodsouttimestart_int = strtotime($goodsouttimestart);
         $where .= " and po.weighTime >= {$goodsouttimestart}";
     }
     $goodsouttimeend = isset($_POST['goodsouttimeend']) ? trim($_POST['goodsouttimeend']) : '';
     //出库日期 结束
     if ($goodsouttimeend != 0) {
         //出库结束时间
         $goodsouttimeend_int = strtotime($goodsouttimeend);
         $goodsouttimeend += 86400;
         $where .= " and po.weighTime < {$goodsouttimeend}";
     }
     $isNote = intval($_POST['isNote']);
     switch ($isNote) {
         case 1:
             //有留言
             $where .= ' and po.isNote=1';
             break;
         case 2:
             //没留言
             $where .= ' and po.isNote=0';
             break;
     }
     $orderTypeId = intval($_POST['orderTypeId']);
     switch ($orderTypeId) {
         case 1:
             //发货单
             $where .= ' and po.orderTypeId=1';
             break;
         case 2:
             //配货单
             $where .= ' and po.orderTypeId=2';
             break;
     }
     $shiptype = trim($_POST['shiptype']);
     //运输方式
     if ($shiptype != 0) {
         //运输方式
         if ($shiptype == 200) {
             $nshiptype = "1,2,3";
         } else {
             if ($shiptype == 200) {
                 $nshiptype = "6,10,52,53";
             } else {
                 $nshiptype = $shiptype;
             }
         }
         $where .= " and po.transportId in({$nshiptype})";
     } else {
         if (empty($_SESSION['shippingList'])) {
             $where = " and po.transportId =''";
         } else {
             $nshiptype = implode(',', $_SESSION['shippingList']);
             $where .= " and po.transportId in({$nshiptype})";
         }
     }
     $client_name = trim($_POST['clientname']);
     if ($client_name != '') {
         //按客户id搜索
         $where .= " and po.platformUsername='******'";
     }
     $salesaccount = trim($_POST['acc']);
     if ($salesaccount != '') {
         $where .= " and po.accountId='{$salesaccount}'";
     } else {
         if (empty($_SESSION['accountList'])) {
             $where = " and po.accountId =''";
         } else {
             $accountInfo = implode(',', $_SESSION['accountList']);
             $where .= " and po.accountId in({$accountInfo})";
         }
     }
     $hunhe = intval($_POST['hunhe']);
     switch ($hunhe) {
         case 2:
             //单料号
             $where .= ' and po.orderAttributes=' . SOA_SINGLE;
             break;
         case 1:
             //多料号
             $where .= ' and po.orderAttributes=' . SOA_MULTIY;
             break;
         case 3:
             //组合订单
             $where .= ' and po.orderAttributes=' . SOA_COMBIN;
             break;
     }
     $platformName = trim($_POST['platformName']);
     if ($platformName != '') {
         //平台
         $where .= " and po.platformId= {$platformName}";
     } else {
         if (empty($_SESSION['platformList'])) {
             $where .= " and po.platformId =''";
         } else {
             $platformInfo = implode(',', $_SESSION['platformList']);
             $where .= " and po.platformId in({$platformInfo})";
         }
     }
     //print_r($where);exit;
     $packorder_obj = new PackingOrderModel();
     $billlist = $packorder_obj->getBillList($where . ' group by po.id order by pd.pName limit ' . $num);
     if (empty($billlist)) {
         self::$errCode = 0;
         self::$errMsg = '没有符合条件的订单!';
         return;
     }
     $orderids = '';
     $orderidArr = array();
     foreach ($billlist as $list) {
         $orderidArr[] = $list['id'];
     }
     $orderids = implode(',', $orderidArr);
     $pm_obj = new printModel();
     if ($pm_obj->insertPrintGroup($orderids, $storeId)) {
         self::$errCode = 200;
         self::$errMsg = '申请打印成功!';
         return true;
     } else {
         self::$errCode = 0;
         self::$errMsg = '申请打印失败!';
         return false;
     }
 }