talentInfo_library.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. /**
  2. * 人才认定申报管理初始化
  3. */
  4. var TalentInfo = {
  5. id: "TalentInfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentInfo.initColumn = function () {
  14. var type = $("#usertype").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'},
  22. {title: '离职状态', field: 'active', visible: true, align: 'center', valign: 'middle',width:'80px',
  23. formatter : function (value,row,index) {
  24. if(value==1){
  25. return '<span style="color:#6495ED">在职</span>';
  26. }if(value==2){
  27. return '<span style="color:#FF82AB">离职</span>';
  28. }
  29. }
  30. },
  31. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:'150px'},
  32. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:'120px',
  33. formatter : function(value,row,index){
  34. if(row.sex==1){
  35. return value+'<span style="color:#6495ED">【男】</span>';
  36. }if(row.sex==2){
  37. return value+'<span style="color:#FF82AB">【女】</span>';
  38. }
  39. }
  40. },
  41. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:'100px'},
  42. {title: '人才标签', field: 'talentTypeName', visible: isShow, align: 'center', valign: 'middle',width:'100px'},
  43. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'150px','class': 'uitd_showTip'},
  44. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px'},
  45. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
  46. {title: '人才证书有效期', field: 'identifyGetTime', visible: isShow, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'150px',
  47. formatter:function (value,row,index) {
  48. return row.certificateStartTime + "至" + row.qzgccrcActiveTime ;
  49. }
  50. },
  51. {title: '公布入选月份',field: 'identifyMonth',visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
  52. {title: '人才编号', field: 'certificateNO', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:'100px'},
  53. {title: '是否过期', field: 'isEffect', visible: isShow, align: 'center', valign: 'middle',width:'120px',
  54. formatter : function (value,row,index){
  55. if(value==1){
  56. return '有效';
  57. }else if(value == 4){
  58. return "失效";
  59. }else{
  60. return "已过期";
  61. }
  62. }
  63. },
  64. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:'80px',
  65. formatter : function (value,row,index){
  66. return "<span class='label label-success' onclick=\"TalentInfo.showLog('"+value+"')\" >" +
  67. "<i class=\"fa fa-book\"></i>日志" +
  68. "</span>";
  69. }
  70. }
  71. ];
  72. };
  73. /**
  74. * 检查是否选中
  75. */
  76. TalentInfo.check = function () {
  77. var selected = $('#' + this.id).bootstrapTable('getSelections');
  78. if(selected.length == 0){
  79. Feng.info("请先选中表格中的某一记录!");
  80. return false;
  81. }else{
  82. TalentInfo.seItem = selected[0];
  83. return true;
  84. }
  85. };
  86. /**
  87. * 打开查看人才认定-初级审核详情
  88. */
  89. TalentInfo.openTalentInfoDetail = function () {
  90. if (this.check()) {
  91. var index = layer.open({
  92. type: 2,
  93. title: '人才认定申报详情',
  94. area: ['800px', '420px'], //宽高
  95. fix: false, //不固定
  96. maxmin: true,
  97. content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id+'/5'
  98. });
  99. layer.full(index);
  100. TalentInfo.layerIndex = index;
  101. }
  102. };
  103. //取消优秀人才
  104. TalentInfo.cancle = function(){
  105. if(this.check()){
  106. if(TalentInfo.seItem.isEffect == 4){
  107. Feng.info("无法重复取消");
  108. return ;
  109. }
  110. var operation = function(){
  111. var ajax = new $ax(Feng.ctxPath + "/talentInfo/removeFromLibrary", function (data) {
  112. if(data.code==200){
  113. Feng.success(data.msg);
  114. TalentInfo.table.refresh();
  115. }else{
  116. Feng.error(data.msg);
  117. }
  118. }, function (data) {
  119. Feng.error("取消优秀人才失败!" + data.responseJSON.message + "!");
  120. });
  121. ajax.setData({"id":TalentInfo.seItem.id});
  122. ajax.start();
  123. }
  124. Feng.confirm("一旦取消将无法恢复,确认取消吗?", operation);
  125. }
  126. }
  127. /**
  128. * 恢复优秀人才
  129. */
  130. TalentInfo.recovery = function(){
  131. if(this.check()){
  132. if(TalentInfo.seItem.isEffect != 4){
  133. Feng.info("无法恢复有效数据");
  134. return ;
  135. }
  136. var operation = function(){
  137. var ajax = new $ax(Feng.ctxPath + "/talentInfo/recovery", function (data) {
  138. if(data.code==200){
  139. Feng.success(data.msg);
  140. TalentInfo.table.refresh();
  141. }else{
  142. Feng.error(data.msg);
  143. }
  144. }, function (data) {
  145. Feng.error("恢复优秀人才失败!" + data.responseJSON.message + "!");
  146. });
  147. ajax.setData({"id":TalentInfo.seItem.id});
  148. ajax.start();
  149. }
  150. Feng.confirm("确认恢复吗?", operation);
  151. }
  152. }
  153. //公示导出
  154. TalentInfo.showExportModal = function(){
  155. $("#exportForm")[0].reset();
  156. $("#exportModal").modal("show");
  157. }
  158. //公示导出提交
  159. TalentInfo.export = function(){
  160. var names = '';
  161. var values = '';
  162. $("#field_info li input").each(function(index){
  163. if($(this).is(":checked")){
  164. values = values + $(this).val() + ",";
  165. names = names + $(this).next().text() + ",";
  166. }
  167. });
  168. var name = $("#name").val();
  169. var sex = $("#sex").val();
  170. var idCard = $("#idCard").val();
  171. var nation = $("#nation").val();
  172. var nationality = $("#nationality").val();
  173. var talentType = $("#talentType").val();
  174. var talentArrange = $("#talentArrange").val();
  175. var active = $("#active").val();
  176. $("#exportModal").modal('hide');
  177. var url = Feng.ctxPath + "/talentInfoExport/libraryExport?name="+name+"&names="+names+"&values="+values
  178. +"&sex="+sex+"&idCard="+idCard+"&nation="+nation+"&nationality="+nationality
  179. +"&talentType="+talentType+"&talentArrange="+talentArrange+"&active="+active;
  180. window.location.href = encodeURI(encodeURI(url));
  181. }
  182. TalentInfo.editBasicInfo = function(){
  183. if(this.check()){
  184. layer.open({
  185. type: 1,
  186. id:"neewFieldFormModel",
  187. title: '审核',
  188. area: ['800px', '450px'], //宽高
  189. fix: false, //不固定
  190. shade:0,
  191. maxmin: true,
  192. content:'<form id="editBaiscInfo">' +
  193. ' <div class="form-group" style="margin: 10px;">' +
  194. ' <label for="checkMsgNotPass" class="control-label" >引进方式</label>' +
  195. ' <select class="form-control" id="introduceMode"></select>' +
  196. ' </div>' +
  197. ' <div class="form-group" style="margin: 10px;">' +
  198. ' <label for="checkMsgNotPass" class="control-label" >是否同步至津补贴申报</label>' +
  199. ' <select class="form-control" id="isSync">' +
  200. ' <option value="2">否</option> '+
  201. ' <option value="1">是</option> '+
  202. ' </select>' +
  203. ' </div>' +
  204. ' </form>',
  205. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  206. btnAlign: 'c',
  207. zIndex: layer.zIndex,
  208. success:function(layero, index){
  209. var arr = [{"name":"introduceMode","code":"un_introduction_mode"}];
  210. Feng.findChildDictBatch(JSON.stringify(arr));
  211. },
  212. yes: function (index, layero) {
  213. var introduceMode = $("#introduceMode").val();
  214. var isSync = $("#isSync").val();
  215. if(Feng.isEmptyStr(introduceMode)){
  216. Feng.info("请选择引进方式");return ;
  217. }
  218. var operation = function(){
  219. var ajax = new $ax(Feng.ctxPath + "/talentInfo/editBasicInfo", function (data) {
  220. if(data.code==200){
  221. Feng.success(data.msg);
  222. TalentInfo.table.refresh();
  223. layer.close(index);
  224. }else{
  225. Feng.error(data.msg);
  226. }
  227. }, function (data) {
  228. Feng.error("修改失败!" + data.responseJSON.message + "!");
  229. });
  230. ajax.set("id",TalentInfo.seItem.id);
  231. ajax.set("introductionMode",introduceMode);
  232. ajax.set("isSync",isSync);
  233. ajax.start();
  234. }
  235. Feng.confirm("确认修改吗?", operation);
  236. }
  237. });
  238. }
  239. }
  240. //回调
  241. TalentInfo.callBack = function (data){
  242. Feng.info(data.msg);
  243. }
  244. /**
  245. * 查看首次申报基础信息
  246. */
  247. TalentInfo.selectFirstInfo = function(){
  248. if (this.check()) {
  249. var index = layer.open({
  250. type: 2,
  251. title: '人才认定首次申报信息',
  252. area: ['800px', '420px'], //宽高
  253. fix: false, //不固定
  254. maxmin: true,
  255. content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id+'/6'
  256. });
  257. layer.full(index);
  258. TalentInfo.layerIndex = index;
  259. }
  260. }
  261. $(function () {
  262. var defaultColunms = TalentInfo.initColumn();
  263. var table = new BSTable(TalentInfo.id, "/talentInfo/list/5", defaultColunms);
  264. table.setPaginationType("server");
  265. table.setOnDblClickRow(function () {
  266. TalentInfo.openTalentInfoDetail();
  267. });
  268. table.setRowStyle(function (row,index) {
  269. if(row.isEffect==1){
  270. return {};
  271. }
  272. if(row.isEffect==2){
  273. return {classes:'warning'};
  274. }
  275. if(row.isEffect==3){
  276. return {classes:'danger'};
  277. }
  278. if(row.isEffect == 4){
  279. return {classes: 'info'}
  280. }
  281. });
  282. var t = TalentInfo.table = table.init();
  283. TalentInfo.init();
  284. //批量加载时间控件
  285. $(".time").each(function(){
  286. laydate.render({
  287. elem: "#"+$(this).attr("id")
  288. ,type: "date"
  289. ,trigger: 'click'
  290. });
  291. });
  292. });