@model Com._9pm2.ClientWeb.Models.OrderCostList
@{
    ViewBag.Title = "订单成本核算";
}
<style>
    .priceMsg {
        display: none;
        color: green;
        font-weight: bold;
        font-size: 16px;
        position: absolute;
        left: 30px;
        top: 12px;
        float: left;
        width: 80px;
        z-index: 99;
    }

    .priceMsg1 {
        display: none;
        color: red;
        font-weight: bold;
        font-size: 16px;
        position: absolute;
        left: 30px;
        top: 12px;
        float: left;
        width: 80px;
        z-index:99;
    }

    .red-text {
        color: red;
    }

    .list #tMaterial input[type=text] {
        width: 100%;
        font-size: 13px;
        border: 0;
        background-color: transparent;
    }

        .list #tMaterial input[type=text]:focus {
            background-color: white;
        }

    .list .td-amount {
        width: 70px;
        padding: 0;
        position:relative;
    }
    .cloud-down{
        position:absolute;
        right:0;
        top:0;
        width:32px;
        display:none;
    }

    .list .td-amount:hover .add-tip {
        display: block;
    }

    .list .td-focus .add-tip {
        display: none !important;
    } 

     .add-tip {
        position: absolute;
        right: 0;
        top: 0;
        display: none;
        height: 20px;
        font-weight: bold;
        color: #fff;
        background: #09f;
        text-indent: 1px;
        line-height: 20px;
        overflow: hidden;
        min-width:20px;
        text-align: center;
        font-size: 15px;
    }
</style>
<script src="~/Scripts/ordercommon.js?vn=20180813"></script>
<script src="../../Scripts/ordercost.js?vn=20180813"></script>

<div class="callout callout-success lead ">提示：订单材料或外协金额发生变动时，需手动核对并更新成本数据。</div>

<form method="post" action="/Order/OrderCost">
    <div class="divSearch">
        <div>
            @Html.TextBox("BeginDate", null, new { maxlength = "50", @class = "text-date", placeholder = "交易日期" }) ~@Html.TextBox("EndDate", null, new { maxlength = "50", @class = "text-date", placeholder = "交易日期" })
            @Html.TextBox("Key", null, new { maxlength = "50", @Style = "width:130px", placeholder = "关键字" })
            <button class="btn btn-default" id="btnSearch" onclick="return checkSearch()">搜索</button>
            <button class="btn btn-default" type="button" onclick="downExcel()">下载(Excel)</button>
            &nbsp;
            @Html.CheckBox("EditModel") 编辑模式
        </div>
    </div>
</form>

<div class="error-msg"></div>

 
    <div class="list" style="overflow:auto">
        <table id="tMaterial" style="min-width:1200px">
            
                <thead>
                    <tr>
                        <th>订单编号</th>
                        <th style="min-width:120px">客户名称</th>
                        <th>订单名称</th>
                        @*<th>开单人</th>*@
                        <th>设计费</th>
                        <th title="包含工艺费">材料费</th>
                        <th>制作费</th>
                        <th>外协费用</th>
                        <th>业务提成</th>
                        <th>交通费</th>
                        <th>安装费</th>
                        <th>税费</th>
                        <th>其它费用</th>
                        <th>费用合计</th>
                        <th>订单金额</th>
                        <th>订单毛利</th>
                        <th style="min-width:60px">备注</th>
                    </tr>
                </thead>
                <tbody id="tbody">
                    @foreach (var item in Model.OrderCosts)
            {
                        <tr id="@item.OrderNo">
                            <td><a href="javascript:void(0)" onclick="ShowDetail('@item.OrderNo')">@item.OrderNo</a></td>
                            <td>@item.CustomerName</td>
                            <td>@item.OrderName</td>
                            @*<td>@item.Creator</td>*@
                            <td class="td-amount">
                                <input type="text" id="fee1" value="@item.FeeDesign" />

                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee2" value="@item.FeeMaterial" />
                                <span class="add-tip" title="点击自动获取">↓</span>
                            <td class="td-amount">
                                <input type="text" id="fee3" value="@item.FeeProcessing" />
                            <td class="td-amount">
                                <input type="text" id="fee4" value="@item.FeeFactory" />
                                <span class="add-tip" title="点击自动获取">↓</span>
                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee5" value="@item.FeeCommission" />
                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee6" value="@item.FeeCommunication" />
                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee7" value="@item.FeeInstallation" />
                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee8" value="@item.FeeTax" />
                                <span class="add-tip" title="点击自动获取">↓</span>
                            </td>
                            <td class="td-amount">
                                <input type="text" id="fee9" value="@item.FeeOther" />
                            </td>
                            <td class="td-amount" id="TotalFee">@item.TotalFee</td>
                            <td class="td-amount" id="Amount">@item.Amount</td>
                            <td class="td-amount" id="Profit">@(item.TotalFee.HasValue ? (decimal?)(item.Amount - item.TotalFee.Value) : null)</td>                            
                            <td><input type="text" id="fee10" value="@item.Memo" /></td>
                        </tr>
                    }
                </tbody>
            </table>

        <div style="min-width:1200px">
            @Html.Pager("OrderCost", "Order", Model.RouterDirectory, Model.PagerConfig, "pagerDiv", "pagerDiv", 8, true, false, true, true, false)
            </div>
        </div>


    @Html.Partial("OrderDetail", Session["LoginUser"] as Com._9pm2.ClientWeb.Models.LoginUser)
    <input type="hidden" id="OrderNo" />
