糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > 预警指标设置

预警指标设置

时间:2021-06-19 08:39:02

相关推荐

预警指标设置

//Controllerclass Product_ReceivingController extends Zend_Controller_Action {//预警指标设置public function warningIndicatorSettingAction() {$warehouseId = $this->_request->getParam("userWarehouse", "");$type = $this->_request->getParam("type", "");$yellowDays = $this->_request->getParam("yellow_days", "");$yellowPercentage = $this->_request->getParam("yellow_percentage", "");$redDays = $this->_request->getParam("red_days", "");$redPercentage = $this->_request->getParam("red_percentage", "");$return = array("ask" => 0,"data" => "","msg" => "",);if (!$warehouseId) {$return['msg'] = "请选择仓库";die(json_encode($return));}$configId = Common_Service_Config::getByAttribute("WARNING_INDICATOR_SETTING", $warehouseId);if ($type == 0) {$return = array("ask" => 1,"data" => unserialize($configId['config_value']),);} else {$combination = array("yellow_days" => $yellowDays,"yellow_percentage" => $yellowPercentage,"red_days" => $redDays,"red_percentage" => $redPercentage,);if ($configId) {if (Common_Service_Config::update(array("config_value" => serialize($combination)), $configId['config_id'])) {$return = array("ask" => 1,"msg" => "修改成功",);} else {$return['msg'] = "修改失败";}} else {$warehouseNameCn = Warehouse_Service_Warehouse::getById($warehouseId);$combinat = array("config_attribute" => "WARNING_INDICATOR_SETTING","warehouse_id" => $warehouseId,"config_value" => serialize($combination),"config_description" => $warehouseNameCn['warehouse_name_cn'] . "预警指标设置","config_create_time" => date("Y-m-d H:i:s"),);if (Common_Service_Config::add($combinat)) {$return = array("ask" => 1,"msg" => "添加成功",);} else {$return['msg'] = "添加失败";}}die(json_encode($return));}die(json_encode($return));}}Html<input class="button" type="button" value="预警指标设置" onclick="warningIndicatorSetting()" style="color: red; width: 90px"><div id="warningIndicatorSettingDialog" title="预警指标设置" style="display: none"></div>js//初始化$(function () {//预警指标设置$("#warningIndicatorSettingDialog").dialog({autoOpen: false,modal: true,width: 1100,height: 400,zIndex: 200,show: "slide",title: "预警指标设置",buttons: {"确定": function () {updateWarningIndicatorSetting();},"关闭": function () {$(this).dialog("close");}}});});//预警指标设置function warningIndicatorSetting() {loading();var userWarehouse = $("[name=userWarehouse]").val();$.ajax({url: "/product/receiving/warning-indicator-setting",data: {"type": 0,"userWarehouse": userWarehouse},type: "post",dataType: "json",async: false,success: function (json) {var Html = "";if (json.ask) {Html += "<table width='100%' height='30%' border='1' style='text-align: center'>";Html += "<tr>";Html += "<th>预警等级</th>";Html += "<th>连续天数</th>";Html += "<th>积压百分比</th>";Html += "</tr>";if (json.data) {Html += "<tr>";Html += "<td>黄色预警</td>";Html += "<td><input type='text' name='yellow_days' value='" + json.data.yellow_days + "' style='text-align: center'></td>";Html += "<td><input type='text' name='yellow_percentage' value='" + json.data.yellow_percentage + "' style='text-align: center'></td>";Html += "</tr>";Html += "<tr>";Html += "<td>红色预警</td>";Html += "<td><input type='text' name='red_days' value='" + json.data.red_days + "' style='text-align: center'></td>";Html += "<td><input type='text' name='red_percentage' value='" + json.data.red_percentage + "' style='text-align: center'></td>";Html += "</tr>";} else {Html += "<tr>";Html += "<td>黄色预警</td>";Html += "<td><input type='text' name='yellow_days' value=''></td>";Html += "<td><input type='text' name='yellow_percentage' value=''></td>";Html += "</tr>";Html += "<tr>";Html += "<td>红色预警</td>";Html += "<td><input type='text' name='red_days' value=''></td>";Html += "<td><input type='text' name='red_percentage' value=''></td>";Html += "</tr>";}Html += "</table>";Html += "<h5 style='margin-top: 0.5cm; text-align: center'>仓库来货积压预警等级划分及处理方案</h5>";Html += "<table width='100%' height='50%' border='1'>";Html += "<tr style='background-color: #D0CECE'>";Html += "<th>预警等级</th>";Html += "<th>指标</th>";Html += "<th>处理办法</th>";Html += "</tr>";Html += "<tr>";Html += "<td style='background-color: yellow; text-align: center'>黄色</td>";Html += "<td>连续三天未处理 PO 数 ≧ 40% (上周日均处理 PO 数)</td>";Html += "<td>1、内部加班,包括质检组外的人员。<br/>2、加大招聘需求,紧急加入。<br/>3、积压超过的组组内人员协助。(组积压数 ≧ 上周日均处理 PO 数 * 40% / 组数)</td>";Html += "</tr>";Html += "<tr>";Html += "<td style='background-color: red; text-align: center'>红色</td>";Html += "<td>1、平常期间预警条件:<br/>连续三天未处理 PO 数 ≧ 100% (上周日均处理 PO 数)<br/>2、国庆和春节备货期间预警条件:<br/>连续三天未处理 PO 数 ≧ 200% (上周日均处理 PO 数)</td>";Html += "<td>1、电商所有部门支援。<br/>2、按实际库存销售。<br/>3、变更预警,减少备货量。</td>";Html += "</tr>";Html += "</table>";$("#warningIndicatorSettingDialog").dialog("open").html(Html);} else {alertTip(json.msg);}}});closeLoading();}//更新预警指标设置function updateWarningIndicatorSetting() {var userWarehouse = $("[name=userWarehouse]").val();var yellow_days = $.trim($("[name=yellow_days]").val());var yellow_percentage = $.trim($("[name=yellow_percentage]").val());var red_days = $.trim($("[name=red_days]").val());var red_percentage = $.trim($("[name=red_percentage]").val());$.ajax({url: "/product/receiving/warning-indicator-setting",data: {"type": 1,"userWarehouse": userWarehouse,"yellow_days": yellow_days,"yellow_percentage": yellow_percentage,"red_days": red_days,"red_percentage": red_percentage},type: "post",dataType: "json",async: false,success: function (json) {if (json.ask) {$("#warningIndicatorSettingDialog").dialog("close");} else {alertTip(json.msg);}}});}

如果觉得《预警指标设置》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。