@model Com._9pm2.ClientWeb.Models.CustomerPriceList
@{
    ViewBag.Title = "客户报价";
}
<style>
    .priceMsg {
        display: none;
        margin-left: 20px;       
        color: green;
        font-weight: bold;
        font-size: 16px;
    }

    .priceMsg1 {
        display: none;
        margin-left: 20px;      
        color: red;
        font-weight: bold;
        font-size: 16px;
    }
    .red-text{
        color:red;
    }

</style>
<script src="../../Scripts/customerprice.js?vn=20180813"></script>

<div class="callout callout-success lead ">提示：对于没有设置单独报价的客户，开单时系统会获取材料的默认价格。</div>

<form method="post" action="/Warehouse/CustomerPrice">
    <div class="divSearch">
        <div>               
            <div class="div-search-select2">
                @Html.DropDownList("sMaterialId", Model.DdlMaterial)
            </div>
            <div class="div-search-select2">
                @Html.DropDownList("sCustomerNo", new SelectList(Model.DdlCustomer, "ItemValue", "ItemText"))
            </div>      
            <button class="btn btn-default" id="btnSearch" onclick="return checkSearch()">搜索</button>
            <button class="btn btn-default" type="button" id="btnCopy">复制报价</button>
            <button class="btn btn-default" type="button" onclick="downExcel()">下载(Excel)</button>   
        </div>
    </div>
</form>

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

<div class="list">
    <table id="tMaterial" class="">
        <thead>
            <tr>
                <th>客户名称</th>
                <th>材料名称</th>        
                <th>计价方式</th>         
                <th style="width:300px;">销售价</th>
            </tr>
        </thead>
        <tbody id="tbody">
            @foreach (var item in Model.CustomerPrices)
            {
                <tr>
                    <td>
                        @item.CustomerName
                    <input type="hidden" id="hCustomerNo" value="@item.CustomerNo" />
                    </td>
                    <td>
                    @item.MaterialName
                        <input type="hidden" id="hMaterialId" value="@item.MaterialId" />
                    </td>
                    <td>@item.UnitName</td>
                    <td>
                        <input type="text" value="@item.SailPrice" />
                        <span class="priceMsg">设置成功！</span>
                        <span class="priceMsg1">设置失败！</span>
                    </td>                    
                  
                </tr>            
            }
        </tbody>
    </table>
    @Html.Pager("CustomerPrice", "Warehouse", Model.RouterDirectory, Model.PagerConfig, "pagerDiv", "pagerDiv", 8, true, false, true, true, false)
</div> 
 
 
<div id="divCopy" title="复制报价" style="display: none">
    <div id="divCopyContent" class="list" style="overflow-y: auto;">

        <table class="tableEdit">
            <tr>
                <td class="label">
                    源客户
                </td>
                <td>
                    @Html.DropDownList("sourceCustomerNo", new SelectList(Model.DdlCustomer, "ItemValue", "ItemText"))                    
                </td>
            </tr>
            <tr>
                <td class="label">
                    目标客户
                </td>
                <td>
                    @Html.DropDownList("destinationCustomerNo", new SelectList(Model.DdlCustomer, "ItemValue", "ItemText"))
                </td>
            </tr>
            
            
        </table>
    </div>
    <div style="text-align: right;">

        <div class="error-msg"></div>
        <button type="button" class="btn btn-primary" onclick="copyPrice()">复制</button>
        <button type="button" class="btn btn-default" onclick="$('#divCopy').dialog('close');">关闭</button>
    </div>
</div>
 