closeAccount.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /**
  2. * 离职管理管理初始化
  3. */
  4. var TalentQuit = {
  5. id: "TalentQuitTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentQuit.initColumn = function () {
  14. var type = $("#type").val();
  15. var idCardTypeName = "统一社会信用代码";
  16. var coTypeName = "企业/单位名称";
  17. switch (type) {
  18. case 5:
  19. idCardTypeName = "登记号";
  20. coTypeName = "医院名称";
  21. break;
  22. case 6:
  23. coTypeName = "学校名称";
  24. break;
  25. }
  26. if (type == 5) {
  27. idCardTypeName = "登记号";
  28. }
  29. return [
  30. {field: 'selectItem', radio: true},
  31. {title: coTypeName, field: 'name', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  32. {title: idCardTypeName, field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  33. {title: '账号', field: 'username', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  34. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  35. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  36. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "80px",
  37. formatter: function (value, row, index) {
  38. if (value == -1) {
  39. return '<span class=\'label\'>待提交</span>';
  40. }
  41. if (value == 1) {
  42. return '<span class=\'label label-success\'>待审核</span>';
  43. }
  44. if (value == 2) {
  45. return '<span class=\'label label-danger\'>已驳回</span>';
  46. }
  47. if (value == 3) {
  48. return '<span class=\'label label-primary\'>已通过</span>';
  49. }
  50. if (value == 9) {
  51. return '<span class=\'label label-success\'>重新提交</span>';
  52. }
  53. }
  54. },
  55. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  56. formatter: function (value, row, index) {
  57. return "<span class='label label-success' onclick=\"TalentQuit.showLog('" + value + "')\" >" +
  58. "<i class=\"fa fa-book\"></i>日志" +
  59. "</span>";
  60. }
  61. },
  62. ];
  63. };
  64. /**
  65. * 检查是否选中
  66. */
  67. TalentQuit.check = function () {
  68. var selected = $('#' + this.id).bootstrapTable('getSelections');
  69. if (selected.length == 0) {
  70. Feng.info("请先选中表格中的某一记录!");
  71. return false;
  72. } else {
  73. TalentQuit.seItem = selected[0];
  74. return true;
  75. }
  76. };
  77. /**
  78. * 打开查看离职管理审核页面
  79. */
  80. TalentQuit.openTalentQuitCheck = function () {
  81. if (this.check()) {
  82. if (TalentQuit.seItem.checkState != 1 && TalentQuit.seItem.checkState != 9) {
  83. Feng.info("不在审核范围内");
  84. return;
  85. }
  86. var index = layer.open({
  87. type: 2,
  88. title: '账号注销审核',
  89. fix: false, //不固定
  90. maxmin: true,
  91. content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.seItem.id,
  92. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  93. btnAlign: 'c',
  94. yes: function (index, layero) {
  95. var obj = layero.find("iframe")[0].contentWindow;
  96. obj.TalentQuitInfoDlg.submitCheck();
  97. }
  98. });
  99. TalentQuit.layerIndex = index;
  100. layer.full(index);
  101. }
  102. };
  103. /**
  104. * 打开查看离职管理页面
  105. */
  106. TalentQuit.openTalentQuitDetail = function () {
  107. if (this.check()) {
  108. var index = layer.open({
  109. type: 2,
  110. title: '账号注销详情',
  111. fix: false, //不固定
  112. maxmin: true,
  113. content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.seItem.id
  114. });
  115. TalentQuit.layerIndex = index;
  116. layer.full(index);
  117. }
  118. };
  119. /**
  120. * 查询表单提交参数对象
  121. * @returns {{}}
  122. */
  123. TalentQuit.formParams = function () {
  124. var queryData = {};
  125. queryData['talentName'] = $("#talentName").val();
  126. queryData['idCard'] = $("#idCard").val();
  127. queryData['enterpriseName'] = $("#enterpriseName").val();
  128. queryData['talentArrange'] = $("#talentArrange").val();
  129. queryData['checkState'] = $("#checkState").val();
  130. return queryData;
  131. }
  132. /**
  133. * 重置
  134. */
  135. TalentQuit.reset = function () {
  136. $("#talentName").val("");
  137. $("#idCard").val("");
  138. $("#enterpriseName").val("");
  139. $("#talentArrange").val("");
  140. $("#checkState").val("");
  141. }
  142. /**
  143. * 查询离职管理列表
  144. */
  145. TalentQuit.search = function () {
  146. TalentQuit.table.refresh({query: TalentQuit.formParams()});
  147. };
  148. /**
  149. * 导出
  150. */
  151. TalentQuit.export = function () {
  152. var queryData = TalentQuit.formParams();
  153. var url = Feng.ctxPath + "/admin/enterpriseCloseAccount/export?" +
  154. "&talentName=" + queryData.talentName +
  155. "&idCard=" + queryData.idCard +
  156. "&enterpriseName=" + queryData.enterpriseName +
  157. "&talentArrange=" + queryData.talentArrange +
  158. "&checkState=" + queryData.checkState;
  159. window.location.href = encodeURI(encodeURI(url));
  160. }
  161. /**
  162. * 打包下载附件
  163. */
  164. TalentQuit.download = function () {
  165. if (this.check()) {
  166. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=109&id=" + TalentQuit.seItem.id));
  167. }
  168. }
  169. /**
  170. * 显示审核日志
  171. */
  172. TalentQuit.showLog = function (id) {
  173. layer.open({
  174. type: 1,
  175. title: "日志",
  176. fixed: false,
  177. content: '<table id="' + id + '"></table>',
  178. area: ['80%', '80%'],
  179. maxmin: true,
  180. success: function (layero, index) {
  181. Feng.getCheckLog(id, {"type": 10, "mainId": id, "typeFileId": "", "active": 1, "category": "close_account"})
  182. }
  183. });
  184. }
  185. $(function () {
  186. var defaultColunms = TalentQuit.initColumn();
  187. var table = new BSTable(TalentQuit.id, "/admin/enterpriseCloseAccount/list", defaultColunms);
  188. table.setPaginationType("server");
  189. TalentQuit.table = table.init();
  190. });