hn_cloud_web/smz-web/js/work/uploadResults/uploadResultsViewAbnormal.js

368 lines
15 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var pers = []
var table, form, laydate
var yjIds, insMonths, ids;
// 静态数据
var tableData = [];
$(function () {
layui.use(['form', 'layer', 'table', 'laydate'], function() {
table = layui.table;
form = layui.form;
laydate = layui.laydate
initTree();
$("#searchBt").click(function(){
initTree();
})
});
})
function setData(idNumber,userName){
var cdata;
var uprewordNum=localStorage.getItem("uprewordNum")
$("#userName").html(userName)
$("#idNumber").html(idNumber)
$.ajax({//id获取详情打开弹窗传值子页面
type: 'post',
url: smz_ht_url + "/salaryCheck/getDetailByIdnumber",
dataType: 'json',
async:false,
data: {
idNumber: idNumber,rewordNum:uprewordNum
},
success: function (data) {
if(data.code=200){
cdata=data;
}
}
})
console.log(cdata,"cdata")
var desc=cdata.desc;
$("#description").val(desc);
$("#worker").empty()
$("#conf").empty()
$("#disk").empty()
$("#atten").empty()
var workerhtml='<tr class="grey" >\n' +
' <th style="width: 15%;">所在班组</th>\n' +
' <th style="width: 10%;">岗位</th>\n' +
' <th style="width: 10%;">出勤天数</th>\n' +
' <th style="width: 10%;">应发工资</th>\n' +
' <th style="width: 10%;">其中代扣/代缴</th>\n' +
' <th style="width: 10%;">实发工资</th>\n' +
' <th style="width: 20%;">开户银行</th>\n' +
' <th style="width: 15%;">银行卡号</th>\n' +
' </tr>';
var confhtnl='<tr class="grey" >\n' +
' <th style="width: 10%;" rowspan="2">岗位</th>\n' +
' <th style="width: 10%;" colspan="3">当月计日工资</th>\n' +
' <th style="width: 10%;" colspan="3">当月计件工资</th>\n' +
' <th style="width: 10%;" colspan="3">当月停工、窝工工资</th>\n' +
' <th style="width: 10%;" colspan="3">当月加班工资</th>\n' +
' <th style="width: 10%;" colspan="3">当月绩效奖金</th>\n' +
' <th style="width: 10%;" rowspan="2">报酬小计</th>\n' +
' <th style="width: 20%;" rowspan="2">签名</th>\n' +
' </tr>\n' +
'\n' +
' <tr class="grey" >\n' +
' <th style="width: 15%;border-top:2px solid #ECECEC;">单价</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">考勤天数</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">小计</th>\n' +
' <th style="width: 15%;border-top:2px solid #ECECEC;">单价</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">考勤天数</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">小计</th>\n' +
' <th style="width: 15%;border-top:2px solid #ECECEC;">单价</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">考勤天数</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">小计</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">单价</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">考勤天数</th>\n' +
' <th style="width: 10%;border-top:2px solid #ECECEC;">小计</th>\n' +
' <th style="width: 20%;border-top:2px solid #ECECEC;">单价</th>\n' +
' <th style="width: 15%;border-top:2px solid #ECECEC;">考勤天数</th>\n' +
' <th style="width: 15%;border-top:2px solid #ECECEC;">小计</th>\n' +
' </tr>';
var diskhtml='<tr class="grey" >\n' +
' <th style="width: 15%;">所在班组</th>\n' +
' <th style="width: 10%;">岗位</th>\n' +
' <th style="width: 10%;">出勤天数</th>\n' +
' <th style="width: 10%;">应发工资</th>\n' +
' <th style="width: 10%;">其中代扣/代缴</th>\n' +
' <th style="width: 10%;">实发工资</th>\n' +
' <th style="width: 35%;">银行卡号</th>\n' +
' </tr>';
var attenhtml='<tr class="grey" >\n' +
' <th style="width: 10%;">工种</th>\n' +
' <th style="width: 20%;">工程名称</th>\n' +
' <th style="width: 20%;">分包商</th>\n' +
' <th style="width: 10%;">班组</th>\n' +
' <th style="width: 5%;">计日天数</th>\n' +
' <th style="width: 5%;">计件天数</th>\n' +
' <th style="width: 5%;">停窝工天数</th>\n' +
' <th style="width: 5%;">休息天数</th>\n' +
' <th style="width: 5%;">缺勤天数</th>\n' +
' <th style="width: 5%;">合同工资</th>\n' +
' <th style="width: 10%;">合同绩效</th>\n' +
' <th style="width: 10%;">银行卡号</th>\n' +
' </tr>';
$.each(cdata.worker,function (index,item){
workerhtml=workerhtml+'<tr className="white">';
workerhtml=workerhtml+' <td>'+item.teamName+'</td>';
if(item.isPost==1){
workerhtml=workerhtml+' <td style="text-align: center;color: red;">'+item.post+'</td>';
}else{
workerhtml=workerhtml+' <td style="text-align: center;">'+item.post+'</td>';
}
if(item.isAttenNum==1){
workerhtml=workerhtml+' <td style="text-align: center;color: red">'+item.attenNum+'</td>';
}else{
workerhtml=workerhtml+' <td style="text-align: center;">'+item.attenNum+'</td>';
}
if(item.isPayable==1){
workerhtml=workerhtml+' <td style="text-align: center;color: red">'+item.payable+'</td>';
}else{
workerhtml=workerhtml+' <td style="text-align: center;">'+item.payable+'</td>';
}
workerhtml=workerhtml+' <td style="text-align: center;">'+item.withhold+'</td>';
if(item.isPayIn==1){
workerhtml=workerhtml+' <td style="text-align: center;color: red">'+item.payIn+'</td>';
}else{
workerhtml=workerhtml+' <td style="text-align: center;">'+item.payIn+'</td>';
}
workerhtml=workerhtml+' <td style="text-align: center;">'+item.bank+'</td>';
if(item.isBankNum==1){
workerhtml=workerhtml+' <td style="text-align: center;color: red">'+item.bankNum+'</td>';
}else{
workerhtml=workerhtml+' <td style="text-align: center;">'+item.bankNum+'</td>';
}
workerhtml=workerhtml+'</tr>';
})
$.each(cdata.conf,function (index,item){
confhtnl=confhtnl+'<tr className="white">';
if(item.isPost==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.post+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.post+'</td>';
}
//当月计日工资 -开始
if(item.isBasePrice==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.basePrice+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.basePrice+'</td>';
}
if(item.isAttenNum==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.baseNum+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.baseNum+'</td>';
}
confhtnl=confhtnl+' <td style="text-align: center;">'+item.baseCount+'</td>';
//当月计日工资 -结束
//当月计件工资 -开始
confhtnl=confhtnl+' <td style="text-align: center;">'+item.piecePrice+'</td>';
if(item.isPieceNum==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.pieceNum+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.pieceNum+'</td>';
}
confhtnl=confhtnl+' <td style="text-align: center;">'+item.pieceCount+'</td>';
//当月计件工资 -结束
//当月停工、窝工工资 -开始
confhtnl=confhtnl+' <td style="text-align: center;">'+item.sutDownPrice+'</td>';
if(item.isSutDownNum==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.sutDownNum+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.sutDownNum+'</td>';
}
confhtnl=confhtnl+' <td style="text-align: center;">'+item.sutDownCount+'</td>';
//当月停工、窝工工资 -结束
//当月加班工资 -开始
confhtnl=confhtnl+' <td style="text-align: center;">'+item.overtimePrice+'</td>';
confhtnl=confhtnl+' <td style="text-align: center;">'+item.overtimeNum+'</td>';
confhtnl=confhtnl+' <td style="text-align: center;">'+item.overCount+'</td>';
//当月加班工资 -结束
//当月绩效奖金 -开始
// if(item.isAchievementsPrice==1){
// confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.achievementsPrice+'</td>';
// }else{
// confhtnl=confhtnl+' <td style="text-align: center;">'+item.achievementsPrice+'</td>';
// }
confhtnl=confhtnl+' <td style="text-align: center;">'+item.achievementsPrice+'</td>';
confhtnl=confhtnl+' <td style="text-align: center;">'+item.achievementsNum+'</td>';
confhtnl=confhtnl+' <td style="text-align: center;">'+item.achievementsCount+'</td>';
//当月绩效奖金 -结束
//报酬小计 -开始
if(item.isPayable==1){
confhtnl=confhtnl+' <td style="text-align: center;color: red">'+item.payable+'</td>';
}else{
confhtnl=confhtnl+' <td style="text-align: center;">'+item.payable+'</td>';
}
//报酬小计 -结束
confhtnl=confhtnl+' <td style="text-align: center;">'+item.bonus+'</td>';
confhtnl=confhtnl+'</tr>';
})
$.each(cdata.disk,function (index,item){
diskhtml=diskhtml+'<tr className="white">';
diskhtml=diskhtml+' <td style="text-align: center;">'+item.teamName+'</td>';
if(item.isPost==1){
diskhtml=diskhtml+' <td style="text-align: center;color: red">'+item.post+'</td>';
}else{
diskhtml=diskhtml+' <td style="text-align: center;">'+item.post+'</td>';
}
if(item.isAttenNum==1){
diskhtml=diskhtml+' <td style="text-align: center;color: red">'+item.attenNum+'</td>';
}else{
diskhtml=diskhtml+' <td style="text-align: center;">'+item.attenNum+'</td>';
}
if(item.isPayable==1){
diskhtml=diskhtml+' <td style="text-align: center;color: red">'+item.payable+'</td>';
}else{
diskhtml=diskhtml+' <td style="text-align: center;">'+item.payable+'</td>';
}
diskhtml=diskhtml+' <td style="text-align: center;">'+item.withhold+'</td>';
if(item.isPayIn==1){
diskhtml=diskhtml+' <td style="text-align: center;color: red">'+item.payIn+'</td>';
}else{
diskhtml=diskhtml+' <td style="text-align: center;">'+item.payIn+'</td>';
}
if(item.isBankNum==1){
diskhtml=diskhtml+' <td style="text-align: center;color: red">'+item.bankNum+'</td>';
}else{
diskhtml=diskhtml+' <td style="text-align: center;">'+item.bankNum+'</td>';
}
diskhtml=diskhtml+'</tr>';
})
$.each(cdata.atten,function (index,item){
attenhtml=attenhtml+'<tr className="white">';
if(item.isPost==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.post+'</td>';
}else{
attenhtml=attenhtml+' <td style="text-align: center;">'+item.post+'</td>';
}
attenhtml=attenhtml+' <td style="text-align: center;">'+item.proName+'</td>';
attenhtml=attenhtml+' <td style="text-align: center;">'+item.subName+'</td>';
attenhtml=attenhtml+' <td style="text-align: center;">'+item.teamName+'</td>';
if(item.isAttenNum==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.attenNum+'</td>';
}else{
attenhtml=attenhtml+' <td style="text-align: center;">'+item.attenNum+'</td>';
}
if(item.isPieceNum==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.pieceNum+'</td>';
} else {
attenhtml=attenhtml+' <td style="text-align: center;">'+item.pieceNum+'</td>';
}
if(item.isSutDownNum==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.sutDownNum+'</td>';
} else {
attenhtml=attenhtml+' <td style="text-align: center;">'+item.sutDownNum+'</td>';
}
attenhtml=attenhtml+' <td style="text-align: center;">'+item.restNum+'</td>';
attenhtml=attenhtml+' <td style="text-align: center;">'+item.noworkNum+'</td>';
if(item.isBasePrice==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.basePay+'</td>';
}else{
attenhtml=attenhtml+' <td style="text-align: center;">'+item.basePay+'</td>';
}
if(item.isAchievementsPrice==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.achievementsPay+'</td>';
}else{
attenhtml=attenhtml+' <td style="text-align: center;">'+item.achievementsPay+'</td>';
}
if(item.isBankNum==1){
attenhtml=attenhtml+' <td style="text-align: center;color: red">'+item.bankNum+'</td>';
}else{
attenhtml=attenhtml+' <td style="text-align: center;">'+item.bankNum+'</td>';
}
attenhtml=attenhtml+'</tr>';
})
$("#worker").append(workerhtml)
$("#conf").append(confhtnl)
$("#disk").append(diskhtml)
$("#atten").append(attenhtml)
}
function initTree(){
layui.use(['tree'], function () {
var tree = layui.tree;
var renderTree = function (data) {
tree.render({
elem: '#lineTree',
data: data,
id: 'lineTree',
showCheckbox: false,
accordion: false,
click: function (obj) {
console.log(obj);
setData(obj.data.id,obj.data.title);
}
});
}
var name=$("#name").val();
var uprewordNum=localStorage.getItem("uprewordNum");
$.ajax({//id获取详情打开弹窗传值子页面
type: 'post',
url: smz_ht_url + "/salaryCheck/getTreeDetail",
dataType: 'json',
data: {
recordNum: uprewordNum,title:name
},
success: function (data) {
if(data.code=200){
renderTree(data.data);
setData(data.data[0].id,data.data[0].title)
}
}
})
});
}
function init() {
$("#content>div:gt(0)").remove();
var html = '';
html += `<div class="navigation navigation_click" value="0">`
html += `<span>全部5</span>`
html += `</div>`
html += `<div class="navigation" value="153">`
html += `<span>李云飞</span>`
html += `</div>`
html += `<div class="navigation" value="154">`
html += `<span>肖洁</span>`
html += `</div>`
html += `<div class="navigation" value="155">`
html += `<span>吕继龙</span>`
html += `</div>`
html += `<div class="navigation" value="155">`
html += `<span>王彬</span>`
html += `</div>`
html += `<div class="navigation" value="155">`
html += `<span>岳粹山</span>`
html += `</div>`
$("#content").append(html);
$(".navigation").click(function (e) {
//样式调整
$(".navigation").removeClass("navigation_click");
$(this).addClass("navigation_click");
var text = $(this).children("span").text();
//样式调整
var examType = $(this).attr("value");
$("#examType").val(examType);
example.ajax.reload();
//子页面面包屑根目录
examTypeName = $(this).children("span").text();
})
}