livingAllowanceInfo_info.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. /**
  2. * 初始化硕博人才生活补贴申报详情对话框
  3. */
  4. var LivingAllowanceInfoInfoDlg = {
  5. livingAllowanceInfoInfoData: {}
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. LivingAllowanceInfoInfoDlg.close = function () {
  11. parent.layer.close(window.parent.LivingAllowanceInfo.layerIndex);
  12. }
  13. /**
  14. * 显示审核模态框
  15. * @param process
  16. */
  17. LivingAllowanceInfoInfoDlg.showCheckModal = function (process) {
  18. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/validateIsCheck", function (data) {
  19. if (data.code == 200) {
  20. layer.open({
  21. type: 1,
  22. id: "neewFieldFormModel",
  23. title: '审核',
  24. area: ['800px', '450px'],
  25. fix: false,
  26. shade: 0,
  27. maxmin: true,
  28. content: $("#checkTemplate").html(),
  29. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  30. btnAlign: 'c',
  31. zIndex: layer.zIndex,
  32. success: function (layero, index) {
  33. layer.setTop(layero);
  34. var obj = data.obj.obj;
  35. var fileList = data.obj.fileList;
  36. var html = '';
  37. for (var key in fileList) {
  38. html = html + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
  39. }
  40. $("#field_file").empty().append(html);
  41. $("#firstCheckForm")[0].reset();
  42. $("#state").val(obj.checkState).trigger("change");
  43. $("#msg").val(obj.checkMsg);
  44. $("#process").val(process);
  45. if (Feng.isNotEmptyStr(obj.fields)) {
  46. $("#field_info input").each(function () {
  47. var arr = obj.fields.split(",");
  48. for (var key in arr) {
  49. if ($(this).val() == arr[key]) {
  50. this.checked = true;
  51. }
  52. }
  53. });
  54. }
  55. if (Feng.isNotEmptyStr(obj.files)) {
  56. $("#field_file input").each(function () {
  57. if (obj.files.indexOf($(this).val()) != -1) {
  58. this.checked = true;
  59. }
  60. });
  61. }
  62. },
  63. yes: function (index, layero) {
  64. var checkState = $("#state").val();
  65. var checkMsg = $("#msg").val();
  66. if (Feng.isEmptyStr(checkState)) {
  67. Feng.info("请选择审核状态");
  68. return;
  69. }
  70. if (Feng.isEmptyStr(checkMsg)) {
  71. Feng.info("请填写审核意见");
  72. return;
  73. }
  74. var fields = '';
  75. var files = '';
  76. $("#field_info li input").each(function (index) {
  77. if ($(this).is(":checked")) {
  78. fields = fields + $(this).val() + ",";
  79. }
  80. });
  81. $("#field_file li input").each(function (index) {
  82. if ($(this).is(":checked")) {
  83. files = files + $(this).val() + ",";
  84. }
  85. });
  86. if (checkState == 2 && fields == '' && files == '') {
  87. Feng.info("请选择可修改的字段或附件!");
  88. return;
  89. }
  90. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/check", function (data) {
  91. if (data.code == 200) {
  92. layer.close(index);
  93. Feng.success(data.msg);
  94. } else {
  95. Feng.error(data.msg);
  96. }
  97. }, function (data) {
  98. Feng.error("提交失败!" + data.responseJSON.message + "!");
  99. });
  100. ajax.setData({
  101. "id": $("#id").val(),
  102. "checkState": checkState,
  103. "checkMsg": checkMsg,
  104. "process": process,
  105. "fields": fields,
  106. "files": files
  107. })
  108. ajax.start();
  109. }
  110. });
  111. } else {
  112. Feng.error(data.msg);
  113. }
  114. }, function (data) {
  115. Feng.error("校验失败!" + data.responseJSON.message + "!");
  116. });
  117. ajax.set("id", $("#id").val());
  118. ajax.set("process", process);
  119. ajax.start();
  120. }
  121. /**
  122. * 提交审核
  123. * @param process
  124. */
  125. LivingAllowanceInfoInfoDlg.submitCheck = function (process) {
  126. var operation = function () {
  127. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/submitCheck", function (data) {
  128. if (data.code == 200) {
  129. Feng.success(data.msg);
  130. window.parent.LivingAllowanceInfo.table.refresh();
  131. LivingAllowanceInfoInfoDlg.close();
  132. } else {
  133. Feng.error(data.msg);
  134. }
  135. }, function (data) {
  136. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  137. });
  138. ajax.set("id", $("#id").val());
  139. ajax.set("process", process);
  140. ajax.start();
  141. }
  142. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  143. }
  144. LivingAllowanceInfoInfoDlg.fieldCheckd = function (context) {
  145. if ($(context).get(0).checked) {
  146. $(context).parent().next().children()[0].checked = true;
  147. $(context).parent().next().children().eq(0).trigger("change");
  148. }
  149. }
  150. LivingAllowanceInfoInfoDlg.checkAll = function () {
  151. $("#field input").each(function () {
  152. this.checked = true;
  153. })
  154. }
  155. /**
  156. * 反选
  157. */
  158. LivingAllowanceInfoInfoDlg.unCheckAll = function () {
  159. $("#field input").each(function () {
  160. if (this.checked) {
  161. this.checked = false;
  162. } else {
  163. this.checked = true;
  164. }
  165. })
  166. }
  167. /**
  168. * 显示字段或者隐藏字段选择
  169. */
  170. LivingAllowanceInfoInfoDlg.toggleField = function () {
  171. var checkState = $("#state").val();
  172. var process = $("#process").val();
  173. var checkMsg = $("#msg").val();
  174. if (checkState == 2) {
  175. $("#field").show();
  176. $("#msg").val("");
  177. } else if (checkState == 3) {
  178. $("#field").hide();
  179. $("#field").find("input[type=checkbox]").removeAttr("checked");
  180. if (Feng.isEmptyStr(checkMsg)) {
  181. if (process == 1) {
  182. $("#msg").val("初审通过,待部门审核!");
  183. }
  184. if (process == 2) {
  185. $("#msg").val("部门审核通过,待复核!");
  186. }
  187. if (process == 3) {
  188. $("#msg").val("复核通过,待公示!");
  189. }
  190. }
  191. } else if (checkState == -1) {
  192. $("#field").hide();
  193. if (process == 1) {
  194. $("#msg").val("初审不通过!");
  195. }
  196. if (process == 2) {
  197. $("#msg").val("部门审核不通过!");
  198. }
  199. if (process == 3) {
  200. $("#msg").val("复核不通过!");
  201. }
  202. }
  203. }
  204. LivingAllowanceInfoInfoDlg.showMiniFileModal = function () {
  205. Feng.showMiniFileModal(CONFIG.project_master_living_allowance, $("#type").val(), $("#id").val());
  206. }
  207. $(function () {
  208. Feng.getCheckLog("logTable", {
  209. "type": CONFIG.project_master_living_allowance,
  210. "mainId": $("#id").val(),
  211. "typeFileId": "",
  212. "active": 1
  213. });
  214. $('#identifyTable').bootstrapTable({
  215. url: Feng.ctxPath + "/admin/talent/getTalentInfoByIdCard",
  216. method: 'POST',
  217. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  218. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  219. showRefresh: false, // 是否显示刷新按钮
  220. clickToSelect: true, // 是否启用点击选中行
  221. singleSelect: true, // 设置True 将禁止多选
  222. striped: true, // 是否显示行间隔色
  223. pagination: false, // 设置为 true 会在表格底部显示分页条
  224. paginationHAlign: "left",
  225. paginationDetailHAlign: "right",
  226. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  227. showColumns: false,
  228. queryParams: function (params) {
  229. return {"idCard": $("#idCard").val(), "cardType": $("#idCard").data("type")};
  230. },
  231. rowStyle: function (row, index) {
  232. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  233. },
  234. columns:
  235. [
  236. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  237. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  238. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  239. formatter: function (value, row, index) {
  240. if (row.sex == 1) {
  241. return value + '<span style="color:#6495ED">【男】</span>';
  242. }
  243. if (row.sex == 2) {
  244. return value + '<span style="color:#FF82AB">【女】</span>';
  245. }
  246. }
  247. },
  248. {title: '人才层次', field: 'talent_arrange', visible: true, align: 'center', valign: 'middle', width: "100px",
  249. formatter: function (value, row, index) {
  250. switch (value) {
  251. case 1:
  252. return "第一层次";
  253. case 2:
  254. return "第二层次";
  255. case 3:
  256. return "第三层次";
  257. case 4:
  258. return "第四层次";
  259. case 5:
  260. return "第五层次";
  261. case 6:
  262. return "第六层次";
  263. case 7:
  264. return "第七层次";
  265. }
  266. }
  267. },
  268. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px"},
  269. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  270. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  271. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
  272. formatter: function (value, row, index) {
  273. if ([-2, 11, 13, 15, 16, 22, 25, 27].indexOf(value) > -1) {
  274. return "<span class='label label-danger'>" + row.checkStateName + "</span>"
  275. }
  276. if ([9, 10, 12, 14, 21, 23, 24, 26].indexOf(value) > -1) {
  277. return "<span class='label label-success'>" + row.checkStateName + "</span>"
  278. }
  279. if ([28].indexOf(value) > -1) {
  280. return "<span class='label label-primary'>" + row.checkStateName + "</span>"
  281. } else {
  282. return "<span class='label'>" + row.checkStateName + "</span>"
  283. }
  284. }
  285. }
  286. ]
  287. ,
  288. onPostBody: function () {
  289. $('#identifyTable' + "td.uitd_showTip").bind("mouseover", function () {
  290. var htm = $(this).html();
  291. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  292. });
  293. }
  294. });
  295. $('#allowanceTable').bootstrapTable({
  296. url: Feng.ctxPath + "/admin/talent_allowance/getTalentAllowanceByIdCard",
  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 {"idCard": $("#idCard").val(), "cardType": $("#cardType").val()};
  311. },
  312. rowStyle: function (row, index) {
  313. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  314. },
  315. columns:
  316. [
  317. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px"},
  318. {title: '单位名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  319. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  320. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  321. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  322. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "120px"},
  323. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "120px"},
  324. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  325. formatter(value, row, index) {
  326. if (value == -1) {
  327. return "<span class='label label-warning-light'>审核不通过</span>";
  328. } else if (value == 1) {
  329. return "<span class='label'>待提交</span>"
  330. } else if (value == 10) {
  331. return "<span class='label label-danger'>已驳回</span>";
  332. } else if (value == 30) {
  333. return "<span class='label label-primary'>已通过</span>"
  334. } else {
  335. return "<span class='label label-success'>审核中</span>";
  336. }
  337. }
  338. },
  339. {title: '兑现状态', field: 'publicState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  340. formatter(value, row, index) {
  341. if (value == 1)
  342. return "<span style='color: #9d8189'>待核查征信</span>";
  343. if (value == 2)
  344. return "<span style='color: #00d3ee'>待公示</span>";
  345. if (value == 3)
  346. return "<span style='color: #af2cc5'>公示中</span>";
  347. if (value == 4) {
  348. return (row.allowanceType == 3) ? "<span style='color: #f55a4e'>不予兑现</span>" : "<span style='color: #ca9fab'>待兑现</span>";
  349. }
  350. if (value == 5)
  351. return "<span style='color: #5cb860'>已兑现</span>";
  352. }
  353. },
  354. {title: '推荐津补贴类型', field: 'recommendAllowanceType', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  355. formatter(value, row, index) {
  356. if (value == null || value == "")
  357. return "<span style='color: black'>未判定</span>";
  358. if (value == 1)
  359. return "<span style='color: green'>人才津贴</span>";
  360. if (value == 2)
  361. return "<span style='color: blue'>一次性交通补贴</span>";
  362. if (value == 3)
  363. return "<span style='color: red'>不予兑现</span>";
  364. }
  365. },
  366. {title: '推荐兑现月份', field: 'recommendMonths', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  367. {title: '推荐兑现金额', field: 'recommendMoney', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  368. {title: '推荐金额说明', field: 'recommendMoneyDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  369. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  370. formatter(value, row, index) {
  371. if (value == null || value == "")
  372. return "<span style='color: black'>未判定</span>";
  373. if (value == 1)
  374. return "<span style='color: green'>人才津贴</span>";
  375. if (value == 2)
  376. return "<span style='color: blue'>一次性交通补贴</span>";
  377. if (value == 3)
  378. return "<span style='color: red'>不予兑现</span>";
  379. }
  380. },
  381. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  382. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  383. {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  384. ]
  385. ,
  386. onPostBody: function () {
  387. $('#allowanceTable' + "td.uitd_showTip").bind("mouseover", function () {
  388. var htm = $(this).html();
  389. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  390. });
  391. }
  392. });
  393. LivingAllowanceInfoInfoDlg.showMiniFileModal();
  394. });