wtt
2024-10-04 79c247e42af02f1536043a79cd39980ffc840116
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBillList.html
@@ -201,11 +201,6 @@
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_startCheckBill" id="set_startCheckBill"><i class="layui-icon layui-icon-form"></i>发起审批</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_CheckFlowInfo" id="get_CheckFlowInfo"><i class="layui-icon layui-icon-form"></i>查看审批进度</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill_Flow" id="CheckBill_Flow"><i class="layui-icon layui-icon-form"></i>多级审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck_Flow" id="AbandonCheck_Flow"><i class="layui-icon layui-icon-form"></i>多级反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_RejectCheck_Flow" id="RejectCheck_Flow"><i class="layui-icon layui-icon-form"></i>驳回</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><i class="layui-icon layui-icon-form"></i>反关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-ProcPriceRequestBills" id="btn-ProcPriceRequestBills"><i class="layui-icon layui-icon-delete"></i>多行下推(定额申请单)</button>
@@ -244,9 +239,10 @@
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var option = [];
            var page = 1;//分页数据
            var size = 50;
            var ins;                        //用于导出excel
            var HModName = "Gy_RoutingBillList";
            var HBillType = 3301;
            var titleData = [];//不需要显示的字段 å¯æ‰©å±•
            //获取参数
            function getUrlVars() {
@@ -291,21 +287,6 @@
                        break;
                    //编辑
                    case 'set_ShowBill': set_ShowBill();
                        break;
                    //发起审批
                    case 'set_startCheckBill': set_startCheckBill();
                        break;
                    //查看审批进度
                    case 'get_CheckFlowInfo': get_CheckFlowInfo();
                        break;
                    //多级审核
                    case 'set_CheckBill_Flow': set_CheckBill_Flow(0);
                        break;
                    //多级反审核
                    case 'set_AbandonCheck_Flow': set_CheckBill_Flow(1);
                        break;
                    //驳回
                    case 'set_RejectCheck_Flow': set_RejectCheck_Flow();
                        break;
                    //多行下推
                    case 'btn-ProcPriceRequestBills': set_ProcPriceRequestBills();
@@ -513,6 +494,28 @@
                        //, { field: '流转工序', title: '流转工序' }
                    ]]
                };
                optionPage = {
                    elem: 'page', //注意,这里的 page æ˜¯ ID,不用加 # å·
                    count: 10000, //数据总数,从服务端得到
                    limit: 50,
                    limits: [50, 500, 5000, 50000],
                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                    jump: function (obj, first) {
                        //console.log(obj)
                        //obj包含了当前分页的所有参数,比如:
                        //console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
                        //console.log(obj.limit); //得到每页显示的条数
                        //首次不执行
                        if (!first) {
                            //do something
                            page = obj.curr;
                            size = obj.limit;
                            get_FastQuery();
                        }
                    }
                }
                laypage.render(optionPage);
            }
@@ -753,19 +756,19 @@
                    var com = "";
                    switch (Comparator) {
                        case "7":
                            com = "like'%" + ColContent + "%'";
                            com = "like''%" + ColContent + "%''";
                            break;
                        case "8":
                            com = "like'%" + ColContent + "'";
                            com = "like''%" + ColContent + "''";
                            break;
                        case "9":
                            com = "like'" + ColContent + "%'";
                            com = "like''" + ColContent + "%''";
                            break;
                        case "10":
                            com = "not like'%" + ColContent + "%'";
                            com = "not like''%" + ColContent + "%''";
                            break;
                        default:
                            com = "" + Comparator + "'" + ColContent + "'";
                            com = "" + Comparator + "''" + ColContent + "''";
                            break;
                    }
                    sWhere += " and " + ColName + " " + com;
@@ -775,19 +778,19 @@
                    var com1 = "";
                    switch (Comparator1) {
                        case "7":
                            com1 = "like'%" + ColContent1 + "%'";
                            com1 = "like''%" + ColContent1 + "%''";
                            break;
                        case "8":
                            com1 = "like'%" + ColContent1 + "'";
                            com1 = "like''%" + ColContent1 + "''";
                            break;
                        case "9":
                            com1 = "like'" + ColContent1 + "%'";
                            com1 = "like''" + ColContent1 + "%''";
                            break;
                        case "10":
                            com1 = "not like'%" + ColContent1 + "%'";
                            com1 = "not like''%" + ColContent1 + "%''";
                            break;
                        default:
                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
                            com1 = "" + Comparator1 + "''" + ColContent1 + "''";
                            break;
                    }
                    sWhere += " and " + ColName1 + " " + com1;
@@ -796,19 +799,19 @@
                    var com2 = "";
                    switch (Comparator2) {
                        case "7":
                            com2 = "like'%" + ColContent2 + "%'";
                            com2 = "like''%" + ColContent2 + "%''";
                            break;
                        case "8":
                            com2 = "like'%" + ColContent2 + "'";
                            com2 = "like''%" + ColContent2 + "''";
                            break;
                        case "9":
                            com2 = "like'" + ColContent2 + "%'";
                            com2 = "like''" + ColContent2 + "%''";
                            break;
                        case "10":
                            com2 = "not like'%" + ColContent2 + "%'";
                            com2 = "not like''%" + ColContent2 + "%''";
                            break;
                        default:
                            com2 = "" + Comparator + "'" + ColContent + "'";
                            com2 = "" + Comparator + "''" + ColContent + "''";
                            break;
                    }
                    sWhere += " and " + ColName2 + " " + com2;
@@ -818,10 +821,10 @@
                } else {
                    if (HDate) {
                        sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                        sWhere += " and CONVERT(varchar(100),日期, 23) >= ''" + HDate + "''";
                    }
                    if (HDate1) {
                        sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                        sWhere += " and CONVERT(varchar(100),日期, 23) <= ''" + HDate1 + "''";
                    }
                }
                
@@ -833,32 +836,96 @@
                }
                if (HOrderProcNO) {
                    sWhere += " and å•据类型 like '%" + HOrderProcNO + "%'";
                    sWhere += " and å•据类型 like ''%" + HOrderProcNO + "%''";
                }
                if (HMaterName) {
                    sWhere += "and ç‰©æ–™åç§° like '%" + HMaterName + "%'";
                    sWhere += "and ç‰©æ–™åç§° like ''%" + HMaterName + "%''";
                }
                if (HMaterNumber) {
                    sWhere += "and  ç‰©æ–™ä»£ç  like '%" + HMaterNumber + "%'";
                    sWhere += "and  ç‰©æ–™ä»£ç  like ''%" + HMaterNumber + "%''";
                }
                if (HModel) {
                    sWhere += "and  è§„格型号 like '%" + HModel + "%'";
                    sWhere += "and  è§„格型号 like ''%" + HModel + "%''";
                }
                if (WorkCenter) {
                    sWhere += " and å•据号 like '%" + WorkCenter + "%'";
                    sWhere += " and å•据号 like ''%" + WorkCenter + "%''";
                }
                if (HOrgID) {
                    sWhere += " and HOrgID = '" + HOrgID + "'";
                    sWhere += " and HOrgID = ''" + HOrgID + "''";
                }
                if (number==2) {
                    if (HProject!='0') {
                        sWhere += " and é¡¹ç›®å· like '%" + HProject + "%'";
                        sWhere += " and é¡¹ç›®å· like ''%" + HProject + "%''";
                    }
                }
               
                sWhere += " and å·¥åºä»£ç  != '9999' and HBillSubType<>'SUB'"
                get_Display(sWhere);
                sWhere += " and å·¥åºä»£ç  != ''9999'' and HBillSubType<>''SUB''"
                get_DisplayPage(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region åˆ†é¡µæŸ¥è¯¢
            function get_DisplayPage(sWhere) {
                var wait = layer.load();//遮罩
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Gy_RoutingBill/page',
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
                    success: function (data1) {
                        option.limit = size;//改变表格页大小
                        if (data1.code == 1) {
                            optionPage.count = data1.count;//改变列表数据总数
                            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')}}</div>", width: 120 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 });
                                    }
                                }
                            }
                            option.cols = [col];
                            option.data = data1.data;
                            ins = table.render(option);
                            laypage.render(optionPage);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            layer.close(ajaxLoad);
                            if ($("#ColName option").length < 1) {
                                ColFilter();
                            }
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            option.data = [[]]
                            table.render(option);
                            layer.close(ajaxLoad);
                            /*layer.alert(data1.code + data1.Message, { icon: 5 });*/
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
@@ -1061,7 +1128,7 @@
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
                get_DisplayPage(sWhere);
            }
            //审核   [1 å®¡æ ¸ã€2 åå®¡æ ¸]
@@ -1097,149 +1164,6 @@
                }
            }
            //#region å‘起审批
            function set_startCheckBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Gy_Routing/StartCheckFlow", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                    //修改为功后刷新界面
                    $("#btnSearch").trigger('click');
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
            //#region æŸ¥çœ‹å®¡æ‰¹è¿›åº¦
            function get_CheckFlowInfo() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    layer.open({
                        type: 2
                        , area: ['70%', '70%']
                        , title: '单据审批进度'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../../系统管理/多级审批/审批进度/Xt_CheckFlowProgressList.html?linterid=' + hID + '&HSouceBillType=' + HBillType
                        , resize: false,
                        end: function () {
                            ////修改为功后刷新界面
                            //if (get_needClose_Bar == 0) {
                            //    $("#btnSearch").trigger('click');
                            //} else if (get_needClose_Bar == 1) {
                            //    $("#get_needClose").trigger('click');
                            //}
                        }
                        , cancel: function () {
                        }
                    })
                } else {
                    layer.msg('请选择一行数据查看!');
                }
            }
            //#endregion
            //#region å¤šçº§ åå®¡æ ¸/审核数据
            function set_CheckBill_Flow(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Gy_Routing/AuditFlow", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
            //#region é©³å›ž
            function set_RejectCheck_Flow(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                });
                                //修改为功后刷新界面
                                $("#btnSearch").trigger('click');
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
            //关闭  [1 å…³é—­ã€2 åå…³é—­]
            function set_CloseBill(num) {
@@ -1304,7 +1228,7 @@
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["field"] + ",";
                    colName += option.cols[0][i]["title"] + ",";
                }
                var urlStr = window.document.location.pathname;//获取文件路径
                var urlLen = urlStr.split('/');
@@ -1339,7 +1263,6 @@
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    async:"false",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
@@ -1376,10 +1299,6 @@
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //统计列
                                if (dataCols[6] == 1) {
                                    option.cols[0][i + 1]["totalRow"] = true;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
@@ -1391,10 +1310,6 @@
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                                //设置表格title属性显示别名
                                if (dataCols[4] != null && dataCols[4] != "") {
                                    option.cols[0][i + 1]["title"] = dataCols[4];
                                }
                            }
@@ -1449,7 +1364,7 @@
                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].title + '</option>';
                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
                    }
                }
                $("#ColName").empty();