<div style="margin: 20px; background: #fff; border: 1px solid #D1D1D1; height: auto; padding-left: 4%; padding-right: 4%; padding-top: 10px"
    ms-controller="SalesComplex">
    <div class="a-title">
        <span>销售分析</span> <a href="#/Report/Complex" class="btn_back" style="margin: 5px; margin-right: 10px"></a>
    </div>
    <br />
    <div style="height: 100px" class="tipBox FZ14">
        <table style="width:100%;">
            <tr>
                <td style="width:100px;">
                    <strong class="forange" style="font-size: large">条件设定：</strong> 
                </td>
                <td style="width:80px;text-align:right;">
                    时间范围：
                </td>
                <td style="text-align:left;">
                    <input type="text" ms-duplex="queryData.startTime" class="chaoboDate" ms-widget='date' data-format="%Y-%m-%d" style="width: 100px" />
                    <span style="margin-right: 10px;">-</span>
                    <input type="text" ms-duplex="queryData.endTime" class="chaoboDate" ms-widget='date' data-format="%Y-%m-%d" style="width: 100px" />
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td style="text-align:right;">归属范围：
                </td>
                <td>
                    <label>
                    <input type="radio" name="radioIsRead" checked="checked" ms-click="selectUser(0)" style="float: none; margin-top: -2px" />
                        不限&nbsp;</label>
                    <label> 
                    <input type="radio" name="radioIsRead" ms-click="selectUser(1)" style="float: none; margin-top: -2px" />指定部门人员</label>   
                    <!--<button type="button" class="myfbt"><i class="bm"></i></button>-->
                    <button class="myfbt2" type="button" ms-click="doSearch" style="width: 70px;">
                        <i class="customer"></i>统计</button>
                    <input type="button" value="重置" class="myfbt2" ms-click="clearQuery" />
                </td>
            </tr>
        </table>

    </div>
    <br />
    <div class="boxTitlenob top10" style="border: 1px solid #D1D1D1; height: auto;">
        <h2></h2>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="top10">
            <tr>
                <td style="width: 20%; text-align: center; font-size: 18px;">新录入客户</td>
                <td style="width: 20%; text-align: center; font-size: 18px;">签约客户</td>
                <td style="width: 20%; text-align: center; font-size: 18px;">签约金额</td>
                <td style="width: 20%; text-align: center; font-size: 18px;">新录入客户中签约</td>
                <td style="width: 20%; text-align: center; font-size: 18px;">旧客户签约</td>
            </tr>
            <tr>
                <td style="text-align: center; font-size: 18px;"><a class="acolor" href="javascript:void(0)" ms-click="viewCuList">{{data.newCustomer}}</a> </td>
                <td style="text-align: center; font-size: 18px;">{{data.signCustomer}}</td>
                <td style="text-align: center; font-size: 18px;">{{data.signAmount|bigNumber}}</td>
                <td style="text-align: center; font-size: 18px;">{{data.newSignCustomer}}位 {{data.newSignPercent}}%</td>
                <td style="text-align: center; font-size: 18px;">{{data.oldSignCustomer}}位 {{data.oldSignPercent}}%</td>
            </tr>
        </table>
    </div>
    <div class="top10" style="height: auto;margin-bottom:10px;">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList">
            <tr class="head">
                <td colspan="2" style="width: 30%;text-align:center;">签约客户
                </td>
                <td colspan="5" style="width: 40%;text-align:center;">合同订单
                </td>
                <td colspan="4" style="width: 40%;text-align:center;">收款信息
                </td>
            </tr>
            <tr style="background:#ffffff;">
                <td style="width: 20%;">客户名称</td>
                <td style="width: 7%;"  class="center">录入时间</td>
                <td style="width: 10%;">合同名称</td>
                <td style="width: 8%;"  class="center">签约时间</td>
                <td style="width: 10%;"  class="center">合同金额</td>
                <td style="width: 10%;"  class="center">已回款</td>
                <td style="width: 5%;" class="center">付款期次</td>
                <td style="width: 5%;" class="center">序号</td>
                <td style="width: 5%;" class="center">期次</td>
                <td style="width: 10%;" class="center">金额</td>
                <td style="width: 10%;" class="center">付款状态</td>
            </tr>
            <tbody ms-each-item="data.list">
                <tr ms-if="item._type=='cu'" style="background:#ffffff;">
                    <td ms-attr-rowspan="item.rowspan"><a href="javascript:void(0);" ms-click="gotoview(item.Id)">{{item.Name}}</a></td>
                    <td ms-attr-rowspan="item.rowspan" class="center">{{item.AddTime|truncate2(10)}}</td>
                    <td ms-attr-rowspan="item.firstc.rowspan">
                        <a href="javascript:void(0);" ms-click="gotoview(item.firstc.Id,'contract')">{{item.firstc.ContractName}}</a>
                    </td>
                    <td ms-attr-rowspan="item.firstc.rowspan">{{item.firstc.SignAContractDate|truncate2(10)}}</td>
                    <td ms-attr-rowspan="item.firstc.rowspan" class="money">{{item.firstc.Amount}}</td>
                    <td ms-attr-rowspan="item.firstc.rowspan" class="money">{{item.firstc.ReturnedMoney}}</td>
                    <td ms-attr-rowspan="item.firstc.rowspan" class="center">{{item.firstc.PlanCount}}</td>
                    <td class="center">{{item.firstc.firstp.Num}}</td>
                    <td class="center">{{item.firstc.firstp.Item}}</td>
                    <td class="money">{{item.firstc.firstp.Money}}</td>
                    <td class="center">{{item.firstc.firstp.ReturnedState}}</td>
                </tr>
                <tr ms-if="item._type=='c'" style="background:#ffffff;">
                    <td ms-attr-rowspan="item.rowspan">
                        <a href="javascript:void(0);" ms-click="gotoview(item.Id,'contract')">{{item.ContractName}}</a>
                    </td>
                    <td ms-attr-rowspan="item.rowspan" class="center">{{item.SignAContractDate|truncate2(10)}}</td>
                    <td ms-attr-rowspan="item.rowspan" class="money">{{item.Amount}}</td>
                    <td ms-attr-rowspan="item.rowspan" class="money">{{item.ReturnedMoney}}</td>
                    <td ms-attr-rowspan="item.rowspan" class="center">{{item.PlanCount}}</td>
                    <td class="center">{{item.firstp.Num}}</td>
                    <td class="center">{{item.firstp.Item}}</td>
                    <td class="money">{{item.firstp.Money}}</td>
                    <td class="center">{{item.firstp.ReturnedState}}</td>
                </tr>
                <tr ms-if="item._type=='p'" style="background:#ffffff;">
                    <td class="center">{{item.Num}}</td>
                    <td class="center">{{item.Item}}</td>
                    <td class="money">{{item.Money}}</td>
                    <td class="center">{{item.ReturnedState}}</td>
                </tr>
            </tbody>
            <tfoot>
                <tr style="background:#F1F2F5;">
                    <td colspan="11">
                        合计：{{sum.signCount}}份合同，
                        签约金额总计:{{sum.signAmount|bigNumber}},
                        已回款总计：{{sum.signAmountReturm|bigNumber}}，
                        未回款总计：{{sum.signAmountNotReturm|bigNumber}}
                    </td>
                </tr>
            </tfoot>
        </table>

    </div>
</div>
