chenhaozhe
2025-05-21 94853e46b9d4911fb4cf00389f00a4b820db5d3c
WebTM/views/ÖÊÁ¿¹ÜÀí/ÖÊÁ¿±¨±í/QC_RegistrationForTestingReport.html
@@ -102,6 +102,7 @@
                        </div>
                        <script type="text/html" id="toolbarDemo1">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>导出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            </div>
                        </script>
@@ -117,7 +118,7 @@
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
    }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable'], function () {
        //#region å…¬å…±å˜é‡
        var $ = layui.$
@@ -131,8 +132,9 @@
            , soulTable = layui.soulTable
        var sWhere = "";
        var option = [];
        var ins;                //用于导出excel
        var HModName = "QC_RegistrationForTestingReport";
        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//子表不需要显示的字段 å¯æ‰©å±•
        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID", "HInterIDLKY","HInterIDSZB"];//子表不需要显示的字段 å¯æ‰©å±•
        //#endregion
@@ -152,6 +154,9 @@
            switch (obj.event) {
                //列设置
                case 'set_HideColumn': get_HideColumn();
                    break;
                //导出按钮
                case 'btn_Export': btn_Export();
                    break;
            };
        });
@@ -216,20 +221,20 @@
            var columns = [];
            columns.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
            columns.push({ field: '日期', title: '日期', sort: true, width: 180});
            columns.push({ field: '日期', title: '日期', sort: true, width: 180 });
            columns.push({ field: '物料代码', title: '物料代码', sort: true, width: 180 });
            columns.push({ field: '物料', title: '物料', sort: true, width: 110 });
            columns.push({ field: '工序', title: '工序', sort: true, width: 110 });
            columns.push({ field: '批次号', title: '批次号', sort: true, width: 110 });
            columns.push({ field: '(1)产品单重/g', title: '(1)产品单重/g', sort: true, totalRow: true, width: 140});
            columns.push({ field: '(2)产品单重/g', title: '(2)产品单重/g', sort: true, totalRow: true, width: 140});
            columns.push({ field: '(3)产品单重/g', title: '(3)产品单重/g', sort: true, totalRow: true, width: 140});
            columns.push({ field: '送测内容', title: '送测内容', sort: true, width: 110});
            columns.push({ field: '送测数量', title: '送测数量', sort: true, totalRow: true, width: 110});
            columns.push({ field: '送测时间', title: '送测时间', sort: true, width: 180});
            columns.push({ field: '判定结果', title: '判定结果', sort: true, width: 110});
            columns.push({ field: '回收数量', title: '回收数量', sort: true, totalRow: true, width: 110});
            columns.push({ field: '回收时间', title: '回收时间', sort: true, width: 180});
            columns.push({ field: '(1)产品单重/g', title: '(1)产品单重/g', sort: true, totalRow: true, width: 140 });
            columns.push({ field: '(2)产品单重/g', title: '(2)产品单重/g', sort: true, totalRow: true, width: 140 });
            columns.push({ field: '(3)产品单重/g', title: '(3)产品单重/g', sort: true, totalRow: true, width: 140 });
            columns.push({ field: '送测内容', title: '送测内容', sort: true, width: 110 });
            columns.push({ field: '送测数量', title: '送测数量', sort: true, totalRow: true, width: 110 });
            columns.push({ field: '送测时间', title: '送测时间', sort: true, width: 180 });
            columns.push({ field: '判定结果', title: '判定结果', sort: true, width: 110 });
            columns.push({ field: '回收数量', title: '回收数量', sort: true, totalRow: true, width: 110 });
            columns.push({ field: '回收时间', title: '回收时间', sort: true, width: 180 });
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo1'
@@ -238,7 +243,7 @@
                //, cellMinWidth: 'auto'
                , totalRow: true
                , limit: 500
                , data:[]
                , data: []
                , limits: [50, 500, 5000, 20000]
                //, done: function (res, curr, count) {
                //    soulTable.render(this);
@@ -272,6 +277,20 @@
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else if (data[i].name == '三坐标') {//添加超链接
                                    col.push({
                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '三坐标', templet: function (d) {
                                            return '<span style="color: blue;">' + d.三坐标 + '</span>'
                                        }, style: 'cursor: pointer;'
                                    });
                                }
                                else if (data[i].name == '轮廓仪') {//添加超链接
                                    col.push({
                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '轮廓仪', templet: function (d) {
                                            return '<span style="color: blue;">' + d.轮廓仪 + '</span>'
                                        }, style: 'cursor: pointer;'
                                    });
                                }
                                else {
                                    switch (data[i].Type) {
@@ -311,15 +330,10 @@
                            option.data = data1.data
                        }
                        table.render(option);
                        ins = table.render(option);
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                        //    ColFilter();
                        //}
                        layer.close(ajaxLoad);
                    } else {
@@ -343,10 +357,10 @@
            var HProject = $("#HProject").val();//项目号
            var HBatchWork = $("#HBatchWork").val();//是否量产
            var HDivisionName = $("#HDivisionName").val();//事业部
            sWhere = {
                HBeginDate: HBeginDate
                ,HEndDate: HEndDate
                , HEndDate: HEndDate
                , HMaterID: HMaterID
                , HBatchNo: HBatchNo
                , HProject: HProject
@@ -422,6 +436,126 @@
        //#endregion
        table.on('tool(mainTable)', function (obj) {
            var data = obj.data;
            if (obj.event == '三坐标') {
                const HBillNo = data.三坐标.substring(0, 2);
                var linterid = data.HInterIDSZB;
                if (HBillNo == "SJ") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看首件检验单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
                else if (HBillNo == "XJ") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看巡检记录单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
                else if (HBillNo == "GX") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看末检检验单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../工序检验单/QC_ProcessCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
            }
            if (obj.event == '轮廓仪') {
                const HBillNo = data.轮廓仪.substring(0, 2);
                var linterid = data.HInterIDLKY;
                if (HBillNo == "SJ") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看首件检验单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
                else if (HBillNo == "XJ") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看巡检记录单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
                else if (HBillNo == "GX") {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看末检检验单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../工序检验单/QC_ProcessCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
            }
        });
        //#region å¯¼å‡ºExecel
        function btn_Export() {
            table.exportFile(ins.config.id, option.data, "xls");
        }
        //#endregion
        //隐藏列设置
        function get_HideColumn() {
            var colName = "";