123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- var SupervisionTypeID = $("#SupervisionTypeID").combobox("getValue");
- if (SupervisionTypeID == evaluation) {
- $("#OtherTarget").hide();
- $("#UserID").show();
- $("#coursetd").show();
- $("#coursetd2").show();
- $("#coursenull").hide();
- $("#totalScorered").show();
- $("#coursered").show();
- } else {
- $("#OtherTarget").show();
- $("#UserID").hide();
- $("#coursetd").hide();
- $("#coursetd2").hide();
- $("#coursenull").show();
- $("#totalScorered").hide();
- $("#coursered").hide();
- }
- })
- function SupervisionTypeSelect() {
- var SupervisionTypeID = $("#SupervisionTypeID").combobox("getValue");
- if (SupervisionTypeID == evaluation) {
- $("#OtherTarget").hide();
- $("#UserID").show();
- $("#coursetd").show();
- $("#coursetd2").show();
- $("#coursenull").hide();
- $("#totalScorered").show();
- $("#coursered").show();
- } else {
- $("#OtherTarget").show();
- $("#UserID").hide();
- $("#coursetd").hide();
- $("#coursetd2").hide();
- $("#coursenull").show();
- $("#totalScorered").hide();
- $("#coursered").hide();
- }
- }
- function ProjectRecord_Upload() {
- var projectRecordID = $("#ProjectRecordID").val();
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectRecord/Upload?projectRecordID=" + projectRecordID + "&MNU=" + mnu;
- $.popupTopWindow('附件上传', redirectTo, 700, 400, setAttachment);
- }
- function setAttachment() {
- $.ajaxSetup({
- async: false
- });
- var fileList;
- var projectRecordID = $("#ProjectRecordID").val();
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/GetFileListByProjectRecordID', { projectRecordID: projectRecordID }, function (data) {
- fileList = data;
- });
- var count = fileList.length;
- var nameStr = "";
- var detailID;
- for (var i = 0; i < count; i++) {
- detailID = fileList[i].FormID;
- var name = fileList[i].FileName;
- nameStr = nameStr + "、" + name;
- }
- if (detailID != null) {
- $("#IsChangeAttachment").val(1);
- }
- nameStr = nameStr.substr(1, (nameStr.length - 1));
- $("#AttachmentName").val(nameStr);
- }
- function ProjectRecord_Save() {
- var Content = $("#Content").val();
- var Advise = $("#Advise").val();
- var SupervisionTypeID = $("#SupervisionTypeID").combobox("getValue");
- var user = $("#UserID").combogridX("getValue");
- var course = $("#CoursematerialID").combogridX("getValue");
- var totalScore = $("#TotalScore").val();
- var otherTarget = $("#OtherTarget").val();
- //只留提示实际不限制
- // if (Content.length < 100) {
- // $.messager.alert("系统提示", "督导情况字数不能小于100。");
- // return;
- // }
- // if (Advise.length < 60) {
- // $.messager.alert("系统提示", "建议或结果字数不能小于60。");
- // return;
- // }
- if (SupervisionTypeID == evaluation) {
- if (user == nonSelect) {
- $.messager.alert("系统提示", "督导对象不能为空。");
- return;
- }
- if (course == nonSelect) {
- $.messager.alert("系统提示", "课程不能为空。");
- return;
- }
- if (totalScore == "" || totalScore == null) {
- $.messager.alert("系统提示", "综合评分不能为空。");
- return;
- }
- }
- else {
- if (otherTarget == "" || otherTarget == null) {
- $.messager.alert("系统提示", "督导对象不能为空。");
- return;
- }
- }
- var nowDate = new Date().format('yyyy-MM-dd');
- var ProjectDate = $("#ProjectDate").val();
- if (ProjectDate > nowDate) {
- $.messager.alert("系统信息", "只能选择当前时间和之前时间的督导时间。");
- return;
- }
- $(document.forms[0]).submit();
- }
- function ProjectDateChange(dp) {
- var week = new Date(dp.cal.newdate.y, dp.cal.newdate.M - 1, dp.cal.newdate.d).getDay();
- $("[comboname='Weekday']").combobox('setValue', week);
- }
- //选中的督导组成员
- function validChoose() {
- var d = [];
- $.each($("#dgTeacherList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- function ProjectRecord_AddStaff() {
- $.popupTopWindow('教师信息', CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/TeacherSelect?FromMNU=' + mnu, 900, 500, AddTeachers_Confirm);
- }
- function ProjectRecord_DeleteStaff() {
- var d = validChoose();
- var teacherViewList = $("#dgTeacherList").cmsXDataTable("getRows");
- var i, j;
- var len = teacherViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (teacherViewList[i].UserID == d[j].UserID) {
- teacherViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgTeacherList").cmsXDataTable("loadData", { rows: teacherViewList, total: teacherViewList.length });
- }
- function AddTeachers_Confirm(teacherList) {
- if (!teacherList) return;
- var teacherViewList = $("#dgTeacherList").cmsXDataTable("getRows");
- $.each(teacherList, function (index, value) {
- if ($.grep(teacherViewList, function (row, index) { return value.UserID == row.UserID; }).length == 0) {
- teacherViewList.push({
- UserID: value.UserID,
- LoginID: value.LoginID,
- Name: value.Name,
- CollegeID: value.CollegeID,
- CollegeName: value.CollegeName,
- BirthDate: value.BirthDate,
- TeacherType: value.TeacherType,
- TeacherTypeName: value.TeacherTypeName,
- IncumbencyState: value.IncumbencyState,
- IncumbencyStateName: value.IncumbencyStateName,
- Title: value.Title,
- TitleName: value.TitleName,
- TeachingMethod: 0, //默認选取的数据为主讲课
- TeachingMethodDesc: null,
- SexName: value.SexName,
- DepartmentName: value.DepartmentName,
- DepartmentID: value.DepartmentID
- });
- }
- });
- $("#dgTeacherList").cmsXDataTable("loadData", { rows: teacherViewList, total: teacherViewList.length });
- }
- function ProjectRecord_SeletcAdvise() {
- $.popupTopWindow('评价建议', CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/SelectAdvise?FromMNU=' + mnu, 900, 500, AddAdvise);
- }
- function AddAdvise(data) {
- var advise = $("#Advise").val();
- data = advise + ";" + data;
- if (advise == "" || advise == null) {
- data = data.substr(1, (data.length - 1));
- }
- $("#Advise").val(data);
- }
|