重新质检
EOF;
break;
case '9':
if($_GET['flt'] == 'process_list'){
$cols = '';
}else{
$cols = $edit.$cancel.$doback;
}
break;
case '11':
$cols = $edit.$cancel.$rejectFreights.$memobtn;
break;
case '14':
$cols = $part_cancel;
break;
default:
$cols = 'wrong';
}
return $cols ? $cols : '';
}
/**
* 行样式
* todo: 绿色list-even、黄色selected、红色list-warning
*
* @param array $row
* @return string
*/
public function row_style($row) {
$s = kernel::single('ome_reship')->is_precheck_reship($row['is_check'],$row[$this->col_prefix.'need_sv']);
$style = '';
if ($s){
$style.= 'highlight-row';
}
if ($row[$this->col_prefix.'source'] == 'matrix' && $row[$this->col_prefix.'return_type'] == 'change'){
$style.= 'selected';
}elseif($row['is_check'] == '11'){
$style .= 'selected'; //待确认记录加黄色背景
}
return $style;
}
var $column_order_id = '订单号';
var $column_order_id_width = '180';
function column_order_id($row, $list)
{
$archive = $row[$this->col_prefix . 'archive'];
$source = $row[$this->col_prefix . 'source'];
$order_id = $row[$this->col_prefix . 'order_id'];
$order_ids = array_column($list, $this->col_prefix . 'order_id');
$filter = array('order_id'=>$order_ids);
if ($archive == '1' || in_array($source,array('archive'))) {
static $a_order;
if (!isset($a_order)) {
$archive_ordObj = kernel::single('archive_interface_orders');
$a_order = $archive_ordObj->getOrder_list($filter,'order_id,order_bn');
$a_order = array_column($a_order, 'order_bn', 'order_id');
}
return $a_order[$order_id];
/*
$archive_ordObj = kernel::single('archive_interface_orders');
$order = $archive_ordObj->getOrders($filter,'order_bn');
*/
}else{
static $o_order;
if (!isset($o_order)) {
$orderObj = app::get('ome')->model('orders');
$o_order = $orderObj->getList('order_id, order_bn', $filter);
$o_order = array_column($o_order, 'order_bn', 'order_id');
}
return $o_order[$order_id];
/*
$orderObj = app::get('ome')->model('orders');
$order = $orderObj->dump($filter,'order_bn');
*/
}
// return $order['order_bn'];
}
var $column_changebranch_id = '换货仓';
var $column_changebranch_id_width='80';
function column_changebranch_id($row, $list){
$changebranch_id = $row[$this->col_prefix .'changebranch_id'];
if($changebranch_id){
static $branchList;
if (!isset($branchList)) {
$changebranch_ids = array_unique(array_column($list, $this->col_prefix . 'changebranch_id'));
$branchObj = app::get('ome')->model('branch');
$branchList = $branchObj->getList('branch_id,name', ['branch_id'=>$changebranch_ids,'check_permission'=>'false']);
$branchList = array_column($branchList, 'name', 'branch_id');
}
return $branchList[$changebranch_id];
/*
$branchObj = app::get('ome')->model('branch');
$branch = $branchObj->db->selectrow('select name FROM sdb_ome_branch WHERE branch_id='.$changebranch_id);
return $branch['name'];
*/
}else{
return '-';
}
}
var $column_change_order_id = '换货订单号';
var $column_change_order_id_width='80';
/**
* column_change_order_id
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_change_order_id($row,$list){
$change_order_id = $row[$this->col_prefix .'change_order_id'];
if ($change_order_id){
static $orderList;
if (!isset($orderList)) {
$change_order_ids = array_unique(array_column($list, $this->col_prefix . 'change_order_id'));
$orderObj = app::get('ome')->model('orders');
$orderList = $orderObj->getList('order_id,order_bn',['order_id'=>$change_order_ids]);
$orderList = array_column($orderList, 'order_bn', 'order_id');
}
return $orderList[$change_order_id];
/*
if (self::$change_order[$change_order_id]){
return self::$change_order[$change_order_id];
}else{
$orderObj = app::get('ome')->model('orders');
$order_detail = $orderObj->dump(array('order_id'=>$change_order_id),'order_bn');
self::$change_order[$change_order_id] = $order_detail['order_bn'];
return self::$change_order[$change_order_id];
}
*/
}
return '';
}
var $column_time_out = '超时时间';
var $column_time_out_width='120';
function column_time_out($row, $list){
if ($row[$this->col_prefix.'source'] == 'matrix' && $row[$this->col_prefix.'shop_type']=='tmall' && $row[$this->col_prefix.'return_type'] == 'change'){
static $dataList;
if (!isset($dataList)) {
$return_ids = array_column($list, 'return_id');
$tmallObj = app::get('ome')->model('return_product_tmall');
$dataList = $tmallObj->getList('return_id,current_phase_timeout', array('return_id'=>$return_ids,'refund_type'=>'change'));
$dataList = array_column($dataList,'current_phase_timeout','return_id');
}
$return_id = $row['return_id'];
if ($dataList[$return_id]) {
return "".date('Y-m-d H:i:s',$dataList[$return_id])."
";
} else {
return '-';
}
/*
$tmallObj = app::get('ome')->model('return_product_tmall');
$tmall_detail = $tmallObj->dump(array('return_id'=>$row['return_id'],'refund_type'=>'change'),'current_phase_timeout');
if ($tmall_detail && $tmall_detail['current_phase_timeout']){
return "".date('Y-m-d H:i:s',$tmall_detail['current_phase_timeout'])."
";;
}
*/
}else{
return '-';
}
}
//退货单标识
var $column_fail_status = '标识';
var $column_fail_status_width = 260;
function column_fail_status($row)
{
$flag_type = $row[$this->col_prefix.'flag_type'];
return kernel::single('ome_reship_const')->getHtml($flag_type);
}
//同步WMS错误码
var $column_sync_code = "同步WMS错误码";
var $column_sync_code_width = 150;
function column_sync_code($row, $list)
{
if(empty($row[$this->col_prefix.'sync_code'])){
return '';
}
static $error_codes;
if(!isset($error_codes)){
$error_codes = $sync_codes = [];
foreach ($list as $key => $v) {
if ($v[$this->col_prefix.'sync_code']) {
$sync_codes[] = $v[$this->col_prefix.'sync_code'];
}
}
$abnormalObj = app::get('wmsmgr')->model('abnormal_code');
$tempList = $abnormalObj->getList('abnormal_id,abnormal_code,abnormal_name', array('abnormal_type'=>'return','abnormal_code'=>$sync_codes), 0, 500);
if($tempList){
foreach ($tempList as $key => $val)
{
$abnormal_code = $val['abnormal_code'];
$error_codes[$abnormal_code] = $val['abnormal_name'];
}
}
unset($tempList);
}
$sync_code = $row[$this->col_prefix.'sync_code'];
$error_msg = ($error_codes[$sync_code] ? '('. $error_codes[$sync_code].')' : '');
return $sync_code . $error_msg;
}
var $column_platform_status = '平台售后状态';
var $column_platform_status_width = 130;
function column_platform_status($row)
{
$platform_status = $row[$this->col_prefix.'platform_status'];
//check
if(empty($platform_status)){
return '';
}
//平台售后状态列表
if(empty(self::$_platformStatus)){
$reshipLib = kernel::single('ome_reship');
self::$_platformStatus = $reshipLib->get_platform_status();
}
return self::$_platformStatus[$platform_status];
}
var $column_abnormal_status = '异常标识';
var $column_abnormal_status_width = 150;
function column_abnormal_status($row)
{
return kernel::single('ome_constants_reship_abnormal')->getIdentifier($row[$this->col_prefix.'abnormal_status']);
}
var $column_aftersale_type = '售后类型';
var $column_aftersale_type_width = 85;
function column_aftersale_type($row)
{
$flag_type = $row[$this->col_prefix . 'flag_type'];
$aftersale_type = '客退';
if ($flag_type & ome_reship_const::__LANJIE_RUKU) {
$aftersale_type = '原单退';
}
return $aftersale_type;
}
var $column_delivery_bn = '发货单号';
var $column_delivery_bn_width = 120;
function column_delivery_bn($row,$list)
{
$data = $this->getDelivery($row,$list);
return isset($data['delivery_bn']) ? $data['delivery_bn'] : '';
}
protected $__deliveryList = [];
/**
* 获取Delivery
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回结果
*/
public function getDelivery($row, $list)
{
$reship_id = $row['reship_id'];
if (isset($this->__deliveryList[$reship_id])) {
return $this->__deliveryList[$reship_id] ?: [];
}
$reshipIds = array_column($list, 'reship_id');
$itemMdl = app::get('ome')->model('reship_items');
$itemList = $itemMdl->getList('reship_id,order_item_id', ['reship_id' => $reshipIds]);
$orderItemIds = array_column($itemList, 'order_item_id');
$itemList = array_column($itemList, null, 'reship_id');
$salesDelOrderitemList = [];
if ($orderItemIds) {
$salesDelOrderitemList = app::get('sales')->model('delivery_order_item')->getList('delivery_id,delivery_bn,order_id,order_bn,order_item_id', ['order_item_id' => $orderItemIds]);
$salesDelOrderitemList = array_column($salesDelOrderitemList, null, 'order_item_id');
}
foreach ($itemList as $item) {
$delivery_bn = $salesDelOrderitemList[$item['order_item_id']]['delivery_bn'] ?? '';
$this->__deliveryList[$item['reship_id']]['delivery_bn'] = $delivery_bn;
}
return $this->__deliveryList[$reship_id] ?: [];
}
}
?>