@page
@model Waste.Web.Entry.Pages.SZPlt.EditCollectModel
@{
    ViewData["Title"] = "采集点编辑";
}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="form-horizontal layui-form">
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="EstateId">地产区域</label>
                <div class="col-md-4">
                    <select id="EstateId" name="EstateId">
                        @foreach (var item in Model.addresslist)
                        {
                            if (Model.estateid == item.Id)
                            {
                                <option value="@item.Id" selected>@item.Name</option>
                            }
                            else
                            {
                                <option value="@item.Id">@item.Name</option>
                            }
                        }
                    </select>
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="Code">编号</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" id="Code" name="Code" value="@Model.data.Code" placeholder="请输入编号" lay-verify="required" />
                    <span class="tiptext">唯一,长度2到32位</span>
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="Name">名称</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" id="Name" name="Name" value="@Model.data.Name" placeholder="请输入名称" lay-verify="required" />
                    <span class="tiptext">长度2到32位</span>
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="Addr">地址</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" id="Addr" name="Addr" value="@Model.data.Addr" placeholder="请输入详细地址" lay-verify="required" />
                    <span class="tiptext">长度4到128位</span>
                </div>
            </div>
            <div class="text-center col-md-7">
                <button class="btn btn-primary btn-lg" lay-submit lay-filter="submit" type="button">提交</button>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <script type="text/javascript">
             layui.use(['form', 'common'], function () {
                 var form = layui.form,
                     common = layui.common;

                 form.on("submit(submit)", function (data) {
                     data.field['id'] = '@Model.data.Id';
                     common.ajax({
                         url: "/api/szplt/submitcollectform",
                         type: "post",
                         data: data.field
                     });
                 });
        });
    </script>
}