1
duhe
2023-11-03 e6cf55b13c472954c8ff3bc65f89b3e124cdc752
WebTM/views/ÖÊÁ¿¹ÜÀí/³ö³§¼ìÑéµ¥/QC_OutCompCheckBillList.html
@@ -15,6 +15,8 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
</head>
<body>
@@ -60,6 +62,7 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>反审核</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                            </div>
                        </script>
@@ -73,7 +76,7 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -82,14 +85,16 @@
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , soulTable = layui.soulTable
            var option = [];
            var sWhere = "";
            var HModName = "QC_OutCompCheckBillList";
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //初始化界面
            set_ClearBill();
            DisPlay_HideColumn();
            //#endregion
            //#region å¤´å·¥å…·æ äº‹ä»¶
@@ -116,6 +121,9 @@
                    ////预览按钮
                    //case 'get_PrintReport': get_PrintReport();
                    //    break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
@@ -157,32 +165,35 @@
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                        , { field: 'hsubid', title: 'hsubid', hide: true }
                        , { field: '日期', title: '日期', sort: true, width: 170 }
                        , { field: '单据号', title: '单据号', sort: true, width: 170 }
                        , { field: '表头备注', title: '表头备注', width: 105 }
                        , { field: '客户名称', title: '客户名称', width: 105}
                        , { field: '客户代码', title: '客户代码', width: 105}
                        , { field: '产品内码', title: '产品内码' }
                        , { field: '产品名称', title: '产品名称' }
                        , { field: '产品型号', title: '产品型号', width: 115 }
                        , { field: 'HProcCheckEmpID', title: 'HProcCheckEmpID', width: 200, hide: true }
                        , { field: '检验员代码', title: '检验员代码', width: 125 }
                        , { field: '检验员名称', title: '检验员名称', width: 125 }
                        , { field: '制单人', title: '制单人', width: 160 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '单据类型', title: '单据类型 ', width: 115 }
                        , { field: '表头备注', title: '表头备注', width: 105, sort: true }
                        , { field: '客户名称', title: '客户名称', width: 105, sort: true }
                        , { field: '客户代码', title: '客户代码', width: 105, sort: true }
                        , { field: '产品内码', title: '产品内码', sort: true }
                        , { field: '产品名称', title: '产品名称', sort: true }
                        , { field: '产品型号', title: '产品型号', width: 115, sort: true }
                        , { field: 'HProcCheckEmpID', title: 'HProcCheckEmpID', width: 200, hide: true, sort: true }
                        , { field: '检验员代码', title: '检验员代码', width: 125, sort: true }
                        , { field: '检验员名称', title: '检验员名称', width: 125, sort: true }
                        , { field: '制单人', title: '制单人', width: 160, sort: true }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 125, sort: true }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', width: 125, sort: true }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '关闭人', title: '关闭人', width: 125, sort: true }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '作废人', title: '作废人', width: 125, sort: true }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '单据类型', title: '单据类型 ', width: 115, sort: true }
                    ]]
                };
            }
@@ -195,7 +206,7 @@
                $.ajax({
                    url: GetWEBURL() + '/QC_OutCompCheckBill/GetOutCompCheckBillList',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
@@ -264,7 +275,7 @@
                        $.ajax({
                            url: GetWEBURL() + 'QC_OutCompCheckBill/DeltetOutCompCheckBill',
                            type: "GET",
                            data: { "HItemID": HItemID },
                            data: { "HItemID": HItemID, "user": sessionStorage["HUserName"]},
                            success: function (result) {
                                console.log('gouba' + result);
                                if (result.count == 1) {
@@ -352,6 +363,124 @@
            }
            //#endregion
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                var urlStr = window.document.location.pathname;//获取文件路径
                var urlLen = urlStr.split('/');
                for (var i = 0; i < urlLen.length - 4; i++) {
                    contentUrl += "../";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: [contentUrl, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //显示列数据
            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", "hsubid", "HProcCheckEmpID"];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                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 (data1.data[0].HColumnWidth != 0) {
                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                                //} else {
                                //    option.cols[0][i + 1]["width"] = "";
                                //}
                                //显示列
                                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;
                                }
                            }
                            //取消冻结列
                            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);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            ////#region æ¸…空过滤条件
            //function set_ClearQuery() {
            //    $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
@@ -365,21 +494,7 @@
                    //#endregion
                    //laydate.render({
                    //    elem: '#HDate'
                    //    , type: 'datetime'
                    //    , trigger: 'click'
                    //    , format:'yyyy-MM-dd HH:mm'
                    //});
                    //以上是layui模块
    </script>
</body>