talentWorkunitChange.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /**
  2. * 工作单位变更管理初始化
  3. */
  4. var TalentWorkunitChange = {
  5. id: "TalentWorkunitChangeTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentWorkunitChange.initColumn = function () {
  14. var type = $("#type").val();
  15. var isShow = true;
  16. if (type == 2) {
  17. isShow = false;
  18. }
  19. return [
  20. {field: 'selectItem', radio: true},
  21. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  22. {title: '姓名', field: 'talentName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  23. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  24. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  25. {title: '原工作单位', field: 'oldEnterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  26. {title: '离职时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  27. {title: '离职申报原因', field: 'quitReason', visible: isShow, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  28. {title: '新单位', field: 'newEnterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  29. {title: '合同开始时间', field: 'starttime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  30. {title: '合同结束时间', field: 'endtime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  31. {title: '手机号码', field: 'phone', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  32. {title: '入职/变更时间', field: 'anyTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  33. {title: '单位变更申报原因', field: 'anyReason', visible: isShow, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  34. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip',
  35. formatter: function (value, row, index) {
  36. if (value == -2) {
  37. return '<span class=\'label label-danger\'>审核不通过</span>';
  38. }
  39. if (value == -1) {
  40. return '<span class=\'label\'>待提交</span>';
  41. }
  42. if (value == 1) {
  43. return '<span class=\'label label-success\'>待审核</span>';
  44. }
  45. if (value == 2) {
  46. return '<span class=\'label label-danger\'>审核驳回</span>';
  47. }
  48. if (value == 3) {
  49. return '<span class=\'label label-primary\'>已通过</span>';
  50. }
  51. if (value == 9) {
  52. return '<span class=\'label label-success\'>重新提交</span>';
  53. }
  54. }
  55. },
  56. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  57. formatter: function (value, row, index) {
  58. return "<span class='label label-success' onclick=\"TalentWorkunitChange.showLog('" + value + "')\" >" +
  59. "<i class=\"fa fa-book\"></i>日志" +
  60. "</span>";
  61. }
  62. },
  63. ];
  64. };
  65. /**
  66. * 检查是否选中
  67. */
  68. TalentWorkunitChange.check = function () {
  69. var selected = $('#' + this.id).bootstrapTable('getSelections');
  70. if (selected.length == 0) {
  71. Feng.info("请先选中表格中的某一记录!");
  72. return false;
  73. } else {
  74. TalentWorkunitChange.seItem = selected[0];
  75. return true;
  76. }
  77. };
  78. /**
  79. * 点击工作单位变更审核
  80. */
  81. TalentWorkunitChange.openTalentWorkunitChangeCheck = function () {
  82. if (this.check()) {
  83. if (TalentWorkunitChange.seItem.checkState != 1 && TalentWorkunitChange.seItem.checkState != 9) {
  84. Feng.error("不在审核范围内 ");
  85. return;
  86. }
  87. var index = layer.open({
  88. type: 2,
  89. title: '工作单位变更审核',
  90. area: ['800px', '420px'], //宽高
  91. fix: false, //不固定
  92. maxmin: true,
  93. content: Feng.ctxPath + '/admin/talentWorkUnitChange/check/id/' + TalentWorkunitChange.seItem.id,
  94. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  95. btnAlign: 'c',
  96. yes: function (index, layero) {
  97. var obj = layero.find("iframe")[0].contentWindow;
  98. obj.TalentWorkunitChangeInfoDlg.submitCheck();
  99. }, end: function () {
  100. TalentWorkunitChange.table.refresh();
  101. }
  102. });
  103. TalentWorkunitChange.layerIndex = index;
  104. layer.full(index);
  105. }
  106. };
  107. /**
  108. * 打开查看工作单位变更详情
  109. */
  110. TalentWorkunitChange.openTalentWorkunitChangeDetail = function () {
  111. if (this.check()) {
  112. var index = layer.open({
  113. type: 2,
  114. title: '工作单位变更详情',
  115. area: ['800px', '420px'], //宽高
  116. fix: false, //不固定
  117. maxmin: true,
  118. content: Feng.ctxPath + '/admin/talentWorkUnitChange/check/id/' + TalentWorkunitChange.seItem.id,
  119. });
  120. TalentWorkunitChange.layerIndex = index;
  121. layer.full(index);
  122. }
  123. };
  124. /**
  125. * 查询表单提交参数对象
  126. * @returns {{}}
  127. */
  128. TalentWorkunitChange.formParams = function () {
  129. var queryData = {};
  130. queryData['talentName'] = $("#talentName").val();
  131. queryData['idCard'] = $("#idCard").val();
  132. queryData['oldEnterpriseName'] = $("#oldEnterpriseName").val();
  133. //queryData['oldTalentType'] = $("#oldTalentType").val();
  134. queryData['newEnterpriseName'] = $("#newEnterpriseName").val();
  135. //queryData['newTalentType'] = $("#newTalentType").val();
  136. queryData['checkState'] = $("#checkState").val();
  137. return queryData;
  138. }
  139. /**
  140. * 重置
  141. */
  142. TalentWorkunitChange.reset = function () {
  143. $("#talentName").val("");
  144. $("#idCard").val("");
  145. $("#oldEnterpriseName").val("");
  146. //$("#oldTalentType").val("");
  147. $("#newEnterpriseName").val("");
  148. //$("#newTalentType").val("");
  149. $("#checkState").val("");
  150. }
  151. /**
  152. * 查询工作单位变更列表
  153. */
  154. TalentWorkunitChange.search = function () {
  155. TalentWorkunitChange.table.refresh({query: TalentWorkunitChange.formParams()});
  156. };
  157. /**
  158. * 导出
  159. */
  160. TalentWorkunitChange.export = function () {
  161. var queryData = TalentWorkunitChange.formParams();
  162. var url = Feng.ctxPath + "/talentWorkunitChange/export?" +
  163. "&talentName=" + queryData.talentName +
  164. "&idCard=" + queryData.idCard +
  165. "&oldEnterpriseName=" + queryData.oldEnterpriseName +
  166. "&newEnterpriseName=" + queryData.newEnterpriseName +
  167. "&checkState=" + queryData.checkState;
  168. window.location.href = encodeURI(encodeURI(url));
  169. }
  170. /**
  171. * 打包下载附件
  172. */
  173. TalentWorkunitChange.download = function () {
  174. if (this.check()) {
  175. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=4&id=" + TalentWorkunitChange.seItem.id));
  176. }
  177. }
  178. /**
  179. * 显示审核日志
  180. */
  181. TalentWorkunitChange.showLog = function (id) {
  182. layer.open({
  183. type: 1,
  184. title: "日志",
  185. fixed: false,
  186. content: '<table id="' + id + '"></table>',
  187. area: ['80%', '80%'],
  188. maxmin: true,
  189. success: function (layero, index) {
  190. Feng.getCheckLog(id, {"type": CONFIG.project_workchange, "mainId": id, "typeFileId": "", "active": 1});
  191. }
  192. });
  193. }
  194. $(function () {
  195. var defaultColunms = TalentWorkunitChange.initColumn();
  196. var table = new BSTable(TalentWorkunitChange.id, "/admin/talentWorkUnitChange/list", defaultColunms);
  197. table.setPaginationType("server");
  198. TalentWorkunitChange.table = table.init();
  199. });