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