talentBasicChange.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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: 'oldContractTime', 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: 'newContractTime', 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. }
  39. if (value == 1) {
  40. return '<span class=\'label label-success\'>待审核</span>';
  41. }
  42. if (value == 2) {
  43. return '<span class=\'label label-danger\'>已驳回</span>';
  44. }
  45. if (value == 3) {
  46. return '<span class=\'label label-primary\'>已通过</span>';
  47. }
  48. if (value == 9) {
  49. return '<span class=\'label label-success\'>重新提交</span>';
  50. }
  51. }
  52. },
  53. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  54. formatter: function (value, row, index) {
  55. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('" + value + "','" + CONFIG.project_basicchange + "')\" >" +
  56. "<i class=\"fa fa-book\"></i>日志" +
  57. "</span>";
  58. }
  59. }
  60. ];
  61. };
  62. /**
  63. * 检查是否选中
  64. */
  65. TalentBasicChange.check = function () {
  66. var selected = $('#' + this.id).bootstrapTable('getSelections');
  67. if (selected.length == 0) {
  68. Feng.info("请先选中表格中的某一记录!");
  69. return false;
  70. } else {
  71. TalentBasicChange.seItem = selected[0];
  72. return true;
  73. }
  74. };
  75. /**
  76. * 点击添加人才基础信息变更
  77. */
  78. TalentBasicChange.openAddTalentBasicChange = function () {
  79. var index = layer.open({
  80. type: 2,
  81. title: '添加人才基础信息变更',
  82. area: ['800px', '420px'], //宽高
  83. fix: false, //不固定
  84. maxmin: true,
  85. content: Feng.ctxPath + '/enterprise/talent_basic_change/apply',
  86. 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;取消'],
  87. btnAlign: 'c',
  88. btn1: function (index, layero) {
  89. var obj = layero.find("iframe")[0].contentWindow;
  90. obj.TalentBasicChangeInfoDlg.addSubmit();
  91. }, btn2: function (index, layero) {
  92. var obj = layero.find("iframe")[0].contentWindow;
  93. obj.TalentBasicChangeInfoDlg.submitToCheck();
  94. return false;
  95. },
  96. success: function (layero, index) {
  97. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  98. },
  99. end: function () {
  100. layer.closeAll('tips');
  101. }
  102. });
  103. TalentBasicChange.layerIndex = index;
  104. layer.full(index);
  105. };
  106. /**
  107. * 打开查看人才基础信息变更详情
  108. */
  109. TalentBasicChange.openTalentBasicChangeDetail = function () {
  110. if (this.check()) {
  111. var index = layer.open({
  112. type: 2,
  113. title: '人才基础信息变更详情',
  114. area: ['800px', '420px'], //宽高
  115. fix: false, //不固定
  116. maxmin: true,
  117. content: Feng.ctxPath + '/enterprise/talent_basic_change/apply/id/' + TalentBasicChange.seItem.id,
  118. 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;取消'],
  119. btnAlign: 'c',
  120. btn1: function (index, layero) {
  121. var obj = layero.find("iframe")[0].contentWindow;
  122. obj.TalentBasicChangeInfoDlg.addSubmit();
  123. }, btn2: function (index, layero) {
  124. var obj = layero.find("iframe")[0].contentWindow;
  125. obj.TalentBasicChangeInfoDlg.submitToCheck();
  126. return false;
  127. },
  128. success: function (layero, index) {
  129. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  130. },
  131. end: function () {
  132. layer.closeAll('tips');
  133. }
  134. });
  135. TalentBasicChange.layerIndex = index;
  136. layer.full(index);
  137. }
  138. };
  139. TalentBasicChange.openTalentBasicChangeSelect = function () {
  140. if (this.check()) {
  141. var index = layer.open({
  142. type: 2,
  143. title: '人才基础信息变更详情',
  144. area: ['800px', '420px'], //宽高
  145. fix: false, //不固定
  146. maxmin: true,
  147. content: Feng.ctxPath + '/enterprise/talent_basic_change/view/id/' + TalentBasicChange.seItem.id
  148. });
  149. TalentBasicChange.layerIndex = index;
  150. layer.full(index);
  151. }
  152. }
  153. /**
  154. * 删除人才基础信息变更
  155. */
  156. TalentBasicChange.delete = function () {
  157. if (this.check()) {
  158. var ajax = new $ax(Feng.ctxPath + "/enterprise/talent_basic_change/delete", function (data) {
  159. Feng.success("删除成功!");
  160. TalentBasicChange.table.refresh();
  161. }, function (data) {
  162. Feng.error("删除失败!" + data.responseJSON.message + "!");
  163. });
  164. ajax.set("id", this.seItem.id);
  165. ajax.start();
  166. }
  167. };
  168. TalentBasicChange.formParams = function () {
  169. var queryData = {};
  170. queryData['oldName'] = $("#oldName").val();
  171. queryData['oldCardType'] = $("#oldCardType").val();
  172. queryData['oldIdCard'] = $("#oldIdCard").val();
  173. queryData['newName'] = $("#newName").val();
  174. queryData['newCardType'] = $("#newCardType").val();
  175. queryData['newIdCard'] = $("#newIdCard").val();
  176. queryData['checkState'] = $("#checkState").val();
  177. return queryData;
  178. }
  179. /**
  180. * 查询人才基础信息变更列表
  181. */
  182. TalentBasicChange.search = function () {
  183. TalentBasicChange.table.refresh({query: TalentBasicChange.formParams()});
  184. };
  185. TalentBasicChange.reset = function () {
  186. $("#oldName").val("");
  187. $("#oldCardType").val("");
  188. $("#oldIdCard").val("");
  189. $("#newName").val("");
  190. $("#newCardType").val("");
  191. $("#newIdCard").val("");
  192. $("#checkState").val("");
  193. }
  194. $(function () {
  195. var defaultColunms = TalentBasicChange.initColumn();
  196. var table = new BSTable(TalentBasicChange.id, "/enterprise/talent_basic_change/list", defaultColunms);
  197. table.setPaginationType("server");
  198. TalentBasicChange.table = table.init();
  199. var arr = [
  200. {"name": "oldCardType", "code": "card_type"},
  201. {"name": "newCardType", "code": "card_type"}
  202. ];
  203. Feng.findChildDictBatch(JSON.stringify(arr));
  204. });