245 lines
7.6 KiB
JavaScript
245 lines
7.6 KiB
JavaScript
// 初始化作业许可数据
|
|
function initPermitTable(type) {
|
|
getWorkPermitAndXhListAjax(type);
|
|
}
|
|
|
|
function getWorkPermitAndXhListAjax(type) {
|
|
let param = {
|
|
isSup: user.isSup,
|
|
currentUserOrgId: user.orgId,
|
|
type: type + ''
|
|
};
|
|
if (type === 1) {
|
|
param.status = $('#permitStatus').val() === '-1' ? '' : $('#permitStatus').val()
|
|
} else if (type === 2) {
|
|
param.status = $('#consumptionStatus').val() === '-1' ? '' : $('#consumptionStatus').val()
|
|
}
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify(param))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/getWorkPermitAndXhList?token=' + token,
|
|
data: param,
|
|
type: 'POST',
|
|
async: true,
|
|
success: function (result) {
|
|
if (result.code === 200) {
|
|
if (result.data) {
|
|
if (type === 1) {
|
|
setPermitTableData(result.data);
|
|
} else if (type === 2) {
|
|
setRiskConsumptionTableData(result.data)
|
|
}
|
|
} else {
|
|
if (type === 1) {
|
|
setPermitTableData(null);
|
|
} else if (type === 2) {
|
|
setRiskConsumptionTableData(null)
|
|
}
|
|
}
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
if (type === 1) {
|
|
setPermitTableData(null);
|
|
} else if (type === 2) {
|
|
setRiskConsumptionTableData(null)
|
|
}
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
}, error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
// 初始化风险销号数据
|
|
function initRiskConsumptionTable(type) {
|
|
getWorkPermitAndXhListAjax(type);
|
|
}
|
|
|
|
|
|
// 作业许可及销号必备条件详情-ajax
|
|
function getTicketEssenCondition() {
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify({
|
|
ticketNo: ticketNo
|
|
}))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/queryTicketEssenCondition?token=' + token,
|
|
data: {
|
|
ticketNo: ticketNo
|
|
},
|
|
type: 'POST',
|
|
async: false,
|
|
success: function (result) {
|
|
if (result.code === 200) {
|
|
if (result.data) {
|
|
setTicketEssenConditionData(result.data);
|
|
}
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
}, error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
// 作业许可及销号-ajax
|
|
function premitAjax(params) {
|
|
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify(params))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/updateTicketEssenCondition?token=' + token,
|
|
type: 'POST',
|
|
data: params,
|
|
dataType: 'json',
|
|
beforeSend: function () {
|
|
$('#permit').addClass("layui-btn-disabled").attr("disabled", true);
|
|
$('#noPermit').addClass("layui-btn-disabled").attr("disabled", true);
|
|
},
|
|
success: function (result) {
|
|
layer.close(loadingMsg); // 关闭提示层
|
|
if (result.code === 200) {
|
|
parent.layer.msg(result.msg, {icon: 1});
|
|
layer.closeAll();
|
|
reloadTableData(params.type);
|
|
getWorkPermitAndXhNumAjax()
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
$('#permit').removeClass("layui-btn-disabled").attr("disabled", false);
|
|
$('#noPermit').removeClass("layui-btn-disabled").attr("disabled", false);
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
},
|
|
error: function (result) {
|
|
layer.close(loadingMsg); // 关闭提示层
|
|
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
|
$('#permit').removeClass("layui-btn-disabled").attr("disabled", false);
|
|
$('#noPermit').removeClass("layui-btn-disabled").attr("disabled", false);
|
|
}
|
|
});
|
|
}
|
|
|
|
// 班组骨干-ajax
|
|
function getBackboneByIdList(){
|
|
let param = {
|
|
ticketId:ticketId
|
|
}
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify(param))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/getBackboneByIdList?token=' + token,
|
|
data: param,
|
|
type: 'POST',
|
|
async: true,
|
|
success: function (result) {
|
|
if (result.code === 200) {
|
|
if (result.data) {
|
|
setBackboneScoreInfo(result.data);
|
|
} else {
|
|
setBackboneScoreInfo(null);
|
|
}
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
setBackboneScoreInfo(null);
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
}, error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
// 准入人员-ajax
|
|
function getAccessPeopleByIdList(){
|
|
let param = {
|
|
ticketId:ticketId
|
|
}
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify(param))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/getAccessPeopleByIdList?token=' + token,
|
|
data: param,
|
|
type: 'POST',
|
|
async: true,
|
|
success: function (result) {
|
|
if (result.code === 200) {
|
|
if (result.data) {
|
|
setPersonAccessInfo(result.data);
|
|
} else {
|
|
setPersonAccessInfo(null);
|
|
}
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
setPersonAccessInfo(null);
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
}, error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
// 已编制安全技术措施-ajax
|
|
function getSgProgramAjax() {
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify({
|
|
bidNo: bidNo
|
|
}))
|
|
},
|
|
url: dataUrl + 'proteam/pot/todayTask/getSgFa?token=' + token,
|
|
data: {
|
|
bidNo: bidNo
|
|
},
|
|
type: 'POST',
|
|
async: true,
|
|
success: function (result) {
|
|
setProgramData(result);
|
|
}, error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
// 统计已许可,不许可的数量
|
|
function getWorkPermitAndXhNumAjax(){
|
|
let param = {
|
|
isSup: user.isSup,
|
|
currentUserOrgId: user.orgId
|
|
};
|
|
$.ajax({
|
|
headers: {
|
|
"encrypt": sm3(JSON.stringify(param))
|
|
},
|
|
url: dataUrl + 'proteam/pot/workPermit/getWorkPermitAndXhNum?token=' + token,
|
|
data: param,
|
|
type: 'POST',
|
|
async: true,
|
|
success: function (result) {
|
|
if (result.code === 200) {
|
|
$('#permitNum').html(result.data.permit)
|
|
$('#notPermitNum').html(result.data.notPermit)
|
|
$('#cancelNum').html(result.data.cancel)
|
|
$('#notCancelNum').html(result.data.notCancel)
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, {icon: 2})
|
|
$('#permitNum').html('0')
|
|
$('#notPermitNum').html('0')
|
|
$('#cancelNum').html('0')
|
|
$('#notCancelNum').html('0')
|
|
} else if (result.code === 401) {
|
|
logout(1)
|
|
}
|
|
}, error: function () {
|
|
}
|
|
});
|
|
} |