talentInfo_prepare.js 28 KB

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