<div ms-controller="labourcontract">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <!--leftNav-->
                <td width="198" height="450" valign="top" id="tdleft">
                    <div id="left">
                        <div id="left" ms-widget="leftMenu"></div>
                    </div>
                    <!--End leftNav-->
                </td>
                <td width="10">&nbsp;</td>
                <td valign="top" bgcolor="#FFFFFF" height="1" style="vertical-align: top; width: 198px;">
                    <table cellpadding="0" cellspacing="0" height="100%" class="bordergrag top10 bottom10">
                        <tr>
                            <td style="vertical-align: top;">
                                <div class="boxTitlenoneb">
                                    <h2><a href="javascript:void(0)" ms-click="expanCategory" style="color: #016b96; float: right; margin-right: 5px; font-size: 12px; font-weight: normal;">- 收起</a>
                                        组织架构
                                    </h2>
                                    <ul id="organizationTree" ms-widget="groupTree,groupsTreeid,groupTreeOpts" class="ztree" style="width: 198px; overflow: auto;"></ul>
                                    <br>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top" style="width: 10px;">&nbsp;
                </td>
                <td valign="top" id="right">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable" id="seacrhTable" style="margin-top: 10px;">
                        <tbody>
                            <tr>
                                <td width="440" class="searchico">
                                    <div class="input-append" style="margin-bottom: 0px;">
                                        <input type="text" class="span4" placeholder="请输入员工姓名快速检索" ms-duplex="keyword" ms-enter="doSearch">
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="doSearch">搜索</button>
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clear">显示全部</button>
                                    </div>
                                </td>
                                <td class="fgray">
                                    <span style="float: left;">历史搜索：</span>
                                    <div class="hotlist">
                                        <span class="bindSearchHistory" ms-each-item="history">
                                            <a href="javascript:void(0)" ms-value="item" ms-click="historyClick">{{item}}&nbsp;&nbsp;</a>
                                        </span>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="seacrhField" class="seacrhField">
                        <tbody>
                            <tr class="quickword">
                                <td colspan="2" width="50%">
                                    <span>合同类型</span>
                                    <div style="display: inline;">
                                        <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="" key="category">不限</a>
                                        <a href="javascript:void(0)" ms-repeat-item="categoryData" ms-live-click="itemClick" ms-value="item.Id" key="category">{{item.Data}}</a>
                                    </div>
                                </td>
                                <td colspan="2" width="50%">
                                    <span>合同状态</span>
                                    <div style="display: inline;">
                                        <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="" key="state">不限</a>
                                        <a href="javascript:void(0)" ms-click="itemClick" value="0" key="state">有效</a>
                                        <a href="javascript:void(0)" ms-click="itemClick" value="1" key="state">终止</a>
                                        <a href="javascript:void(0)" ms-click="itemClick" value="2" key="state">过期</a>
                                    </div>
                                </td>
                            </tr>
                            <tr class="quickword">
                                <td colspan="2" width="50%">
                                    <span>签约时间</span>
                                    <div style="display: inline;">
                                        <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="" key="signtime">不限</a>
                                        <a href="javascript:void(0)" ms-repeat-item="signtimeData" ms-live-click="itemClick" ms-value="item.Id" key="signtime">{{item.Data}}</a>
                                    </div>
                                </td>
                                <td colspan="2" width="50%">
                                    <span>到期时间</span>
                                    <div style="display: inline;">
                                        <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="" key="endtime">不限</a>
                                        <a href="javascript:void(0)" ms-repeat-item="endtimeData" ms-live-click="itemClick" ms-value="item.Id" key="endtime">{{item.Data}}</a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" class="seabox"><span class="first">筛选条件：</span>
                                    <div style="display: inline;">
                                        <span class="searchItem" ms-if="showItem.category!=''">{{showItem.categoryname}}<i><a href="javascript:void(0)" val="category" ms-click="remove"></a></i></span>
                                        <span class="searchItem" ms-if="showItem.state!=''">{{showItem.statename}}<i><a href="javascript:void(0)" val="state" ms-click="remove"></a></i></span>
                                        <span class="searchItem" ms-if="showItem.signtime!=''">{{showItem.signtimename}}<i><a href="javascript:void(0)" val="signtime" ms-click="remove"></a></i></span>
                                        <span class="searchItem" ms-if="showItem.endtime!=''">{{showItem.endtimename}}<i><a href="javascript:void(0)" val="endtime" ms-click="remove"></a></i></span>

                                    </div>
                                    <span class="last" ms-if="showItem.category!='' || showItem.state!='' || showItem.signtime!='' || showItem.endtime!=''"><a href="javascript:void(0)" ms-click="clearAllItem">清除全部</a></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList">
                        <thead>
                            <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0);">
                                <td colspan="11">
                                    <a ms-if="ADD" href="javascript:void(0)" class="doadd" ms-click="doadd">新增</a>
                                    <a ms-if="DELETE" href="javascript:void(0)" class="doalldel" ms-click="doalldel">批量删除</a>
                                </td>
                            </tr>
                            <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                                <td width="2%" align="center">
                                    <input type="checkbox" class="checkAll">
                                </td>
                                <td width="5%" align="center">合同编号
                                </td>
                                <td width="8%" align="center">合同名称
                                </td>
                                <td width="5%" align="center">合同类型
                                </td>

                                <td width="5%" align="center">姓名
                                </td>
                                <td width="5%" align="center">部门
                                </td>
                                <td width="5%" align="center">签约时间
                                </td>
                                <td width="10%" align="center">合同起止时间
                                </td>
                                <td width="5%" align="center">录入人
                                </td>
                                <td width="5%" align="center">录入时间
                                </td>
                                <td width="10%" align="center">操作
                                </td>
                            </tr>
                        </thead>
                        <tbody ms-each-item="labourcontractList">
                            <tr align="center" ms-hover='hover'>
                                <td>
                                    <input type="checkbox" name="checkbox" ms-value="item.Id">
                                </td>
                                <td><a href="javascript:void(0)" ms-click="doview" ms-value="item.Id">{{item.No}}</a>
                                </td>
                                <td align="left"><a href="javascript:void(0)" ms-click="doview" ms-value="item.Id">{{item.Title}}</a>
                                </td>
                                <td>{{item.CategoryDisplay}}
                                </td>

                                <td>
                                    <a href='javascript:void(0);' ms-click="viewHr(item.EmployeeId)">{{item.EmployeeDisplay}}</a>
                                </td>
                                <td>{{item.GroupDisplay}}
                                </td>

                                <td>{{item.SigningTime | truncate(10,'')}}
                                </td>
                                <td>{{item.StartDay | truncate(10,'')}}
                            ~
                            {{item.EndDay | truncate(10,'')}}
                                </td>
                                <td>
                                    <a href="javascript:void(0)" ms-value="item.AddBy.Id" ms-widget='userCard' ms-data-userid="item.AddBy.Id">{{item.AddBy.FullName}}</a>
                                </td>
                                <td>{{item.AddTime | truncate(10,'')}}
                                </td>
                                <td>
                                    <a href="javascript:void(0)" class="doview" ms-click="doview" ms-value="item.Id" title="查看"></a>
                                    <a ms-if="item.EDIT" href="javascript:void(0)" class="doedit" ms-click="doedit" ms-value="item.Id" title="编辑"></a>
                                    <a ms-if="!item.EDIT" href="javascript:void(0)" class="noedit" title="编辑"></a>
                                    <a ms-if="item.DELETE" href="javascript:void(0)" class="dodel" ms-click="dodel" ms-attr-index="$index" ms-value="item.Id" title="删除"></a>
                                    <a ms-if="!item.DELETE" href="javascript:void(0)" class="nodel" title="删除"></a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr style="background-color: rgba(0, 0, 0, 0);">
                                <td colspan="11" ms-widget='paging,upaing,labourcontractpaing'></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>

    <!---新增 and 编辑--->
    <noscript type="text/avalon" id="formTemplate">
        <table cellspacing="0" cellpadding="0" width="100%" border="0" class="formTable">
            <tbody>
                <tr ms-visible="!haskey">
                    <td height="25" width="80" align="right">员工姓名：
                    </td>
                    <td height="25" width="300" align="left">
                        <input type="hidden" ms-duplex="entity.EmployeeId" />
                        <input type="text" ms-duplex="entity.EmployeeDisplay" readonly="readonly" />
                        <button ms-click="selectEmy()" type="button" class="myfbt"><i class="iadduser"></i></button>
                        <span class="must">*</span>
                    </td>
                    <td width="80" align="right">部&nbsp;&nbsp;&nbsp;&nbsp;门 ：
                    </td>
                    <td width="300">
                        <input type="text" ms-duplex="entity.GroupDisplay" readonly="readonly" />
                    </td>
                </tr>
                <tr ms-visible="!haskey">
                    <td height="25" align="right">身份证号 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <input type="text" ms-duplex="entity.IDNumber" />
                    </td>
                </tr>
                <tr>
                    <td height="25" width="80" align="right">合同类型 ：
                    </td>
                    <td height="25" width="300" align="left">
                        <select ms-duplex="entity.CategoryId" ms-each-item="categoryData">
                            <option ms-value="item.Id">{{item.Data}}</option>
                        </select>
                    </td>
                    <td height="25" width="80" align="right">合同状态 ：
                    </td>
                    <td height="25" width="300" align="left">
                        <select ms-duplex="entity.State">
                            <option value="0">有效</option>
                            <option value="1">终止</option>
                            <option value="2">过期</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">期限类型 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <label>
                            <input type="radio" ms-duplex-text="entity.DayType" value="0" />固定期限</label>
                        <label>
                            <input type="radio" ms-duplex-text="entity.DayType" value="1" />无固定期阴</label>
                    </td>
                    <td height="25" align="right">合同期限 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <input type="text" ms-duplex="entity.StartDay" ms-widget="date,startdateId,startdateOpts" readonly="readonly" style="width: 109px;" />至
                <span ms-if="entity.DayType!=1">
                    <input type="text" ms-duplex="entity.EndDay" ms-widget="date,enddayeId,enddayOpts" readonly="readonly" style="width: 109px;" /></span>
                        <input ms-if="entity.DayType==1" type="text" ms-duplex="entity.EndDay" readonly="readonly" style="width: 109px;" />
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同编号 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <input ms-duplex="entity.No" type="text" style="width: 206px;">
                        <span class="must">*</span>
                    </td>
                    <td height="25" align="right">签约时间 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <input type="text" ms-duplex="entity.SigningTime" ms-widget="date,signingId,signingOpts" readonly="readonly" style="width: 109px;" />
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同名称 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <input ms-duplex="entity.Title" type="text" style="width: 206px;"><span class="must">*</span>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同内容 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <textarea id="txtremark"></textarea>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">附&nbsp;&nbsp;&nbsp;&nbsp;件 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3" id="bindFilesView">
                        <input type="text" ms-duplex="entity.Attachment" readonly="readonly" />
                        <button type="button" class="myfbt" ms-click="uploadFiles"><i class="customer"></i></button>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">录入人 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <input ms-duplex="entity.AddBy.FullName" type="text" readonly="readonly" style="width: 100px;">
                    </td>
                    <td height="25" align="right">录入时间 ：
                    </td>
                    <td height="25" width="*" align="left">
                        <input ms-duplex="entity.AddTime" type="text" readonly="readonly" style="width: 100px;">
                    </td>
                </tr>
            </tbody>
        </table>
    </noscript>

    <!--查看-->
    <noscript type="text/avalon" id="viewTemplate">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablecInfo" id="info">
            <tbody>
                <tr>
                    <td height="25" width="80" align="right">姓&nbsp;&nbsp;&nbsp;&nbsp;名 ：
                    </td>
                    <td height="25" width="300" align="left">{{entity.EmployeeDisplay}}
                    </td>
                    <td width="80" align="right">部&nbsp;&nbsp;&nbsp;&nbsp;门 ：
                    </td>
                    <td width="300">{{entity.GroupDisplay}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">身份证号 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.IDNumber}} 
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同类型 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.CategoryDisplay}}  
                    </td>
                    <td height="25" align="right">合同状态 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.StateDisplay}} 
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">期限类型 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.DayType?'无固定期阴':'固定期限'}} 
                    </td>
                    <td height="25" align="right">合同期限 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.StartDay|truncate(10,'')}}至{{entity.EndDay|truncate(10,'')}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同编号 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.No}}
                    </td>
                    <td height="25" align="right">签约时间 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.SigningTime}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同名称 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.Title}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">合同内容 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.Remark}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">附&nbsp;&nbsp;&nbsp;&nbsp;件 ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3" id="Td1">
                        <a ms-if="entity.Attachment" ms-href="entity.Attachment">下载</a>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">录入人 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.AddBy.FullName}}
                    </td>
                    <td height="25" align="right">录入时间 ：
                    </td>
                    <td height="25" width="*" align="left">{{entity.AddTime}}
                    </td>
                </tr>
            </tbody>

        </table>
    </noscript>

</div>
