<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="orderassign.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.workordermanage.workorder.orderassign" %>

<!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 runat="server">
    <title>待指派</title>
    <link href="../../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../scripts/ui/json2.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/core/base.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../scripts/function.js"></script>
    <script src="../../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
    <link href="../../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
    <link href="../../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerMenu.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerTab.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerDrag.js" type="text/javascript"></script>
    <script src="../../scripts/ui/js/plugins/ligerRadioList.js" type="text/javascript"></script>
    <script src="../../scripts/CustomersData.js" type="text/javascript"></script>
    <link href="../../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
    <link href="../../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
    <link href="../../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="../../images/style.css" rel="stylesheet" type="text/css" />
     <script src="../../scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        var gridlist;
        var checked = "";
        var checkRows;
        $(function () {
            LoadList(" ");
        });
        function Confirm(optid) {
            parent.$.ligerDialog.confirm('确定要结单吗?', function (yes) {
                if (yes) {
                    __doPostBack('runSavebtn' + optid, '');
                    return true;
                }
            });
            return false;
        }
        function LoadList(id) {
            gridlist = $("#divDataList").ligerGrid({
                height: 120,
                checkbox: false,
                single: true,
                columns: [
                { display: 'ID', name: '_f_userid', align: 'left', width: 1, hide: true },
                { display: '指派人员', name: '_f_username', width: 120 }
                ], url: '../../sysmanage/ajax/UserAjaxList.ashx?action=getAssignUserList' + '&id=' + id, pageSize: 4, rownumbers: true, usePager: false,
                onSuccess: function (data, grid) {
                },
                onSelectRow: function (rowdata, rowid, rowobj) {
                    checked = rowdata._f_userid;

                }
            });
            gridlist.changePage('first');
            $("#pageloading").hide();
        }

//        function _isChecked(rowdata) {
//            alert(document.getElementById("hfSQDX").value);
//            if (document.getElementById("hfSQDX").value != "") {
//                var str = new Array();
//                var strdata = document.getElementById("hfSQDX").value + ",";
//                str = strdata.split(',');
//                alert(rowdata._f_userid);
//                alert(str[0]);
//                if (rowdata._f_userid == str[0]) {
//                    return true;
//                } else {
//                    return false;
//                }
//            }
//            return false;
//         }

        function Add() {
            parent.OpenWindowShow("selectfinishuser.aspx", '用户信息', 600, 400);
        }
        function SetValue(id) {
            if (document.getElementById("hfSQDX").value != "") {
                if (id != "") {
                    document.getElementById("hfSQDX").value = document.getElementById("hfSQDX").value + "," + id;
                }
            }
            else {
                document.getElementById("hfSQDX").value = id;
            }
            LoadList(document.getElementById("hfSQDX").value);
         }
        //客户端验证事件
         function checkUserDataAddOther() {
             var userCode = "";
             var userName = "";
             checkRows = gridlist.getData();
             if (checkRows == '') {
                 window.parent.$.ligerDialog.success('请选择要指派的人员!');
                 return false;
             }
             for (var i = 0; i < checkRows.length; i++) {
                 var row = checkRows[i];
                 if (userCode != "") {
                     userCode += "," + row._f_userid;
                     userName += "," + row._f_username;
                 }
                 else {
                     userCode = row._f_userid;
                     userName = row._f_username;
                 }
             }
             document.getElementById("hfSQDX").value = userCode;
             document.getElementById("hfSQDXName").value = userName;

             if (document.getElementById("hfSQDX").value.indexOf(",") > 0) {
                 //多个处理人，需要指定主负责人
                 if (checked != "") {
                     document.getElementById("hfChecked").value = checked;
                 }
                 else {
                     parent.$.ligerDialog.success('多人处理需要选择主负责人！双击人员名字！流转领导只能选择一人！');
                     return false;
                  }
             }
             else {
             //一个人处理，不需要指定主负责人
                 document.getElementById("hfChecked").value = document.getElementById("hfSQDX").value;
             }
         }
     </script>

</head>
<body>
    <form id="form1" runat="server">
      <div region="north" border="false" split="flase" style="height: 0px;">
                  <!--授权对象eptIdlist-->
         <asp:HiddenField ID="hfSQDX" runat="server" />
          <!--授权对象人名列表-->
           <asp:HiddenField ID="hfSQDXName" runat="server" />
           <asp:HiddenField ID="txtF_INSTANCEID" runat="server" />
           <asp:HiddenField ID="hfChecked" runat="server" />
           <asp:HiddenField ID="txtF_WORKORDERSTATEID" runat="server" />
    </div>
<div region="center" border="false" split="flase">
        <div class="easyui-panel" fit="true" border="true" title="工单处理" iconcls="icon-edit">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border: #A0A2AF 1px dotted;
                        background-color: #E0ECFF;">
                        当前状态
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-top: #A0A2AF 1px dotted;
                        border-right: #A0A2AF 1px dotted;">
                        &nbsp;<span id="F_Name" runat="server" style="color: Red;">未知</span>
                    </td>
                </tr>
                <tr>
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        工单类型
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        &nbsp;<span id="F_TypeName" runat="server" style="color: Red;">未知</span>
                    </td>
                </tr>
                <tr style="display:none;">
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        建单人员
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        &nbsp;<span id="F_UserAccountName" runat="server" style="color: Red;">未知</span>
                    </td>
                </tr>
                <tr style="display:none;">
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        处理人员<asp:HiddenField ID="txtOpterId" runat="server" />
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        &nbsp;<span id="F_USERNAME" runat="server" style="color: blue;">未知</span>
                    </td>
                </tr>
                 <tr>
                    <td width="65px" height="120" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        <div>指派对象</div><div style="float:right;"><a class="tools_btn" href="#" onclick="Add();">
                <span><b class="add">添加</b></span>
            </a></div>
                    </td>
                    <td valign="top" style="padding-left: 0px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                    
                        <div id="divDataList">
                               </div>
                    </td>
                </tr>
                  <tr>
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        预计工时
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        &nbsp;<asp:TextBox ID="F_ESTIMATED" runat="server" CssClass="txtInput normal" TextMode="MultiLine" 
                        ></asp:TextBox><br />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="工时是带一位小数点的数字"
                         ControlToValidate="F_ESTIMATED" ValidationExpression="^[0-9]+(.[0-9]{1})?$"  ></asp:RegularExpressionValidator>
                    </td>
                </tr>
                  <tr style="display:none;">
                    <td width="65px" height="30" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        形成知识
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        <asp:RadioButton ID="RadioButton1" runat="server" Text="是"  GroupName="a"/>
                        <asp:RadioButton ID="RadioButton2" runat="server" Text="否" Checked="true" GroupName="a"/>
                    </td>
                </tr>
                 <tr>
                    <td width="65px" height="120" align="right" style="padding-right: 8px; border-bottom: #A0A2AF 1px dotted;
                        border-left: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted; background-color: #E0ECFF;">
                        指派描述
                    </td>
                    <td style="padding-left: 8px; border-bottom: #A0A2AF 1px dotted; border-right: #A0A2AF 1px dotted;">
                        &nbsp;<asp:TextBox ID="F_CONTENT" runat="server" CssClass="txtInput normal" TextMode="MultiLine"
                                Style="width:120px; height:100px;" ></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td id="tdbtn" runat="server" colspan="2" align="center" valign="middle" height="30">
                    </td>
                </tr>
            </table>
        </div>
    </div>
        <div region="south" border="false" split="false" style="height: 0px;">
    </div>
    <div region="east" border="false" split="flase" style="width: 0px;">
    </div>
    <div region="west" border="false" split="flase" style="width: 0px;">
    </div>
    </form>
</body>
</html>
