@model Com._9pm2.ClientWeb.Models.SupplierList
@{
    ViewBag.Title = "供应商管理";
}
<script src="../../Scripts/supplier.js?vn=20180813"></script>

<form method="post" action="/Warehouse/Supplier">
    <div class="divSearch">
        <div>            
            @Html.TextBox("sKeywords", null, new { maxlength = "50", placeholder = "关键字" })
            <button class="btn btn-default" id="btnSearch">搜索</button>
            <button id="btnNew" type="button" class="btn btn-default">新增</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="tSupplier" class="">
        <thead>
            <tr>
                <th>供应商名</th>
                <th>联系人</th>
                <th>电话</th>
                <th>手机</th>
                <th>Email</th>
                <th>开户银行</th>
                <th>开户名称</th>
                <th>银行账号</th>     
                <th>备注</th>
                <th style="width:120px;">操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.List)
            {
                <tr id="@item.Id">
                    <td>@item.Name</td>
                    <td>@item.Contact</td>
                    <td>@item.Phone</td>
                    <td>@item.Mobile</td>
                    <td>@item.Email</td>
                    <td>@item.Bank</td>
                    <td>@item.BankAccountName</td>
                    <td>@item.BankAccount</td>
                    <td>@item.Memo</td>

                    <td style="text-align:center">

                        <div class="operation-btns">
                            <div>
                                <button id="select">&nbsp;</button>
                            </div>
                            <ul>
                                <li><a href="javascript:void(0);" onclick="EditSupplier('@item.Id');">编辑</a></li>
                                <li><a href="javascript:void(0);" onclick="DeleteSupplier('@item.Id');">删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    @Html.Pager("Supplier", "Warehouse", Model.RouterDirectory, Model.PagerConfig, "pagerDiv", "pagerDiv", 8, true, false, true, true, false)
</div>

<div id="divSupplier" title="供应商信息" style="display:none">
    <div id="divSupplierContent">

        <table id="tableEdit" class="font85 tableEdit">
            <tr>
                <td class="label">供应商名称</td>
                <td>
                    @Html.TextBox("Name", null, new { maxlength = "100", @style = "width:260px" })&nbsp;<span class="redStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">联系人</td>
                <td>
                    @Html.TextBox("Contact", null, new { maxlength = "100", @style = "width:260px" })
                </td>
            </tr>
            <tr>
                <td class="label">电话</td>
                <td>
                    @Html.TextBox("Phone", null, new { maxlength = "100", @style = "width:260px" })
                </td>
            </tr>
            <tr>
                <td class="label">手机</td>
                <td>
                    @Html.TextBox("Mobile", null, new { maxlength = "100", @style = "width:260px" })
                </td>
            </tr>
            <tr>
                <td class="label">Email</td>
                <td>
                    @Html.TextBox("Email", null, new { maxlength = "100", @style = "width:260px" })
                </td>
            </tr>
            <tr>
                <td class="label">开户银行</td>
                <td>
                    @Html.TextBox("Bank", null, new { maxlength = "100", @style = "width:90%" })
                </td>
            </tr>
            <tr>
                <td class="label">开户名称</td>
                <td>
                    @Html.TextBox("BankAccountName", null, new { maxlength = "100", @style = "width:90%" })
                </td>
            </tr>
            <tr>
                <td class="label">银行账号</td>
                <td>
                    @Html.TextBox("BankAccount", null, new { maxlength = "100", @style = "width:90%" })
                </td>
            </tr>
            <tr>
                <td class="label">备注</td>                
                <td>
                    @Html.TextArea("Memo", null, new { maxlength = "200", @style = "height:60px;width:90%" })
                </td>
                
            </tr> 
        </table>
        <br />
    </div>
    <div style="text-align:right;">

        <div class="error-msg"></div>
        <button type="button" class="btn btn-default" id="btnCancel" onclick="$('#divSupplier').dialog('close');">取消</button>
        <button type="button" class="btn btn-primary" id="btnSave">保存</button>
    </div>
</div>


@Html.Hidden("Id")