@{
    ViewData["Title"] = "新增物流供应商往来统计配置";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
}

<div class="row">
    <div class="col-sm-12">
        <div class="ibox-content m-b-sm border-bottom">
            <form id="toolbar">
                <div class="form-inline" style="line-height:40px;">
                    <div class="form-group">
                        <label>供应商名称：</label>
                        <input id="suppliername" name="suppliername" class="form-control" style="width:180px" />
                    </div>
                    <div class="form-group" style="margin-left:10px;">
                        <label>合并后的供应商：</label>
                        <input id="supplierparent" name="supplierparent" class="form-control" style="width:180px" />
                    </div>
                    <div class="form-group">
                        <a href="javascript:;" class="btn btn-sm btn-primary" onclick="Save()">提交</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@section scripts{ 
    <script type="text/javascript">

         function Save() {
            var name = $('#suppliername').val();
            var parent = $('#supplierparent').val();

            if (name == '' || parent == '') {
                alert('供应商名称、合并后的供应商都不能为空');
                return;
            }

            $.submit({
                url: '@Url.Content("~/Supplier/Home/SetLogisticsSupplierConfigJson")',
                paramData: 'suppliername=' + name + '&supplierparent=' + parent+'&type=1',
                type:'POST',
                func: function (result) {
                    if (result.success) {
                        layer.msg('提交成功');
                    }
                    else {
                        layer.msg(result.msg);
                    }
                }
            })

        }
    </script>


}