talentInfo_prepare.js 29 KB

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