talentInfo_prepare.js 30 KB

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