<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="workmanager.aspx.cs" Inherits="Us.Web.admin.work.workmanager" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8,chrome=1" />
    <title>评分工作管理</title>

    <link href="../style/default/style.css" rel="stylesheet" type="text/css" />

    <asp:Literal ID="litregscript" runat="server" Text=""></asp:Literal>
    <%=ImportScriptStr %>

    <script type="text/javascript" src="/admin/js/select2/js/select2.min.js"></script>
    <link href="/admin/js/select2/css/select2.css" rel="stylesheet" />
    <script language="javascript" type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor= K.create('#txtEvalInfo');
        });
    </script>

<%--    <script language="javascript" type="text/javascript">
        $(function () {
            var d = $('select').select2();
        });
    </script>--%>
    <script language="javascript" type="text/javascript">
        $(function () {

            //var d = $('select').select2();
            $("#drpEvalID").on("change", function () {
                var s = $(this).children('option:selected').attr("data-evalid");
                var ss = s.split("#");
                $("#txtEvalue").val(ss[0]);


                //var s2 = $(this).children('option:selected').text();
                //$("#txtWorkName").val(s2);

                //var s1 = $(this).children('option:selected').attr("data-evalinfo");
                //$("#txtEvalInfo").val(s1);
                //KindEditor.html('#txtEvalInfo', s1);

                //var d = $('select').select2();
            });

            $("#drpEvalID").change();
        });

        //被评分人选择
        function opJsTreeUser(txt, txtValue) {
            var para = "/admin/basic/usertreeselectbjgj.aspx?isbp=1&para=1&list=" + $("#" + txtValue).val() + "&PostID=<% =LoginUserInfo.sPostID %>&DeptID=<% =LoginUserInfo.sDeptID %>";
            CareffArtOpen4(para, '人员选择', 300, 650, function (path) {
                //alert(path);
                if (path == null) { return false; }
                var strs = path.split("#")
                var m = $id(txt)
                m.value = strs[1];
                var m1 = $id(txtValue)
                m1.value = strs[0];

                $("#txtPFUserID").val("");
                $("#txtPFUserName").val("");
            });
        }
        //评分人选择
        function opJsTreeUserD(txt, txtValue) {

            var cuserid = $("#txtPUserID").val();
            if (cuserid == "")
            {
                alert("请选择一个被评分人后才能选择评分！");
                return;
            }
            var para = "/admin/basic/usertreeselectbjgj.aspx?isbp=2&RoleID=1001&para=1&list=" + $("#" + txtValue).val() + "&PostID=<% =LoginUserInfo.sPostID %>&DeptID=<% =LoginUserInfo.sDeptID %>&cuserid=" + cuserid;
            CareffArtOpen4(para, '人员选择', 300, 650, function (path) {
                //alert(path);
                if (path == null) { return false; }
                var strs = path.split("#")
                var m = $id(txt)
                m.value = strs[1];
                var m1 = $id(txtValue)
                m1.value = strs[0];
            });
        }
        var LoginUserID = '<%=LoginUserInfo.sUserID%>';
        function jscheckAll() {
            editor.sync();
            var EvalInfo = $("#txtEvalInfo").val();
            //alert(EvalInfo);
            if (EvalInfo == "")
            {
                art.dialog.alert('对不起，事件描述必须填写！');
                return false;
            }


            var sValue = $("#drpWorkState").val();
            //alert(sValue);

            var UserID = $("#txtPUserID").val() + ",";
            var RUserID = $("#txtPFUserID").val() + ",";//评分人


            if (UserID.indexOf(RUserID) >= 0) {
                art.dialog.alert('对不起，被评分人里面不能包含评分人！');
                return false;

            }
            if (RUserID.indexOf(UserID) >= 0) {
                art.dialog.alert('对不起，评分人里面不能包含被评分人！');
                return false;

            }
            //if (!(UserID == (LoginUserID + ",") || RUserID == (LoginUserID + ",")))
            //{
            //    art.dialog.alert('对不起，评分人或者被评分人里面必须包含您自己！');
            //    return false;
            //}

            if (UserID == LoginUserID + ",") {
                art.dialog.alert('对不起，被评分人不能是自己！');
                return false;
            }

            if (sValue == "2") {
                //return window.confirm("当您提交工作任务状态为[已经发布]状态，您将无法修改，是否要继续吗？");
                var info = "";
                info = "当评分工作状态为[已发布]状态，其他人可以看到评分工作，是否要继续吗？";

                if (art.dialog.data("retdata") == 1) {
                    art.dialog.data("retdata", 0);//重置
                    return true;
                }
                art.dialog.confirm(info, function () {
                    art.dialog.data("retdata", 1);
                    document.getElementById("btnSubmit").click();
                });

                return false;
            }
            return true;
        }
    </script>
</head>
<body onload="win_onLoad();">
    <form id="form1" runat="server">

        <div id="tbMain">
            <div class="divTbg">
                <div class="divTbgL">
                </div>
                <div class="divTbgInfo">
                    <div class="divTbgTitle">
                        评分工作管理
                    </div>
                </div>
            </div>
            <div class="divTbgF">
            </div>
            <div class="divTNavBG" id="topURL">
                <ul id="topURLul">
                    <li class="divURLed" id="div1">
                        <div>
                            <img src="../style/default/images/mini_icons_046.gif" width="10" height="10" />
                            基本信息
                        </div>
                    </li>
                </ul>
            </div>
            <div id="mypanel">
                <div class="divInfoContext">
                    <div class="divInfo">
                        <div class="divInfoblack">
                            <div class="divInfoTopList">
                                <div class="listLeft">
                                    <div class="navtitle">
                                        评分工作管理
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="divInfo">
                        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="tablist" id="mainlist">
                            <tr class="tablisttr">

                                <td class="tablisttitle">考核事件<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:TextBox ID="txtWorkName" runat="server" ToolTip="考核事件" Text="" CssClass="1" placeholder="考核事件必须填写"></asp:TextBox>
                                </td>
                                <td class="tablisttitle">时间段<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:DropDownList runat="server" ID="drpDateID" ToolTip="时间段" CssClass="chosen-select"></asp:DropDownList>
                                </td>
                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">考核项<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:DropDownList runat="server" ID="drpBITypeID" ToolTip="考核项" CssClass="1 chosen-select" AutoPostBack="True" OnSelectedIndexChanged="drpBITypeID_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td class="tablisttitle">考核分类<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:DropDownList runat="server" ID="drpSITypeID" ToolTip="考核分类" CssClass="1 chosen-select" AutoPostBack="True" OnSelectedIndexChanged="drpSITypeID_SelectedIndexChanged">
                                        <asp:ListItem Text="请选择" Value=""></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">考核标准<span class="fStar">*</span></td>
                                <td class="tabmanagertr" colspan="3">
                                    <asp:DropDownList runat="server" ID="drpEvalID" ToolTip="考核标准" CssClass="1 chosen-select" Width="98%">
                                    </asp:DropDownList>
                                </td>

                            </tr>
                            <tr>

                                <td class="tablisttitle">评分分值<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:TextBox ID="txtEvalue" runat="server" ToolTip="评分分值" Text="" CssClass="1"></asp:TextBox>
                                </td>
                                <td class="tablisttitle"></td>
                                <td class="tabmanagertr">
                                   
                                </td>
                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">评分状态<span class="fStar">*</span></td>
                                <td class="tabmanagertr">
                                    <asp:DropDownList runat="server" ID="drpWorkState" ToolTip="评分状态" CssClass="1 chosen-select">
                                        <asp:ListItem Value="WorkState" Text="codeno"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td class="tablisttitle">发布人员</td>
                                <td class="tabmanagertr">
                                    <asp:TextBox ID="txtFUserName" runat="server" ToolTip="发布人员名称" Text="" CssClass="1"></asp:TextBox>
                                    <div style="display: none;">
                                        <asp:TextBox ID="txtFUserID" runat="server" ToolTip="发布人员编号" Text="" CssClass="1"></asp:TextBox></div>

                                </td>
                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">事件描述<span class="fStar">*</span></td>
                                <td class="tabmanagertr" colspan="3">
                                    <asp:TextBox ID="txtEvalInfo" runat="server" ToolTip="事件描述"  Text="" Width="100%" TextMode="MultiLine" Height="200px"></asp:TextBox>
                                </td>

                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">评分附件</td>
                                <td class="tabmanagertr" colspan="3">
                                    <asp:TextBox ID="txtEvalAddr" runat="server" ToolTip="评分附件" Text="" Width="80%"></asp:TextBox>
                                    <a href="#" onclick="SkyOpen('txtEvalAddr');">[选择]</a><a href="#" onclick="SkyView('txtEvalAddr');">[查看]</a><a href="#" onclick="SkyDelete('txtEvalAddr');">[清空]</a>
                                </td>

                            </tr>

                            <tr class="tablisttr">
                                <td class="tablisttitle">被评分人<span class="fStar">*</span></td>
                                <td class="tabmanagertr" colspan="3">
                                    <asp:TextBox ID="txtPUserName" runat="server" ToolTip="被评分人名称" Text="" CssClass="1" Width="80%" placeholder="被评分人只能选择一个，而且不能是自己！"></asp:TextBox>
                                    <div style="display: none;">
                                        <asp:TextBox ID="txtPUserID" runat="server" ToolTip="被评分人编号" Text="" CssClass="1"></asp:TextBox></div>
                                    <a runat="server" id="lnkGo" href="javascript:opJsTreeUser('txtPUserName','txtPUserID');">[选择]</a>
                                </td>

                            </tr>
                            <tr class="tablisttr">
                                <td class="tablisttitle">评分人<span class="fStar">*</span></td>
                                <td class="tabmanagertr" colspan="3">
                                    <asp:TextBox ID="txtPFUserName" runat="server" ToolTip="评分人名称" Text="" CssClass="1" Width="80%" placeholder="评分人只能选择一个，请先选择被评分人，系统可以自动筛选出可以评价他的人，您在进行选择！"></asp:TextBox>
                                    <div style="display: none">
                                        <asp:TextBox ID="txtPFUserID" runat="server" ToolTip="评分人编号" Text="" CssClass="1"></asp:TextBox></div>
                                    <a href="javascript:opJsTreeUserD('txtPFUserName','txtPFUserID');">[选择]</a>
                                </td>

                            </tr>
                        </table>




                        <div class="divSave">
                            <asp:Button ID="btnSubmit" runat="server" Text="保存(S)"
                                CssClass="SkyButtonFocus" OnClick="btnSubmit_Click" />
                            <asp:Button ID="btnExit" runat="server" Text="取消(C)" CssClass="SkyButtonFocus"
                                OnClick="btnSubmit_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </form>
</body>
</html>
