严智鑫
2025-08-18 3b65a5dc04be7cdac460c84ebaa38bf009405128
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
 
<html>
<head>
<script src="tb.js"></script>
<script src="jq.js"></script>
<script src="${ctx}/static/js/ng/tb.js" type="text/javascript"></script>
 
<style>
.table>tbody>tr>td {
    vertical-align: middle;
    /* content:middle; */
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    /* border: 1px solid green; */
}
 
.table>thead>tr>th {
    font-weight: bold;
    font-size: 20px;
    text-align: center;
}
 
h1 {
    display: inline;
}
 
.s-style {
    font-size: 18px;
    font-weight: bold;
}
 
.s-title {
    font-size: 18px;
    /*font-weight: bold;
     text-align :center; */
    vertical-align: middle;
    text-align: center
}
 
.sel-style {
    width: 200px;
    font-size: 20px;
}
 
.span-data {
    font-weight: bold;
    color: red;
}
</style>
 
<script>
    //自动刷新间隔时间 单位:毫秒
 
    var rf_url = "/gmms2/mesview/data/_reportform_manage";
    var p_url = "/gmms2/mesview/data/_public_manage";
 
    <%-- <%String group = request.getParameter("group");
            String gongyi = request.getParameter("gongyi");
            String reportFName = request.getParameter("rfName");%>
    
    //班组
    var group = "<%=group%>";
    //工艺
    var gongyi = "<%=gongyi%>";
    //报表名字
    var rfName ="<%=reportFName%>";
    //是否查询
    var isChaXun = false; --%>
    //数据总量
    var total_num = 0;
    var zl_num = 0;
</script>
 
<title>报表</title>
</head>
<body>
    <div class="content-wrapper">
        <!-- 理片任务信息 -->
 
        <section class="content container-fluid">
            <h3 id="rf_title">工程切裁率报表</h3>
            <span id="rf_total"></span>
            <div class="box" id="rf_condition">
                <div class="box-header">
                    <h4>
                        <span>工程号</span><input type='text' id="rf_gc_num"> <select
                            id="rf_lck_isShow" class="span_tasktext">
                            <option value="0">不显示流程卡</option>
                            <option value="1">显示流程卡</option>
                        </select> <input type='text' id="rf_lck_num" style="display: none">
 
                        <span class="s-title">开始时间</span> <input type="datetime-local"
                            id="starttime" name="starttime" /> <span class="s-title">结束时间</span>
                        <input type="datetime-local" id="endtime" name="endtime" />
                        <button id='' type='button' data-toggle='popover' data-content=''
                            data-trigger='hover' class="btn btn-success"
                            onclick="queryLoadRFData(1)">查询</button>
 
                        <button id='' type='button' class="btn btn-success"
                            onclick="btnSetDatetime(7)">近七天</button>
                        <button id='' type='button' class="btn btn-success"
                            onclick="btnSetDatetime(30)">当前月</button>
                        <button id='' type='button' class="btn btn-success"
                            onclick="btnSetDatetime(60)">上一月</button>
                        <button id='' type='button' class="btn btn-success"
                            onclick="btnSetDatetime(365)">今年</button>
 
 
                        <button id="ms_baipian" class="btn btn-success" type='button'
                            onclick="ExportTable(1);">导出表格</button>
                    </h4>
                </div>
 
                <p style="font-size: 20px" id="rf_total">
                    查询数据总览: 【共&nbsp;<span id="rNum" class="span-data"></span>&nbsp;条数据】
                     【小片总数量:<span id="pZSL"    class="span-data"></span>】【小片总面积:<span id="pZMJ" class="span-data"></span>㎡】
                    <span id="span_ypmj" >【原片总面积:<span id="sZMJ" class="span-data"></span>㎡】</span> 
                </p>
            </div>
 
 
            <!-- /.box-header -->
 
            <!-- style="height:10%;width:100%;overflow:auto" -->
 
            <!-- <div class="box-body no-padding" id="glass-data"
                style="overflow-y: scroll"></div> -->
 
            <div class="box-body no-padding" id="rf_glass_data"
                style="height: 500px; border: 1px; overflow-y: auto"></div>
 
            <div>
                <p style="font-size: 20px" id="rf_total">
                    切裁率总报表
                    <button id='' type='button' data-toggle='popover' data-content=''
                        data-trigger='hover' class="btn btn-success" onclick="queryLoadRFData(3)">查询全部</button>
                    <button id='' type='button' data-toggle='popover' data-content=''
                        data-trigger='hover' class="btn btn-success" onclick="queryLoadRFData(2)">查询时间段内</button>
                    
                    <button id="ms_baipian" class="btn btn-success" type='button'
                        onclick="ExportTable(2);">导出表格</button>
                    <span id="span_zongqiecailv"></span>
                </p>
 
 
                <div class="box-body no-padding" id="qcl_rf_zl" style=""></div>
            </div>
        </section>
    </div>
 
    <%@ include file="/WEB-INF/views/mes/view/modal_tishi.jsp"%>
 
 
    <!-- /.content-wrapper -->
 
 
    <!-- 导出表格 -->
    <script>
        function ExportTable(type) {
 
            if ((type==1 && total_num < 1) ||(type==2 && zl_num<1) ) {
                $("#CZ_Msg").modal('toggle');
                $("#cz_Ming").html("导出表格:");
                $("#cz_Zhuangtai").html("无需导出");
                $("#cz_Zhuangtai").attr("style", "color:red;");
                $("#cz_mingxi").html("没有数据,不需要导出!");
                return;
 
            }
            var dt = new Date().getFullYear().toString();
            dt += (new Date().getMonth() + 1).toString();
            dt += new Date().getDate().toString();
            let exportFileContent =null;
        if(type==1){
            var tName = "切割率明细报表-" + dt + ".xls";
            if($("#rf_lck_isShow").val()==1){
                tName = "流程卡明细报表-" + dt + ".xls";
            }
            exportFileContent = document.getElementById('rf_glass_data').outerHTML;
        }else if(type ==2){
            var tName = "切割率总报表-" + dt + ".xls";
            exportFileContent = document.getElementById('qcl_rf_zl').outerHTML;
        }
            
            let    blob = new Blob([ exportFileContent ], {
                type : 'text/plain;charset=utf-8'
            }); // 解决中文乱码问题
            blob = new Blob([ String.fromCharCode(0xFEFF), blob ], {
                type : blob.type
            });
            // 设置链接
            let    link = window.URL.createObjectURL(blob);
            let    a = document.createElement('a'); // 创建a标签
            a.download = tName; // 设置被下载的超链接目标(文件名)
            a.href = link; // 设置a标签的链接
            document.body.appendChild(a); // a标签添加到页面
            a.click(); // 设置a标签触发单击事件
            document.body.removeChild(a); // 移除a标签
        }
        
        
        $("#rf_lck_isShow").change(function(){
            if($("#rf_lck_isShow").val() == 1){
                $("#rf_lck_num").attr("style","display:''");
                $("#rf_lck_num").val("");
                $("#rf_title").text("流程卡切裁率报表");
                $("#span_ypmj").attr("style","display:none");
                
            }else{
                $("#rf_lck_num").attr("style","display:none");
                $("#rf_lck_num").val("");
                $("#rf_title").text("工程切裁率报表");
                $("#span_ypmj").attr("style","display:''");
            }
        })
    </script>
 
    <%@ include file="/WEB-INF/views/mes/view/rf_qiegelvmingxi.jsp"%>
 
</body>
</html>