/**
* 人才认定申报管理初始化
*/
var TalentInfo = {
id: "TalentInfoTable", //表格id
seItem: null, //选中的条目
table: null,
layerIndex: -1
};
/**
* 初始化表格的列
*/
TalentInfo.initColumn = function () {
var type = $("#type").val();
var isShow = true;
if (type == 2) {
isShow = false;
}
return [
{field: 'selectItem', radio: true},
{title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle', width: "100px",
formatter: function (value, row, index) {
if (value == 1) {
return '晋江市现代产业体系人才';
}
if (value == 2) {
return '集成电路优秀人才';
}
}
},
{title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
formatter: function (value, row, index) {
if (row.sex == 1) {
return value + '【男】';
} else if (row.sex == 2) {
return value + '【女】';
} else {
return value;
}
}
},
{title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
{title: '单位名称', field: 'enterpriseName', visible: isShow, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
{title: '单位标签', field: 'enterpriseTagName', visible: isShow, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
{title: '产业领域', field: 'industryName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
{title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
formatter: function (value, row, index) {
if (row.real_state != row.checkState) {
switch (row.real_state) {
case 4:
return "基审驳回";
break;
case 8:
return "初审驳回";
break;
case 10:
return "部门驳回";
break;
case 12:
return "复核驳回";
break;
}
} else {
switch (value) {
case - 2:
return "初审失败";
break;
case - 1:
return "基础信息审核失败";
break;
case 1:
return "保存未提交";
break;
case 2:
if (row.last_state == 4) {
return "待审核(重新提交)";
}
return "待审核";
break;
case 3:
return "待详细填报";
break;
case 5:
return "保存未提交(II)";
break;
case 6:
if (row.last_state == 8) {
return "待初审(重新提交)";
}
return "待初审";
break;
case 7:
if (row.companyIds) {
return "待部门审核";
} else {
return "待复审";
}
break;
case 9:
return "待复审";
break;
case 11:
return "认定通过";
break;
case 13:
return "复审失败";
break;
}
}
}
},
{title: '审核意见', field: 'checkMsg', visible: false, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
formatter: function (value, row, index) {
if (value == 1) {
return ""
} else if (value == 10 || value == 5) {
return value;
} else {
if (row.isPublic >= 5) {
if (value == -1) {
return value
} else if (value == 35) {
return value;
} else {
return ""
}
} else {
return ""
}
}
}
},
{title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
formatter: function (value, row, index) {
return "" +
"日志" +
"";
}
}
];
};
/**
* 检查是否选中
*/
TalentInfo.check = function () {
var selected = $('#' + this.id).bootstrapTable('getSelections');
if (selected.length == 0) {
Feng.info("请先选中表格中的某一记录!");
return false;
} else {
TalentInfo.seItem = selected[0];
return true;
}
};
/**
* 显示审核日志
*/
TalentInfo.showLog = function (id) {
layer.open({
type: 1,
title: "日志",
fixed: false,
content: '
',
area: ['80%', '80%'],
maxmin: true,
success: function (layero, index) {
Feng.getCheckLog(id, {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
}
});
}
/**
* 点击添加人才认定申报
*/
TalentInfo.openAddTalentInfo = function () {
var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
if (data.code == 200) {
var index = layer.open({
type: 2,
title: '添加人才认定申报',
fix: false, //不固定
maxmin: true,
content: '/enterprise/base/add?year=' + data.batch,
btn: [' 保存未提交', ' 提交审核', ' 取消'],
btnAlign: 'c',
btn1: function (index, layero) {
var obj = layero.find("iframe")[0].contentWindow;
obj.TalentInfoInfoDlg.addSubmit();
}, btn2: function (index, layero) {
var obj = layero.find("iframe")[0].contentWindow;
obj.TalentInfoInfoDlg.submitToCheck();
return false;
},
success: function (layero, index) {
layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
},
end: function () {
layer.closeAll('tips');
}
});
layer.full(index);
TalentInfo.layerIndex = index;
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.set("type", CONFIG.project_rcrd);
ajax.start();
};
/**
* 打开查看人才认定申报详情
*/
TalentInfo.openTalentInfoDetail = function () {
if (this.check()) {
var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
if (data.code == 200) {
var index = layer.open({
type: 2,
title: '人才认定申报详情',
area: ['800px', '420px'], //宽高
fix: false, //不固定
maxmin: true,
content: '/enterprise/base/add/id/' + TalentInfo.seItem.id,
btn: [' 保存未提交', ' 提交审核', ' 取消'],
btnAlign: 'c',
btn1: function (index, layero) {
var obj = layero.find("iframe")[0].contentWindow;
obj.TalentInfoInfoDlg.addSubmit();
}, btn2: function (index, layero) {
var obj = layero.find("iframe")[0].contentWindow;
obj.TalentInfoInfoDlg.submitToCheck();
return false;
},
success: function (layero, index) {
layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
},
end: function () {
layer.closeAll('tips');
}
});
layer.full(index);
TalentInfo.layerIndex = index;
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.set("type", CONFIG.project_rcrd);
ajax.set("year", TalentInfo.seItem.year);
ajax.start();
}
};
/**
* 查看
*/
TalentInfo.openTalentInfoSelect = function () {
if (this.check()) {
var index = layer.open({
type: 2,
title: '基础条件申报',
area: ['800px', '420px'], //宽高
fix: false, //不固定
maxmin: true,
content: '/enterprise/base/view/id/' + TalentInfo.seItem.id,
btn: [' 取消'],
btnAlign: 'c',
});
layer.full(index);
TalentInfo.layerIndex = index;
}
}
/**
* 删除人才认定申报
*/
TalentInfo.delete = function () {
if (this.check()) {
if (TalentInfo.seItem.checkState > 1) {
Feng.error("该申报已提交审核,无法删除");
return;
}
var operation = function () {
var ajax = new $ax("/enterprise/base/delete", function (data) {
Feng.success("删除成功!");
TalentInfo.table.refresh();
}, function (data) {
Feng.error("删除失败!" + data.responseJSON.message + "!");
});
ajax.set("talentInfoId", TalentInfo.seItem.id);
ajax.start();
}
Feng.confirm("删除后无法恢复,确认删除吗?", operation);
}
};
/**
* 查询表单提交参数对象
* @returns {{}}
*/
TalentInfo.formParams = function () {
var queryData = {};
queryData['name'] = $("#name").val();
queryData['card_number'] = $("#idCard").val();
queryData['sex'] = $("#sex").val();
queryData['nation'] = $("#nation").val();
queryData['nationality'] = $("#nationality").val();
queryData['talent_arrange'] = $("#talent_arrange").val();
queryData['checkState'] = $("#checkState").val();
return queryData;
}
/**
* 查询人才认定申报列表
*/
TalentInfo.search = function () {
TalentInfo.table.refresh({query: TalentInfo.formParams()});
};
/**
* 重置
*/
TalentInfo.reset = function () {
$("#name").val("");
$("#idCard").val("");
$("#sex").val("");
$("#nation").val("");
$("#nationality").val("");
$("#talentType").val("");
$("#talentArrange").val("");
$("#checkState").val("");
}
$(function () {
var defaultColunms = TalentInfo.initColumn();
var table = new BSTable(TalentInfo.id, "/enterprise/base/list/type/1", defaultColunms);
table.setPaginationType("server");
table.setOnDblClickRow(function () {
TalentInfo.openTalentInfoDetail();
});
TalentInfo.table = table.init();
//批量加载字典表数据
var arr = [
{"name": "nation", "code": "nation"},
{"name": "nationality", "code": "nationality"}
];
Feng.findChildDictBatch(JSON.stringify(arr));
});