talentAllowance_info_supple.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. //回调
  2. TalentAllowanceInfoDlg.callBack = function (data) {
  3. layer.close(data.obj);
  4. Feng.info(data.msg);
  5. if (data.code == 200) {
  6. $("#fileTable").bootstrapTable("refresh", {});
  7. }
  8. }
  9. //全选
  10. TalentAllowanceInfoDlg.newCheckAll = function (id, obj) {
  11. var checked = $(obj).is(":checked");
  12. if (checked) {
  13. $("#m" + id + " input[name=month]").each(function () {
  14. $(this).prop("checked", "checked");
  15. })
  16. } else {
  17. $("#m" + id + " input[name=month]").each(function () {
  18. $(this).removeAttr("checked");
  19. })
  20. }
  21. }
  22. //全选
  23. TalentAllowanceInfoDlg.checkAll = function (id) {
  24. $("#" + id + " input").each(function () {
  25. $(this).iCheck("check");
  26. })
  27. }
  28. //反选
  29. TalentAllowanceInfoDlg.unCheckAll = function (id) {
  30. $("#" + id + " input").each(function () {
  31. if (this.checked) {
  32. $(this).iCheck("uncheck");
  33. } else {
  34. $(this).iCheck("check");
  35. }
  36. })
  37. }
  38. //初始化工作单位表的列
  39. TalentAllowanceInfoDlg.initContractColumns = function () {
  40. var type = $("#type").val();
  41. var checkState = $("#checkState").val();
  42. var concats = $("#concats").val();
  43. if (type == 1) {
  44. return [
  45. {field: 'selectItem', checkbox: false, visible: false},
  46. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  47. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  48. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  49. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  50. {title: '离职时间(未离职则模拟离职)', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  51. {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  52. {title: '首次来晋行政介绍信时间', field: 'letterTime', visible: true, align: 'center', valign: 'middle', width: "120px"},
  53. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "120px",
  54. formatter: function (value, row, index) {
  55. var html = "";
  56. if (checkState == 1 || (checkState == 10 && concats.indexOf(value) != -1)) {
  57. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-left: 5px' class='btn btn-xs btn-danger'>" +
  58. "<i class=\"fa fa-edit\"></i>修改" +
  59. "</button>";
  60. }
  61. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' style='margin-left: 5px' class='btn btn-xs btn-success'>" +
  62. "<i class=\"fa fa-book\"></i>日志" +
  63. "</button>";
  64. return html;
  65. }
  66. }
  67. ];
  68. }
  69. if (type == 2) {
  70. return [
  71. {field: 'selectItem', checkbox: false, visible: false},
  72. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  73. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "120px"},
  74. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  75. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  76. {title: '离职时间(未离职则模拟离职)', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  77. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "120px",
  78. formatter: function (value, row, index) {
  79. var html = "";
  80. if (checkState == 1 || (checkState == 10 && concats.indexOf(value) != -1)) {
  81. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-left: 5px' class='btn btn-xs btn-danger'>" +
  82. "<i class=\"fa fa-edit\"></i>修改" +
  83. "</button>";
  84. }
  85. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' style='margin-left: 5px' class='btn btn-xs btn-success'>" +
  86. "<i class=\"fa fa-book\"></i>日志" +
  87. "</button>";
  88. return html;
  89. }
  90. }
  91. ];
  92. }
  93. }
  94. //初始化项目表的列
  95. TalentAllowanceInfoDlg.initProjectColumns = function () {
  96. return [
  97. {field: 'selectItem', checkbox: false, visible: false},
  98. {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
  99. {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%",
  100. formatter: function (value, row, index) {
  101. var html = TalentAllowanceInfoDlg.createMonthSelector(row.project, row.id, row.enterpriseId, value);
  102. if (row.days != null && row.days != '') {
  103. }
  104. return html;
  105. }
  106. },
  107. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "25%",
  108. formatter: function (value, row, index) {
  109. var html = '<textarea id="d' + row.id + '" class="form-control">' + (value ? value : "") + '</textarea>';
  110. return html;
  111. }
  112. },
  113. {title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle', width: "15%",
  114. formatter: function (value, row, index) {
  115. var butHtml = "";
  116. if (row.isEdit == 1) {
  117. /*butHtml = butHtml + "<button type='button' data-value='" + (row.description ? row.description : "") + "' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('" + row.project + "','" + row.id + "','" + row.enterpriseId + "','" + row.months + "','" + row.days + "',this)\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
  118. "<i class=\"fa fa-edit\"></i>修改</button>";*/
  119. butHtml = butHtml + "<button type='button' onclick=\"TalentAllowanceInfoDlg.saveProjectData('" + row.id + "')\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
  120. "<i class=\"fa fa-edit\"></i>保存</button>";
  121. }
  122. butHtml = butHtml + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' style='margin-left: 5px' class='btn btn-xs btn-success'><i class=\"fa fa-book\"></i>日志</button>";
  123. return butHtml;
  124. }
  125. }
  126. ];
  127. }
  128. TalentAllowanceInfoDlg.createMonthSelector = function (project, id, enterpriseId, selectMonths) {
  129. var monthArr = selectMonths ? selectMonths.split(",") : [];
  130. var html = '<div id="m' + id + '" class="month-selector"><ul><li><input type="checkbox" onchange="TalentAllowanceInfoDlg.newCheckAll(' + id + ',this)">全选</li>';
  131. for (var m = 1; m <= 12; m++) {
  132. var month = m < 10 ? "0" + m : m;
  133. var checked = "";
  134. if (monthArr.indexOf(month.toString()) > -1) {
  135. checked = "checked";
  136. }
  137. html += '<li><input type="checkbox" name="month" value="' + month + '" ' + checked + '>' + month + '月</li>';
  138. }
  139. html += '</ul></div>'
  140. return html;
  141. }
  142. /**
  143. * 初始化附件类别表的列
  144. */
  145. TalentAllowanceInfoDlg.initFileTypeColumn = function () {
  146. return [
  147. {field: 'selectItem', checkbox: false, visible: false},
  148. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%", 'class': 'uitd_showTip',
  149. formatter: function (value, row, index) {
  150. if (row.must == 1) {
  151. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  152. }
  153. if (row.must == 2) {
  154. return '<i class="fa fa-paste"></i>' + value;
  155. }
  156. }
  157. },
  158. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  159. formatter: function (value, row, index) {
  160. if (value == null || value == '' || value == 'null') {
  161. return '无';
  162. }
  163. return "<button type='button' onclick=\"Feng.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  164. "<i class=\"fa fa-download\"></i>下载" +
  165. "</button>";
  166. }
  167. },
  168. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip'},
  169. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "10%",
  170. formatter: function (value, row, index) {
  171. var files = $("#files").val();
  172. var checkState = $("#checkState").val();
  173. if (checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) {
  174. return "<button type='button' onclick=\"TalentAllowanceInfoDlg.checkFile(this,'" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  175. "<i class=\"fa fa-upload\"></i>添加" +
  176. "</button>";
  177. } else {
  178. return "";
  179. }
  180. }
  181. }
  182. ]
  183. };
  184. TalentAllowanceInfoDlg.showLog = function (id) {
  185. layer.open({
  186. type: 1,
  187. title: "日志",
  188. fixed: false,
  189. content: '<table id="' + id + '"></table>',
  190. area: ['80%', '80%'],
  191. maxmin: true,
  192. success: function (layero, index) {
  193. $('#' + id).bootstrapTable({
  194. url: Feng.ctxPath + "/common/api/getJbtCheckLog",
  195. method: 'POST',
  196. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  197. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  198. showRefresh: false, // 是否显示刷新按钮
  199. clickToSelect: true, // 是否启用点击选中行
  200. singleSelect: true, // 设置True 将禁止多选
  201. striped: true, // 是否显示行间隔色
  202. pagination: false, // 设置为 true 会在表格底部显示分页条
  203. paginationHAlign: "left",
  204. paginationDetailHAlign: "right",
  205. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  206. showColumns: false,
  207. queryParams: function (params) {
  208. return {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": id, "active": 1}
  209. },
  210. columns:
  211. [
  212. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  213. formatter: function (value, row, index) {
  214. return "" + value;
  215. }
  216. },
  217. {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle', width: "15%"},
  218. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  219. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "45%",
  220. formatter: function (value, row, index) {
  221. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  222. }
  223. }
  224. ]
  225. ,
  226. onPostBody: function () {
  227. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  228. var htm = $(this).html();
  229. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  230. });
  231. }
  232. });
  233. }
  234. });
  235. }