2025-11-27 16:55:35 +08:00
|
|
|
|
var name="";
|
|
|
|
|
|
var idNumber="";
|
|
|
|
|
|
var certificateName="";
|
|
|
|
|
|
var isUpload = false;
|
|
|
|
|
|
var form;
|
|
|
|
|
|
var layer;
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
layui.use(['form', 'laydate','upload'], function () {
|
|
|
|
|
|
form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
|
|
|
|
|
laydate = layui.laydate;
|
|
|
|
|
|
layer=layui.layer;
|
|
|
|
|
|
var upload = layui.upload;
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
form.verify({
|
|
|
|
|
|
});
|
|
|
|
|
|
// 年月选择器
|
|
|
|
|
|
laydate.render({
|
|
|
|
|
|
elem: '#month',
|
|
|
|
|
|
type: 'month',
|
|
|
|
|
|
max:getNowTime()
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// getProForSalary();
|
|
|
|
|
|
// getSubForSalary();
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
var isup=$("#isupdate").val();
|
|
|
|
|
|
if(isup==0){
|
|
|
|
|
|
getProForSalary(); // 初始化时加载工程下拉列表
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
form.on('select(proId)', function(data){
|
|
|
|
|
|
console.log(data,"data")
|
|
|
|
|
|
getSubForSalary(data.value);
|
|
|
|
|
|
})
|
|
|
|
|
|
//getAllPersonList(form);
|
|
|
|
|
|
document.getElementById('nextButton').addEventListener('click', function() {
|
|
|
|
|
|
//判断 月份、工程、分包、备注是否填写
|
|
|
|
|
|
if ($("#month").val()==""){
|
|
|
|
|
|
layer.msg("请选择月份!", {icon: 2, time: 2000});
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}else if ($("#proId").val()==""){
|
|
|
|
|
|
layer.msg("请选择工程!", {icon: 2, time: 2000});
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}else if ($("#subId").val()==""){
|
|
|
|
|
|
layer.msg("请选择分包!", {icon: 2, time: 2000});
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else if ($("#remark").val()==""){
|
|
|
|
|
|
layer.msg("请填写备注!", {icon: 2, time: 2000});
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
document.getElementById('div1').style.display = 'none';
|
|
|
|
|
|
document.getElementById('div2').style.display = 'block';
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('prevButton').addEventListener('click', function() {
|
|
|
|
|
|
document.getElementById('div2').style.display = 'none';
|
|
|
|
|
|
document.getElementById('div1').style.display = 'block';
|
|
|
|
|
|
});
|
|
|
|
|
|
document.getElementById('submitReword').addEventListener('click', function() {
|
|
|
|
|
|
var excelFileAttenname = $("#excelFileAtten").val();
|
|
|
|
|
|
var excelFileALLname = $("#excelFileALL").val();
|
|
|
|
|
|
if(excelFileAttenname==null|| excelFileAttenname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileAttenname.endsWith(".xls") || excelFileAttenname.endsWith(".xlsx") || excelFileAttenname.endsWith(".xlsm"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!");
|
|
|
|
|
|
$("#excelFileAtten").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(excelFileALLname==null|| excelFileALLname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileALLname.endsWith(".xls") || excelFileALLname.endsWith(".xlsx") || excelFileALLname.endsWith(".xlsm"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!");
|
|
|
|
|
|
$("#excelFileALL").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var ischeck=$("#isCheck").val();
|
|
|
|
|
|
if(ischeck==0){
|
|
|
|
|
|
layer.msg("请点击 开始对比 !")
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
updateReword("1");
|
|
|
|
|
|
});
|
|
|
|
|
|
document.getElementById('saveReword').addEventListener('click', function() {
|
|
|
|
|
|
var excelFileAttenname = $("#excelFileAtten").val();
|
|
|
|
|
|
var excelFileALLname = $("#excelFileALL").val();
|
|
|
|
|
|
if(excelFileAttenname==null|| excelFileAttenname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileAttenname.endsWith(".xlsx"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!");
|
|
|
|
|
|
$("#excelFileAtten").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(excelFileALLname==null|| excelFileALLname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileALLname.endsWith(".xlsx"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!");
|
|
|
|
|
|
$("#excelFileALL").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var ischeck=$("#isCheck").val();
|
|
|
|
|
|
if(ischeck==0){
|
|
|
|
|
|
layer.msg("请点击 开始对比 !")
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
updateReword("0");
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#importAtten").click(function(){
|
|
|
|
|
|
importExcel();
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#jieguo").click(function(){
|
|
|
|
|
|
jieguo();
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
function getNowTime() {
|
|
|
|
|
|
var time = new Date();
|
|
|
|
|
|
var year = time.getFullYear();
|
|
|
|
|
|
var month = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
|
|
|
|
|
|
var day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
|
|
|
|
|
|
return year + "-" + month + "-" + day;
|
|
|
|
|
|
}
|
|
|
|
|
|
function setData(rewordNum){
|
|
|
|
|
|
$("#rewordNum").val(rewordNum)
|
|
|
|
|
|
}
|
|
|
|
|
|
function setData2(rewordNum){
|
|
|
|
|
|
console.log(rewordNum,"setData2")
|
|
|
|
|
|
$("#rewordNum").val(rewordNum);
|
|
|
|
|
|
$("#isupdate").val("1");
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'post',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_ht_url + '/salaryCheck/getDetailForUpadte',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
data: {rewordNum:rewordNum},
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
getSubForSalary("");
|
|
|
|
|
|
$("#month").val(data.data.month)
|
|
|
|
|
|
$("#proId").val(data.data.proId)
|
|
|
|
|
|
$("#subId").val(data.data.subId)
|
|
|
|
|
|
$("#remark").val(data.data.checkRemark)
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (err) {
|
|
|
|
|
|
console.log("出错:", err);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function updateReword(state){
|
|
|
|
|
|
var rewordNum=$("#rewordNum").val();
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'post',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_ht_url + '/salaryCheck/updateReword',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
data: {state:state,rewordNum:rewordNum},
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
console.log(data,"updateReword")
|
|
|
|
|
|
var isupdate=$("#isupdate").val();
|
|
|
|
|
|
if(isupdate==1){
|
|
|
|
|
|
window.parent.init();
|
|
|
|
|
|
}
|
|
|
|
|
|
if(state==1){
|
|
|
|
|
|
openResult();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
reloading();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (err) {
|
|
|
|
|
|
console.log("出错:", err);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function getProForSalary() {
|
|
|
|
|
|
$("#proId").html("");
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'post',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_ht_url + '/salaryCheck/getPros',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
data: {},
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
var html = '<option value="">--请选择--</option>';
|
|
|
|
|
|
for (var i = 0; i < data.data.length; i++) {
|
|
|
|
|
|
html += '<option value="' + data.data[i].proId + '">' + data.data[i].proName + '</option>';
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#proId").html(html);
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
|
|
|
|
|
|
// 绑定事件监听器以在用户选择工程时加载分包商
|
|
|
|
|
|
$("#proId").change(function() {
|
|
|
|
|
|
var selectedProId = $(this).val(); // 获取选中的工程ID
|
|
|
|
|
|
if (selectedProId) { // 如果选择了工程
|
|
|
|
|
|
getSubForSalary(selectedProId); // 加载分包商
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$("#subId").html(""); // 如果没有选择工程,则清空分包商下拉列表
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (err) {
|
|
|
|
|
|
console.log("获取工程信息下拉列表出错:", err);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function getSubForSalary(proId) {
|
|
|
|
|
|
$("#subId").html("");
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'post',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_ht_url + '/salaryCheck/getSubs',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
async: false,
|
|
|
|
|
|
data: {proId:proId},
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
var html = '';
|
|
|
|
|
|
for (var i = 0; i < data.data.length; i++) {
|
|
|
|
|
|
html += '<option value="' + data.data[i].subId + '">' + data.data[i].subName + '</option>';
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#subId").html(html);
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (err) {
|
|
|
|
|
|
console.log("获取分包商信息下拉列表出错:", err);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//导入excel文件
|
|
|
|
|
|
function importExcel(){
|
|
|
|
|
|
$("#isCheck").val("0");
|
|
|
|
|
|
var formData = new FormData($('form')[0]);
|
|
|
|
|
|
var excelFileAttenname = $("#excelFileAtten").val();
|
|
|
|
|
|
var excelFileALLname = $("#excelFileALL").val();
|
|
|
|
|
|
if(excelFileAttenname==null|| excelFileAttenname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileAttenname.endsWith(".xlsx"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!");
|
|
|
|
|
|
$("#excelFileAtten").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(excelFileALLname==null|| excelFileALLname == "") {
|
|
|
|
|
|
layer.msg("请上传Excel表格!xlsx格式");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!(excelFileALLname.endsWith(".xlsx"))) {
|
|
|
|
|
|
layer.msg("请上传正确的Excel表格!xlsx格式");
|
|
|
|
|
|
$("#excelFileALL").val("");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var proId=$("#proId").val();
|
|
|
|
|
|
var month=$("#month").val();
|
|
|
|
|
|
var subId=$("#subId").val();
|
|
|
|
|
|
var remark=$("#remark").val();
|
|
|
|
|
|
var rewordNum=$("#rewordNum").val();
|
|
|
|
|
|
formData.append("file1", $("#excelFileALL")[0].files[0]);
|
|
|
|
|
|
formData.append("file2", $("#excelFileAtten")[0].files[0]);
|
|
|
|
|
|
formData.append("month", month);
|
|
|
|
|
|
formData.append("proId", proId);
|
|
|
|
|
|
formData.append("subId", subId);
|
|
|
|
|
|
formData.append("remark", remark);
|
|
|
|
|
|
formData.append("rewordNum", rewordNum);
|
|
|
|
|
|
var idx = layer.msg('正在处理数据,请稍等...', {
|
|
|
|
|
|
icon: 16
|
|
|
|
|
|
,shade: 0.01
|
|
|
|
|
|
,time:'0'
|
|
|
|
|
|
});
|
|
|
|
|
|
$.ajax({
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url : smz_ht_url + "/salaryCheck/importExcelALL",
|
2025-11-27 16:55:35 +08:00
|
|
|
|
type : 'POST',
|
|
|
|
|
|
data : formData,
|
|
|
|
|
|
timeout:20000,
|
|
|
|
|
|
// 告诉jQuery不要去处理发送的数据
|
|
|
|
|
|
processData : false,
|
|
|
|
|
|
// 告诉jQuery不要去设置Content-Type请求头
|
|
|
|
|
|
contentType : false,
|
|
|
|
|
|
success : function(data) {
|
|
|
|
|
|
layer.close(idx);
|
|
|
|
|
|
if(data.code==200){
|
|
|
|
|
|
$("#rewordNum").val(data.rewordNum);
|
|
|
|
|
|
$("#countNum").html("异常数据"+data.count+"条")
|
|
|
|
|
|
layer.alert(data.msg, {icon: 1});
|
|
|
|
|
|
$("#jieguo").html("结果下载");
|
|
|
|
|
|
$("#isCheck").val("1");
|
|
|
|
|
|
}else{
|
|
|
|
|
|
layer.alert(data.msg, {icon: 2});
|
|
|
|
|
|
}
|
|
|
|
|
|
// example.ajax.reload(null, false); // 刷新页面
|
|
|
|
|
|
},
|
|
|
|
|
|
error:function(XMLHttpRequest, textStatus, errorThrown) {
|
|
|
|
|
|
console.log(JSON.stringify(errorThrown));
|
|
|
|
|
|
layer.close(idx);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function openResult(){
|
|
|
|
|
|
localStorage.setItem("submitrewordNum",$("#rewordNum").val());
|
2025-12-13 17:44:14 +08:00
|
|
|
|
var height = '97.5%';
|
|
|
|
|
|
var width = '97.5%';
|
2025-11-27 16:55:35 +08:00
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: '结果',
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
closeBtn: 0,
|
|
|
|
|
|
content: 'submitReword.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 打开比对说明页面
|
|
|
|
|
|
*/
|
|
|
|
|
|
function ruleView(){
|
|
|
|
|
|
localStorage.setItem("uprewordNum",$("#rewordNum").val());
|
2025-12-13 17:44:14 +08:00
|
|
|
|
var height = '75%';
|
|
|
|
|
|
var width = '75%';
|
2025-11-27 16:55:35 +08:00
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: '比对说明',
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'uploadResultsComparisonExplanation.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
// btn:['确定','关闭'],
|
|
|
|
|
|
// yes:function(index,layero){
|
|
|
|
|
|
// var formSubmit=layer.getChildFrame('form', index);
|
|
|
|
|
|
// var submited = formSubmit.find('button')[2];
|
|
|
|
|
|
// // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
|
|
|
|
|
|
// submited.click();
|
|
|
|
|
|
// example.ajax.reload(); // 刷新页面
|
|
|
|
|
|
// },
|
|
|
|
|
|
// btn2:function(index,layero){
|
|
|
|
|
|
//
|
|
|
|
|
|
// }
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function jieguo(){
|
2025-12-05 15:39:43 +08:00
|
|
|
|
var token = localStorage.getItem("smz-token");
|
2025-11-27 16:55:35 +08:00
|
|
|
|
let loadingMsg = layer.msg("请稍等...", {icon: 16, scrollbar: false, time: 0});
|
2025-12-09 18:44:29 +08:00
|
|
|
|
let url = smz_ht_url + "/salaryCheck/exportCheck?rewordNum=" + $('#rewordNum').val().trim()+"&token="+token ;
|
2025-11-27 16:55:35 +08:00
|
|
|
|
let xhr = new XMLHttpRequest();
|
|
|
|
|
|
xhr.open("get", url, true);
|
|
|
|
|
|
xhr.responseType = "blob"; // 转换流
|
|
|
|
|
|
xhr.onload = function () {
|
|
|
|
|
|
layer.close(loadingMsg);
|
|
|
|
|
|
if (this.status === 200) {
|
|
|
|
|
|
let blob = this.response;
|
|
|
|
|
|
var a = document.createElement("a");
|
|
|
|
|
|
let url = window.URL.createObjectURL(blob);
|
|
|
|
|
|
a.href = url;
|
|
|
|
|
|
a.download = "比对结果.xlsx"; // 文件名
|
|
|
|
|
|
a.click();
|
|
|
|
|
|
window.URL.revokeObjectURL(url)
|
|
|
|
|
|
}else {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
xhr.send();
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 去下载
|
|
|
|
|
|
* 跳转考勤统计页面
|
|
|
|
|
|
*/
|
|
|
|
|
|
function goDownload(){
|
2025-12-13 17:44:14 +08:00
|
|
|
|
var height = '97.5%';
|
|
|
|
|
|
var width = '97.5%';
|
2025-11-27 16:55:35 +08:00
|
|
|
|
var index = parent.layer.open({
|
|
|
|
|
|
title: '考勤统计',
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: '../../../pages/work/person/faceContrastNew/faceContrast.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function resultsView(){
|
|
|
|
|
|
var ischeck=$("#isCheck").val();
|
|
|
|
|
|
if(ischeck==0){
|
|
|
|
|
|
layer.msg("请点击 开始对比 !")
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
localStorage.setItem("uprewordNum",$("#rewordNum").val());
|
2025-12-13 17:44:14 +08:00
|
|
|
|
var height = '97.5%';
|
|
|
|
|
|
var width = '97.5%';
|
2025-11-27 16:55:35 +08:00
|
|
|
|
var index = parent.layer.open({
|
|
|
|
|
|
title: '考勤统计',
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'uploadResultsViewAbnormal.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 模版下载
|
|
|
|
|
|
*/
|
|
|
|
|
|
function templateDownload() {
|
2025-12-09 18:44:29 +08:00
|
|
|
|
window.location.href = smz_ht_url + "/download/download?filename=工资支付表、劳动报酬确认单、传盘文件模版(新).xlsx";
|
2025-11-27 16:55:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置弹窗关闭
|
|
|
|
|
|
function reloading() {
|
|
|
|
|
|
parent.layer.closeAll();
|
|
|
|
|
|
layer.closeAll();
|
|
|
|
|
|
window.parent.example.ajax.reload(null, false); // 刷新页面
|
2025-12-13 17:44:14 +08:00
|
|
|
|
}
|