talentWorkunitChange.js 8.6 KB

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