@model Com._9pm2.ClientWeb.Models.IndexMode
@{
    ViewBag.Title = "仪表盘";
}
<script src="../../Scripts/myspanceindex.js?vn=20180813"></script>

@{Com._9pm2.ClientWeb.Models.LoginUser user = Session["LoginUser"] as Com._9pm2.ClientWeb.Models.LoginUser;}

<div class="myspace-index">
    <div>


        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-green"><i class="fa fa-rmb"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text1">今日营业额</span>
                        <span class="info-box-number1">
                            @if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单金额显示))
                            {
                                <span>
                                    @string.Format("{0:N2}", Model.TodayAmount.HasValue ? Model.TodayAmount.Value : 0)
                                </span>
                            }
                            else
                            {
                                @:--
                                    }

                        </span>
                        <span class="amount">元</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-light-blue"><i class="fa fa-rmb"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text1">昨日营业额</span>
                        <span class="info-box-number1">
                            @if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单金额显示))
                            {
                                <span> @string.Format("{0:N2}", Model.YesterdayAmount.HasValue ? Model.YesterdayAmount.Value : 0)</span>
                            }
                            else
                            {
                                @:--
                            }
                        </span>
                        <span class="amount">元</span>

                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>


        </div>

        <div class="row">

            <!-- /.col -->
            <div class="col-md-6 col-sm-6 col-xs-12">
                @{
                    string url1 = "#";
                    if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单查询))
                    {
                        url1 = "/Order?sDueDay=3";
                    }

                }
                <a href='@url1'>
                    <div class="info-box">
                        <span class="info-box-icon bg-red"><i class="fa fa-warning"></i></span>

                        <div class="info-box-content">
                            <span class="info-box-text1">超时未完工订单</span>
                            <span class="info-box-number1" style="color:#f00">@Model.OrderExpiredcount</span>
                        </div>
                        <!-- /.info-box-content -->
                    </div>
                    <!-- /.info-box -->
                </a>
            </div>
            <!-- /.col -->
            <!-- fix for small devices only -->
            <div class="clearfix visible-sm-block"></div>

            <div class="col-md-6 col-sm-6 col-xs-12">
                @{
                    string url2 = "#";
                    if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单查询))
                    {
                        url2 = "/Order?sDueDay=2";
                    }

                }
                <a href='@url2'>
                    <div class="info-box">
                        <span class="info-box-icon bg-yellow"><i class="fa fa-warning"></i></span>

                        <div class="info-box-content">
                            <span class="info-box-text1">今日到期未完工订单</span>
                            <span class="info-box-number1" style="color:#f00">@Model.OrderDueCount</span>
                        </div>
                        <!-- /.info-box-content -->
                    </div>
                </a>
                <!-- /.info-box -->
            </div>
        </div>
        <br />
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-green"><i class="fa fa-rmb"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text1">客户订单应收金额</span>
                        <span class="info-box-number1">
                            @if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单金额显示))
                            {
                                <span>
                                    @string.Format("{0:N2}", Model.ReceivableAmount)
                                </span>
                            }
                            else
                            {
                                @:--
                                    }

                        </span>
                        <span class="amount">元</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-red"><i class="fa fa-rmb"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text1">外协订单应付金额</span>
                        <span class="info-box-number1">
                            @if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P2_外协订单_订单金额显示))
                            {
                                <span> @string.Format("{0:N2}", Model.PayableAmount)</span>
                            }
                            else
                            {
                                @:--
                            }
                        </span>
                        <span class="amount">元</span>

                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>


        </div>

        <div class="row">

            <!-- /.col -->
            <div class="col-md-6 col-sm-6 col-xs-12">
                <a href='/MySpace/UnProcessedOrder'>
                    <div class="info-box">
                        <span class="info-box-icon bg-red"><i class="fa fa-file-text-o"></i></span>

                        <div class="info-box-content">
                            <span class="info-box-text1">我的待处理订单</span>
                            <span class="info-box-number1" style="color:#f00">@Model.UnProccessCount</span>
                        </div>
                        <!-- /.info-box-content -->
                    </div>
                    <!-- /.info-box -->
                </a>
            </div>
            <!-- /.col -->
            <!-- fix for small devices only -->
            <div class="clearfix visible-sm-block"></div>

            <div class="col-md-6 col-sm-6 col-xs-12">
                @{
                    string url = "#";
                    if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P2_外协订单_订单查询))
                    {
                        url = "/FactoryOrder?sStatus=0";
                    }

                }
                <a href='@url'>
                    <div class="info-box">
                        <span class="info-box-icon bg-yellow"><i class="fa fa-file-text-o"></i></span>

                        <div class="info-box-content">
                            <span class="info-box-text1">未完工外协订单</span>
                            <span class="info-box-number1" style="color:#f00">@Model.UnCompletedFactoryCount</span>
                        </div>
                        <!-- /.info-box-content -->
                    </div>
                </a>
                <!-- /.info-box -->
            </div>

        </div>

    </div>

    @foreach (var w in Model.WorkFlows)
    {
        <div class="callout callout-success lead" style="margin:30px 0 0 0">@w.WorkFlowName 业务进度</div>
        <div class="work-flow" style="padding:40px 10px 40px 10px">

            @for (int i = 0; i < w.Tasks.Count; i++)
            {
                string u = "#";
                if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单查询) && w.Tasks[i].TaskNumber>0)
                {
                    u = "/Order?sStatus=" + w.Tasks[i].StatusNo+"&sWorkFlow=" +w.WorkFlowNo ;
                }
                <a href="@u">

                    <div class="cell">
                        <img src="~/Images/flow/@w.Tasks[i].TaskIcon" />
                        <div class="name">@w.Tasks[i].TaskName</div>
                        @if (@w.Tasks[i].TaskNumber > 0)
                    {
                            <div class="badge">@w.Tasks[i].TaskNumber</div>
                        }

                    </div>

                </a>

                if (i != w.Tasks.Count - 1)
                {
                    <div class="arrow">
                        <img src="~/Images/flow/arrow.png" />
                    </div>
                }
            }

            <div class="clear"></div>

        </div>

    }


</div>

<style>
    .work-flow {
        background-color: white;
    }

        .work-flow .title {
            float: left;
            font-weight: bold;
            font-size: 32px;
        }


        .work-flow .cell {
            float: left;
            position: relative;
            padding: 20px;
            display: inline-block;
            height: 120px;
            text-align:center;
        }

            .work-flow .cell .name {
                font-size: 18px;
                text-align: center;
                margin-top:10px;
                color:#333;
               
            }

            .work-flow .cell img {
                width: 70px;
            }

            .work-flow .cell .badge {
                position: absolute;
                color: white;
                top: 5px;
                right: 5px;
                font-size: 18px;
              
                background-color: #dd4b39;
                border: 5px;
            }


        .work-flow .arrow {
            float: left;
            padding: 30px 10px;
            height: 120px;
        }

            .work-flow .arrow img {
                width: 50px
            }
</style>