@page
@model Waste.Web.Entry.Pages.Trash.EditTypeModel
@{
    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="Name">物品编码</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" id="Code" name="Code" value="@Model.data.Code" placeholder="请输入物品编码" lay-verify="required" />
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="Phone">物品名称</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" id="Name" name="Name" value="@Model.data.Name" placeholder="请输入物品名称" lay-verify="required" />
                </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/waste/submittypeform",
                         type: "post",
                         data: data.field
                     });
                 });
        });
    </script>
}