时间配置
2017-11-02 20:00
21 查看
//Controller //标准时间配置 public function standardTimeConfigurationAction() { $type = $this->_request->getParam("type", ""); $warehouseId = $this->_request->getParam("userWarehouse", ""); $postName = $this->_request->getParam("post_name", ""); $trainA = $this->_request->getParam("trainA", ""); $trainB = $this->_request->getParam("trainB", ""); $trainC = $this->_request->getParam("trainC", ""); $tryHillockA = $this->_request->getParam("try_hillockA", ""); $tryHillockB = $this->_request->getParam("try_hillockB", ""); $tryHillockC = $this->_request->ge 4000 tParam("try_hillockC", ""); $postsA = $this->_request->getParam("postsA", ""); $postsB = $this->_request->getParam("postsB", ""); $postsC = $this->_request->getParam("postsC", ""); $matureA = $this->_request->getParam("matureA", ""); $matureB = $this->_request->getParam("matureB", ""); $matureC = $this->_request->getParam("matureC", ""); $posts = Order_Service_OrderWorkload::$post; $return = array( "ask" => 0, "data" => "", "msg" => "", ); if (!$warehouseId) { $return['msg'] = "请选择仓库"; } else { if ($postName == 0) { $configId = Common_Service_Config::getByAttribute(Order_Service_OrderWorkload::$StandardConfigurationTime['0'], $warehouseId); $configAttribute = Order_Service_OrderWorkload::$StandardConfigurationTime['0']; } else if ($postName == 1) { $configId = Common_Service_Config::getByAttribute(Order_Service_OrderWorkload::$StandardConfigurationTime['1'], $warehouseId); $configAttribute = Order_Service_OrderWorkload::$StandardConfigurationTime['1']; } else if ($postName == 2) { $configId = Common_Service_Config::getByAttribute(Order_Service_OrderWorkload::$StandardConfigurationTime['2'], $warehouseId); $configAttribute = Order_Service_OrderWorkload::$StandardConfigurationTime['2']; } if ($type == 0) { $return = array( "ask" => 1, "posts" => $posts, ); } else if ($type == 1) { $configValueInfo = unserialize($configId['config_value']); $return = array( "ask" => 1, "data" => $configValueInfo, ); } else { $Info = array( "trainA" => $trainA, "trainB" => $trainB, "trainC" => $trainC, "try_hillockA" => $tryHillockA, "try_hillockB" => $tryHillockB, "try_hillockC" => $tryHillockC, "postsA" => $postsA, "postsB" => $postsB, "postsC" => $postsC, "matureA" => $matureA, "matureB" => $matureB, "matureC" => $matureC, ); if (!$configId) { $configInfo = array( "config_attribute" => $configAttribute, "warehouse_id" => $warehouseId, "config_value" => serialize($Info), "config_description" => "标准时间配置", "config_create_time" => date("Y-m-d H:i:s"), ); if (!Common_Service_Config::add($configInfo)) { $return = array( "ask" => 0, "msg" => "添加失败", ); } else { $return = array( "ask" => 1, "msg" => "添加成功", ); } } else { if (!Common_Service_Config::update(array("config_value" => serialize($Info)), $configId['config_id'])) { $return = array( "ask" => 0, "msg" => "修改失败", ); } else { $return = array( "ask" => 1, "msg" => "修改成功", ); } } die(json_encode($return)); } } die(json_encode($return)); } //Html <input class="button2" type="button" value="标准时间配置表" onclick="posts()"> <div id="timeAllocationDialog" title="标准时间配置表" style="display: none"></div> <div id="postDialog" title="岗位选择" style="display: none"></div> //Js //岗位 $("#postDialog").dialog({ autoOpen: false, modal: true, width: 300, show: "slide", buttons: { "确定": function () { $(this).dialog("close"); timeAllocation(); }, "关闭": function () { $(this).dialog("close"); } } }); //标准时间配置 $("#timeAllocationDialog").dialog({ autoOpen: false, modal: true, width: 700, show: "slide", buttons: { "确定": function () { timeAllocationUpdate(); }, "关闭": function () { $(this).dialog("close"); } } }); //岗位 function posts() { loading(); var userWarehouse = $("[name=userWarehouse]").val(); $.ajax({ url: "/order/order/standard-time-configuration", async: false, dataType: "json", type: "post", data: { "type": 0, "userWarehouse": userWarehouse }, success: function (json) { var Html = ""; if (json.ask == 1) { Html += "<span>岗位:</span>"; Html += "<select name='post_name'>"; $.each(json.posts, function (key, value) { Html += "<option value=" + key + ">" + value + "</option>"; }); Html += "</select>"; $("#postDialog").html(Html); $("#postDialog").dialog("open"); } else { alertTip(json.msg); } } }); closeLoading(); } //标准时间配置 function timeAllocation() { loading(); var post_name = $("[name='post_name']").val(); var userWarehouse = $("[name=userWarehouse]").val(); $.ajax({ url: "/order/order/standard-time-configuration", async: false, dataType: "json", type: "post", data: { "type": 1, "post_name": post_name, "userWarehouse": userWarehouse }, success: function (json) { var Html = ""; if (json.ask == 1) { Html += "<table width='100%' height='100%' border='1' style='text-align: center'>"; Html += "<tr>"; Html += "<th>阶段</th>"; Html += "<th>时间</th>"; Html += "<th>类型</th>"; Html += "<th>标准时间(分钟)</th>"; Html += "</tr>"; if (!json.data) { Html += "<tr>"; Html += "<td rowspan='3'>培训期</td>"; Html += "<td rowspan='3'><= 10 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='trainA' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='trainB' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='trainC' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td rowspan='3'>试岗期</td>"; Html += "<td rowspan='3'>> 10 天<br/><= 20 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='try_hillockA' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='try_hillockB' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='try_hillockC' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td rowspan='3'>上岗期</td>"; Html += "<td rowspan='3'>> 20 天<br/><= 30 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='postsA' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='postsB' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='postsC' value=''></td>"; Html += "</tr>"; Html += "<td rowspan='3'>成熟期</td>"; Html += "<td rowspan='3'>> 30 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='matureA' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='matureB' value=''></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='matureC' value=''></td>"; Html += "</tr>"; } else { Html += "<tr>"; Html += "<td rowspan='3'>培训期</td>"; Html += "<td rowspan='3'><= 10 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='trainA' value=" + json.data.trainA + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='trainB' value=" + json.data.trainB + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='trainC' value=" + json.data.trainC + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td rowspan='3'>试岗期</td>"; Html += "<td rowspan='3'>> 10 天<br/><= 20 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='try_hillockA' value=" + json.data.try_hillockA + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='try_hillockB' value=" + json.data.try_hillockB + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='try_hillockC' value=" + json.data.try_hillockC + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td rowspan='3'>上岗期</td>"; Html += "<td rowspan='3'>> 20 天<br/><= 30 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='postsA' value=" + json.data.postsA + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='postsB' value=" + json.data.postsB + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='postsC' value=" + json.data.postsC + "></td>"; Html += "</tr>"; Html += "<td rowspan='3'>成熟期</td>"; Html += "<td rowspan='3'>> 30 天</td>"; Html += "<td>A</td>"; Html += "<td><input class='item' type='text' name='matureA' value=" + json.data.matureA + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>B</td>"; Html += "<td><input class='item' type='text' name='matureB' value=" + json.data.matureB + "></td>"; Html += "</tr>"; Html += "<tr>"; Html += "<td>C</td>"; Html += "<td><input class='item' type='text' name='matureC' value=" + json.data.matureC + "></td>"; Html += "</tr>"; } Html += "</table>"; $("#timeAllocationDialog").html(Html); $("#timeAllocationDialog").dialog("open"); } else { alertTip(json.msg); } } }); closeLoading(); } //更新标准配置时间 function timeAllocationUpdate() { var post_name = $("[name='post_name']").val(); var userWarehouse = $("[name='userWarehouse']").val(); var trainA = $("[name='trainA']").val(); var trainB = $("[name='trainB']").val(); var trainC = $("[name='trainC']").val(); var try_hillockA = $("[name='try_hillockA']").val(); var try_hillockB = $("[name='try_hillockB']").val(); var try_hillockC = $("[name='try_hillockC']").val(); var postsA = $("[name='postsA']").val(); var postsB = $("[name='postsB']").val(); var postsC = $("[name='postsC']").val(); var matureA = $("[name='matureA']").val(); var matureB = $("[name='matureB']").val(); var matureC = $("[name='matureC']").val(); $.ajax({ url: "/order/order/standard-time-configuration", type: "post", dataType: "json", async: false, data: { "type": 2, "userWarehouse": userWarehouse, "post_name": post_name, "trainA": trainA, "trainB": trainB, "trainC": trainC, "try_hillockA": try_hillockA, "try_hillockB": try_hillockB, "try_hillockC": try_hillockC, "postsA": postsA, "postsB": postsB, "postsC": postsC, "matureA": matureA, "matureB": matureB, "matureC": matureC }, success: function (json) { if (!json.ask) { alertTip(json.msg); } else { alertTip(json.msg); $("#timeAllocationDialog").dialog("close"); } } }); }
相关文章推荐
- springboot 返回json格式数据的时间格式配置
- ESX Server时间配置
- 对于Quartz的时间配置符号中?的终极说明
- xen虚拟化实战系列(九)之xen虚拟机时间配置
- 2个区别搞懂web.xml配置Session超时时间
- vtune 使用pmc 时间的配置
- Quartz CronTrigger时间最完整配置说明
- Linux 配置 history 命令显示操作时间、用户和登录 IP
- SpringMVC整合Quartz实现定时任务和Crontrigger时间配置和版本问题
- 配置树莓派3和局域网NTP服务器实现内网时间校准
- Linux 时间同步配置
- Spring集成Quartz定时调度时间配置
- 内网虚拟化平台(VMware vSphere5.1)时间同步配置案例(经过网闸)
- linux时间同步配置
- spring quartz 时间配置格式
- kvm虚拟化学习笔记(九)之kvm虚拟机时间配置
- 转spring配置定时器的时间设置
- linux NTP 配置时间同步
- Nginx配置——配置静态文件过期时间
- 【Linux配置】:ruijie配置 & eclipse cdt 安装 & grub改变选择菜单等待时间