talentBasicChange.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /**
  2. * 人才基础信息变更管理初始化
  3. */
  4. var TalentBasicChange = {
  5. id: "TalentBasicChangeTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentBasicChange.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '原姓名', field: 'oldName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  17. // {title: '原出生日期', field: 'oldBirthday', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  18. {title: '原国籍', field: 'oldNationalityName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  19. {title: '原民族', field: 'oldNationName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  20. {title: '原政治面貌', field: 'oldPoliticsName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  21. {title: '原证件类型', field: 'oldCardTypName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  22. {title: '原证件号码', field: 'oldIdCard', visible: true, align: 'center', valign: 'middle',width:"150px",'class': 'uitd_showTip'},
  23. // {title: '原电子邮箱', field: 'oldEmail', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  24. {title: '现姓名', field: 'newName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  25. // {title: '现出生日期', field: 'newBirthday', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  26. {title: '现国籍', field: 'newNationalityName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  27. {title: '现民族', field: 'newNationName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  28. {title: '现政治面貌', field: 'newPoliticsName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  29. {title: '现证件类型', field: 'newCardTypName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  30. {title: '现证件号码', field: 'newIdCard', visible: true, align: 'center', valign: 'middle',width:"150px",'class': 'uitd_showTip'},
  31. // {title: '现邮箱', field: 'newEmail', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  32. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  33. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  34. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"80px",
  35. formatter : function (value,row,index) {
  36. if(value==-1){
  37. return '<span class=\'label\'>待提交</span>';
  38. }if(value==1){
  39. return '<span class=\'label label-success\'>待审核</span>';
  40. }if(value==2){
  41. return '<span class=\'label label-danger\'>已驳回</span>';
  42. }if(value==3){
  43. return '<span class=\'label label-primary\'>已通过</span>';
  44. }if(value==9){
  45. return '<span class=\'label label-success\'>重新提交</span>';
  46. }
  47. }
  48. },
  49. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  50. formatter: function (value,row,index) {
  51. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_basicchange+"')\" >" +
  52. "<i class=\"fa fa-book\"></i>日志" +
  53. "</span>";
  54. }
  55. }
  56. ];
  57. };
  58. /**
  59. * 检查是否选中
  60. */
  61. TalentBasicChange.check = function () {
  62. var selected = $('#' + this.id).bootstrapTable('getSelections');
  63. if(selected.length == 0){
  64. Feng.info("请先选中表格中的某一记录!");
  65. return false;
  66. }else{
  67. TalentBasicChange.seItem = selected[0];
  68. return true;
  69. }
  70. };
  71. /**
  72. * 点击添加人才基础信息变更
  73. */
  74. TalentBasicChange.openAddTalentBasicChange = function () {
  75. var index = layer.open({
  76. type: 2,
  77. title: '添加人才基础信息变更',
  78. area: ['800px', '420px'], //宽高
  79. fix: false, //不固定
  80. maxmin: true,
  81. content: Feng.ctxPath + '/api/talentBasicChange/talentBasicChange_add',
  82. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交','<i class="fa fa-check layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  83. btnAlign: 'c',
  84. btn1: function (index, layero) {
  85. var obj = layero.find("iframe")[0].contentWindow;
  86. obj.TalentBasicChangeInfoDlg.addSubmit();
  87. },btn2: function(index, layero){
  88. var obj = layero.find("iframe")[0].contentWindow;
  89. obj.TalentBasicChangeInfoDlg.submitToCheck();
  90. return false;
  91. },
  92. success :function (layero, index) {
  93. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  94. },
  95. end :function () {
  96. layer.closeAll('tips');
  97. }
  98. });
  99. TalentBasicChange.layerIndex = index;
  100. layer.full(index);
  101. };
  102. /**
  103. * 打开查看人才基础信息变更详情
  104. */
  105. TalentBasicChange.openTalentBasicChangeDetail = function () {
  106. if (this.check()) {
  107. var index = layer.open({
  108. type: 2,
  109. title: '人才基础信息变更详情',
  110. area: ['800px', '420px'], //宽高
  111. fix: false, //不固定
  112. maxmin: true,
  113. content: Feng.ctxPath + '/api/talentBasicChange/talentBasicChange_update/' + TalentBasicChange.seItem.id+"?hand=1",
  114. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交','<i class="fa fa-check layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  115. btnAlign: 'c',
  116. btn1: function (index, layero) {
  117. var obj = layero.find("iframe")[0].contentWindow;
  118. obj.TalentBasicChangeInfoDlg.addSubmit();
  119. },btn2: function(index, layero){
  120. var obj = layero.find("iframe")[0].contentWindow;
  121. obj.TalentBasicChangeInfoDlg.submitToCheck();
  122. return false;
  123. },
  124. success :function (layero, index) {
  125. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  126. },
  127. end :function () {
  128. layer.closeAll('tips');
  129. }
  130. });
  131. TalentBasicChange.layerIndex = index;
  132. layer.full(index);
  133. }
  134. };
  135. TalentBasicChange.openTalentBasicChangeSelect = function(){
  136. if (this.check()) {
  137. var index = layer.open({
  138. type: 2,
  139. title: '人才基础信息变更详情',
  140. area: ['800px', '420px'], //宽高
  141. fix: false, //不固定
  142. maxmin: true,
  143. content: Feng.ctxPath + '/api/talentBasicChange/talentBasicChange_update/' + TalentBasicChange.seItem.id+"?hand=2"
  144. });
  145. TalentBasicChange.layerIndex = index;
  146. layer.full(index);
  147. }
  148. }
  149. /**
  150. * 删除人才基础信息变更
  151. */
  152. TalentBasicChange.delete = function () {
  153. if (this.check()) {
  154. var ajax = new $ax(Feng.ctxPath + "/talentBasicChange/delete", function (data) {
  155. Feng.success("删除成功!");
  156. TalentBasicChange.table.refresh();
  157. }, function (data) {
  158. Feng.error("删除失败!" + data.responseJSON.message + "!");
  159. });
  160. ajax.set("talentBasicChangeId",this.seItem.id);
  161. ajax.start();
  162. }
  163. };
  164. TalentBasicChange.formParams = function() {
  165. var queryData = {};
  166. queryData['oldName'] = $("#oldName").val();
  167. queryData['oldCardType'] = $("#oldCardType").val();
  168. queryData['oldIdCard'] = $("#oldIdCard").val();
  169. queryData['newName'] = $("#newName").val();
  170. queryData['newCardType'] = $("#newCardType").val();
  171. queryData['newIdCard'] = $("#newIdCard").val();
  172. queryData['checkState'] = $("#checkState").val();
  173. return queryData;
  174. }
  175. /**
  176. * 查询人才基础信息变更列表
  177. */
  178. TalentBasicChange.search = function () {
  179. TalentBasicChange.table.refresh({query: TalentBasicChange.formParams()});
  180. };
  181. TalentBasicChange.reset = function(){
  182. $("#oldName").val("");
  183. $("#oldCardType").val("");
  184. $("#oldIdCard").val("");
  185. $("#newName").val("");
  186. $("#newCardType").val("");
  187. $("#newIdCard").val("");
  188. $("#checkState").val("");
  189. }
  190. $(function () {
  191. var defaultColunms = TalentBasicChange.initColumn();
  192. var table = new BSTable(TalentBasicChange.id, "/api/talentBasicChange/list", defaultColunms);
  193. table.setPaginationType("server");
  194. TalentBasicChange.table = table.init();
  195. var arr = [
  196. {"name": "oldCardType", "code": "un_cardType"},
  197. {"name": "newCardType", "code": "un_cardType"}
  198. ];
  199. Feng.findChildDictBatch(JSON.stringify(arr));
  200. });