WebTM/views/ÏúÊÛ¹ÜÀí/ÏúÊÛ¶©µ¥/Add_Edit_Xs_SeOrderBillList.html
@@ -436,6 +436,7 @@
    </script>
    <script>
        //#region æŠ˜å æ³¨é‡Š
        var HDataEmp = {};
        //#endregion
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -1514,7 +1515,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '销售员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1522,7 +1523,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HEmpName").val(checkStatus.data[0].HName);
                        $("#HEmpName").val(checkStatus.data[0].职员名称);
                        $("#HEmpID").val(checkStatus.data[0].HItemID);
                        getEmpInfoByHEmpID(checkStatus.data[0].HItemID);
@@ -1532,7 +1533,8 @@
                        $("#HEmpName").val("");
                        $("#HEmpID").val("0");
                        getEmpInfoByHEmpID("0");
                        $("#HDeptID").val("0");
                        $("#HDeptName").val("");
                    }
                })
            }
@@ -1625,7 +1627,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '销售部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1633,7 +1635,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        $("#HDeptName").val(checkStatus.data[0].部门名称);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1675,7 +1677,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '销售方式列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_SellStyle.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_SellStyle.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1683,7 +1685,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSellSName").val(checkStatus.data[0].HName);
                        $("#HSellSName").val(checkStatus.data[0].销售方式名称);
                        $("#HSellSID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1700,7 +1702,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '结算方式列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_SettleStyle.html', 'yes']
                    , content: ['../../基础资料/基础资料/Gy_SettleStyle.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1708,7 +1710,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSSName").val(checkStatus.data[0].HName);
                        $("#HSSName").val(checkStatus.data[0].结算方式名称);
                        $("#HSSID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1931,10 +1933,12 @@
                //#endregion
                //#region å­è¡¨ æ•°æ®æ£€éªŒ
                var RowCount = 0;
                for (var i = 0; i < option.data.length; i++) {
                    if (option.data[i]["HMaterID"] == "0") {
                        continue;
                    }
                    RowCount++;
                    if (option.data[i]["HUnitID"] == "0") {
                        layer.msg("第" + i + "行:计量单位未选择!");
@@ -2096,6 +2100,10 @@
                    //    layer.msg("第" + i + "行:开票数量请输入大于0的数字!");
                    //    return false;
                    //}
                }
                if (RowCount == 0) {
                    layer.msg("保存失败,子表至少需要存在一行记录选择了物料!");
                    return false;
                }
                //#endregion
@@ -2604,6 +2612,20 @@
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (typeof (HDataEmp.HItemID) != "undefined") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HMaterID": HDataEmp.HItemID
                                            , "物料代码": HDataEmp.物料代码
                                            , "物料名称": HDataEmp.物料名称
                                            , "规格型号": HDataEmp.规格型号
                                            , "HUnitID": HDataEmp.HUnitID
                                            , "计量单位": HDataEmp.计量单位名称
                                        })
                                        HDataEmp = {};
                                    }
                                }
                            })
                        }
                        //计量单位
@@ -2616,7 +2638,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../Baseset/基础资料/Gy_UnitList.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -2628,10 +2650,20 @@
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "计量单位": checkStatus.data[0].HName
                                        "计量单位": checkStatus.data[0].计量单位名称
                                        , "HUnitID": checkStatus.data[0].HItemID
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (typeof (HDataEmp.HItemID) != "undefined") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HUnitID": HDataEmp.HItemID
                                            , "计量单位": HDataEmp.计量单位名称
                                        })
                                        HDataEmp = {};
                                    }
                                }
                            })
                        }
@@ -2700,6 +2732,16 @@
                                        , "HOrderLevID": checkStatus.data[0].HItemID
                                    })
                                    layer.close(index);//关闭弹窗
                                }, end: function () {
                                    if (typeof (HDataEmp.HItemID) != "undefined") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "订单等级名称": HDataEmp.订单等级
                                            , "订单等级代码": HDataEmp.订单等级代码
                                            , "HOrderLevID": HDataEmp.HItemID
                                        })
                                        HDataEmp = {};
                                    }
                                }
                            })
                        }
@@ -3246,9 +3288,7 @@
            function set_HBillMoney(HEarnestRate) {
                var HBillMoney = 0;
                for (var i = 0; i < option.data.length; i++) {
                    if (option.data[i]["HisStockGoods"] == "false") {
                        HBillMoney += option.data[i]["HlineTotal"] * 1;
                    }
                    HBillMoney += option.data[i]["HlineTotal"] * 1;
                }
@@ -3261,9 +3301,15 @@
            function setHEarnestRateByHisStockGoods() {
                if (option.data.length > 0 && option.data[0]["HisStockGoods"] == "true") {
                    var HEarnestRateList = '<option  value="0" selected="selected" >0%</option>';
                    HEarnestRateList += '<option  value="100" >100%</option>';
                    $("#HEarnestRate").empty();
                    $("#HEarnestRate").append(HEarnestRateList);
                    //var HEarnestRateListArray = ["0", "100"];
                    //if ($.inArray(HEarnestRateTemp+"", HEarnestRateListArray) > -1) {
                    //    $("#HEarnestRate").val(HEarnestRateTemp);
                    //}
                    form.render('select');
                } else if (option.data.length > 0 && option.data[0]["HisStockGoods"] == "false") {
                    var HEarnestRateList = '<option  value="50" selected="selected" >50%</option>';
@@ -3272,7 +3318,7 @@
                    $("#HEarnestRate").empty();
                    $("#HEarnestRate").append(HEarnestRateList);
                    /*form.render('select');*/
                    $("#HEarnestRate").val(HEarnestRateTemp);
                    //$("#HEarnestRate").val(HEarnestRateTemp);
                    form.render('select');
                } else {
                    var HEarnestRateList = '<option  value="50" selected="selected" >50%</option>';
@@ -3281,7 +3327,7 @@
                    $("#HEarnestRate").empty();
                    $("#HEarnestRate").append(HEarnestRateList);
                    //form.render('select');
                    $("#HEarnestRate").val(HEarnestRateTemp);
                  /*  $("#HEarnestRate").val(HEarnestRateTemp);*/
                    form.render('select');
                }
            }
@@ -3395,7 +3441,7 @@
        // åŸºç¡€èµ„料返回数据
        function GetHEmpValue(obj)  //返回业务员
        {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpName").val(obj[0].职员名称);
            $("#HEmpID").val(obj[0].HItemID);
            getEmpInfoByHEmpID(obj[0].HItemID)
@@ -3419,22 +3465,37 @@
        function GetHDeptNameValue(obj)  //返回部门
        {
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptName").val(obj[0].部门名称);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function GetSettleStyleValue(obj)           //返回结算方式
        {
            $("#HSSName").val(obj[0].HName);
            $("#HSSName").val(obj[0].结算方式名称);
            $("#HSSID").val(obj[0].HItemID);
        }
        function GetSellStyleValue(obj)           //返回销售方式
        {
            $("#HSellSName").val(obj[0].HName);
            $("#HSellSName").val(obj[0].销售方式名称);
            $("#HSellSID").val(obj[0].HItemID);
        }
        function GetMaterValue(obj)           //物料名称
        {
            HDataEmp = obj[0];
        }
        function GetUnitValue(obj)           //计量单位
        {
            HDataEmp = obj[0];
        }
        function GetOrderLevValue(obj)           //订单等级列表
        {
            HDataEmp = obj[0];
        }
        //#region æ ¹æ®å®¢æˆ·èŽ·å–å¸åˆ«ã€æ±‡çŽ‡ã€ç»“ç®—æ–¹å¼ã€å®¢æˆ·ä¿¡ç”¨é¢åº¦ã€è”ç³»äººã€è”ç³»ç”µè¯
        function getCustomerByCusID(HCusID) {
            $.ajax({