123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- /**
- * 子女就学管理初始化
- */
- var EducationSchool = {
- id: "EducationSchoolTable", //表格id
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- /**
- * 初始化表格的列
- */
- EducationSchool.initColumn = function () {
- return [
- {field: 'selectItem', radio: true},
- {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
- {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
- {title: '父母姓名', field: 'pName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
- {title: '父母性别', field: 'pSex', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip',
- formatter: function (value, row, index) {
- if (value == 1) {
- return '男';
- }
- if (value == 2) {
- return '女';
- }
- }
- },
- {title: '父母证件号码', field: 'pIdcard', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
- {title: '工作单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
- {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
- {title: '认定条件', field: 'identifyCondition', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
- {title: '人才证书有效期', field: 'certificateNo', visible: true, align: 'center', valign: 'middle', width: "140px", 'class': 'uitd_showTip',
- formatter: function (value, row, index) {
- return row.certificateStartTime + "至" + row.qzgccrcActiveTime;
- }
- },
- {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
- {title: '子女姓名', field: 'cName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '子女性别', field: 'cSex', visible: true, align: 'center', valign: 'middle', width: "80px",
- formatter: function (value, row, index) {
- if (value == 1) {
- return '男';
- }
- if (value == 2) {
- return '女';
- }
- }
- },
- {title: '与申报人关系', field: 'cRelationName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '现就读学校', field: 'nowSchool', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '现就读年级', field: 'nowGradeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '拟申请学校', field: 'applySchoolName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
- {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
- formatter: function (value, row, index) {
- if (value == -2) {
- return '<span class="label label-default">待提交</span>';
- }
- if (value == -1) {
- return '<span class="label label-danger">审核不通过</span>';
- }
- if (value == 1) {
- return '<span class="label label-success">待审核</span>';
- }
- if (value == 2) {
- return '<span class="label label-danger">审核驳回</span>';
- }
- if (value == 3) {
- return '<span class="label label-primary">审核通过</span>';
- }
- if (value == 9) {
- return '<span class="label label-success">重新提交</span>';
- }
- }
- },
- {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
- formatter: function (value, row, index) {
- return "<span class='label label-success' onclick=\"EducationSchool.showLog('" + value + "')\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- }
- ];
- };
- /**
- * 检查是否选中
- */
- EducationSchool.check = function () {
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if (selected.length == 0) {
- Feng.info("请先选中表格中的某一记录!");
- return false;
- } else {
- EducationSchool.seItem = selected[0];
- return true;
- }
- };
- /**
- * 审核
- */
- EducationSchool.toCheckPage = function () {
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '子女就学申报',
- area: 'auto', //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/admin/education_school/detail/id/' + EducationSchool.seItem.id,
- btn: ['<i class="fa fa-eye"></i> 保存未提交', '<i class="fa fa-check layui-bg-green"></i> 提交审核', '<i class="fa fa-eraser"></i> 取消'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.EducationSchoolInfoDlg.showCheckModal();
- }, btn2: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.EducationSchoolInfoDlg.submitCheck();
- return false;
- },
- success: function (layero, index) {
- layer.tips('审核完成并确认无误后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
- },
- end: function () {
- layer.closeAll('tips');
- }
- });
- EducationSchool.layerIndex = index;
- layer.full(index);
- }
- };
- /**
- * 收集数据
- */
- EducationSchool.formParams = function () {
- var queryData = {};
- queryData['year'] = $("#year").val();
- queryData['enterpriseName'] = $("#enterpriseName").val();
- queryData['pName'] = $("#pName").val();
- queryData['pSex'] = $("#pSex").val();
- queryData['pIdcard'] = $("#pIdcard").val();
- queryData['talentArrange'] = $("#talentArrange").val();
- queryData['certificateNo'] = $("#certificateNo").val();
- queryData['address'] = $("#address").val();
- queryData['phone'] = $("#phone").val();
- queryData['project'] = $("#project").val();
- queryData['cName'] = $("#cName").val();
- queryData['cSex'] = $("#cSex").val();
- queryData['cIdcard'] = $("#cIdcard").val();
- queryData['cRelation'] = $("#cRelation").val();
- queryData['nowSchool'] = $("#nowSchool").val();
- queryData['nowGrade'] = $("#nowGrade").val();
- queryData['applySchool'] = $("#applySchool").val();
- queryData['companyStreet'] = $("#companyStreet").val();
- queryData['houseStreet'] = $("#houseStreet").val();
- queryData['checkState'] = $("#checkState").val();
- queryData['isDoctor'] = $("#isDoctor").val();
- return queryData;
- }
- /**
- * 重置
- */
- EducationSchool.reset = function () {
- $("#year").val("");
- $("#isDoctor").val("");
- $("#enterpriseName").val("");
- $("#pName").val("");
- $("#pSex").val("");
- $("#pIdcard").val("");
- $("#talentArrange").val("");
- $("#certificateNo").val("");
- $("#address").val("");
- $("#phone").val("");
- $("#project").val("");
- $("#cName").val("");
- $("#cSex").val("");
- $("#cIdcard").val("");
- $("#cRelation").val("");
- $("#nowSchool").val("");
- $("#nowGrade").val("");
- $("#applySchool").val("").trigger("chosen:updated");
- $("#companyStreet").val("");
- $("#houseStreet").val("");
- $("#checkState").val("");
- }
- /**
- * 查询子女就学列表
- */
- EducationSchool.search = function () {
- EducationSchool.table.refresh({query: EducationSchool.formParams()});
- };
- /**
- * 显示审核日志
- */
- EducationSchool.showLog = function (id) {
- layer.open({
- type: 1,
- title: "日志",
- fixed: false,
- content: '<table id="' + id + '"></table>',
- area: ['80%', '80%'],
- maxmin: true,
- success: function (layero, index) {
- Feng.getCheckLog(id, {"type": CONFIG.project_school, "mainId": id, "typeFileId": "", "active": 1})
- }
- });
- }
- /**
- * 显示导出
- */
- EducationSchool.showExportModel = function () {
- $("#exportForm")[0].reset();
- $("#commonExportModal").modal("show");
- }
- /**
- * 导出
- */
- EducationSchool.export = function () {
- var names = '';
- var values = '';
- $("#field_info li input").each(function (index) {
- if ($(this).is(":checked")) {
- values = values + $(this).val() + ",";
- names = names + $(this).next().text() + ",";
- }
- });
- var queryData = EducationSchool.formParams();
- $("#commonExportModal").modal('hide');
- var url = Feng.ctxPath + "/admin/education_school/export?names=" + names + "&values=" + values +
- "&isDoctor=" + queryData.isDoctor +
- "&year=" + queryData.year +
- "&enterpriseName=" + queryData.enterpriseName +
- "&pName=" + queryData.pName +
- "&pSex=" + queryData.pSex +
- "&pIdcard=" + queryData.pIdcard +
- "&talentArrange=" + queryData.talentArrange +
- "&certificateNo=" + queryData.certificateNo +
- "&address=" + queryData.address +
- "&phone=" + queryData.phone +
- "&project=" + queryData.project +
- "&cName=" + queryData.cName +
- "&cSex=" + queryData.cSex +
- "&cIdcard=" + queryData.cIdcard +
- "&cRelation=" + queryData.cRelation +
- "&nowSchool=" + queryData.nowSchool +
- "&nowGrade=" + queryData.nowGrade +
- "&applySchool=" + queryData.applySchool +
- "&companyStreet=" + queryData.companyStreet +
- "&houseStreet=" + queryData.houseStreet +
- "&checkState=" + queryData.checkState;
- window.location.href = encodeURI(encodeURI(url));
- }
- $(function () {
- var defaultColunms = EducationSchool.initColumn();
- var table = new BSTable(EducationSchool.id, "/admin/education_school/list", defaultColunms);
- table.setPaginationType("server");
- table.setOnDblClickRow(function () {
- EducationSchool.toCheckPage();
- });
- EducationSchool.table = table.init();
- //批量加载字典表数据
- var arr = [
- {"name": "companyStreet", "code": "street"},
- {"name": "houseStreet", "code": "street"},
- {"name": "talentArrange", "code": "talent_arrange"},
- {"name": "cRelation", "code": "education_relation"},
- {"name": "nowGrade", "code": "education_grade"},
- {"name": "project", "code": "education_project"},
- {"name": "applySchool", "code": "education_school_pool"}];
- Feng.findChildDictBatch(JSON.stringify(arr));
- $("#applySchool").on('chosen:ready', function (e, params) {
- $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
- });
- $("#applySchool").chosen({
- search_contains: true, //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
- disable_search: false,
- width: "100%",
- enable_split_word_search: true
- });
- });
|