-
Notifications
You must be signed in to change notification settings - Fork 0
/
test2.html
183 lines (164 loc) · 6.1 KB
/
test2.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> </title>
<link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap-table.css">
<link rel="stylesheet" href="css/plugins/sweetalert/sweetalert2.css">
</head>
<style>
body{
margin: 5px 5px;
}
button{
margin-left: 2%;
}
/*.table-bordered > tbody > tr > td
{
border: 1px solid #000000;
}*/
td{
border: 1px solid #000000;
}
</style>
<body>
<!-- <div
style="border-bottom: 1px solid black;font-size: 18px;font-weight: bold;margin: 0 0 10px 0;padding-bottom: 5px">
打卡次数异常信息查询
</div> -->
<!--startprint-->
<h1 style="text-align: center;">考勤表</h1>
<!-- <h4>项目名称:双子楼        用人单位:单位1        班组:默认班组        2020年9月</h4> -->
<div style="font-size: 20px;">
<p class="row">
<span id="contractors" class="col-md-4">施工单位:XXXXXXXXXXXXXXXXXXXXXX</span>
<span id="corpName" class="col-md-4">劳务单位:XXXXXXXXXXXXXXXXXXXXXX</span>
</p>
<p class="row">
<span id="productName" class="col-md-6">项目名称:XXXXXXXXXXXXXXXXXXXXXXXXXXX</span>
<span id="teamName" class="col-md-3">班组: 班组</span>
<span id="date"class="col-md-3">时间: 年 月份</span>
</p>
</div>
<table class="table" id="table" border="1" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<td rowspan="2">序号</td>
<td rowspan="2">编号</td>
<td rowspan="2">姓名</td>
<td rowspan="2">1</td>
<td rowspan="2">2</td>
<td rowspan="2">3</td>
<td rowspan="2">4</td>
<td rowspan="2">5</td>
<td rowspan="2">6</td>
<td rowspan="2">7</td>
<td rowspan="2">8</td>
<td rowspan="2">9</td>
<td rowspan="2">10</td>
<td rowspan="2">11</td>
<td rowspan="2">12</td>
<td rowspan="2">13</td>
<td rowspan="2">14</td>
<td rowspan="2">15</td>
<td rowspan="2">16</td>
<td rowspan="2">17</td>
<td rowspan="2">18</td>
<td rowspan="2">19</td>
<td rowspan="2">20</td>
<td rowspan="2">21</td>
<td rowspan="2">22</td>
<td rowspan="2">23</td>
<td rowspan="2">24</td>
<td rowspan="2">25</td>
<td rowspan="2">26</td>
<td rowspan="2">27</td>
<td rowspan="2">28</td>
<td rowspan="2">29</td>
<td rowspan="2">30</td>
<td rowspan="2">31</td>
<td rowspan="2">天数</td>
</tr>
</thead>
<tbody id="tableBody">
</tbody>
</table>
<!-- <div> </div> -->
<!-- <div>
<table style="width: 25%"class="table" border="1" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2">代号</td>
<td>全天</td>
<td>加班</td>
<td>休息</td>
<td>半天</td>
</tr>
<tr>
<td>√</td>
<td>+</td>
<td>0</td>
<td>Φ</td>
</tr>
</table>
</div> -->
<!--endprint-->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<script src="js/bootstrap-table.js"></script>
<script src="js/vue.js"></script>
<script src="js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="js/plugins/sweetalert/sweetalert2.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"></script>
<script src="js/plugins/validate/messages_zh.min.js"></script>
<script src="js/js/publicUrl.js"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function preview(){
bdhtml=window.document.body.innerHTML;//获取当前页的html代码
sprnstr="<!--startprint-->";//设置打印开始区域
eprnstr="<!--endprint-->";//设置打印结束区域
prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //从开始代码向后取html
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
window.document.body.innerHTML=prnhtml;
window.print();
window.document.body.innerHTML=bdhtml;
}
function strToMap(data){
var map=new Map();
var array=data.split(",")
$.each(array, function(index, item) {
var a=item.split(':');
map[a[0]]=a[1];
});
return map;
}
var str=sessionStorage.getItem("clockCountData")
var json=JSON.parse(str);
console.log(json)
var dateArray=json.date.split('-');
$('#contractors').text('施工单位:'+json.data.contractors)
$('#corpName').text('劳务单位:'+json.data.corpName)
$('#productName').text('项目名称:'+json.productName)
$('#teamName').text('班组: '+json.teamName)
$('#date').text('日期: '+dateArray[0]+'年 '+dateArray[1]+'月份')
console.log(json.data);
$.each(json.data.list, function(index, item) {
console.log(item.dateList);
var map=strToMap(item.dateList);
var str='<tr><td>'+(index+1)+'</td><td>'+item.id+'</td><td>'+item.workerName+'</td>'
for(var i=1;i<=31;i++){
str+='<td>'+(map[i.toString()]==undefined?"":"√")+'</td>';
}
str+='<td>'+item.days+'</td></tr>'
$("#tableBody").append(str)
});
preview();
// window.print();
</script>
</body>
</html>