@{
    ViewBag.Title = "用户配置设置";
    Layout = "~/Views/Shared/_LayoutTable.cshtml";
}
<body>
    <div class="wrapper wrapper-content">
        <div class="ibox-content ">
            <div class="form-horizontal m-t">
                <table id="configurationTable" class="table table-bordered table-striped table-hover">
                    <tr>
                        <td>经销商公司名称:</td>
                        <td>
                            <input type="text" id="UserPowerSale" />
                        </td>
                    </tr>
                    <tr>
                        <td>经销商咨询电话:</td>
                        <td>
                            <input type="text" id="UserPowerSaleTel">
                        </td>
                    </tr>
                    <tr>

                        @{
                    if (ViewBag.EdNm == "CM")
                    {

                                <td>设置会计准则:</td>
                                <td>
                                    <select id="SetMeeting">
                                        <option value="商品流通企业">商品流通企业</option>
                                        <option value="07会计准则">07会计准则</option>
                                        <option value="2012会计准则">2012会计准则</option>
                                        <option value="2014会计准则">2014会计准则</option>
                                        <option value="工业企业">工业企业</option>
                                    </select>
                                </td>

                    }
                    else
                    {
                                @*
                                <td>
                                    启用过账功能:
                                </td>
                                <td>

                                    <div class="radio i-checks inline">
                                        <label>
                                            <input type="radio" value="是" name="BillPosting" />是
                                        </label>
                                    </div>
                                    <div class="radio i-checks inline">
                                        <label>
                                            <input type="radio" value="否" name="BillPosting" />否
                                        </label>
                                    </div>
                                </td>*@
                    }
                        }

                    </tr>
                    <tr>
                        <td>是否允许手机端下载数据使用全新升级:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="IfNewDataUpdate">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="IfNewDataUpdate"> 否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>服务器设置自动产生的数据包时间:</td>
                        <td>&nbsp;时间一：<input type="text" onfocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'HH:mm'})" id="txtFirstDate" style="width: 70px">时间二：<input type="text" onfocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'HH:mm'})" id="txtSecondDate" style="width: 70px">时间三：<input type="text" onfocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'HH:mm'})" id="txtThirdDate" style="width: 70px"></td>
                    </tr>
                    <tr>
                        <td>启用基本信息授权控制:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="UserPower">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="UserPower">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>启用出入库中批号/生产日期应用:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="GNumberPDate">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="GNumberPDate">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>启用商品序列号应用:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="UniqueIsUsed">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="UniqueIsUsed">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>启用离线签到功能:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="UnLineQian">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="UnLineQian">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>拜访启动高级模式:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="isHighModle">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="isHighModle">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>客户按顺序进行拜访:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="isSortModle">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="isSortModle">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>启用提交单据后自动签到:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="SubmitAutoSign">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="SubmitAutoSign">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>定点签到时不用选择客户:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="SignMessage">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="SignMessage">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>开单时启用多仓库出入库:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="MultStock">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="MultStock">否
                                </label>
                            </div>
                        </td>
                    </tr>
                
                    <tr>
                        <td>数量小数位:</td>
                        <td>
                            <input type="text" maxlength="1" id="QtyPoint">
                        </td>
                    </tr>
                    <tr>
                        <td>单价小数位:</td>
                        <td>
                            <input type="text" maxlength="1" id="PricePoint">
                        </td>
                    </tr>
                    <tr>
                        <td>折扣小数位:</td>
                        <td>
                            <input type="text" maxlength="1" id="DiscountPoint">
                        </td>
                    </tr>
                    <tr>
                        <td>金额小数位:</td>
                        <td>
                            <input type="text" maxlength="1" id="TotalPoint">
                        </td>
                    </tr>
                    <tr>
                        <td>手动签到时，允许距离差在指定范围内:</td>
                        <td>
                            <input type="text" maxlength="4" id="RangeDifference">
                        </td>
                    </tr>
                    <tr>
                        <td>单据编号格式:</td>
                        <td>
                            <select id="ReceiptPattern" style="width: 200px">
                                <option value="按月">按月</option>
                                <option value="按日">按日</option>
                            </select>
                    </tr>
                    <tr>
                        <td>客户变价销售报表价格设置：</td>
                        <td>
                            <select name="srps" style="width:200px" id="SaleReportPriceSet" onchange="dpriceWChange()">
                                <option value="1" text="按客户预设售价类型">按客户预设售价类型</option>
                                <option value="2" text="按标准价格选择预设售价">按标准价格选择预设售价</option>
                            </select>
                        </td>
                    </tr>
                    <tr id="test">
                        <td>选择预设售价类型：</td>
                        <td>
                            <select style="width:160px" name="srpt" id="SaleReportPriceType" disabled="disabled"></select>
                        </td>
                    </tr>
                    <tr>
                        <td>补货生成单据默认为:</td>
                        <td>
                            <select name="DefaultBillType" id="DefaultBillType" style="width: 200px">
                                <option value="销售单">销售单</option>
                                <option value="销售订单">销售订单</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>工作台权限设置:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="LimitTypeSite">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="LimitTypeSite">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>是否需要拍摄门头照:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="UpdateBtypeIfPhoto">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="UpdateBtypeIfPhoto">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>调拨单据中仓库权限范围失效:</td>
                        <td>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="是" name="StockPermissionsFailure">是
                                </label>
                            </div>
                            <div class="radio i-checks inline">
                                <label>
                                    <input type="radio" value="否" name="StockPermissionsFailure">否
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印抬头:</td>
                        <td>
                            <input type="text" id="Printbillindex">
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印备注1:</td>
                        <td>
                            <input type="text" id="PrintComment1">
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印备注2:</td>
                        <td>
                            <input type="text" id="PrintComment2">
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印备注3:</td>
                        <td>
                            <input type="text" id="PrintComment3">
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印备注4:</td>
                        <td>
                            <input type="text" id="PrintComment4">
                        </td>
                    </tr>
                    <tr>
                        <td>小票打印备注5:</td>
                        <td>
                            <input type="text" id="PrintComment5">
                        </td>
                    </tr>
                    <tr>
                        <td>上传打印小票时所需图片:</td>
                        <td>
                            <form id="firstImgForm" name="formfirstImg" action="../WLTManage/UploadImageSeals" enctype="multipart/form-data" method="post" target="ajaxUploadUplodaFirstImg">
                                <div style="width:140px;height:28px;padding:0px;float:left" class="btn btn-default">
                                    <input onchange="FirstImg()" name="firstImg" type="file" id="FirstfileImg" style="position:relative;opacity:0;width:inherit;height:inherit;z-index:5;" />
                                    <div style="position:relative;width:inherit;height:inherit;margin-top:-40px;z-index:2;">
                                        <span class="glyphicon glyphicon-folder-open" style="line-height:44px;"> 选择上传图片</span>
                                    </div>
                                </div>
                                &nbsp;&nbsp; <span id="fileFirstimg" class="btn btn-default" style="float:left;" onclick="UploadFirstImg()">开始上传</span>
                                <iframe name="ajaxUploadUplodaFirstImg" hidden="hidden"></iframe>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <div id="imgdiv" style="position:relative;width:150px">
                                <img id="firstimg" width="150px" />
                                <div id="delicon" style="position: absolute; top: 0px; right: 0px; z-index: 99; width: 30px; height: 30px;" onclick="ClearfirtsImg()">
                                    <img src="~/icon/删除.png" title="删除" style="cursor:pointer" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td style="text-align:left">
                            <span id="btnSave" onclick="SetSave()" class="button-glow btn btn-default"><i class="glyphicon glyphicon-saved"></i> 保 存</span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <input type="hidden" id="txtGjbf" />
    <script type="text/javascript">

    //客户变价销售报表价格设置改变时
    function dpriceWChange() {
        var dpriceW = $("#SaleReportPriceSet").val()
        if (dpriceW == "1") {
            $("#SaleReportPriceType").attr("disabled", "true");
            $("#test").hide();
        } else {
            $("#SaleReportPriceType").removeAttr("disabled");
            $("#test").show();
        }
    }
    //上传打印小票时所需图片预览
    function FirstImg() {
        if ($.ImgYulan(document.getElementById("FirstfileImg").files[0], "firstimg")) {
            $("#delicon").show();
        }
    }
    //去上传打印小票时所需图片
    function ClearfirtsImg() {
        var file = $("#FirstfileImg")
        if (file.val()) {
            file.after(file.clone().val(""));
            file.remove();
            $("#firstimg").removeAttr("src");
            $("#firstimg").removeAttr("title");
            $("#firstimg").removeAttr("width");
            $("#firstimg").removeAttr("height");
            $("#delicon").hide();
        } else {
            layer.confirm('确定删除打印小票所需图片?', { icon: 3, title: '提示' }, function (index) {
                $.ajax({
                    url: "../WLTManage/DelImageSeals",
                    data: {},
                    datatype: "text",
                    type: "post",
                    async:false,
                    success: function (data) {
                        if (data=="err") {
                            layer.msg("删除失败", { time: 2000 });
                            return;
                        }
                    }, error: function () {
                        layer.msg("删除失败", { time: 2000 });
                        return;
                    }
                })
                $("#firstimg").removeAttr("src");
                $("#firstimg").removeAttr("title");
                $("#firstimg").removeAttr("width");
                $("#firstimg").removeAttr("height");
                $("#delicon").hide();
                layer.close(index);
            });
        }

    }
    //上传打印小票时所需图片
    function UploadFirstImg() {
        if (document.getElementById("FirstfileImg").files.length < 1) {
            layer.msg("请选择图片", { icon: 2, time: 2000 });
            return;
        }
        $("#firstImgForm").submit();
    }
    var EdNm = "";
    $(function () {
        parent.$("body").css("overflow","hidden");
        $.ajax({
            url: "../WLTManage/GetDefPriceID",
            dataType: "html",
            type: "post",
            async: false,
            success: function (data) {
                $("#SaleReportPriceType").append(data);
            }
        });
        EdNm = "@ViewBag.EdNm";
        var data = parent.$('#configurationTable').bootstrapTable('getData');
        for (var i = 0; i < data.length; i++) {
            if (data[i]["TypeName"] == "UserPowerSale") {     //经销商公司名称
                $("#UserPowerSale").val(data[i]["TypeValues"]);
                }
            if (data[i]["TypeName"] == "UserPowerSaleTel") {   //经销商咨询电话
                $("#UserPowerSaleTel").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "IfNewDataUpdate") {      //是否允许手机端下载数据使用全新升级  IfNewDataUpdate
                $("input[name='IfNewDataUpdate'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "AutoUpdate") {   //服务器设置自动产生的数据包时间
                var date = data[i]["TypeValues"];
                $("#txtFirstDate").val(date.substring(0, 5))
                $("#txtSecondDate").val(date.substring(6,11))
                $("#txtThirdDate").val(date.substring(12, 17))
            }
            //if (data[i]["TypeName"] == "BillPosting") {    //启用过账功能  BillPosting
            //    $("input[name='BillPosting'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            //}
            if (data[i]["TypeName"] == "SetMeeting") {    //设置会计准则  SetMeeting
                $("#SetMeeting").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "UserPower") {    //启用基本信息授权控制  UserPower
                $("input[name='UserPower'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "GNumberPDate") { //启用出入库中批号、生产日期应用 GNumberPDate
                $("input[name='GNumberPDate'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "UniqueIsUsed") {//启用商品序列号应用  UniqueIsUsed
                $("input[name='UniqueIsUsed'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "UnLineQian") {//启用离线签到功能  UnLineQian
                $("input[name='UnLineQian'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "isHighModle") {//拜访启动高级模式  isHighModle
                $("input[name='isHighModle'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
                $("#txtGjbf").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "MultStock") {//开单时启用多仓库出入库  MultStock
                $("input[name='MultStock'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "isSortModle") {//客户按顺序进行拜访  isSortModle
                $("input[name='isSortModle'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "SubmitAutoSign") {//启用提交单据后自动签到 SubmitAutoSign
                $("input[name='SubmitAutoSign'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "SignMessage") {//定点签到时不用选择客户  SignMessage
                $("input[name='SignMessage'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "RangeDifference") {//手动签到时，允许距离差在指定范围内
                $("#RangeDifference").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "ReceiptPattern") {//单据编号格式 ReceiptPattern
                $("#ReceiptPattern").val(data[i]["TypeValues"])
            }
            if (data[i]["TypeName"] == "DefaultBillType") {//补货生成单据默认为
                $("#DefaultBillType").val(data[i]["TypeValues"]);
                //$("#DefaultBillType").find("option[text=" + data[i]["TypeValues"] + "]").attr("selected", true);
            }
            if (data[i]["TypeName"] == "SaleReportPriceSet") {//客户变价销售报表价格设置
                //$("#SaleReportPriceSet ").val(data[i]["TypeValues"]);
                $("#SaleReportPriceSet").find("option[text=" + data[i]["TypeValues"] + "]").attr("selected", true);
                if (data[i]["TypeValues"] == "按标准价格选择预设售价") {
                     $("#SaleReportPriceType").removeAttr("disabled");
                } else {
                    $("#test").hide();
                }
            }
            if (data[i]["TypeName"] == "SaleReportPriceType") {//选择预设售价类型
                //$("#SaleReportPriceType ").val(data[i]["TypeValues"]);
                if (data[i]["TypeValues"]) {
                    $("#SaleReportPriceType").find("option[text=" + data[i]["TypeValues"] + "]").attr("selected", true);
                }
            }

            if (data[i]["TypeName"] == "Printbillindex") {//小票打印抬头
                $("#Printbillindex").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "LimitTypeSite") {//工作台权限设置  LimitTypeSite
                $("input[name='LimitTypeSite'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "UpdateBtypeIfPhoto") {//是否需要拍摄门头照
                $("input[name='UpdateBtypeIfPhoto'][value='" + data[i]["TypeValues"] + "']").attr("checked", true);
            }
            if (data[i]["TypeName"] == "StockPermissionsFailure") {//调拨单据中仓库权限范围失效
                $("input[name='StockPermissionsFailure'][value='" + data[i]["TypeValues"] + "']").attr("checked", true)
            }
            if (data[i]["TypeName"] == "PrintComment1") {//小票打印备注1
                $("#PrintComment1").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "PrintComment2") {//小票打印备注2
                $("#PrintComment2").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "PrintComment3") {//小票打印备注3
                $("#PrintComment3").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "PrintComment4") {//小票打印备注4
                $("#PrintComment4").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "PrintComment5") {//小票打印备注5
                $("#PrintComment5").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "QtyPoint") {//数量小数位
                $("#QtyPoint").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "PricePoint") {//单价小数位
                $("#PricePoint").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "DiscountPoint") {//折扣小数位
                $("#DiscountPoint").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "TotalPoint") {//金额小数位
                $("#TotalPoint").val(data[i]["TypeValues"]);
            }
            if (data[i]["TypeName"] == "UploadImageSeals") {//上传打印小票时所需图片
                if (data[i]["TypeValues"]) {
                    $("#firstimg").attr("src", "../UserData/CommoditiesImages/" + data[i]["TypeValues"]+'?' + new Date().getTime());
                    $("#firstimg").error(function () {
                        $("#firstimg").removeAttr("src");
                        $("#firstimg").removeAttr("title");
                        $("#firstimg").removeAttr("width");
                        $("#firstimg").removeAttr("height");
                        $("#delicon").hide();
                    })
                } else {
                    $("#delicon").hide();
                }
            }
        }
        $(".i-checks").iCheck({ checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green", });
    });
    function SetSave() {
        // 验证经销商咨询电话
        var phone = $("#UserPowerSaleTel").val();
        //验证距离差在指定范围内
        var rd = $("#RangeDifference").val();
        var reg = /^[1-9][0-9]*$/;
        if (rd.trim() && !reg.test(rd)) {
            layer.tips('只能为正整数字或者为空', '#RangeDifference', {
                shift: 0,
                tips: [1, '#c00']
            });
            $.LeversScroll(window, document.getElementById("RangeDifference"));
            return;
        } if (rd.trim() && rd.trim() < 30) {
            layer.tips('距离差在指定范围不能小于30', '#RangeDifference', {
                shift: 0,
                tips: [1, '#c00']
            });
            $.LeversScroll(window, document.getElementById("RangeDifference"));
            return;
        }
        var regnum = /^[0-6]$/;
        var qtyPoint = $("#QtyPoint").val().replace(/,/ig, "，").trim();//数量小数位
        if (qtyPoint && !regnum.test(qtyPoint)) {
            $.LeversScroll(window, document.getElementById("QtyPoint"));
            layer.tips('只能为0-6', '#QtyPoint', {
                shift: 0,
                tips: [1, '#c00']
            });
            return;
        }
        var pricePoint = $("#PricePoint").val().replace(/,/ig, "，").trim();//单价小数位
        if (pricePoint && !regnum.test(pricePoint)) {
            $.LeversScroll(window, document.getElementById("PricePoint"));
            layer.tips('只能为0-6', '#PricePoint', {
                shift: 0,
                tips: [1, '#c00']
            });
            return;
        }
        var discountPoint = $("#DiscountPoint").val().replace(/,/ig, "，").trim();//折扣小数位
        if (discountPoint && !regnum.test(discountPoint)) {
            $.LeversScroll(window, document.getElementById("DiscountPoint"));
            layer.tips('只能为0-6', '#DiscountPoint', {
                shift: 0,
                tips: [1, '#c00']
            });
            return;
        }
        var totalPoint = $("#TotalPoint").val().replace(/,/ig, "，").trim();//金额小数位
        if (totalPoint && !regnum.test(totalPoint)) {
            $.LeversScroll(window, document.getElementById("TotalPoint"));
            layer.tips('只能为0-6', '#TotalPoint', {
                shift: 0,
                tips: [1, '#c00']
            });
            return;
        }
        var AutoUpdate = "";//服务器设置自动产生的数据包时间
        if ($("#txtFirstDate").val()) {
                AutoUpdate = $("#txtFirstDate").val();
        }
        if ($("#txtSecondDate").val()) {
            if (AutoUpdate) {
                AutoUpdate = AutoUpdate + "and" + $("#txtSecondDate").val();
            } else {
                AutoUpdate = $("#txtSecondDate").val();
            }
        }
        if ($("#txtThirdDate").val()) {
            if (AutoUpdate) {
                AutoUpdate = AutoUpdate + "and" + $("#txtThirdDate").val();
            } else {
                AutoUpdate = $("#txtThirdDate").val();
            }
        }
        var par = {
            AutoUpdate: AutoUpdate,//服务器设置自动产生的数据包时间
            UserPowerSale: $("#UserPowerSale").val().replace(/,/ig, "，"),  //经销商公司名称
            UserPowerSaleTel: $("#UserPowerSaleTel").val(), //经销商咨询电话
            IfNewDataUpdate: $("input[name='IfNewDataUpdate']:checked").val(),//是否允许手机端下载数据使用全新升级
            UserPower: $("input[name='UserPower']:checked").val(),//启用基本信息授权控制  UserPower
            GNumberPDate: $("input[name='GNumberPDate']:checked").val(),//启用出入库中批号、生产日期应用 GNumberPDate
            UniqueIsUsed: $("input[name='UniqueIsUsed']:checked").val(),//启用商品序列号应用  UniqueIsUsed
            UnLineQian: $("input[name='UnLineQian']:checked").val(),   //启用离线签到功能  UnLineQian
            isHighModle: $("input[name='isHighModle']:checked").val(),//拜访启动高级模式  isHighModle
            MultStock: $("input[name='MultStock']:checked").val(),//开单时启用多仓库出入库  MultStock
            isSortModle: $("input[name='isSortModle']:checked").val(), //客户按顺序进行拜访  isSortModle
            SubmitAutoSign: $("input[name='SubmitAutoSign']:checked").val(),//启用提交单据后自动签到 SubmitAutoSign
            SignMessage: $("input[name='SignMessage']:checked").val(),//定点签到时不用选择客户  SignMessage
            RangeDifference: $("#RangeDifference").val(),//手动签到时，允许距离差在指定范围内
            ReceiptPattern: $("#ReceiptPattern").val(),//单据编号格式 ReceiptPattern
            DefaultBillType: $("#DefaultBillType").val(),//补货生成单据默认为
            SaleReportPriceSet: $("#SaleReportPriceSet").val() + "-" + $("#SaleReportPriceSet").find("option:selected").text(),//客户变价销售报表价格设置
            SaleReportPriceType: $("#SaleReportPriceType").val() + "-" + $("#SaleReportPriceType").find("option:selected").text(),//选择预设售价类型
            Printbillindex: $("#Printbillindex").val().replace(/,/ig, "，"), //小票打印抬头
            LimitTypeSite: $("input[name='LimitTypeSite']:checked").val(), //工作台权限设置  LimitTypeSite
            UpdateBtypeIfPhoto: $("input[name='UpdateBtypeIfPhoto']:checked").val(),//是否需要拍摄门头照
            PrintComment1: $("#PrintComment1").val().replace(/,/ig, "，"),//小票打印备注1
            StockPermissionsFailure: $("input[name='StockPermissionsFailure']:checked").val(), //调拨单据中仓库权限范围失效
            PrintComment2: $("#PrintComment2").val().replace(/,/ig, "，"), //小票打印备注2
            PrintComment3: $("#PrintComment3").val().replace(/,/ig, "，"),//小票打印备注3
            PrintComment4: $("#PrintComment4").val().replace(/,/ig, "，"),//小票打印备注4
            PrintComment5: $("#PrintComment5").val().replace(/,/ig, "，"),//小票打印备注5
            QtyPoint: $("#QtyPoint").val().replace(/,/ig, "，"),//数量小数位
            PricePoint: $("#PricePoint").val().replace(/,/ig, "，"),//单价小数位
            DiscountPoint: $("#DiscountPoint").val().replace(/,/ig, "，"),//折扣小数位
            TotalPoint: $("#TotalPoint").val().replace(/,/ig, "，")//金额小数位
            //  BillPosting: $("input[name='BillPosting']:checked").val()//启用过账功能
        }
        if (EdNm == "CM") {
            par.SetMeeting = $("#SetMeeting").val();//设置会计准则});
        } else {
            par.BillPosting = $("input[name='BillPosting']:checked").val();//启用过账功能});
        }
        $.ajax({
            url: "../WLTManage/SaveAlertUserConfiguration",
            dataType:"text",
            data: JSON.stringify(par),
            type: "post",
            success: function (data) {
                if (data=="OK") {
                    if ($("#txtGjbf").val() != par.isHighModle) {
                        layer.open({
                            type: '0',
                            content: "保存成功,高级拜访模式已经更改是否刷新菜单栏？",
                            title: "提示",
                            icon:"1",
                            btn: ['立即刷新', '暂时不刷新'],
                            yes: function (index, layero) {
                                parent.parent.location.reload();
                            }, btn2: function (index, layero) {
                               parent.$('#configurationTable').bootstrapTable('refresh');
                               parent.layer.close(parent.layer.getFrameIndex(window.name)); //再执行关闭
                            }

                        })
                    } else {
                        parent.layer.msg("保存成功", { icon: 1, time: 2000 });
                        parent.$('#configurationTable').bootstrapTable('refresh');
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    }
                } else {
                    layer.msg("保存失败！", { icon: 1, time: 1000 });
                }

            }, error: function () {
                layer.msg("连接超时！", { icon: 0, time: 1000 });
            }
        });
    }
    </script>
</body>