talentAllowanceInfoIC.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /**
  2. * 优秀人才津补贴管理初始化
  3. */
  4. var TalentAllowanceInfo = {
  5. id: "TalentAllowanceInfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentAllowanceInfo.initColumn = function () {
  14. var type = $("#type").val();
  15. return [
  16. {field: 'selectItem', radio: true},
  17. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px"},
  18. {title: '所属镇街', field: 'addressName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  19. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  20. {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px",
  21. formatter(value, row, index) {
  22. if (value == 1) {
  23. return "男";
  24. }
  25. if (value == 2) {
  26. return "女";
  27. }
  28. }
  29. },
  30. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  31. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  32. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  33. {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "150px"},
  34. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  35. {title: '公布入选月份', field: 'identifyMonth', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  36. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  37. formatter(value, row, index) {
  38. if (value == null || value == "")
  39. return "未判定";
  40. if (value == 1)
  41. return "工作津贴";
  42. if (value == 2)
  43. return "一次性交通补贴";
  44. if (value == 3)
  45. return "不予兑现";
  46. }
  47. },
  48. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  49. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  50. {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  51. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  52. formatter(value, row, index) {
  53. var html = "";
  54. switch (value) {
  55. case 1:
  56. html = "<span class='label'>待提交</span>"
  57. break;
  58. case 3:
  59. html = "<span class='label label-success''>待总院审核</span>"
  60. break;
  61. case 5:
  62. case 13:
  63. case 15:
  64. case 20:
  65. case 25:
  66. case 35:
  67. html = "<span class='label label-success'>审核中</span>";
  68. break;
  69. case 8:
  70. html = "<span class='label label-danger'>总院驳回</span>"
  71. break;
  72. case 9:
  73. html = "<span class='label label-danger'>已驳回</span>"
  74. break;
  75. case 10:
  76. if (type == 5) {
  77. html = "<span class='label label-success'>待总院审核</span>"
  78. } else {
  79. html = "<span class='label label-danger'>已驳回</span>"
  80. }
  81. break;
  82. case - 1:
  83. if (row.publicState >= 3) {
  84. html = "<span class='label label-danger'>审核不通过</span>";
  85. } else {
  86. html = "<span class='label label-success'>审核中</span>";
  87. }
  88. break;
  89. case 30:
  90. if (row.publicState == 1) {
  91. html = "<span class='label label-primary'>待核查征信</span>"
  92. } else if (row.publicState == 2) {
  93. html = "<span class='label label-primary'>待公示</span>"
  94. } else if (row.publicState == 3) {
  95. html = "<span class='label label-primary'>公示中</span>"
  96. } else if (row.publicState == 4) {
  97. html = row.allowanceType != 3 ? "<span class='label label-success'>待兑现</span>" : "<span class='label label-danger'>不予兑现</span>";
  98. } else if (row.publicState == 5) {
  99. html = "<span class='label label-primary'>已兑现</span>"
  100. }
  101. break;
  102. }
  103. return html;
  104. }
  105. },
  106. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  107. formatter: function (value, row, index) {
  108. return "<span class='label label-success' onclick=\"TalentAllowanceInfo.showLog('" + value + "')\" >" +
  109. "<i class=\"fa fa-book\"></i>日志" +
  110. "</span>";
  111. }
  112. }
  113. ];
  114. };
  115. /**
  116. * 检查是否选中
  117. */
  118. TalentAllowanceInfo.check = function () {
  119. var selected = $('#' + this.id).bootstrapTable('getSelections');
  120. if (selected.length == 0) {
  121. Feng.info("请先选中表格中的某一记录!");
  122. return false;
  123. } else {
  124. TalentAllowanceInfo.seItem = selected[0];
  125. return true;
  126. }
  127. };
  128. /**
  129. * 点击添加优秀人才津补贴
  130. */
  131. TalentAllowanceInfo.openAddTalentAllowanceInfo = function () {
  132. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  133. if (data.code == 200) {
  134. var index = layer.open({
  135. type: 2,
  136. title: '津补贴申报',
  137. fix: false, //不固定
  138. maxmin: true,
  139. content: '/enterprise/talentAllowance/apply?year=' + data.batch,
  140. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  141. btnAlign: 'c',
  142. btn1: function (index, layero) {
  143. var obj = layero.find("iframe")[0].contentWindow;
  144. obj.TalentAllowanceInfoDlg.addSubmit();
  145. }, btn2: function (index, layero) {
  146. var obj = layero.find("iframe")[0].contentWindow;
  147. obj.TalentAllowanceInfoDlg.submitToCheck();
  148. return false;
  149. }, btn3: function (index, layero) {
  150. var obj = layero.find("iframe")[0].contentWindow;
  151. obj.TalentAllowanceInfoDlg.calculator();
  152. return false;
  153. }, success: function (layero, index) {
  154. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  155. },
  156. end: function () {
  157. layer.closeAll('tips');
  158. TalentAllowanceInfo.table.refresh();
  159. }
  160. });
  161. layer.full(index);
  162. TalentAllowanceInfo.layerIndex = index;
  163. } else {
  164. Feng.error(data.msg);
  165. }
  166. }, function (data) {
  167. Feng.error("查询失败!" + data.responseJSON.message + "!");
  168. });
  169. ajax.set("type", CONFIG.project_jbt);
  170. ajax.start();
  171. };
  172. /**
  173. * 打开查看优秀人才津补贴详情
  174. */
  175. TalentAllowanceInfo.openTalentAllowanceInfoDetail = function () {
  176. if (this.check()) {
  177. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  178. if (data.code == 200) {
  179. var index = layer.open({
  180. type: 2,
  181. title: '津补贴申报',
  182. fix: false, //不固定
  183. maxmin: true,
  184. content: Feng.ctxPath + '/enterprise/talentAllowance/apply/id/' + TalentAllowanceInfo.seItem.id,
  185. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  186. btnAlign: 'c',
  187. btn1: function (index, layero) {
  188. var obj = layero.find("iframe")[0].contentWindow;
  189. obj.TalentAllowanceInfoDlg.editSubmit();
  190. },
  191. btn2: function (index, layero) {
  192. var obj = layero.find("iframe")[0].contentWindow;
  193. obj.TalentAllowanceInfoDlg.submitToCheck();
  194. return false;
  195. }, btn3: function (index, layero) {
  196. var obj = layero.find("iframe")[0].contentWindow;
  197. obj.TalentAllowanceInfoDlg.calculator();
  198. return false;
  199. },
  200. success: function (layero, index) {
  201. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn0', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  202. },
  203. end: function () {
  204. layer.closeAll('tips');
  205. }
  206. });
  207. layer.full(index);
  208. TalentAllowanceInfo.layerIndex = index;
  209. } else {
  210. Feng.info(data.msg);
  211. }
  212. }, function (data) {
  213. Feng.error("校验失败!" + data.responseJSON.message + "!");
  214. });
  215. ajax.set("type", CONFIG.project_jbt);
  216. ajax.set("year", TalentAllowanceInfo.seItem.year);
  217. ajax.set("first_submit_time", TalentAllowanceInfo.seItem.firstSubmitTime);
  218. ajax.start();
  219. }
  220. };
  221. TalentAllowanceInfo.openTalentAllowanceInfoSelect = function () {
  222. if (this.check()) {
  223. var index = layer.open({
  224. type: 2,
  225. title: '津补贴查看',
  226. fix: false, //不固定
  227. maxmin: true,
  228. content: Feng.ctxPath + '/enterprise/talentAllowance/detail/id/' + TalentAllowanceInfo.seItem.id,
  229. btn: ['<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  230. btnAlign: 'c',
  231. btn1: function (index, layero) {
  232. var obj = layero.find("iframe")[0].contentWindow;
  233. obj.TalentAllowanceInfoDlg.calculator();
  234. return false;
  235. }
  236. });
  237. layer.full(index);
  238. TalentAllowanceInfo.layerIndex = index;
  239. }
  240. }
  241. /**
  242. * 删除优秀人才津补贴
  243. */
  244. TalentAllowanceInfo.delete = function () {
  245. if (this.check()) {
  246. var operation = function () {
  247. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/delete", function (data) {
  248. if (data.code == 200) {
  249. Feng.success(data.msg);
  250. TalentAllowanceInfo.table.refresh();
  251. } else {
  252. Feng.info(data.msg);
  253. }
  254. }, function (data) {
  255. Feng.error("删除失败!" + data.responseJSON.message + "!");
  256. });
  257. ajax.set("id", TalentAllowanceInfo.seItem.id);
  258. ajax.start();
  259. }
  260. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  261. }
  262. };
  263. /**
  264. * 查询表单提交参数对象
  265. * @returns {{}}
  266. */
  267. TalentAllowanceInfo.formParams = function () {
  268. var queryData = {};
  269. queryData['year'] = $("#year").val();
  270. queryData['enterpriseName'] = $("#enterpriseName").val();
  271. queryData['name'] = $("#name").val();
  272. queryData['idCard'] = $("#idCard").val();
  273. queryData['talentType'] = $("#talentType").val();
  274. queryData['talentArrange'] = $("#talentArrange").val();
  275. queryData['identifyCondition'] = $("#identifyCondition").val();
  276. queryData['allowanceType'] = $("#allowanceType").val();
  277. queryData['address'] = $("#address").val();
  278. return queryData;
  279. }
  280. /**
  281. * 查询人才认定申报列表
  282. */
  283. TalentAllowanceInfo.search = function () {
  284. TalentAllowanceInfo.table.refresh({query: TalentAllowanceInfo.formParams()});
  285. };
  286. /**
  287. * 重置
  288. */
  289. TalentAllowanceInfo.reset = function () {
  290. $("#year").val("");
  291. $("#enterpriseName").val("");
  292. $("#name").val("");
  293. $("#idCard").val("");
  294. $("#talentType").val("");
  295. $("#talentArrange").val("");
  296. $("#identifyCondition").val("");
  297. $("#allowance").val("");
  298. $("#address").val("");
  299. }
  300. /**
  301. * 获取人才认定
  302. */
  303. TalentAllowanceInfo.getIdentifyCondition = function () {
  304. var level = $("#talentArrange").val();
  305. if (level == null || level == '') {
  306. $("#identifyCondition").empty();
  307. $("#identifyCondition").trigger('chosen:updated');
  308. return;
  309. }
  310. Feng.addAjaxSelect({
  311. "id": "identifyCondition",
  312. "displayCode": "id",
  313. "displayName": "name",
  314. "type": "GET",
  315. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
  316. });
  317. $("#identifyCondition").trigger('chosen:updated');
  318. }
  319. TalentAllowanceInfo.initCheckFileTable = function () {
  320. $('#checkFileTable').bootstrapTable('destroy');
  321. $('#checkFileTable').bootstrapTable({
  322. url: Feng.ctxPath + "/enterprise/talentAllowance/listCommonFile",
  323. method: 'POST',
  324. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  325. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  326. showRefresh: false, // 是否显示刷新按钮
  327. clickToSelect: true, // 是否启用点击选中行
  328. singleSelect: true, // 设置True 将禁止多选
  329. striped: true, // 是否显示行间隔色
  330. pagination: false, // 设置为 true 会在表格底部显示分页条
  331. paginationHAlign: "left",
  332. paginationDetailHAlign: "right",
  333. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  334. showColumns: false,
  335. queryParams: function (params) {
  336. return {"batch": $("#batch").val()};
  337. },
  338. rowStyle: function (row, index) {
  339. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  340. },
  341. columns:
  342. [
  343. {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', width: '120px'},
  344. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px",
  345. formatter: function (value, row, index) {
  346. var sn = value.lastIndexOf(".");
  347. var suffix = value.substring(sn + 1, value.length);
  348. var imgStr = "";
  349. if (suffix == "pdf" || suffix == "PDF") {
  350. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  351. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  352. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  353. } else {
  354. imgStr = '<img class=\"imgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  355. }
  356. return imgStr;
  357. }
  358. },
  359. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '80px',
  360. formatter: function (value, row, index) {
  361. var selector = '<select style="background:#fff;border:1px solid #000;margin-right:2px;" onchange="TalentAllowanceInfo.onCommonTypeChangeAndBind(\'' + row.id + '\',this.value);"><option value="">关联通用附件类型</option>';
  362. for (var i = 0; i < row.fileTypes.length; i++) {
  363. var selectedStr = row.fileTypes[i].id == row.fileTypeId ? "selected" : "";
  364. selector += '<option value="' + row.fileTypes[i].id + '" ' + selectedStr + '>' + row.fileTypes[i].name + '</option>'
  365. }
  366. selector += '</select>';
  367. return selector + "<button type='button' onclick=\"downloadFile('" + row.id + "','6')\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>" +
  368. "<button type='button' onclick=\"TalentAllowanceInfo.deleteCheckFile('" + row.id + "','" + CONFIG.project_jbt + "')\" class=\"btn btn-xs btn-danger\">" +
  369. "<i class=\"fa fa-times\"></i>删除" +
  370. "</button>";
  371. }
  372. },
  373. ],
  374. onPostBody: function () {
  375. $('#checkFileTable' + "td.uitd_showTip").bind("mouseover", function () {
  376. var htm = $(this).html();
  377. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  378. });
  379. $(".imgUrl").viewer({fullscreen: false});
  380. },
  381. });
  382. }
  383. TalentAllowanceInfo.onCommonTypeChangeAndBind = function (fileId, fileTypeId) {
  384. var formData = new FormData();
  385. formData.append('fileId', fileId.toString());
  386. formData.append('fileTypeId', fileTypeId.toString());
  387. $.ajax({
  388. url: Feng.ctxPath + "/enterprise/talentAllowance/bindCommonFileWithFileType",
  389. type: "POST",
  390. processData: false,
  391. contentType: false,
  392. data: formData,
  393. success: function (data) {
  394. Feng.info(data.msg);
  395. }, error: function (data) {
  396. Feng.error("关联失败!" + data.responseJSON.message + "!");
  397. }
  398. });
  399. }
  400. TalentAllowanceInfo.commonColumns = function () {
  401. return [
  402. {field: "selectItem", checkbox: true},
  403. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%"},
  404. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "40%"},
  405. {title: '入职时间', field: 'cur_entry_time', visible: true, align: 'center', valign: 'middle', width: "30%"}
  406. ];
  407. }
  408. TalentAllowanceInfo.openBatchApplyModal = function (type) {
  409. var columns = TalentAllowanceInfo.commonColumns();
  410. $('#batchApplyTable').bootstrapTable('destroy');
  411. $('#batchApplyTable').bootstrapTable({
  412. url: Feng.ctxPath + "/enterprise/talentAllowance/findTalentAllowance",
  413. method: 'POST',
  414. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  415. search: true, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  416. showRefresh: false, // 是否显示刷新按钮
  417. clickToSelect: true, // 是否启用点击选中行
  418. singleSelect: false, // 设置True 将禁止多选
  419. striped: true, // 是否显示行间隔色
  420. pagination: true, // 设置为 true 会在表格底部显示分页条
  421. paginationHAlign: "left",
  422. paginationDetailHAlign: "right",
  423. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  424. pageNumber: 1, //初始化加载第一页,默认第一页
  425. pageSize: 10, //每页的记录行数(*)
  426. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  427. maintainSelected: true, //全表全选需要开启
  428. showColumns: false,
  429. responseHandler: function (res) {
  430. $(".time").each(function () {
  431. laydate.render({
  432. elem: "#" + $(this).attr("id")
  433. , type: 'date'
  434. , format: 'yyyy年MM月dd日'
  435. });
  436. });
  437. $("#batchApplyModal").modal("show");
  438. return res.obj.rows;
  439. },
  440. columns: columns
  441. });
  442. }
  443. TalentAllowanceInfo.batchApply = function () {
  444. var selected = $('#batchApplyTable').bootstrapTable('getSelections');
  445. if (!selected || selected.length < 1) {
  446. Feng.info("请至少选择一行数据!");
  447. return;
  448. }
  449. var ids = "";
  450. var count = 0;
  451. for (var i = 0; i < selected.length; i++) {
  452. count++;
  453. ids = ids + selected[i].id + ",";
  454. }
  455. var operation = function () {
  456. var index = layer.open({
  457. type: 1,
  458. title: '请确认补贴类型',
  459. area: ['300px', '220px'], //宽高
  460. fix: false, //不固定
  461. maxmin: true,
  462. content: '<div class="rowGroup" style="padding:20px;"><label class="control-label spacing"><span style="color: red">*</span>补贴类型</label><br><input type="radio" name="batchAllowanceType" value="1"/><label for="batchAllowanceType">工作津贴</label>&nbsp;&nbsp;<input type="radio" name="batchAllowanceType" value="2"/><label for="batchAllowanceType">一次性交通补贴</label></div>',
  463. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;确定', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  464. btnAlign: 'c',
  465. success: function () {
  466. },
  467. yes: function (index, layero) {
  468. var allowanceType = $("input[name=batchAllowanceType]:checked").val();
  469. if (Feng.isEmptyStr(allowanceType) || typeof allowanceType == "undefined") {
  470. Feng.info("请选择补贴类型");
  471. return;
  472. }
  473. layer.close(index);
  474. var allowanceTypeStr = allowanceType == 1 ? "工作津贴" : "一次性交通补贴";
  475. Feng.confirm("已选<span style='color:#ff0000;'>" + count + "</span>人,确定要批量申请<span style='color:#ff0000;'>" + allowanceTypeStr + "</span>吗?<br><span style='color:#ff0000;'>*此方法不能撤销,请谨慎操作</span>", function () {
  476. var ajax = new $ax("/enterprise/talentAllowance/batchApply", function (data) {
  477. if (data.code == 200) {
  478. Feng.success(data.msg);
  479. TalentInfo.table.refresh();
  480. $("#batchApplyModal").modal("hide");
  481. } else {
  482. Feng.error(data.msg);
  483. }
  484. }, function (data) {
  485. Feng.error("公示失败!" + data.responseJSON.message + "!");
  486. });
  487. ajax.set("ids", ids);
  488. ajax.set("allowanceType", allowanceType);
  489. ajax.start();
  490. });
  491. }
  492. });
  493. }
  494. Feng.confirm("确定进入下一步选择补贴类型吗?", operation);
  495. }
  496. $('#checkAllBatch').click(function () {
  497. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  498. })
  499. $('#uncheckAllBatch').click(function () {
  500. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  501. })
  502. TalentAllowanceInfo.batchImportApply = function () {
  503. $("#file,#fileName").val("");
  504. $("#importModal").modal("show");
  505. }
  506. /**
  507. *
  508. */
  509. TalentAllowanceInfo.importSubmit = function () {
  510. $("#import-form")[0].submit();
  511. }
  512. TalentAllowanceInfo.importCallBack = function (data) {
  513. if (data.code == 200) {
  514. $("#importModal").modal("hide");
  515. TalentAllowanceInfo.table.refresh();
  516. Feng.success(data.msg);
  517. } else {
  518. Feng.error(data.msg);
  519. }
  520. }
  521. /**
  522. * 核查材料留存上传
  523. */
  524. TalentAllowanceInfo.showCheckFileModal = function () {
  525. Feng.addAjaxSelect({
  526. "id": "batch",
  527. "displayCode": "id",
  528. "displayName": "batch",
  529. "type": "GET",
  530. "url": "/common/batch/listBatchByType?type=" + CONFIG.project_jbt + "&source=" + $("#type").val()
  531. });
  532. $("#upload_file").val("");
  533. $("#checkFileModal").modal("show");
  534. }
  535. TalentAllowanceInfo.checkFileUpload = function () {
  536. var batch = $("#batch").val();
  537. if (Feng.isEmptyStr(batch)) {
  538. Feng.info("请选择申报批次后再上传!");
  539. return;
  540. }
  541. $("#upload_file ").unbind("change");
  542. $("#upload_file ").change(function () {
  543. var formData = new FormData();
  544. formData.append("batch", batch);
  545. for (var i = 0; i < $('#upload_file')[0].files.length; i++) {
  546. formData.append('file', $('#upload_file')[0].files[i]);
  547. }
  548. $.ajax({
  549. url: Feng.ctxPath + "/enterprise/talentAllowance/uploadCommonFile",
  550. type: "POST",
  551. processData: false,
  552. contentType: false,
  553. data: formData,
  554. success: function (data) {
  555. $("#checkFileTable").bootstrapTable("refresh", {});
  556. Feng.info(data.msg);
  557. }, error: function (data) {
  558. Feng.error("上传失败!" + data.responseJSON.message + "!");
  559. }
  560. });
  561. });
  562. $('#upload_file').val("");
  563. $('#upload_file').click();
  564. }
  565. TalentAllowanceInfo.deleteCheckFile = function (id, type) {
  566. var operation = function () {
  567. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/deleteCommonFile", function (data) {
  568. if (data.code == 200) {
  569. Feng.success(data.msg);
  570. $("#checkFileTable").bootstrapTable("refresh", {});
  571. } else {
  572. Feng.error(data.msg);
  573. }
  574. }, function (data) {
  575. Feng.error("删除失败!" + data.responseJSON.message + "!");
  576. });
  577. ajax.set("id", id);
  578. ajax.set("type", type);
  579. ajax.start();
  580. }
  581. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  582. }
  583. /**
  584. * 导出基础信息
  585. */
  586. TalentAllowanceInfo.export = function () {
  587. var queryData = TalentAllowanceInfo.formParams();
  588. var url = Feng.setUrlParam(Feng.ctxPath + "/enterprise/talentAllowance/export", queryData);
  589. window.hiddenIframe.location.href = url;
  590. }
  591. /**
  592. * 显示审核日志
  593. */
  594. TalentAllowanceInfo.showLog = function (id) {
  595. layer.open({
  596. type: 1,
  597. title: "日志",
  598. fixed: false,
  599. content: '<table id="' + id + '"></table>',
  600. area: ['80%', '80%'],
  601. maxmin: true,
  602. success: function (layero, index) {
  603. $('#' + id).bootstrapTable({
  604. url: Feng.ctxPath + "/common/api/getCheckLog",
  605. method: 'POST',
  606. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  607. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  608. showRefresh: false, // 是否显示刷新按钮
  609. clickToSelect: true, // 是否启用点击选中行
  610. singleSelect: true, // 设置True 将禁止多选
  611. striped: true, // 是否显示行间隔色
  612. pagination: false, // 设置为 true 会在表格底部显示分页条
  613. paginationHAlign: "left",
  614. paginationDetailHAlign: "right",
  615. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  616. showColumns: false,
  617. queryParams: function (params) {
  618. return {"type": CONFIG.project_jbt, "mainId": id, "typeFileId": "", "active": 1}
  619. },
  620. rowStyle: function (row, index) {
  621. return {
  622. css: {
  623. "word-break": "break-word",
  624. "white-space": "inherit"
  625. }
  626. }
  627. },
  628. columns:
  629. [
  630. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  631. formatter: function (value, row, index) {
  632. return "" + value;
  633. }
  634. },
  635. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
  636. formatter: function (value, row, index) {
  637. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  638. }
  639. },
  640. {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
  641. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  642. ]
  643. ,
  644. onPostBody: function () {
  645. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  646. var htm = $(this).html();
  647. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  648. });
  649. }
  650. });
  651. }
  652. });
  653. }
  654. $(function () {
  655. var defaultColunms = TalentAllowanceInfo.initColumn();
  656. var table = new BSTable(TalentAllowanceInfo.id, "/enterprise/talentAllowance/list", defaultColunms);
  657. table.setPaginationType("server");
  658. table.setOnDblClickRow(function () {
  659. TalentAllowanceInfo.openTalentAllowanceInfoDetail();
  660. });
  661. TalentAllowanceInfo.table = table.init();
  662. //批量加载字典表数据
  663. var arr = [
  664. {"name": "address", "code": "street"},
  665. {"name": "talentArrange", "code": "talent_arrange"},
  666. {"name": "nationality", "code": "nationality"}];
  667. Feng.findChildDictBatch(JSON.stringify(arr));
  668. $("#identifyCondition").chosen({
  669. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  670. disable_search: false,
  671. width: "100%",
  672. enable_split_word_search: true
  673. });
  674. });