<div ms-controller="Integral">
    <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" ms-widget="leftMenu"></div>
                    <!--End leftNav-->
                </td>
                <td valign="top" id="right">
                    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhTable top10" style="background: none;">
                        <tbody>
                            <tr>
                                <td width="460" class="searchico">
                                    <div class="input-append" style="margin-bottom: 0px;">
                                        <input id="keyInput" type="text" class="span4" ms-duplex="keyword" placeholder="请输入员工姓名快速检索" ms-keyup="toEnter">
                                        <button class="add-on ibtsearch" type="button" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="search">搜索</button>
                                        <button class="add-on ibtsearch clearall" type="button" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clearQuery">显示全部</button>
                                    </div>
                                </td>
                                <td class="fgray">{{lang.SearchHistory}}
                                   <span class="bindSearchHistory" ms-repeat-h='queryHistory'>
                                       <a href="javascript:void(0)" ms-click='addQuery(h.name,h.val,h.label)' ms-title='h.label'>{{h.label|truncate(20)}}</a>
                                   </span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhField">
                        <tbody>

                            <tr class="quickword">
                                <td colspan="2"><span>{{queryData.dateTimes.label}}</span>
                                    <div ms-each-r='queryData.dateTimes.items'>
                                        <a href="javascript:void(0)" ms-click='addQuery("dateTimes",r.val)' ms-class-1="selected:r.curr" ms-html='r.label'></a>
                                    </div>
                                    <div ms-visible="queryData.dateTimes.val=='2'">
                                        <input type="text" style="width: 80px; height: 15px; margin-left: 10px;" ms-duplex="queryData.begindate.val" readonly="readonly" ms-widget="date,begindateid,begindateopts" id="txtbegindate" />
                                        <label style="margin-left: -15px;">至</label>
                                        <input type="text" style="width: 80px; height: 15px;" readonly="readonly" ms-duplex="queryData.enddate.val" ms-widget="date,enddateid,enddateopts" id="txtenddate" />

                                    </div>
                                </td>
                                <td colspan="2"><span>{{queryData.score.label}}</span>
                                    <div ms-each-r='queryData.score.items'>
                                        <a href="javascript:void(0)" ms-click='addQuery("score",r.val)' ms-class-1="selected:r.curr" ms-html='r.label'></a>
                                    </div>
                                </td>
                            </tr>
                            <tr class="quickword">
                                <td colspan="2"><span>{{queryData.state.label}}</span>
                                    <div ms-each-r='queryData.state.items'>
                                        <a href="javascript:void(0)" ms-click='addQuery("state",r.val)' ms-class-1="selected:r.curr" ms-html='r.label'></a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="seabox">
                                    <span class="first" ms-html='lang.CurrSearchCondition'></span>
                                    <div ms-repeat="queryData" style="display: inline; float: left;">
                                        <span class="searchItem" ms-if-loop='$val.valLabel'>{{$val.valLabel}}
                                        <i><a href="javascript:void(0)" ms-click='removeQuery($key)'></a></i>
                                        </span>
                                    </div>
                                    <span class="last" ms-visible='hasQuery' ms-click='clearQuery'><a href="javascript:void(0)" ms-html='lang.ClearAll'></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="9">
                                    <a ms-if="ADD" href="javascript:void(0)" class="doadd" ms-click="doadd">新增</a>
                                </td>
                            </tr>
                            <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                                <!-- <td width="2%" rowspan='2' align="center">
                                    <input type="checkbox" class="checkAll">
                                </td>-->
                                <td width="6%" align="center"  ms-visible="action!='Archive'">员工姓名
                                </td>
                                <td width="6%" align="center" >所属部门
                                </td>
                                <td width="6%" align="center">积分</td>
                                <td width="20%" align="center">备注</td>

                                <td width="8%" align="center">操作人
                                </td>
                                <td width="5%" align="center">操作时间
                                </td>
                                <td width="5%" align="center">操作
                                </td>
                            </tr>
                        </thead>
                        <tbody ms-each-item="IntergralList">
                            <tr align="center" ms-hover='hover'>
                                <!-- <td>
                                    <input type="checkbox" name="checkbox" ms-value="item.Id">
                                </td>-->
                                <td  ms-visible="action!='Archive'" align="left"><a href='javascript:void(0);' ms-click="viewHr(item.EmployeeId)">{{item.Name}}</a>
                                </td>
                                <td >{{item.GroupName}}
                                </td>
                                <td><span ms-if="item.IntegralType=='+'" style="color: green;">{{item.IntegralType}}{{item.IntegralNumber}}</span>
                                    <span ms-if="item.IntegralType=='-'" style="color: red;">{{item.IntegralType}}{{item.IntegralNumber}}</span>
                                </td>
                                <td align="left"><a href="javascript:void(0)" ms-click="doview" ms-value="item.Id">{{item.Remark|truncate(30,"…")}}</a></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}}
                                </td>
                                <td>
                                    <a href="javascript:void(0)" class="doview" ms-click="doview" ms-value="item.Id" ms-title="查看"></a>
                                    <!--     <a ms-if="item.EDIT" href="javascript:void(0)" class="doedit" ms-click="doedit" ms-value="item.Id" ms-title="编辑"></a>
                                    <a ms-if="!item.EDIT" href="javascript:void(0)" class="noedit" ms-title="编辑"></a>
                                    <a ms-if="item.DELETE" href="javascript:void(0)" class="dodel" ms-click="dodel" ms-attr-index="$index" ms-value="item.Id" ms-title="删除"></a>
                                    <a ms-if="!item.DELETE" href="javascript:void(0)" class="nodel" ms-title="删除"></a>-->
                                </td>
                            </tr>
                        </tbody>
                        <tr ms-if="IntergralList.length!=0">
                            <td align="center">总计</td>
                            <td ms-visible="action!='Archive'"></td>
                            <td align="center">
                                <span ms-if="sumIntegral>0" style="color: green;">{{sumIntegral}}</span>
                                <span ms-if="sumIntegral<0" style="color: red;">{{sumIntegral}}</span>
                                <span ms-if="sumIntegral==0">{{sumIntegral}}</span>
                            </td>
                            <td colspan="4"></td>
                        </tr>
                        <tr ms-if="IntergralList.length==0">
                            <td colspan="9" style="text-align: center;">暂无数据

                            </td>
                        </tr>
                        <tfoot>
                            <tr style="background-color: rgba(0, 0, 0, 0);">
                                <td colspan="9" ms-widget='paging,upaing,Integralpaing'></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <!---新增 and 编辑--->
    <noscript type="text/avalon" id="fTemplate">
        <table cellspacing="0" cellpadding="0" width="100%" border="0" class="formTable">
            <tbody>
                <tr ms-visible="!haskey">
                    <td height="25" width="70" align="right">员工姓名 ：
                    </td>
                    <td height="25" width="250" align="left">
                        <input type="hidden" ms-duplex="entity.EmployeeId" />
                        <input type="text" ms-duplex="entity.Name" readonly="readonly" style="width: 155px;" />
                        <button type="button" class="myfbt" ms-click="selectEmy()"><i class="iadduser"></i></button>
                        <span class="must">*</span>
                    </td>
                    <td width="70" align="right">所属部门 ：
                    </td>
                    <td>
                        <input type="hidden" ms-duplex="entity.GroupId" />
                        <input type="text" ms-duplex="entity.GroupName" readonly="readonly" style="width: 155px;" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="5"></td>
                </tr>
                <tr>
                    <td height="25" align="right">事项描述 ：
                    </td>
                    <td colspan="3">
                        <textarea style="width: 475px; height: 50px;" ms-duplex="entity.Remark"></textarea>
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">积分 ：
                    </td>
                    <td height="25" width="*" colspan="3" align="left">
                        <div class="input-append">
                            <select style="width: 70px; height: 28px;" ms-duplex="entity.IntegralType">
                                <option ms-repeat="options" ms-value="$key">{{$val}}</option>
                            </select>
                            <input type="text" style="width: 60px;" ms-duplex="entity.IntegralNumber"><span class="add-on">分</span>
                        </div>
                    </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: 155px;">
                    </td>

                    <td height="25" colspan="2" rowspan="2" align="right"></td>
                </tr>
                <tr>
                    <td height="25" align="right">录入时间：
                    </td>
                    <td height="25" width="*" align="left">
                        <input ms-duplex="entity.AddTime" type="text" readonly="readonly" style="width: 155px;">
                    </td>
                </tr>
            </tbody>
        </table>
    </noscript>

    <!--查看-->
    <noscript type="text/avalon" id="viewTemplate">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablecInfo bottom10" id="info">
            <tbody>
                <tr>
                    <td style="width: 80px; height: 25px;" align="right">员工姓名 ：
                    </td>
                    <td style="width: 300px; height: 25px;" align="left">{{entity.Name}}
                    </td>
                    <td style="width: 80px; height: 25px;" align="right">所属部门 ：
                    </td>
                    <td style="width: 300px; height: 25px;">{{entity.GroupName}}
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right">积分 ：
                    </td>
                    <td height="25" colspan="3" width="*" align="left">
                        <span ms-if="entity.IntegralNumber && entity.IntegralType=='+'" style="color: green;">加分({{entity.IntegralType}}{{entity.IntegralNumber}})分</span>
                        <span ms-if="entity.IntegralNumber && entity.IntegralType=='-'" style="color: red;">扣分({{entity.IntegralType}}{{entity.IntegralNumber}})分</span>
                    </td>

                </tr>
                <tr height="25">
                    <td height="25" align="right">备注 ：
                    </td>
                    <td valign="top" colspan="3" style="height: 100px;">{{entity.Remark}} 
                    </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>

