123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <#include "/base/add_base.ftl">
- <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css" />
- <style>
- .my-title{font-weight: 500;padding-left: 15px;position: relative;}
- .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
- .my-input{padding: 5px 10px;width: 60%;}
- .my-input-date{padding: 5px 10px;width: 60%;background: url(${path}/common/images/pts//rili-1.png) 98.5% center no-repeat; background-size:auto 80%;}
- .input-box{margin: 18px 0;}
- .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
- .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
- .add-list>li{margin: 10px 0;}
- .my-textarea{padding: 5px 10px;width: 60%;}
- .my-btn-reset{padding: 6px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
- .my-btn-submit{padding: 6px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
- .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
- </style>
- <title>添加员工- 员工管理 - RST</title>
- </head>
- <body>
- <nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页
- <span class="c-gray en">></span> 员工管理
- <span class="c-gray en">></span> 修改员工
- <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #58d2ea;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
- </nav>
- <article class="page-container">
- <form class="form form-horizontal" id="form-admin-addEmployee">
- <div style="padding: 10px;width: 600px;margin: 0 auto;">
- <div class="my-title">员工信息</div>
- <input type="hidden" name="employeeId" value="${employee.employeeId!}">
- <div class="input-box"><span class="input-dic">员工编号</span> <input class="my-input" name="employeeNo" type="text" value="${employee.employeeNo!}" placeholder="请输入员工编号" required maxlength="10" /> </div>
- <div class="input-box"><span class="input-dic">员工姓名</span> <input class="my-input" name="employeeName" type="text" value="${employee.employeeName!}" placeholder="请输入员工姓名" required maxlength="20" /> </div>
- <div class="input-box"><span class="input-dic">员工电话</span> <input class="my-input" name="employeeTel" type="text" value="${employee.employeeTel!}" placeholder="请输入员工手机号码" required maxlength="11" minlength="11" /> </div>
- <div class="input-box"><span class="input-dic">员工状态</span>
- <input type="radio" id="employeeState1" name="employeeState" value="1" <#if employee.employeeState == 1>checked</#if>/><label for="employeeState1">在职</label>
- <input type="radio" id="employeeState2" name="employeeState" value="0" <#if employee.employeeState == 0>checked</#if>/><label for="employeeState2">离职</label>
- </div>
- <div class="input-box"><span class="input-dic">清空卡权限</span>
- <input type="radio" id="employeeClearPower1" name="employeeClearPower" value="1" <#if employee.employeeClearPower == 1>checked</#if>/><label for="employeeClearPower1">具有</label>
- <input type="radio" id="employeeClearPower2" name="employeeClearPower" value="0" <#if employee.employeeClearPower == 0>checked</#if>/><label for="employeeClearPower2">不具有</label>
- </div>
- <div class="input-box"><span class="input-dic">入职日期</span> <input class="my-input-date" type="text" name="employeeEntryDate" value="${(employee.employeeEntryDate?string("yyyy-MM-dd"))!''}" placeholder="请选择入职日期" onclick="WdatePicker({skin:'whyGreen'})" readonly="readonly"/> </div>
- <div class="input-box" id="isDeparture" style="<#if employee.employeeState == 1>display: none</#if>"><span class="input-dic">离职日期</span> <input class="my-input-date" type="text" name="employeeDepartureDate" value="${(employee.employeeDepartureDate?string("yyyy-MM-dd"))!''}" placeholder="请选择离职日期" onclick="WdatePicker({skin:'whyGreen'})" readonly="readonly"/> </div>
- <div class="input-box"><span class="input-dic">员工岗位</span> <input class="my-input" type="text" name="employeePost" value="${employee.employeePost!}" placeholder="请输入员工岗位" required maxlength="100"/> </div>
- <div style="clear: both;"></div>
- <div class="input-box"><span class="input-dic">员工备注</span>
- <textarea rows="3" cols="20" class="my-textarea" name="employeeDesc">${employee.employeeDesc!}</textarea>
- </div>
- <div>
- <button type="reset" class="my-btn-reset">重置</button><button type="submit" class="my-btn-submit">确认提交</button>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
- <script type="text/javascript">
- //动态显示隐藏所属菜单
- $(document).on('click', '.menuSubid input[type=radio]', function() {
- isSelectShow($(this).val())
- })
- /* $(function(){
- $("#form-admin-addEmployee").validate({
- rules:{
- subName:{
- required:true,
- minlength:4,
- maxlength:30
- }
- },
- onkeyup:false,
- focusCleanup:true,
- success:"valid",
- submitHandler:function(form){
- $.post(root_path + "/admin/employee/update_employee", formatJSON(),function(result){
- if (result.returnCode != 200 || result.returnCode != 200) {
- layer.msg('录入失败,请重试!',{icon: 5,time:3000});
- } else {
- layer.msg('录入成功!!',{icon: 1,time:2000}, function () {
- // 关闭当前页面,并刷新父级页面
- window.location.href= '${path}/admin/employee/list_employee';
- });
- }
- });
- }
- });
- });*/
- $(function(){
- //var validator = $("#form-admin-addEmployee").validate();
- $("#form-admin-addEmployee").submit(function(){
- ajaxReq();
- return false;
- })
- })
- function ajaxReq(){
- var data = formatJSON();
- $.ajax({
- cache: true,
- type: "POST",
- data: data,
- url: "${path}/admin/employee/update_employee",
- async: false,
- success: function(data){
- if (data.returnCode == 200) {
- window.location.href = '${path}//admin/employee/_employee_list'
- }
- },
- error: function(XmlHttpRequest, textStatus, errorThrown){
- }
- });
- }
- /*将表单format为JSON*/
- function formatJSON() {
- var serializeObj={};
- $($("#form-admin-addEmployee").serializeArray()).each(function(){
- if (this.value != "" && this.value != null) {
- serializeObj[this.name]=this.value;
- }
- });
- return serializeObj;
- }
- $(function(){
- //监听离职状态,离职的才有离职时间
- $("[name='employeeState']").change(function(){
- $("[name='employeeDepartureDate']").val("");
- var departureDate = $("[name='employeeState']:checked").val();
- if(departureDate == "0"){
- $("#isDeparture").show();
- }else{
- $("#isDeparture").hide();
- }
- })
- })
- </script>
- </body>
- </html>
|