educationSchool.js 11 KB

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