瀏覽代碼

学生学籍功能打印

临城职教中职
ndbs 2 年之前
父節點
當前提交
095ec541a4
共有 2 個檔案被更改,包括 173 行新增237 行删除
  1. +17
    -48
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs
  2. +156
    -189
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/printxjk.cshtml

+ 17
- 48
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs 查看文件

@@ -163,59 +163,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View(new StuInfoBasicEntity());
}
//头像
stuInfoBasicEntity.Photo = annexesFileIbll.GetEntityByFolderId(stuInfoBasicEntity.Photo)?.F_FilePath;
if (!string.IsNullOrEmpty(stuInfoBasicEntity.Photo))
{
stuInfoBasicEntity.Photo = stuInfoBasicEntity.Photo.Substring(stuInfoBasicEntity.Photo.IndexOf("Resource") - 1);
}
//#region 获取附件名称
//if (dispatchEntity.AttachmentName != null)
//{
// string str = "";
// string[] array = annexesFileIBLL.GetFileNames(dispatchEntity.AttachmentName).Split(',');
// if (array.Length > 0)
// {
// for (int i = 0; i < array.Length; i++)
// {
// if (array[i].Trim() != "")
// {
// str += array[i].Substring(0, array[i].IndexOf(".")) + ",";
// }
// }
// str.TrimEnd(',');
// }
// dispatchEntity.Reasons = str;
//}
//#endregion

//#region 获取校长的签名盖章+ 批示+时间+阅
////var listTaskLog = nWFTaskIBLL.GetLogList(dispatchEntity.processId);
//var firstList = nWFTaskIBLL.GetLogList(dispatchEntity.processId).OrderBy(o => o.F_CreateDate).ToList();
//for (int i = 1; i < firstList.Count; i++)
//{
// if (i == 1)
// {
// dispatchEntity.Render = firstList[i].F_Des;
// ViewBag.pSList += firstList[i].F_CreateUserName + firstList[i].F_CreateDate + "阅" + "&";
// }
//}
//var PrintList = nWFTaskIBLL.GetLogList(dispatchEntity.processId).GroupBy(o => o.F_CreateUserName).Select(o => new
//{
// F_CreateDate = o.FirstOrDefault().F_CreateDate,
// F_CreateUserName = o.FirstOrDefault().F_CreateUserName,
//});
//var newList = PrintList.Where(s => PrintList.Select(mo => mo.F_CreateDate).Contains(s.F_CreateDate)).OrderBy(s => s.F_CreateDate).ToList();
//for (int i = 1; i < newList.Count; i++)
//{
// if (!ViewBag.pSList.Contains(newList[i].F_CreateUserName))
// {
// ViewBag.pSList += newList[i].F_CreateUserName + newList[i].F_CreateDate + "阅" + "&";
// }
//}
//ViewBag.pSList = ViewBag.pSList.TrimEnd('&');
//ViewBag.pSList = new List<string>(ViewBag.pSList.Split('&'));
//#endregion
//学习成绩
stuInfoBasicEntity.StuScoreClassOneList = stuScoreIBLL.GetAllScoreListByStuNo(stuInfoBasicEntity.StuNo)
.Where(x => x.AcademicYearNo != null && x.Semester != null && x.Score != null)
.GroupBy(x => new { x.AcademicYearNo, x.Semester })
.Select(x => new StuScoreClassOne()
{
AcademicYearNo = x.Key.AcademicYearNo,
Semester = x.Key.Semester,
StuScoreList = x.Select(y => new StuScoreEntity()
{
LessonNo = y.LessonNo,
LessonName = y.LessonName,
Score = y.Score
}).OrderBy(xx => xx.LessonNo).ToList()
}).OrderBy(xx => xx.AcademicYearNo).ThenBy(xx => xx.Semester).ToList();

return View(stuInfoBasicEntity);
}



+ 156
- 189
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/printxjk.cshtml 查看文件

@@ -61,14 +61,25 @@
word-break: normal; */
page-break-after: always;
}
media print {
.pageBreak {
page-break-after: always;
}

.noPrint {
display: none;
.btn {
width: 100px;
height: 34px;
line-height: 34px;
text-align: center;
margin: 30px auto;
border: 1px solid #ccc;
cursor: pointer;
border-radius: 4px;
}

.tableBox {
width: 90%;
margin: 30px auto;
}
</style>
</head>
@@ -90,13 +101,13 @@
<td id="GenderNo">@Model.GenderNo</td>
<td>出生日期</td>
<td>@(Model.Birthday.HasValue ? Model.Birthday.Value.ToShortDateString().Replace("/", "-") : "")</td>
<td rowspan="3"><img src="@Model.Photo" alt="" /></td>
<td rowspan="3"><img src="@Model.Photo" style="width: 80%;" alt="" /></td>
</tr>
<tr>
<td>民族</td>
<td id="NationalityNo">@Model.NationalityNo</td>
<td>政治面貌</td>
<td>@Model.PartyFaceNo</td>
<td id="PartyFaceNo">@Model.PartyFaceNo</td>
<td>班级</td>
<td id="ClassNo">@Model.ClassNo</td>
</tr>
@@ -120,19 +131,19 @@
<td>入学年月</td>
<td>@(Model.EntranceDate.HasValue ? Model.EntranceDate.Value.ToShortDateString().Replace("/", "-") : "")</td>
<td>入学方式</td>
<td>@Model.EntranceWay</td>
<td id="EntranceWay">@Model.EntranceWay</td>
<td>学习形式</td>
<td colspan="2">@Model.StudyModality</td>
<td colspan="2" id="StudyModality">@Model.StudyModality</td>
</tr>
<tr>
<td>家庭住址</td>
<td colspan="3">@Model.MailAddress</td>
<td>毕业时间</td>
<td colspan="2">@Model.GraduateYear</td>
<td colspan="2"><input type="text" style="width: 90% ;" /></td>
</tr>
<tr>
<td>异动情况</td>
<td colspan="7"></td>
<td colspan="7"><input type="text" style="width: 100% ;" /></td>
</tr>
<tr>
<td colspan="8">学业成绩</td>
@@ -147,60 +158,48 @@
<td>成绩</td>
</tr>
</table>
@if (Model.StuScoreClassOneList.Count > 0)
{
for (int i = 0; i < Model.StuScoreClassOneList.Count; i++)
{
if (i == 0)
{
<table cellpadding="0" cellspacing="0" id="yi">
@for (int j = 0; j < Model.StuScoreClassOneList[i].StuScoreList.Count; j++)
{

<table cellpadding="0" cellspacing="0" id="yi">
<tr>
<td rowspan="5">第一学期</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
if (j == 0)
{
<tr>
<td rowspan="5">第一学期</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>
@*<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>*@
</tr>
}
else
{
<tr>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>
@*<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].LessonName</td>
<td>@Model.StuScoreClassOneList[i].StuScoreList[j].Score</td>*@
</tr>
}
}
</table>
}

}
}
<table cellpadding="0" cellspacing="0" id="er">
<tr>
<td rowspan="5">第二学期</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="5">第一学期</td>
<td></td>
<td></td>
<td></td>
@@ -405,89 +404,15 @@
</tr>

</table>
</div>
</body>
</html>
<script>
var clientH22 = document.body.clientHeight
var clientH33 = window.screen.availHeight
var scrollH = document.body.scrollHeight
var yiDom = document.getElementById("yi")
var yiH = yiDom.offsetHeight

var erDom = document.getElementById("er")
var erH = erDom.offsetHeight
var sanDom = document.getElementById("san")
var sanH = sanDom.offsetHeight
var siDom = document.getElementById("si")
var siH = siDom.offsetHeight
var wuDom = document.getElementById("wu")
var wuH = wuDom.offsetHeight
var liuDom = document.getElementById("liu")
var liuH = liuDom.offsetHeight
var siNumH = erH + sanH + siH
erDom.classList.add("pageBreak")
if (yiH > 230) {
yiDom.classList.add("pageBreak")
wuDom.classList.add("pageBreak")
}

if (erH > 230) {
yiDom.classList.add("pageBreak")
erDom.classList.remove("pageBreak")
}

if (sanH > 300) {
erDom.classList.remove("pageBreak")
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
}
if (siH > 400) {
siDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
}
if (wuH > 400) {
wuDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")

}
if (liuH > 400) {
wuDom.classList.add("pageBreak")

}

if ((erH + sanH) > 600) {
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
liuDom.classList.remove("pageBreak")
} else
if ((sanH + siH) > 700) {
// siDom.classList.add("pageBreak")
wuDom.classList.remove("pageBreak")
liuDom.classList.remove("pageBreak")
}

if ((siH + wuH) > 700) {
wuDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")
}
console.log("erH", erH)
console.log("sanH", sanH)
console.log("siH", siH)
console.log("wuH", wuH)
console.log("liuH", liuH)

if ((erH + sanH + siH) > 700) {
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.add("pageBreak")
}

</script>
<script>
<div class="btn">打印</div>
<script src="~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js"></script>
<script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script>
<script>
$('.btn').click(function () {
$('.tableBox').jqprint();
})
</script>
<script>
//绑定字典或源的值
function GetDataSourceStr(code, value, text, valueStr, box) {
$(box).html("");
@@ -510,48 +435,6 @@
});
return;
};
function GetDataItemStr(code, valueStr, box) {
$(box).html("");
$.ajax({
url: "/OnlineRegistrate/GetDataItemMap?code=" + code,
async: false,
success: function (msg) {
var msgObject = $.parseJSON(msg);
if (msgObject.code == 200) {
$.each(msgObject.data, function (i, item) {
if (item["F_ItemValue"] == valueStr) {
$(box).html(item["F_ItemName"]);
return;
}
});
} else {
layer.msg(msgObject.info);
}
},
});
return;
};//绑定字典或源的值
function GetDataSourceStr(code, value, text, valueStr, box) {
$(box).html("");
$.ajax({
url: "/OnlineRegistrate/GetDataSourceMap?code=" + code,
async: false,
success: function (msg) {
var msgObject = $.parseJSON(msg);
if (msgObject.code == 200) {
$.each(msgObject.data, function (i, item) {
if (item[value] == valueStr) {
$(box).html(item[text]);
return;
}
});
} else {
layer.msg(msgObject.info);
}
},
});
return;
};
function GetDataItemStr(code, valueStr, box) {
$(box).html("");
$.ajax({
@@ -573,10 +456,94 @@
});
return;
};
GetDataItemStr("usersexbit", "@Model.GenderNo", "#GenderNo");
GetDataItemStr("BCdNationality", "@Model.NationalityNo", "#NationalityNo");
GetDataSourceStr("CdDeptInfo", "deptno", "deptname", "@Model.DeptNo", "#DeptNo");
GetDataItemStr("usersexbit", "@Model.GenderNo.ToString().ToLower()", "#GenderNo");
GetDataItemStr("National", "@Model.NationalityNo", "#NationalityNo");
GetDataItemStr("PolityStatus", "@Model.PartyFaceNo", "#PartyFaceNo");
//GetDataItemStr("EntranceWay", "@Model.EntranceWay", "#EntranceWay");
GetDataItemStr("StudyModality", "@Model.StudyModality", "#StudyModality");
GetDataSourceStr("CdMajorInfo", "majorno", "majorname", "@Model.MajorNo", "#MajorNo");
GetDataSourceStr("bjsj", "classno", "classname", "@Model.ClassNo", "#ClassNo");
</script>
<script>
var clientH22 = document.body.clientHeight
var clientH33 = window.screen.availHeight
var scrollH = document.body.scrollHeight
var yiDom = document.getElementById("yi")
var yiH = yiDom.offsetHeight

var erDom = document.getElementById("er")
var erH = erDom.offsetHeight
var sanDom = document.getElementById("san")
var sanH = sanDom.offsetHeight
var siDom = document.getElementById("si")
var siH = siDom.offsetHeight
var wuDom = document.getElementById("wu")
var wuH = wuDom.offsetHeight
var liuDom = document.getElementById("liu")
var liuH = liuDom.offsetHeight
var siNumH = erH + sanH + siH
erDom.classList.add("pageBreak")
if (yiH > 230) {
yiDom.classList.add("pageBreak")
wuDom.classList.add("pageBreak")
}

if (erH > 230) {
yiDom.classList.add("pageBreak")
erDom.classList.remove("pageBreak")
}

</script>
if (sanH > 300) {
erDom.classList.remove("pageBreak")
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
}
if (siH > 400) {
siDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
}
if (wuH > 400) {
wuDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")

}
if (liuH > 400) {
wuDom.classList.add("pageBreak")

}

if ((erH + sanH) > 600) {
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.remove("pageBreak")
liuDom.classList.remove("pageBreak")
} else
if ((sanH + siH) > 700) {
// siDom.classList.add("pageBreak")
wuDom.classList.remove("pageBreak")
liuDom.classList.remove("pageBreak")
}

if ((siH + wuH) > 700) {
wuDom.classList.add("pageBreak")
liuDom.classList.remove("pageBreak")
}
console.log("erH", erH)
console.log("sanH", sanH)
console.log("siH", siH)
console.log("wuH", wuH)
console.log("liuH", liuH)

if ((erH + sanH + siH) > 700) {
sanDom.classList.add("pageBreak")
siDom.classList.remove("pageBreak")
wuDom.classList.add("pageBreak")
}

</script>
</table>
</div>
</body>
</html>

Loading…
取消
儲存