427 lines
13 KiB
JavaScript
427 lines
13 KiB
JavaScript
|
|
function getSub(form,proId) {
|
|||
|
|
$("#subId").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/SubContractor/getSubByProId',
|
|||
|
|
data: {
|
|||
|
|
proId: proId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
var html = '<option value="">--请选择分包商--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].subName + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#subId").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取分包商下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getTeam(subId,teamId) {
|
|||
|
|
$("#teamId").empty();
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'POST',
|
|||
|
|
url: ctxPath + '/noSignalTeamApply/getTeam',
|
|||
|
|
data: {
|
|||
|
|
subId: subId,
|
|||
|
|
teamId: teamId
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (data) {
|
|||
|
|
if(data.length>0){
|
|||
|
|
var str = '<option selected value="-1">请选择班组</option>';
|
|||
|
|
for(var i = 0; i < data.length; i++) {
|
|||
|
|
if(teamId == data[i].id) {
|
|||
|
|
str += '<option selected value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
|||
|
|
} else {
|
|||
|
|
str += '<option value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$("#teamId").append(str);
|
|||
|
|
layui.form.render('select'); //这里就是我们要渲染的地方了
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getPro(form,orgId) {
|
|||
|
|
$("#proId").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/project/getProject',
|
|||
|
|
data: {
|
|||
|
|
companyId: orgId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择工程--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#proId").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取工程下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getOrg(form) {
|
|||
|
|
$("#orgId").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/project/getCompanys',
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '';
|
|||
|
|
if (data.length > 1) {
|
|||
|
|
html = '<option value="">--请选择公司--</option>';
|
|||
|
|
}
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#orgId").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取分公司下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//分部分项工程
|
|||
|
|
function getBranchWork(form) {
|
|||
|
|
$("#branchWork").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/projectRisk/getBranchWork',
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择分部分项工程--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].branchWork + '">' + data[i].branchWork + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#branchWork").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取分部分项工程下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据分部分项工程 获取 中高风险作业
|
|||
|
|
function getRiskContent(branchWork, form) {
|
|||
|
|
$("#riskContent").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/projectRisk/getRiskContent',
|
|||
|
|
data: {
|
|||
|
|
branchWork: branchWork
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择中高风险作业--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].workRiskId + '">' + data[i].riskContent + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#riskContent").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取中高风险作业下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据工程ID 获取 施工现场
|
|||
|
|
function getScene(proId,startTf,endTf, form) {
|
|||
|
|
$("#workSenceStartId").html("");
|
|||
|
|
if(endTf){
|
|||
|
|
$("#workSenceEndId").html("");
|
|||
|
|
}
|
|||
|
|
console.log("proId", proId);
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/SceneManager/getSceneList',
|
|||
|
|
data: {
|
|||
|
|
proId: proId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择施工现场--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#workSenceStartId").html(html);
|
|||
|
|
if(endTf){
|
|||
|
|
$("#workSenceEndId").html(html);
|
|||
|
|
}
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取中高风险作业下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据工程ID 获取 施工现场
|
|||
|
|
function getSceneSinge(proId, form) {
|
|||
|
|
$("#workSceneId").html("");
|
|||
|
|
console.log("proId", proId);
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/SceneManager/getSceneList',
|
|||
|
|
data: {
|
|||
|
|
proId: proId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
console.log("getSceneSinge", data);
|
|||
|
|
var html = '<option value="">--请选择施工现场--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#workSceneId").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取中高风险作业下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据工程ID 获取 施工现场
|
|||
|
|
function getSceneSinge2(proId,workSenceId) {
|
|||
|
|
$("#workSenceId").html("");
|
|||
|
|
console.log("proId", proId);
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/SceneManager/getSceneList',
|
|||
|
|
data: {
|
|||
|
|
proId: proId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择施工现场--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
if (workSenceId == data[i].id) {
|
|||
|
|
html += '<option selected value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
|||
|
|
} else {
|
|||
|
|
html += '<option value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$("#workSenceId").html(html);
|
|||
|
|
layui.form.render('select'); //这里就是我们要渲染的地方了
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取中高风险作业下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//红名单人员 获取 施工人员信息
|
|||
|
|
function getRedPersonList(form) {
|
|||
|
|
$("#idNumber").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/Redlist/getRedPersonList',
|
|||
|
|
data: {},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择人员信息--</option>';
|
|||
|
|
var name = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].idNumber + '">' + data[i].idNumber + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#idNumber").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取人员信息下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//黑名单人员 获取 施工人员信息
|
|||
|
|
function getBlackPersonList(form) {
|
|||
|
|
$("#idNumber").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/Blacklist/getBlackPersonList',
|
|||
|
|
data: {},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择人员信息--</option>';
|
|||
|
|
var name = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].idNumber + '">' + data[i].idNumber + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#idNumber").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取人员信息下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据权限获取人员列表
|
|||
|
|
function getUserList(form, id, postId) {
|
|||
|
|
$(id).html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/users/getUserList',
|
|||
|
|
data: {
|
|||
|
|
role: postId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择人员信息--</option>';
|
|||
|
|
var name = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].username + '</option>';
|
|||
|
|
}
|
|||
|
|
$(id).html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取人员信息下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//根据权限获取工程部权限的人
|
|||
|
|
function getUserLists(form, id, postId) {
|
|||
|
|
$(id).html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/users/getUserListProject',
|
|||
|
|
data: {
|
|||
|
|
role: postId
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择人员信息--</option>';
|
|||
|
|
var name = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].username + '</option>';
|
|||
|
|
}
|
|||
|
|
$(id).html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取人员信息下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//获取厂家下拉选
|
|||
|
|
function getManufactor(form) {
|
|||
|
|
$("#manufactor").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/materialWarehours/getManufactor',
|
|||
|
|
data: {
|
|||
|
|
proId: ''
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择厂家--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].manufactor + '">' + data[i].manufactor + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#manufactor").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取厂家下拉选出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 中高风险库工程类型
|
|||
|
|
* */
|
|||
|
|
function getProType(form) {
|
|||
|
|
$("#proType").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/inHighRisk/getProType',
|
|||
|
|
data: {
|
|||
|
|
proId: ''
|
|||
|
|
},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择工程类型--</option>';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#proType").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取工程类型下拉选出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
//获取所有施工人员
|
|||
|
|
function getAllPersonList(form) {
|
|||
|
|
$("#personnelInformation").html("");
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ctxPath + '/BaseManager/getWorkerNameSelect',
|
|||
|
|
data: {},
|
|||
|
|
async: false,
|
|||
|
|
success: function (data) {
|
|||
|
|
var html = '<option value="">--请选择人员信息--</option>';
|
|||
|
|
var name = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
html += '<option selected value=\'' + data[i].idNumber + '\'>' + data[i].name + '</option>';
|
|||
|
|
}
|
|||
|
|
$("#personnelInformation").html(html);
|
|||
|
|
form.render();
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取人员信息下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取行政区code
|
|||
|
|
* */
|
|||
|
|
function getRegisterAddressCode(from,addressCodeId) {
|
|||
|
|
$("#registerAddressCode").empty();
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'POST',
|
|||
|
|
url: ctxPath + '/companyManager/getRegisterAddressCode',
|
|||
|
|
data: {},
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (data) {
|
|||
|
|
if (data.length > 0) {
|
|||
|
|
var html = '';
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
if(data[i].id === addressCodeId){
|
|||
|
|
html += '<option value=\'' + data[i].id + '\' selected>' + data[i].registerAddressCode + '</option>';
|
|||
|
|
}else{
|
|||
|
|
html += '<option value=\'' + data[i].id + '\'>' + data[i].registerAddressCode + '</option>';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
$("#registerAddressCode").append(html);
|
|||
|
|
from.render(); //这里就是我们要渲染的地方了
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
error: function (err) {
|
|||
|
|
console.log("获取行政区code下拉列表出错:", err);
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|