var refreshGirdData; var StuId; var tempdatra = new Array(); var list = []; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 280, 400); $('#SubmitBtn').on('click', function () { if (!$('body').lrValidform()) { return false; } var entity = $('body').lrGetFormData(); entity.AnomalousType = entity.NewAnomalousType; var selgridtab = $('#selgridtab').jfGridGet('rowdatas'); $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/SaveAgainEntity', { entity: entity, strStuTranEntity: JSON.stringify(selgridtab) }, function (res) { //console.log(res) if (res.code == 200) { setTimeout(function () { location.reload(); }, 100) } // 保存成功后才回调 //if (!!callBack) { // callBack(res); //} } ); }) $('#DeptNo').lrselect({ allowSearch: true, value: "deptno", text: "deptname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', select: function (item) { if (item) { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } }); } else { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "1=1 AND CheckMark=1" } }); } } }); $('#MajorNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', value: "majorno", text: "majorname", param: { strWhere: "1=1 AND CheckMark=1" }, select: function (item) { var Grades = $("#Grade").lrselectGet(); if (Grades != null && Grades != "" && Grades != "undefined") { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#Grade').lrselect({ url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', value: "value", text: "text", select: function (item) { var MajorNos = $("#MajorNo").lrselectGet(); if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#ClassNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }, value: "classno", text: "classname" }); //提交下拉框 $('#AnomalousType').lrDataItemSelect({ code: 'StuChangeType' }); $('#NewDeptNo').lrselect({ allowSearch: true, value: "deptno", text: "deptname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', select: function (item) { if (item) { $('#NewMajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } }); } else { $('#NewMajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "1=1 AND CheckMark=1" } }); } } }); $('#NewMajorNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', value: "majorno", text: "majorname", param: { strWhere: "1=1 AND CheckMark=1" }, select: function (item) { var Grades = $("#NewGrade").lrselectGet(); if (Grades != null && Grades != "" && Grades != "undefined") { if (item) { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" } }); } else { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" } }); } else { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#NewGrade').lrselect({ url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', value: "value", text: "text", select: function (item) { var MajorNos = $("#NewMajorNo").lrselectGet(); if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") { if (item) { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#NewClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#NewClassNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }, value: "classno", text: "classname" }); $('#RecoverWriteMark').lrDataItemSelect({ code: 'YesOrNoInt' }); $('#RecoverStuStatus').lrDataItemSelect({ code: 'YesOrNoInt' }); $('#NewAnomalousType').lrDataItemSelect({ code: 'StuChangeType' }); $('#NewAnomalousType').lrselectSet("16"); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); //查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('StuId'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(',') != -1) { learun.alert.warning("只能选择一条记录进行查看!"); return; } learun.layerForm({ id: 'form', title: '查看', url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue, width: 1162, height: 600, btn: null }); } }); $('#selgridtab').jfGrid({ headData: [ { label: "学号", name: "StuNo", width: 100, align: "left" }, { label: "姓名", name: "StuName", width: 100, align: "left" }, { label: "性别", name: "Gender", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "男" : "女"; } }, { label: "出生日期", name: "Birthday", width: 100, align: "left", ishide: true, formatter: function (value) { return learun.formatDate(value, 'yyyy-MM-dd'); } }, { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" }, { label: "民族", name: "NationalityNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'National', callback: function (_data) { callback(_data.text); } }); } }, { label: "年级", name: "Grade", width: 100, align: "left" }, { label: "系所", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', key: value, keyId: 'deptno', callback: function (_data) { callback(_data['deptname']); } }); } }, { label: "专业", name: "MajorNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } }); } }, { label: "班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', key: value, keyId: 'classno', callback: function (_data) { callback(_data['classname']); } }); } }, { label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'EduSystem', callback: function (_data) { callback(_data.text); } }); } }, { label: "家庭地址", name: "MailAddress", width: 100, align: "left" }, { label: "联系电话", name: "Mobile", width: 100, align: "left" }, { label: "户口所在地", name: "ResidencePlace", width: 100, align: "left" }, { label: "档案所在地", name: "LocationFile", width: 100, align: "left" }, { label: "操作", name: "Delete", width: 100, align: "center", formatter: function (callback, cellvalue, row, op, $cell) { var $div = $('
'); var $hbtn = $(' 移除'); $hbtn.on('click', function () { tempdatra.map((item, index) => { if (item.StuNo == cellvalue.StuNo) { tempdatra.splice(index, 1) } }); //console.log(tempdatra) $('#selgridtab').jfGridSet('refreshdata', tempdatra); }); $div.append($hbtn); return $div; } }, ], mainId: 'AAIId', }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGridLei({ url: top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/GetPageList', headData: [ { label: "学号", name: "StuNo", width: 100, align: "left" }, { label: "姓名", name: "StuName", width: 100, align: "left" }, { label: "性别", name: "Gender", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "男" : "女"; } }, { label: "出生日期", name: "Birthday", width: 100, align: "left", ishide: true, formatter: function (value) { return learun.formatDate(value, 'yyyy-MM-dd'); } }, { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" }, { label: "民族", name: "NationalityNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'National', callback: function (_data) { callback(_data.text); } }); } }, { label: "年级", name: "Grade", width: 100, align: "left" }, { label: "系所", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', key: value, keyId: 'deptno', callback: function (_data) { callback(_data['deptname']); } }); } }, { label: "专业", name: "MajorNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } }); } }, { label: "班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', key: value, keyId: 'classno', callback: function (_data) { callback(_data['classname']); } }); } }, { label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'EduSystem', callback: function (_data) { callback(_data.text); } }); } }, { label: "家庭地址", name: "MailAddress", width: 100, align: "left" }, { label: "联系电话", name: "Mobile", width: 100, align: "left" }, { label: "户口所在地", name: "ResidencePlace", width: 100, align: "left" }, { label: "档案所在地", name: "LocationFile", width: 100, align: "left" }, ], mainId: 'StuId', isPage: true, rows: 100, isMultiselect: true, onSelectRow: function (rowdata, type) { if (type) { list.push(rowdata) let temp = {} list = list.reduce((prev, curv) => { if (temp[curv.StuNo]) { } else { temp[curv.StuNo] = true prev.push(curv) } return prev }, []) //var selectedRow = $('#gridtable').jfGridGet('rowdata'); tempdatra = list $('#selgridtab').jfGridSet('refreshdata', tempdatra); } } }); page.search(); }, search: function (param) { param = param || {}; param.SqlParameter = ' and (AnomalousType=05 or AnomalousType=10 or AnomalousType= 13 or AnomalousType= 14) and IsReturnSchool=0 and F_EnabledMark=1 and id not in(select ReturnSchoolId from StuTransferInfo where ReturnSchoolId is not null ) '; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }