
@{
    ViewData["Title"] = "资产负债表";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
    ViewBag.Nav = new string[] { "报表管理", "资产负债表" };
}


<div class="row">
    <div class="col-sm-12">
        <div class="ibox-content m-b-sm border-bottom">
            <form id="toolbar">
                <div class="form-inline" style="line-height:40px;">
                    <div class="form-group">
                        <select id="timetype" class="form-control" style="width:120px;">
                            <option value="1">按日的方式</option>
                            <option value="2">按周的方式</option>
                            <option value="3">按月的方式</option>
                            <option value="4">按年的方式</option>
                        </select>
                        <label>日期</label>
                        <input id="day" type="text" style="width:120px" value="@DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")" class="form-control">
                        <label>付款主体</label>
                        <select id="sel_paycompany" class="form-control" style="width:200px;">
                            <option value="0">百伦供应链</option>
                            @*<option value="1">广州百伦科技有限公司</option>
                            <option value="2" selected>香港百伦科技有限公司</option>*@
                        </select>
                        <button type="button" class="btn btn-sm btn-primary" onclick="GetData();"><i class="fa fa-search"></i>&nbsp;查询</button>
                        <button type="button" class="btn btn-sm btn-success" onclick="ExportXsl()">导出</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="ibox-content m-b-sm border-bottom">
            <div class="bootstrap-table">
                <div class="fixed-table-container">
                    <table id="roletable" class="table table-hover">
                        <tr>
                            <td style="width:120px;">统计大项</td>
                            <td style="width:160px;">统计项</td>
                            <td style="width:160px;">数值</td>
                            <td id="c0"></td>
                            <td id="c1"></td>
                            <td id="c2"></td>
                            <td id="c3"></td>
                            <td id="c4"></td>
                            <td id="c5"></td>
                            <td id="c6">当前统计值</td>
                            <td>操作</td>
                        </tr>
                        <tr>
                            <td rowspan="33">资产</td>
                            <td rowspan="12">流动资产</td>
                            <td>货币资金</td>
                            <td class="monetary_fund">0</td>
                            <td class="monetary_fund">0</td>
                            <td class="monetary_fund">0</td>
                            <td class="monetary_fund">0</td>
                            <td class="monetary_fund">0</td>
                            <td class="monetary_fund">0</td>
                            <td><input id="monetary_fund" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('monetary_fund');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>交易性金融资金</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td class="fa_trading_finan_asset">0</td>
                            <td><input id="fa_trading_finan_asset" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_trading_finan_asset');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应收票据</td>
                            <td class="fa_bill_receivable">0</td>
                            <td class="fa_bill_receivable">0</td>
                            <td class="fa_bill_receivable">0</td>
                            <td class="fa_bill_receivable">0</td>
                            <td class="fa_bill_receivable">0</td>
                            <td class="fa_bill_receivable">0</td>
                            <td><input id="fa_bill_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_bill_receivable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应收账款</td>
                            <td class="accounts_receivable">0</td>
                            <td class="accounts_receivable">0</td>
                            <td class="accounts_receivable">0</td>
                            <td class="accounts_receivable">0</td>
                            <td class="accounts_receivable">0</td>
                            <td class="accounts_receivable">0</td>
                            <td><input id="accounts_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('accounts_receivable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>预付款项</td>
                            <td class="prepayment">0</td>
                            <td class="prepayment">0</td>
                            <td class="prepayment">0</td>
                            <td class="prepayment">0</td>
                            <td class="prepayment">0</td>
                            <td class="prepayment">0</td>
                            <td><input id="prepayment" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('prepayment');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>应收利息</td>
                            <td class="fa_interest_receivable">0</td>
                            <td class="fa_interest_receivable">0</td>
                            <td class="fa_interest_receivable">0</td>
                            <td class="fa_interest_receivable">0</td>
                            <td class="fa_interest_receivable">0</td>
                            <td class="fa_interest_receivable">0</td>
                            <td><input id="fa_interest_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_interest_receivable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应收股利</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td class="fa_dividends_receivable">0</td>
                            <td><input id="fa_dividends_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_dividends_receivable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他应收款</td>
                            <td class="other_accounts_receivable">0</td>
                            <td class="other_accounts_receivable">0</td>
                            <td class="other_accounts_receivable">0</td>
                            <td class="other_accounts_receivable">0</td>
                            <td class="other_accounts_receivable">0</td>
                            <td class="other_accounts_receivable">0</td>
                            <td><input id="other_accounts_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('other_accounts_receivable');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>存货</td>
                            <td class="inventory_amount">0</td>
                            <td class="inventory_amount">0</td>
                            <td class="inventory_amount">0</td>
                            <td class="inventory_amount">0</td>
                            <td class="inventory_amount">0</td>
                            <td class="inventory_amount">0</td>
                            <td><input id="inventory_amount" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>一年内到期的非流动资产</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td class="fa_oneyear_noncurrent_assets">0</td>
                            <td><input id="fa_oneyear_noncurrent_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_oneyear_noncurrent_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他流动资产</td>
                            <td class="fa_other_assets">0</td>
                            <td class="fa_other_assets">0</td>
                            <td class="fa_other_assets">0</td>
                            <td class="fa_other_assets">0</td>
                            <td class="fa_other_assets">0</td>
                            <td class="fa_other_assets">0</td>
                            <td><input id="fa_other_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fa_other_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>流动资产合计</td>
                            <td class="fa_count">0</td>
                            <td class="fa_count">0</td>
                            <td class="fa_count">0</td>
                            <td class="fa_count">0</td>
                            <td class="fa_count">0</td>
                            <td class="fa_count">0</td>
                            <td><input id="fa_count" class="txtinput" type="number" value="0" disabled  style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('fa_count');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <!-- 流动资产 end -->

                        <tr>
                            <td rowspan="18">非流动资产</td>
                            <td>可供出售金融资产</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td class="nca_avai_for_sale_fassets">0</td>
                            <td><input id="nca_avai_for_sale_fassets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_avai_for_sale_fassets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>持有至到期投资</td>
                            <td class="nca_heldon_investment">0</td>
                            <td class="nca_heldon_investment">0</td>
                            <td class="nca_heldon_investment">0</td>
                            <td class="nca_heldon_investment">0</td>
                            <td class="nca_heldon_investment">0</td>
                            <td class="nca_heldon_investment">0</td>
                            <td><input id="nca_heldon_investment" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_heldon_investment');">更新</a></td>
                        </tr>
                        <tr>
                            <td>长期应收款</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td class="nca_longterm_receivable">0</td>
                            <td><input id="nca_longterm_receivable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_longterm_receivable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>长期股权投资</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td class="nca_longterm_equity_investment">0</td>
                            <td><input id="nca_longterm_equity_investment" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_longterm_equity_investment');">更新</a></td>
                        </tr>
                        <tr>
                            <td>投资性房地产</td>
                            <td class="nca_investment_property">0</td>
                            <td class="nca_investment_property">0</td>
                            <td class="nca_investment_property">0</td>
                            <td class="nca_investment_property">0</td>
                            <td class="nca_investment_property">0</td>
                            <td class="nca_investment_property">0</td>
                            <td><input id="nca_investment_property" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_investment_property');">更新</a></td>
                        </tr>
                        <tr>
                            <td>固定资产</td>
                            <td class="fixed_assets">0</td>
                            <td class="fixed_assets">0</td>
                            <td class="fixed_assets">0</td>
                            <td class="fixed_assets">0</td>
                            <td class="fixed_assets">0</td>
                            <td class="fixed_assets">0</td>
                            <td><input id="fixed_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('fixed_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>在建工程</td>
                            <td class="nca_construction_in_process">0</td>
                            <td class="nca_construction_in_process">0</td>
                            <td class="nca_construction_in_process">0</td>
                            <td class="nca_construction_in_process">0</td>
                            <td class="nca_construction_in_process">0</td>
                            <td class="nca_construction_in_process">0</td>
                            <td><input id="nca_construction_in_process" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_construction_in_process');">更新</a></td>
                        </tr>
                        <tr>
                            <td>工程物资</td>
                            <td class="nca_engineering_material">0</td>
                            <td class="nca_engineering_material">0</td>
                            <td class="nca_engineering_material">0</td>
                            <td class="nca_engineering_material">0</td>
                            <td class="nca_engineering_material">0</td>
                            <td class="nca_engineering_material">0</td>
                            <td><input id="nca_engineering_material" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_engineering_material');">更新</a></td>
                        </tr>
                        <tr>
                            <td>固定资产清理</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td class="nca_disposal_of_fixed_assets">0</td>
                            <td><input id="nca_disposal_of_fixed_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_disposal_of_fixed_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>生产性生物资产</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td class="nca_productive_biological_asset">0</td>
                            <td><input id="nca_productive_biological_asset" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_productive_biological_asset');">更新</a></td>
                        </tr>
                        <tr>
                            <td>油气资产</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td class="nca_oil_and_gas_assets">0</td>
                            <td><input id="nca_oil_and_gas_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_oil_and_gas_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>无形资产</td>
                            <td class="nca_intangible_assets">0</td>
                            <td class="nca_intangible_assets">0</td>
                            <td class="nca_intangible_assets">0</td>
                            <td class="nca_intangible_assets">0</td>
                            <td class="nca_intangible_assets">0</td>
                            <td class="nca_intangible_assets">0</td>
                            <td><input id="nca_intangible_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_intangible_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>开发支出</td>
                            <td class="nca_development_expenditure">0</td>
                            <td class="nca_development_expenditure">0</td>
                            <td class="nca_development_expenditure">0</td>
                            <td class="nca_development_expenditure">0</td>
                            <td class="nca_development_expenditure">0</td>
                            <td class="nca_development_expenditure">0</td>
                            <td><input id="nca_development_expenditure" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_development_expenditure');">更新</a></td>
                        </tr>
                        <tr>
                            <td>商誉</td>
                            <td class="nca_goodwill">0</td>
                            <td class="nca_goodwill">0</td>
                            <td class="nca_goodwill">0</td>
                            <td class="nca_goodwill">0</td>
                            <td class="nca_goodwill">0</td>
                            <td class="nca_goodwill">0</td>
                            <td><input id="nca_goodwill" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_goodwill');">更新</a></td>
                        </tr>
                        <tr>
                            <td>长期待摊费用</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td class="nca_longterm_unamortized_expenses">0</td>
                            <td><input id="nca_longterm_unamortized_expenses" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_longterm_unamortized_expenses');">更新</a></td>
                        </tr>
                        <tr>
                            <td>递延所得税资产</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td class="nca_deferred_tax_assets">0</td>
                            <td><input id="nca_deferred_tax_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_deferred_tax_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他非流动资产</td>
                            <td class="nca_other_assets">0</td>
                            <td class="nca_other_assets">0</td>
                            <td class="nca_other_assets">0</td>
                            <td class="nca_other_assets">0</td>
                            <td class="nca_other_assets">0</td>
                            <td class="nca_other_assets">0</td>
                            <td><input id="nca_other_assets" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('nca_other_assets');">更新</a></td>
                        </tr>
                        <tr>
                            <td>非流动资产合计</td>
                            <td class="nca_count">0</td>
                            <td class="nca_count">0</td>
                            <td class="nca_count">0</td>
                            <td class="nca_count">0</td>
                            <td class="nca_count">0</td>
                            <td class="nca_count">0</td>
                            <td><input id="nca_count" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('nca_count');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>资产总计</td>
                            <td>资产总计</td>
                            <td class="count_assets">0</td>
                            <td class="count_assets">0</td>
                            <td class="count_assets">0</td>
                            <td class="count_assets">0</td>
                            <td class="count_assets">0</td>
                            <td class="count_assets">0</td>
                            <td><input id="count_assets" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('count_assets');">更新</a>*@</td>
                        </tr>
                        <!-- 非流动资产 end -->

                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <!-- 第一大栏 end -->


                        <tr>
                            <td rowspan="33">负债和所有者权益</td>
                            <td rowspan="13">流动负债</td>
                            <td>短期借款</td>
                            <td class="short_term_borrow">0</td>
                            <td class="short_term_borrow">0</td>
                            <td class="short_term_borrow">0</td>
                            <td class="short_term_borrow">0</td>
                            <td class="short_term_borrow">0</td>
                            <td class="short_term_borrow">0</td>
                            <td><input id="short_term_borrow" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('short_term_borrow');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>交易性金融负债</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td class="cl_trading_financ_liabilities">0</td>
                            <td><input id="cl_trading_financ_liabilities" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_trading_financ_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应付票据</td>
                            <td class="cl_notes_payable">0</td>
                            <td class="cl_notes_payable">0</td>
                            <td class="cl_notes_payable">0</td>
                            <td class="cl_notes_payable">0</td>
                            <td class="cl_notes_payable">0</td>
                            <td class="cl_notes_payable">0</td>
                            <td><input id="cl_notes_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_notes_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应付账款</td>
                            <td class="accounts_payable">0</td>
                            <td class="accounts_payable">0</td>
                            <td class="accounts_payable">0</td>
                            <td class="accounts_payable">0</td>
                            <td class="accounts_payable">0</td>
                            <td class="accounts_payable">0</td>
                            <td><input id="accounts_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('accounts_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>预收款项</td>
                            <td class="advance_received">0</td>
                            <td class="advance_received">0</td>
                            <td class="advance_received">0</td>
                            <td class="advance_received">0</td>
                            <td class="advance_received">0</td>
                            <td class="advance_received">0</td>
                            <td><input id="advance_received" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('advance_received');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>应付职工薪酬</td>
                            <td class="payable_remuneration">0</td>
                            <td class="payable_remuneration">0</td>
                            <td class="payable_remuneration">0</td>
                            <td class="payable_remuneration">0</td>
                            <td class="payable_remuneration">0</td>
                            <td class="payable_remuneration">0</td>
                            <td><input id="payable_remuneration" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('payable_remuneration');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应交税费</td>
                            <td class="taxes_payable">0</td>
                            <td class="taxes_payable">0</td>
                            <td class="taxes_payable">0</td>
                            <td class="taxes_payable">0</td>
                            <td class="taxes_payable">0</td>
                            <td class="taxes_payable">0</td>
                            <td><input id="taxes_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('taxes_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应付利息</td>
                            <td class="cl_payable_interest">0</td>
                            <td class="cl_payable_interest">0</td>
                            <td class="cl_payable_interest">0</td>
                            <td class="cl_payable_interest">0</td>
                            <td class="cl_payable_interest">0</td>
                            <td class="cl_payable_interest">0</td>
                            <td><input id="cl_payable_interest" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_payable_interest');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应付股利</td>
                            <td class="cl_dividends_payable">0</td>
                            <td class="cl_dividends_payable">0</td>
                            <td class="cl_dividends_payable">0</td>
                            <td class="cl_dividends_payable">0</td>
                            <td class="cl_dividends_payable">0</td>
                            <td class="cl_dividends_payable">0</td>
                            <td><input id="cl_dividends_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_dividends_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他应付款</td>
                            <td class="other_accounts_payable">0</td>
                            <td class="other_accounts_payable">0</td>
                            <td class="other_accounts_payable">0</td>
                            <td class="other_accounts_payable">0</td>
                            <td class="other_accounts_payable">0</td>
                            <td class="other_accounts_payable">0</td>
                            <td><input id="other_accounts_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('other_accounts_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>一年内到期的非流动负债</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td class="cl_oneyear_noncurrent_liabilities">0</td>
                            <td><input id="cl_oneyear_noncurrent_liabilities" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_oneyear_noncurrent_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他流动负债</td>
                            <td class="cl_other_liabilities">0</td>
                            <td class="cl_other_liabilities">0</td>
                            <td class="cl_other_liabilities">0</td>
                            <td class="cl_other_liabilities">0</td>
                            <td class="cl_other_liabilities">0</td>
                            <td class="cl_other_liabilities">0</td>
                            <td><input id="cl_other_liabilities" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('cl_other_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>流动负债合计</td>
                            <td class="cl_count">0</td>
                            <td class="cl_count">0</td>
                            <td class="cl_count">0</td>
                            <td class="cl_count">0</td>
                            <td class="cl_count">0</td>
                            <td class="cl_count">0</td>
                            <td><input id="cl_count" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('cl_count');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <!-- 流动负债 end -->

                        <tr>
                            <td rowspan="8">非流动负债</td>
                            <td>长期借款</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td class="ncl_longterm_loan">0</td>
                            <td><input id="ncl_longterm_loan" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_longterm_loan');">更新</a></td>
                        </tr>
                        <tr>
                            <td>应付债券</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td class="ncl_bonds_payable">0</td>
                            <td><input id="ncl_bonds_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_bonds_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>长期应付款</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td class="long_term_accounts_payable">0</td>
                            <td><input id="long_term_accounts_payable" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('long_term_accounts_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>专项应付款</td>
                            <td class="ncl_special_payable">0</td>
                            <td class="ncl_special_payable">0</td>
                            <td class="ncl_special_payable">0</td>
                            <td class="ncl_special_payable">0</td>
                            <td class="ncl_special_payable">0</td>
                            <td class="ncl_special_payable">0</td>
                            <td><input id="ncl_special_payable" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_special_payable');">更新</a></td>
                        </tr>
                        <tr>
                            <td>预计负债</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td class="ncl_anticipation_liabilities">0</td>
                            <td><input id="ncl_anticipation_liabilities" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_anticipation_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>递延所得税负债</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td class="ncl_deferred_income_tax_liabilities">0</td>
                            <td><input id="ncl_deferred_income_tax_liabilities" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_deferred_income_tax_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>其他非流动负债</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td class="ncl_other_liabilities">0</td>
                            <td><input id="ncl_other_liabilities" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_other_liabilities');">更新</a></td>
                        </tr>
                        <tr>
                            <td>非流动负债合计</td>
                            <td class="ncl_count">0</td>
                            <td class="ncl_count">0</td>
                            <td class="ncl_count">0</td>
                            <td class="ncl_count">0</td>
                            <td class="ncl_count">0</td>
                            <td class="ncl_count">0</td>
                            <td><input id="ncl_count" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('ncl_count');">更新</a>*@</td>
                        </tr>
                        <!-- 非流动负债 end -->
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>

                        <tr>
                            <td>负债合计</td>
                            <td>负债合计</td>
                            <td class="count_liabilities">0</td>
                            <td class="count_liabilities">0</td>
                            <td class="count_liabilities">0</td>
                            <td class="count_liabilities">0</td>
                            <td class="count_liabilities">0</td>
                            <td class="count_liabilities">0</td>
                            <td><input id="count_liabilities" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('count_liabilities');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>

                        <!-- 负债合计 end -->

                        <tr>
                            <td rowspan="6">所有者权益(或股东权益)</td>
                            <td>实收资本（或股本）</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td class="oe_paicl_up_capital">0</td>
                            <td><input id="oe_paicl_up_capital" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('oe_paicl_up_capital');">更新</a></td>
                        </tr>
                        <tr>
                            <td>资本公积</td>
                            <td class="oe_capital_reserve">0</td>
                            <td class="oe_capital_reserve">0</td>
                            <td class="oe_capital_reserve">0</td>
                            <td class="oe_capital_reserve">0</td>
                            <td class="oe_capital_reserve">0</td>
                            <td class="oe_capital_reserve">0</td>
                            <td><input id="oe_capital_reserve" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('oe_capital_reserve');">更新</a></td>
                        </tr>
                        <tr>
                            <td>减：库存股</td>
                            <td class="oe_inventory_amount">0</td>
                            <td class="oe_inventory_amount">0</td>
                            <td class="oe_inventory_amount">0</td>
                            <td class="oe_inventory_amount">0</td>
                            <td class="oe_inventory_amount">0</td>
                            <td class="oe_inventory_amount">0</td>
                            <td><input id="oe_inventory_amount" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('oe_inventory_amount');">更新</a></td>
                        </tr>
                        <tr>
                            <td>盈余公积</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td class="oe_surplus_public_accumulation">0</td>
                            <td><input id="oe_surplus_public_accumulation" class="txtinput" type="number" value="0" style="width:110px;" /></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('oe_surplus_public_accumulation');">更新</a></td>
                        </tr>
                        <tr>
                            <td>未分配利润</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td class="oe_undistributed_profit">0</td>
                            <td><input id="oe_undistributed_profit" class="txtinput" type="number" value="0"  style="width:110px;"/></td>
                            <td><a class="btn btn-primary btn-xs" onclick="UpdateData('oe_undistributed_profit');">更新</a></td>
                        </tr>
                        <tr>
                            <td>所有者权益（或股东权益）合计</td>
                            <td class="oe_count">0</td>
                            <td class="oe_count">0</td>
                            <td class="oe_count">0</td>
                            <td class="oe_count">0</td>
                            <td class="oe_count">0</td>
                            <td class="oe_count">0</td>
                            <td><input id="oe_count" class="txtinput" type="number" value="0"  style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('oe_count');">更新</a>*@</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>负债和所有者权益（或股东权益）总计</td>
                            <td>负债和所有者权益（或股东权益）总计</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td class="count_liabilities_and_oe">0</td>
                            <td><input id="count_liabilities_and_oe" class="txtinput" type="number" value="0" style="width:110px;" disabled /></td>
                            <td>@*<a class="btn btn-primary btn-xs" onclick="UpdateData('count_liabilities_and_oe');">更新</a>*@</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

@section css{
    <link href="@Url.Content("~/css/select2/select2.min.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/chosen_v1.6.2/chosen.min.css")" rel="stylesheet" />
    <style>
        #roletable tr td{cursor:pointer;}
    </style>
}

@section scripts{
    <script src="@Url.Content("~/css/select2/select2.min.js")"></script>
    <script src="@Url.Content("~/css/chosen_v1.6.2/chosen.jquery.min.js")"></script>
    <script type="text/javascript">
        var tb;
        $(document).ready(function () {
            //计算表格高度
            var height = document.body.clientHeight;
            $("#roletable").attr("data-height", (height - 149));
            laydate.render({ elem: '#day' });
            init();
            //list();
            
        })

        function init() {
            
            //异步加载条件的数据
            //syncListData();

            $('td').click(function () {

                if ($('#chk_showdetail').is(":checked")) {
                    ShowDetail(this);
                }
            })

            GetData();

        }

        function GetData() {
            var type = $('#timetype').val();
            var day = $('#day').val();
            var paycompany = $('#sel_paycompany').val();

            if (type == '') {
                alert('请选择类型');
                return false;
            }

            if (day == '') {
                alert('请选择日期');
                return false;
            }

            if (paycompany == '') {
                alert('请选择付款主体');
                return false;
            }


            $.ajax({
                url: '@Url.Content("~/Reports/Finance/IndexJson")',
                type: "POST",
                data: 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany,
                success: function (result) {
                    if (result.success) {
                        var list = result.data;

                        var obj = list[list.length - 1];
                        var day = obj.statistical_time.replace('T', ' ').replace('00:00:00', '');
                        $('#c6').html(day);
                        for (var key in obj) {
                            $('#' + key).val(obj[key]);
                        }

                        for (var i = 0; i < list.length - 1; i++) {
                            var obj = list[i];
                            var day = obj.statistical_time.replace('T', ' ').replace('00:00:00', '');
                            $('#c' + (i)).html(day);
                            for (var key in obj) {
                                $('.' + key).each(function (j) {
                                    if (j == i) {
                                        $(this).attr('title', day);
                                        $(this).html(numFormat(obj[key]));
                                    }
                                });
                            }

                        }
                    }
                    else {
                        alert(result.msg);
                    }
                }
            })
        }

    function UpdateData(c) {
        var val = $('#' + c).val();
        if (val == '') {
            alert('请填写正确的数字。');
            return false;
        }

        var id = $('#id').val();
        if (id == ''||id=='0') {
            alert('id不能为0。');
            return false;
        }

        $.ajax({
            url: '@Url.Content("~/FinanceReport/FHome/BalanceSheet")',
            type: "POST",
            data: 'id=' + id + '&c=' + c + '&val=' + val,
            success: function (result) {
                if (result.result.success) {
                    alert('更新成功！');
                }
                else {
                    alert(result.result.msg);
                }
            }
        })
        
    }

        function ShowDetail(d) {
            var c = $(d).attr('class');
            var title = $(d).attr('title');
            var paycompany = $('#sel_paycompany').val();
            switch (c) {
                case 'monetary_fund':
                    showdetail(title + ' 货币资金明细', '@Url.Content("~/Reports/Finance/MonetaryFund?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'inventory_amount':
                    showdetail(title + ' 存货明细', '@Url.Content("~/Reports/Finance/InventoryBalanceCount?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'short_term_borrow':
                    showdetail(title + ' 短期借款明细', '@Url.Content("~/Reports/Finance/ShortBorrow?date=")' + title + '&paycompanyid=' + paycompany); //ShortBorrow
                    return false;
                case 'prepayment':
                    showdetail(title + ' 预付帐款明细', '@Url.Content("~/Reports/Finance/PrePayCount?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'accounts_payable':
                    showdetail(title + ' 应付帐款明细', '@Url.Content("~/Reports/Finance/CopeWithCount?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'other_accounts_receivable':
                    showdetail(title + ' 其他应收款明细', '@Url.Content("~/Reports/Finance/OtherReceivable?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'other_accounts_payable':
                    showdetail(title + ' 其他应付款明细', '@Url.Content("~/Reports/Finance/OtherPayable?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
                case 'fixed_assets':
                    showdetail(title + ' 固定资产明细', '@Url.Content("~/Reports/Finance/ListFixedAssets?date=")' + title + '&paycompanyid=' + paycompany);
                    return false;
            }

            return false;
        }

        function showdetail(title,url)
        {
            layer_show(title,url, '90%','90%');
        }

        function numFormat(num) {
            var res = num.toString().replace(/\d+/, function (n) { // 先提取整数部分
                return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {
                    return $1 + ",";
                });
            })
            return res;
        }

        function ExportXsl() {
            var type = $('#timetype').val();
            var day = $('#day').val();
            var paycompany = $('#sel_paycompany').val();

            window.open('@Url.Content("~/Reports/Finance/ExportIndex?")' + 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany, '_blank');
        }
        
    </script>
}


