talentAllowanceInfo_public_check.js 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  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. }
  753. if (type == 2) {
  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['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: '70%', formatter: function (value, row, index) {
  1110. return value;
  1111. }},
  1112. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', width: "20%",
  1113. formatter: function (value, row, index) {
  1114. var sn = value.lastIndexOf(".");
  1115. var suffix = value.substring(sn + 1, value.length);
  1116. var imgStr = "";
  1117. if (suffix == "pdf" || suffix == "PDF") {
  1118. 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>";
  1119. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  1120. 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>";
  1121. } else {
  1122. imgStr = '<img class=\"cImgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  1123. }
  1124. return imgStr;
  1125. }
  1126. },
  1127. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '10%',
  1128. formatter: function (value, row, index) {
  1129. return "";
  1130. }
  1131. }
  1132. ],
  1133. onPostBody: function () {
  1134. $("td.uitd_showTip").bind("mouseover", function () {
  1135. var htm = $(this).html();
  1136. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  1137. });
  1138. $(".cImgUrl").viewer({fullscreen: false});
  1139. }
  1140. });
  1141. }
  1142. TalentAllowanceInfoDlg.showAllLog = function () {
  1143. var id = $("#id").val();
  1144. if (Feng.isNotEmptyStr(id)) {
  1145. Feng.getCheckLog("logTable", {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
  1146. }
  1147. }
  1148. $(function () {
  1149. if ($("#type").val() == 2) {
  1150. $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style", "display:none");
  1151. }
  1152. $("select").each(function () {
  1153. $(this).val($(this).attr("value"));
  1154. });
  1155. TalentAllowanceInfoDlg.initFileTable();
  1156. TalentAllowanceInfoDlg.initContract();
  1157. TalentAllowanceInfoDlg.initCommonFileTable();
  1158. //批量加载时间控件
  1159. $(".date").each(function () {
  1160. laydate.render({elem: "#" + $(this).attr("id"), type: 'date', trigger: 'click'});
  1161. });
  1162. TalentAllowanceInfoDlg.showAllLog();
  1163. });