talentAllowanceInfoIC.js 31 KB

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