talentAllowanceInfoIC.js 28 KB

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