Commit bcf13e3c authored by 马超's avatar 马超
Browse files

值班管理

parent d92229f0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -14,11 +14,11 @@
      type="text/css">
<div class="page-container">
    <div class="left-tree">
        <button class="btn btn-success" onclick="optMx('add');" style="text-align:center;float:left;">
        <button class="btn btn-success" onclick="optMx('add');" style="text-align:center;float:left;margin-left: 30px;">
            新建</button>
        <button class="btn btn-success" onclick="updateMx();" style="text-align:center;float:left;margin-left: 20px;">
            修改</button>
        <button class="btn btn-success" onclick="delMx();" style="text-align:center;float:right;">
        <%--<button class="btn btn-success" onclick="updateMx();" style="text-align:center;float:left;margin-left: 20px;">
            修改</button>--%>
        <button class="btn btn-success" onclick="delMx();" style="text-align:center;float:left;margin-left: 20px;">
            删除</button>
        <input type="hidden" name="check_mx_id" id="check_mx_id">
        <input type="hidden" name="check_mx_day" id="check_mx_day">
+217 −100
Original line number Diff line number Diff line
@@ -5,95 +5,221 @@
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.Vector" %>
<%
    ConnectionFactory cf = new ConnectionFactory();
    Pub pub = new Pub();
    Connection conn = null;
    Vector v_list = null;
    Vector v_list_day = null;
    String login_id = (String) session.getAttribute("session_login_id");
    if ("".equals(login_id)) {
        System.out.println("当前没有用户信息");
    }
    Vector v_type_list = null;
    String mx_id = pub.trimNull(request.getParameter("mx_id"));
    String Mxday = pub.trimNull(request.getParameter("day"));
    int divCount=30;
    if(!"".equals(Mxday)){
        divCount=Integer.parseInt(Mxday);
    }
    String divWidth=(divCount+2)*140-80+"px";
    String action = pub.trimNull(request.getParameter("action"));
    Hashtable ht = new Hashtable();
    StringBuffer sql = new StringBuffer();
    StringBuffer sql_day = new StringBuffer();
    sql.append("select * from zb_type where mx_id=? order by order_num asc ");
    sql_day.append("select * from zb_mx_day where mx_id=? and zb_type=? order by day asc ");
    StringBuffer group_sql = new StringBuffer();
    int listSize=1;
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        if(!"".equals(mx_id)){
            sql.append("select * from zb_mx where id=?");
            v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{mx_id});
            group_sql.append("select * from zb_type where mx_id=? order by order_num asc");
            v_type_list = cf.doQuery(conn, group_sql.toString(), null, new Object[]{mx_id});
            if(v_type_list!=null && v_type_list.size()>0){
                listSize=v_type_list.size();
            }
        }
        if (v_list!=null&&v_list.size() > 0) {
            ht = (Hashtable) v_list.get(0);
        }
    } catch (Exception e) {
        out.println("查询用户信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }

%>
<div style="border: solid 1px #eee;margin-top: 20px;height:550px;width:1100px;overflow: auto;">
<style>
    .input-three {
        width: 22%
    }
    .input-two {
        width: 32%
    }
    .col-sm-2{
        width:14%;
    }
    .col-sm-3{
        width:19%;
    }
    .btn-red{ background-color:red;border: red}
    .btn-green{ background-color:green;border: green}


</style>
<div class="">
    <form class="form form-horizontal" id="form-admin-add">
        <input type="hidden" value="<%=action%>" name="action" id="action">
        <input type="hidden" value="<%=mx_id%>" name="mx_id" id="mx_id">
        <input type="hidden" id="input_count" name="input_count" value="<%=listSize%>"/>
        <input type="hidden"  name="mx_day" id="mx_day" value="30" >
        <div id="content" class="cl pd-5  bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>模型名字&nbsp;
                </label>
                <div class="formControls col-xs-8 col-sm-10">
                    <input type="text" class="input-text" name="mx_name" id="mx_name" value="<%=pub.trimNull((String)ht.get("name"))%>" >
                </div>
            </div>
            <div class="row cl" id="zb_type_div">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>时间段&nbsp;
                </label>
            </div>

            <%
       for(int i=0;i<v_list.size();i++){
           Hashtable ht = (Hashtable) v_list.get(i);
           String id=pub.trimNull((String)ht.get("id"));
           String zb_type=pub.trimNull((String)ht.get("zb_type"));
           String b_time=pub.trimNull((String)ht.get("b_time"));
           String e_time=pub.trimNull((String)ht.get("e_time"));
                Hashtable ht1 = new Hashtable();
                if(v_type_list != null && v_type_list.size() > 0){
                    for (int i = 0; i < v_type_list.size(); i++) {
                        ht1 = (Hashtable) v_type_list.get(i);
            %>
    <%
        if(i==0){%>
        <div  style="width:<%=divWidth%>;height:40px;float:left;white-space: nowrap;">
            <div style="width:140px;height:40px;float:left;border:0.5px solid #000;">
            <div class="zbType row cl" id="div_<%=pub.trimNull((String)ht.get("id"))%>">
                <input type="hidden" name="zb_type_id_<%=i+1%>" value="<%=pub.trimNull((String)ht1.get("id"))%>">
                <label class="form-label col-xs-4" style="margin-top: 0px;">
                    <input type="text" style="width:30%;" autocomplete="off" class="input-text" value="<%=pub.trimNull((String)ht1.get("zb_type"))%>" placeholder=""  id = "zb_type_<%=i+1%>" name="zb_type_<%=i+1%>" >

                </label>
                <div class="formControls col-xs-6">
                    <input type="text" style="width:25%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("b_time"))%>" placeholder="" id = "b_time_<%=i+1%>" name="b_time_<%=i+1%>" >
                    &nbsp;&nbsp;
                    <input type="text" style="width:25%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("e_time"))%>" placeholder="" id = "e_time_<%=i+1%>" name="e_time_<%=i+1%>" >
                    &nbsp;&nbsp;默认人数
                    <input type="text" style="width:20%;" class="input-text "  value="<%=pub.trimNull((String)ht1.get("ren_num"))%>" placeholder="" id = "ren_num_<%=i+1%>" name="ren_num_<%=i+1%>" >
                </div>
                <%
                for(int n=0;n<30;n++){
                    if(i==0){
                %>
                <a href="javascript:void (0);" onclick="addDiv();" style="font-size: 25px;">+</a>
                <%}else{%>
                <a href="javascript:void (0);" onclick="deleteDiv('<%=pub.trimNull((String)ht.get("id"))%>');" style="font-size: 25px;display:none;">-</a>
                <%}
                %>
            <div style="width:140px;height:40px;line-height:40px;text-align:center;color:#fff;float:left;border:0.5px solid #000;background-color: #00b7ee">
                <%=n+1%>
            </div>
            <% }%>
            <%
                }
            }else{
            %>
            <div class="zbType row cl" id="div_1">
                <label class="form-label col-xs-4" style="margin-top: 0px;">
                    <input type="text" style="width:30%;" autocomplete="off" class="input-text" value="" placeholder=""  id = "zb_type_1" name="zb_type_1" >

                </label>
                <div class="formControls col-xs-6">
                    <input type="text" style="width:25%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "b_time_1" name="b_time_1" >
                    &nbsp;&nbsp;
                    <input type="text" style="width:25%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "e_time_1" name="e_time_1" >
                    &nbsp;&nbsp;默认人数
                    <input type="text" style="width:20%;" class="input-text "  value="" placeholder="" id = "ren_num_1" name="ren_num_1" >
                </div>
    <%}%>

    <div  style="width:<%=divWidth%>;height:160px;float:left;">
        <div style="width:140px;height:160px;float:left;border:0.5px solid #000;text-align: center;line-height: 120px;">
            <p style="height:30px;"> <%=zb_type%></p>
            <p style="height:30px;">(<%=b_time%>-<%=e_time%>)</p>
                <a href="javascript:void (0);" onclick="addDiv();" style="font-size: 25px;">+</a>
            </div>
            <%
            for(int n=0;n<30;n++){
                }
            %>
        <div style="text-align:center;width:140px;height:160px;float:left;border:0.5px solid #000;position: relative">
            <p style="height:10px;display:none;">
        </div>

            </p>
            <button class="btn btn-success" style="display:none;text-align:center;position:absolute; right:0; bottom:0;">
                修改</button>
    </form>
</div>
        <%}%>
<div class="cl mb-10  bk-gray " style="height: 50px;">
    <div class="col-sm-3 pd-10" style="width:100%;text-align: center;">
        <input class="btn btn-primary radius btn-green" type="button" onclick="javascript:saveForm();" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
    </div>
    <%}%>
</div>
<script type="text/javascript">
    function deleteUser(user_id){
      layer.confirm('确认要删除吗?', function (index) {
<script>
    var  count;
    var size='<%=listSize%>';
    if(size==0){
        count=1;
    }else{
        count=parseInt(size);
    }
    function addDiv(){
        var name_count=parseInt($("#input_count").val());
        $("#content").append("<div class=\"zbType row cl\" name=\""+(count+1)+"\" id=\"div_"+(count+1)+"\">\n" +
            "                <label class=\"form-label col-xs-4\" style=\"margin-top: 0px;\">                    " +
            "                   <input type=\"text\" style=\"width:30%;\" autocomplete=\"off\" class=\"input-text\" value=\"\" placeholder=\"\"  id = \"zb_type_"+(name_count+1)+"\" name=\"zb_type_"+(name_count+1)+"\" > :</label>\n" +
            "                <div class=\"formControls col-xs-6\">\n" +
            "                    <input type=\"text\" style=\"width:25%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"b_time_"+(name_count+1)+"\" name=\"b_time_"+(name_count+1)+"\" >\n" +
            "                    &nbsp;至&nbsp;\n" +
            "                    <input type=\"text\" style=\"width:25%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"e_time_"+(name_count+1)+"\" name=\"e_time_"+(name_count+1)+"\" >\n" +
            "                       &nbsp;&nbsp;默认人数\n" +
            "                    <input type=\"text\" style=\"width:20%;\" class=\"input-text \"  value=\"\" placeholder=\"\" id = \"ren_num_"+(name_count+1)+"\" name=\"ren_num_"+(name_count+1)+"\" >" +
            "                 </div>\n" +
            "                  <a href=\"javascript:void (0);\" onclick=\"deleteDiv("+(count+1)+");\" style=\"font-size: 25px;\">-</a>"+
            "            </div>");
        count++;
        //var obj=document.getElementsByClassName("row cl").length;
        var obj=$(".zbType").length;
        $("#input_count").val(obj);
    }
    function deleteDiv(div_id){
        $("#div_"+div_id).remove();
        $('.zbType').each(function(index,element){
            if(index!=0){
                index=index+1;
                //$(this).children(":first").html("号段"+index+":");
                var div_index=$(this).attr("name");
                $("#zb_type_"+div_index).attr("name","zb_type_"+index);
                $("#b_time_"+div_index).attr("name","b_time_"+index);
                $("#e_time_"+div_index).attr("name","e_time_"+index);
            }
        });
        //var obj=document.getElementsByClassName("row cl").length;
        var obj=$(".zbType").length;
        $("#input_count").val(obj);
    }
    function LayerOpen(title, url, w, h) {
        if($("#user_id").val()==''){
            layer.alert("请先保存用户再添加相关人员",{icon:5,title:"提示"});
            return false;
        }
        var abc = layer.open({
            title:title,
            type: 2,
            content: url,
            area: [w, h],
            maxmin: true
        });
        layer.full(abc);
    }
    function saveForm() {
        if($("#mx_name").val()==''){
            layer.alert("模型名称不能为空",{icon:5,title:"提示"});
            return false;
        }
        $.ajax({
            type: "POST",
				url: "./action.jsp?user_id="+user_id+"&action=delete",
            url: "./action.jsp",
            data: $('#form-admin-add').serialize(),
            success: function (msg) {
                if (msg.indexOf("success") >= 0) {
                    var mx_id = msg.substring(msg.indexOf(",")+1,msg.length);
                    layer.msg('操作成功!', {icon: 1, time: 1000},
                        function () {
                            document.getElementById("check_mx_id").value=mx_id;
                            searchModel();
                            openLi(mx_id,7);
                        });
                } else {
                    layer.msg('操作失败', {
@@ -105,21 +231,24 @@
                }
            }
        });
		})
    }
    function optOrder(opt,user_id){
    function deleteUser(user_id,p_user_id){
        layer.confirm('确认要删除吗?', function (index) {
            $.ajax({
            type: "post",
            url: "opt_order.jsp",
            data:{"user_id":user_id,"opt":opt},
            success: function (data) {
                if (data.indexOf("success") >= 0) {
                type: "POST",
                url: "./action.jsp?&p_user_id="+p_user_id+"&user_id="+user_id+"&action=delete",
                success: function (msg) {
                    if (msg.indexOf("success") >= 0) {
                        layer.msg('操作成功!', {icon: 1, time: 1000},
                            function () {
                            searchModel();
                                location.reload();
                                if(rel_user_id!=''){
                                    window.parent.location.reload();
                                }
                                parent.searchModel();
                            });
                    } else {
                    layer.msg('操作失败'+data, {
                        layer.msg('操作失败', {
                            icon: 5,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
@@ -128,18 +257,6 @@
                    }
                }
            });
        });
    }
</script>
 No newline at end of file
<%
    } catch (Exception e) {
        out.println("查询用户信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>
 No newline at end of file
+145 −0
Original line number Diff line number Diff line
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/11
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
    ConnectionFactory cf = new ConnectionFactory();
    Pub pub = new Pub();
    Connection conn = null;
    Vector v_list = null;
    Vector v_list_day = null;
    String login_id = (String) session.getAttribute("session_login_id");
    if ("".equals(login_id)) {
        System.out.println("当前没有用户信息");
    }
    String mx_id = pub.trimNull(request.getParameter("mx_id"));
    String Mxday = pub.trimNull(request.getParameter("day"));
    int divCount=30;
    if(!"".equals(Mxday)){
        divCount=Integer.parseInt(Mxday);
    }
    String divWidth=(divCount+2)*140-80+"px";
    StringBuffer sql = new StringBuffer();
    StringBuffer sql_day = new StringBuffer();
    sql.append("select * from zb_type where mx_id=? order by order_num asc ");
    sql_day.append("select * from zb_mx_day where mx_id=? and zb_type=? order by day asc ");
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{mx_id});
        if (v_list != null && v_list.size()>0) {
        }

%>
<div style="border: solid 1px #eee;margin-top: 20px;height:550px;width:1100px;overflow: auto;">
    <%
       for(int i=0;i<v_list.size();i++){
           Hashtable ht = (Hashtable) v_list.get(i);
           String id=pub.trimNull((String)ht.get("id"));
           String zb_type=pub.trimNull((String)ht.get("zb_type"));
           String b_time=pub.trimNull((String)ht.get("b_time"));
           String e_time=pub.trimNull((String)ht.get("e_time"));
    %>
    <%
        if(i==0){%>
        <div  style="width:<%=divWidth%>;height:40px;float:left;white-space: nowrap;">
            <div style="width:140px;height:40px;float:left;border:0.5px solid #000;">
            </div>
            <%
                for(int n=0;n<30;n++){
            %>
            <div style="width:140px;height:40px;line-height:40px;text-align:center;color:#fff;float:left;border:0.5px solid #000;background-color: #00b7ee">
                <%=n+1%>
            </div>
            <% }%>
         </div>
    <%}%>

    <div  style="width:<%=divWidth%>;height:160px;float:left;">
        <div style="width:140px;height:160px;float:left;border:0.5px solid #000;text-align: center;line-height: 120px;">
            <p style="height:30px;"> <%=zb_type%></p>
            <p style="height:30px;">(<%=b_time%>-<%=e_time%>)</p>
        </div>
        <%
            for(int n=0;n<30;n++){
        %>
        <div style="text-align:center;width:140px;height:160px;float:left;border:0.5px solid #000;position: relative">
            <p style="height:10px;display:none;">

            </p>
            <button class="btn btn-success" style="display:none;text-align:center;position:absolute; right:0; bottom:0;">
                修改</button>
        </div>
        <%}%>
    </div>
    <%}%>
</div>
<script type="text/javascript">
    function deleteUser(user_id){
      layer.confirm('确认要删除吗?', function (index) {
			$.ajax({
				type: "POST",
				url: "./action.jsp?user_id="+user_id+"&action=delete",
				success: function (msg) {
					if (msg.indexOf("success") >= 0) {
						layer.msg('操作成功!', {icon: 1, time: 1000},
							function () {
								searchModel();
							});
					} else {
						layer.msg('操作失败', {
							icon: 5,
							time: 2000 //2秒关闭(如果不配置,默认是3秒)
						}, function () {
							// console.log("********************8")
						});
					}
				}
			});
		})
    }
    function optOrder(opt,user_id){
        $.ajax({
            type: "post",
            url: "opt_order.jsp",
            data:{"user_id":user_id,"opt":opt},
            success: function (data) {
                if (data.indexOf("success") >= 0) {
                    layer.msg('操作成功!', {icon: 1, time: 1000},
                        function () {
                            searchModel();
                        });
                } else {
                    layer.msg('操作失败,'+data, {
                        icon: 5,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        // console.log("********************8")
                    });
                }
            }
        });
    }
</script>
<%
    } catch (Exception e) {
        out.println("查询用户信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>
 No newline at end of file
+299 −0

File added.

Preview size limit exceeded, changes collapsed.

+294 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading