wtt
2024-11-22 4f90256a50a31f587853ce3ce51a89732764c924
WebTM/views/ÖÊÁ¿¹ÜÀí/ÖÊÁ¿±¨±í/SB_TechnologyParameterList.html
@@ -44,6 +44,7 @@
                                    <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="HProcName" name="HProcName" id="HProcName" value="" style="background-color: #efefef4d; width: 75%; display: inline-block;" readonly>
                                        <input type="hidden" class="layui-input" name="HProcID" id="HProcID" value="" readonly>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" style="padding: 0 10px;float: right;margin-right: 3px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                        </button>
@@ -62,12 +63,14 @@
                                    <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>
                                <button type="button" class="layui-btn layuiadmin-btn-order" lay-submit="" lay-filter="Exit" id="Exit" style="padding:0 5px">退出</button>
                                <div class="layui-row" style="margin-top:5px;margin-left:82px;margin-bottom:5px;">
                                    <div class="layui-row" style="margin-top:5px">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">物料名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName" readonly>
                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" value="" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
@@ -75,18 +78,42 @@
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HEquipName" id="HEquipName" value="" readonly>
                                                <input type="hidden" class="layui-input" name="HEquipNumber" id="HEquipNumber" value="" readonly>
                                                <input type="hidden" class="layui-input" name="HEquipID" id="HEquipID" value="" readonly>
                                            </div>
                                        </div>
                                        <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="HEquipType" id="HEquipType"  class=" ForFilteringSchemes" lay-verify="HEquipType">
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HEquipType" id="HEquipType" class=" ForFilteringSchemes" lay-verify="HEquipType">
                                                    <option value="手动输入">手动输入</option>
                                                    <option value="设备采集">设备采集</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">开始日期</label>
                                            <div class="layui-input-block">
                                                <input type="datetime" class="layui-input ForFilteringSchemes" id="HBeginDate" style="width:190px;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">结束日期</label>
                                            <div class="layui-input-block">
                                                <input type="datetime" class="layui-input ForFilteringSchemes" id="HEndDate" style="width:190px;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row" >
                            <div class="layui-col-xs3 layui-inline" style="margin-top:20px;">
                                <table class="layui-hide" id="mainTable_HTeach" lay-filter="mainTable_HTeach"></table>
                            </div>
                            <div class="layui-col-xs9 layui-inline" style="margin-top:20px;">
                                <div id="histogram" style="width:99.5%;height:calc(90vh);margin-top:10px;">
                                </div>
                            </div>
                        </div>
@@ -94,18 +121,18 @@
                            <div style="width:99%;height:calc(100vh);">
                                <table class="" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <div id="histogram" style="width:99.5%;height:calc(68vh);margin-top:10px;">
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="RefreshButton"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>导出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideButton"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="ExitButton"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideButton"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display :none" lay-event="get_Exit" id="ExitButton"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                        <script type="text/html" id="toolbarDemo1">
                        </script>
                    </form>
                </div>
            </div>
@@ -136,8 +163,11 @@
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var HProcID = params[params[2]]; //从参数中获取 å•据内码
            var ins;                        //用于导出excel
            var HMater; //物料
            var HProc;  //工序
            var HEquId;   //设备
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
@@ -165,10 +195,21 @@
                        break;                   
                };
            });
            table.on('tool(mainTable_HTeach)', function (obj) {
                var data = obj.data;
                //单据号超链接
                if (obj.event == '工艺参数') {                  //检查 obj.event æ˜¯å¦ç­‰äºŽå­—符串 '单据号'。如果等于,则执行if循环
                    $("#HTechParamName").val(data.工艺参数);
                    get_FastQuery( );
                }
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
            // é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
@@ -199,15 +240,22 @@
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            // åˆå§‹åŒ–界面
            function set_ClearBill() {
                set_InitGrid(); //初始化表格
                get_FastQuery();
                //加载折线图
                set_Graphics();
                if (OperationType==3) {
                    Get_SB_EquipICMOTechParamBill(linterid);
                set_InitGrid(); //初始化表格
                set_InitGrid1(); //初始化表格
                if (OperationType == 3) {
                    Get_SB_EquipICMOTechParamBill(linterid, HProcID);//获取流转卡,工序,设备,物料,开始结束时间
                    Get_TechParam();//获取当前流转卡,物料,工序,设备 å¯¹åº”的产品工艺参数清单
                    get_FastQuery();
                    //加载折线图
                    set_Graphics();
                } else {
                    get_FastQuery();
                    //加载折线图
                    set_Graphics();
                }
            }
            //初始化表格
            function set_InitGrid() {
                option = {
@@ -234,6 +282,69 @@
                    ]]
                };
                table.render(option)
            }
            //初始化表格
            function set_InitGrid1() {
                option_HTeach = {
                    elem: '#mainTable_HTeach'
                    , toolbar: '#toolbarDemo1'
                    , totalRow: true
                    , height: 'full-50'
                    , page: false
                    , cellMinWidth: 90
                    , limit: 50
                    , data: []
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', totalRowText: '合计行' }
                        , { field: '工艺参数', title: '工艺参数', sort: true }
                        , { field: '采集来源', title: '采集来源', sort: true }
                    ]]
                };
                table.render(option_HTeach)
            }
            //快速查询
            function get_FastQuery() {
                var HProcExchBillNo = $("#HProcExchBillNo").val();//流转卡号
                var HProcID = $("#HProcID").val();  //工序名称
                var HTechParamName = $("#HTechParamName").val(); //工艺参数
                var HEquipID = $("#HEquipID").val();    //设备名称
                var HBeginDate = $("#HBeginDate").val(); //开始时间
                var HEndDate = $("#HEndDate").val();    //结束时间
                if (HProcExchBillNo != "" && HProcID != "" && HTechParamName != "") {
                    sWhere = {
                        HProcExchBillNo: HProcExchBillNo
                        , HProcID: HProcID
                        , HTechParamName: HTechParamName
                        , HEquipID: HEquipID
                        , HBeginDate: HBeginDate
                        , HEndDate: HEndDate
                    }
                    get_Display(JSON.stringify(sWhere));
                    sWhere = "";//调用接口后清空sWhere缓存
                }
            }
            //重置快速查询
            function set_ClearQuery() {
                $("#HProcExchBillNo").val("");
                $("#HProcID").val("");
                $("#HProcName").val("");
                $("#HTechParamName").val("");
                $("#HMaterID").val("");
                $("#HMaterName").val("");
                $("#HEquipID").val("");
                $("#HEquipNumber").val("");
                $("#HEquipName").val("");
                $("#HBeginDate").val("");
                $("#HEndDate").val("");
                $("#btnSearch").click();
                form.render('select');
                sWhere = "";
            }
            //查询
@@ -291,16 +402,13 @@
                                , cellMinWidth: 90
                            }
                            ins = table.render(option);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            //加载折线图
                            set_Graphics();
                            layer.close(ajaxLoad);
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                                ColFilter();
                            }
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
@@ -313,37 +421,7 @@
                });
                layer.close(index);
            }
            //快速查询
            function get_FastQuery() {
                var HProcExchBillNo = $("#HProcExchBillNo").val();
                var HProcName = $("#HProcName").val();
                var HTechParamName = $("#HTechParamName").val();
                var HEquipName = $("#HEquipName").val();
                if (HProcExchBillNo != "" && HProcName != "" && HTechParamName != "") {
                    sWhere = {
                        HProcExchBillNo: HProcExchBillNo
                        , HProcName: HProcName
                        , HTechParamName: HTechParamName
                        , HEquipName: HEquipName
                    }
                    get_Display(JSON.stringify(sWhere));
                    sWhere = "";//调用接口后清空sWhere缓存
                }
            }
            //重置快速查询
            function set_ClearQuery() {
                $("#HProcExchBillNo").val();
                $("#HProcName").val();
                $("#HTechParamName").val();
                $("#HMaterName").val();
                $("#HEquipName").val();
                $("#btnSearch").click();
                form.render('select');
                sWhere = "";
            }
            //刷新
            function get_Refresh() {
                $("#btnSearch").trigger('click');
@@ -546,10 +624,10 @@
                            return layer.msg('请选择数据');
                        }
                        $("#HProcExchBillNo").val(checkStatus.data[0].单据号);
                        $("#HMaterID").val(checkStatus.data[0].HMaterID);
                        $("#HMaterName").val(checkStatus.data[0].产品名称);
                        $("#HProcName").val(checkStatus.data[0].当前工序);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_EquipList();
                        //$("#HProcName").val(checkStatus.data[0].当前工序);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
@@ -576,8 +654,8 @@
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                    btn: ['确定', '取消'],
                    btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -585,8 +663,11 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HProcID").val(checkStatus.data[0].HItemID);
                        $("#HProcName").val(checkStatus.data[0].工序名称);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_EquipList();//查找设备 å’Œ æµè½¬å¡çš„ å¼€å®Œå·¥æ—¶é—´
                        Get_TechParam();//查找这个流转卡 å·¥åºçš„产品工艺参数清单
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
@@ -610,7 +691,7 @@
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '工序列表',
                    title: '工艺参数列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['90%', '90%'],
@@ -641,20 +722,32 @@
                });
            });
            //根据流转卡获取设备点检表的 è®¾å¤‡
            function get_EquipList() {
            //退出
            form.on('submit(Exit)', function (data) {
                if (OperationType == 3) {
                    Pub_Close(1);
                } else {
                    Pub_Close(2);
                }
            });
            //根据流转卡+工序 èŽ·å– è®¾å¤‡
            function get_EquipList() {
                var HProcExchBillNo = $("#HProcExchBillNo").val();
                var HProcID = $("#HProcID").val();
                $.ajax({
                    url: GetWEBURL() + "/QC_CustomerAppealReport/Get_EquipList",
                    type: "GET",
                    async: false,
                    data: { "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"] },
                    data: { "HProcExchBillNo": HProcExchBillNo, "HProcID": HProcID, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data;
                            $("#HEquipName").val(data[0]["HName"]);
                            $("#HEquipNumber").val(data[0]["HEquipFileNumber"]);
                            $("#HEquipID").val(data[0]["设备id"]);
                            $("#HEquipName").val(data[0]["设备名称"]);
                            $("#HEquipNumber").val(data[0]["设备代码"]);
                            $("#HBeginDate").val(Pub_Format(data[0]["开始时间"],"yyyy-MM-dd hh:mm:ss"));
                            $("#HEndDate").val(Pub_Format(data[0]["结束时间"], "yyyy-MM-dd hh:mm:ss"));
                        } else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
@@ -666,22 +759,25 @@
            }
            //根据全程追溯报表获取流转卡,工序,设备,物料
            function Get_SB_EquipICMOTechParamBill(linterid) {
            function Get_SB_EquipICMOTechParamBill(linterid, HProcID) {
                $.ajax({
                    url: GetWEBURL() + "/QC_CustomerAppealReport/Get_EquipICMOTechParamList",
                    type: "GET",
                    async: false,
                    data: { "linterid": linterid, "user": sessionStorage["HUserName"] },
                    data: { "linterid": linterid, "HProcID": HProcID, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data;
                            $("#HProcExchBillNo").val(data[0]["HProcExchBillNo"]);
                            $("#HProcExchBillNo").val(data[0]["工序流转卡号"]);
                            $("#HProcID").val(data[0]["工序id"]);
                            $("#HProcName").val(data[0]["工序名称"]);
                            $("#HMaterID").val(data[0]["物料id"]);
                            $("#HMaterName").val(data[0]["物料名称"]);
                            $("#HEquipID").val(data[0]["设备id"]);
                            $("#HEquipNumber").val(data[0]["设备代码"]);
                            $("#HEquipName").val(data[0]["设备名称"]);
                            $("#HEquipName").val(data[0]["设备名称"]);
                            $("#HBeginDate").val(Pub_Format(data[0]["开始时间"], "yyyy-MM-dd hh:mm:ss"));
                            $("#HEndDate").val(Pub_Format(data[0]["结束时间"], "yyyy-MM-dd hh:mm:ss"));
                        } else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
@@ -691,6 +787,72 @@
                    }
                })
            }
            //根据流转卡,工序,设备,物料 èŽ·å–äº§å“å·¥è‰ºå‚æ•°æ¸…å•çš„  å·¥è‰ºå‚æ•°
            function Get_TechParam() {
                HMater = $("#HMaterID").val();
                HProc = $("#HProcID").val();
                HEquId = $("#HEquipID").val();
                $.ajax({
                    url: GetWEBURL() + "/QC_CustomerAppealReport/Get_TechParamList",
                    type: "GET",
                    async: false,
                    data: { "HMaterID": HMater, "HProID": HProc, "HEquId": HEquId,"user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = [];
                            var col = [];
                            //给空的数组赋值
                            for (var key in result.list) {
                                data.push({ "id": result.list[key].ColmCols, "name": result.list[key].ColmCols, "Type": result.list[key].ColmType });
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left' });
                            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) {
                                        //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')}}</div>", width: 200 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
                            //动态显示列名
                            option_HTeach = {
                                elem: '#mainTable_HTeach'
                                , toolbar: '#toolbarDemo1'
                                , cols: [col]
                                , data: result.data
                                , height: 'full-80'
                                , page: true
                                , limits: [50, 500, 5000, 50000]
                                , limit: 50
                                , cellMinWidth: 90
                            }
                            table.render(option_HTeach);
                        } else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                })
            }
            //#region èŽ·å–å‚æ•°
            function getUrlVars() {
@@ -704,7 +866,6 @@
                return vars;
            }
            //#endregion
            //#region éšè—åˆ—设置
            function get_HideColumn() {