Files
OMS/app/wms/lib/system/setting.php
2025-12-28 23:13:25 +08:00

122 lines
3.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class wms_system_setting{
public $tab_name = '发货校验';
public $tab_key = 'delivery';
private $_setting_tab = array(
array('name' => '发货校验', 'file_name' => 'admin/system/setting/tab_delivery.html', 'app' => 'wms', 'order' => 40),
);
/**
* 获取_setting_tab
* @return mixed 返回结果
*/
public function get_setting_tab()
{
return $this->_setting_tab;
}
/**
* 获取View
* @return mixed 返回结果
*/
public function getView(){
$settings = $this->all_settings();
foreach($settings as $set){
$key = str_replace('.','_',$set);
$setData[$key] = app::get('wms')->getConf($set);
}
$render = kernel::single('base_render');
$render->pagedata['tab_key'] = $this->tab_key;
$render->pagedata['setData'] = $setData;
$html = $render->fetch('admin/system/setting.html','wms');
return $html;
}
/**
* all_settings
* @return mixed 返回值
*/
public function all_settings(){
$all_settings =array(
'wms.delivery.check',
'wms.delivery.check_show_type',
//'ome.batch_print_nums',
'wms.delivery.check_ident',
'wms.delivery.weight',
'wms.delivery.weightwarn',
'wms.delivery.minWeight',
'wms.delivery.maxWeight',
'wms.delivery.cfg.radio',
'wms.delivery.min_weightwarn',
'wms.delivery.max_weightwarn',
'wms.delivery.maxpercent',
'wms.delivery.minpercent',
//'ome.delivery.min_weight',
'wms.delivery.problem_package',
'wms.groupCalibration.intervalTime',
'wms.groupDelivery.intervalTime',
'wms.delivery.consignnum.show',
'wms.delivery.checknum.show',
'wms.delivery.logi',
'wms.product.serial.delivery',
'wms.delivery.check_delivery',//校验后,直接发货
);
return $all_settings;
}
/**
* 保存Conf
* @param mixed $data 数据
* @return mixed 返回操作结果
*/
public function saveConf($data){
if ($data['wms.delivery.weight'] == 'off') {
$data['wms.delivery.logi'] = '0';
}
//称重开启后,关闭校验完即发货功能
if($settins['wms.delivery.weight'] == 'on'){
$data['wms.delivery.check_delivery'] = 'off';
}
foreach($data as $set=>$value){
$curSet = app::get('wms')->getConf($set);
if(in_array($set,$this->all_settings()) && $curSet!=$data[$set]){
app::get('wms')->setConf($set,$data[$set]);
}
}
return true;
}
/**
* 获取_setting_data
* @return mixed 返回结果
*/
public function get_setting_data()
{
$setData = array();
$all_settings = $this->all_settings();
foreach($all_settings as $set){
$key = str_replace('.','_',$set);
$setData[$key] = app::get('wms')->getConf($set);
}
return $setData;
}
}