wtt
2024-08-22 bdf59b03cd7f87db3e79178fca6d1a9a79a15e46
收款单添加子表
3个文件已修改
480 ■■■■■ 已修改文件
WebTM/WebTM.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/销售管理/收款单/YS_ReceiveBill.html 472 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj.user
@@ -3,7 +3,7 @@
  <PropertyGroup>
    <NameOfLastUsedPublishProfile>D:\vs\项目代码\MES-WEB-TM\MESWMS-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <ProjectView>ProjectFiles</ProjectView>
    <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
    <Use64BitIISExpress />
    <IISExpressSSLPort />
WebTM/layuiadmin/Scripts/webConfig.js
@@ -6,14 +6,14 @@
    //var WEBURL = "http://localhost/API/";             //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //杨乐本地配置
   /* var WEBURL = "http://localhost:8082/API/"; */   //杜贺本地配置
     var WEBURL = "http://localhost/API/";   //潘浙游本地配置
     /*var WEBURL = "http://localhost/API/";   //潘浙游本地配置  */
    //var WEBURL = "http://localhost:8082/API/";    //杜贺本地配置
    /*var WEBURL = "http://localhost/API/";*/    //潘浙游本地配置  
    /*var WEBURL = "http://localhost:8082/API/";    //杜贺本地配置*/
    //var WEBURL = "http://localhost:81/API/";    //王彬本地配置
    /*var WEBURL = "http://localhost:8083/API/";  //陈雯静本地配置*/
    var WEBURL = "http://localhost:8082/API/";    //张瑞广本地配置
   /* var WEBURL = "http://localhost:81/API/"    //翁涛涛本地配置*/
    /*var WEBURL = "http://localhost:8082/API/";    //张瑞广本地配置*/
    var WEBURL = "http://localhost:81/API/"    //翁涛涛本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";   //余思杰本地配置
    //var WEBURL = "http://localhost:8088/ARAPI/";    //余思杰本地配置(安瑞)
    //var WEBURL = "http://10.1.4.155/API/";   //江丰客户NEW
WebTM/views/ÏúÊÛ¹ÜÀí/ÊÕ¿îµ¥/YS_ReceiveBill.html
@@ -285,6 +285,18 @@
                                                <input class="layui-input" name="HAvailableBalance" id="HAvailableBalance" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">源单号</label>
                                            <div class="layui-input-inline">
                                                <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; background-color: #efefef4d;" 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>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:10px;">
                                        <div class="layui-inline">
@@ -298,7 +310,7 @@
                                    </div>
                                    <!--隐藏字段-->
                                    <div class="layui-row" style="display:none;">
                                    <!--<div class="layui-row" style="display:none;">
                                        <div class="layui-inline">
                                            <div class="layui-input-block">
                                                <input class="layui-input" name="HMainSourceInterID" id="HMainSourceInterID" value="0" autocomplete="off">
@@ -307,7 +319,7 @@
                                                <input class="layui-input" name="HMainSourceBillType" id="HMainSourceBillType" value="" autocomplete="off">
                                            </div>
                                        </div>
                                    </div>
                                    </div>-->
                                </div>
                            </div>
                            <!--其他信息-->
@@ -404,11 +416,19 @@
                            </div>
                        </div>
                    </div>
                    <table id="mainTable" lay-filter="mainTable"></table>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                        </div>
                    </script>
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        layui.config({
@@ -446,7 +466,7 @@
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            //#endregion
            //#endregion
@@ -464,12 +484,16 @@
                //销售员、销售部门、销售主管初始化
                getCzyglByUser();
                //初始化子表
                set_InitGrid();
            }
            else if (OperationType == 3) {                                                 //编辑
            else if (OperationType == 3) {//编辑
                //初始化子表
                set_InitGrid();
                if (closeType == 10) {
                    $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                    $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);
                }
                //加载编辑页面
                RoadBillMain(linterid);
@@ -490,10 +514,54 @@
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {   //监听mainTable表格上的工具栏事件 è§¦å‘回调函数obj参数
                var checkStatus = table.checkStatus('mainTable')  //  ç›‘听选中的的状态
                    , data = checkStatus.data;          //从选中状态中提取数据,这些数据是表格中被选中的行
                switch (obj.event) { // switch (obj.event)用于根据obj.event的值来决定执行哪个case块
                    ////列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                }
            });
            //#region è¡Œå†…事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
            });
            //#endregion
            //#region è¡Œå†…删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
            }
            //#endregion
            //#region å¼¹çª—选择触发事件
            //#region é€‰æ‹©é”€å”®éƒ¨é—¨æŒ‰é’®
            form.on('submit(HDeptList)', function () {
                get_checkDept();
            });
            //#endregion
            //#region é€‰æ‹©æºå•按钮
            form.on('submit(HMainSource)', function () {
                get_checkMainSource();
            });
            //#endregion
@@ -569,7 +637,7 @@
                    var HGiftRate = $("#HGiftRate").val() * 1;              //赠送比例
                    var HGiftMoney = HSumMoney * HGiftRate * 0.01;
                    HGiftMoney = dealDoubleToFixed(HGiftMoney,2);
                    HGiftMoney = dealDoubleToFixed(HGiftMoney, 2);
                    $("#HSumMoney").val(HSumMoney);
                    $("#HDiscountRate").val(HDiscountRate);
@@ -614,7 +682,7 @@
                var HSumMoney = $("#HSumMoney").val() * 1;                       //金额
                var HGiftRate = $("#HGiftRate").val() * 1;              //赠送比例
                var HGiftMoney = HSumMoney * HGiftRate * 0.01;
                HGiftMoney = dealDoubleToFixed(HGiftMoney,2);
                HGiftMoney = dealDoubleToFixed(HGiftMoney, 2);
                $("#HGiftMoney").val(HGiftMoney);
            });
@@ -762,6 +830,70 @@
            }
            //#endregion
            //#region å­è¡¨åˆå§‹åŒ–
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , totalRow: true
                    , limit: 500
                    , height: 500
                    , loading: false
                    , cols: [[ //子表
                        { type: 'checkbox', totalRowText: '合计行' }
                        , { type: 'numbers', title: '序号', width: 100 }
                        , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: '物料代码', title: '物料代码', width: 150, style: 'background-color:#efefef4d;' }
                        , { field: '物料名称', title: '物料名称', width: 150, style: 'background-color:#efefef4d;' }
                        , { 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;' }
                        , { field: 'HQty', title: '数量', width: 100, edit: 'text'}
                        , { field: 'HPrice', title: '单价', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HMoney', title: '结算金额', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HReceiveBillInterID', title: '接收源单内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HReceiveBillEntryID', title: '接收源单子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HReceiveBillNo', title: '接收源单号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceDate', title: '源单日期', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceMoney', title: '源单金额', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceMoneyBB', title: '源单金额本位币', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HInovceExRate', title: '当期汇率', width: 100, style: 'background-color:#efefef4d;' }
                        //, { field: 'HReadyCheckMoney', title: '已核销金额', width: 100 }
                        //, { field: 'HUnCheckMoney', title: '未核销金额', width: 100 }
                        //, { field: 'HCheckMoney', title: '本次核销金额', width: 100}
                        //, { field: 'HCheckMoneyBB', title: '本次核销金额', width: 100}
                        , { field: 'HSourceRemark', title: '源单备注', width: 100 }
                        , { field: 'HSourceInterID', title: '源单内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceBillNo', title: '源单号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HRelationQty', title: '关联数量', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HRelationMoney', title: '关联金额', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HPOOrderInterID', title: '采购订单内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HPOOrderBillNo', title: '采购订单号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSeOrderInterID', title: '销售订单内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSeOrderEntryID', title: '销售订单子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HSeOrderBillNo', title: '销售订单号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HPOContractInterID', title: '采购合同内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HPOContractEntryID', title: '采购合同子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HPOContractBillNo', title: '采购合同号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HSeContractInterID', title: '销售合同内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HSeContractEntryID', title: '销售合同子内码', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        //, { field: 'HSeContractBillNo', title: '销售合同号', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                    ]]
                }
                option.data = [];
                table.render(option);
            }
            //#endregion
            //#region æ—¶é—´ç»„件初始化
            function set_InitDate() {
                var dateList = ["#HAccDate"];
@@ -887,7 +1019,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '业务客户列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_CustomerList.html?Type=1&openType=3&HEmp='+HEmpID, 'yes']
                    , content: ['../../Baseset/基础资料/Gy_CustomerList.html?Type=1&openType=3&HEmp=' + HEmpID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1009,8 +1141,129 @@
                })
            }
            //#endregion
            //#region é€‰æ‹©æºå•
            function get_checkMainSource() {
                var url = "";
                var HOrgID = $("#HOrgID").val();
                url = "../../销售管理/应收单/Xs_ReceivableBillList.html?openType=2&HOrgID=" + HOrgID;
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '源单-应收单' + '列表'//标题
                    , shift: 2//弹出动画
                    , content: [url, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        setReceivableBill(checkStatus);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
            //#endregion
            //#region é€‰æ‹©æºå•-应收单
            function setReceivableBill(checkStatus) {
                var dataArray = [];
                for (var i = 0; i < checkStatus.data.length; i++) {
                    var temp = checkStatus.data[i];
                    if (temp != "none") {
                        if (temp.单据状态 != "已审核") {
                            layer.msg("下推失败!单据号【" + temp.单据号 + "】单据状态不为已审核状态!");
                            return;
                        }
                        if (temp.行状态 == "已关闭") {
                            layer.msg("下推失败!单据号【" + temp.单据号 + "】下选中的记录中存在已关闭状态的记录!");
                            return;
                        }
                        dataArray.push(temp);
                    } else {
                        return;
                    }
                }
                form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                    "HMainSourceInterID": 0
                    , "HMainSourceEntryID": 0
                    , "HMainSourceBillNo": ''
                    , "HMainSourceBillType": '1114'
                    , "HDeptID": dataArray[0].HDeptID
                    , "HDeptName": dataArray[0].部门
                    , "HEmpID": dataArray[0].HEmpID
                    , "HEmpName": dataArray[0].业务员
                    , "HCurID": dataArray[0].HCurID
                    , "HCurName": dataArray[0].币别
                    , "HExRate": dataArray[0].汇率
                    , "HSSID": dataArray[0].HSSID
                    , "HSSName": dataArray[0].结算方式
                    , "HCusID": dataArray[0].HCusID
                    , "HCusName": dataArray[0].客户
                    /*, "HSSNum": checkStatus[0].结算号*/
                    , "HSumMoney": dataArray[0].金额
                });
                //子表  èµ‹å€¼
                var rowdata = [];
                var sumMoney = 0;
                for (var i = 0; i < dataArray.length; i++) {
                    sumMoney = sumMoney + dealDoubleToFixed(dataArray[i].金额, 2);
                    rowdata.push(
                        {
                            "HMaterID": dataArray[i].HMaterID == null ? 0 : dataArray[i].HMaterID
                            , "物料代码": dataArray[i].物料代码
                            , "物料名称": dataArray[i].物料名称
                            , "规格型号": dataArray[i].规格型号
                            , "HUnitID": dataArray[i].HUnitID == null ? 0 : dataArray[i].HUnitID
                            , "计量单位": dataArray[i].计量单位
                            , "HQty": dealDoubleToFixed(dataArray[i].数量, 1)
                            , "HPrice": dealDoubleToFixed(dataArray[i].单价, 3)                                                   //
                            , "HMoney": dealDoubleToFixed(dataArray[i].金额, 2)
                            , "HReceiveBillInterID": dataArray[i].hmainid
                            , "HReceiveBillEntryID": dataArray[i].hsubid
                            , "HReceiveBillNo": dataArray[i].单据号
                            , "HSourceDate": Format(dataArray[i].日期, "yyyy-MM-dd")
                            , "HSourceMoney": dealDoubleToFixed(dataArray[i].金额, 2)
                            , "HSourceMoneyBB": dealDoubleToFixed(dataArray[i].金额 * dataArray[0].汇率, 2)
                            , "HInovceExRate": dataArray[i].汇率
                            , "HSourceRemark": dataArray[i].表体备注
                            , "HSourceInterID": dataArray[i].hmainid
                            , "HSourceEntryID": dataArray[i].hsubid
                            , "HSourceBillNo": dataArray[i].单据号
                            , "HSourceBillType": 1114
                            , "HRelationQty": "0"
                            , "HRelationMoney": "0"
                            , 'HPOOrderInterID': dataArray[i].HPOOrderInterID
                            , 'HPOOrderEntryID': dataArray[i].HPOOrderEntryID
                            , 'HPOOrderBillNo': dataArray[i].HPOOrderBillNo
                            , "HSeOrderInterID": dataArray[i].HSeOrderInterID
                            , "HSeOrderEntryID": dataArray[i].HSeOrderEntryID
                            , "HSeOrderBillNo": dataArray[i].HSeOrderBillNo
                        }
                    );
                }
                $("#HSumMoney").val(sumMoney);
                $("#HRelSumMoney").val(sumMoney);
                option.data = rowdata;
                table.render(option);
            }
            //#endregion
            //#endregion
            //#region ä¿å­˜HMaker
            function set_AddNew(data) {
                //获取操作方式
@@ -1033,7 +1286,21 @@
                //获取表头数据并序列化
                var sMainStr = JSON.stringify(data.field);              //主表数据
                var sSubStr = JSON.stringify([]);                     //子表数据
                //获取表头数据并序列化
                var sMainStr = JSON.stringify(data.field);              //主表数据
                //子表数据
                if (table.cache["mainTable"].length != 0) {
                    var num = [];
                    for (var i = 0; i < table.cache["mainTable"].length; i++) {
                        if (table.cache["mainTable"][i] != "") {
                            table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                            num.push(table.cache["mainTable"][i])
                        }
                    }
                    var sSubStr = JSON.stringify(num);
                } else {
                    var sSubStr = JSON.stringify([]);
                }
                //拼接序列化的数据
                var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav + ';' + sessionStorage["HUserName"];
@@ -1131,7 +1398,59 @@
                            });
                            HOrgIDBar = data.HOrgID == null ? 0 : data.HOrgID;
                            if (data.hsubid != null) {
                                //子表  èµ‹å€¼
                                var rowdata = [];
                                var allMoney = 0;
                                for (var i = 0; i < result.data.length; i++) {
                                    rowdata.push(
                                        {
                                            "HMaterID": result.data[i].子表主键 == null ? 0 : result.data[i].子表主键
                                            , "物料代码": result.data[i].物料代码
                                            , "物料名称": result.data[i].物料名称
                                            , "规格型号": result.data[i].规格型号
                                            , "HUnitID": result.data[i].HUnitID == null ? 0 : result.data[i].HUnitID
                                            , "计量单位": result.data[i].计量单位名称
                                            , "HQty": dealDoubleToFixed(result.data[i].数量, 1)
                                            , "HPrice": dealDoubleToFixed(result.data[i].单价, 3)                                                   //
                                            , "HMoney": dealDoubleToFixed(result.data[i].结算金额, 2)
                                            , "HReceiveBillInterID": result.data[i].源单主内码
                                            , "HReceiveBillEntryID": result.data[i].源单子内码
                                            , "HReceiveBillNo": result.data[i].源单单号
                                            , "HSourceDate": Format(result.data[i].源单日期, "yyyy-MM-dd")
                                            , "HSourceMoney": dealDoubleToFixed(result.data[i].源单金额, 2)
                                            , "HSourceMoneyBB": dealDoubleToFixed(result.data[i].源单金额本位币, 2)
                                            , "HInovceExRate": result.data[i].当期汇率
                                            , "HSourceRemark": result.data[i].源单备注
                                            , "HSourceInterID": result.data[i].源单主内码
                                            , "HSourceEntryID": result.data[i].源单子内码
                                            , "HSourceBillNo": result.data[i].源单单号
                                            , "HSourceBillType": 1114
                                            , "HRelationQty": result.data[i].关联数量
                                            , "HRelationMoney": result.data[i].关联金额
                                            , 'HPOOrderInterID': result.data[i].采购订单主内码
                                            , 'HPOOrderEntryID': result.data[i].采购订单子内码
                                            , 'HPOOrderBillNo': result.data[i].采购订单号
                                            , "HSeOrderInterID": result.data[i].销售订单主内码
                                            , "HSeOrderEntryID": result.data[i].销售订单子内码
                                            , "HSeOrderBillNo": result.data[i].销售订单号
                                        }
                                    );
                                    allMoney = Number(result.data[i]["结算金额"]) + allMoney
                                }
                                option.data = rowdata;
                                table.render(option);
                                //设置主表金额
                                $("#HSumMoney").val(allMoney);
                                var HDiscountRate = $("#HDiscountRate").val() * 1;      //整单折扣
                                var HRelSumMoney = allMoney * HDiscountRate * 0.01;    //折扣后金额
                                $("#HRelSumMoney").val(HRelSumMoney);
                            }
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
@@ -1248,7 +1567,7 @@
                    return false;
                }
                if ($("#HSSID").val() == "0") {
                    layer.msg("结算方式未选择!");
@@ -1362,6 +1681,133 @@
                return HSourceBillData;
            }
            //#endregion
            //#endregion
            //#region éšè—åˆ—设置
            function get_HideColumn() {
                var colName = "";
                for (var i = 1; i < option.cols[0].length; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //#endregion
            //#region æ˜¾ç¤ºåˆ—数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "HBillType", "HSupID", "业务状态", "HUnitID", "供应商代码", "业务员代码", "HPriority", "HPSStyleID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid", "HMaterID"];//不需要显示的字段 å¯æ‰©å±•
                            var newCols = [[]];//对应数据库列顺序col
                            newCols[0].push(option.cols[0][0]);//放入第一个checkbox
                            dataCol = data1.data[0].HGridString.split(',');
                            //列设置列数与页面列数是否一致
                            if (dataCol.length == option.cols[0].length - 1) {
                                //遍历寻找列设置对应列按顺序插入
                                for (var j = 0; j < option.cols[0].length - 1; j++) {
                                    for (var i = 0; i < option.cols[0].length - 1; i++) {
                                        var dataCols = dataCol[j].split('|');
                                        //选择与datacols相应列进行修改
                                        if (option.cols[0][i + 1]["field"] == dataCols[4]) {
                                            //隐藏列
                                            if (dataCols[1] == 1) {
                                                option.cols[0][i + 1]["hide"] = true;
                                            }
                                            //设置列宽
                                            if (dataCols[3] > 0) {
                                                option.cols[0][i + 1]["width"] = dataCols[3];
                                            }
                                            //设置内容字体大小
                                            if (data1.data[0].HFontSize != 0) {
                                                option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                            } else {
                                                option.cols[0][i + 1]["style"] = "font-size:100%";
                                            }
                                            //显示列
                                            if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                                option.cols[0][i + 1]["hide"] = false;
                                            }
                                            //字体所在位置(å·¦ å±…中 å³)
                                            switch (dataCols[2]) {
                                                case "L":
                                                    option.cols[0][i + 1]["align"] = "left";
                                                    break;
                                                case "M":
                                                    option.cols[0][i + 1]["align"] = "center";
                                                    break;
                                                case "R":
                                                    option.cols[0][i + 1]["align"] = "right";
                                                    break;
                                            }
                                            newCols[0].push(option.cols[0][i + 1]);
                                        }
                                    }
                                }
                                //遍历循环后判断对应列数是否一致
                                if (dataCol.length == newCols[0].length - 1) {
                                    option.cols = newCols;
                                    //取消冻结列
                                    for (var i = 1; i < option.cols[0].length - 1; i++) {
                                        if (option.cols[0][i]["fixed"] != null) {
                                            option.cols[0][i]["fixed"] = null;
                                        }
                                        else {
                                            break;
                                        }
                                    }
                                    //冻结列
                                    if (data1.data[0].HFixCols != 0) {
                                        for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                            if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                                data1.data[0].HFixCols += 1;
                                            }
                                            option.cols[0][i + 1]["fixed"] = "left";
                                        }
                                    }
                                }
                            }
                            table.render(option);
                            var HBillType = "1102";
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        } else {
                            table.render(option);
                            var HBillType = "1102";
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //#endregion
            //#endregion
@@ -1577,7 +2023,7 @@
                }
            }
        }
                //#endregion
                    //#endregion
    </script>
</body>
</html>