123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- /**
- * 人才认定申报管理初始化
- */
- 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: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
- {title: '离职状态', field: 'active', visible: true, align: 'center', valign: 'middle', width: '80px',
- formatter: function (value, row, index) {
- if (value == 1) {
- return '<span style="color:#6495ED">在职</span>';
- }
- if (value == 2) {
- return '<span style="color:#FF82AB">离职</span>';
- }
- }
- },
- {title: '企业名称', field: 'enterprise_name', visible: true, align: 'center', valign: 'middle', width: '150px'},
- {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: '120px',
- formatter: function (value, row, index) {
- if (row.sex == 1) {
- return value + '<span style="color:#6495ED">【男】</span>';
- }
- if (row.sex == 2) {
- return value + '<span style="color:#FF82AB">【女】</span>';
- }
- }
- },
- {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: '150px', 'class': 'uitd_showTip'},
- {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: '100px'},
- {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px',
- formatter: function (value, row, index) {
- if (!row.talent_condition) {
- return "积分认定";
- }
- return value;
- }
- },
- {title: '人才证书有效期', field: 'identifyGetTime', visible: isShow, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px',
- formatter: function (value, row, index) {
- return row.certificateGetTime + "至" + row.certificateExpireTime;
- }
- },
- {title: '公布入选月份', field: 'identifyMonth', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '100px'},
- {title: '人才编号', field: 'certificateNo', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '100px'},
- {title: '是否过期', field: 'isEffect', visible: isShow, align: 'center', valign: 'middle', width: '120px',
- formatter: function (value, row, index) {
- if (value == 1) {
- return '有效';
- } else if (value == 4) {
- return "失效";
- } else {
- return "已过期";
- }
- }
- },
- {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
- formatter: function (value, row, index) {
- return "<span class='label label-success' onclick=\"TalentInfo.showLog('" + value + "')\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- }
- ];
- };
- /**
- * 检查是否选中
- */
- 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.openTalentInfoDetail = function () {
- var process = 6;
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '人才认定申报详情',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/process/' + process,
- });
- layer.full(index);
- TalentInfo.layerIndex = index;
- }
- };
- //取消优秀人才
- TalentInfo.cancle = function () {
- if (this.check()) {
- if (TalentInfo.seItem.isEffect == 4) {
- Feng.info("无法重复取消");
- return;
- }
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talent/removeFromLibrary", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("取消优秀人才失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id": TalentInfo.seItem.id});
- ajax.start();
- }
- Feng.confirm("一旦取消将无法恢复,确认取消吗?", operation);
- }
- }
- /**
- * 恢复优秀人才
- */
- TalentInfo.recovery = function () {
- if (this.check()) {
- if (TalentInfo.seItem.isEffect != 4) {
- Feng.info("无法恢复有效数据");
- return;
- }
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talent/recovery", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("恢复优秀人才失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id": TalentInfo.seItem.id});
- ajax.start();
- }
- Feng.confirm("确认恢复吗?", operation);
- }
- }
- //公示导出
- TalentInfo.showExportModal = function () {
- $("#exportForm")[0].reset();
- $("#exportModal").modal("show");
- }
- //公示导出提交
- TalentInfo.export = function () {
- var names = '';
- var values = '';
- $("#field_info li input").each(function (index) {
- if ($(this).is(":checked")) {
- values = values + $(this).val() + ",";
- names = names + $(this).next().text() + ",";
- }
- });
- var name = $("#name").val();
- var sex = $("#sex").val();
- var idCard = $("#card_number").val();
- var nation = $("#nation").val();
- var nationality = $("#nationality").val();
- var talentType = $("#talent_type").val();
- var talentArrange = $("#talent_arrange").val();
- var active = $("#active").val();
- $("#exportModal").modal('hide');
- var url = Feng.ctxPath + "/talentInfoExport/libraryExport?name=" + name + "&names=" + names + "&values=" + values
- + "&sex=" + sex + "&idCard=" + idCard + "&nation=" + nation + "&nationality=" + nationality
- + "&talentType=" + talentType + "&talentArrange=" + talentArrange + "&active=" + active;
- window.location.href = encodeURI(encodeURI(url));
- }
- TalentInfo.editBasicInfo = function () {
- if (this.check()) {
- layer.open({
- type: 1,
- id: "neewFieldFormModel",
- title: '审核',
- area: ['800px', '450px'], //宽高
- fix: false, //不固定
- shade: 0,
- maxmin: true,
- content: '<form id="editBaiscInfo">' +
- ' <div class="form-group" style="margin: 10px;">' +
- ' <label for="checkMsgNotPass" class="control-label" >引进方式</label>' +
- ' <select class="form-control" id="introduceMode"></select>' +
- ' </div>' +
- ' <div class="form-group" style="margin: 10px;">' +
- ' <label for="checkMsgNotPass" class="control-label" >是否同步至津补贴申报</label>' +
- ' <select class="form-control" id="isSync">' +
- ' <option value="2">否</option> ' +
- ' <option value="1">是</option> ' +
- ' </select>' +
- ' </div>' +
- ' </form>',
- btn: ['<i class="fa fa-save"></i> 提交', '<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- zIndex: layer.zIndex,
- success: function (layero, index) {
- var arr = [{"name": "introduceMode", "code": "un_introduction_mode"}];
- Feng.findChildDictBatch(JSON.stringify(arr));
- },
- yes: function (index, layero) {
- var introduceMode = $("#introduceMode").val();
- var isSync = $("#isSync").val();
- if (Feng.isEmptyStr(introduceMode)) {
- Feng.info("请选择引进方式");
- return;
- }
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/editBasicInfo", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- layer.close(index);
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("修改失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", TalentInfo.seItem.id);
- ajax.set("introductionMode", introduceMode);
- ajax.set("isSync", isSync);
- ajax.start();
- }
- Feng.confirm("确认修改吗?", operation);
- }
- });
- }
- }
- //回调
- TalentInfo.callBack = function (data) {
- Feng.info(data.msg);
- }
- /**
- * 查看首次申报基础信息
- */
- TalentInfo.selectFirstInfo = function () {
- var process = $("#process").val();
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '人才认定首次申报信息',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/process/' + process,
- });
- layer.full(index);
- TalentInfo.layerIndex = index;
- }
- }
- $(function () {
- var defaultColunms = TalentInfo.initColumn();
- var process = $("#process").val();
- var table = new BSTable(TalentInfo.id, "/admin/talent/base_verify_list/process/" + process, defaultColunms);
- table.setPaginationType("server");
- table.setOnDblClickRow(function () {
- TalentInfo.openTalentInfoDetail();
- });
- table.setRowStyle(function (row, index) {
- if (row.isEffect == 2) {
- return {classes: 'warning'};
- } else if (row.isEffect == 3) {
- return {classes: 'danger'};
- } else if (row.isEffect == 4) {
- return {classes: 'info'}
- } else {
- return {};
- }
- });
- var t = TalentInfo.table = table.init();
- TalentInfo.init();
- //批量加载时间控件
- $(".time").each(function () {
- laydate.render({
- elem: "#" + $(this).attr("id")
- , type: "date"
- , trigger: 'click'
- });
- });
- });
|