talentAllowanceInfo_public_check.js 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. /**
  2. * 初始化人才认定申报详情对话框
  3. */
  4. var TalentAllowanceInfoDlg = {
  5. talentAllowanceData: {}
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. TalentAllowanceInfoDlg.close = function () {
  11. parent.layer.close(window.parent.TalentAllowanceInfo.layerIndex);
  12. }
  13. /**
  14. * 初始化工作单位及核查项目情况表
  15. */
  16. TalentAllowanceInfoDlg.initContract = function () {
  17. $("#projectTable").bootstrapTable({
  18. url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceContractDetail",
  19. method: 'POST',
  20. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  21. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  22. showRefresh: false, // 是否显示刷新按钮
  23. clickToSelect: true, // 是否启用点击选中行
  24. singleSelect: true, // 设置True 将禁止多选
  25. striped: true, // 是否显示行间隔色
  26. escape: true,
  27. pagination: false, // 设置为 true 会在表格底部显示分页条
  28. paginationHAlign: "left",
  29. paginationDetailHAlign: "right",
  30. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  31. showColumns: false,
  32. detailView: true, //父子表
  33. queryParams: function (params) {
  34. return $.extend({"mainId": $("#id").val()}, params)
  35. },
  36. columns: TalentAllowanceInfoDlg.initContractColumns(),
  37. onPostBody: function () {
  38. $("td.uitd_showTip").bind("mouseover", function () {
  39. var htm = $(this).html();
  40. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  41. });
  42. },
  43. onLoadSuccess: function (data) {
  44. $("#projectTable").bootstrapTable('expandAllRows');
  45. },
  46. onExpandRow: function (index, row, $detail) {
  47. var enterpriseId = row.enterpriseId;
  48. var cur_table = $detail.html('<table id="' + enterpriseId + '"></table>').find('table');
  49. $(cur_table).bootstrapTable({
  50. url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceProject",
  51. method: 'POST',
  52. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  53. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  54. showRefresh: false, // 是否显示刷新按钮
  55. clickToSelect: true, // 是否启用点击选中行
  56. singleSelect: true, // 设置True 将禁止多选
  57. striped: true, // 是否显示行间隔色
  58. escape: true,
  59. pagination: false, // 设置为 true 会在表格底部显示分页条
  60. paginationHAlign: "left",
  61. paginationDetailHAlign: "right",
  62. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  63. showColumns: false,
  64. queryParams: function (params) {
  65. return $.extend({"mainId": $("#id").val(), "baseId": row.id, "companyCode": ""}, params)
  66. },
  67. columns: TalentAllowanceInfoDlg.initProjectColumns(),
  68. });
  69. }
  70. });
  71. TalentAllowanceInfoDlg.initArrange();
  72. }
  73. TalentAllowanceInfoDlg.initArrange = function () {
  74. $("#arrangeTable").bootstrapTable({
  75. url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceArrange",
  76. method: 'POST',
  77. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  78. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  79. showRefresh: false, // 是否显示刷新按钮
  80. clickToSelect: true, // 是否启用点击选中行
  81. singleSelect: true, // 设置True 将禁止多选
  82. striped: true, // 是否显示行间隔色
  83. escape: true,
  84. pagination: false, // 设置为 true 会在表格底部显示分页条
  85. paginationHAlign: "left",
  86. paginationDetailHAlign: "right",
  87. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  88. showColumns: false,
  89. pageList: [10, 30, 50],
  90. queryParams: function (params) {
  91. return $.extend({"mainId": $("#id").val()}, params)
  92. },
  93. columns:
  94. [
  95. {field: 'selectItem', checkbox: false, visible: false},
  96. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  97. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  98. {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  99. {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  100. {title: '忽略其他条件可享受月份', field: 'prepareMonths', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  101. {title: '综合可享受月份', field: 'months', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  102. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  103. ],
  104. onPostBody: function () {
  105. $("td.uitd_showTip").bind("mouseover", function () {
  106. var htm = $(this).html();
  107. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  108. });
  109. }
  110. });
  111. }
  112. //显示修改工作单位合同情况模态框
  113. TalentAllowanceInfoDlg.showEditContractModel = function (id) {
  114. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
  115. if (data.code == 200) {
  116. $("#contractForm")[0].reset();
  117. $("#contractId").val(id);
  118. $("#contractModal").modal("show");
  119. } else {
  120. Feng.info(data.msg);
  121. }
  122. }, function (data) {
  123. Feng.error("校验失败!" + data.responseJSON.message + "!");
  124. });
  125. ajax.set("id", id);
  126. ajax.set("type", 1);
  127. ajax.set("process", $("#process").val())
  128. ajax.set("companyId", $("#companyId").val())
  129. ajax.start();
  130. }
  131. //修改合同起止时间提交
  132. TalentAllowanceInfoDlg.editContract = function () {
  133. var id = $("#contractId").val();
  134. var startTime = $("#startTime").val();
  135. var endTime = $("#endTime").val();
  136. if (startTime == null || startTime == '') {
  137. Feng.info("请选择合同起始时间");
  138. return;
  139. }
  140. if (endTime == null || endTime == '') {
  141. Feng.info("请选择合同截止时间");
  142. return;
  143. }
  144. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editContract", function (data) {
  145. if (data.code == 200) {
  146. Feng.success(data.msg);
  147. $("#projectTable").bootstrapTable("refresh", {});
  148. $("#contractModal").modal("hide");
  149. } else {
  150. Feng.info(data.msg);
  151. }
  152. }, function (data) {
  153. Feng.error("提交失败!" + data.responseJSON.message + "!");
  154. });
  155. ajax.set({"id": id, "startTime": startTime, "endTime": endTime, "process": $("#process").val()});
  156. ajax.start();
  157. }
  158. TalentAllowanceInfoDlg.saveProjectData = function (id, project, allowanceType) {
  159. var description = $("#d" + id).val();
  160. var months = [];
  161. var error = "";
  162. if (project == 4 && allowanceType == 2) {
  163. $("#m" + id + " input[name=day]").each(function () {
  164. var days = $(this).val();
  165. var max = $(this).attr("max");
  166. var num = $(this).attr("num");
  167. if (isNaN(days)) {
  168. error = error + num + "月的考勤天数不是数字;";
  169. } else {
  170. if (days < 0 || days > max) {
  171. error = error + num + "月的考勤天数不在范围内(1-" + max + ");";
  172. }
  173. }
  174. if (days == null || days == '') {
  175. days = 0;
  176. }
  177. months.push(num + "=" + days);
  178. })
  179. } else {
  180. $("#m" + id + " input[name=month]").each(function () {
  181. if (this.checked) {
  182. months.push($(this).val());
  183. }
  184. })
  185. }
  186. if (error != "") {
  187. Feng.error(error);
  188. return;
  189. }
  190. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) {
  191. if (data.code == 200) {
  192. Feng.success(data.msg);
  193. } else {
  194. Feng.info(data.msg);
  195. }
  196. }, function (data) {
  197. Feng.error("提交失败!" + data.responseJSON.message + "!");
  198. });
  199. ajax.set({"id": id, "months": months.join(","), "description": description});
  200. ajax.start();
  201. }
  202. //显示编辑项目模态框
  203. TalentAllowanceInfoDlg.showEditProjectModal = function (project, id, enterpriseId, months, days, content) {
  204. var desc = $(content).attr("data-value");
  205. var type = $("#type").val();
  206. TalentAllowanceInfoDlg.initICheck();
  207. $("#description").val(desc);
  208. switch (project) {
  209. case "1":
  210. $("#contractCheckForm")[0].reset();
  211. $("#contractCheckId").val(id);
  212. $("#contractEnterpriseId").val(enterpriseId);
  213. $("#contractCheckModal").modal("show");
  214. break;
  215. case "4":
  216. var allowanceType = $("#allowanceType").val();
  217. if (allowanceType == 2) {
  218. $("#attendanceModalLabel").html("考勤");
  219. $("#heading").html("请填写每月考勤天数<span style=\"color: red\">(不填写或填写0则代表无考勤记录)</span>");
  220. $("#attendanceForm")[0].reset();
  221. $("#attendanceId").val(id);
  222. $("#attendanceEnterpriseId").val(enterpriseId);
  223. if (months != null && months != '') {
  224. var arr = months.split(",");
  225. for (var key in arr) {
  226. var num = arr[key].split("=")[0];
  227. var day = arr[key].split("=")[1];
  228. $("#attendMonths input").each(function () {
  229. if ($(this).attr('num') == num)
  230. $(this).val(day);
  231. });
  232. }
  233. }
  234. $("#attendanceModal").modal("show");
  235. } else if (allowanceType == 1) {
  236. $('#jjAttendanceModal').on('show.bs.modal', function () {
  237. $("#jjmonths input").each(function () {
  238. $(this).iCheck("uncheck");
  239. });
  240. $("#jjAttendanceId").val(id);
  241. $("#jjAttendanceEnterpriseId").val(enterpriseId);
  242. if (Feng.isNotEmptyStr(months)) {
  243. if (months.indexOf(",") != -1) {
  244. var arr = months.split(",");
  245. for (var key in arr) {
  246. $("#jjmonths input").each(function () {
  247. if ($(this).val() == arr[key])
  248. $(this).iCheck("check");
  249. });
  250. }
  251. }
  252. }
  253. });
  254. if (days != null && days != '')
  255. $("#days").val(days);
  256. $("#jjAttendanceModal").modal("show");
  257. }
  258. break;
  259. case "15":
  260. $("#attendanceModalLabel").html("在境时间");
  261. $("#heading").html("请填写每月在境内天数<span style=\"color: red\">(不填写则代表为0天)</span>");
  262. $("#attendanceForm")[0].reset();
  263. $("#attendanceId").val(id);
  264. $("#attendanceEnterpriseId").val(enterpriseId);
  265. if (months != null && months != '') {
  266. var arr = months.split(",");
  267. for (var key in arr) {
  268. var num = arr[key].split("=")[0];
  269. var day = arr[key].split("=")[1];
  270. $("#attendMonths input").each(function () {
  271. if ($(this).attr('num') == num)
  272. $(this).val(day);
  273. });
  274. }
  275. }
  276. $("#attendanceModal").modal("show");
  277. break;
  278. case "16":
  279. $("#attendanceModalLabel").html("境内工作日时间");
  280. $("#heading").html("请填写每月境内工作日天数<span style=\"color: red\">(不填写则代表为0天)</span>");
  281. $("#attendanceForm")[0].reset();
  282. $("#attendanceId").val(id);
  283. $("#attendanceEnterpriseId").val(enterpriseId);
  284. if (months != null && months != '') {
  285. var arr = months.split(",");
  286. for (var key in arr) {
  287. var num = arr[key].split("=")[0];
  288. var day = arr[key].split("=")[1];
  289. $("#attendMonths input").each(function () {
  290. if ($(this).attr('num') == num)
  291. $(this).val(day);
  292. });
  293. }
  294. }
  295. $("#attendanceModal").modal("show");
  296. break;
  297. default:
  298. $('#projectModal').on('show.bs.modal', function () {
  299. $("#months input").each(function () {
  300. $(this).iCheck("uncheck");
  301. });
  302. $("#projectId").val(id);
  303. $("#enterpriseId").val(enterpriseId);
  304. TalentAllowanceInfoDlg.initICheck();
  305. if (Feng.isNotEmptyStr(months)) {
  306. var arr = months.split(",");
  307. for (var key in arr) {
  308. $("#months input").each(function () {
  309. if ($(this).val() == arr[key])
  310. $(this).iCheck("check");
  311. });
  312. }
  313. }
  314. });
  315. $("#projectModal").modal("show");
  316. break;
  317. }
  318. }
  319. //审核合同满两年提交
  320. TalentAllowanceInfoDlg.contractCheckSubmit = function () {
  321. var id = $("#contractCheckId").val();
  322. var enterpriseId = $("#contractEnterpriseId").val();
  323. var description = $("#msg").val();
  324. var months = $("#state").val();
  325. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) {
  326. if (data.code == 200) {
  327. Feng.success(data.msg);
  328. $("#" + enterpriseId).bootstrapTable("refresh", {});
  329. $("#contractCheckModal").modal("hide");
  330. } else {
  331. Feng.info(data.msg);
  332. }
  333. }, function (data) {
  334. Feng.error("提交失败!" + data.responseJSON.message + "!");
  335. });
  336. ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()});
  337. ajax.start();
  338. }
  339. //编辑项目提交
  340. TalentAllowanceInfoDlg.editProject = function () {
  341. var id = $("#projectId").val();
  342. var enterpriseId = $("#enterpriseId").val();
  343. var description = $("#description").val();
  344. var months = "";
  345. $("#months input").each(function () {
  346. if (this.checked) {
  347. months = months + $(this).val() + ",";
  348. }
  349. })
  350. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) {
  351. if (data.code == 200) {
  352. Feng.success(data.msg);
  353. $("#" + enterpriseId).bootstrapTable("refresh", {});
  354. $("#projectModal").modal("hide");
  355. } else {
  356. Feng.info(data.msg);
  357. }
  358. }, function (data) {
  359. Feng.error("提交失败!" + data.responseJSON.message + "!");
  360. });
  361. ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()});
  362. ajax.start();
  363. }
  364. /**
  365. * 提交晋江市现代产业体系人才的考勤
  366. */
  367. TalentAllowanceInfoDlg.editJJAttendance = function () {
  368. var id = $("#jjAttendanceId").val();
  369. var enterpriseId = $("#jjAttendanceEnterpriseId").val();
  370. var description = $("#jjDescription").val();
  371. var days = $("#days").val();
  372. var months = "";
  373. $("#jjmonths input").each(function () {
  374. if (this.checked) {
  375. months = months + $(this).val() + ",";
  376. }
  377. })
  378. if (months == "" && (days == null || days == "")) {
  379. Feng.info("请填写考勤信息");
  380. return;
  381. }
  382. if (months != null && months != '' && days != null && days != '') {
  383. Feng.info("考勤天数和考勤月份只能选择一个填写");
  384. return;
  385. }
  386. $("#attendanceMonths").val(months);
  387. $("#jjAttendanceForm")[0].submit();
  388. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) {
  389. if (data.code == 200) {
  390. Feng.success(data.msg);
  391. $("#" + enterpriseId).bootstrapTable("refresh", {});
  392. $("#jjAttendanceModal").modal("hide");
  393. } else {
  394. Feng.info(data.msg);
  395. }
  396. }, function (data) {
  397. Feng.error("提交失败!" + data.responseJSON.message + "!");
  398. });
  399. ajax.set({"id": id, "months": months, "days": days, "description": description, "process": $("#process").val()});
  400. ajax.start();
  401. }
  402. TalentAllowanceInfoDlg.editAttendanceProject = function () {
  403. var id = $("#attendanceId").val();
  404. var enterpriseId = $("#attendanceEnterpriseId").val();
  405. var description = $("#attendanceDescription").val();
  406. var months = "";
  407. var error = "";
  408. $("#attendMonths input").each(function () {
  409. var days = $(this).val();
  410. var num = $(this).attr("num");
  411. if (isNaN(days)) {
  412. error = error + num + "月的考勤天数不是数字;";
  413. } else {
  414. if (days < 0 || days > 31) {
  415. error = error + num + "月的考勤天数不在范围内(1-31);";
  416. }
  417. }
  418. if (days == null || days == '') {
  419. days = 0;
  420. }
  421. months = months + num + "=" + days + ",";
  422. });
  423. if (error != "") {
  424. Feng.error(error);
  425. return;
  426. }
  427. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) {
  428. if (data.code == 200) {
  429. Feng.success(data.msg);
  430. $("#" + enterpriseId).bootstrapTable("refresh", {});
  431. $("#attendanceModal").modal("hide");
  432. } else {
  433. Feng.info(data.msg);
  434. }
  435. }, function (data) {
  436. Feng.error("提交失败!" + data.responseJSON.message + "!");
  437. });
  438. ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()});
  439. ajax.start();
  440. }
  441. /**
  442. * 计算津补贴额度
  443. */
  444. TalentAllowanceInfoDlg.showCheckModal = function () {
  445. layer.open({
  446. id: "afterCheck",
  447. type: 1,
  448. title: "津补贴计算",
  449. fixed: false,
  450. resize: true,
  451. scrollbar: false,
  452. content:
  453. '<div class="panel panel-success">\n' +
  454. ' <div class="panel-heading" onclick="$(this).next().toggle()">推荐津补贴类型</div>\n' +
  455. ' <div class="panel-body">\n' +
  456. ' <form id="checkForm">\n' +
  457. ' <div class="form-group">\n' +
  458. ' <label for="checkState" class="control-label">津补贴类型</label>\n' +
  459. ' <input class="form-control" id="recommendallowanceType" />\n' +
  460. ' </div>\n' +
  461. ' <div class="form-group">\n' +
  462. ' <label for="dxMonths" class="control-label">兑现月份</label>\n' +
  463. ' <input type="text" class="form-control" readonly="readonly" id="recommenddxMonths" />\n' +
  464. ' </div>\n' +
  465. ' <div class="form-group">\n' +
  466. ' <label for="dxMonths" class="control-label">津补贴判定详情</label>\n' +
  467. ' <textarea type="text" class="form-control" readonly="readonly" id="recommendAllowanceMsg" rows="8"></textarea>\n' +
  468. ' </div>\n' +
  469. ' <div class="form-group">\n' +
  470. ' <label for="dxMonths" class="control-label">津补贴计算详情</label>\n' +
  471. ' <input type="text" class="form-control" readonly="readonly" id="recommendMoneyDesc" />\n' +
  472. ' </div>\n' +
  473. ' </form>\n' +
  474. ' </div>\n' +
  475. ' </div>\n' +
  476. ' <div id="checkDiv" class="panel panel-primary">\n' +
  477. ' <div class="panel-heading" onclick="$(this).next().toggle()">确认津补贴</div>\n' +
  478. ' <div class="panel-body">\n' +
  479. ' <div class="form-group">\n' +
  480. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  481. ' <select class="form-control" id="checkStateAfter" onchange="TalentAllowanceInfoDlg.checkStateChange(this)">\n' +
  482. ' <option value="">请选择</option>\n' +
  483. ' <option value="-1">审核不通过</option>\n' +
  484. ' <option value="3">审核通过</option>\n' +
  485. ' </select>\n' +
  486. ' </div>\n' +
  487. ' <div class="form-group">\n' +
  488. ' <label for="checkState" class="control-label">审核意见</label>\n' +
  489. ' <textarea type="text" class="form-control" id="checkMsgAfter" name="checkMsgAfter"></textarea>\n' +
  490. ' </div>\n' +
  491. ' <div class="form-group ">\n' +
  492. ' <label for="checkState" class="control-label">征信状态</label>\n' +
  493. ' <select class="form-control" id="zxState" onchange="TalentAllowanceInfoDlg.zxChange(this)">\n' +
  494. ' <option value="">请选择</option>\n' +
  495. ' <option value="1">征信通过</option>\n' +
  496. ' <option value="2">征信失信</option>\n' +
  497. ' </select>\n' +
  498. ' </div>\n' +
  499. ' <div class="form-group ">\n' +
  500. ' <label for="checkState" class="control-label">失信原因</label>\n' +
  501. ' <textarea type="text" class="form-control" id="zxMsg" name="zxMsg" placeholder="征信通过不填写"></textarea>\n' +
  502. ' </div>\n' +
  503. ' <div class="form-group notPassDiv sourceDiv" style="display: none">\n' +
  504. ' <label for="checkState" class="control-label">判定类型</label>\n' +
  505. ' <select class="form-control" id="source" onchange="TalentAllowanceInfoDlg.allowanceTypeChange(this)">\n' +
  506. ' <option value="">请选择</option>\n' +
  507. ' <option value="1">与系统判定一致</option>\n' +
  508. ' <option value="2">个人判定</option>\n' +
  509. ' </select>\n' +
  510. ' </div>\n' +
  511. ' <div class="form-group notPassDiv personDiv" style="display: none">\n' +
  512. ' <label for="checkState" class="control-label">津补贴类型</label>\n' +
  513. ' <select type="text" class="form-control" id="resAllowanceType">\n' +
  514. ' <option value="">请选择</option>\n' +
  515. ' <option value="1">工作津贴</option>\n' +
  516. ' <option value="2">一次性交通补贴</option>\n' +
  517. ' <option value="3">不予兑现</option>\n' +
  518. ' </select>\n' +
  519. ' </div>\n' +
  520. ' <div class="form-group notPassDiv personDiv" id="setMonths" style="display: none">\n' +
  521. ' <label for="checkState" class="control-label">享受月份(仅工作津贴填写)</label>\n' +
  522. ' </div>\n' +
  523. ' <div class="form-group notPassDiv personDiv" style="display: none">\n' +
  524. ' <label for="checkState" class="control-label">判定说明</label>\n' +
  525. ' <textarea type="text" class="form-control" id="resAllowanceMsg" name="resAllowanceMsg"></textarea>\n' +
  526. ' </div>\n' +
  527. ' </div>\n' +
  528. ' </div>',
  529. area: ['80%', '80%'],
  530. maxmin: true,
  531. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  532. btnAlign: 'c',
  533. success: function (layero, index) {
  534. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/suppleCheckCalculate", function (data) {
  535. if (data.code == 200) {
  536. var info = data.obj.info;
  537. var list = data.obj.detailList;
  538. if (info.recommendAllowanceType == 1) {
  539. $("#recommendallowanceType").val("工作津贴");
  540. }
  541. if (info.recommendAllowanceType == 2) {
  542. $("#recommendallowanceType").val("一次性交通补贴");
  543. }
  544. if (info.recommendAllowanceType == 3) {
  545. $("#recommendallowanceType").val("不予兑现");
  546. }
  547. $("#recommenddxMonths").val(info.recommendMonths);
  548. $("#recommendAllowanceMsg").val(info.recommendAllowanceMsg);
  549. $("#recommendMoneyDesc").val(info.recommendMoneyDesc);
  550. var html = "";
  551. for (var key in list) {
  552. var title = info.type == 1 ? list[key].enterpriseName + "(" + list[key].entryTime + "至" + list[key].quitTime + ")-" + list[key].talentTypeName : list[key].enterpriseName + "(" + list[key].entryTime + "至" + list[key].quitTime + ")";
  553. html = html +
  554. '<div class="input-group detailMonths">\n' +
  555. '<input type="hidden" class="detailId" value="' + list[key].id + '">' +
  556. '<span class="input-group-addon" title="' + title + '">' + title + '</span>' +
  557. '<input type="text" class="form-control months" >\n' +
  558. '<span class="input-group-addon btn-danger" onclick="TalentAllowanceInfoDlg.showEditMonths(this)">编辑</span>\n' +
  559. '</div>\n';
  560. }
  561. $("#setMonths").append(html);
  562. } else {
  563. Feng.info(data.msg);
  564. }
  565. }, function (data) {
  566. Feng.error("提交失败!" + data.responseJSON.message + "!");
  567. });
  568. ajax.set({"id": $("#id").val()});
  569. ajax.start();
  570. },
  571. yes: function (index, layero) {
  572. var operation = function () {
  573. var checkState = $("#checkStateAfter").val();
  574. var checkMsg = $("#checkMsgAfter").val();
  575. var zxState = $("#zxState").val();
  576. var zxMsg = $("#zxMsg").val();
  577. var source = $("#source").val();
  578. var resAllowanceType = $("#resAllowanceType").val();
  579. var resAllowanceMsg = $("#resAllowanceMsg").val();
  580. var details = new Array();
  581. $(".detailMonths").each(function () {
  582. var id = $(this).find(".detailId").val();
  583. var months = $(this).find(".months").val();
  584. details.push({"id": id, "months": months});
  585. });
  586. if (Feng.isEmptyStr(checkState)) {
  587. Feng.info("请选择审核状态");
  588. return;
  589. }
  590. if (Feng.isEmptyStr(checkMsg)) {
  591. Feng.info("请填写审核意见");
  592. return;
  593. }
  594. if (Feng.isEmptyStr(zxState)) {
  595. Feng.info("请选择征信状态");
  596. return;
  597. }
  598. if (zxState == 2 && Feng.isEmptyStr(zxMsg)) {
  599. Feng.info("请填写失信原因");
  600. return;
  601. }
  602. if (checkState == 3 && zxState == 1) {
  603. if (Feng.isEmptyStr(source)) {
  604. Feng.info("请选择判定类型");
  605. return;
  606. }
  607. if (source == 2) {
  608. if (Feng.isEmptyStr(resAllowanceType)) {
  609. Feng.info("请选择津补贴类型");
  610. return;
  611. }
  612. if (resAllowanceType == 1 && details.length == 0) {
  613. Feng.info("请选择工作津贴可享受的月份");
  614. return;
  615. }
  616. if (Feng.isEmptyStr(resAllowanceMsg)) {
  617. Feng.info("请填写判定说明");
  618. return;
  619. }
  620. }
  621. }
  622. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/afterCheck", function (data) {
  623. if (data.code == 200) {
  624. Feng.success(data.msg);
  625. window.parent.TalentAllowanceInfo.table.refresh();
  626. TalentAllowanceInfoDlg.close();
  627. } else {
  628. Feng.info(data.msg);
  629. }
  630. }, function (data) {
  631. Feng.error("提交失败!" + data.responseJSON.message + "!");
  632. });
  633. ajax.setData(JSON.stringify({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg, "zxState": zxState, "zxMsg": zxMsg, "source": source, "resAllowanceType": resAllowanceType, "resAllowanceMsg": resAllowanceMsg, "details": details}))
  634. ajax.setcontentType("application/json;charset=utf-8");
  635. ajax.start();
  636. };
  637. Feng.confirm("一旦提交将无法修改,确认提交吗?", operation);
  638. }
  639. });
  640. }
  641. TalentAllowanceInfoDlg.showEditMonths = function (content) {
  642. layer.open({
  643. id: "setMoths",
  644. type: 1,
  645. title: "津补贴计算",
  646. fixed: false,
  647. resize: true,
  648. scrollbar: false,
  649. content: '<ul style="padding-top: 5px" id="resMonths">\n' +
  650. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="01"><span style="margin-left: 3px">01月</span></li>\n' +
  651. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="02"><span style="margin-left: 3px">02月</span></li>\n' +
  652. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="03"><span style="margin-left: 3px">03月</span></li>\n' +
  653. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="04"><span style="margin-left: 3px">04月</span></li>\n' +
  654. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="05"><span style="margin-left: 3px">05月</span></li>\n' +
  655. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="06"><span style="margin-left: 3px">06月</span></li>\n' +
  656. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="07"><span style="margin-left: 3px">07月</span></li>\n' +
  657. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="08"><span style="margin-left: 3px">08月</span></li>\n' +
  658. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="09"><span style="margin-left: 3px">09月</span></li>\n' +
  659. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="10"><span style="margin-left: 3px">10月</span></li>\n' +
  660. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="11"><span style="margin-left: 3px">11月</span></li>\n' +
  661. ' <li style="width: 7%"><input type="checkbox" name="lastMonth" value="12"><span style="margin-left: 3px">12月</span></li>\n' +
  662. ' </ul>\n',
  663. area: ['60%', '40%'],
  664. maxmin: true,
  665. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;确定', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  666. btnAlign: 'c',
  667. yes: function (index, layero) {
  668. var months = "";
  669. $("#resMonths input").each(function () {
  670. if (this.checked) {
  671. months = months + $(this).val() + ",";
  672. }
  673. });
  674. months = months.substring(0, months.length - 1);
  675. $(content).prev().val(months);
  676. layer.close(index);
  677. },
  678. });
  679. }
  680. TalentAllowanceInfoDlg.allowanceTypeChange = function (content) {
  681. var allowanceType = $(content).val();
  682. if (allowanceType == 1) {
  683. $(".personDiv").css("display", "none");
  684. } else {
  685. $(".personDiv").css("display", "block");
  686. }
  687. }
  688. TalentAllowanceInfoDlg.checkStateChange = function (content) {
  689. var checkState = $(content).val();
  690. var zxState = $("#zxState").val();
  691. if (checkState == -1) {
  692. $(".notPassDiv").css("display", "none");
  693. } else if (checkState == 3 && zxState == 1) {
  694. $(".sourceDiv").css("display", "block");
  695. } else {
  696. $(".notPassDiv").css("display", "none").trigger("change");
  697. }
  698. }
  699. TalentAllowanceInfoDlg.zxChange = function (content) {
  700. var zxState = $(content).val();
  701. var checkState = $("#checkStateAfter").val();
  702. if (checkState == 2) {
  703. $(".notPassDiv").css("display", "none");
  704. } else if (zxState == 1 && checkState == 3) {
  705. $(".sourceDiv").css("display", "block");
  706. } else {
  707. $(".notPassDiv").css("display", "none").trigger("change");
  708. }
  709. }
  710. TalentAllowanceInfoDlg.attendanceCallBack = function () {
  711. if (data.code == 200) {
  712. Feng.success(data.msg);
  713. $("#" + data.obj).bootstrapTable("refresh", {});
  714. $("#jjAttendanceModal").modal("hide");
  715. } else {
  716. Feng.info(data.msg);
  717. }
  718. }
  719. TalentAllowanceInfoDlg.initICheck = function () {
  720. $('input[type=checkbox]').iCheck({
  721. labelHover: false,
  722. cursor: true,
  723. checkboxClass: 'icheckbox_square-green',
  724. radioClass: 'iradio_square-greene',
  725. increaseArea: '20%'
  726. });
  727. }
  728. TalentAllowanceInfoDlg.initContractColumns = function () {
  729. var type = $("#type").val();
  730. var process = $("#process").val();
  731. if (type == 1) {
  732. return [
  733. {field: 'selectItem', checkbox: false, visible: false},
  734. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  735. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'},
  736. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'},
  737. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  738. {title: '本年度工作截止时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  739. {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  740. {title: '首次来晋行政介绍信时间', field: 'letterTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  741. {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  742. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "150px",
  743. formatter: function (value, row, index) {
  744. return "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-left: 5px;' class='btn btn-xs btn-danger'>" +
  745. "<i class=\"fa fa-edit\"></i>修改" +
  746. "</button>" +
  747. "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + value + "\")' style='margin-left: 5px;' class='btn btn-xs btn-success'>" +
  748. "<i class=\"fa fa-book\"></i>日志" +
  749. "</button>";
  750. }
  751. }
  752. ];
  753. } else {
  754. return [
  755. {field: 'selectItem', checkbox: false, visible: false},
  756. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  757. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  758. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  759. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "80px"},
  760. {title: '本年度工作截止时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "80px"},
  761. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "150px",
  762. formatter: function (value, row, index) {
  763. return "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-left: 5px;' class='btn btn-xs btn-danger '>" +
  764. "<i class=\"fa fa-edit\"></i>修改" +
  765. "</button>" +
  766. "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + value + "\")' style='margin-left: 5px;' class='btn btn-xs btn-success'>" +
  767. "<i class=\"fa fa-book\"></i>日志" +
  768. "</button>";
  769. }
  770. }
  771. ];
  772. }
  773. }
  774. //初始化项目表的列
  775. TalentAllowanceInfoDlg.initProjectColumns = function () {
  776. return [
  777. {field: 'selectItem', checkbox: false, visible: false},
  778. {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
  779. {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%",
  780. formatter: function (value, row, index) {
  781. var allowanceType = $("#allowanceType").val();
  782. var html = "";
  783. if (row.project == 4 && allowanceType == 2) {
  784. html = TalentAllowanceInfoDlg.createDaySelector(row.id, value);
  785. } else {
  786. html = TalentAllowanceInfoDlg.createMonthSelector(row.id, value);
  787. }
  788. return html;
  789. }
  790. },
  791. /*{title: '附件材料', field: 'fileUrl', visible: true, align: 'center', valign: 'middle',width:"35%",
  792. formatter : function(value,row,index){
  793. if(value!=null && value!=''){
  794. var sn = value.lastIndexOf(".");
  795. var suffix = value.substring(sn+1,value.length);
  796. return suffix=="pdf"||suffix=="PDF"?"<button type='button' onclick=\"Feng.showPdf('"+value+"','"+row.id+"','"+row.projectName+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>"
  797. :'<img class=\"imgUrl\" src=\"'+value+'\" style=\"width:25px;height:25px;\">';
  798. }else{
  799. return "未上传";
  800. }
  801. }
  802. },*/
  803. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "25%", 'class': 'uitd_showTip',
  804. formatter: function (value, row, index) {
  805. var html = '<textarea id="d' + row.id + '" class="form-control">' + (value ? value : "") + '</textarea>';
  806. return html;
  807. }
  808. },
  809. {title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle', width: "15%",
  810. formatter: function (value, row, index) {
  811. var allowanceType = $("#allowanceType").val();
  812. var html = "<button type='button' data-value='" + row.description + "' onclick=\"TalentAllowanceInfoDlg.saveProjectData('" + row.id + "','" + row.project + "','" + allowanceType + "')\" style='margin-left: 5px;' class=\"btn btn-xs btn-danger\">" +
  813. "<i class=\"fa fa-edit\"></i>保存" +
  814. "</button>" +
  815. "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' style='margin-left: 5px;' class='btn btn-xs btn-success'>" +
  816. "<i class=\"fa fa-book\"></i>日志" +
  817. "</button>";
  818. /*if (value == 1 || value ==2){
  819. html = html + "<button type='button' onclick=\"TalentAllowanceInfoDlg.showFileTable('"+row.project+"')\" style='margin-left: 5px;' class=\"btn btn-xs btn-default\">" +
  820. "<i class=\"fa fa-book\"></i>查看附件" +
  821. "</button>" ;
  822. }*/
  823. return html;
  824. }
  825. }
  826. ];
  827. }
  828. TalentAllowanceInfoDlg.createDaySelector = function (id, selectDays) {
  829. var dayArr = selectDays ? selectDays.split(",") : [];
  830. var tmpKv = {};
  831. for (var d = 0; d < dayArr.length; d++) {
  832. var kv = dayArr[d].split("=");
  833. tmpKv["m" + kv[0]] = kv[1];
  834. }
  835. var html = '<div id="m' + id + '" class="day-selector"><span style="color:red;">*填写对应月份打卡天数,没有填写则记为0天</span><ul>';
  836. var bigMonths = [1, 3, 5, 7, 8, 10, 12];
  837. for (var m = 1; m <= 12; m++) {
  838. var month = m < 10 ? "0" + m : m;
  839. var day = tmpKv["m" + month] ? tmpKv["m" + month] : "";
  840. var maxDay = bigMonths.indexOf(m) > -1 ? 31 : (m != 2 ? 30 : 29);
  841. html += '<li><label>' + m + '月</label><input type="number" name="day" class="form-control" max="' + maxDay + '" min="0" num="' + month + '" value="' + day + '"></li>';
  842. }
  843. html += '</ul></div>'
  844. return html;
  845. }
  846. TalentAllowanceInfoDlg.createMonthSelector = function (id, selectMonths) {
  847. var monthArr = selectMonths ? selectMonths.split(",") : [];
  848. var html = '<div id="m' + id + '" class="month-selector"><ul><li><input type="checkbox" onchange="TalentAllowanceInfoDlg.newCheckAll(' + id + ',this)">全选</li>';
  849. for (var m = 1; m <= 12; m++) {
  850. var month = m < 10 ? "0" + m : m;
  851. var checked = "";
  852. if (monthArr.indexOf(month.toString()) > -1) {
  853. checked = "checked";
  854. }
  855. html += '<li><input type="checkbox" name="month" value="' + month + '" ' + checked + '>' + month + '月</li>';
  856. }
  857. html += '</ul></div>'
  858. return html;
  859. }
  860. TalentAllowanceInfoDlg.showFileTable = function (project) {
  861. var api = (project == 1) ? CONFIG.jbt_concat : CONFIG.jbt_tax;
  862. var index = layer.open({
  863. type: 1,
  864. title: "附件材料",
  865. fixed: false,
  866. content: '<ul class="showImgs" style="padding: 0px 5px 0px 5px;"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li></ul>',
  867. area: ['50%', '50%'],
  868. maxmin: true,
  869. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  870. success: function (layero, index) {
  871. var ajax = new $ax(Feng.ctxPath + "/api/common/getTalentFileByApi?api=" + api + "&mainId=" + $("#id").val(), function (data) {
  872. if (data.code == 500) {
  873. Feng.error(data.msg);
  874. return;
  875. }
  876. var html = "";
  877. var files = data.obj;
  878. for (var key in files) {
  879. var sn = files[key].url.lastIndexOf(".");
  880. var suffix = files[key].url.substring(sn + 1, files[key].url.length);
  881. var imgStr = "";
  882. if (suffix == "pdf" || suffix == "PDF") {
  883. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  884. } else {
  885. imgStr = '<img class=\"imgUrl\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
  886. }
  887. html = html + '<li style="display: none">' + files[key].id + '</li>\n' +
  888. '<li style="width: 80%;padding-top: 5px;">' + files[key].orignName + '</li>\n' +
  889. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  890. "<li style='width: 10%;padding-top: 2px;'><button type='button' onclick=\"Feng.downloadFile('" + files[key].id + "',1)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
  891. }
  892. $(".showImgs").append(html);
  893. $(".showImgs").viewer({
  894. fullscreen: false
  895. });
  896. });
  897. ajax.start();
  898. }
  899. });
  900. }
  901. TalentAllowanceInfoDlg.showLog = function (id) {
  902. layer.open({
  903. type: 1,
  904. title: "日志",
  905. fixed: false,
  906. content: '<table id="' + id + '"></table>',
  907. area: ['80%', '80%'],
  908. maxmin: true,
  909. success: function (layero, index) {
  910. $('#' + id).bootstrapTable({
  911. url: Feng.ctxPath + "/common/api/getJbtCheckLog",
  912. method: 'POST',
  913. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  914. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  915. showRefresh: false, // 是否显示刷新按钮
  916. clickToSelect: true, // 是否启用点击选中行
  917. singleSelect: true, // 设置True 将禁止多选
  918. striped: true, // 是否显示行间隔色
  919. pagination: false, // 设置为 true 会在表格底部显示分页条
  920. paginationHAlign: "left",
  921. paginationDetailHAlign: "right",
  922. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  923. showColumns: false,
  924. queryParams: function (params) {
  925. return {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": id, "active": 1}
  926. },
  927. columns:
  928. [
  929. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  930. formatter: function (value, row, index) {
  931. return "" + value;
  932. }
  933. },
  934. {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle', width: "15%"},
  935. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  936. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "45%",
  937. formatter: function (value, row, index) {
  938. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  939. }
  940. }
  941. ]
  942. ,
  943. onPostBody: function () {
  944. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  945. var htm = $(this).html();
  946. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  947. });
  948. }
  949. });
  950. }
  951. });
  952. }
  953. //全选
  954. TalentAllowanceInfoDlg.newCheckAll = function (id, obj) {
  955. var checked = $(obj).is(":checked");
  956. if (checked) {
  957. $("#m" + id + " input[name=month]").each(function () {
  958. $(this).prop("checked", "checked");
  959. })
  960. } else {
  961. $("#m" + id + " input[name=month]").each(function () {
  962. $(this).removeAttr("checked");
  963. })
  964. }
  965. }
  966. //全选
  967. TalentAllowanceInfoDlg.checkAll = function (id) {
  968. $("#" + id + " input").each(function () {
  969. $(this).iCheck("check");
  970. })
  971. }
  972. //反选
  973. TalentAllowanceInfoDlg.unCheckAll = function (id) {
  974. $("#" + id + " input").each(function () {
  975. if (this.checked) {
  976. $(this).iCheck("uncheck");
  977. } else {
  978. $(this).iCheck("check");
  979. }
  980. })
  981. }
  982. //初始化附件类别表单
  983. TalentAllowanceInfoDlg.initFileTable = function () {
  984. TalentAllowanceInfoDlg.initContract();
  985. var queryData = {};
  986. queryData["mainId"] = $("#id").val();
  987. queryData['project'] = CONFIG.project_jbt;
  988. queryData['type'] = $("#type").val();
  989. queryData['allowanceType'] = $("#allowanceType").val();
  990. $("#fileTable").bootstrapTable({
  991. url: Feng.ctxPath + "/common/api/findCommonFileType",
  992. method: 'POST',
  993. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  994. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  995. showRefresh: false, // 是否显示刷新按钮
  996. clickToSelect: true, // 是否启用点击选中行
  997. singleSelect: true, // 设置True 将禁止多选
  998. striped: true, // 是否显示行间隔色
  999. escape: true,
  1000. pagination: false, // 设置为 true 会在表格底部显示分页条
  1001. paginationHAlign: "left",
  1002. paginationDetailHAlign: "right",
  1003. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  1004. showColumns: false,
  1005. detailView: true, //是否显示父子表
  1006. pageList: [10, 30, 50],
  1007. queryParams: function (params) {
  1008. return $.extend(queryData, params)
  1009. },
  1010. rowStyle: function (row, index) {
  1011. return {classes: "info"};
  1012. },
  1013. columns: [
  1014. {field: 'selectItem', checkbox: false, visible: false},
  1015. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%", 'class': 'uitd_showTip',
  1016. formatter: function (value, row, index) {
  1017. if (row.must == 1) {
  1018. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  1019. }
  1020. if (row.must == 2) {
  1021. return '<i class="fa fa-paste"></i>' + value;
  1022. }
  1023. }
  1024. },
  1025. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "68%", 'class': 'uitd_showTip'},
  1026. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "12%",
  1027. formatter: function (value, row, index) {
  1028. if (value == null || value == '' || value == 'null') {
  1029. return '无';
  1030. }
  1031. return "<button type='button' onclick=\"Feng.downloadFile('" + value + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  1032. "<i class=\"fa fa-download\"></i>下载" +
  1033. "</button>";
  1034. }
  1035. }
  1036. ],
  1037. onPostBody: function () {
  1038. $("td.uitd_showTip").bind("mouseover", function () {
  1039. var htm = $(this).html();
  1040. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  1041. });
  1042. },
  1043. onLoadSuccess: function (data) {
  1044. $("#fileTable").bootstrapTable('expandAllRows');
  1045. },
  1046. onExpandRow: function (index, row, $detail) {
  1047. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  1048. if (data == null || data.length == 0) {
  1049. return;
  1050. }
  1051. var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
  1052. for (var key in data) {
  1053. var sn = data[key].url.lastIndexOf(".");
  1054. var suffix = data[key].url.substring(sn + 1, data[key].url.length);
  1055. var imgStr = "";
  1056. if (suffix == "pdf" || suffix == "PDF") {
  1057. imgStr = "<button type='button' onclick=\"Feng.showPdf(('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  1058. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS' || suffix == "doc" || suffix == "DOC" || suffix == 'docx' || suffix == "DOCX") {
  1059. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  1060. } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
  1061. imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
  1062. } else {
  1063. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  1064. }
  1065. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  1066. '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  1067. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  1068. "<li style='width: 10%;padding-top: 2px;'><button type='button' onclick=\"Feng.downloadFile('" + data[key].id + "',1)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
  1069. }
  1070. html = html + '</ul>';
  1071. $detail.html(html);
  1072. $(".imgs").viewer({
  1073. // toolbar:false,
  1074. fullscreen: false
  1075. });
  1076. }, function (data) {
  1077. Feng.error("查询失败!" + data.responseJSON.message + "!");
  1078. });
  1079. var queryData = {};
  1080. queryData["mainId"] = $("#id").val();
  1081. queryData["fileTypeId"] = row.id;
  1082. ajax.set(queryData);
  1083. ajax.start();
  1084. }
  1085. });
  1086. }
  1087. //初始化通用附件
  1088. TalentAllowanceInfoDlg.initCommonFileTable = function () {
  1089. var queryData = {};
  1090. queryData.id = $("#id").val();
  1091. $("#commonFileTable").bootstrapTable({
  1092. url: Feng.ctxPath + "/common/api/listTalentAllowanceCommonFile",
  1093. method: 'POST',
  1094. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  1095. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  1096. showRefresh: false, // 是否显示刷新按钮
  1097. clickToSelect: true, // 是否启用点击选中行
  1098. singleSelect: true, // 设置True 将禁止多选
  1099. striped: true, // 是否显示行间隔色
  1100. pagination: false, // 设置为 true 会在表格底部显示分页条
  1101. paginationHAlign: "left",
  1102. paginationDetailHAlign: "right",
  1103. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  1104. showColumns: false,
  1105. queryParams: function (params) {
  1106. return $.extend(queryData, params)
  1107. },
  1108. rowStyle: function (row, index) {
  1109. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  1110. },
  1111. columns: [
  1112. {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '60%', formatter: function (value, row, index) {
  1113. return value;
  1114. }},
  1115. {title: '附件类型', field: 'fileTypeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '20%', formatter: function (value, row, index) {
  1116. return value;
  1117. }},
  1118. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', width: "20%",
  1119. formatter: function (value, row, index) {
  1120. var sn = value.lastIndexOf(".");
  1121. var suffix = value.substring(sn + 1, value.length);
  1122. var imgStr = "";
  1123. if (suffix == "pdf" || suffix == "PDF") {
  1124. 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>";
  1125. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  1126. 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>";
  1127. } else {
  1128. imgStr = '<img class=\"cImgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  1129. }
  1130. return imgStr;
  1131. }
  1132. }
  1133. ],
  1134. onPostBody: function () {
  1135. $("td.uitd_showTip").bind("mouseover", function () {
  1136. var htm = $(this).html();
  1137. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  1138. });
  1139. $(".cImgUrl").viewer({fullscreen: false});
  1140. }
  1141. });
  1142. }
  1143. TalentAllowanceInfoDlg.showAllLog = function () {
  1144. var id = $("#id").val();
  1145. if (Feng.isNotEmptyStr(id)) {
  1146. Feng.getCheckLog("logTable", {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
  1147. }
  1148. }
  1149. $(function () {
  1150. if ($("#type").val() == 2) {
  1151. $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style", "display:none");
  1152. }
  1153. $("select").each(function () {
  1154. $(this).val($(this).attr("value"));
  1155. });
  1156. TalentAllowanceInfoDlg.initFileTable();
  1157. TalentAllowanceInfoDlg.initContract();
  1158. TalentAllowanceInfoDlg.initCommonFileTable();
  1159. //批量加载时间控件
  1160. $(".date").each(function () {
  1161. laydate.render({elem: "#" + $(this).attr("id"), type: 'date', trigger: 'click'});
  1162. });
  1163. TalentAllowanceInfoDlg.showAllLog();
  1164. });