mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-30 21:15:34 +08:00
93 lines
3.7 KiB
PHP
93 lines
3.7 KiB
PHP
<?php
|
|
/**
|
|
* Copyright 2026 ShopeX (https://www.shopex.cn)
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
class ome_desktop_widgets_service_delivery{
|
|
|
|
/**
|
|
* 获取_menugroup
|
|
* @return mixed 返回结果
|
|
*/
|
|
public function get_menugroup(){
|
|
|
|
$deliCfgLib = kernel::single('wms_delivery_cfg');
|
|
$deliveryObj = app::get('wms')->model('delivery');
|
|
$data['label'] = '发货单';
|
|
$data['type'] = 'delivery';
|
|
$btncombi = $deliCfgLib->btnCombi();
|
|
$basicFilter = array('status'=>array('0'),'type'=>'normal');
|
|
#$unprintFilter = array('type'=>'normal','pause'=>'FALSE' ,'verify'=>'FALSE' ,'process'=>'FALSE','deli_cfg|notin'=>array('single','multi'));
|
|
//$unprintFilter = array('type'=>'normal','pause'=>'FALSE' ,'verify'=>'FALSE' ,'process'=>'FALSE');
|
|
switch ($btncombi) {
|
|
case '1_1':
|
|
$unprintFilter['todo'] = '1';
|
|
break;
|
|
case '1_0':
|
|
$unprintFilter['todo'] = '2';
|
|
break;
|
|
case '0_1':
|
|
$unprintFilter['todo'] = '3';
|
|
break;
|
|
case '0_0':
|
|
$unprintFilter['todo'] = '4';
|
|
break;
|
|
}
|
|
#获取自建仓库
|
|
$ownerBranch = array();
|
|
$ownerBranch = kernel::single('ome_branch_type')->getOwnBranchIds();
|
|
|
|
#非管理员取管辖仓
|
|
$is_super = kernel::single('desktop_user')->is_super();
|
|
if (!$is_super) {
|
|
$oBranch = app::get('ome')->model('branch');
|
|
$branch_ids = $oBranch->getBranchByUser(true);
|
|
if ($branch_ids) {
|
|
$tmp_filter['ext_branch_id'] = $branch_ids;
|
|
} else {
|
|
$tmp_filter['ext_branch_id'] = false;
|
|
}
|
|
}
|
|
#非管理员取管辖仓与自建仓的交集
|
|
$tmp_filter['ext_branch_id'] = $tmp_filter['ext_branch_id']?array_intersect($tmp_filter['ext_branch_id'], $ownerBranch) : $ownerBranch;
|
|
$basicFilter['ext_branch_id'] = $tmp_filter['ext_branch_id'];
|
|
$data['value'][0] = array(
|
|
'count' => $deliveryObj->count(array_merge($unprintFilter,$basicFilter)),
|
|
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=0&sku=',
|
|
'label' => '待打印',
|
|
);
|
|
$uncheckFilter = array('process_status'=>1);
|
|
$btncombi_single = $deliCfgLib->btnCombi('single');
|
|
$btncombi_multi = $deliCfgLib->btnCombi('multi');
|
|
$btncombi_basic = $deliCfgLib->btnCombi();
|
|
$uncheckFilter['print_finish'] = array(
|
|
''=> $btncombi_basic,
|
|
'single' => $btncombi_single,
|
|
'multi' => $btncombi_multi,
|
|
);
|
|
$data['value'][1] = array(
|
|
'count' => $deliveryObj->count(array_merge($uncheckFilter,$basicFilter)),
|
|
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=1',
|
|
'label' => '待校验',
|
|
);
|
|
|
|
$data['value'][2] = array(
|
|
'count' => $deliveryObj->count($basicFilter),
|
|
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=4',
|
|
'label' => '待发货',
|
|
);
|
|
return $data;
|
|
}
|
|
} |