talentInfo_third.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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', radio: true},
  21. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:'80px'},
  22. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle'},
  23. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',
  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'},
  33. {title: '人才标签', field: 'talentTypeName', visible: isShow, align: 'center', valign: 'middle'},
  34. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle'},
  35. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip'},
  36. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip'},
  37. {title: '获得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip'},
  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:"120px",
  41. formatter : function (value,row,index) {
  42. if(value==-1){
  43. return "<span class='label label-danger'>审核不通过</span>"
  44. }if(value == 25){
  45. if(row.highProcess!=null && row.highProcess!='' && row.highProcess>=3){
  46. return "<span class='label label-success'>重新提交</span>"
  47. }else{
  48. return "<span class='label label-success'>待审核</span>"
  49. }
  50. }if(value == 30 || value <= 20){
  51. return "<span class='label label-danger'>已驳回</span>"
  52. }if(value >= 35){
  53. return "<span class='label label-primary'>已通过</span>"
  54. }
  55. }
  56. },
  57. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',
  58. formatter : function (value,row,index){
  59. var data = {"type":CONFIG.project_rcrd,"mainId":value,"typeFileId":"","active":1};
  60. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_rcrd+"',null)\" >" +
  61. "<i class=\"fa fa-book\"></i>日志" +
  62. "</span>";
  63. }
  64. }
  65. ];
  66. };
  67. /**
  68. * 检查是否选中
  69. */
  70. TalentInfo.check = function () {
  71. var selected = $('#' + this.id).bootstrapTable('getSelections');
  72. if(selected.length == 0){
  73. Feng.info("请先选中表格中的某一记录!");
  74. return false;
  75. }else{
  76. TalentInfo.seItem = selected[0];
  77. return true;
  78. }
  79. };
  80. TalentInfo.openCheckTalentInfo = function (){
  81. if (this.check()) {
  82. var index = layer.open({
  83. type: 2,
  84. title: '人才认定-复核',
  85. area: ['800px', '420px'], //宽高
  86. fix: false, //不固定
  87. maxmin: true,
  88. content: Feng.ctxPath + '/talentInfo/talentInfo_toCommonCheck/' + TalentInfo.seItem.id + '/3',
  89. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交','<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  90. btnAlign: 'c',
  91. btn1: function (index, layero) {
  92. var obj = layero.find("iframe")[0].contentWindow;
  93. obj.TalentInfoInfoDlg.showFirstCheckModal();
  94. },btn2: function(index, layero){
  95. var obj = layero.find("iframe")[0].contentWindow;
  96. obj.TalentInfoInfoDlg.submitCheck();
  97. return false;
  98. }
  99. });
  100. layer.full(index);
  101. TalentInfo.layerIndex = index;
  102. }
  103. }
  104. /**
  105. * 打开查看人才认定-初级审核详情
  106. */
  107. TalentInfo.openTalentInfoDetail = 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 + '/talentInfo/talentInfo_toDetail/' + TalentInfo.seItem.id+'/3'
  116. });
  117. layer.full(index);
  118. TalentInfo.layerIndex = index;
  119. }
  120. };
  121. TalentInfo.cancleThirdCheck = function(){
  122. if (this.check()) {
  123. var index = layer.open({
  124. type: 1,
  125. title: '撤销复核',
  126. area: ['800px', '420px'], //宽高
  127. fix: false, //不固定
  128. maxmin: true,
  129. content: '<form >\n' +
  130. ' <div class="form-group" style="margin: 10px;">\n' +
  131. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  132. ' <textarea class="form-control" id="msg" rows="6"></textarea>\n' +
  133. ' </div>\n' +
  134. ' </form>',
  135. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  136. yes: function (index, layero) {
  137. var cancleMsg = $("#msg").val();
  138. if(Feng.isEmptyStr(cancleMsg)){
  139. Feng.error("撤销原因不能为空");return ;
  140. }
  141. var operation = function(){
  142. var ajax = new $ax(Feng.ctxPath + "/talentInfo/cancleThirdCheck", function (data) {
  143. if(data.code==200){
  144. Feng.success(data.msg);
  145. TalentInfo.table.refresh();
  146. layer.close(index);
  147. }else{
  148. Feng.error(data.msg);
  149. }
  150. locked = false;
  151. }, function (data) {
  152. Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
  153. locked = false;
  154. });
  155. ajax.setData({"id":TalentInfo.seItem.id,"checkMsg":cancleMsg})
  156. ajax.start();
  157. };
  158. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  159. }
  160. });
  161. }
  162. }
  163. /**
  164. * 查询表单提交参数对象
  165. * @returns {{}}
  166. */
  167. TalentInfo.formParams = function() {
  168. var queryData = {};
  169. queryData['name'] = $("#name").val();
  170. queryData['idCard'] = $("#idCard").val();
  171. queryData['sex'] = $("#sex").val();
  172. queryData['nation'] = $("#nation").val();
  173. queryData['nationality'] = $("#nationality").val();
  174. queryData['talentType'] = $("#talentType").val();
  175. queryData['talentArrange'] = $("#talentArrange").val();
  176. queryData['address'] = $("#address").val();
  177. queryData['identifyCondition'] = $("#identifyCondition").val();
  178. queryData['checkState'] = $("#checkState").val();
  179. return queryData;
  180. }
  181. /**
  182. * 查询人才认定申报列表
  183. */
  184. TalentInfo.search = function () {
  185. TalentInfo.table.refresh({query: TalentInfo.formParams()});
  186. };
  187. /**
  188. * 重置
  189. */
  190. TalentInfo.reset = function (){
  191. $("#name").val("");
  192. $("#idCard").val("");
  193. $("#sex").val("");
  194. $("#nation").val("");
  195. $("#nationality").val("");
  196. $("#talentType").val("");
  197. $("#talentArrange").val("").trigger("change");
  198. $("#address").val("");
  199. $("#identifyCondition").val("");
  200. $("#checkState").val("");
  201. }
  202. /**
  203. * 获取人才认定
  204. */
  205. TalentInfo.getIdentifyCondition = function() {
  206. var level = $("#talentArrange").val();
  207. if(level==null||level==''){
  208. $("#identifyCondition").empty();
  209. $("#identifyCondition").trigger('chosen:updated');
  210. return;
  211. }
  212. Feng.addAjaxSelect({
  213. "id": "identifyCondition",
  214. "displayCode": "id",
  215. "displayName": "name",
  216. "type": "GET",
  217. "url": Feng.ctxPath + "/identifyCondition/findIdentifyConditionByLevel?talentLevel="+level
  218. });
  219. $("#identifyCondition").trigger('chosen:updated');
  220. }
  221. $(function () {
  222. var defaultColunms = TalentInfo.initColumn();
  223. var table = new BSTable(TalentInfo.id, "/talentInfo/list/3", defaultColunms);
  224. table.setPaginationType("server");
  225. table.setOnDblClickRow(function () {
  226. TalentInfo.openCheckTalentInfo();
  227. });
  228. TalentInfo.table = table.init();
  229. TalentInfo.init();
  230. });