@model Com._9pm2.ClientWeb.Models.OrderModel
@{Layout = "../Shared/_PortalLayout.cshtml";}
@{ ViewBag.Title = Model.OrderNo == "" ? "客户新订单" : "修改客户订单";}

<script src="../../Scripts/portal/simpleorderedit.js?vn=20180813"></script>
<script src="~/Content/resizecolumn/jquery.resizableColumns.js"></script>
<link rel="stylesheet" href="~/Content/resizecolumn/jquery.resizableColumns.css" />
<style>

    @if (!string.IsNullOrEmpty(Model.OrderNo))
    {
       @:.col-factory{display:none !important;}
    }

    @if(Model.FactoryList.Count==0)
    {
         @:.tr-factory-order{display:none !important;}
    }
</style>

<div id="divOrder">
    <div class="error-msg"></div>
    <div id="divOrderContent" style="min-height:240px">

        <table id="tableEdit" class="font85 tableEdit" style="width:100%">

            <tr>              
                <td class="label">联系人</td>
                <td>
                    @Html.Hidden("CustomerNo")
                    @Html.DropDownList("ContactNo", new SelectList(Model.DdlContact, "ItemValue", "ItemText"), new { @class = "form-control" })                   
                    @Html.TextBox("Contact", null, new { maxlength = "100",placeholder="请输入联系人信息", title = "空格分隔，比如：张三 13888888888", @style = "width:180px", @class = "form-control" })&nbsp;
                   
                </td>          
                          
            </tr>
            <tr>
                <td class="label">送货方式</td>
                <td>
                    @Html.DropDownList("DeliveryType", new SelectList(Model.DdlDeliveryType, "ItemValue", "ItemText"), new { @class = "form-control" })
                    @Html.TextBox("DeliveryAddress", null, new { @class = "form-control", maxlength = "300", style = "width:465px;", placeholder = "请填写送货地址" })
                </td>
            </tr>
            <tr>
                <td class="label">明细</td>
                <td>
                    <div>
                        <div>
                            <div class="btn-group">
                                <button type="button" class="btn btn-default btn-sm" id="btnNewDetail">新增明细</button>
                                <button type="button" class="btn btn-default btn-sm" id="btnCopyDetail">复制明细</button>
                                <button type="button" class="btn btn-default btn-sm" id="btnDeleteDetail">删除明细</button>
                            </div>
                           
                        </div>
                        <div>
                            <table class="excel-table" id="simpleOrderDetail">
                                <thead>
                                    <tr>
                                        <th></th>
                                        <th style="width:100px">业务类型</th>
                                        <th>名称</th>                                     
                                        <th style="width:60px">单位</th>
                                        <th style="width:60px">宽(@Model.WidthUnit)</th>
                                        <th style="width:60px">高(@Model.WidthUnit)</th>
                                        <th style="width:60px">数量</th>
                                        <th style="width:80px">面积(m<sup>2</sup>)</th>                                        
                                        <th>备注</th>                                        
                                    </tr>
                                </thead>
                                <tbody id="simpleOrderTr"></tbody>
                            </table>
                        </div>
                    </div>
                </td>
            </tr> 
            <tr>
                <td class="label">备注</td>
                <td>
                    @Html.TextArea("Memo", null, new { maxlength = "1000", style = "width:98%;height:80px;", @class = "form-control" })
                </td>
            </tr>
        </table>

    </div>
    <div style="text-align:right;margin:10px 0">
        <span id="errorMessage" class="error-msg"></span>
        <button type="button" class="btn btn-default" id="btnCancel">取消</button>
        <button type="button" class="btn btn-primary" id="btnSave">保存</button>
    </div>
</div>

 

@Html.Hidden("OrderTemplate") 
@Html.Hidden("TemplateNo")
@Html.Hidden("OrderDetails", Model.OrderDetailString)
@Html.Hidden("Detail")
@Html.Hidden("BackURL")
@Html.Hidden("OrderNo")
@Html.Hidden("WidthUnit")

<div style="display:none">
    <select id="Category"></select>    
</div>