WebTM/views/ÖÊÁ¿¹ÜÀí/ÖÊÁ¿±¨±í/QC_QualityTraceabilityReport.html
@@ -37,9 +37,13 @@
                                <div class="layui-row">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">生产订单号</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" id="HICMOBillNo" style="width:190px;">
                                            <input type="text" class="layui-input" id="HType" value="" style="width:190px;display:none;">
                                        <div class="layui-input-block" style="margin-left: 77px;">
                                            <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <input type="hidden" class="layui-input" name="HICMOInterID" id="HICMOInterID" value="0" style="background-color:#efefef4d;" readonly>
                                            <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" value="0">
                                            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchICMOBill" id="btnSearchICMOBill" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                            </button>
                                        </div>
                                    </div>
@@ -55,19 +59,23 @@
                            </div>
                        </div>
                        <div>
                            <div style="width:99%;height:calc(35vh);">
                            <div style="width:99%;height:calc(45vh);">
                                <div style="width:100px;height:23px; background: linear-gradient(-135deg, transparent 30px, #2baaca 0);"><span style="color:aliceblue;">首件检验单</span></div>
                                <table class="" id="mainTable_SJ" lay-filter="mainTable_SJ"></table>
                            </div>
                            <div style="width:99%;height:calc(35vh);">
                            <div style="width:99%;height:calc(45vh);">
                                <div style="width:100px;height:23px; background: linear-gradient(-135deg, transparent 30px, #2baaca 0);"><span style="color:aliceblue;">巡检记录单</span></div>
                                <table class="" id="mainTable_XJ" lay-filter="mainTable_XJ"></table>
                            </div>
                            <div style="width:99%;height:calc(45vh);">
                                <div style="width:100px;height:23px; background: linear-gradient(-135deg, transparent 30px, #2baaca 0);"><span style="color:aliceblue;">过程检验单</span></div>
                                <table class="" id="mainTable_GXJ" lay-filter="mainTable_GXJ"></table>
                            </div>
                            <div style="width:99%;height:calc(35vh);">
                            <div style="width:99%;height:calc(45vh);">
                                <div style="width:100px;height:23px; background: linear-gradient(-135deg, transparent 30px, #2baaca 0);"><span style="color:aliceblue;">生产汇报单</span></div>
                                <table class="" id="mainTable_SC" lay-filter="mainTable_SC"></table>
                            </div>
                            <div style="width:99%;height:calc(35vh);">
                            <div style="width:99%;height:calc(45vh);">
                                <div style="width:100px;height:23px; background: linear-gradient(-135deg, transparent 30px, #2baaca 0);"><span style="color:aliceblue;">质量汇报单</span></div>
                                <table class="" id="mainTable_ZL" lay-filter="mainTable_ZL"></table>
                            </div>
@@ -108,6 +116,7 @@
            var option_GCJ = [];//过程检验
            var option_SC = [];//生产汇报
            var option_ZL = [];//质量汇报
            var option_XJ = [];//巡检记录单
            var HModName = "QC_QualityTraceabilityReport";
            //#endregion
@@ -150,6 +159,46 @@
            form.on('submit(HideColumn)', function (data) {
                get_HideColumn();
            });
            //表头信息生产任务单弹窗
            form.on('submit(btnSearchICMOBill)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '生产任务单列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html?openType=3', '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('请选择数据');
                        }
                        $("#HICMOInterID").val(checkStatus.data[0].hmainid);
                        $("#HICMOEntryID").val(checkStatus.data[0].HEntryID);
                        $("#HICMOBillNo").val(checkStatus.data[0].单据号);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -163,13 +212,13 @@
                set_InitGrid();
                //加载数据到网格
                get_FastQuery();
                //DisPlay_HideColumn();
           }
            //初始化表格
            function set_InitGrid() {
                option_SJ = {
                    elem: '#mainTable_SJ'
                    , totalRow: true
                    //, toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
@@ -177,6 +226,7 @@
                };
                option_GCJ = {
                    elem: '#mainTable_GXJ'
                    , totalRow: true
                    //, toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
@@ -184,6 +234,7 @@
                };
                option_SC = {
                    elem: '#mainTable_SC'
                    , totalRow: true
                    //, toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
@@ -191,22 +242,29 @@
                };
                option_ZL = {
                    elem: '#mainTable_ZL'
                    , totalRow: true
                    //, toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
                    , height: 'full-490'
                };
                option_XJ = {
                    elem: '#mainTable_XJ'
                    , totalRow: true
                    //, toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
                    , height: 'full-490'
                }
            }
            //加载网格
            function get_Display1(sWhere) {
                var wait = layer.load();//遮罩
                var HICMOBillNo = $("#HICMOBillNo").val();
                $.ajax({
                    url: GetWEBURL() + '/QC_Report/QualityTraceability1',
                    type: "GET",
                    data: { "HICMOBillNo": HICMOBillNo, "HType": "" },
                    data: { "sWhere": sWhere, "HType": "" },
                    success: function (data1) {
                        var col = [];
                        if (data1.count == 1) {
@@ -227,7 +285,7 @@
                                            col.push({ field: data[i].name, 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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120 });
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true});
                                    }
                                }
                            }
@@ -248,12 +306,10 @@
            //加载网格
            function get_Display2(sWhere) {
                var wait = layer.load();//遮罩
                var HICMOBillNo = $("#HICMOBillNo").val();
                $.ajax({
                    url: GetWEBURL() + '/QC_Report/QualityTraceability2',
                    type: "GET",
                    data: { "HICMOBillNo": HICMOBillNo, "HType": "" },
                    data: { "sWhere": sWhere, "HType": "" },
                    success: function (data1) {
                        var col = [];
                        if (data1.count == 1) {
@@ -274,7 +330,7 @@
                                            col.push({ field: data[i].name, 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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120 });
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                    }
                                }
                            }
@@ -295,12 +351,10 @@
            //加载网格
            function get_Display3(sWhere) {
                var wait = layer.load();//遮罩
                var HICMOBillNo = $("#HICMOBillNo").val();
                $.ajax({
                    url: GetWEBURL() + '/QC_Report/QualityTraceability3',
                    type: "GET",
                    data: { "HICMOBillNo": HICMOBillNo, "HType": "" },
                    data: { "sWhere": sWhere, "HType": "" },
                    success: function (data1) {
                        var col = [];
                        if (data1.count == 1) {
@@ -321,7 +375,7 @@
                                            col.push({ field: data[i].name, 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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120 });
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                    }
                                }
                            }
@@ -342,10 +396,55 @@
            //加载网格
            function get_Display4(sWhere) {
                var wait = layer.load();//遮罩
                $.ajax({
                    url: GetWEBURL() + '/QC_Report/QualityTraceability4',
                    type: "GET",
                    data: { "sWhere": sWhere, "HType": "" },
                    success: function (data1) {
                        var col = [];
                        if (data1.count == 1) {
                            var data = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                            //判断是否是纯英文
                            var patrn = new RegExp("[\u4E00-\u9FA5]+");
                            for (var i = 0; i < data.length; i++) {
                                if (!patrn.test(data[i].name)) {
                                    col.push({ field: data[i].name, title: data[i].name, hide: true }); //隐藏列
                                }
                                else {
                                    switch (data[i].Type) {
                                        case 'DateTime':
                                            col.push({ field: data[i].name, 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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                    }
                                }
                            }
                            option_ZL.cols = [col];
                            option_ZL.data = data1.data;
                            table.render(option_ZL);
                            layer.close(wait);
                        } else {
                            layer.close(wait);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(wait);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //加载网格
            function get_Display5(sWhere) {
                var wait = layer.load();//遮罩
                var HICMOBillNo = $("#HICMOBillNo").val();
                $.ajax({
                    url: GetWEBURL() + '/QC_Report/QualityTraceability4',
                    url: GetWEBURL() + '/QC_Report/QualityTraceability5',
                    type: "GET",
                    data: { "HICMOBillNo": HICMOBillNo, "HType": "" },
                    success: function (data1) {
@@ -368,13 +467,13 @@
                                            col.push({ field: data[i].name, 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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120 });
                                            col.push({ field: data[i].name, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                    }
                                }
                            }
                            option_ZL.cols = [col];
                            option_ZL.data = data1.data;
                            table.render(option_ZL);
                            option_XJ.cols = [col];
                            option_XJ.data = data1.data;
                            table.render(option_XJ);
                            layer.close(wait);
                        } else {
                            layer.close(wait);
@@ -387,17 +486,22 @@
                });
            }
            //快速过滤
            function get_FastQuery() {
                var HICMOBillNo = $("#HICMOBillNo").val();
                sWhere = "'" + HICMOBillNo + "'"
                var HICMOInterID = $("#HICMOInterID").val();
                var HICMOEntryID = $("#HICMOEntryID").val();
                get_Display1(sWhere);
                get_Display2(sWhere);
                get_Display3(sWhere);
                get_Display4(sWhere);
                sWhere = {
                    HICMOBillNo: HICMOBillNo
                    , HICMOInterID: HICMOInterID
                    , HICMOEntryID: HICMOEntryID
                }
                get_Display1(JSON.stringify(sWhere));
                get_Display2(JSON.stringify(sWhere));
                get_Display3(JSON.stringify(sWhere));
                get_Display4(JSON.stringify(sWhere));
                get_Display5(JSON.stringify(sWhere));
                //调用接口后清空sWhere缓存
                sWhere = "";
            }
@@ -407,6 +511,9 @@
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HICMOBillNo").val("");
                $("#HICMOBillNo").val("");
                $("#HICMOInterID").val("0");
                $("#HICMOInterID").val("0");
                sWhere = " ";
                //get_FastQuery();
            }