yangle
2024-10-27 f6d6a3c0c65103cb4a58e4f929ed7a1c8da21b9a
WebTM/views/ÖÊÁ¿¹ÜÀí/ÖÊÁ¿±¨±í/QC_RegistrationForTestingReport.html
@@ -63,93 +63,34 @@
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <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">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
                                                <option value="10">不包含</option>
                                <div class="layui-row" style="margin-top:5px;margin-left:82px;margin-bottom:5px;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">是否量产</label>
                                        <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                            <select name="HBatchWork" id="HBatchWork" lay-verify="HBatchWork">
                                                <option value="">请选择</option>
                                                <option value="1">量产</option>
                                                <option value="0">非量产</option>
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                        </div>
                                    </div>
                                    <div class="layui-row" style=" margin-top: 10px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName1" id="ColName1" class="ForFilteringSchemes" lay-filter="ColName1" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator1" id="Comparator1" class="ForFilteringSchemes" lay-filter="Comparator1" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
                                                <option value="10">不包含</option>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">项目号</label>
                                        <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                            <select name="HProject" id="HProject" class=" ForFilteringSchemes" lay-verify="HProject">
                                                <!--动态渲染组织-->
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent1" id="ColContent1">
                                        </div>
                                    </div>
                                    <div class="layui-row" style=" margin-top: 10px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName2" id="ColName2" class="ForFilteringSchemes" lay-filter="ColName2" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator2" id="Comparator2" class="ForFilteringSchemes" lay-filter="Comparator2" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
                                                <option value="10">不包含</option>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">事业部</label>
                                        <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                            <select name="HDivisionName" id="HDivisionName" class=" ForFilteringSchemes" lay-verify="HDivisionName">
                                                <!--动态渲染组织-->
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent2" id="ColContent2">
                                        </div>
                                    </div>
                                </div>-->
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab layui-tab-card">
@@ -176,7 +117,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.$
@@ -239,7 +180,8 @@
        function set_ClearBill() {
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            //set_InitGrid();
            Get_HProject(); //获取项目号
            GetGy_Division();//获取事业部
            //查询
            get_FastQuery();
        }
@@ -274,20 +216,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'
@@ -296,7 +238,7 @@
                //, cellMinWidth: 'auto'
                , totalRow: true
                , limit: 500
                , data:[]
                , data: []
                , limits: [50, 500, 5000, 20000]
                //, done: function (res, curr, count) {
                //    soulTable.render(this);
@@ -330,6 +272,13 @@
                            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 {
                                    switch (data[i].Type) {
@@ -369,7 +318,7 @@
                            option.data = data1.data
                        }
                        table.render(option);
                        //刷新表格数据
@@ -398,110 +347,149 @@
            var HMaterID = $("#HMaterID").val();
            var HBatchNo = $("#HBatchNo").val();
            var ColName = $("#ColName").val();//复选框
            var Comparator = $("#Comparator").val()
            var ColContent = $("#ColContent").val();
            var ColName1 = $("#ColName1").val();//复选框
            var Comparator1 = $("#Comparator1").val()
            var ColContent1 = $("#ColContent1").val();
            var ColName2 = $("#ColName2").val();//复选框
            var Comparator2 = $("#Comparator2").val()
            var ColContent2 = $("#ColContent2").val();
            if (ColName != 0 && Comparator != 0) {
                var com = "";
                switch (Comparator) {
                    case "7":
                        com = "like'%" + ColContent + "%'";
                        break;
                    case "8":
                        com = "like'%" + ColContent + "'";
                        break;
                    case "9":
                        com = "like'" + ColContent + "%'";
                        break;
                    case "10":
                        com = "not like'%" + ColContent + "%'";
                        break;
                    default:
                        com = "" + Comparator + "'" + ColContent + "'";
                        break;
                }
                sWhere += " and " + ColName + " " + com;
            }
            if (ColName1 != 0 && Comparator1 != 0) {
                var com1 = "";
                switch (Comparator1) {
                    case "7":
                        com1 = "like'%" + ColContent1 + "%'";
                        break;
                    case "8":
                        com1 = "like'%" + ColContent1 + "'";
                        break;
                    case "9":
                        com1 = "like'" + ColContent1 + "%'";
                        break;
                    case "10":
                        com1 = "not like'%" + ColContent1 + "%'";
                        break;
                    default:
                        com1 = "" + Comparator1 + "'" + ColContent1 + "'";
                        break;
                }
                sWhere += " and " + ColName1 + " " + com1;
            }
            if (ColName2 != 0 && Comparator2 != 0) {
                var com2 = "";
                switch (Comparator2) {
                    case "7":
                        com2 = "like'%" + ColContent2 + "%'";
                        break;
                    case "8":
                        com2 = "like'%" + ColContent2 + "'";
                        break;
                    case "9":
                        com2 = "like'" + ColContent2 + "%'";
                        break;
                    case "10":
                        com2 = "not like'%" + ColContent2 + "%'";
                        break;
                    default:
                        com2 = "" + Comparator2 + "'" + ColContent2 + "'";
                        break;
                }
                sWhere += " and " + ColName2 + " " + com2;
            }
            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
                , HBatchWork: HBatchWork
                , HDivisionName: HDivisionName
            }
            //set_InitGrid();
            get_Display(JSON.stringify(sWhere));
            sWhere = "";//调用接口后清空sWhere缓存
        }
        function set_ClearQuery() {
            $("#HICMOBillNo").val("");
            $("#HBardCode").val("");
            $("#HProcExchBillNo").val("");
            $("#ColContent1").val("");
            $("#ColName1").val("0");
            $("#Comparator1").val("0");
            $("#ColContent2").val("");
            $("#ColName2").val("0");
            $("#Comparator2").val("0");
            $("#ColContent").val("");
            $("#ColName").val("0");
            $("#Comparator").val("0");
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            $("#HMaterID").val("0");
            $("#HBatchNo").val("");
            $("#HProject").val("");
            $("#HBatchWork").val("");
            $("#HDivisionName").val("");
            form.render('select');
            sWhere = "";
        }
        //#region èŽ·å–é¡¹ç›®å·
        function Get_HProject() {
            //获取项目号
            var HProjectList = '<option value="" style="color:red;" selected></option>';
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Gy_Material/Get_HProject",
                async: false,
                data: { "HOrgID": sessionStorage["OrganizationID"] },
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
                        for (var i = 0; i < data.length; i++) {
                            HProjectList += '<option  style="color:blue;"  value="' + data[i].HName + '" >' + data[i].HName + '</option>';
                        }
                        $("#HProject").append(HProjectList);
                        form.render('select');
                    }
                    layer.closeAll("loading");
                }
            })
        }
        //#endregion
        //#region èŽ·å–äº‹ä¸šéƒ¨
        function GetGy_Division() {
            //获取事业部
            var HDivisionList = '<option value="" style="color:red;" selected></option>';
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Gy_Material/Get_Gy_Division",
                async: false,
                data: { "HOrgID": sessionStorage["OrganizationID"] },
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
                        for (var i = 0; i < data.length; i++) {
                            HDivisionList += '<option  style="color:blue;"  value="' + data[i].HName + '" >' + data[i].HName + '</option>';
                        }
                        $("#HDivisionName").append(HDivisionList);
                        form.render('select');
                    }
                    layer.closeAll("loading");
                }
            })
        }
        //#endregion
        table.on('tool(mainTable)', function (obj) {
            var data = obj.data;
            if (obj.event == '检验单单号') {
                const HBillNo = data.检验单单号.substring(0, 2);
                var linterid = data.HInterID;
                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 () {
                        }
                    })
                }
            }
        });
        //隐藏列设置
        function get_HideColumn() {
            var colName = "";