yangle
2023-12-22 9cf675865b67bc94ee6c97c2fb61b9ef2e825f6a
逆向追溯查询报表
质量追溯查询报表
3个文件已修改
852 ■■■■ 已修改文件
WebTM/views/index.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/BadQueryReport.html 341 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/RetrospectiveQueryReport.html 507 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index.html
@@ -606,8 +606,8 @@
                                        <dd><a lay-href="车间管理/单品过站/Cj_ProcessItemBGA.html">工序单品返修台</a></dd>
                                        <!--<dd><a lay-href="车间管理/单品过站/Cj_ProcessItemBGA_PJGH.html">工序单品返修台(配件更换)</a></dd>-->
                                        <dd><a lay-href="车间管理/单品过站/Sc_SourceLineRepairBillList.html">返修记录列表</a></dd>
                                        <dd><a lay-href="车间管理/单品过站/RetrospectiveQueryReport.html">合格追溯查询报表</a></dd>
                                        <dd><a lay-href="车间管理/单品过站/BadQueryReport.html">不良追溯查询报表</a></dd>
                                        <dd><a lay-href="车间管理/单品过站/RetrospectiveQueryReport.html">质量追溯查询</a></dd>
                                        <dd><a lay-href="车间管理/单品过站/BadQueryReport.html">逆向追溯查询报表</a></dd>
                                    </dl>
                                </dd>
                            </dl>
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/BadQueryReport.html
@@ -2,7 +2,7 @@
<html>
<head>
    <meta charset="utf-8" />
    <title>不良追溯查询报表</title>
    <title>逆向追溯查询报表</title>
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -26,21 +26,27 @@
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">生产订单号</label>
                                    <label class="layui-form-label">物料编码</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" value="">
                                        <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" value="">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 76px;">产品条码</label>
                                    <label class="layui-form-label">物料名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBardCode" id="HBardCode" value="">
                                        <input type="text" class="layui-input" name="HMaterName" id="HMaterName" value="" style="background-color: #efefef4d;" readonly>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">流转卡号</label>
                                    <label class="layui-form-label" style="width: 76px;">规格型号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo" value="">
                                        <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" value="" style="background-color: #efefef4d;" readonly>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">批次号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBatchNo" id="HBatchNo">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
@@ -81,10 +87,41 @@
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">流转卡清单</li>
                                <li>产品码绑定清单</li>
                                <li>出入库记录</li>
                                <!--<li>相关库存清单</li>-->
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <!--流转卡清单-->
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--产品码绑定清单-->
                                    <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--出入库记录-->
                                    <table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--相关库存清单-->
                                    <table class="layui-hide" id="mainTable4" lay-filter="mainTable4"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo1">
                            <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>
                        <script type="text/html" id="toolbarDemo5">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn5"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            </div>
                        </script>
                    </form>
@@ -112,8 +149,14 @@
            , laydate = layui.laydate
            , soulTable = layui.soulTable
        var sWhere = "";
        var option = [];
        var HModName = "BadQueryReport";
        var option1 = [];
        var option2 = [];
        var option3 = [];
        var option4 = [];
        var option5 = [];
        var option6 = [];
        var option7 = [];
        var HModName = "RetrospectiveQueryReport";
        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//子表不需要显示的字段 å¯æ‰©å±•
        //#endregion
@@ -130,7 +173,7 @@
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        // å¤´å·¥å…·æ äº‹ä»¶
        table.on('toolbar(mainTable)', function (obj) {
        table.on('toolbar(mainTable1)', function (obj) {
            switch (obj.event) {
                //列设置
                case 'set_HideColumn': get_HideColumn();
@@ -152,15 +195,15 @@
            //查询
            get_FastQuery();
        }
        // æŸ¥è¯¢
        function get_Display(sWhere) {
        // æµè½¬å¡æ¸…单
        function get_Display1(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/BadQueryReport',
                url: GetWEBURL() + '/Cj_SingleStation/Sc_ProcessExchangeBillMainList',
                type: "GET",
                data: { "HBardCode": $("#HBardCode").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                async: false,
                data: { "HMaterNumber": $("#HMaterNumber").val(), "HBatchNo": $("#HBatchNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
@@ -189,9 +232,9 @@
                        }
                        //动态显示列名
                        option = {
                            elem: '#mainTable'
                            , toolbar: '#toolbarDemo'
                        option1 = {
                            elem: '#mainTable1'
                            , toolbar: '#toolbarDemo1'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
@@ -204,7 +247,12 @@
                                soulTable.render(this);
                            }
                        }
                        table.render(option);
                        table.render(option1);
                        if ($("#HBardCode").val() != "" && data1.data.length != 0) {
                            $("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
                            $("#HProcExchBillNo").val(data1.data[0]["流转卡"]);
                        }
                        //刷新表格数据
                        DisPlay_HideColumn();
@@ -225,8 +273,203 @@
            });
        }
        // äº§å“ç ç»‘定清单
        function get_Display2(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/HBardcodeList',
                type: "GET",
                async: false,
                data: { "HMaterNumber": $("#HMaterNumber").val(), "HBatchNo": $("#HBatchNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option2 = {
                            elem: '#mainTable2'
                            , toolbar: '#toolbarDemo1'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option2);
                        if ($("#HBardCode").val() != "" && data1.data.length != 0) {
                            $("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
                            $("#HProcExchBillNo").val(data1.data[0]["流转卡"]);
                        }
                        //刷新表格数据
                        DisPlay_HideColumn();
                        if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            ColFilter();
                        }
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //出入库记录
        function get_Display3(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/BardCodeOutInList',
                type: "GET",
                async: false,
                data: { "HMaterNumber": $("#HMaterNumber").val(), "HBatchNo": $("#HBatchNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option3 = {
                            elem: '#mainTable3'
                            , toolbar: '#toolbarDemo3'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option3);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //相关库存清单
        function get_Display4(sWhere) {
            var sWhere = " and HMaterSN='" + HBardcode + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        //动态显示列名
                        option4 = {
                            elem: '#mainTable4'
                            , toolbar: '#toolbarDemo4'
                            , cols: [[
                                { type: 'checkbox', fixed: 'left' }
                                , { type: 'numbers', title: '序号' }
                                , { field: 'HICMOBillNo', title: '生产订单' }
                                , { field: 'HDate', title: '日期' }
                                , { field: 'HMaterNumber', title: '配件物料编码' }
                                , { field: 'HMaterName', title: '配件物料名称' }
                                , { field: 'HBarCode', title: '配件SN码' }
                                , { field: 'HMaterSN', title: '产品SN码' }
                            ]]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option4);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        // å¿«é€Ÿè¿‡æ»¤
        function get_FastQuery() {
            var ColName = $("#ColName").val();//复选框
            var Comparator = $("#Comparator").val()
            var ColContent = $("#ColContent").val();
@@ -253,7 +496,13 @@
                com = " and (" + ColName + " " + com + ")";
            }
            get_Display(sWhere);
            sWhere += com;
            get_Display1(sWhere);//流转卡清单
            get_Display2(sWhere);//产品码绑定清单
            get_Display3(sWhere);//出入库记录
            //get_Display4(HBardCode);//相关库存清单
            sWhere = "";//调用接口后清空sWhere缓存
        }
@@ -261,8 +510,8 @@
        function get_HideColumn() {
            var colName = "";
            var contentUrl = "";
            for (var i = 1; i < option.cols[0].length - 1; i++) {
                colName += option.cols[0][i]["title"] + ",";
            for (var i = 1; i < option1.cols[0].length - 1; i++) {
                colName += option1.cols[0][i]["title"] + ",";
            }
            var urlStr = window.document.location.pathname;//获取文件路径
            var urlLen = urlStr.split('/');
@@ -307,50 +556,50 @@
                        dataCol = data1.data[0].HGridString.split(',');
                        for (var i = 0; i < option.cols[0].length - 2; i++) {
                        for (var i = 0; i < option1.cols[0].length - 2; i++) {
                            var dataCols = dataCol[i].split('|');
                            //隐藏列
                            if (dataCols[1] == 1) {
                                option.cols[0][i + 1]["hide"] = true;
                                option1.cols[0][i + 1]["hide"] = true;
                            }
                            //设置列宽
                            if (dataCols[3] > 0) {
                                option.cols[0][i + 1]["width"] = dataCols[3];
                                option1.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;";
                                option1.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                            } else {
                                option.cols[0][i + 1]["style"] = "font-size:100%";
                                option1.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;";
                            //    option1.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                            //} else {
                            //    option.cols[0][i + 1]["width"] = "";
                            //    option1.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;
                            if (dataCols[1] == 0 && $.inArray(option1.cols[0][i + 1]["title"], titleData) == -1) {
                                option1.cols[0][i + 1]["hide"] = false;
                            }
                            //字体所在位置(å·¦ å±…中 å³)
                            switch (dataCols[2]) {
                                case "L":
                                    option.cols[0][i + 1]["align"] = "left";
                                    option1.cols[0][i + 1]["align"] = "left";
                                    break;
                                case "M":
                                    option.cols[0][i + 1]["align"] = "center";
                                    option1.cols[0][i + 1]["align"] = "center";
                                    break;
                                case "R":
                                    option.cols[0][i + 1]["align"] = "right";
                                    option1.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;
                        for (var i = 1; i < option1.cols[0].length - 1; i++) {
                            if (option1.cols[0][i]["fixed"] != null) {
                                option1.cols[0][i]["fixed"] = null;
                            }
                            else {
                                break;
@@ -359,15 +608,15 @@
                        //冻结列
                        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) {
                                if ($.inArray(option1.cols[0][i + 1]["title"], titleData) != -1) {
                                    data1.data[0].HFixCols += 1;
                                }
                                option.cols[0][i + 1]["fixed"] = "left";
                                option1.cols[0][i + 1]["fixed"] = "left";
                            }
                        }
                        table.render(option);
                        table.render(option1);
                    } else {
                        table.render(option);
                        table.render(option1);
                    }
                }, error: function () {
                    layer.alert("接口请求失败!", { icon: 5 });
@@ -378,9 +627,9 @@
        // åˆ—明显示下拉框
        function ColFilter() {
            var Organization = '<option  value="0" selected="selected" ></option>';
            for (var i = 1; i < option.cols[0].length; i++) {
                if (option.cols[0][i].hide != true) {
                    Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
            for (var i = 1; i < option1.cols[0].length; i++) {
                if (option1.cols[0][i].hide != true) {
                    Organization += '<option  style="color:blue;" value="' + option1.cols[0][i].field + '">' + option1.cols[0][i].field + '</option>';
                }
            }
            $("#ColName").empty();
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/RetrospectiveQueryReport.html
@@ -2,7 +2,7 @@
<html>
<head>
    <meta charset="utf-8" />
    <title>合格追溯查询报表</title>
    <title>质量追溯查询报表</title>
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -28,7 +28,7 @@
                                <div class="layui-inline">
                                    <label class="layui-form-label">生产订单号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo"  value="">
                                        <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" value="">
                                    </div>
                                </div>
                                <div class="layui-inline">
@@ -40,7 +40,7 @@
                                <div class="layui-inline">
                                    <label class="layui-form-label">流转卡号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo"  value="">
                                        <input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
@@ -49,7 +49,7 @@
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                    <div class="layui-row" style="margin-top:10px;margin-left:5%;">
                                    </div>
                                    <div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
                                        <div class="layui-inline">
@@ -81,10 +81,56 @@
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">进出站记录</li>
                                <li>不良汇报记录</li>
                                <li>工艺参数记录</li>
                                <li>配件清单</li>
                                <li>返修记录</li>
                                <li>配件变更记录</li>
                                <!--<li>出入库记录</li>-->
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <!--进出站记录-->
                                    <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--不良汇报记录-->
                                    <table class="layui-hide" id="mainTable5" lay-filter="mainTable5"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--工艺参数记录-->
                                    <table class="layui-hide" id="mainTable7" lay-filter="mainTable7"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--配件清单-->
                                    <table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--返修记录-->
                                    <table class="layui-hide" id="mainTable6" lay-filter="mainTable6"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--配件变更记录-->
                                    <table class="layui-hide" id="mainTable4" lay-filter="mainTable4"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <!--出入库记录-->
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo1">
                            <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>
                        <script type="text/html" id="toolbarDemo5">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn5"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            </div>
                        </script>
                    </form>
@@ -112,7 +158,13 @@
            , laydate = layui.laydate
            , soulTable = layui.soulTable
        var sWhere = "";
        var option = [];
        var option1 = [];
        var option2 = [];
        var option3 = [];
        var option4 = [];
        var option5 = [];
        var option6 = [];
        var option7 = [];
        var HModName = "RetrospectiveQueryReport";
        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//子表不需要显示的字段 å¯æ‰©å±•
@@ -130,7 +182,7 @@
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        // å¤´å·¥å…·æ äº‹ä»¶
        table.on('toolbar(mainTable)', function (obj) {
        table.on('toolbar(mainTable2)', function (obj) {
            switch (obj.event) {
                //列设置
                case 'set_HideColumn': get_HideColumn();
@@ -138,6 +190,34 @@
            };
        });
        table.on('row(mainTable2)', function (obj) {
            var HBardcode = obj.data["条码"];
            get_Display3(HBardcode);//配件清单
            get_Display6(HBardcode);//返修记录
            get_Display7(HBardcode);//工艺参数
        })
        table.on('row(mainTable5)', function (obj) {
            var HBardcode = obj.data["条码"];
            get_Display3(HBardcode);//配件清单
            get_Display6(HBardcode);//返修记录
            get_Display7(HBardcode);//工艺参数
        })
        table.on('row(mainTable6)', function (obj) {
            var HBardcode = obj.data["SN码"];
            get_Display4(HBardcode);//配件变更记录
        })
        table.on('toolbar(mainTable5)', function (obj) {
            switch (obj.event) {
                //列设置
                case 'set_HideColumn5': get_HideColumn5();
                    break;
            };
        });
        //查询按钮
        form.on('submit(btnSearch)', function (data) {//选择仓位
            get_FastQuery();
@@ -153,13 +233,210 @@
            get_FastQuery();
        }
        // æŸ¥è¯¢
        function get_Display(sWhere) {
        // è¿›å‡ºç«™æŸ¥è¯¢
        function get_Display2(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/RetrospectiveQueryReport',
                url: GetWEBURL() + '/Cj_SingleStation/EntryAndExitRecords',
                type: "GET",
                async: false,
                data: { "HBardCode": $("#HBardCode").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option2 = {
                            elem: '#mainTable2'
                            , toolbar: '#toolbarDemo1'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option2);
                        //if ($("#HBardCode").val() != "" && data1.data.length != 0) {
                        //    $("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
                        //    $("#HProcExchBillNo").val(data1.data[0]["流转卡"]);
                        //}
                        //刷新表格数据
                        DisPlay_HideColumn();
                        if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            ColFilter();
                        }
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //配件清单
        function get_Display3(HBardcode) {
            var sWhere = " and äº§å“æ¡ç ='" + HBardcode + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Sc_AssemblyBill/list1',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option3 = {
                            elem: '#mainTable3'
                            , toolbar: '#toolbarDemo3'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option3);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //配件变更记录
        function get_Display4(HBardcode) {
            var sWhere = " and HMaterSN='" + HBardcode + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        //动态显示列名
                        option4 = {
                            elem: '#mainTable4'
                            , toolbar: '#toolbarDemo4'
                            , cols: [[
                                { type: 'checkbox', fixed: 'left' }
                                , { type: 'numbers', title: '序号' }
                                , { field: 'HICMOBillNo', title: '生产订单' }
                                , { field: 'HDate', title: '日期' }
                                , { field: 'HMaterNumber', title: '配件物料编码' }
                                , { field: 'HMaterName', title: '配件物料名称' }
                                , { field: 'HBarCode', title: '配件SN码' }
                                , { field: 'HMaterSN', title: '产品SN码' }
                            ]]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option4);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //不良汇报记录
        function get_Display5(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/BadQueryReport',
                type: "GET",
                async: false,
                data: { "HBardCode": $("#HBardCode").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
@@ -190,8 +467,8 @@
                        //动态显示列名
                        option = {
                            elem: '#mainTable'
                            , toolbar: '#toolbarDemo'
                            elem: '#mainTable5'
                            , toolbar: '#toolbarDemo5'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
@@ -206,13 +483,147 @@
                        }
                        table.render(option);
                        //刷新表格数据
                        DisPlay_HideColumn();
                        ////刷新表格数据
                        //DisPlay_HideColumn();
                        if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            ColFilter();
                        //if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                        //    ColFilter();
                        //}
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //返修记录
        function get_Display6(HBardcode) {
            var sWhere = " and SN码='" + HBardcode + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/ProcessItemRepair',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option6 = {
                            elem: '#mainTable6'
                            , toolbar: '#toolbarDemo6'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option6);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //工艺参数
        function get_Display7(HBardcode) {
            var sWhere = " and æ¡ç ='" + HBardcode + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/ProcessParameters',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
                                }
                            }
                        }
                        //动态显示列名
                        option7 = {
                            elem: '#mainTable7'
                            , toolbar: '#toolbarDemo7'
                            , cols: [col]
                            , data: data1.data
                            , height: 800
                            , page: true
                            , totalRow: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , done: function (res, curr, count) {
                                soulTable.render(this);
                            }
                        }
                        table.render(option7);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
@@ -227,10 +638,12 @@
        // å¿«é€Ÿè¿‡æ»¤
        function get_FastQuery() {
            var HBardCode = $("#HBardCode").val();
            var ColName = $("#ColName").val();//复选框
            var Comparator = $("#Comparator").val()
            var ColContent = $("#ColContent").val();
            var com = "";
            if (ColName != 0 && Comparator != 0) {
                switch (Comparator) {
@@ -253,7 +666,15 @@
                com = " and (" + ColName + " " + com + ")";
            }
            get_Display(sWhere);
            get_Display2(sWhere);
            get_Display5(sWhere);
            if (HBardCode != "") {
                get_Display3(HBardCode);//配件清单
                get_Display6(HBardCode);//返修记录
                get_Display7(HBardCode);//工艺参数
                get_Display4(HBardCode);//配件变更记录
            }
            sWhere = "";//调用接口后清空sWhere缓存
        }
@@ -261,8 +682,8 @@
        function get_HideColumn() {
            var colName = "";
            var contentUrl = "";
            for (var i = 1; i < option.cols[0].length - 1; i++) {
                colName += option.cols[0][i]["title"] + ",";
            for (var i = 1; i < option2.cols[0].length - 1; i++) {
                colName += option2.cols[0][i]["title"] + ",";
            }
            var urlStr = window.document.location.pathname;//获取文件路径
            var urlLen = urlStr.split('/');
@@ -307,50 +728,50 @@
                        dataCol = data1.data[0].HGridString.split(',');
                        for (var i = 0; i < option.cols[0].length - 2; i++) {
                        for (var i = 0; i < option2.cols[0].length - 2; i++) {
                            var dataCols = dataCol[i].split('|');
                            //隐藏列
                            if (dataCols[1] == 1) {
                                option.cols[0][i + 1]["hide"] = true;
                                option2.cols[0][i + 1]["hide"] = true;
                            }
                            //设置列宽
                            if (dataCols[3] > 0) {
                                option.cols[0][i + 1]["width"] = dataCols[3];
                                option2.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;";
                                option2.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                            } else {
                                option.cols[0][i + 1]["style"] = "font-size:100%";
                                option2.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;";
                            //    option2.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                            //} else {
                            //    option.cols[0][i + 1]["width"] = "";
                            //    option2.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;
                            if (dataCols[1] == 0 && $.inArray(option2.cols[0][i + 1]["title"], titleData) == -1) {
                                option2.cols[0][i + 1]["hide"] = false;
                            }
                            //字体所在位置(å·¦ å±…中 å³)
                            switch (dataCols[2]) {
                                case "L":
                                    option.cols[0][i + 1]["align"] = "left";
                                    option2.cols[0][i + 1]["align"] = "left";
                                    break;
                                case "M":
                                    option.cols[0][i + 1]["align"] = "center";
                                    option2.cols[0][i + 1]["align"] = "center";
                                    break;
                                case "R":
                                    option.cols[0][i + 1]["align"] = "right";
                                    option2.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;
                        for (var i = 1; i < option2.cols[0].length - 1; i++) {
                            if (option2.cols[0][i]["fixed"] != null) {
                                option2.cols[0][i]["fixed"] = null;
                            }
                            else {
                                break;
@@ -359,15 +780,15 @@
                        //冻结列
                        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) {
                                if ($.inArray(option2.cols[0][i + 1]["title"], titleData) != -1) {
                                    data1.data[0].HFixCols += 1;
                                }
                                option.cols[0][i + 1]["fixed"] = "left";
                                option2.cols[0][i + 1]["fixed"] = "left";
                            }
                        }
                        table.render(option);
                        table.render(option2);
                    } else {
                        table.render(option);
                        table.render(option2);
                    }
                }, error: function () {
                    layer.alert("接口请求失败!", { icon: 5 });
@@ -378,9 +799,9 @@
        // åˆ—明显示下拉框
        function ColFilter() {
            var Organization = '<option  value="0" selected="selected" ></option>';
            for (var i = 1; i < option.cols[0].length; i++) {
                if (option.cols[0][i].hide != true) {
                    Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
            for (var i = 1; i < option2.cols[0].length; i++) {
                if (option2.cols[0][i].hide != true) {
                    Organization += '<option  style="color:blue;" value="' + option2.cols[0][i].field + '">' + option2.cols[0][i].field + '</option>';
                }
            }
            $("#ColName").empty();