@{
    Layout = "~/Views/Shared/_LayoutTable.cshtml";
}
<style type="text/css">
    table tr td:first-child {
        text-align: right;
        width: 30%;
    }
</style>
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <table class="table table-bordered table-striped table-hover">
                <tr>
                    <td>验证码:</td>
                    <td>
                        <input type="text" id="yzm" value="@ViewBag.yzm" style="width: 400px">
                    </td>
                </tr>
                <tr>
                    <td>姓名:</td>
                    <td>
                        <input type="text" id="fullname" value="@ViewBag.fullname" style="width: 400px">
                    </td>
                </tr>
                <tr>
                    <td>手机号:</td>
                    <td>
                        <input type="text" id="tel" value="@ViewBag.tel" style="width: 400px">
                    </td>
                </tr>

                <tr>
                    <td>用户人员:</td>
                    <td>
                        <select  name="regtype" id="person" style="width:160px">
                            <option>—请选择—</option>
                            @{
                                if (@ViewBag.dtempory != null && @ViewBag.dtempory.Rows.Count > 0)
                                {
                                    for (int i = 0; i < @ViewBag.dtempory.Rows.Count; i++)
                                    {
                                        <option @(@ViewBag.dtempory.Rows[i]["TypeID_"].ToString() == @ViewBag.empory ? "selected" : "") value="@ViewBag.dtempory.Rows[i]["TypeID_"]">@ViewBag.dtempory.Rows[i]["FullName"]</option>
                                    }
                                }
                            }
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>备注:</td>
                    <td>
                        <input type="text" id="comment" value="@ViewBag.comment" style="width: 400px">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <img src="~/Content/img/ma.png" style="width:150px;height:150px;" />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button id="btnSave" class="btn btn-default">保存</button>&nbsp;&nbsp;&nbsp;
                        <button id="btnClose" class="btn btn-danger">取消</button>
                        <input id="wxuserid" value="@ViewBag.wxuserid" type="hidden" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>

<script>
    $("#btnSave").click(function () {
        $.ajax({
            url: "../WeChatAssistant/SaveCustomer",
            dataType: "text",
            data: {
                wxuserid: $("#wxuserid").val(),
                yzm: $("#yzm").val(),
                fullname: $("#fullname").val(),
                tel: $("#tel").val(),
                person: $("#person option:selected").val(),
                comment: $("#comment").val()
            },
            type: "post",
            success: function (data) {
                if (data == "True") {
                    layer.msg("保存成功", { icon2: 1, time: 2000 });
                    parent.$('#businessTable').bootstrapTable("refresh");
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
                else {
                    layer.msg(data, { icon2: 1, time: 2000 });
                }
            },
            error: function (data) {
                layer.msg(data, { icon2: 1, time: 2000 });
            }
        })
    })
    $("#btnClose").click(function () {
        parent.$('#businessTable').bootstrapTable("refresh");
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })
</script>