talentQuit.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 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:"150px",'class': 'uitd_showTip'},
  24. {title: '离职企业', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  25. {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  26. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  27. {title: '认定时间', field: 'identifyTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  28. {title: '合同开始时间', field: 'starttime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  29. {title: '合同结束时间', field: 'endtime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  30. {title: '离职时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  31. {title: '离职申报原因', field: 'quitReason', visible: isShow, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  32. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"80px",
  33. formatter : function (value,row,index) {
  34. if(value==-1){
  35. return '<span class=\'label\'>待提交</span>';
  36. }if(value==1){
  37. return '<span class=\'label label-success\'>待审核</span>';
  38. }if(value==2){
  39. return '<span class=\'label label-danger\'>已驳回</span>';
  40. }if(value==3){
  41. return '<span class=\'label label-primary\'>已通过</span>';
  42. }if(value==9){
  43. return '<span class=\'label label-success\'>重新提交</span>';
  44. }
  45. }
  46. },
  47. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  48. formatter: function (value,row,index) {
  49. return "<span class='label label-success' onclick=\"TalentQuit.showLog('"+value+"')\" >" +
  50. "<i class=\"fa fa-book\"></i>日志" +
  51. "</span>";
  52. }
  53. },
  54. ];
  55. };
  56. /**
  57. * 检查是否选中
  58. */
  59. TalentQuit.check = function () {
  60. var selected = $('#' + this.id).bootstrapTable('getSelections');
  61. if(selected.length == 0){
  62. Feng.info("请先选中表格中的某一记录!");
  63. return false;
  64. }else{
  65. TalentQuit.seItem = selected[0];
  66. return true;
  67. }
  68. };
  69. /**
  70. * 打开查看离职管理审核页面
  71. */
  72. TalentQuit.openTalentQuitCheck = function () {
  73. if (this.check()) {
  74. if(TalentQuit.seItem.checkState!=1 && TalentQuit.seItem.checkState!=9){
  75. Feng.info("不在审核范围内");
  76. return ;
  77. }
  78. var index = layer.open({
  79. type: 2,
  80. title: '离职管理审核',
  81. fix: false, //不固定
  82. maxmin: true,
  83. content: Feng.ctxPath + '/talentQuit/talentQuit_check/' + TalentQuit.seItem.id,
  84. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  85. btnAlign: 'c',
  86. yes: function (index, layero) {
  87. var obj = layero.find("iframe")[0].contentWindow;
  88. obj.TalentQuitInfoDlg.submitCheck();
  89. }
  90. });
  91. TalentQuit.layerIndex = index;
  92. layer.full(index);
  93. }
  94. };
  95. /**
  96. * 打开查看离职管理页面
  97. */
  98. TalentQuit.openTalentQuitDetail = function () {
  99. if (this.check()) {
  100. var index = layer.open({
  101. type: 2,
  102. title: '离职管理详情',
  103. fix: false, //不固定
  104. maxmin: true,
  105. content: Feng.ctxPath + '/talentQuit/talentQuit_check/' + TalentQuit.seItem.id
  106. });
  107. TalentQuit.layerIndex = index;
  108. layer.full(index);
  109. }
  110. };
  111. /**
  112. * 查询表单提交参数对象
  113. * @returns {{}}
  114. */
  115. TalentQuit.formParams = function() {
  116. var queryData = {};
  117. queryData['talentName'] = $("#talentName").val();
  118. queryData['idCard'] = $("#idCard").val();
  119. queryData['enterpriseName'] = $("#enterpriseName").val();
  120. queryData['talentArrange'] = $("#talentArrange").val();
  121. queryData['checkState'] = $("#checkState").val();
  122. return queryData;
  123. }
  124. /**
  125. * 重置
  126. */
  127. TalentQuit.reset = function (){
  128. $("#talentName").val("");
  129. $("#idCard").val("");
  130. $("#enterpriseName").val("");
  131. $("#talentArrange").val("");
  132. $("#checkState").val("");
  133. }
  134. /**
  135. * 查询离职管理列表
  136. */
  137. TalentQuit.search = function () {
  138. TalentQuit.table.refresh({query: TalentQuit.formParams()});
  139. };
  140. /**
  141. * 导出
  142. */
  143. TalentQuit.export = function (){
  144. var queryData = TalentQuit.formParams();
  145. var url = Feng.ctxPath + "/talentQuit/export?" +
  146. "&talentName=" + queryData.talentName +
  147. "&idCard=" + queryData.idCard +
  148. "&enterpriseName=" + queryData.enterpriseName +
  149. "&talentArrange=" + queryData.talentArrange +
  150. "&checkState=" + queryData.checkState ;
  151. window.location.href = encodeURI(encodeURI(url));
  152. }
  153. /**
  154. * 打包下载附件
  155. */
  156. TalentQuit.download = function () {
  157. if (this.check()) {
  158. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadZip?type=3&id="+TalentQuit.seItem.id));
  159. }
  160. }
  161. /**
  162. * 显示审核日志
  163. */
  164. TalentQuit.showLog = function (id){
  165. layer.open({
  166. type: 1,
  167. title:"日志",
  168. fixed:false,
  169. content: '<table id="'+id+'"></table>',
  170. area: ['80%', '80%'],
  171. maxmin: true,
  172. success :function (layero, index) {
  173. Feng.getCheckLog(id,{"type":CONFIG.project_quit,"mainId":id,"typeFileId":"","active":1})
  174. }
  175. });
  176. }
  177. $(function () {
  178. var defaultColunms = TalentQuit.initColumn();
  179. var table = new BSTable(TalentQuit.id, "/talentQuit/list", defaultColunms);
  180. table.setPaginationType("server");
  181. TalentQuit.table = table.init();
  182. Feng.addAjaxSelect({
  183. "id": 'talentArrange',
  184. "displayCode": "code",
  185. "displayName": "name",
  186. "type": "GET",
  187. "url": Feng.ctxPath + "/api/common/findChildDictByCode?code=un_talentLevel"
  188. });
  189. });