talentAllowanceInfoIC.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  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 5:
  59. case 13:
  60. case 15:
  61. case 20:
  62. case 25:
  63. case 35:
  64. html = "<span class='label label-success'>审核中</span>";
  65. break;
  66. case 10:
  67. html = "<span class='label label-danger'>已驳回</span>"
  68. break;
  69. case - 1:
  70. if (row.publicState >= 3) {
  71. html = "<span class='label label-danger'>审核不通过</span>";
  72. } else {
  73. html = "<span class='label label-success'>审核中</span>";
  74. }
  75. break;
  76. case 30:
  77. if (row.publicState == 3) {
  78. html = "<span class='label label-primary'>公示中</span>"
  79. } else if (row.publicState == 4) {
  80. html = row.allowanceType != 3 ? "<span class='label label-success'>待兑现</span>" : "<span class='label label-danger'>不予兑现</span>";
  81. } else if (row.publicState == 5) {
  82. html = "<span class='label label-primary'>已兑现</span>"
  83. }
  84. break;
  85. }
  86. return html;
  87. }
  88. },
  89. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  90. formatter: function (value, row, index) {
  91. return "<span class='label label-success' onclick=\"TalentAllowanceInfo.showLog('" + value + "')\" >" +
  92. "<i class=\"fa fa-book\"></i>日志" +
  93. "</span>";
  94. }
  95. }
  96. ];
  97. };
  98. /**
  99. * 检查是否选中
  100. */
  101. TalentAllowanceInfo.check = function () {
  102. var selected = $('#' + this.id).bootstrapTable('getSelections');
  103. if (selected.length == 0) {
  104. Feng.info("请先选中表格中的某一记录!");
  105. return false;
  106. } else {
  107. TalentAllowanceInfo.seItem = selected[0];
  108. return true;
  109. }
  110. };
  111. /**
  112. * 点击添加优秀人才津补贴
  113. */
  114. TalentAllowanceInfo.openAddTalentAllowanceInfo = function () {
  115. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  116. if (data.code == 200) {
  117. var index = layer.open({
  118. type: 2,
  119. title: '津补贴申报',
  120. fix: false, //不固定
  121. maxmin: true,
  122. content: '/enterprise/talentAllowance/apply?year=' + data.batch,
  123. 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;取消'],
  124. btnAlign: 'c',
  125. btn1: function (index, layero) {
  126. var obj = layero.find("iframe")[0].contentWindow;
  127. obj.TalentAllowanceInfoDlg.addSubmit();
  128. }, btn2: function (index, layero) {
  129. var obj = layero.find("iframe")[0].contentWindow;
  130. obj.TalentAllowanceInfoDlg.submitToCheck();
  131. return false;
  132. },
  133. success: function (layero, index) {
  134. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  135. },
  136. end: function () {
  137. layer.closeAll('tips');
  138. TalentAllowanceInfo.table.refresh();
  139. }
  140. });
  141. layer.full(index);
  142. TalentAllowanceInfo.layerIndex = index;
  143. } else {
  144. Feng.error(data.msg);
  145. }
  146. }, function (data) {
  147. Feng.error("查询失败!" + data.responseJSON.message + "!");
  148. });
  149. ajax.set("type", CONFIG.project_jbt);
  150. ajax.start();
  151. };
  152. /**
  153. * 打开查看优秀人才津补贴详情
  154. */
  155. TalentAllowanceInfo.openTalentAllowanceInfoDetail = function () {
  156. if (this.check()) {
  157. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  158. if (data.code == 200) {
  159. var index = layer.open({
  160. type: 2,
  161. title: '津补贴申报',
  162. fix: false, //不固定
  163. maxmin: true,
  164. content: Feng.ctxPath + '/enterprise/talentAllowance/apply/id/' + TalentAllowanceInfo.seItem.id,
  165. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  166. btnAlign: 'c',
  167. yes: function (index, layero) {
  168. var obj = layero.find("iframe")[0].contentWindow;
  169. obj.TalentAllowanceInfoDlg.submitToCheck();
  170. },
  171. success: function (layero, index) {
  172. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn0', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  173. },
  174. end: function () {
  175. layer.closeAll('tips');
  176. }
  177. });
  178. layer.full(index);
  179. TalentAllowanceInfo.layerIndex = index;
  180. } else {
  181. Feng.info(data.msg);
  182. }
  183. }, function (data) {
  184. Feng.error("校验失败!" + data.responseJSON.message + "!");
  185. });
  186. ajax.set("type", CONFIG.project_jbt);
  187. ajax.set("year", TalentAllowanceInfo.seItem.year);
  188. ajax.set("first_submit_time", TalentAllowanceInfo.seItem.firstSubmitTime);
  189. ajax.start();
  190. }
  191. };
  192. TalentAllowanceInfo.openTalentAllowanceInfoSelect = function () {
  193. if (this.check()) {
  194. var index = layer.open({
  195. type: 2,
  196. title: '津补贴查看',
  197. fix: false, //不固定
  198. maxmin: true,
  199. content: Feng.ctxPath + '/enterprise/talentAllowance/detail/id/' + TalentAllowanceInfo.seItem.id,
  200. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  201. btnAlign: 'c',
  202. });
  203. layer.full(index);
  204. TalentAllowanceInfo.layerIndex = index;
  205. }
  206. }
  207. /**
  208. * 删除优秀人才津补贴
  209. */
  210. TalentAllowanceInfo.delete = function () {
  211. if (this.check()) {
  212. var operation = function () {
  213. var ajax = new $ax(Feng.ctxPath + "/enterpirse/talentAllowance/delete", function (data) {
  214. if (data.code == 200) {
  215. Feng.success(data.msg);
  216. TalentAllowanceInfo.table.refresh();
  217. } else {
  218. Feng.info(data.msg);
  219. }
  220. }, function (data) {
  221. Feng.error("删除失败!" + data.responseJSON.message + "!");
  222. });
  223. ajax.set("id", TalentAllowanceInfo.seItem.id);
  224. ajax.start();
  225. }
  226. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  227. }
  228. };
  229. /**
  230. * 查询表单提交参数对象
  231. * @returns {{}}
  232. */
  233. TalentAllowanceInfo.formParams = function () {
  234. var queryData = {};
  235. queryData['year'] = $("#year").val();
  236. queryData['enterpriseName'] = $("#enterpriseName").val();
  237. queryData['name'] = $("#name").val();
  238. queryData['idCard'] = $("#idCard").val();
  239. queryData['talentType'] = $("#talentType").val();
  240. queryData['talentArrange'] = $("#talentArrange").val();
  241. queryData['address'] = $("#address").val();
  242. queryData['identifyCondition'] = $("#identifyCondition").val();
  243. return queryData;
  244. }
  245. /**
  246. * 查询人才认定申报列表
  247. */
  248. TalentAllowanceInfo.search = function () {
  249. TalentAllowanceInfo.table.refresh({query: TalentAllowanceInfo.formParams()});
  250. };
  251. /**
  252. * 重置
  253. */
  254. TalentAllowanceInfo.reset = function () {
  255. $("#year").val("");
  256. $("#enterpriseName").val("");
  257. $("#name").val("");
  258. $("#idCard").val("");
  259. $("#talentType").val("");
  260. $("#talentArrange").val("");
  261. $("#address").val("");
  262. $("#identifyCondition").val("");
  263. }
  264. /**
  265. * 获取人才认定
  266. */
  267. TalentAllowanceInfo.getIdentifyCondition = function () {
  268. var level = $("#talentArrange").val();
  269. if (level == null || level == '') {
  270. $("#identifyCondition").empty();
  271. $("#identifyCondition").trigger('chosen:updated');
  272. return;
  273. }
  274. Feng.addAjaxSelect({
  275. "id": "identifyCondition",
  276. "displayCode": "id",
  277. "displayName": "name",
  278. "type": "GET",
  279. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
  280. });
  281. $("#identifyCondition").trigger('chosen:updated');
  282. }
  283. /**
  284. * 显示审核日志
  285. */
  286. TalentAllowanceInfo.showLog = function (id) {
  287. layer.open({
  288. type: 1,
  289. title: "日志",
  290. fixed: false,
  291. content: '<table id="' + id + '"></table>',
  292. area: ['80%', '80%'],
  293. maxmin: true,
  294. success: function (layero, index) {
  295. $('#' + id).bootstrapTable({
  296. url: Feng.ctxPath + "/common/api/getCheckLog",
  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 {"type": CONFIG.project_jbt, "mainId": id, "typeFileId": "", "active": 1}
  311. },
  312. rowStyle: function (row, index) {
  313. return {
  314. css: {
  315. "word-break": "break-word",
  316. "white-space": "inherit"
  317. }
  318. }
  319. },
  320. columns:
  321. [
  322. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  323. formatter: function (value, row, index) {
  324. return "" + value;
  325. }
  326. },
  327. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
  328. formatter: function (value, row, index) {
  329. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  330. }
  331. },
  332. {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
  333. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  334. ]
  335. ,
  336. onPostBody: function () {
  337. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  338. var htm = $(this).html();
  339. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  340. });
  341. }
  342. });
  343. }
  344. });
  345. }
  346. $(function () {
  347. var defaultColunms = TalentAllowanceInfo.initColumn();
  348. var table = new BSTable(TalentAllowanceInfo.id, "/enterprise/talentAllowance/list", defaultColunms);
  349. table.setPaginationType("server");
  350. table.setOnDblClickRow(function () {
  351. TalentAllowanceInfo.openTalentAllowanceInfoDetail();
  352. });
  353. TalentAllowanceInfo.table = table.init();
  354. //批量加载字典表数据
  355. var arr = [
  356. {"name": "address", "code": "street"},
  357. {"name": "talentArrange", "code": "talent_arrange"},
  358. {"name": "nationality", "code": "nationality"}];
  359. Feng.findChildDictBatch(JSON.stringify(arr));
  360. $("#identifyCondition").chosen({
  361. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  362. disable_search: false,
  363. width: "100%",
  364. enable_split_word_search: true
  365. });
  366. });