zrg
2024-01-26 6b8a9aef84d4d4ba8dd08b911ade7cfa6cc4fa4a
WebTM/views/ÏúÊÛ¹ÜÀí/ÏúÊÛ¶©µ¥/Add_Edit_Xs_SeOrderBillList.html
@@ -98,6 +98,16 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">客户<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;">
                                                <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">销售币别<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;">
@@ -111,16 +121,6 @@
                                            <label class="layui-form-label">汇率<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" style="background-color: #efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="width:900px;">
                                            <label class="layui-form-label">客户<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline" style="width:700px;">
                                                <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float: left; width: 465px; background-color: #efefef4d;" readonly>
                                                <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
@@ -146,24 +146,6 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">摘要</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off" style="width: 501px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">销售主管</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">联系人</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HLinkMan" id="HLinkMan" autocomplete="off" value="">
@@ -175,13 +157,8 @@
                                                <input class="layui-input" name="HLinkPhone" id="HLinkPhone" autocomplete="off" value="">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">内部订单号</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" style="background-color: #efefef4d;" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">备注</label>
@@ -192,7 +169,7 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">客户余额</label>
                                            <label class="layui-form-label">客户余额<i class="layui-icon layui-icon-tips" id="tips-HCusBalance"></i></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HCusBalance" id="HCusBalance" autocomplete="off" readonly>
                                            </div>
@@ -204,9 +181,15 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">可用额度</label>
                                            <label class="layui-form-label">可用额度<i class="layui-icon layui-icon-tips" id="tips-HAvailableBalance"></i></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HAvailableBalance" id="HAvailableBalance" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">需求金额<i class="layui-icon layui-icon-tips" id="tips-HBillMoney"></i></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HBillMoney" id="HBillMoney" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -222,6 +205,30 @@
                                    </div>
                                    <!--隐藏字段:暂时没有用处-->
                                    <div class="layui-row" style="display:none;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">销售主管</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">内部订单号</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" style="background-color: #efefef4d;" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">摘要</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off" style="width: 501px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="display:none;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">结算日期</label>
@@ -538,6 +545,9 @@
                    "HMaterID": "0",
                    "物料代码": "",
                    "物料名称": "",
                    "HItemID": "0",
                    "订单等级代码": "",
                    "订单等级名称": "",
                    "规格型号": "",
                    "HUnitID": "0",
                    "计量单位": "",
@@ -554,7 +564,10 @@
                    "HDate": Format(new Date(), 'yyyy-MM-dd'),
                    "HOutStockQty": "0",
                    "HInvoiceQty": "0",
                    "HRemark": ""
                    "HRemark": "",
                    "HCusMaterNumber": "",
                    "HCusModel": "",
                    "HCusMaterName": ""
                };
                switch (obj.event) {
                    //新增一行
@@ -643,7 +656,13 @@
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -655,6 +674,8 @@
                            , HlineTotal: HlineTotal
                        });
                        table.render(option);
                        //设置表头所需金额
                        set_HBillMoney();
                        break;
                    case "HPrice":                                                       //单价
                        //数据格式校验
@@ -683,7 +704,13 @@
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -695,6 +722,8 @@
                            , HlineTotal: HlineTotal
                        });
                        table.render(option);
                        //设置表头所需金额
                        set_HBillMoney();
                        break;
                    case "HTaxRate":                                                       //数量
                        //数据格式校验
@@ -723,7 +752,13 @@
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -735,6 +770,8 @@
                            , HlineTotal: HlineTotal
                        });
                        table.render(option);
                        //设置表头所需金额
                        set_HBillMoney();
                        break;
                    case "HTaxPrice":                                                       //数量
                        //数据格式校验
@@ -763,7 +800,13 @@
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -775,11 +818,38 @@
                            , HlineTotal: HlineTotal
                        });
                        table.render(option);
                        //设置表头所需金额
                        set_HBillMoney();
                        break;
                    default:
                }
            });
            //#endregion
            //#endregion
            //#region æ–‡æœ¬æ¡†ç›‘听
            $(document).ready(function () {
                //#region å®¢æˆ·ä½™é¢æç¤ºä¿¡æ¯
                $("#tips-HCusBalance").on('click', function (data) {
                    var tips_Message = "客户余额 = æœŸåˆ+本期收款(已审核)-本期退款(已审核)-本期出库(已审核)+本期退货(已审核)";
                    layer.alert(tips_Message, { icon: 0, btn: ['退出'], time: 100000, offset: 't' });
                });
                //#endregion
                //#region å¯ç”¨ä½™é¢æç¤ºä¿¡æ¯
                $("#tips-HAvailableBalance").on('click', function (data) {
                    var tips_Message = "可用额度 = å®¢æˆ·ä½™é¢ + ä¿¡ç”¨é¢åº¦ - ï¼ˆæœ¬æœŸé”€å”®è®¢å•总金额 * 0.5)";
                    layer.alert(tips_Message, { icon: 0, btn: ['退出'], time: 100000, offset: 't' });
                });
                //#endregion
                //#region éœ€æ±‚金额
                $("#tips-HBillMoney").on('click', function (data) {
                    var tips_Message = "需求金额 = ä»·ç¨Žåˆè®¡ * 0.5";
                    layer.alert(tips_Message, { icon: 0, btn: ['退出'], time: 100000, offset: 't' });
                });
                //#endregion
            });
            //#endregion
            //#endregion
@@ -889,28 +959,33 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , totalRow: true
                    , limit: 500
                    , height: 500
                    , loading: false
                    , cols: [[ //子表
                        { type: 'checkbox', totalRowText: '合计行', style: 'background-color:#efefef4d;' }
                        , { type: 'numbers', title: '序号', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { type: 'numbers', title: '序号', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: '物料代码', title: '物料代码', width: 150, edit: 'text', event: "HMaterID" }//f7
                        , { field: '物料名称', title: '物料名称', width: 150, style: 'background-color:#efefef4d;' }
                        , { field: 'HOrderLevID', title: 'HOrderLevID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: '订单等级代码', title: '订单等级代码', width: 150, edit: 'text', event: "HOrderLevID" }//f7
                        , { field: '订单等级名称', title: '订单等级名称', width: 150, style: 'background-color:#efefef4d;' }
                        , { field: 'HCusMaterNumber', title: '客户物料编码', width: 100, edit: 'text' }
                        , { field: 'HCusModel', title: '客户规格型号', width: 100, edit: 'text' }
                        , { field: 'HCusMaterName', title: '客户物料名称', width: 100, edit: 'text' }
                        , { field: '规格型号', title: '规格型号', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: '计量单位', title: '计量单位', width: 100, style: 'background-color:#efefef4d;' }//f7
                        , { field: 'HQty', title: '数量', width: 100, edit: 'text' }
                        , { field: 'HQty', title: '数量', width: 100, totalRow: true, edit: 'text' }
                        , { field: 'HPrice', title: '单价', width: 100, edit: 'text' }
                        , { field: 'HTaxRate', title: '税率', width: 100, edit: 'text' }
                        , { field: 'HTaxPrice', title: '含税单价', width: 100, edit: 'text' }
                        , { field: 'HMoney', title: '金额', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HlineTotal', title: '价税合计', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HMoney', title: '金额', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HlineTotal', title: '价税合计', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HDate', title: '交货日期', event: "HDate", width: 120 }
                        , { field: 'HRemark', title: '备注', width: 100, edit: 'text' }
                        , { field: 'HDiscountRate', title: '折扣率', width: 100, edit: 'text', hide: true }
                        , { field: 'HRelTaxPrice', title: '实际含税单价', width: 110, hide: true }
                        , { field: 'HTaxMoney', title: '税额', width: 100, hide: true }
@@ -925,6 +1000,9 @@
                    "HMaterID": "0",
                    "物料代码": "",
                    "物料名称": "",
                    "HOrderLevID": "0",
                    "订单等级代码": "",
                    "订单等级名称": "",
                    "规格型号": "",
                    "HUnitID": "0",
                    "计量单位": "",
@@ -941,11 +1019,17 @@
                    "HDate": Format(new Date(),'yyyy-MM-dd'),
                    "HOutStockQty": "0",
                    "HInvoiceQty": "0",
                    "HRemark": ""
                    "HRemark": "",
                    "HCusMaterNumber": "",
                    "HCusModel": "",
                    "HCusMaterName": ""
                }];
                option.data = rowdata;
                table.render(option);
                //设置表头所需金额
                set_HBillMoney();
            }
            //#endregion
@@ -1042,33 +1126,42 @@
                                        "HMaterID": result.data[i]["HMaterID"],
                                        "物料代码": result.data[i]["物料代码"],
                                        "物料名称": result.data[i]["物料名称"],
                                        "HOrderLevID": result.data[i]["HOrderLevID"],
                                        "订单等级代码": result.data[i]["订单等级代码"],
                                        "订单等级名称": result.data[i]["订单等级名称"],
                                        "规格型号": result.data[i]["规格型号"],
                                        "HUnitID": result.data[i]["HUnitID"],
                                        "计量单位": result.data[i]["计量单位"],
                                        "HQty": result.data[i]["数量"],
                                        "HPrice": result.data[i]["单价"],
                                        "HTaxPrice": result.data[i]["含税单价"],
                                        "HMoney": result.data[i]["金额"],
                                        "HQty": dealDoubleToFixed(result.data[i]["数量"], 1),
                                        "HPrice": dealDoubleToFixed(result.data[i]["单价"], 3),
                                        "HTaxPrice": dealDoubleToFixed(result.data[i]["含税单价"], 3),
                                        "HMoney": dealDoubleToFixed(result.data[i]["金额"],2),
                                        "HDiscountRate": result.data[i]["折扣率"],
                                        "HRelTaxPrice": result.data[i]["实际含税单价"],
                                        "HTaxRate": result.data[i]["税率"],
                                        "HTaxMoney": result.data[i]["税额"],
                                        "HlineTotal": result.data[i]["价税合计"],
                                        "HlineTotal": dealDoubleToFixed(result.data[i]["价税合计"], 2),
                                        "HlineTotalBB": result.data[i]["本位币价税合计"],
                                        "HDate": formatDate(result.data[i]["交货日期"]),
                                        "HOutStockQty": result.data[i]["出库数量"],
                                        "HInvoiceQty": result.data[i]["开票数量"],
                                        "HRemark": result.data[i]["表体备注"]
                                        "HRemark": result.data[i]["表体备注"],
                                        "HCusMaterNumber": result.data[i]["客户物料编码"],
                                        "HCusModel": result.data[i]["客户规格型号"],
                                        "HCusMaterName": result.data[i]["客户物料名称"]
                                    }
                                );
                            }
                            option.data = rowdata;
                            //出库数量、开票数量不可编辑
                            option.cols[0][19].edit = null;
                            option.cols[0][20].edit = null;
                            option.cols[0][22].edit = null;
                            option.cols[0][23].edit = null;
                            table.render(option);
                            //设置表头所需金额
                            set_HBillMoney();
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
@@ -1573,6 +1666,8 @@
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
                //设置表头所需金额
                set_HBillMoney();
                //rows++;
                layer.msg('增加一行按钮!')
            }
@@ -1594,6 +1689,8 @@
                    }
                    option.data = tables;
                    table.render(option);
                    //设置表头所需金额
                    set_HBillMoney();
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
@@ -1618,6 +1715,8 @@
                    option.data[option.data.length - 1].HWeight = "0";
                    table.render(option);//将数据渲染到表格上
                    //设置表头所需金额
                    set_HBillMoney();
                }
            }
            //#endregion
@@ -1642,6 +1741,8 @@
                            option.data[i - 1] = data[0];
                            option.data[i] = tables[0];
                            table.render(option);
                            //设置表头所需金额
                            set_HBillMoney();
                            break;
                        }
                    }
@@ -1673,6 +1774,8 @@
                            option.data[i + 1] = data[0];
                            option.data[i] = tables[0];
                            table.render(option);
                            //设置表头所需金额
                            set_HBillMoney();
                            break;
                        }
                    }
@@ -1698,6 +1801,8 @@
                            oldData.splice(obj.tr.data('index'), 1);
                            option.data = oldData;
                            table.render(option);
                            //设置表头所需金额
                            set_HBillMoney();
                            layer.close(index);
                        }
                    });
@@ -1711,6 +1816,8 @@
                    if (event.key == "F7") {
                        //物料
                        if (obj.event == "HMaterID") {
                            var HOrgID = $("#HOrgID").val();
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
@@ -1719,7 +1826,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -1736,7 +1843,8 @@
                                            var NewRow = {
                                                "HMaterID": "0", "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": "0", "计量单位": "", "HQty": "0", "HPrice": "0", "HTaxPrice": "0"
                                                , "HMoney": "0", "HDiscountRate": "0", "HRelTaxPrice": "0", "HTaxRate": "0", "HTaxMoney": "0", "HlineTotal": "0", "HlineTotalBB": "0"
                                                , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": ""
                                                , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": "", "HCusMaterNumber": "",
                                                "HCusModel": "","HCusMaterName": ""
                                            }
                                            btnAddLine(NewRow);
                                        }
@@ -1788,6 +1896,8 @@
                                    }
                                    table.render(option);
                                    //设置表头所需金额
                                    set_HBillMoney();
                                    layer.close(index);//关闭弹窗
                                }
@@ -1822,6 +1932,37 @@
                                }
                            })
                        }
                        //订单等级
                        if (obj.event == "HOrderLevID") {
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "订单等级列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_OrderLev.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "订单等级名称": checkStatus.data[0].订单等级
                                        , "订单等级代码": checkStatus.data[0].订单等级代码
                                        , "HOrderLevID": checkStatus.data[0].HItemID
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        obj.event = "";
                        return false;
                    }
@@ -1986,6 +2127,24 @@
            //#region æ‰“印
            function get_PrintReport() {
                //#region åˆ¤æ–­æºå•状态
                var HSourceBillData = "";
                var HSourceBillData = getSourceBillStatus_SeOrderBill();            //获取源单数据
                if (HSourceBillData != "none") {
                    if (HSourceBillData.length == 0) {
                        layer.alert("打印失败!未查询到单据信息!", { icon: 5 });
                        return;
                    } else if (HSourceBillData[0]["状态"] != "已审核") {
                        layer.alert("打印失败!单据状态未为'已审核'状态!", { icon: 5 });
                        return;
                    }
                } else {
                    return;
                }
                //#endregion
                var InterID = $("#HInterID").val();
                $.ajax({
                    type: "GET",
@@ -2010,6 +2169,39 @@
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
            //#region è®¾ç½®è¡¨å¤´æ‰€éœ€é‡‘额
            function set_HBillMoney() {
                var HBillMoney = 0;
                for (var i = 0; i < option.data.length; i++) {
                    HBillMoney += option.data[i]["HlineTotal"] * 1;
                }
                $("#HBillMoney").val(HBillMoney * 0.5);
            }
            //#endregion
            //#region èŽ·å–æºå•-销售订单单据状态
            function getSourceBillStatus_SeOrderBill() {
                var HSourceBillData = "none";
                var sWhere = " and hmainid = " + $("#HInterID").val();
                $.ajax({
                    url: GetWEBURL() + '/Xs_SeOrderBill/list',
                    async: false,
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceBillData = data1.data;
                        } else {
                            layer.alert(data1.code + "单据状态判断失败!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return HSourceBillData;
            }
            //#endregion
            //#endregion
@@ -2047,6 +2239,18 @@
        {
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function GetSettleStyleValue(obj)           //返回结算方式
        {
            $("#HSSName").val(obj[0].HName);
            $("#HSSID").val(obj[0].HItemID);
        }
        function GetSellStyleValue(obj)           //返回销售方式
        {
            $("#HSellSName").val(obj[0].HName);
            $("#HSellSID").val(obj[0].HItemID);
        }
        //#region æ ¹æ®å®¢æˆ·èŽ·å–å¸åˆ«ã€æ±‡çŽ‡ã€ç»“ç®—æ–¹å¼ã€å®¢æˆ·ä¿¡ç”¨é¢åº¦ã€è”ç³»äººã€è”ç³»ç”µè¯
@@ -2134,6 +2338,42 @@
            });
        }
        //#endregion
        //#region å¤„理小数显示位数(data:需要处理的数据;num:数据的类型(如1:数量;2:金额;3:单价))
        function dealDoubleToFixed(data, num) {
            //用于设置小数位数
            var dotLength = 0;
            if (num == 1) {                                    //当数据为数量时,最多保留6位小数
                //设置最多保留6位小数
                dotLength = 6;
            } else if (num == 2) {                             //当数据为金额时,最多保留2位小数
                //设置最多保留2位小数
                dotLength = 2;
            } else if (num == 3) {                             //当数据为单价时,最多保留4位小数
                //设置最多保留4位小数
                dotLength = 4;
            }
            //判断是否存在小数点及其索引位置
            data = data + "";
            var index = data.indexOf(".");
            //处理数据并返回
            if (index < 0) {
                return data * 1;
            } else {
                //获取小数位数
                var length = data.length - index - 1;
                if (length <= dotLength) {
                    return data * 1;
                } else {
                    data = data * 1;
                    return data.toFixed(dotLength);
                }
            }
        }
            //#endregion
    </script>
</body>
</html>