<div ms-controller="trainplan">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <td width="198" height="450" valign="top" id="tdleft">
                    <div id="left" ms-widget="leftMenu"></div>
                </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">
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="search">搜索</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="1" cellpadding="0" class="tableList bottom10" id="tableList">
                        <thead>
                            <tr class="dobtn">
                                <td colspan="8">
                                    <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">
                                <td width="2%" align="center">
                                    <input type="checkbox" class="checkAll">
                                </td>
                                <td width="5%" align="center">主题
                                </td>
                                <td width="5%" align="center">培训时间
                                </td>
                                <td width="8%" align="center">地点
                                </td>
                                <td width="5%" align="center">讲师
                                </td>
                                <td width="6%" align="center">课时
                                </td>
                                <td width="9%" align="center">目标
                                </td>
                                <td width="6%" align="center">操作
                                </td>
                            </tr>
                        </thead>
                        <tbody ms-each-item="trainplanList">
                            <tr align="center" ms-hover='hover'>
                                <td>
                                    <input type="checkbox" name="checkbox" ms-value="item.Id">
                                </td>
                                <td align="left"><a href="javascript:void(0)" ms-value="item.Id" ms-click="doview">{{item.Subject}}</a>
                                </td>
                                <td>{{item.Time | truncate(10,'')}}
                                </td>
                                <td>{{item.Place}}
                                </td>
                                <td>{{item.Teach}}
                                </td>
                                <td>{{item.ClassHour}}
                                </td>
                                <td align="left">{{item.Target}}
                                </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>
                                <td colspan="8" ms-widget='paging,upaing,trainplanpaing'></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>

    <!---add & edit-->
    <noscript id="formTemplate">
        <ul class="tabWarp">
            <li ms-class-hover="tab=='tab1'" ms-class-normal="tab!='tab1'" val="tab1" ms-click="tabChange">计划信息</li>
            <li ms-class-hover="tab=='tab2'" ms-class-normal="tab!='tab2'" val="tab2" ms-click="tabChange">培训名单</li>
        </ul>
        <div class="tabContent" ms-visible="tab=='tab1'">
            <table cellspacing="0" cellpadding="0" width="100%" border="0" class="formTable">
                <tbody>
                    <tr>
                        <td height="25" align="right">讲师 ：
                        </td>
                        <td height="25" align="left">
                            <input ms-duplex="entity.Teach" type="text">
                        </td>
                        <td height="25" align="right">课时 ：
                        </td>
                        <td height="25" align="left">
                            <div class="input-append">
                                <input ms-duplex="entity.ClassHour" type="text" style="width: 50px;">
                                <span class="add-on">小时</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="90" align="right">培训地点 ：
                        </td>
                        <td height="25" width="350" align="left">
                            <input ms-duplex="entity.Place" type="text">
                        </td>
                        <td height="25" width="120" align="right" style="color: red;">培训时间 ：
                        </td>
                        <td height="25" width="250" align="left">
                            <input ms-duplex="entity.Time" type="text" ms-widget="date,timeId,timeOpts" style="width: 89px;" readonly="readonly">
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训对象 ：
                        </td>
                        <td align="left">
                            <label ms-repeat-item="objectData">
                                <input type="radio" ms-duplex-text="entity.Object" ms-value="item.Id" />{{item.Data}}&nbsp;&nbsp;</label>
                        </td>
                        <td height="25" align="right">培训类别 ：
                        </td>
                        <td height="25" align="left">
                            <label ms-repeat-item="categoryData">
                                <input type="radio" ms-duplex-text="entity.CategoryId" ms-value="item.Id" />{{item.Data}}&nbsp;&nbsp;</label>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="color: red;">培训主题 ：
                        </td>
                        <td colspan="3" height="25" align="left">
                            <input type="text" ms-duplex="entity.Subject" style="width: 206px;"><span class="must">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训目标 ：
                        </td>
                        <td colspan="3" height="25" align="left">
                            <textarea ms-duplex="entity.Target" rows="2" cols="20" style="height: 40px; width: 95%;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="color: red;">培训内容 ：
                        </td>
                        <td height="25" align="left" colspan="3">
                            <textarea id="txtContent" rows="2" cols="20" style="height: 80px; width: 95%;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训科目 ：
                        </td>
                        <td height="25" align="left">
                            <select ms-duplex="entity.ClassId">
                                <option ms-repeat-item="classData" ms-value="item.Id">{{item.Data}}</option>
                            </select>
                        </td>
                        <td height="25" align="right">培训层面 ：
                        </td>
                        <td height="25" align="left">
                            <select ms-duplex="entity.LayId">
                                <option ms-repeat-item="layData" ms-value="item.Id">{{item.Data}}</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训方式 ：
                        </td>
                        <td height="25" align="left">
                            <select ms-duplex="entity.MethodId">
                                <option ms-repeat-item="methodData" ms-value="item.Id">{{item.Data}}</option>
                            </select>
                        </td>
                        <td height="25" align="right">考核方式 ：
                        </td>
                        <td height="25" align="left">
                            <select ms-duplex="entity.CheckMethodId" ms-each-item="checkMethodData">
                                <option ms-value="item.Id">{{item.Data}}</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">费用预算 ：
                        </td>
                        <td height="25" align="left">
                            <div class="input-append">
                                <input ms-duplex="entity.Cost" type="text" style="width: 80px;">
                                <span class="add-on">元</span>
                            </div>
                        </td>
                        <td height="25" align="right">培训运作评估时间 ：
                        </td>
                        <td height="25" align="left">
                            <input ms-duplex="entity.EmployeeEvaluateDayAfter" type="text" ms-widget="date,pinguId,pinguOpts" class="span17" readonly="readonly">
                            <span class="helptip"><a href="#" data-toggle="tooltip" data-placement="top" title="实到培训人员应在该时间内提交本次培训评估报告。">&nbsp;&nbsp; </a></span>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">课件附件 ：
                        </td>
                        <td height="25" align="left">
                            <input type="text" ms-duplex="entity.Attachment" readonly="readonly" />
                            <button type="button" class="myfbt" ms-click="uploadFiles"><i class="customer"></i></button>
                        </td>
                        <td height="25" align="right">培训转化评估时间 ：
                        </td>
                        <td height="25" align="left">
                            <input ms-duplex="entity.HREvaluateDayAfter" type="text" ms-widget="date,trunpinguId,trunpinguOpts" class="span17" readonly="readonly">
                            <span class="helptip"><a href="#" data-toggle="tooltip" data-placement="top" title="主管需在该时间内提交本次培训每位员工学习效果评估报告。">&nbsp;&nbsp; </a></span>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="tabContent" ms-visible="tab=='tab2'">
            <table width="810" style="margin: 0 auto;" cellspacing="0" cellpadding="0" border="0" class="formTable">
                <tr>
                    <td height="25" align="right" width="110" height="300">拟培训人员名单 ：
                    </td>
                    <td height="25">
                        <input type="hidden" ms-duplex="entity.PlanEmployeeIds" />
                        <input type="text" ms-duplex="entity.PlanEmployeeDisplay" readonly="readonly" style="width: 500px;" />
                        <button type="button" class="myfbt" ms-click="selectPlanemp()"><i class="iadduser"></i></button>
                        <span class="helptip"><a href="#" data-toggle="tooltip" data-placement="top" title="计划参加培训人员名单。">&nbsp;&nbsp; </a></span>
                    </td>
                </tr>
            </table>
            <table width="790" border="0" cellspacing="1" cellpadding="0" class="tableList" style="margin: 0 auto;">
                <tr class="minhead" align="center" style="background-color: rgb(255, 255, 255);">
                    <td width="3%" bgcolor="#FFFFFF">序号</td>
                    <td width="20%" bgcolor="#FFFFFF">姓名</td>
                    <td width="15%" bgcolor="#FFFFFF">所在部门</td>
                    <td width="21%" align="center" bgcolor="#FFFFFF">职位</td>
                </tr>
                <tr ms-repeat-item="planempList" style="background-color: rgb(250, 250, 250);">
                    <td align="center" bgcolor="#FFFFFF">{{$index+1}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.FullName}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.GroupId | groupname}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.PositionId | postname}}</td>
                </tr>
            </table>
        </div>
    </noscript>
    <!---view-->
    <noscript id="viewTemplate">
        <ul class="tabWarp">
            <li ms-class-hover="tab=='tab1'" ms-class-normal="tab!='tab1'" val="tab1" ms-click="tabChange">计划信息</li>
            <li ms-class-hover="tab=='tab2'" ms-class-normal="tab!='tab2'" val="tab2" ms-click="tabChange">培训名单</li>
        </ul>
        <div style="width: 900px;" class="tabContent" ms-visible="tab=='tab1'">
            <table width="98%" border="0" cellspacing="1" cellpadding="0" class="tablecInfo bottom10" style="margin: 0 10px;">
                <tbody>
                    <tr>
                        <td height="25" align="right">讲师 ：
                        </td>
                        <td height="25" align="left">{{entity.Teach}}
                        </td>
                        <td height="25" align="right">课时 ：
                        </td>
                        <td height="25" align="left">{{entity.ClassHour}}小时
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="90" align="right">培训地点 ：
                        </td>
                        <td height="25" width="350" align="left">{{entity.Place}}                                </td>
                        <td height="25" width="120" align="right">培训时间 ：
                        </td>
                        <td height="25" width="250" align="left">{{entity.Time}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训对象 ：
                        </td>
                        <td align="left">{{entity.Object}}
                        </td>
                        <td height="25" align="right">培训类别 ：
                        </td>
                        <td height="25" align="left">{{entity.CategoryDisplay}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训主题 ：
                        </td>
                        <td colspan="3" height="25" align="left">{{entity.Subject}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训目标 ：
                        </td>
                        <td colspan="3" height="25" align="left">{{entity.Target}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训内容 ：
                        </td>
                        <td height="25" align="left" colspan="3">{{entity.Content}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训科目 ：
                        </td>
                        <td height="25" align="left">{{entity.ClassDisplay}}
                        </td>
                        <td height="25" align="right">培训层面 ：
                        </td>
                        <td height="25" align="left">{{entity.LayDisplay}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">培训方式 ：
                        </td>
                        <td height="25" align="left">{{entity.MethodDisplay}}
                        </td>
                        <td height="25" align="right">考核方式 ：
                        </td>
                        <td height="25" align="left">{{entity.CheckMethodDisplay}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">费用预算 ：
                        </td>
                        <td height="25" align="left">{{entity.Cost}}
                        </td>
                        <td height="25" align="right">培训运作评估时间 ：
                        </td>
                        <td height="25" align="left">{{entity.EmployeeEvaluateDayAfter}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">课件附件 ：
                        </td>
                        <td height="25" align="left">
                            <a ms-if="entity.Attachment" ms-href="entity.Attachment" target="_blank">下载附件</a>
                            <span ms-if="!entity.Attachment">无</span>
                        </td>
                        <td height="25" align="right">培训转化评估时间 ：
                        </td>
                        <td height="25" align="left">{{entity.HREvaluateDayAfter}}
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right">录入人 ：
                        </td>
                        <td height="25" width="*" align="left">{{entity.PlanningByDisplay}}
                        </td>
                        <td height="25" align="right">录入时间 ：
                        </td>
                        <td height="25" width="*" align="left">{{entity.PlanningTime}}
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div style="width: 900px;" class="tabContent" ms-visible="tab=='tab2'">
            <table width="98%" cellspacing="0" cellpadding="0" border="0" class="formTable" style="margin: 0 10px;">
                <tr>
                    <td height="25" align="right" width="110" height="300">拟培训人员名单 ：
                    </td>
                    <td height="25">
                        <input type="hidden" ms-duplex="entity.PlanEmployeeIds" />
                        <input type="text" ms-duplex="entity.PlanEmployeeDisplay" readonly="readonly" style="width: 500px;" />
                        <span class="helptip"><a href="#" data-toggle="tooltip" data-placement="top" title="计划参加培训人员名单。">&nbsp;&nbsp; </a></span>
                    </td>
                </tr>
            </table>
            <div style="height: 300px; overflow-y: auto;">
                <table width="98%" border="0" cellspacing="1" cellpadding="0" class="tableList" style="margin: 0 10px;">
                    <tr class="dobtn">
                        <td colspan="6">
                            <a href="javascript:void(0)" class="dosave" ms-click="dosavearrive">保存</a>
                        </td>
                    </tr>
                    <tr class="minhead" align="center" style="background-color: rgb(255, 255, 255);">
                        <td width="3%" bgcolor="#FFFFFF">序号</td>
                        <td width="15%" bgcolor="#FFFFFF">姓名</td>
                        <td width="15%" bgcolor="#FFFFFF">所在部门</td>
                        <td width="15%" align="center" bgcolor="#FFFFFF">职位</td>
                        <td width="5%" align="center" bgcolor="#FFFFFF">
                            <input type="checkbox" ms-click="doallarrive" />是否签到</td>
                        <td width="8%" align="center" bgcolor="#FFFFFF">培训记录</td>
                    </tr>
                    <tr ms-repeat-item="planempList" style="background-color: rgb(250, 250, 250);">
                        <td align="center" bgcolor="#FFFFFF">{{$index+1}}</td>
                        <td align="center" bgcolor="#FFFFFF">{{item.FullName}}</td>
                        <td align="center" bgcolor="#FFFFFF">{{item.GroupId | groupname}}</td>
                        <td align="center" bgcolor="#FFFFFF">{{item.PositionId | postname}}</td>
                        <td align="center" bgcolor="#FFFFFF">
                            <input ms-duplex-radio="item.IsArrary" type="checkbox" class="chkarrive" /></td>
                        <td width="8%" align="center" bgcolor="#FFFFFF">
                            <span ms-if="!item.IsArrary">无</span>
                            <input type="hidden" ms-duplex="item.RecordId" />
                            <span ms-if="!item.IsEstimate && item.IsArrary">未填</span>
                            <a ms-if="item.IsEstimate" title="查看评估" ms-href="'#/HR/TrainRecord/'+item.RecordId">查看</a>
                        </td>
                    </tr>
                    <tr>
                        <td height="65" colspan="6" class="fgray" bgcolor="#FFFFFF">
                            <span class="tipico">&nbsp;&nbsp;&nbsp;&nbsp;</span>勾选签到后，请点击保存。签到保存成功后即生成培训记录。
                        </td>
                    </tr>
                </table>

            </div>
        </div>
    </noscript>
</div>
