duhe
2023-07-10 fc3e41679ca6eeafb6973715d3fcb1a52df263df
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBillList.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>工艺路线列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@@ -9,11 +9,10 @@
    <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>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/scripts/jquery-1.4.1.min.js"></script>
    <script src="../../../layuiadmin/pubcustom.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
</head>
<body>
    <div class="layui-fluid">
@@ -56,22 +55,23 @@
                                    <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;">
                                        <!--其他条件-->
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 76px;">物料名称</label>
                                            <div class="layui-input-block" style="margin-left: 107px;">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName">
                                            </div>
                                        </div>
                                        <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="HModel" id="HModel">
                                            </div>
                                <div class="layui-row" style="margin-top:10px;margin-left:5%;">
                                    <!--其他条件-->
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 76px;">物料名称</label>
                                        <div class="layui-input-block" style="margin-left: 107px;">
                                            <input type="text" class="layui-input" name="HMaterName" id="HMaterName">
                                        </div>
                                    </div>
                                    <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="HModel" id="HModel">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                    <div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
@@ -111,11 +111,16 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" 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" 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" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>反审核</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="export"><i class="layui-icon layui-icon-export"></i>导出</button>
                            </div>
                        </script>
                    </form>
@@ -123,6 +128,7 @@
            </div>
        </div>
    </div>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -142,6 +148,7 @@
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var option = [];
            var ins;                        //用于导出excel
            var HModName = "Gy_RoutingBillList";
            //#endregion
@@ -178,11 +185,27 @@
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //审核
                    case 'set_CheckBill': set_CheckBill(1);
                        break;
                    //反审核
                    case 'set_AbandonCheck': set_CheckBill(2);
                        break;
                    //关闭
                    case 'set_CloseBill': set_CloseBill(1);
                        break;
                    //反关闭
                    case 'set_CancelCloseBill': set_CloseBill(2);
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    //导出excel
                    case 'get_export':
                        get_Export();
                        break;
                };
            });
@@ -204,11 +227,11 @@
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //获取组织
@@ -250,61 +273,61 @@
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , limit:50
                    //, cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                    /*    { field: 'hmainid', title: 'hmainid', width: 110 }*/
                        /*    { field: 'hmainid', title: 'hmainid', width: 110 }*/
                        , { field: '单据号', title: '单据号', sort: true, width: 165 }
                        , { field: '单据类型', title: '单据类型' }
                        , { field: '工艺名称', title: '工艺名称', width: 170 }
                        //, { field: 'hmaterid', title: 'hmaterid', width: 165 }
                        , { field: '物料代码', title: '物料代码', width: 160 }
                        , { field: '物料名称', title: '物料名称', width: 160 }
                        , { field: '规格型号', title: '规格型号', width: 215 }
                        , { field: '规格型号', title: '规格型号', width: 160 }
                        , { field: '计量单位代码', title: '计量单位代码', width: 115 }
                        , { field: '计量单位', title: '计量单位' }
                        , { field: '默认工艺', title: '默认工艺' }
                        , { field: '表头备注', title: '表头备注' }
                        , { field: '组织', title: '组织' }
                        //, { field: 'hsubid', title: 'hsubid', width: 80 }
                        , { field: '工序号', title: '工序号' }
                        , { field: '委外标记', title: '委外标记' }
                        //, { field: 'hprocid', title: 'hprocid', width: 105 }
                        , { field: '工序代码', title: '工序代码' }
                        , { field: '工序', title: '工序' }
                        //, { field: 'HSupID', title: 'HSupID', width: 105 }
                        , { field: '供应商代码', title: '供应商代码' }
                        , { field: '供应商', title: '供应商' }
                        //, { field: 'HCenterID', title: 'HCenterID', width: 105 }
                        , { field: '工作中心代码', title: '工作中心代码', width: 115 }
                        , { field: '工作中心名称', title: '工作中心名称', width: 115 }
                        , { field: '时间单位', title: '时间单位' }
                        , { field: '运行时间', title: '运行时间' }
                        , { field: '加工数量', title: '加工数量' }
                        , { field: '准备时间', title: '准备时间' }
                        , { field: '排队时间', title: '排队时间' }
                        , { field: '转移时间', title: '转移时间' }
                        , { field: '良率', title: '良率' }
                        , { field: '累计良率', title: '累计良率' }
                        , { field: '表体备注', title: '表体备注' }
                        , { field: '制单人', title: '制单人' }
                        , { field: '制单日期', title: '制单日期', width: 195 }
                        , { field: '审核人', title: '审核人' }
                        , { field: '审核日期', title: '审核日期', width: 180 }
                        , { field: '修改人', title: '修改人' }
                        , { field: '修改日期', title: '修改日期', width: 180 }
                        , { field: '作废人', title: '作废人' }
                        , { field: '作废日期', title: '作废日期' }
                        //, { field: 'HDayWorkQty', title: 'HDayWorkQty', width: 105 }
                        //, { field: 'HGroupID', title: 'HGroupID', width: 105 }
                        //, { field: 'HWorkerID', title: 'HWorkerID', width: 105 }
                        //, { field: 'HSourceID', title: 'HSourceID', width: 105 }
                        , { field: '加工单价', title: '加工单价' }
                        //, { field: 'HNextProcFlag', title: 'HNextProcFlag', width: 105 }
                        , { field: '下道流转工序', title: '下道流转工序', width: 150 }
                        , { field: '流转工序', title: '流转工序' }
                        , { field: '默认工艺', title: '默认工艺' }
                        //, { field: '单据类型', title: '单据类型' }
                        ////, { field: 'hmaterid', title: 'hmaterid', width: 165 }
                        //, { field: '组织', title: '组织' }
                        ////, { field: 'hsubid', title: 'hsubid', width: 80 }
                        //, { field: '委外标记', title: '委外标记' }
                        ////, { field: 'hprocid', title: 'hprocid', width: 105 }
                        ////, { field: 'HSupID', title: 'HSupID', width: 105 }
                        //, { field: '供应商代码', title: '供应商代码' }
                        //, { field: '供应商', title: '供应商' }
                        ////, { field: 'HCenterID', title: 'HCenterID', width: 105 }
                        //, { field: '时间单位', title: '时间单位' }
                        //, { field: '运行时间', title: '运行时间' }
                        //, { field: '加工数量', title: '加工数量' }
                        //, { field: '准备时间', title: '准备时间' }
                        //, { field: '排队时间', title: '排队时间' }
                        //, { field: '转移时间', title: '转移时间' }
                        //, { field: '良率', title: '良率' }
                        //, { field: '累计良率', title: '累计良率' }
                        //, { field: '表体备注', title: '表体备注' }
                        //, { field: '作废人', title: '作废人' }
                        //, { field: '作废日期', title: '作废日期' }
                        ////, { field: 'HDayWorkQty', title: 'HDayWorkQty', width: 105 }
                        ////, { field: 'HGroupID', title: 'HGroupID', width: 105 }
                        ////, { field: 'HWorkerID', title: 'HWorkerID', width: 105 }
                        ////, { field: 'HSourceID', title: 'HSourceID', width: 105 }
                        //, { field: '加工单价', title: '加工单价' }
                        ////, { field: 'HNextProcFlag', title: 'HNextProcFlag', width: 105 }
                        //, { field: '下道流转工序', title: '下道流转工序', width: 150 }
                        //, { field: '流转工序', title: '流转工序' }
                    ]]
                };
            }
@@ -349,6 +372,7 @@
                        }
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        $("#HMaterName").val(checkStatus.data[0].HName);
                        $("#HMaterNumber").val(checkStatus.data[0].HNumber);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                })
@@ -366,7 +390,7 @@
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            ins = table.render(option);
                            layer.close(ajaxLoad);
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
@@ -427,7 +451,7 @@
                else {
                    HOrgID = $("#HOrgID").val();//组织
                }
                if (HOrderProcNO) {
                    sWhere += " and å•据类型 like '%" + HOrderProcNO + "%'";
                }
@@ -446,6 +470,7 @@
                if (HOrgID) {
                    sWhere += " and HOrgID = '" + HOrgID + "'";
                }
                sWhere += " and å·¥åºä»£ç  != '9999'"
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
@@ -475,7 +500,7 @@
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].HItemID;
                    //var linteridSub = data[0].hsubid;
                    //if (AllowLoadData(sSubStr) != false) {//非空验证
                    layer.open({
                        type: 2
@@ -565,6 +590,82 @@
                set_ClearQuery();
                get_Display(sWhere);
            }
            //审核   [1 å®¡æ ¸ã€2 åå®¡æ ¸]
            function set_CheckBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要审核吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Gy_RoutingBill/CheckGy_RoutingBill',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    get_FastQuery();
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                } else {
                    layer.msg("请选择一条数据!");
                }
            }
            //关闭  [1 å…³é—­ã€2 åå…³é—­]
            function set_CloseBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要关闭吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill_1',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                }
                else {
                    layer.msg("请选择一条数据!");
                }
            }
            //导出Execel
            function get_Export() {
                table.exportFile(ins.config.id, option.data, "xls");
            }
            //#endregion
            //隐藏列设置
            function get_HideColumn() {