talentInfo_prepare.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. /**
  2. * 人才认定申报管理初始化
  3. */
  4. var TalentInfo = {
  5. id: "TalentInfoTable", //表格id
  6. checkAll:false,
  7. seItem: null, //选中的条目
  8. table: null,
  9. layerIndex: -1
  10. };
  11. /**
  12. * 初始化表格的列
  13. */
  14. TalentInfo.initColumn = function () {
  15. var type = $("#usertype").val();
  16. var isShow = true;
  17. if(type==2){
  18. isShow = false;
  19. };
  20. return [
  21. {field: 'selectItem', checkbox: true},
  22. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:'80px'},
  23. {title: '离职状态', field: 'active', visible: true, align: 'center', valign: 'middle',width:'80px',
  24. formatter : function (value,row,index) {
  25. if(value==1){
  26. return '<span style="color:#6495ED">在职</span>';
  27. }if(value==2){
  28. return '<span style="color:#FF82AB">离职</span>';
  29. }
  30. }
  31. },
  32. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:'150px'},
  33. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:'120px',
  34. formatter : function(value,row,index){
  35. if(row.sex==1){
  36. return value+'<span style="color:#6495ED">【男】</span>';
  37. }if(row.sex==2){
  38. return value+'<span style="color:#FF82AB">【女】</span>';
  39. }
  40. }
  41. },
  42. // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:'120px',
  43. // formatter : function (value,row,index){
  44. // if(value==1){
  45. // return '晋江市优秀人才';
  46. // }if(value==2){
  47. // return '集成电路优秀人才';
  48. // }
  49. // }
  50. // },
  51. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:'100px'},
  52. {title: '人才标签', field: 'talentTypeName', visible: isShow, align: 'center', valign: 'middle',width:'100px'},
  53. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'150px','class': 'uitd_showTip'},
  54. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px'},
  55. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
  56. {title: '获得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
  57. {title: '人才证书有效期', field: 'certificateStartTime', visible: isShow, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px',
  58. formatter : function (value,row,index) {
  59. return Feng.isNotEmptyStr(row.certificateStartTime) && Feng.isNotEmptyStr(row.qzgccrcActiveTime)?row.certificateStartTime +"至"+ row.qzgccrcActiveTime:"";
  60. }
  61. },
  62. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  63. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  64. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",
  65. formatter : function (value,row,index) {
  66. if(value == -1){
  67. return "<span class='label label-danger'>审核不通过</span>"
  68. }if(value == 35){
  69. return "<span class='label label-primary'>已通过</span>"
  70. }
  71. }
  72. },
  73. {title: '公示状态', field: 'isPublic', visible: true, align: 'center', valign: 'middle',width:'120px',
  74. formatter : function (value,row,index) {
  75. if(value == 1){
  76. return "<span class='label label-info'>待核查征信</span>"
  77. }if(value == 2){
  78. return "<span class='label label-success'>待公示</span>"
  79. }if(value == 3){
  80. return "<span class='label label-danger'>公示中</span>"
  81. }if(value == 4){
  82. return "<span class='label label-warning'>待公布</span>"
  83. }if(value == 5){
  84. if(row.checkState == -1){
  85. return "<span class='label label-danger'>审核不通过</span>"
  86. }
  87. return "<span class='label label-primary'>待发证</span>"
  88. }if(value == 6){
  89. return "<span class='label label-primary'>已发证</span>"
  90. }
  91. }
  92. },
  93. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:'80px',
  94. formatter : function (value,row,index){
  95. return "<span class='label label-success' onclick=\"TalentInfo.showLog('"+value+"')\" >" +
  96. "<i class=\"fa fa-book\"></i>日志" +
  97. "</span>";
  98. }
  99. }
  100. ];
  101. };
  102. /**
  103. * 检查是否选中
  104. */
  105. TalentInfo.check = function () {
  106. var selected = $('#' + this.id).bootstrapTable('getSelections');
  107. if(selected.length == 0){
  108. Feng.info("请先选中表格中的某一记录!");
  109. return false;
  110. }else{
  111. TalentInfo.seItem = selected[0];
  112. return true;
  113. }
  114. };
  115. /**
  116. * 打开查看人才认定-初级审核详情
  117. */
  118. TalentInfo.openTalentInfoDetail = function () {
  119. if (this.check()) {
  120. var index = layer.open({
  121. type: 2,
  122. title: '人才认定审核详情',
  123. area: ['800px', '420px'], //宽高
  124. fix: false, //不固定
  125. maxmin: true,
  126. content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id+'/4'
  127. });
  128. layer.full(index);
  129. TalentInfo.layerIndex = index;
  130. }
  131. };
  132. TalentInfo.prepareSearch = function(){
  133. var sex = $("#pub_sex").val();
  134. var checkState = $("#pub_checkState").val();
  135. var name = $("#pub_name").val();
  136. $('#dataTable').bootstrapTable("refresh",{"query":{"sex":sex,"checkState":checkState,"name":name}});
  137. }
  138. TalentInfo.prepareReset = function(){
  139. $("#pub_sex").val("");
  140. $("#pub_checkState").val("");
  141. $("#pub_name").val("");
  142. }
  143. /**
  144. * 查询需要处理的数据
  145. * @param type
  146. */
  147. TalentInfo.showDataCheckModal = function(type){
  148. $("#hczxForm").css("display","none");
  149. switch (type) {
  150. case 1: //待核查征信名单-导出
  151. $("#hczxButton").attr("onclick","TalentInfo.checkExport()").text("导出");
  152. $("#exportCommonModalLabel").text("待核查征信名单");
  153. break;
  154. case 2: //待核查征信名单-核查征信通过
  155. $("#hczxButton").attr("onclick","TalentInfo.hczxPass()").text("提交");
  156. $("#exportCommonModalLabel").text("待核查征信名单");
  157. break;
  158. case 3: //公示(批量)
  159. $("#hczxButton").attr("onclick","TalentInfo.public()").text("公示");
  160. $("#exportCommonModalLabel").text("待公示名单");
  161. $("#hczxForm").css("display","block");
  162. $(".time").each(function(){
  163. laydate.render({
  164. elem: "#"+$(this).attr("id")
  165. ,type: 'date'
  166. ,format:'yyyy年MM月dd日'
  167. });
  168. });
  169. break;
  170. case 4: //公示通过(批量)
  171. $("#hczxButton").attr("onclick","TalentInfo.publicPass()").text("提交");
  172. $("#exportCommonModalLabel").text("公示通过名单");
  173. break;
  174. case 5: //待公布名单
  175. $("#hczxButton").attr("onclick","TalentInfo.publish()").text("公布");
  176. $("#exportCommonModalLabel").text("待公布名单");
  177. break;
  178. case 6: //待发证名单
  179. $("#hczxButton").attr("onclick","TalentInfo.sendCard()").text("提交");
  180. $("#exportCommonModalLabel").text("待发证名单");
  181. break;
  182. case 7: //公示名单预览
  183. $("#hczxButton").attr("onclick","TalentInfo.needPublicExport()").text("导出");
  184. $("#exportCommonModalLabel").text("待公示名单");
  185. break;
  186. case 8: //公布预览
  187. $("#hczxButton").attr("onclick","TalentInfo.publishExportBefore()").text("导出");
  188. $("#exportCommonModalLabel").text("待公布名单");
  189. break;
  190. }
  191. $('#dataTable').bootstrapTable('destroy');
  192. $('#dataTable').bootstrapTable({
  193. url: Feng.ctxPath + "/talentInfo/selectNeedCheckData?type="+type,
  194. method: 'POST',
  195. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  196. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  197. showRefresh: false, // 是否显示刷新按钮
  198. clickToSelect: true, // 是否启用点击选中行
  199. singleSelect: false, // 设置True 将禁止多选
  200. striped: true, // 是否显示行间隔色
  201. pagination: true, // 设置为 true 会在表格底部显示分页条
  202. paginationHAlign: "left",
  203. paginationDetailHAlign: "right",
  204. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  205. pageNumber:1, //初始化加载第一页,默认第一页
  206. pageSize: 10, //每页的记录行数(*)
  207. pageList: [10, 25, 50, 100,500,1000,1500], //可供选择的每页的行数(*)
  208. maintainSelected:true, //全表全选需要开启
  209. showColumns: false,
  210. responseHandler : function(res){
  211. $("#exportCommonModal").modal("show");
  212. return res.obj.rows;
  213. },
  214. columns:
  215. [
  216. {field:"selectItem",checkbox:true},
  217. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:"20%"},
  218. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"30%"},
  219. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"40%"},
  220. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"10%",
  221. formatter:function (value,row,index) {
  222. if(value==-1){
  223. return "<span style='color: #ed5565;'>审核不通过</span>";
  224. }if(value== 35){
  225. return "<span style='color: #1ab394;'>审核通过</span>";
  226. }
  227. }
  228. },
  229. ]
  230. });
  231. }
  232. /**
  233. * 选择导出提交
  234. */
  235. TalentInfo.checkExport = function(){
  236. var selected = $('#dataTable').bootstrapTable('getSelections');
  237. if(!selected || selected.length<1){
  238. Feng.info("请至少选择一行数据!");
  239. return;
  240. }
  241. var ids = "";
  242. for(var i=0; i<selected.length; i++){
  243. ids = ids + selected[i].id + ",";
  244. }
  245. window.location.href = Feng.ctxPath + "/talentInfo/exportHczx?ids="+ids;
  246. }
  247. /**
  248. * 核查征信批量通过提交
  249. */
  250. TalentInfo.hczxPass = function(){
  251. var selected = $('#dataTable').bootstrapTable('getSelections');
  252. if(!selected || selected.length<1){
  253. Feng.info("请至少选择一行数据!");
  254. return;
  255. }
  256. var ids = "";
  257. for(var i=0; i<selected.length; i++){
  258. ids = ids + selected[i].id + ",";
  259. }
  260. var operation = function(){
  261. var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxPass", function (data) {
  262. if(data.code==200){
  263. Feng.success(data.msg);
  264. TalentInfo.table.refresh();
  265. $("#exportCommonModal").modal("hide");
  266. }else{
  267. Feng.error(data.msg);
  268. }
  269. }, function (data) {
  270. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  271. });
  272. ajax.set("ids",ids);
  273. ajax.start();
  274. }
  275. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  276. }
  277. /**
  278. * 显示核查征信驳回模态框
  279. */
  280. TalentInfo.showHczxRejectModal = function(){
  281. if (this.check()) {
  282. if(TalentInfo.seItem.isPublic!=1){
  283. Feng.info("当前记录不是待核查征信状态,无法核查");
  284. return;
  285. }
  286. $("#hczxId").val(TalentInfo.seItem.id);
  287. $("#hczxMsg").val("");
  288. $("#hczxRejectModal").modal("show");
  289. }
  290. }
  291. /**
  292. * 核查征信驳回提交
  293. */
  294. TalentInfo.hczxReject = function(){
  295. var id = $("#hczxId").val();
  296. var msg = $("#hczxMsg").val();
  297. if(msg==null || msg==''){
  298. Feng.info("请填写失信原因");
  299. return;
  300. }
  301. var operation = function(){
  302. var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxReject", function (data) {
  303. if(data.code==200){
  304. Feng.success(data.msg);
  305. TalentInfo.table.refresh();
  306. $("#hczxRejectModal").modal("hide");
  307. }else{
  308. Feng.error(data.msg);
  309. }
  310. }, function (data) {
  311. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  312. });
  313. ajax.setData({"id":id,"outMsg":msg});
  314. ajax.start();
  315. }
  316. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  317. }
  318. // /**
  319. // * 导入核查征信名单
  320. // * @param type
  321. // */
  322. // TalentInfo.importHczx = function(){
  323. // $("#importHczx-form")[0].reset();
  324. // $("#hczxModal").modal("show");
  325. // }
  326. // /**
  327. // * 导入提交
  328. // */
  329. // TalentInfo.importHczxSubmit = function(){
  330. // $("#importHczx-form")[0].submit();
  331. // }
  332. /**
  333. * 是否发送短信
  334. */
  335. TalentInfo.toggleMessage = function(){
  336. var isMessage = $("input[name='isSend']:checked").val();
  337. if (isMessage==1) {
  338. $("#messageEdit").css("display","block");
  339. } else if ( isMessage == 2){
  340. $("#messageEdit").css("display","none");
  341. }
  342. }
  343. /**
  344. * 公示预览
  345. */
  346. TalentInfo.needPublicExport = function(){
  347. var selected = $('#dataTable').bootstrapTable('getSelections');
  348. if(!selected || selected.length<1){
  349. Feng.info("请至少选择一行数据!");
  350. return;
  351. }
  352. var ids = "";
  353. for(var i=0; i<selected.length; i++){
  354. ids = ids + selected[i].id + ",";
  355. }
  356. var operation = function(){
  357. $("#exportCommonModal").modal("hide");
  358. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/talentInfo/exportPublic?ids="+ids));
  359. }
  360. Feng.confirm("确定要公示预览吗?", operation);
  361. }
  362. /**
  363. * 公示
  364. */
  365. TalentInfo.public = function(){
  366. var selected = $('#dataTable').bootstrapTable('getSelections');
  367. if(!selected || selected.length<1){
  368. Feng.info("请至少选择一行数据!");
  369. return;
  370. }
  371. var ids = "";
  372. for(var i=0; i<selected.length; i++){
  373. ids = ids + selected[i].id + ",";
  374. }
  375. var isMessage = $("input[name='isSend']:checked").val();
  376. var typeName = $("#typeName").val();
  377. var address = $("#web").val();
  378. var publicStartTime = $("#publicStartTime").val();
  379. var publicEndTime = $("#publicEndTime").val();
  380. var dep = $("#dep").val();
  381. var phone = $("#fyphone").val();
  382. var email = $("#fyemail").val();
  383. if(isMessage == 1){
  384. if(typeName == null || typeName == ''){
  385. Feng.info("请填写公示类型");return ;
  386. }if(address == null || address == ''){
  387. Feng.info("请填写公示平台");return ;
  388. }if(publicStartTime == null || publicStartTime == ''){
  389. Feng.info("请填写公示开始时间");return ;
  390. }if(publicEndTime == null || publicEndTime == ''){
  391. Feng.info("请填写公示截止时间");return ;
  392. }if(dep == null || dep == ''){
  393. Feng.info("请填写反映单位");return ;
  394. }if(phone == null || phone == ''){
  395. Feng.info("请填写联系电话");return ;
  396. }if(email == null || email == ''){
  397. Feng.info("请填写联系邮箱");return ;
  398. }
  399. }
  400. var operation = function(){
  401. var index = layer.open({
  402. type: 1,
  403. title: '公示',
  404. area: ['300px', '220px'], //宽高
  405. fix: false, //不固定
  406. maxmin: true,
  407. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
  408. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  409. btnAlign: 'c',
  410. success:function(){
  411. laydate.render({elem: "#publicBatchId",type: 'month',trigger: 'click',format :"yyyyMM"});
  412. },
  413. yes: function (index, layero) {
  414. var month = $("#publicBatchId").val();
  415. if(Feng.isEmptyStr(month)){
  416. Feng.info("请填写公示批次");return ;
  417. }
  418. layer.close(index);
  419. var ajax = new $ax(Feng.ctxPath + "/talentInfo/publicBatch", function (data) {
  420. if(data.code==200){
  421. Feng.success(data.msg);
  422. TalentInfo.table.refresh();
  423. $("#exportCommonModal").modal("hide");
  424. }else{
  425. Feng.error(data.msg);
  426. }
  427. }, function (data) {
  428. Feng.error("公示失败!" + data.responseJSON.message + "!");
  429. });
  430. ajax.set("ids",ids);
  431. ajax.set("typeName",typeName);
  432. ajax.set("address",address);
  433. ajax.set("publicStartTime",publicStartTime);
  434. ajax.set("publicEndTime",publicEndTime);
  435. ajax.set("dep",dep);
  436. ajax.set("phone",phone);
  437. ajax.set("email",email);
  438. ajax.set("isMessage",isMessage);
  439. ajax.set("batch",month);
  440. ajax.start();
  441. }
  442. });
  443. }
  444. Feng.confirm("确定要公示吗?", operation);
  445. }
  446. //已公示的数据根据公示批次公示导出
  447. TalentInfo.publicExport = function(type){
  448. var url = "",dateType='',format='';
  449. if( type==1 ) { //公示导出
  450. url = Feng.ctxPath+"/talentInfoExport/publicExport";
  451. dateType='month';
  452. format="yyyyMM";
  453. }else if(type==2) { //公布导出
  454. url = Feng.ctxPath+"/talentInfoExport/publishExport";
  455. dateType='date';
  456. format="yyyy-MM-dd";
  457. }
  458. layer.open({
  459. type: 1,
  460. title: type==1?'公示导出':"公布导出",
  461. area: ['800px', '300px'], //宽高
  462. fix: false, //不固定
  463. maxmin: true,
  464. content: "<form id=\"publicExportForm\" action=\""+url+"\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
  465. " <div class=\"form-group col-sm-12\">\n" +
  466. " <div class=\"row\">\n" +
  467. " <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
  468. " <div class=\"col-sm-4\">\n" +
  469. " <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  470. " </div>\n" +
  471. " <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
  472. " <div class=\"col-sm-4\">\n" +
  473. " <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  474. " </div>\n" +
  475. " </div>\n" +
  476. " </div>\n" +
  477. " </form>",
  478. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  479. btnAlign: 'c',
  480. success: function (index, layero) {
  481. $("#publicExportForm")[0].reset();
  482. $("input[time='time']").each(function(){
  483. laydate.render({
  484. elem: "#"+$(this).attr("id")
  485. ,type: dateType
  486. ,format:format
  487. ,trigger: 'click'
  488. });
  489. });
  490. },
  491. yes:function (index) {
  492. var startTime = $("#startTime").val();
  493. var endTime = $("#endTime").val();
  494. if(startTime==null || startTime==''){
  495. Feng.info("请选择开始时间");
  496. return ;
  497. }
  498. if(endTime==null || endTime==''){
  499. Feng.info("请选择结束时间");
  500. return ;
  501. }
  502. $("#publicExportForm")[0].submit();
  503. layer.close(index)
  504. }
  505. });
  506. }
  507. /**
  508. * 公示再审核
  509. */
  510. TalentInfo.afterCheck= function(){
  511. if (this.check()) {
  512. if(TalentInfo.seItem.isPublic!=3){
  513. Feng.info("当前记录不是公示中状态,无法审核");
  514. return ;
  515. }
  516. if(TalentInfo.seItem.outMsg!=null && TalentInfo.seItem.outMsg!=''){
  517. Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
  518. }
  519. if(TalentInfo.seItem.checkState==-1){
  520. var html = '<option value="">请选择</option>\n' +
  521. ' <option value="2">驳回/恢复</option>';
  522. $("#checkStateAfter").empty().append(html);
  523. }
  524. if(TalentInfo.seItem.checkState==35){
  525. var html = '<option value="">请选择</option>\n' +
  526. ' <option value="-1">审核不通过</option>'+
  527. ' <option value="2">驳回</option>';
  528. $("#checkStateAfter").empty().append(html);
  529. }
  530. $("#checkForm")[0].reset();
  531. $("#mainId").val(TalentInfo.seItem.id);
  532. $("#checkModal").modal("show");
  533. }
  534. }
  535. /**
  536. * 公示后审核提交
  537. */
  538. TalentInfo.afterCheckSubmit = function(){
  539. var checkState = $("#checkStateAfter").val();
  540. var msg = $("#msg").val();
  541. if(checkState == null || checkState =='') {
  542. Feng.info("请选择审核状态");
  543. }
  544. if(msg == null || msg ==''){
  545. Feng.info("请填写审核意见");
  546. return;
  547. }
  548. var operation = function(){
  549. var ajax = new $ax(Feng.ctxPath + "/talentInfo/afterCheck", function (data) {
  550. if(data.code==200){
  551. Feng.success(data.msg);
  552. TalentInfo.table.refresh();
  553. $("#checkModal").modal("hide");
  554. }else{
  555. Feng.error(data.msg);
  556. }
  557. }, function (data) {
  558. Feng.error("审核失败!" + data.responseJSON.message + "!");
  559. });
  560. ajax.setData({"id":$("#mainId").val(),"checkState":$("#checkStateAfter").val(),"checkMsg":msg});
  561. ajax.start();
  562. }
  563. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  564. }
  565. /**
  566. * 批量公示通过
  567. * @param type
  568. */
  569. TalentInfo.publicPass = function(){
  570. var selected = $('#dataTable').bootstrapTable('getSelections');
  571. if(!selected || selected.length<1){
  572. Feng.info("请至少选择一行数据!");
  573. return;
  574. }
  575. var ids = "";
  576. for(var i=0; i<selected.length; i++){
  577. ids = ids + selected[i].id + ",";
  578. }
  579. var operation = function(){
  580. var ajax = new $ax(Feng.ctxPath + "/talentInfo/publicPass", function (data) {
  581. if(data.code==200){
  582. Feng.success(data.msg);
  583. TalentInfo.table.refresh();
  584. $("#exportCommonModal").modal("hide");
  585. }else{
  586. Feng.error(data.msg);
  587. }
  588. }, function (data) {
  589. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  590. });
  591. ajax.set("ids",ids);
  592. ajax.start();
  593. }
  594. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  595. }
  596. /**
  597. * 公布预览
  598. */
  599. TalentInfo.publishExportBefore = function(){
  600. var selected = $('#dataTable').bootstrapTable('getSelections');
  601. if(!selected || selected.length<1){
  602. Feng.info("请至少选择一行数据!");
  603. return;
  604. }
  605. var ids = "";
  606. for(var i=0; i<selected.length; i++){
  607. ids = ids + selected[i].id + ",";
  608. }
  609. var operation = function(){
  610. $("#exportCommonModal").modal("hide");
  611. window.location.href = Feng.ctxPath + "/talentInfo/publishExportBefore?ids="+ids;
  612. }
  613. Feng.confirm("确定要导出吗?", operation);
  614. }
  615. /**
  616. * 公布
  617. */
  618. TalentInfo.publish = function(){
  619. var selected = $('#dataTable').bootstrapTable('getSelections');
  620. if(!selected || selected.length<1){
  621. Feng.info("请至少选择一行数据!");
  622. return;
  623. }
  624. var ids = "";
  625. for(var i=0; i<selected.length; i++){
  626. ids = ids + selected[i].id + ",";
  627. }
  628. var operation = function(){
  629. var index = layer.open({
  630. type: 1,
  631. title: '公布',
  632. area: ['300px', '220px'], //宽高
  633. fix: false, //不固定
  634. maxmin: true,
  635. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公布日期(公布入选月份)'>",
  636. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  637. btnAlign: 'c',
  638. success:function(){
  639. laydate.render({elem: "#publicBatchId",type: 'date',trigger: 'click',format :"yyyy-MM-dd"});
  640. },
  641. yes: function (index, layero) {
  642. var month = $("#publicBatchId").val();
  643. if(Feng.isEmptyStr(month)){
  644. Feng.info("请填写公布批次");return ;
  645. }
  646. layer.close(index);
  647. var ajax = new $ax(Feng.ctxPath + "/talentInfo/publish", function (data) {
  648. if(data.code==200){
  649. Feng.success(data.msg);
  650. TalentInfo.table.refresh();
  651. $("#exportCommonModal").modal("hide");
  652. }else{
  653. Feng.error(data.msg);
  654. }
  655. }, function (data) {
  656. Feng.error("公布失败!" + data.responseJSON.message + "!");
  657. });
  658. ajax.set("ids",ids);
  659. ajax.set("batch",month);
  660. ajax.start();
  661. }
  662. });
  663. }
  664. Feng.confirm("一旦确认无法修改,确定要公布吗?", operation);
  665. }
  666. /**
  667. * 撤销公布
  668. */
  669. TalentInfo.canclePublish = function(){
  670. if (this.check()) {
  671. var operation = function(){
  672. var ajax = new $ax(Feng.ctxPath + "/talentInfo/canclePublish", function (data) {
  673. if(data.code==200){
  674. Feng.success(data.msg);
  675. TalentInfo.table.refresh();
  676. }else{
  677. Feng.error(data.msg);
  678. }
  679. }, function (data) {
  680. Feng.error("撤销公布失败!" + data.responseJSON.message + "!");
  681. });
  682. ajax.set("id",TalentInfo.seItem.id);
  683. ajax.start();
  684. }
  685. Feng.confirm("一旦撤销无法修改,确定要撤销公布吗?", operation);
  686. }
  687. }
  688. //发证
  689. TalentInfo.sendCard = function(){
  690. var selected = $('#dataTable').bootstrapTable('getSelections');
  691. if(!selected || selected.length<1){
  692. Feng.info("请至少选择一行数据!");
  693. return;
  694. }
  695. var ids = "";
  696. for(var i=0; i<selected.length; i++){
  697. ids = ids + selected[i].id + ",";
  698. }
  699. var operation = function(){
  700. var ajax = new $ax(Feng.ctxPath + "/talentInfo/sendCard", function (data) {
  701. if(data.code==200){
  702. Feng.success(data.msg);
  703. TalentInfo.table.refresh();
  704. $("#exportCommonModal").modal("hide");
  705. }else{
  706. Feng.error(data.msg);
  707. }
  708. }, function (data) {
  709. Feng.error("发证失败!" + data.responseJSON.message + "!");
  710. });
  711. ajax.set("ids",ids);
  712. ajax.start();
  713. }
  714. Feng.confirm("一旦发证无法修改,确定要发证吗?", operation);
  715. }
  716. //回调
  717. TalentInfo.callBack = function (data){
  718. Feng.info(data.msg);
  719. if(data.code==200){
  720. $("#hczxModal").modal("hide");
  721. TalentInfo.table.refresh();
  722. }
  723. }
  724. $(function () {
  725. var defaultColunms = TalentInfo.initColumn();
  726. var table = new BSTable(TalentInfo.id, "/talentInfo/list/4", defaultColunms);
  727. table.setPaginationType("server");
  728. table.setSingleSelect(false);
  729. table.setOnDblClickRow(function () {
  730. TalentInfo.openTalentInfoDetail();
  731. });
  732. var t = TalentInfo.table = table.init();
  733. TalentInfo.init();
  734. $('#checkAll').click(function () {
  735. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  736. })
  737. $('#uncheckAll').click(function () {
  738. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  739. })
  740. });