talentInfo_first.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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 = $("#type").val();
  15. var isShow = true;
  16. if(type==2){
  17. isShow = false;
  18. };
  19. return [
  20. {field: 'selectItem', checkbox:true},
  21. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:'80px'},
  22. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  23. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
  24. formatter : function(value,row,index){
  25. if(row.sex==1){
  26. return value+'<span style="color:#6495ED">【男】</span>';
  27. }if(row.sex==2){
  28. return value+'<span style="color:#FF82AB">【女】</span>';
  29. }
  30. }
  31. },
  32. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px"},
  33. {title: '人才标签', field: 'talentTypeName', visible: isShow, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  34. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
  35. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  36. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  37. {title: '获得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  38. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  39. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  40. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",
  41. formatter : function (value,row,index) {
  42. if(value==-1){
  43. return "<span class='label label-danger'>审核不通过</span>"
  44. }if(value==1){
  45. return "<span class='label'>待提交</span>"
  46. }if(value==7){
  47. if(row.highProcess!=null && row.highProcess!='' && row.highProcess>=1){
  48. return "<span class='label label-success'>重新提交</span>"
  49. }else{
  50. return "<span class='label label-success'>待审核</span>"
  51. }
  52. }if(value==20){
  53. if(row.highProcess!=null && row.highProcess!='' && row.highProcess>=1){
  54. return "<span class='label label-success'>上级驳回</span>"
  55. }else{
  56. return "<span class='label label-success'>待审核</span>"
  57. }
  58. }if(value==10){
  59. return "<span class='label label-danger'>已驳回</span>"
  60. }if(value == 15 ||value>=25){
  61. return "<span class='label label-primary'>已通过</span>"
  62. }
  63. }
  64. },
  65. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  66. formatter : function (value,row,index){
  67. return "<span class='label label-success' onclick=\"TalentInfo.showLog('"+value+"')\" >" +
  68. "<i class=\"fa fa-book\"></i>日志" +
  69. "</span>";
  70. }
  71. }
  72. ];
  73. };
  74. /**
  75. * 检查是否选中
  76. */
  77. TalentInfo.check = function () {
  78. var selected = $('#' + this.id).bootstrapTable('getSelections');
  79. if(selected.length != 1){
  80. Feng.info("请先选中表格中的某一记录!");
  81. return false;
  82. }else{
  83. TalentInfo.seItem = selected[0];
  84. return true;
  85. }
  86. };
  87. TalentInfo.openCheckTalentInfo = function (){
  88. if (this.check()) {
  89. var index = layer.open({
  90. type: 2,
  91. title: '人才认定-初级审核',
  92. area: ['800px', '420px'], //宽高
  93. fix: false, //不固定
  94. maxmin: true,
  95. content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id + '/1',
  96. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交','<i class="fa fa-save"></i>&nbsp;&nbsp;提交审核' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  97. btnAlign: 'c',
  98. btn1: function (index, layero) {
  99. var obj = layero.find("iframe")[0].contentWindow;
  100. obj.TalentInfoInfoDlg.showFirstCheckModal();
  101. },btn2: function(index, layero){
  102. var obj = layero.find("iframe")[0].contentWindow;
  103. obj.TalentInfoInfoDlg.submitCheck();
  104. return false;
  105. }
  106. });
  107. layer.full(index);
  108. TalentInfo.layerIndex = index;
  109. }
  110. }
  111. /**
  112. * 打开查看人才认定-初级审核详情
  113. */
  114. TalentInfo.openTalentInfoDetail = function () {
  115. if (this.check()) {
  116. var index = layer.open({
  117. type: 2,
  118. title: '人才认定申报详情',
  119. area: ['800px', '420px'], //宽高
  120. fix: false, //不固定
  121. maxmin: true,
  122. content: Feng.ctxPath + '/talentInfo/talentInfo_toDetail/' + TalentInfo.seItem.id+'/1'
  123. });
  124. layer.full(index);
  125. TalentInfo.layerIndex = index;
  126. }
  127. };
  128. /**
  129. * 修改驳回的字段及附件
  130. */
  131. TalentInfo.updateFieldsAndFiles = function(){
  132. if (this.check()) {
  133. var ajax = new $ax(Feng.ctxPath + "/talentInfo/findFieldsAndFiles?id="+TalentInfo.seItem.id, function (data) {
  134. var obj = data.obj.obj;
  135. if(data.code==200){
  136. layer.open({
  137. type: 1,
  138. id: "neewFieldFormModel",
  139. title: '修改',
  140. area: ['800px', '450px'], //宽高
  141. fix: false, //不固定
  142. shade: 0,
  143. maxmin: true,
  144. content: TalentInfo.creatFieldCheckModal(),
  145. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  146. btnAlign: 'c',
  147. zIndex: layer.zIndex,
  148. success: function (layero, index) {
  149. var fileList = data.obj.fileList;
  150. var html = '';
  151. for(var key in fileList){
  152. html = html + '<ul><li style="width: 100%"><input type="checkbox" value="'+fileList[key].id+'"><span>'+fileList[key].name+'</span></li></ul>';
  153. }
  154. $("#field_file").empty().append(html);
  155. if(obj.fields!=null && obj.fields!=''){
  156. $("#field_info input").each(function () {
  157. var arr = obj.fields.split(",");
  158. for(var key in arr){
  159. if($(this).val()==arr[key]){
  160. this.checked = true;
  161. }
  162. }
  163. });
  164. }
  165. if(obj.files!=null && obj.files!=''){
  166. $("#field_file input").each(function () {
  167. if(obj.files.indexOf($(this).val())!=-1){
  168. this.checked=true;
  169. }
  170. });
  171. }
  172. },
  173. yes: function (index, layero) {
  174. TalentInfo.submitFieldsAndFiles(index,obj.id);
  175. }
  176. });
  177. }else{
  178. Feng.error(data.msg);
  179. }
  180. }, function (data) {
  181. Feng.error("查询失败!" + data.responseJSON.message + "!");
  182. });
  183. ajax.start();
  184. }
  185. }
  186. /**
  187. * 修改提交
  188. * @param index
  189. * @param id
  190. */
  191. TalentInfo.submitFieldsAndFiles = function(index,id){
  192. var fields = '';
  193. var files = '';
  194. $("#field_info li input").each(function(index){
  195. if($(this).is(":checked")){
  196. fields = fields + $(this).val() + ",";
  197. }
  198. });
  199. $("#field_file li input").each(function(index){
  200. if($(this).is(":checked")){
  201. files = files + $(this).val() + ",";
  202. }
  203. });
  204. if( fields=='' && files==''){
  205. Feng.info("请选择可修改的字段或附件!");
  206. return ;
  207. }
  208. var ajax = new $ax(Feng.ctxPath + "/talentInfo/updateFieldsAndFiles", function (data) {
  209. if(data.code==200){
  210. layer.close(index);
  211. Feng.success(data.msg);
  212. }else{
  213. Feng.error(data.msg);
  214. }
  215. }, function (data) {
  216. Feng.error("修改失败!" + data.responseJSON.message + "!");
  217. });
  218. ajax.setData({"id":id,"fields":fields,"files":files})
  219. ajax.start();
  220. }
  221. /**
  222. * 审核不通过
  223. */
  224. TalentInfo.setNotPass = function(){
  225. var selecteds = $('#' + this.id).bootstrapTable('getSelections');
  226. if(selecteds.length == 0){
  227. Feng.info("请选择需要设置审核不通过的行");
  228. return ;
  229. }
  230. var ids = "";
  231. for(var key in selecteds){
  232. ids = ids + selecteds[key].id + ",";
  233. }
  234. ids = ids.substring(0,ids.length-1);
  235. layer.open({
  236. type: 1,
  237. id: "notPassModal",
  238. title: '修改',
  239. area: ['800px', '450px'], //宽高
  240. fix: false, //不固定
  241. shade: 0,
  242. maxmin: true,
  243. content: '<form id="checkNotPass">\n' +
  244. ' <div class="form-group" style="margin: 10px;">\n' +
  245. ' <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
  246. ' <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据" rows="6"></textarea>\n' +
  247. ' </div>\n' +
  248. ' </form>',
  249. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  250. btnAlign: 'c',
  251. zIndex: layer.zIndex,
  252. yes: function (index, layero) {
  253. var checkMsg = $("#checkMsgNotPass").val();
  254. if(Feng.isEmptyStr(checkMsg)){
  255. Feng.info("请填写审核不通过原因");
  256. return ;
  257. }
  258. var operation = function(){
  259. var ajax = new $ax(Feng.ctxPath + "/talentInfo/setNotPass", function (data) {
  260. if(data.code==200){
  261. Feng.success(data.msg);
  262. TalentInfo.table.refresh();
  263. layer.close(index);
  264. }else{
  265. Feng.error(data.msg);
  266. }
  267. }, function (data) {
  268. Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
  269. });
  270. ajax.set("ids",ids);
  271. ajax.set("msg",checkMsg);
  272. ajax.start();
  273. }
  274. Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
  275. }
  276. });
  277. }
  278. TalentInfo.creatFieldCheckModal = function () {
  279. return '<form id="firstCheckForm">\n' +
  280. ' <div class="form-group" style="margin: 10px;">\n' +
  281. ' <div >\n' +
  282. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  283. ' <div id="field_info">\n' +
  284. ' <ul>\n' +
  285. ' <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
  286. ' <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
  287. ' <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
  288. ' <li style="width:10%"><input type="checkbox" value="nationality"><span>国籍/地区</span></li>\n' +
  289. ' <li style="width:10%"><input type="checkbox" value="provinceCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯省</span></li>\n' +
  290. ' <li style="width:10%"><input type="checkbox" value="cityCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯市</span></li>\n' +
  291. ' <li style="width:10%"><input type="checkbox" value="countyCode"><span>籍贯县</span></li>\n' +
  292. ' <li style="width:10%"><input type="checkbox" value="nation"><span>民族</span></li>\n' +
  293. ' <li style="width:10%"><input type="checkbox" value="politics"><span>政治面貌</span></li>\n' +
  294. ' <li style="width:10%"><input type="checkbox" value="cardType"><span>证件类型</span></li>\n' +
  295. ' <li style="width:10%"><input type="checkbox" value="idCard"><span>证件号码</span></li>\n' +
  296. ' <li style="width:20.5%"><input type="checkbox" value="firstInJJTime"><span>首次来晋工作时间</span></li>\n' +
  297. ' <li style="width:10%"><input type="checkbox" value="source" onchange="TalentInfo.sourceCheckd(this)"><span>申报来源</span></li>\n' +
  298. ' <li style="width:20.5%"><input type="checkbox" value="ourCitySource"><span>公布入选来源</span></li>\n' +
  299. ' <li style="width:20.5%"><input type="checkbox" value="fromCity"><span>入选来源县市</span></li>\n' +
  300. ' <li style="width:20.5%"><input type="checkbox" value="qzBatch"><span>入选名单的文件号及批次</span></li>\n' +
  301. ' <li style="width:31%"><input type="checkbox" value="certificateStartTime"><span>泉州高层次人才证书发证日期</span></li>\n' +
  302. ' <li style="width:31%"><input type="checkbox" value="qzgccrcActiveTime"><span>泉州高层次人才证书的有效期</span></li>\n' +
  303. ' <li style="width:10%"><input type="checkbox" id="talentArrangeCheckBox" value="talentArrange" onchange="TalentInfo.fieldCheckd(this)"><span>人才层次</span></li>\n' +
  304. ' <li style="width:10%"><input type="checkbox" value="identifyCondition"><span>认定条件</span></li>\n' +
  305. ' <li style="width:20.5%"><input type="checkbox" value="identifyConditionName"><span>认定条件名称</span></li>\n' +
  306. ' <li style="width:20.5%"><input type="checkbox" value="identifyGetTime"><span>认定条件证书取得时间</span></li>\n' +
  307. ' <li style="width:10%"><input type="checkbox" value="talentType"><span>人才标签</span></li>\n' +
  308. ' <li style="width:31%"><input type="checkbox" value="letterTime"><span>首次来晋行政介绍信时间</span></li>\n' +
  309. ' <li style="width:10%"><input type="checkbox" value="introductionMode"><span>引进方式</span></li>\n' +
  310. ' <li style="width:20.5%"><input type="checkbox" value="entryTime"><span>本单位入职时间</span></li>\n' +
  311. ' <li style="width:10%"><input type="checkbox" value="post"><span>职务</span></li>\n' +
  312. ' <li style="width:20.5%"><input type="checkbox" value="startTime"><span>工作合同开始时间</span></li>\n' +
  313. ' <li style="width:20.5%"><input type="checkbox" value="endTime"><span>工作合同结束时间</span></li>\n' +
  314. ' <li style="width:20.5%"><input type="checkbox" value="lastYearWages"><span>上一年度年薪</span></li>\n' +
  315. ' <li style="width:10%"><input type="checkbox" value="highEducation"><span>最高学历</span></li>\n' +
  316. ' <li style="width:10%"><input type="checkbox" value="graduateSchool"><span>毕业院校</span></li>\n' +
  317. ' <li style="width:10%"><input type="checkbox" value="major"><span>专业</span></li>\n' +
  318. ' <li style="width:10%"><input type="checkbox" value="title"><span>职称</span></li>\n' +
  319. ' <li style="width:20.5%"><input type="checkbox" value="professionalQualifications"><span>国家职业资格</span></li>\n' +
  320. ' <li style="width:20.5%"><input type="checkbox" value="studyAbroad"><span>是否有留学经历</span></li>\n' +
  321. ' <li style="width:10%"><input type="checkbox" value="phone"><span>手机号码</span></li>\n' +
  322. ' <li style="width:10%"><input type="checkbox" value="email"><span>电子邮箱</span></li>\n' +
  323. ' <li style="width:10%"><input type="checkbox" value="bank"><span>开户银行</span></li>\n' +
  324. ' <li style="width:20.5%"><input type="checkbox" value="bankNetwork"><span>开户银行网点</span></li>\n' +
  325. ' <li style="width:10%"><input type="checkbox" value="bankNumber"><span>银行行号</span></li>\n' +
  326. ' <li style="width:10%"><input type="checkbox" value="bankAccount"><span>银行账号</span></li>\n' +
  327. ' <li style="width:31%"><input type="checkbox" value="breakFaith"><span>曾被相关主管部门列为失信个人</span></li>\n' +
  328. ' <li style="width:20.5%"><input type="checkbox" value="educationAndResume"><span>教育背景及工作简历</span></li>\n' +
  329. ' <li style="width:20.5%"><input type="checkbox" value="mainHonours"><span>主要业绩及取得的荣誉</span></li>\n' +
  330. ' </ul>\n' +
  331. ' </div>\n' +
  332. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  333. ' <div id="field_file">\n' +
  334. ' </div>\n' +
  335. ' <div class="form-group" style="text-align: center">\n' +
  336. ' <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>\n' +
  337. ' <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>\n' +
  338. ' </div>\n' +
  339. ' </div>\n' +
  340. ' </div>\n' +
  341. ' </form>';
  342. }
  343. TalentInfo.fieldCheckd = function(context){
  344. if($(context).get(0).checked){
  345. $(context).parent().next().children()[0].checked=true;
  346. $(context).parent().next().children().eq(0).trigger("change");
  347. }
  348. }
  349. TalentInfo.sourceCheckd = function(context){
  350. if($(context).get(0).checked){
  351. $("#talentArrangeCheckBox").attr("checked",true);
  352. $("#talentArrangeCheckBox").trigger("change");
  353. }
  354. }
  355. TalentInfo.getPhones = function(){
  356. var ajax = new $ax(Feng.ctxPath + "/talentInfo/getPhones", function(data){
  357. if(data.code == 200){
  358. layer.open({
  359. type: 1,
  360. title:"手机号码",
  361. area: ['830px', '300px'], //宽高
  362. fix: false, //不固定
  363. maxmin: true,
  364. content: "<span style='word-break:break-all'>"+data.obj+"</span>"
  365. });
  366. }else{
  367. Feng.info(data.msg);
  368. }
  369. },function(data){
  370. Feng.error("操作失败!");
  371. });
  372. ajax.setData(TalentInfo.formParams());
  373. ajax.start();
  374. }
  375. TalentInfo.getEnterprisePhones = function(){
  376. var ajax = new $ax(Feng.ctxPath + "/talentInfo/getEnterprisePhones", function(data){
  377. if(data.code == 200){
  378. layer.open({
  379. type: 1,
  380. title:"手机号码",
  381. area: ['830px', '300px'], //宽高
  382. fix: false, //不固定
  383. maxmin: true,
  384. content: "<span style='word-break:break-all'>"+data.obj+"</span>"
  385. });
  386. }else{
  387. Feng.info(data.msg);
  388. }
  389. },function(data){
  390. Feng.error("操作失败!");
  391. });
  392. ajax.setData(TalentInfo.formParams());
  393. ajax.start();
  394. }
  395. $(function () {
  396. var defaultColunms = TalentInfo.initColumn();
  397. var table = new BSTable(TalentInfo.id, "/talentInfo/list/1", defaultColunms);
  398. table.setPaginationType("server");
  399. table.setSingleSelect(false);
  400. table.setOnDblClickRow(function () {
  401. TalentInfo.openCheckTalentInfo();
  402. });
  403. TalentInfo.table = table.init();
  404. TalentInfo.init();
  405. // var defaultColunms = TalentInfo.initColumn();
  406. // var table = new KDTable(TalentInfo.id, "/talentInfo/list/1", defaultColunms);
  407. // table.setPaginationType("server");
  408. // TalentInfo.table = table.init();
  409. });