<div ms-controller="Settings">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="nobgmian" ms-if="index==''">
        <tbody>
        <tr>
            <td valign="top">
                <div class="boxTitle">
                    <h2>基本资料</h2>
                    <div style="padding-left: 20px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable">
                            <tbody>
                            <tr>
                                <td class="fgray" style="min-height: 300px; vertical-align: middle; padding: 50px;">
                                    <ul id="lstPic">
                                        <li ms-click="change" ms-hover="cproject" ms-class-cproject="index=='cproject'" data-index="cproject" class="cproject"><a href="javascript:void(0);">&nbsp;</a></li>
                                        <li ms-click="change" ms-hover="cex" ms-class-cex="index=='exchangerate'" data-index="exchangerate" class="exchangerate"><a href="javascript:void(0);">&nbsp;</a></li>
                                        <li ms-click="change" ms-hover="cas" ms-class-cas="index=='assetes'" data-index="assetes" class="assetes"><a href="javascript:void(0);">&nbsp;</a></li>
                                    </ul>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
        </tbody>
    </table>

    <!--收支项目-->
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="nobgmian" ms-if="index=='cproject'">
         <tbody>
         <tr> 
             <td valign="top"> 
             <div class="boxTitle">
                 <h2>项目检索</h2>
                 <div style="padding-left:20px;">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable" id="seacrhTable">
                    <tbody>
                    <tr>
                        <td width="440" class="searchico">  
                            <div class="input-append" style="margin-bottom: 0px;">
                                <input type="text"  class="span4 bindDefault" placeholder="输入项目名称快速检索" ms-duplex="projectKeyword" ms-enter="projectSearch">
                                <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="projectSearch">搜索</button>
                                <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="projectClear">显示全部</button>
                            </div>
                        </td>
                        <td class="fgray">
                            <a href="javascript:void(0);" ms-click="backlist" class="btn_back" style="margin-top:-2px;margin-right:20px;"></a>
                        </td>
                    </tr>
                    </tbody>
                 </table>
                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhField">
                    <tbody>
                    <tr class="bindQuick">
                        <td width="50%">
                            <span>收支类型</span>
                            <div id="TypeItems" style="display: inline;">
                                <a  val=""  na="" ms-class-selected="projectShowItem.type===''" ms-click="projectItem" href="javascript:void(0)">不限</a>
                                <a  val="0" na="收入" ms-class-selected="projectShowItem.type===0" ms-click="projectItem"  href="javascript:void(0)">收入</a>
                                <a  val="1" na="支出" ms-class-selected="projectShowItem.type===1" ms-click="projectItem"  href="javascript:void(0)">支出</a>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="seabox">
                            <span class="first">筛选条件：</span>
                            <div id="bindSearchKey" style="display: inline;">
                                <span class="searchItem" ms-if="projectShowItem.keywordName!=''">{{projectShowItem.keywordName}}<i><a href="javascript:void(0)" val="keyword" ms-click="projectRemove"></a></i></span>
                                <span class="searchItem" ms-if="projectShowItem.typeName!=''">{{projectShowItem.typeName}}<i><a href="javascript:void(0)" val="type" ms-click="projectRemove"></a></i></span>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                 </table>
                 </div>
             </div>

             <!--<div class="boxTitlenob" style="margin-top:10px">
                <h2>收支项目列表</h2>
             </div>-->
             <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList">
                <thead>
                   <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0); ">
                        <td colspan="6" bgcolor="#FFFFFF"> 
                            <a href="javascript:void(0)" class="doadd" ms-click="projectAdd(0)" ms-if="PROJECTADD" title="新增收支项目">新增</a>
                            <a href="javascript:void(0)" class="doalldel" ms-click="projectAllDel" ms-if="PROJECTDELETE" title="批量删除收支项目">批量删除</a>
                            <a href="javascript:void(0)" class="dohide" ms-click="projectHide(true)" ms-if="PROJECTDELETE" title="批量隐藏收支项目">批量隐藏</a>
                            <a href="javascript:void(0)" class="doshow" ms-click="projectHide(false)" ms-if="PROJECTDELETE" title="批量显示收支项目">批量显示</a>
                        </td>
                    </tr>
                    <tr class="head" style="background-color: rgba(0, 0, 0, 0); ">
                        <td width="50px" align="center"><input type="checkbox" class="checkAll"></td> 
                        <td align="center">项目名称</td>
                        <td align="center">类型</td>
                        <td align="center">状态</td>
                        <td width="40%" align="center">备注</td> 
                        <td width="100px" align="center">操作</td>
                    </tr>
                </thead>
                <tbody>
                    <tr ms-repeat-item="projectList" style="background-color: rgb(255, 255, 255); " ms-class-typein="item.Type==0 && item.Id >1" ms-class-typeout="item.Type==1 && item.Id >1">
                        <td align="center" style="height:41px;"><input type="checkbox" name="checkbox" ms-value="{{item.Id}}"></td> 
                        <td align="left">
                             <span ms-attr-class="tablelevel {{item.Parents?'tablelevel'+item.Parents.split(',').length :'tablelevel0'}}"  stu="1"  ms-attr-ty="item.Type"  ms-attr-id="item.Id" ms-click="doNode" ></span>{{item.Name}}
                        </td> 
                        <td align="center">{{item.Type==0?'收入':'支出'}}</td>
                        <td align="center">
                            <a ms-if="item.Id>1" href="javascript:void(0)" title="点击切换" ms-click="changeProjectHide(item,true)" ms-class="statebtn {{item.Hide?'disabled':'enabled'}}">{{item.Hide?"隐藏":"显示"}}</a>
                        </td>
                        <td align="center">{{item.Remark}}</td> 
                        <td ms-if="item.Id != 0 && item.Id !=1" align="right" style="padding-right:10px;">
                            <!--<a style="background-position:-500px -510px" ms-if="item.ADD && item.Parents && item.Parents.split(',').length <2" title="新增子项" href="javascript:void(0)" ms-attr-val="item.Id" ms-attr-ty="item.Type" class="doadd" ms-click="projectAdd(item.Type,item.Id,item.Name)" ms-attr-pname="item.Name"></a>-->
                            <a href="javascript:void(0);" ms-if="item.EDIT" title="修改" class="doedit" ms-attr-id="item.Id" ms-click="projectEdit"></a>
                            <a href="javascript:void(0);" ms-if="!item.EDIT" title="非常抱歉，您没有编辑的权限"  class="noedit"></a>
                            <a href="javascript:void(0);" ms-if="item.DELETE" title="删除" class="dodel" ms-attr-val="item.Id" ms-attr-index="$index" ms-click="projectDel"></a>
                            <a href="javascript:void(0);" ms-if="!item.DELETE" title="非常抱歉，您没有删除的权限" class="nodelete"></a>
                        </td>
                         <td  ms-if="item.Id == 0 || item.Id == 1"  align="left" style="padding-left:20px;">
                            <a style="background-position:-500px -510px" ms-if="item.ADD" title="新增子项" href="javascript:void(0)"  ms-attr-val="item.Id"  ms-attr-ty="item.Type" class="doadd" ms-click="projectAdd(item.Type,item.Id,item.Name)" ms-attr-pname="item.Name"></a>
                             
                        </td>
                    </tr>
                </tbody>
               <!-- <tfoot>
                    <tr>
                        <td colspan="5" ms-widget='paging,upaing,projectpaing'></td>
                    </tr>
                </tfoot>-->
            </table>
             </td>
        </tr>
        </tbody>
    </table>

    <!--资产账户-->
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="nobgmian" ms-if="index=='assetes'">
        <tr>
            <td valign="top">
                <div class="boxTitle">
                 <h2>账户检索</h2>
                 <div style="padding-left:20px;">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable" id="seacrhTable">
                    <tbody>
                    <tr>
                        <td width="440" class="searchico">  
                            <div class="input-append" style="margin-bottom: 0px;">
                                <input type="text"  class="span4 bindDefault" placeholder="输入账户名称快速检索" ms-duplex="assetsKeyword" ms-enter="assetsSearch">
                                <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="assetsSearch">搜索</button>
                                <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="assetsClear">显示全部</button>
                            </div>
                        </td>
                        <td class="fgray">
                            <a href="javascript:void(0);" ms-click="backlist" class="btn_back" style="margin-top:-2px;margin-right:20px;"></a>
                        </td>
                    </tr>
                    </tbody>
                 </table>
                 </div>
                </div>
                <div>
                    <ul class="tabWarp" style="margin-top: 10px;">
                        <li ms-repeat-r="assetslistTabs" ms-class-1="{{assetslisttab===r.val?'hover':'normal'}}" ms-click="assetslisttabChange(r.val)">{{r.label}}</li>
                    </ul>
                </div>
                <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="tableList">
                    <thead>
                       <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0); ">
                            <td colspan="9" bgcolor="#FFFFFF">
                                <a href="javascript:void(0)" class="doadd" ms-click="assetsAdd" ms-if="ASSETSADD">新增</a>
                                <a href="javascript:void(0)" class="doalldel" ms-click="assetsAllDel" ms-if="ASSETSDELETE">批量删除</a>
                            </td>
                        </tr>
                        <tr class="head" style="background-color: rgba(0, 0, 0, 0); ">
                            <td width="50px" align="center"><input type="checkbox" class="checkAll"></td>
                            <td align="center">账户名称</td>
                            <td align="right">账户余额</td>
                            <td align="center">币种</td>
                            <td align="center">类型</td>
                            <td align="center">备注</td>
                            <td align="center">启用时间</td>
                             <td align="center">显示隐藏</td>
                            <td width="100px" align="center">操作</td>
                        </tr>
                    </thead>
                    <tbody ms-each-item="assetsList">
                        <tr style="background-color: rgb(255, 255, 255); ">
                            <td align="center"><input type="checkbox" name="checkbox" ms-value="item.Id"></td>
                            <td align="left">{{item.AccountName}}</td> 
                            <td align="right">{{item.Balance}}</td>
                            <td align="center">{{item.CurrencyId|GetCurrency}}</td>
                            <td align="center">{{item.AccountTypeId|GetType}}</td>
                            <td align="left" style="padding-left:20px;">{{item.Remark}}</td>
                            <td align="center">{{item.BeginData|truncate(10,'')}}</td>
                            <td align="center">
                                <a href="javascript:void(0)" title="点击切换" ms-click="changeAssetsHide(item,true)" ms-class="statebtn {{item.Hide?'disabled':'enabled'}}">{{item.Hide?"隐藏":"显示"}}</a>
                            </td>
                            <td align="center">
                                <a href="javascript:void(0);" class="icon_do cw_sz" ms-if="ACCOUNTINGVIEW" title="查看收支记账" ms-click="gotourl('/FinancialAffairs/Accounting',false,{assetsid:item.Id})"></a>
                                <a href="javascript:void(0);" ms-if="item.ASSETSEDIT" title="修改" class="doedit"  ms-click="assetsEdit(item.Id)"></a>
                                <a href="javascript:void(0);" ms-if="!item.ASSETSEDIT" title="非常抱歉，您没有编辑的权限"  class="noedit"></a>
                                <a href="javascript:void(0);" ms-if="item.ASSETSDELETE" title="删除" class="dodel" ms-attr-val="item.Id" ms-attr-index="$index" ms-click="assetsDel"></a>
                                <a href="javascript:void(0);" ms-if="!item.ASSETSDELETE" title="非常抱歉，您没有删除的权限" class="nodelete"></a>
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="9" ms-widget='paging,assetsupaing,assetspaing'></td>
                        </tr>
                    </tfoot>
                </table>
            </td>
        </tr>
    </table>

    <!--设置汇率-->
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="nobgmian" ms-visible="index=='exchangerate'">
        <tbody>
            <tr> 
                <td valign="top">
                    <div class="boxTitlenob" style="margin-top:10px">
                        <h2>币别列表<a ms-click="backlist"  href="javascript:void(0)" style="background: url(/Content/Themes/Base/Images/ico/crm_ico.png) no-repeat -636px -2456px;width: 79px;height: 27px; margin:4px 10px 0 0;  display : block;float: right;"></a></h2>
                    </div>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="tableList">
                        <thead>
                           <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0); ">
                             <td colspan="5" bgcolor="#FFFFFF">
                                <a href="javascript:void(0);" class="doadd" title="新增账户" ms-click="currencyAdd" ms-if="EXCHANGEADD">新增</a>
                                <a href="javascript:void(0);"class="doalldel" ms-click="currencyAllDel" ms-if="EXCHANGEDELETE">批量删除</a>
                             </td>
                           </tr>
                           <tr class="head" style="background-color: rgba(0, 0, 0, 0); ">
                                <td width="3%" align="center"><input type="checkbox" class="checkAll"></td>
                                <td width="20%" align="center">币别</td>
                                <td width="10%" align="center">对人民币汇率</td> 
                                <td width="10%" align="center">排序</td>
                                <td width="6%" align="center">操作</td>
                           </tr>
                        </thead>
                        <tbody ms-each-item="currencyList"> 
                            <tr style="background-color: rgb(255, 255, 255); ">
                                <td align="center"><input type="checkbox" name="checkbox" ms-value="item.Id"></td>
                                <td align="center">{{item.Data}}</td>
                                <td align="center">{{item.Rate}}</td>
                                <td align="center">{{item.Sort}}</td>
                                <td align="center">
                                    <a href="javascript:void(0);" ms-if="item.EXCHANGEEDIT" title="修改" class="doedit" ms-attr-index="$index" ms-click="currencyEdit"></a>
                                    <a href="javascript:void(0);" ms-if="!item.EXCHANGEEDIT" title="非常抱歉，您没有编辑的权限"  class="noedit"></a>
                                    <a href="javascript:void(0);" ms-if="item.EXCHANGEDELETE" title="删除" class="dodel" ms-attr-val="item.Id" ms-attr-index="$index" ms-click="currencyDel"></a>
                                    <a href="javascript:void(0);" ms-if="!item.EXCHANGEDELETE" title="非常抱歉，您没有删除的权限" class="nodelete"></a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr style="background-color: rgba(0, 0, 0, 0); ">
                                <td colspan="5" ms-widget='paging,currencyupaing,currencypaing'></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
</div>

<noscript type="text/avalon" id="projectTemplate">
    <table width="400" cellspacing="1" cellpadding="0" border="0" class="commontable">
        <tr>
            <td>收支类型：</td>
            <td>
                <label style="padding-right:20px;"><input type="radio" name="type" value="0" ms-duplex-text="project.Type" /> 收入</label>
                <label><input type="radio" name="type" value="1" ms-duplex-text="project.Type" /> 支出</label>
            </td>
        </tr>
         <tr>
            <td>上级项目：</td>
            <td>
                <select ms-duplex-text="project.Parent">
                    <option ms-repeat-item="projectPList" ms-text="item.Id==0 || item.Id==1?'无':item.Name" ms-value="item.Id"></option>
                </select>
            </td>
        </tr>
        <tr>
            <td>项目名称：</td>
            <td><input type="text" ms-duplex="project.Name" /></td>
        </tr>
       
        <tr>
            <td>备注：</td>
            <td><input type="text" ms-duplex="project.Remark" /></td>
        </tr>
    </table>
</noscript>

<noscript type="text/avalon" id="assetsTemplate">
    <table width="100%" cellspacing="0" cellpadding="0" border="0" class="commontable">
        <tbody>
            <tr>
                <th style="width:100px">账户名称：</th>
                <td style="width:250px;"><input type="text" ms-duplex="assets.AccountName" /></td>
                <th style="width:100px">币种：</th>
                <td>
                    <select ms-duplex="assets.CurrencyId" ms-each-item="currencyList">
                        <option ms-value="item.Id">{{item.Data}}</option>
                    </select>
                    <span class="helptip"> <a href="#" data-toggle="tooltip" data-placement="top" title="在财务基本资料币别/汇率中设置">&nbsp;&nbsp; </a></span>
                </td>
            </tr>
            <tr>
                <th>账户类型：</th>
                <td colspan="3">
                    <label ms-repeat-item="assetsCategorySimple" style="padding-right:10px;">
                        <input type="radio" ms-duplex-text="assets.AccountTypeId" ms-value="item.value" name="cateogry" /> 
                        {{item.key}}<span ms-if="item.helpTip" ms-attr-title="item.helpTip" class="helptip">&nbsp;</span> </label>
                </td>
            </tr>
            <tr>
                <th>开户银行：</th>
                <td><input type="text" ms-duplex="assets.Bank" /> </td>
                <th>卡号：</th>
                <td><input type="text" ms-duplex="assets.BankAccount" /></td>
            </tr>
            <tr>
                <th>网银网址：</th>
                <td><input type="text" ms-duplex="assets.BankLoginUrl" /> </td>
                <th>登陆账号：</th>
                <td><input type="text" ms-duplex="assets.UserName" /></td>
            </tr>
            <tr>
                <th>账户余额：</th>
                <td><input type="text" ms-duplex="assets.Balance"  ms-disabled="assets.Id>0? 'disabled':''"/></td>
                <th>排序：</th>
                <td><input type="text" ms-duplex="assets.Sort" /></td>
            </tr>
            <tr>
                <th>备注：</th>
                <td colspan="3"><textarea rows="4" ms-duplex="assets.Remark" style="width:625px;"></textarea></td>
            </tr>
            <tr>
                <th>显示隐藏：</th>
                <td colspan="3">
                    <a href="javascript:void(0)" title="点击切换" ms-click="changeAssetsHide(assets)" ms-class="statebtn {{assets.Hide?'disabled':'enabled'}}">{{assets.Hide?"隐藏":"显示"}}</a>
                </td>
            </tr>
        </tbody>
    </table>
</noscript>

<noscript id="currencyTemplate">
    <table width="700" cellspacing="0" cellpadding="0" border="0" class="commontable">
        <tbody>
            <tr>
                <th>币别：</th>
                <td><input type="text" ms-duplex="currency.Data" /></td>
                <th>对人民币汇率：</th>
                <td><input type="text" ms-duplex="currency.Rate" /></td>
            </tr>
            <tr>
                <th>排序：</th>
                <td colspan="3"><input type="text" ms-duplex="currency.Sort" /></td>
            </tr>
        </tbody>
    </table>
</noscript>