talentInfo_prepare.js 30 KB

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