talentAllowanceInfo_public_check.js 60 KB

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