@model System.Collections.Generic.List<Com._9pm2.ClientWeb.Database.Factory>
@{ViewBag.Title = "外协管理"; }
<script src="../../Scripts/factory.js?vn=20180813"></script>


<form method="get" action="/Customer/Factory">
    <div class="divSearch">
        <div>
            @Html.TextBox("Keywords", null, new { maxlength = "50", placeholder = "关键字" })
            <button class="btn btn-default" id="btnSearch">搜索</button>
            <button class="btn btn-default" type="button" id="btnNew">新增</button>
            <button class="btn btn-default" type="button" onclick="downExcel()">下载(Excel)</button>
        </div>
    </div>
</form>

<div class="list">
    <table id="tFactory">
        <thead>
            <tr>
                <th>外协名称</th>
                <th>快速索引</th>
                <th>联系人</th>
                <th>固定电话</th>
                <th>手机号码</th>
                <th>QQ</th>
                <th>其它联系方式</th>
                <th>描述</th>
                <th style="width:100px">操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr id="@item.FactoryNo">
                    <td>@item.FactoryName</td>
                    <td>@item.SearchKey</td>
                    <td>@item.Contact</td>
                    <td>@item.Phone</td>
                    <td>@item.Mobile</td>
                    <td>@item.QQ</td>
                    <td>@item.Other</td>
                    <td>@item.Description</td>
                    <td>

                        <div class="operation-btns">
                            <div>
                                <button id="select">&nbsp;</button>
                            </div>
                            <ul>
                                <li><a href="javascript:void(0);" onclick="EditFactory('@item.FactoryNo');">编辑 </a></li>
                                <li><a href="javascript:void(0);" onclick="DeleteFactory('@item.FactoryNo')">删除</a></li>

                            </ul>
                        </div>


                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>


<div id="divFactory" title="外协信息" style="display:none">
    <div id="divFactoryContent" style="overflow-y: auto;">
        @using (Html.BeginForm())
            {
            <table class="font85 tableEdit">
                <tr>
                    <td class="label">外协名称</td>
                    <td>
                        @Html.TextBox("FactoryName", null, new { maxlength = "50", @style = "width:260px" })&nbsp;<span class="redStar">*</span>
                    </td>
                </tr>
                <tr>
                    <td class="label">快速索引</td>
                    <td>
                        @Html.TextBox("SearchKey", null, new { maxlength = "50", @style = "width:260px", placeholder = "请使用拼音首字母缩写作为索引键" })&nbsp;<span class="redStar">*</span>
                    </td>
                </tr>
                <tr>
                    <td class="label">联系人</td>
                    <td>
                        @Html.TextBox("Contact", null, new { maxlength = "50" })
                    </td>
                </tr>
                <tr>
                    <td class="label">固定电话</td>
                    <td>
                        @Html.TextBox("Phone", null, new { maxlength = "50" })
                    </td>
                </tr>
                <tr>
                    <td class="label">手机号码</td>
                    <td>
                        @Html.TextBox("Mobile", null, new { maxlength = "50" })
                    </td>
                </tr>
                <tr>
                    <td class="label">QQ</td>
                    <td>
                        @Html.TextBox("QQ", null, new { maxlength = "50" })
                    </td>
                </tr>
                <tr>
                    <td class="label">其它联系方式</td>
                    <td>
                        @Html.TextArea("Other", null, new { maxlength = "200", @style = "height:70px;width:90%;" })
                    </td>
                </tr>
                <tr>
                    <td class="label">描述</td>
                    <td>
                        @Html.TextArea("Description", null, new { maxlength = "200", @style = "height:70px;width:90%;" })
                        @Html.Hidden("FactoryNo")
                    </td>
                </tr>
            </table>
        }
    </div>
    <div style="text-align:right;">

        <div class="error-msg"></div>
        <button class="btn btn-primary" type="button" id="btnSave">保存</button>
        <button class="btn btn-default" type="button" id="btnCancel">取消</button>
    </div>
</div>
