chenhaozhe
2025-09-23 65968b3e0e9e03ef0904de35b78872224b9ce00a
WebTM/views/²É¹º¹ÜÀí/Ó¦¸¶µ¥/Cg_PayableBill.html
@@ -45,6 +45,7 @@
                <form class="layui-form" lay-filter="component-form-group" action="">
                    <div class="layui-card-header">
                        <div class="layui-btn-group">
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">新增</button>
                            <button type="button" id="set_SaveBill" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill">审核</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SelectMainBill">选整单</button>
@@ -67,7 +68,7 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label">单据编号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;">
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" value="0">
                                            </div>
                                        </div>
@@ -95,7 +96,7 @@
                                                <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; ">
                                                <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; " readonly>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HMainSource" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
@@ -418,7 +419,7 @@
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1114";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            var HPageTitle = get_PageTitle(HModuleType) || $("h1").html();
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
@@ -491,6 +492,13 @@
                    Pub_Close(2);
                }
            })
            //#endregion
            //#region æ–°å¢ž
            form.on('submit(set_AddNew)', function (data) {
                const url = new URL(location.href);
                location.href = url.origin + url.pathname;
            });
            //#endregion
            //#region å®¡æ ¸æŒ‰é’®
@@ -726,7 +734,9 @@
                                        for (var j = i + 1; j < rowdataEntry.length; j++) {
                                            if (rowdataEntry[j].HMaterID == item.HMaterID) {
                                                rowdataEntry[i].HQty += rowdataEntry[j].HQty;//数量
                                                rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                                                rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                                                rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                                                //rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                                                rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                                                rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                                                var HExRate = $("#HExRate").val();
@@ -826,7 +836,8 @@
                                        for (var j = i + 1; j < rowdataEntry.length; j++) {
                                            if (rowdataEntry[j].HMaterID == item.HMaterID) {
                                                rowdataEntry[i].HQty += rowdataEntry[j].HQty;
                                                rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                                                rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                                                rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                                                rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                                                rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                                                var HExRate = $("#HExRate").val();
@@ -1466,7 +1477,8 @@
                                    for (var j = i + 1; j < rowdataEntry.length; j++) {
                                        if (rowdataEntry[j].HMaterID == item.HMaterID) {
                                            rowdataEntry[i].HQty += rowdataEntry[j].HQty;//数量
                                            rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                                            rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                                            rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                                            rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                                            rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                                            var HExRate = $("#HExRate").val();
@@ -1588,7 +1600,8 @@
                                    for (var j = i + 1; j < rowdataEntry.length; j++) {
                                        if (rowdataEntry[j].HMaterID == item.HMaterID) {
                                            rowdataEntry[i].HQty += rowdataEntry[j].HQty;
                                            rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                                            rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                                            rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                                            rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                                            rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                                            var HExRate = $("#HExRate").val();
@@ -1769,6 +1782,9 @@
                    if (option.cols[0][i]["field"] == "HQty") {
                       option.cols[0][i]["edit"] = false;
                    }
                    //if (option.cols[0][i]["field"] == "HMoney") {
                    //    option.cols[0][i]["edit"] = false;
                    //}
                    
                }
            }
@@ -2163,15 +2179,15 @@
                                , "HInvoiceBillNo": data.发票编号
                                , "HMaker": data.制单人
                                , "HMakeDate": data.制单日期 == null ? "" : Format(new Date(data.制单日期), "yyyy-MM-dd HH:mm:ss")
                                , "HMakeDate": data.制单日期 == null ? "" : Format(new Date(data.制单日期), "yyyy-MM-dd hh:mm:ss")
                                , "HUpDater": data.修改人
                                , "HUpDateDate": data.修改日期 == null ? "" : Format(new Date(data.修改日期), "yyyy-MM-dd HH:mm:ss")
                                , "HUpDateDate": data.修改日期 == null ? "" : Format(new Date(data.修改日期), "yyyy-MM-dd hh:mm:ss")
                                , "HChecker": data.审核人
                                , "HCheckDate": data.审核日期 == null ? "" : Format(new Date(data.审核日期), "yyyy-MM-dd HH:mm:ss")
                                , "HCheckDate": data.审核日期 == null ? "" : Format(new Date(data.审核日期), "yyyy-MM-dd hh:mm:ss")
                                , "HCloseMan": data.关闭人
                                , "HCloseDate": data.关闭日期 == null ? "" : Format(new Date(data.关闭日期), "yyyy-MM-dd HH:mm:ss")
                                , "HCloseDate": data.关闭日期 == null ? "" : Format(new Date(data.关闭日期), "yyyy-MM-dd hh:mm:ss")
                                , "HDeleteMan": data.作废人
                                , "HDeleteDate": data.作废日期 == null ? "" : Format(new Date(data.作废日期), "yyyy-MM-dd HH:mm:ss")
                                , "HDeleteDate": data.作废日期 == null ? "" : Format(new Date(data.作废日期), "yyyy-MM-dd hh:mm:ss")
                            });
                            if (data.HMainSourceBillType != "") {
@@ -2447,7 +2463,6 @@
                    $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                }
                var sMainStr = JSON.stringify(data.field);
                debugger
                //获取子表数据
                var num = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
@@ -3310,7 +3325,8 @@
                    for (var j = i + 1; j < rowdataEntry.length; j++) {
                        if (rowdataEntry[j].HMaterID == item.HMaterID) {
                            rowdataEntry[i].HQty += rowdataEntry[j].HQty;//数量
                            rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                            rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                            rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                            rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                            rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                            var HExRate = $("#HExRate").val();
@@ -3371,9 +3387,9 @@
                    , "HEmpName": dataArray[0].业务员
                    , "HSupID": dataArray[0].HSupID
                    , "HSupName": dataArray[0].供应商
                    //, "HCurID": dataArray[0].HCurID
                    //, "HCurName": dataArray[0].币别
                    //, "HExRate": dataArray[0].汇率
                    , "HCurID": dataArray[0].HCurID
                    , "HCurName": dataArray[0].币别
                    , "HExRate": dataArray[0].汇率
                    , "HSSID": "0"
                    , "HSSName": ""
                    , "HPSStyleID": dataArray[0].HPSStyleID
@@ -3443,7 +3459,8 @@
                    for (var j = i + 1; j < rowdataEntry.length; j++) {
                        if (rowdataEntry[j].HMaterID == item.HMaterID) {
                            rowdataEntry[i].HQty += rowdataEntry[j].HQty;
                            rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//金额=数量*单价
                            rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//金额
                            rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//单价
                            rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//税额
                            rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //价税合计
                            var HExRate = $("#HExRate").val();