123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769 |
- /**
- * 人才认定申报管理初始化
- */
- var TalentInfo = {
- id: "TalentInfoTable", //表格id
- checkAll:false,
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- /**
- * 初始化表格的列
- */
- TalentInfo.initColumn = function () {
- var type = $("#usertype").val();
- var isShow = true;
- if(type==2){
- isShow = false;
- };
- return [
- {field: 'selectItem', checkbox: true},
- {title: '申报年度', field: '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: 'enterpriseName', 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: 'type', visible: true, align: 'center', valign: 'middle',width:'120px',
- // formatter : function (value,row,index){
- // if(value==1){
- // return '晋江市优秀人才';
- // }if(value==2){
- // return '集成电路优秀人才';
- // }
- // }
- // },
- {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:'100px'},
- {title: '人才标签', field: 'talentTypeName', visible: isShow, align: 'center', valign: 'middle',width:'100px'},
- {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'150px','class': 'uitd_showTip'},
- {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px'},
- {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
- {title: '获得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
- {title: '人才证书有效期', field: 'certificateStartTime', visible: isShow, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px',
- formatter : function (value,row,index) {
- return Feng.isNotEmptyStr(row.certificateStartTime) && Feng.isNotEmptyStr(row.qzgccrcActiveTime)?row.certificateStartTime +"至"+ row.qzgccrcActiveTime:"";
- }
- },
- {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",
- formatter : function (value,row,index) {
- if(value == -1){
- return "<span class='label label-danger'>审核不通过</span>"
- }if(value == 35){
- return "<span class='label label-primary'>已通过</span>"
- }
- }
- },
- {title: '公示状态', field: 'isPublic', visible: true, align: 'center', valign: 'middle',width:'120px',
- formatter : function (value,row,index) {
- if(value == 1){
- return "<span class='label label-info'>待核查征信</span>"
- }if(value == 2){
- return "<span class='label label-success'>待公示</span>"
- }if(value == 3){
- return "<span class='label label-danger'>公示中</span>"
- }if(value == 4){
- return "<span class='label label-warning'>待公布</span>"
- }if(value == 5){
- if(row.checkState == -1){
- return "<span class='label label-danger'>审核不通过</span>"
- }
- return "<span class='label label-primary'>待发证</span>"
- }if(value == 6){
- return "<span class='label label-primary'>已发证</span>"
- }
- }
- },
- {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 () {
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '人才认定审核详情',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id+'/4'
- });
- layer.full(index);
- TalentInfo.layerIndex = index;
- }
- };
- TalentInfo.prepareSearch = function(){
- var sex = $("#pub_sex").val();
- var checkState = $("#pub_checkState").val();
- var name = $("#pub_name").val();
- $('#dataTable').bootstrapTable("refresh",{"query":{"sex":sex,"checkState":checkState,"name":name}});
- }
- TalentInfo.prepareReset = function(){
- $("#pub_sex").val("");
- $("#pub_checkState").val("");
- $("#pub_name").val("");
- }
- /**
- * 查询需要处理的数据
- * @param type
- */
- TalentInfo.showDataCheckModal = function(type){
- $("#hczxForm").css("display","none");
- switch (type) {
- case 1: //待核查征信名单-导出
- $("#hczxButton").attr("onclick","TalentInfo.checkExport()").text("导出");
- $("#exportCommonModalLabel").text("待核查征信名单");
- break;
- case 2: //待核查征信名单-核查征信通过
- $("#hczxButton").attr("onclick","TalentInfo.hczxPass()").text("提交");
- $("#exportCommonModalLabel").text("待核查征信名单");
- break;
- case 3: //公示(批量)
- $("#hczxButton").attr("onclick","TalentInfo.public()").text("公示");
- $("#exportCommonModalLabel").text("待公示名单");
- $("#hczxForm").css("display","block");
- $(".time").each(function(){
- laydate.render({
- elem: "#"+$(this).attr("id")
- ,type: 'date'
- ,format:'yyyy年MM月dd日'
- });
- });
- break;
- case 4: //公示通过(批量)
- $("#hczxButton").attr("onclick","TalentInfo.publicPass()").text("提交");
- $("#exportCommonModalLabel").text("公示通过名单");
- break;
- case 5: //待公布名单
- $("#hczxButton").attr("onclick","TalentInfo.publish()").text("公布");
- $("#exportCommonModalLabel").text("待公布名单");
- break;
- case 6: //待发证名单
- $("#hczxButton").attr("onclick","TalentInfo.sendCard()").text("提交");
- $("#exportCommonModalLabel").text("待发证名单");
- break;
- case 7: //公示名单预览
- $("#hczxButton").attr("onclick","TalentInfo.needPublicExport()").text("导出");
- $("#exportCommonModalLabel").text("待公示名单");
- break;
- case 8: //公布预览
- $("#hczxButton").attr("onclick","TalentInfo.publishExportBefore()").text("导出");
- $("#exportCommonModalLabel").text("待公布名单");
- break;
- }
- $('#dataTable').bootstrapTable('destroy');
- $('#dataTable').bootstrapTable({
- url: Feng.ctxPath + "/talentInfo/selectNeedCheckData?type="+type,
- method: 'POST',
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
- showRefresh: false, // 是否显示刷新按钮
- clickToSelect: true, // 是否启用点击选中行
- singleSelect: false, // 设置True 将禁止多选
- striped: true, // 是否显示行间隔色
- pagination: true, // 设置为 true 会在表格底部显示分页条
- paginationHAlign: "left",
- paginationDetailHAlign: "right",
- sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
- pageNumber:1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100,500,1000,1500], //可供选择的每页的行数(*)
- maintainSelected:true, //全表全选需要开启
- showColumns: false,
- responseHandler : function(res){
- $("#exportCommonModal").modal("show");
- return res.obj.rows;
- },
- columns:
- [
- {field:"selectItem",checkbox:true},
- {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:"20%"},
- {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"30%"},
- {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"40%"},
- {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"10%",
- formatter:function (value,row,index) {
- if(value==-1){
- return "<span style='color: #ed5565;'>审核不通过</span>";
- }if(value== 35){
- return "<span style='color: #1ab394;'>审核通过</span>";
- }
- }
- },
- ]
- });
- }
- /**
- * 选择导出提交
- */
- TalentInfo.checkExport = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- window.location.href = Feng.ctxPath + "/talentInfo/exportHczx?ids="+ids;
- }
- /**
- * 核查征信批量通过提交
- */
- TalentInfo.hczxPass = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxPass", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#exportCommonModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("核查征信失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
- }
- /**
- * 显示核查征信驳回模态框
- */
- TalentInfo.showHczxRejectModal = function(){
- if (this.check()) {
- if(TalentInfo.seItem.isPublic!=1){
- Feng.info("当前记录不是待核查征信状态,无法核查");
- return;
- }
- $("#hczxId").val(TalentInfo.seItem.id);
- $("#hczxMsg").val("");
- $("#hczxRejectModal").modal("show");
- }
- }
- /**
- * 核查征信驳回提交
- */
- TalentInfo.hczxReject = function(){
- var id = $("#hczxId").val();
- var msg = $("#hczxMsg").val();
- if(msg==null || msg==''){
- Feng.info("请填写失信原因");
- return;
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxReject", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#hczxRejectModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("核查征信失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id":id,"outMsg":msg});
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
- }
- // /**
- // * 导入核查征信名单
- // * @param type
- // */
- // TalentInfo.importHczx = function(){
- // $("#importHczx-form")[0].reset();
- // $("#hczxModal").modal("show");
- // }
- // /**
- // * 导入提交
- // */
- // TalentInfo.importHczxSubmit = function(){
- // $("#importHczx-form")[0].submit();
- // }
- /**
- * 是否发送短信
- */
- TalentInfo.toggleMessage = function(){
- var isMessage = $("input[name='isSend']:checked").val();
- if (isMessage==1) {
- $("#messageEdit").css("display","block");
- } else if ( isMessage == 2){
- $("#messageEdit").css("display","none");
- }
- }
- /**
- * 公示预览
- */
- TalentInfo.needPublicExport = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- $("#exportCommonModal").modal("hide");
- window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/talentInfo/exportPublic?ids="+ids));
- }
- Feng.confirm("确定要公示预览吗?", operation);
- }
- /**
- * 公示
- */
- TalentInfo.public = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var isMessage = $("input[name='isSend']:checked").val();
- var typeName = $("#typeName").val();
- var address = $("#web").val();
- var publicStartTime = $("#publicStartTime").val();
- var publicEndTime = $("#publicEndTime").val();
- var dep = $("#dep").val();
- var phone = $("#fyphone").val();
- var email = $("#fyemail").val();
- if(isMessage == 1){
- if(typeName == null || typeName == ''){
- Feng.info("请填写公示类型");return ;
- }if(address == null || address == ''){
- Feng.info("请填写公示平台");return ;
- }if(publicStartTime == null || publicStartTime == ''){
- Feng.info("请填写公示开始时间");return ;
- }if(publicEndTime == null || publicEndTime == ''){
- Feng.info("请填写公示截止时间");return ;
- }if(dep == null || dep == ''){
- Feng.info("请填写反映单位");return ;
- }if(phone == null || phone == ''){
- Feng.info("请填写联系电话");return ;
- }if(email == null || email == ''){
- Feng.info("请填写联系邮箱");return ;
- }
- }
- var operation = function(){
- var index = layer.open({
- type: 1,
- title: '公示',
- area: ['300px', '220px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
- btn: ['<i class="fa fa-save layui-bg-green"></i> 提交' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- success:function(){
- laydate.render({elem: "#publicBatchId",type: 'month',trigger: 'click',format :"yyyyMM"});
- },
- yes: function (index, layero) {
- var month = $("#publicBatchId").val();
- if(Feng.isEmptyStr(month)){
- Feng.info("请填写公示批次");return ;
- }
- layer.close(index);
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/publicBatch", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#exportCommonModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("公示失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.set("typeName",typeName);
- ajax.set("address",address);
- ajax.set("publicStartTime",publicStartTime);
- ajax.set("publicEndTime",publicEndTime);
- ajax.set("dep",dep);
- ajax.set("phone",phone);
- ajax.set("email",email);
- ajax.set("isMessage",isMessage);
- ajax.set("batch",month);
- ajax.start();
- }
- });
- }
- Feng.confirm("确定要公示吗?", operation);
- }
- //已公示的数据根据公示批次公示导出
- TalentInfo.publicExport = function(type){
- var url = "",dateType='',format='';
- if( type==1 ) { //公示导出
- url = Feng.ctxPath+"/talentInfoExport/publicExport";
- dateType='month';
- format="yyyyMM";
- }else if(type==2) { //公布导出
- url = Feng.ctxPath+"/talentInfoExport/publishExport";
- dateType='date';
- format="yyyy-MM-dd";
- }
- layer.open({
- type: 1,
- title: type==1?'公示导出':"公布导出",
- area: ['800px', '300px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: "<form id=\"publicExportForm\" action=\""+url+"\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
- " <div class=\"form-group col-sm-12\">\n" +
- " <div class=\"row\">\n" +
- " <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
- " <div class=\"col-sm-4\">\n" +
- " <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
- " </div>\n" +
- " <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
- " <div class=\"col-sm-4\">\n" +
- " <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
- " </div>\n" +
- " </div>\n" +
- " </div>\n" +
- " </form>",
- btn: ['<i class="fa fa-save layui-bg-green"></i> 提交', '<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- success: function (index, layero) {
- $("#publicExportForm")[0].reset();
- $("input[time='time']").each(function(){
- laydate.render({
- elem: "#"+$(this).attr("id")
- ,type: dateType
- ,format:format
- ,trigger: 'click'
- });
- });
- },
- yes:function (index) {
- var startTime = $("#startTime").val();
- var endTime = $("#endTime").val();
- if(startTime==null || startTime==''){
- Feng.info("请选择开始时间");
- return ;
- }
- if(endTime==null || endTime==''){
- Feng.info("请选择结束时间");
- return ;
- }
- $("#publicExportForm")[0].submit();
- layer.close(index)
- }
- });
- }
- /**
- * 公示再审核
- */
- TalentInfo.afterCheck= function(){
- if (this.check()) {
- if(TalentInfo.seItem.isPublic!=3){
- Feng.info("当前记录不是公示中状态,无法审核");
- return ;
- }
- if(TalentInfo.seItem.outMsg!=null && TalentInfo.seItem.outMsg!=''){
- Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
- }
- if(TalentInfo.seItem.checkState==-1){
- var html = '<option value="">请选择</option>\n' +
- ' <option value="2">驳回/恢复</option>';
- $("#checkStateAfter").empty().append(html);
- }
- if(TalentInfo.seItem.checkState==35){
- var html = '<option value="">请选择</option>\n' +
- ' <option value="-1">审核不通过</option>'+
- ' <option value="2">驳回</option>';
- $("#checkStateAfter").empty().append(html);
- }
- $("#checkForm")[0].reset();
- $("#mainId").val(TalentInfo.seItem.id);
- $("#checkModal").modal("show");
- }
- }
- /**
- * 公示后审核提交
- */
- TalentInfo.afterCheckSubmit = function(){
- var checkState = $("#checkStateAfter").val();
- var msg = $("#msg").val();
- if(checkState == null || checkState =='') {
- Feng.info("请选择审核状态");
- }
- if(msg == null || msg ==''){
- Feng.info("请填写审核意见");
- return;
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/afterCheck", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#checkModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("审核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id":$("#mainId").val(),"checkState":$("#checkStateAfter").val(),"checkMsg":msg});
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
- }
- /**
- * 批量公示通过
- * @param type
- */
- TalentInfo.publicPass = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/publicPass", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#exportCommonModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("公示通过失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
- }
- /**
- * 公布预览
- */
- TalentInfo.publishExportBefore = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- $("#exportCommonModal").modal("hide");
- window.location.href = Feng.ctxPath + "/talentInfo/publishExportBefore?ids="+ids;
- }
- Feng.confirm("确定要导出吗?", operation);
- }
- /**
- * 公布
- */
- TalentInfo.publish = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- var index = layer.open({
- type: 1,
- title: '公布',
- area: ['300px', '220px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公布日期(公布入选月份)'>",
- btn: ['<i class="fa fa-save layui-bg-green"></i> 提交' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- success:function(){
- laydate.render({elem: "#publicBatchId",type: 'date',trigger: 'click',format :"yyyy-MM-dd"});
- },
- yes: function (index, layero) {
- var month = $("#publicBatchId").val();
- if(Feng.isEmptyStr(month)){
- Feng.info("请填写公布批次");return ;
- }
- layer.close(index);
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/publish", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#exportCommonModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("公布失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.set("batch",month);
- ajax.start();
- }
- });
- }
- Feng.confirm("一旦确认无法修改,确定要公布吗?", operation);
- }
- /**
- * 撤销公布
- */
- TalentInfo.canclePublish = function(){
- if (this.check()) {
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/canclePublish", 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.set("id",TalentInfo.seItem.id);
- ajax.start();
- }
- Feng.confirm("一旦撤销无法修改,确定要撤销公布吗?", operation);
- }
- }
- //发证
- TalentInfo.sendCard = function(){
- var selected = $('#dataTable').bootstrapTable('getSelections');
- if(!selected || selected.length<1){
- Feng.info("请至少选择一行数据!");
- return;
- }
- var ids = "";
- for(var i=0; i<selected.length; i++){
- ids = ids + selected[i].id + ",";
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/talentInfo/sendCard", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- TalentInfo.table.refresh();
- $("#exportCommonModal").modal("hide");
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("发证失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.start();
- }
- Feng.confirm("一旦发证无法修改,确定要发证吗?", operation);
- }
- //回调
- TalentInfo.callBack = function (data){
- Feng.info(data.msg);
- if(data.code==200){
- $("#hczxModal").modal("hide");
- TalentInfo.table.refresh();
- }
- }
- $(function () {
- var defaultColunms = TalentInfo.initColumn();
- var table = new BSTable(TalentInfo.id, "/talentInfo/list/4", defaultColunms);
- table.setPaginationType("server");
- table.setSingleSelect(false);
- table.setOnDblClickRow(function () {
- TalentInfo.openTalentInfoDetail();
- });
- var t = TalentInfo.table = table.init();
- TalentInfo.init();
- $('#checkAll').click(function () {
- $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
- })
- $('#uncheckAll').click(function () {
- $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
- })
- });
|