/** * whGoodsAssignView::view_assignList() * 调拨单列表 * @return void */ public function view_assignList() { global $memc_obj; $pagesize = 100; //页面大小 //print_r($this->assign_status);exit; $whereSql = $this->buildWhereSql(); //拼接sql条件 //$whereSql = ' and a.status = 100'; //echo $whereSql;exit; //$assign_obj = new WhGoodsAssignModel(); $rownumber = WhGoodsAssignModel::getRowAllNumber($whereSql); //获得所有的行数 if ($rownumber > 0) { $pager = new Page($rownumber, $pagesize); $lists = WhGoodsAssignModel::getAssignList($whereSql, 'a.id', $pager->limit, 'a.id', 'desc'); //print_r($lists); exit; foreach ($lists as $key => $val) { //处理调拨单 $outStore = WarehouseManagementModel::warehouseManagementModelList(" where id = {$val['outStoreId']}"); //print_r($outStore);exit; $lists[$key]['outStoreId'] = $outStore[0]['whName']; $inStore = WarehouseManagementModel::warehouseManagementModelList(" where id = {$val['inStoreId']}"); //print_r($outStore);exit; $lists[$key]['inStoreId'] = $inStore[0]['whName']; $skusinfo = WhGoodsAssignModel::getsAssignListDetail($val['id']); $lists[$key]['skuinfo'] = $skusinfo; $lists[$key]['createUid'] = $val['createUid'] ? getUserNameById($val['createUid']) : '无'; $lists[$key]['statusTime'] = date('Y-m-d H:i:s', $val['statusTime']); $lists[$key]['createTime'] = date('Y-m-d H:i:s', $val['createTime']); $lists[$key]['status'] = $this->assign_status[$val['status']]; } 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); } $storeLists = WarehouseManagementModel::warehouseManagementModelList($where); //获取可用仓库列表 self::bulidNav('调拨单浏览', '调拨单列表', 51); //print_r($storeLists);exit; //print_r($lists);exit; $this->smarty->assign('lists', $lists); //调拨单列表 $this->smarty->assign('assign_status', $this->assign_status); //调拨单状态 $this->smarty->assign('storeLists', $storeLists); $this->smarty->display('assignList.htm'); }
/** * WhGoodsAssignAct::printAssignList() * 标记调拨单为待配货 * @return void */ public function act_printAssignList() { $ids = is_array($_POST['ids']) ? $_POST['ids'] : array(); if (!empty($ids)) { $idNums = count($ids); $ids = implode(',', $ids); $where1 = " and a.id in({$ids}) and a.status = 100"; $assignList1 = WhGoodsAssignModel::getRowAllNumber($where1); //获取选定的调拨单中所有待处理状态的总数 $where2 = " and a.id in({$ids}) and a.status = 103"; $assignList2 = WhGoodsAssignModel::getRowAllNumber($where2); //获取选定的调拨单中所有待打印调拨出库单的总数 if ($assignList1 != $idNums && $assignList2 != $idNums) { self::$errCode = 401; self::$errMsg = '请选择待处理或待打印出库单状态的调拨单!'; return FALSE; } $status = $assignList1 == $idNums ? 101 : 104; //下级状态对应编号 $info = WhGoodsAssignModel::updateAssignStatus($ids, $status, $_SESSION['userId']); if ($info) { self::$errCode = 200; self::$errMsg = '状态更新成功!'; return TRUE; } else { self::$errCode = 402; self::$errMsg = '状态更新失败!'; return FALSE; } } else { self::$errCode = 403; self::$errMsg = '数据不正确!'; return FALSE; } }