Пример #1
0
<body>

<?php 
$printId = $_SESSION['userId'];
//print_r($_GET);
$max_num = 10000;
//isset($_GET['max_num'])?$_GET['max_num']:1000000;
$idarr = isset($_GET['idarr']) ? $_GET['idarr'] : array();
$idarr = explode(",", $idarr);
$lists = array();
$time = time();
foreach ($idarr as $key => $id) {
    $where = "where id={$id}";
    $list = packageCheckModel::selectList($where);
    $goodscode = get_skuGoodsCode($list[0]['sku']);
    $pname_info = GroupRouteModel::getSkuPosition("where a.sku='{$list[0]['sku']}' and b.is_delete=0");
    if (!empty($pname_info)) {
        $pname = $pname_info[0]['pName'];
    } else {
        $pname = '';
    }
    $print_num = $list[0]['num'] > $max_num ? $max_num : $list[0]['num'];
    $groupInfo = printLabelModel::getGroupInfoByTallyListId($id);
    if (!empty($groupInfo)) {
        $group_id = $groupInfo[0]['id'];
    } else {
        //没有打标ID则跳转到打标页面
        header("Location:index.php?act=printLabelPrint&mod=printLabel&max_num=10000000&idarr={$id}");
        exit;
        $group_id = '';
    }
Пример #2
0
-->
</style>
</head>
<body>

<?php 
$max_num = isset($_GET['max_num']) ? $_GET['max_num'] : 100;
$str = isset($_GET['str']) ? $_GET['str'] : "";
$arr = explode(",", $str);
$lists = array();
foreach ($arr as $key => $value) {
    $value_arr = explode("*", $value);
    $sku = $value_arr[0];
    $num = $value_arr[1];
    //$lists[] = $list;
    $pname_info = GroupRouteModel::getSkuPosition("where a.sku='{$sku}' and b.is_delete=0");
    if (!empty($pname_info)) {
        $pname = $pname_info[0]['pName'];
    } else {
        $pname = '';
    }
    $skuCode = get_skuGoodsCode($sku);
    ?>




<?php 
    for ($i = 0; $i < $num; $i = $i + 2) {
        ?>
Пример #3
0
$idarr = isset($_GET['idarr']) ? $_GET['idarr'] : array();
$storeId = intval(trim($_GET['storeId']));
$storeId = $storeId ? $storeId : 1;
$idarr = explode(",", $idarr);
$lists = array();
$time = time();
foreach ($idarr as $key => $id) {
    $where = "where id={$id}";
    $list = packageCheckModel::selectList($where);
    $goodscode = get_skuGoodsCode($list[0]['sku']);
    $where = "where a.sku='{$list[0]['sku']}' and b.is_delete=0";
    if ($list['0']['storeId'] == 2) {
        //B仓点货操作则添加所属仓库判断
        $where .= " and b.storeId = 2";
    }
    $pname_info = GroupRouteModel::getSkuPosition($where);
    if (!empty($pname_info)) {
        $pname = $pname_info[0]['pName'];
    } else {
        $pname = '';
    }
    $print_num = $list[0]['num'] > $max_num ? $max_num : $list[0]['num'];
    $group_id = printLabelModel::insertPrintGroup($id, $print_num, $printId, $time, $storeId);
    //$lists[] = $list;
    ?>

<table width="420" border="0" cellspacing="0" cellpadding="0" style="margin-top:2px;"> 
  <tr valign="middle">
    <td width="200">
    	<table width="100%" height="100" border="0" cellspacing="0" cellpadding="0">
		  <tr>
Пример #4
0
 public function act_checkSku()
 {
     $skus = $_POST['skus'];
     $skuarray = array();
     $skulists = explode(',', $skus);
     foreach ($skulists as $skulist) {
         list($sku, $num) = array_map('trim', explode('*', $skulist));
         $skuarray[] = "'{$sku}'";
         $skukeyarray[$sku] = array('sku' => $sku);
     }
     $skuarray = array_unique($skuarray);
     $skustr = "(" . implode(',', $skuarray) . ")";
     $goodslists = OmAvailableModel::getTNameList("pc_goods", "sku,goodsName", "where sku in {$skustr} and is_delete=0");
     if (empty($goodslists)) {
         self::$errCode = 201;
         self::$errMsg = "未找到对应的料号信息!";
         return false;
     } else {
         $res = array();
         $skukeyresult = array();
         $resultskus = array();
         foreach ($goodslists as $key => $goodslist) {
             $resultskus[$goodslist['sku']] = array('');
             $pname_info = GroupRouteModel::getSkuPosition("where a.sku='{$goodslist['sku']}' and b.is_delete=0");
             if (!empty($pname_info)) {
                 $pname = $pname_info[0]['pName'];
             } else {
                 $pname = null;
             }
             $goodslists[$key]['pName'] = $pname;
         }
         foreach ($goodslists as $goodslist) {
             $skukeyarray[$goodslist['sku']] = $goodslist;
         }
         foreach ($skukeyarray as $skukey) {
             $skukeyresult[] = $skukey;
         }
         $errorskus = array_diff_key($skukeyarray, $resultskus);
         $res['res_data'] = $skukeyresult;
         $res['res_errorsku'] = count($errorskus) > 0 ? true : false;
         self::$errMsg = "料号验证成功";
         return $res;
     }
 }
Пример #5
0
 function act_searchSku()
 {
     $sku = trim($_POST['sku']);
     $sku = get_goodsSn($sku);
     $eosr_arr = whShelfModel::selectSkuNums($sku);
     if (empty($eosr_arr)) {
         self::$errCode = "401";
         self::$errMsg = "找不到该料号的库存信息!";
         return false;
     } else {
         $info = GroupRouteModel::getSkuPosition("where a.sku='{$sku}' and b.is_delete=0");
         self::$errCode = "400";
         self::$errMsg = '成功搜索该料号信息!' . $sku;
         return $info;
     }
 }
Пример #6
0
 function act_searchSku()
 {
     $order_id = $_POST['ebay_id'];
     $sku = trim($_POST['sku']);
     $sku = get_goodsSn($sku);
     $now_pname = trim($_POST['now_pname']);
     $state_status = array(402);
     //准备状态
     $final_status = array(403);
     //配货完成状态
     $no_express_delivery = array('中国邮政平邮', '中国邮政挂号', '香港小包平邮', '香港小包挂号', '德国邮政', '新加坡邮政', 'EUB', 'Global Mail');
     //先核对订单
     //兼容 EUB或者 包裹 扫描的是 trackno 而非ebayid
     $p_real_ebayid = '#^\\d+$#';
     $p_trackno_eub = '#^(LK|RA|RB|RC|RR|RF|LN)\\d+(CN|HK|DE200)$#';
     $is_eub_package_type = false;
     if (preg_match($p_real_ebayid, $order_id)) {
     } else {
         if (preg_match($p_trackno_eub, $order_id)) {
             $is_eub_package_type = true;
         } else {
             self::$errCode = "001";
             self::$errMsg = "订单号[" . $order_id . "]格式有误";
             return false;
         }
     }
     if ($is_eub_package_type === true) {
         $ordercheck = ShippingOrderModel::getShippingOrderInfo("b.*", "where a.tracknumber='{$order_id}' and a.is_delete=0");
     } else {
         $ordercheck = ShippingOrderModel::getShippingOrder("*", "where id='{$order_id}'");
     }
     if (empty($ordercheck)) {
         self::$errCode = '001';
         self::$errMsg = '未找到订单/跟踪号[' . $order_id . ']';
         return false;
     } else {
         $ebay_carrier = CommonModel::getShipingNameById($ordercheck[0]['transportId']);
         //$ebay_carrier = '中国邮政平邮';
         if (!in_array($ebay_carrier, $no_express_delivery)) {
             self::$errCode = '001';
             self::$errMsg = '请选择非快递订单!';
             return false;
         }
     }
     if ($ordercheck[0]['orderStatus'] == 900) {
         self::$errCode = '002';
         self::$errMsg = "该发货单[{$order_id}][已经废弃]!";
         return false;
     } else {
         if (in_array($ordercheck[0]['orderStatus'], $final_status)) {
             self::$errCode = '005';
             self::$errMsg = "该发货单已经扫描完成!";
             return false;
         }
     }
     if (!in_array($ordercheck[0]['orderStatus'], $state_status)) {
         self::$errCode = '002';
         self::$errMsg = "该发货单[{$order_id}][不在待配货]!";
         return false;
     }
     //配货单所有料号及数量
     $skuinfos = array();
     $skuinfo = GroupRouteModel::getOrderPositionID($ordercheck[0]['id']);
     foreach ($skuinfo as $info) {
         $s_key = $info['sku'] . "-" . $info['pName'];
         $skuinfos[$s_key] = $info['amount'];
     }
     $eosr_arr = OrderPickingRecordsModel::getPickingRecords("*", "where shipOrderId={$ordercheck[0]['id']} and sku='{$sku}' and is_delete=0");
     if (!$eosr_arr) {
         self::$errCode = "012";
         self::$errMsg = "请扫描正确料号!";
         return false;
     } else {
         $sku_stock = GroupRouteModel::getSkuPosition("where a.sku='{$sku}' and c.pName='{$now_pname}' and b.is_delete=0");
         $s_key = $sku . "-" . $now_pname;
         $goods_sn = array();
         //$gsi = get_sku_info($sku);
         $goods_sn['sku'] = $sku;
         //$goods_sn['gc'] = $gsi['realnums'];
         $goods_sn['gc'] = isset($sku_stock[0]['nums']) ? $sku_stock[0]['nums'] : 0;
         //$goods_sn['day']= floor($gsi['realnums']/$gsi['everyday_sale']); //库存天数
         $goods_sn['day'] = "";
         //库存天数
         $goods_sn['nums'] = $skuinfos[$s_key];
         $goods_sn['is_scan'] = $eosr_arr[0]['isScan'] == 1 ? "已扫描" : "未扫描";
         //$eg  = GroupRouteModel::getSkuPosition("where a.sku='$sku'");
         $goods_sn['gl'] = $now_pname;
         self::$errCode = "400";
         self::$errMsg = '成功搜索该料号信息!' . $sku;
         return $goods_sn;
     }
 }