educationSchool.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /**
  2. * 子女就学管理初始化
  3. */
  4. var EducationSchool = {
  5. id: "EducationSchoolTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. EducationSchool.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  17. {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  18. {title: '父母姓名', field: 'pName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  19. {title: '父母性别', field: 'pSex', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip',
  20. formatter: function (value, row, index) {
  21. if (value == 1) {
  22. return '男';
  23. }
  24. if (value == 2) {
  25. return '女';
  26. }
  27. }
  28. },
  29. {title: '父母证件号码', field: 'pIdcard', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  30. {title: '工作单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  31. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  32. {title: '认定条件', field: 'identifyCondition', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  33. {title: '人才证书有效期', field: 'certificateNo', visible: true, align: 'center', valign: 'middle', width: "140px", 'class': 'uitd_showTip',
  34. formatter: function (value, row, index) {
  35. return row.certificateStartTime + "至" + row.qzgccrcActiveTime;
  36. }
  37. },
  38. {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
  39. {title: '子女姓名', field: 'cName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  40. {title: '子女性别', field: 'cSex', visible: true, align: 'center', valign: 'middle', width: "80px",
  41. formatter: function (value, row, index) {
  42. if (value == 1) {
  43. return '男';
  44. }
  45. if (value == 2) {
  46. return '女';
  47. }
  48. }
  49. },
  50. {title: '与申报人关系', field: 'cRelationName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  51. {title: '现就读学校', field: 'nowSchool', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  52. {title: '现就读年级', field: 'nowGradeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  53. {title: '拟申请学校', field: 'applySchoolName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  54. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  55. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  56. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
  57. formatter: function (value, row, index) {
  58. if (value == -2) {
  59. return '<span class="label label-default">待提交</span>';
  60. }
  61. if (value == -1) {
  62. return '<span class="label label-danger">审核不通过</span>';
  63. }
  64. if (value == 1) {
  65. return '<span class="label label-success">待审核</span>';
  66. }
  67. if (value == 2) {
  68. return '<span class="label label-danger">审核驳回</span>';
  69. }
  70. if (value == 3) {
  71. return '<span class="label label-primary">审核通过</span>';
  72. }
  73. if (value == 9) {
  74. return '<span class="label label-success">重新提交</span>';
  75. }
  76. }
  77. },
  78. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  79. formatter: function (value, row, index) {
  80. return "<span class='label label-success' onclick=\"EducationSchool.showLog('" + value + "')\" >" +
  81. "<i class=\"fa fa-book\"></i>日志" +
  82. "</span>";
  83. }
  84. }
  85. ];
  86. };
  87. /**
  88. * 检查是否选中
  89. */
  90. EducationSchool.check = function () {
  91. var selected = $('#' + this.id).bootstrapTable('getSelections');
  92. if (selected.length == 0) {
  93. Feng.info("请先选中表格中的某一记录!");
  94. return false;
  95. } else {
  96. EducationSchool.seItem = selected[0];
  97. return true;
  98. }
  99. };
  100. /**
  101. * 审核
  102. */
  103. EducationSchool.toCheckPage = function () {
  104. if (this.check()) {
  105. var index = layer.open({
  106. type: 2,
  107. title: '子女就学申报',
  108. area: 'auto', //宽高
  109. fix: false, //不固定
  110. maxmin: true,
  111. content: Feng.ctxPath + '/admin/education_school/detail/id/' + EducationSchool.seItem.id,
  112. 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;取消'],
  113. btnAlign: 'c',
  114. btn1: function (index, layero) {
  115. var obj = layero.find("iframe")[0].contentWindow;
  116. obj.EducationSchoolInfoDlg.showCheckModal();
  117. }, btn2: function (index, layero) {
  118. var obj = layero.find("iframe")[0].contentWindow;
  119. obj.EducationSchoolInfoDlg.submitCheck();
  120. return false;
  121. },
  122. success: function (layero, index) {
  123. layer.tips('审核完成并确认无误后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  124. },
  125. end: function () {
  126. layer.closeAll('tips');
  127. }
  128. });
  129. EducationSchool.layerIndex = index;
  130. layer.full(index);
  131. }
  132. };
  133. /**
  134. * 收集数据
  135. */
  136. EducationSchool.formParams = function () {
  137. var queryData = {};
  138. queryData['year'] = $("#year").val();
  139. queryData['enterpriseName'] = $("#enterpriseName").val();
  140. queryData['pName'] = $("#pName").val();
  141. queryData['pSex'] = $("#pSex").val();
  142. queryData['pIdcard'] = $("#pIdcard").val();
  143. queryData['talentArrange'] = $("#talentArrange").val();
  144. queryData['certificateNo'] = $("#certificateNo").val();
  145. queryData['address'] = $("#address").val();
  146. queryData['phone'] = $("#phone").val();
  147. queryData['project'] = $("#project").val();
  148. queryData['cName'] = $("#cName").val();
  149. queryData['cSex'] = $("#cSex").val();
  150. queryData['cIdcard'] = $("#cIdcard").val();
  151. queryData['cRelation'] = $("#cRelation").val();
  152. queryData['nowSchool'] = $("#nowSchool").val();
  153. queryData['nowGrade'] = $("#nowGrade").val();
  154. queryData['applySchool'] = $("#applySchool").val();
  155. queryData['companyStreet'] = $("#companyStreet").val();
  156. queryData['houseStreet'] = $("#houseStreet").val();
  157. queryData['checkState'] = $("#checkState").val();
  158. queryData['isDoctor'] = $("#isDoctor").val();
  159. return queryData;
  160. }
  161. /**
  162. * 重置
  163. */
  164. EducationSchool.reset = function () {
  165. $("#year").val("");
  166. $("#isDoctor").val("");
  167. $("#enterpriseName").val("");
  168. $("#pName").val("");
  169. $("#pSex").val("");
  170. $("#pIdcard").val("");
  171. $("#talentArrange").val("");
  172. $("#certificateNo").val("");
  173. $("#address").val("");
  174. $("#phone").val("");
  175. $("#project").val("");
  176. $("#cName").val("");
  177. $("#cSex").val("");
  178. $("#cIdcard").val("");
  179. $("#cRelation").val("");
  180. $("#nowSchool").val("");
  181. $("#nowGrade").val("");
  182. $("#applySchool").val("").trigger("chosen:updated");
  183. $("#companyStreet").val("");
  184. $("#houseStreet").val("");
  185. $("#checkState").val("");
  186. }
  187. /**
  188. * 查询子女就学列表
  189. */
  190. EducationSchool.search = function () {
  191. EducationSchool.table.refresh({query: EducationSchool.formParams()});
  192. };
  193. /**
  194. * 显示审核日志
  195. */
  196. EducationSchool.showLog = function (id) {
  197. layer.open({
  198. type: 1,
  199. title: "日志",
  200. fixed: false,
  201. content: '<table id="' + id + '"></table>',
  202. area: ['80%', '80%'],
  203. maxmin: true,
  204. success: function (layero, index) {
  205. Feng.getCheckLog(id, {"type": CONFIG.project_school, "mainId": id, "typeFileId": "", "active": 1})
  206. }
  207. });
  208. }
  209. /**
  210. * 显示导出
  211. */
  212. EducationSchool.showExportModel = function () {
  213. $("#exportForm")[0].reset();
  214. $("#commonExportModal").modal("show");
  215. }
  216. /**
  217. * 导出
  218. */
  219. EducationSchool.export = function () {
  220. var names = '';
  221. var values = '';
  222. $("#field_info li input").each(function (index) {
  223. if ($(this).is(":checked")) {
  224. values = values + $(this).val() + ",";
  225. names = names + $(this).next().text() + ",";
  226. }
  227. });
  228. var queryData = EducationSchool.formParams();
  229. $("#commonExportModal").modal('hide');
  230. var url = Feng.ctxPath + "/admin/education_school/export?names=" + names + "&values=" + values +
  231. "&isDoctor=" + queryData.isDoctor +
  232. "&year=" + queryData.year +
  233. "&enterpriseName=" + queryData.enterpriseName +
  234. "&pName=" + queryData.pName +
  235. "&pSex=" + queryData.pSex +
  236. "&pIdcard=" + queryData.pIdcard +
  237. "&talentArrange=" + queryData.talentArrange +
  238. "&certificateNo=" + queryData.certificateNo +
  239. "&address=" + queryData.address +
  240. "&phone=" + queryData.phone +
  241. "&project=" + queryData.project +
  242. "&cName=" + queryData.cName +
  243. "&cSex=" + queryData.cSex +
  244. "&cIdcard=" + queryData.cIdcard +
  245. "&cRelation=" + queryData.cRelation +
  246. "&nowSchool=" + queryData.nowSchool +
  247. "&nowGrade=" + queryData.nowGrade +
  248. "&applySchool=" + queryData.applySchool +
  249. "&companyStreet=" + queryData.companyStreet +
  250. "&houseStreet=" + queryData.houseStreet +
  251. "&checkState=" + queryData.checkState;
  252. window.location.href = encodeURI(encodeURI(url));
  253. }
  254. $(function () {
  255. var defaultColunms = EducationSchool.initColumn();
  256. var table = new BSTable(EducationSchool.id, "/admin/education_school/list", defaultColunms);
  257. table.setPaginationType("server");
  258. table.setOnDblClickRow(function () {
  259. EducationSchool.toCheckPage();
  260. });
  261. EducationSchool.table = table.init();
  262. //批量加载字典表数据
  263. var arr = [
  264. {"name": "companyStreet", "code": "street"},
  265. {"name": "houseStreet", "code": "street"},
  266. {"name": "talentArrange", "code": "talent_arrange"},
  267. {"name": "cRelation", "code": "education_relation"},
  268. {"name": "nowGrade", "code": "education_grade"},
  269. {"name": "project", "code": "education_project"},
  270. {"name": "applySchool", "code": "education_school_pool"}];
  271. Feng.findChildDictBatch(JSON.stringify(arr));
  272. $("#applySchool").on('chosen:ready', function (e, params) {
  273. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  274. });
  275. $("#applySchool").chosen({
  276. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  277. disable_search: false,
  278. width: "100%",
  279. enable_split_word_search: true
  280. });
  281. });