tony.cheng
2026-03-17 6fb356e222fa92fb98b1dbfef4d8e1bde8dc89a7
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欠薪计算器 - 维护您的劳动权益</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
            padding: 20px;
        }
        
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
            overflow: hidden;
        }
        
        header {
            background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
            color: white;
            padding: 25px 30px;
            text-align: center;
        }
        
        header h1 {
            font-size: 2.2rem;
            margin-bottom: 10px;
        }
        
        header p {
            opacity: 0.9;
            font-size: 1.1rem;
        }
        
        .calculator-wrapper {
            display: flex;
            flex-wrap: wrap;
            padding: 0;
        }
        
        .input-section {
            flex: 1;
            min-width: 300px;
            padding: 30px;
            background-color: #f9fbfd;
        }
        
        .result-section {
            flex: 1;
            min-width: 300px;
            padding: 30px;
            background-color: white;
            border-left: 1px solid #eaeaea;
        }
        
        .section-title {
            font-size: 1.4rem;
            margin-bottom: 25px;
            color: #1e5799;
            padding-bottom: 10px;
            border-bottom: 2px solid #eaeaea;
            display: flex;
            align-items: center;
        }
        
        .section-title i {
            margin-right: 10px;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #444;
        }
        
        input, select {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #d0d7e2;
            border-radius: 6px;
            font-size: 1rem;
            transition: border 0.3s;
        }
        
        input:focus, select:focus {
            border-color: #1e5799;
            outline: none;
            box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.1);
        }
        
        .date-range-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .date-range-container input {
            flex: 1;
        }
        
        .date-separator {
            color: #666;
            font-weight: bold;
        }
        
        .hint {
            font-size: 0.85rem;
            color: #666;
            margin-top: 5px;
            font-style: italic;
        }
        
        .button-group {
            display: flex;
            gap: 15px;
            margin-top: 30px;
        }
        
        button {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 6px;
            font-size: 1.05rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        button i {
            margin-right: 8px;
        }
        
        .calculate-btn {
            background-color: #1e5799;
            color: white;
        }
        
        .calculate-btn:hover {
            background-color: #17467e;
            transform: translateY(-2px);
        }
        
        .reset-btn {
            background-color: #f0f3f9;
            color: #555;
        }
        
        .reset-btn:hover {
            background-color: #e1e7f1;
        }
        
        .result-box {
            background-color: #f8fafd;
            border-radius: 8px;
            padding: 25px;
            margin-bottom: 30px;
            border: 1px solid #e1e8f0;
        }
        
        .result-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px dashed #dce4ef;
        }
        
        .result-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }
        
        .result-label {
            font-weight: 600;
            color: #555;
        }
        
        .result-value {
            font-weight: 700;
            color: #1e5799;
            font-size: 1.2rem;
        }
        
        .total {
            background-color: #eef5ff;
            padding: 15px;
            border-radius: 6px;
            margin-top: 10px;
        }
        
        .total .result-value {
            font-size: 1.5rem;
            color: #d32f2f;
        }
        
        .legal-notice {
            background-color: #fff8e1;
            border-left: 4px solid #ffc107;
            padding: 20px;
            margin-top: 30px;
            border-radius: 4px;
        }
        
        .legal-notice h3 {
            color: #856404;
            margin-bottom: 10px;
        }
        
        .legal-notice p {
            margin-bottom: 10px;
            color: #664d03;
        }
        
        footer {
            text-align: center;
            padding: 20px;
            color: #666;
            font-size: 0.9rem;
            border-top: 1px solid #eee;
            background-color: #f9fbfd;
        }
        
        @media (max-width: 768px) {
            .calculator-wrapper {
                flex-direction: column;
            }
            
            .result-section {
                border-left: none;
                border-top: 1px solid #eaeaea;
            }
            
            .button-group {
                flex-direction: column;
            }
            
            .date-range-container {
                flex-direction: column;
                gap: 10px;
            }
            
            .date-separator {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="container">
 
        
        <div class="calculator-wrapper">
            <div class="input-section">
                <h2 class="section-title"><i class="fas fa-edit"></i> 填写欠薪信息</h2>
                
                <div class="form-group">
                    <label for="salary">月平均工资(元)</label>
                    <input type="number" id="salary" min="0" step="100" placeholder="请输入您的月平均工资" value="8000">
                    <div class="hint">请输入税前月平均工资,包括奖金、津贴等</div>
                </div>
                
                <div class="form-group">
                    <label for="unpaidMonths">欠薪月数</label>
                    <input type="number" id="unpaidMonths" min="0" step="0.5" placeholder="请输入欠薪月数" value="3">
                    <div class="hint">可输入小数,如2.5个月</div>
                </div>
                
                <div class="form-group">
                    <label for="overtimeHours">每月平均加班时长(小时)</label>
                    <input type="number" id="overtimeHours" min="0" step="1" placeholder="请输入每月平均加班时长" value="30">
                    <div class="hint">按劳动法规定,加班费按小时工资的150%计算</div>
                </div>
                
                <div class="form-group">
                    <label for="compensationType">经济补偿金类型</label>
                    <select id="compensationType">
                        <option value="0">无需支付经济补偿金</option>
                        <option value="0.5">工作不满半年,支付半个月工资</option>
                        <option value="1" selected>工作半年以上,支付一个月工资</option>
                        <option value="n">N个月工资(根据工作年限)</option>
                    </select>
                    <div class="hint">根据《劳动合同法》第四十六条规定</div>
                </div>
                
                <div class="form-group" id="yearsOfWorkGroup" style="display: none;">
                    <label for="yearsOfWork">工作年限(年)</label>
                    <input type="number" id="yearsOfWork" min="0" step="0.5" placeholder="请输入工作年限" value="3">
                    <div class="hint">工作满6个月不满1年按1年计算,不满6个月按半年计算</div>
                </div>
                
                <div class="form-group">
                    <label for="unpaidDuration">欠薪持续时间</label>
                    <div class="date-range-container">
                        <input type="date" id="startDate" value="2025-10-15">
                        <span class="date-separator">至</span>
                        <input type="date" id="endDate" value="2026-01-15">
                    </div>
                    <div class="hint">用于计算滞纳金,请选择欠薪的起始和结束日期</div>
                </div>
                
                <div class="button-group">
                    <button class="calculate-btn" id="calculateBtn">
                        <i class="fas fa-calculator"></i> 计算欠薪总额
                    </button>
                    <button class="reset-btn" id="resetBtn">
                        <i class="fas fa-redo"></i> 重置数据
                    </button>
                </div>
            </div>
            
            <div class="result-section">
                <h2 class="section-title"><i class="fas fa-chart-bar"></i> 计算结果</h2>
                
                <div class="result-box">
                    <div class="result-item">
                        <span class="result-label">基本欠薪总额:</span>
                        <span class="result-value" id="basicUnpaid">0.00 元</span>
                    </div>
                    
                    <div class="result-item">
                        <span class="result-label">加班费总额:</span>
                        <span class="result-value" id="overtimeUnpaid">0.00 元</span>
                    </div>
                    
                    <div class="result-item">
                        <span class="result-label">经济补偿金:</span>
                        <span class="result-value" id="compensation">0.00 元</span>
                    </div>
                    
                    <div class="result-item">
                        <span class="result-label">滞纳金(估算):</span>
                        <span class="result-value" id="lateFee">0.00 元</span>
                    </div>
                    
                    <div class="result-item total">
                        <span class="result-label">欠薪总计:</span>
                        <span class="result-value" id="totalUnpaid">0.00 元</span>
                    </div>
                </div>
                
                <div class="legal-notice">
                    <h3><i class="fas fa-gavel"></i> 法律提示</h3>
                    <p>1. 根据《劳动法》第五十条规定,工资应当以货币形式按月支付给劳动者本人,不得克扣或者无故拖欠。</p>
                    <p>2. 用人单位拖欠工资的,劳动行政部门可责令支付工资、经济补偿金,并可责令支付赔偿金。</p>
                    <p>3. 本计算结果仅供参考,具体金额以劳动仲裁或法院判决为准。</p>
                    <p>4. 如遇欠薪问题,请及时向当地劳动监察部门投诉或申请劳动仲裁。</p>
                </div>
            </div>
        </div>
        
        <footer>
            <p>© 欠薪计算器 | 本工具仅供参考,不构成法律建议 | 数据在本地计算,不会上传到服务器</p>
        </footer>
    </div>
 
    <script>
        // DOM元素获取
        const salaryInput = document.getElementById('salary');
        const unpaidMonthsInput = document.getElementById('unpaidMonths');
        const overtimeHoursInput = document.getElementById('overtimeHours');
        const compensationTypeSelect = document.getElementById('compensationType');
        const yearsOfWorkGroup = document.getElementById('yearsOfWorkGroup');
        const yearsOfWorkInput = document.getElementById('yearsOfWork');
        const startDateInput = document.getElementById('startDate');
        const endDateInput = document.getElementById('endDate');
        const calculateBtn = document.getElementById('calculateBtn');
        const resetBtn = document.getElementById('resetBtn');
        
        // 结果元素
        const basicUnpaidEl = document.getElementById('basicUnpaid');
        const overtimeUnpaidEl = document.getElementById('overtimeUnpaid');
        const compensationEl = document.getElementById('compensation');
        const lateFeeEl = document.getElementById('lateFee');
        const totalUnpaidEl = document.getElementById('totalUnpaid');
        
        // 设置默认日期范围(3个月)
        function setDefaultDateRange() {
            const today = new Date();
            const threeMonthsAgo = new Date(today);
            threeMonthsAgo.setMonth(today.getMonth() - 3);
            
            // 格式化开始日期(3个月前)
            const startYear = threeMonthsAgo.getFullYear();
            const startMonth = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
            const startDay = String(threeMonthsAgo.getDate()).padStart(2, '0');
            
            // 格式化结束日期(今天)
            const endYear = today.getFullYear();
            const endMonth = String(today.getMonth() + 1).padStart(2, '0');
            const endDay = String(today.getDate()).padStart(2, '0');
            
            startDateInput.value = `${startYear}-${startMonth}-${startDay}`;
            endDateInput.value = `${endYear}-${endMonth}-${endDay}`;
        }
        
        // 页面加载时设置默认日期范围
        window.addEventListener('DOMContentLoaded', setDefaultDateRange);
        
        // 经济补偿金类型改变时的处理
        compensationTypeSelect.addEventListener('change', function() {
            if (this.value === 'n') {
                yearsOfWorkGroup.style.display = 'block';
            } else {
                yearsOfWorkGroup.style.display = 'none';
            }
        });
        
        // 计算函数
        function calculateUnpaidSalary() {
            // 获取输入值
            const salary = parseFloat(salaryInput.value) || 0;
            const unpaidMonths = parseFloat(unpaidMonthsInput.value) || 0;
            const overtimeHours = parseFloat(overtimeHoursInput.value) || 0;
            const compensationType = compensationTypeSelect.value;
            const yearsOfWork = parseFloat(yearsOfWorkInput.value) || 0;
            
            // 获取日期范围
            const startDate = new Date(startDateInput.value);
            const endDate = new Date(endDateInput.value);
            
            // 确保结束日期不小于开始日期
            if (endDate < startDate) {
                alert("结束日期不能早于开始日期,已自动调整");
                endDateInput.value = startDateInput.value;
                return calculateUnpaidSalary();
            }
            
            // 计算基本欠薪
            const basicUnpaid = salary * unpaidMonths;
            
            // 计算加班费(按小时工资的150%计算)
            const hourlyWage = salary / 21.75 / 8; // 月平均工资 / 月平均工作日 / 每天8小时
            const overtimeUnpaid = hourlyWage * 1.5 * overtimeHours * unpaidMonths;
            
            // 计算经济补偿金
            let compensation = 0;
            if (compensationType === 'n') {
                compensation = salary * yearsOfWork;
            } else {
                compensation = salary * parseFloat(compensationType);
            }
            
            // 计算滞纳金(按日利率0.05%估算)
            const daysDiff = Math.max(0, Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24)));
            const lateFee = basicUnpaid * 0.0005 * daysDiff;
            
            // 计算总计
            const totalUnpaid = basicUnpaid + overtimeUnpaid + compensation + lateFee;
            
            // 更新显示结果
            basicUnpaidEl.textContent = basicUnpaid.toFixed(2) + ' 元';
            overtimeUnpaidEl.textContent = overtimeUnpaid.toFixed(2) + ' 元';
            compensationEl.textContent = compensation.toFixed(2) + ' 元';
            lateFeeEl.textContent = lateFee.toFixed(2) + ' 元';
            totalUnpaidEl.textContent = totalUnpaid.toFixed(2) + ' 元';
            
            return {
                basicUnpaid,
                overtimeUnpaid,
                compensation,
                lateFee,
                totalUnpaid,
                daysDiff
            };
        }
        
        // 重置函数
        function resetForm() {
            salaryInput.value = '8000';
            unpaidMonthsInput.value = '3';
            overtimeHoursInput.value = '30';
            compensationTypeSelect.value = '1';
            yearsOfWorkGroup.style.display = 'none';
            yearsOfWorkInput.value = '3';
            setDefaultDateRange();
            
            // 重置结果
            basicUnpaidEl.textContent = '0.00 元';
            overtimeUnpaidEl.textContent = '0.00 元';
            compensationEl.textContent = '0.00 元';
            lateFeeEl.textContent = '0.00 元';
            totalUnpaidEl.textContent = '0.00 元';
        }
        
        // 事件监听
        calculateBtn.addEventListener('click', calculateUnpaidSalary);
        resetBtn.addEventListener('click', resetForm);
        
        // 当日期变化时自动计算
        startDateInput.addEventListener('change', calculateUnpaidSalary);
        endDateInput.addEventListener('change', calculateUnpaidSalary);
        
        // 初始计算
        calculateUnpaidSalary();
    </script>
</body>
</html>