123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421 |
- @using Bowin.Web.Controls.Mvc;
- @using EMIS.Entities;
- @using EMIS.Web.Controls;
- @using EMIS.ViewModel.EvaluationManage.EvaluationEnter
- @using System.Text.RegularExpressions;
- @model EMIS.ViewModel.EvaluationManage.EvaluationEnter.EvaluationEnterView
- @{
- ViewBag.Title = "Edit";
- //List<CreateTable> evaluationTableLsit = ViewData["evaluationTableLsit"] as List<CreateTable>;
- }
- <style>
- .target td div
- {
- font-weight: bold;
- }
-
- #table_EvaluationEnter
- {
- width: 100%;
- }
-
- #table_EvaluationEnter tr
- {
- border: 1px solid #D6D6D6;
- height: 30px;
- }
-
- #table_EvaluationEnter td
- {
- border: 1px solid #D6D6D6;
- }
- .datagrid-body
- {
- overflow-x: hidden; /*去掉左/右边缘滚动条*/
- }
-
- .datagrid-header-row td /*设置grid列标题颜色*/
- {
- background-color: #D6D6D6; /*using (Html.BeginForm())*/
- }
-
- .datagrid-btable .datagrid-cell
- {
- text-overflow: ellipsis;
- }
-
- .div_Content
- {
- margin: 0 auto;
- }
- /*居中评价说明注意事项*/
-
- .div_TableName
- {
- margin: 0 auto;
- width: 400px;
- height: 20px;
- }
- /*评价表名*/
- </style>
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
- @using (Ajax.BeginForm(new AjaxOptions { Url = Url.Action("Edit"), OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" }))
- {
- @Html.HiddenFor(x => x.EducationMissionClassID)
- @Html.HiddenFor(x => x.EvaluationTableID)
- @Html.HiddenFor(x => x.EvaluationEnterID)
- @Html.Hidden("ProjectWeightSum")
- <div class="div_Content">
- <h1 style="text-align: center; color: red;">说明</h1>
- <h4>@ViewBag.ContentStr</h4>
- </div>
- <br />
- <br />
- <div class="div_TableName">
- <h3>@ViewBag.TableName</h3>
- </div>
- <div class="search_list">
- <table cellpadding="0" cellspacing="0" id="table_EvaluationEnter" style="width: 100%">
- <tr style="text-align: center;">
- <td colspan="2" style="width: 70%; color: red; font-size: 14px">
- 准确的评价是你成熟的表现
- </td>
- <td colspan="2" rowspan="4" style="width: 30%">
- <div>
- <img src="@Model.PhotoUrl" id="imgPhoto" width="80" height="100" />
- </div>
- </td>
- </tr>
- <tr style="text-align: center;">
- <td colspan="2" style="width: 60%;">
- 被评教师:@ViewBag.UserNames
- </td>
- </tr>
- <tr style="text-align: center;">
- <td colspan="2" style="width: 60%;">
- 课程名称:@ViewBag.CourseName
- </td>
- </tr>
- <tr style="text-align: center;">
- <td colspan="2" style="width: 60%;">
- 教研室:@ViewBag.Remark
- </td>
- </tr>
- <tr>
- <td colspan="4">
- <div id="dgEvaluationEnterList">
- </div>
- </td>
- </tr>
- <tr>
- <td style="color: red; border: 0px;">
- 简要评语或建议:
- </td>
- <td colspan="3" align="left" style="border: 0px;">@Html.TextAreaFor(x => x.Remark, new Dictionary<string, object> { { "style", "width:300px;" } })
- </td>
- </tr>
- <tr>
- @Html.HiddenFor(x => x.EvaluationScore)
- @Html.HiddenFor(x => x.ProjectID)
- @Html.HiddenFor(x => x.jsonDataStr)
- <td style="border: 0px">
- 你的评价分数为:<span style="color: red;" id="EvaluationScoreSp">0</span>@Html.HiddenFor(x => x.TotalScore, new Dictionary<string, object> { { "id", "TotalScore" } })
- </td>
- <td style="border: 0px">
- </td>
- </tr>
- <tr>
- <td style="border: 0px">
- 限评次数为:@ViewBag.LimitMore 次;您对此已评:@ViewBag.YP 次
- </td>
- <td style="border: 0px">
- </td>
- </tr>
- <tr>
- <td style="border: 0px">
- </td>
- <td align="center" style="border: 0px">
- <input type="button" onclick="EvaluationEnter_Save()" value="保存" id="btnclick" />
- <input type="button" class="button" value="关闭" onclick="EvaluationEnter_Close()">
- </td>
- </tr>
- </table>
- </div>
- }
- </div>
- @section scripts{
- <script type="text/javascript">
- var tableIDs = '@ViewBag.EvaluationTableID';
- var evaluationEnterID = '@ViewBag.evaluationEnterID';
- var educationMissionClassIDs = '@ViewBag.EducationMissionClassID';
- var dataColums = Invoke("/EvaluationEnter/GetTitle", null, "jsonp", function (re) { });
- var dataList = Invoke("/EvaluationEnter/GetList?tableID=" + tableIDs + "&evaluationEnterID=" + evaluationEnterID, null, "jsonp", function (re) { });
- if (dataColums != undefined && dataColums != null && dataList != undefined && dataList != null) {
- var jsonData = { rows: eval("[" + dataList.rows + "]"), total: dataList.total };
- var colums = eval("[" + dataColums.UpTitle + "]");
- $("#dgEvaluationEnterList").datagrid({
- columns: [[
- { field: 'OrderID', title: '次序', width: 150, align: 'center' },
- { field: 'ProjectName', title: '评价项目', width: 300, align: 'center', formatter: formatCellTooltip },
- { field: 'NormNameProjectID', title: '评价项目ID', width: 100, align: 'center' },
- { field: 'TargetID', title: '评价指标ID', width: 100, align: 'center' },
- { field: 'TargetWeight', title: '评价指标分数', width: 100, align: 'center' },
- { field: 'Weight', title: '权重', width: 100, align: 'center' },
- { field: 'NormNames', title: '评分标准', width: 250, align: 'center' }]],
- data: jsonData,
- singleSelect: true,
- rownumbers: false,
- showFooter: true,
- striped: 'True',
- nowrap: true,
- fitColumns: false,
- rowStyler: function (index, row) {
- if (isNaN(row.OrderID)) {
- return 'color:blue;';
- }
- },
- onClickRow: function (rowIndex, field, value) {
- //onClickSum(rowIndex, field, value);
- }
- });
- $('#dgEvaluationEnterList').datagrid('hideColumn', 'TargetWeight');
- $('#dgEvaluationEnterList').datagrid('hideColumn', 'NormNameProjectID');//隐藏评价项目ID列
- $('#dgEvaluationEnterList').datagrid('hideColumn', 'TargetID');//隐藏评价指标ID列
- }
- //格式化单元格提示信息
- function formatCellTooltip(val, rec) {
- return "<span title='" + val + "'>" + val + "</span>";
- }
- //保存
- function EvaluationEnter_Save() {
- // var radioButtonObject = $("input:radio[name^='radioButtonName_']").not("input:checked") //获取没有选中值~~
- var totalScore = $("#EvaluationScoreSp").text();
- $("#TotalScore").val(totalScore);
- var radioButtonCount = $("input:radio[name^='radioButtonName_']:checked"); //获取所有选中值~~
- if (radioButtonCount.length != Xzcount()) {
- $.messager.alert("系统提示", "评分没有评选完毕!");
- return;
- }
- $(document.forms[0]).submit();
-
- //EvaluationEnter_Close();//保存直接关闭窗口
- }
- //关闭窗口
- function EvaluationEnter_Close() {
- top.$("#@(Request["WindowID"])").dialog("close");//关闭窗口
- }
- function Xzcount() {
- var rows = $("#dgEvaluationEnterList").datagrid("getRows");//获取全部数据
- var total = "";
- for (var i = 0; i < rows.length; i++) {
- if (rows[i]['ProjectName'] != "") {
- total += rows[i]['ProjectName'] + "&"; //获取指定列
- }
- }
- if (total.length > 0) {
- total = total.substr(0, total.length - 1);
- }
- return total.split('&').length;
- }
-
- function getSum(total, num) {
- return total + num;
- }
- //选中时改变评分值
- function getonclick(obj) {
- //Loadinfo();
- var CodeSum = new Array();
- var jsonStr = "";
- var tableWeight = '@ViewBag.TableWeight';//评价表格
- var rows = $("#dgEvaluationEnterList").datagrid("getRows");//获取全部数据
- var orderID = $(obj).closest("tr").find("td[field='OrderID'] div").text();//序号ID
- var normNameProjectID = $(obj).closest("tr").find("td[field='NormNameProjectID'] div").text();
- var targetWeight = $(obj).closest("tr").find("td[field='TargetWeight'] div").text();//评价指标分数
- var weight = $(obj).closest("tr").find("td[field='Weight'] div").text();//项目分数
- var targetID = $(obj).closest("tr").find("td[field='TargetID'] div").text();
- var allZb = $.grep(rows, function (x) { return (x.NormNameProjectID == ""); });
- var brothers = $.grep(rows, function (x) { return (x.TargetID == targetID); })
- var xmqzdate = $.grep(rows, function (x) { return (x.TargetID == targetID && x.NormNameProjectID != ""); });//Sum(评价项目权重)
- var xmqzSum = 0;
- var targetWeightSum = 0;
- var totalSum = 0;
- var radioButtonObject = $("input:radio[name^='radioButtonName_']:checked") //获取所有选中值~~
- for (var j = 0; j < xmqzdate.length; j++) {
- var xmqzfs = xmqzdate[j].Weight;
- xmqzSum += parseInt(xmqzfs);
- }
- for (var k = 0; k < allZb.length; k++) {
- var pgfs = allZb[k].Weight;
- targetWeightSum += parseInt(pgfs);
- }
- var zb = 0;
- var bg = 0;
- debugger;
- for (var h = 0; h < radioButtonObject.length; h++) {
- var qzxmf = radioButtonObject.parent().parent().prev().prev().find("div").eq(h).html();//评价权重
- var qz = radioButtonObject.parent().parent().prev().find("div").eq(h).html();//项目权重数据
- var pjxmID = radioButtonObject.parent().parent().prev().prev().prev().prev().find("div").eq(h).html();//评价项目ID
- var xm = radioButtonObject[h].value / 100 * qz;
- zb = xm / xmqzSum * qzxmf/*指标权重*/;
- bg = zb / targetWeightSum * parseInt(tableWeight);
- CodeSum.push(bg.toFixed(5));
- jsonStr += "{ \"ProjectID\":\"" + pjxmID + "\",\"EvaluationScore\":\"" + radioButtonObject[h].value + "\"}" + ","; //拼接json、返回后台操作
- }
- var jsonData = "[ " + jsonStr + " ]";
- for(var z = 0; z < CodeSum.length; z++){
- totalSum = totalSum + parseFloat(CodeSum[z]);
- }
- $("#EvaluationScoreSp").html(((totalSum * 100) / 100).toFixed(2));
- $("#jsonDataStr").val(jsonData);
- $("#EvaluationEnterID").val('@ViewBag.evaluationEnterID')
- $("#EducationMissionClassID").val('@ViewBag.EducationMissionClassID')
- }
- //页面元素加载完成在执行
- $(document).ready(function () {
- if ('@ViewBag.IsEvaluation' == "False") {
- $("#btnclick").attr("disabled", true);//按钮不可点击
- }
- Loadinfo();
- })
- function Loadinfo() {
- //1.选中的评分标准权重/100*评价项目权重=评价项目分数;
- //2.Sum(评价项目分数)/Sum(评价项目权重)*评价指标权重=评价指标分数;
- //3.Sum(评价指标分数)/Sum(评价指标权重)*评价表格权重=评价表格分数;
- var radioButtonObject = $("input:radio[name^='radioButtonName_']:checked") //获取所有选中值~~
- var rows = $("#dgEvaluationEnterList").datagrid("getRows");//获取全部数据
- //求取评价指标分数
- var jsonStr = "";
- var evaluationScore = 0;//评价项目分数
- var zbScore = 0;//评价指标分数
- var bgScore = 0;//评价表格分数
- var arrList = new Array();
- var newarrList = new Array();
- var xmqzarrList = new Array();
- var pjzbfsArry = new Array();
- var pjxmID = null;
- var pjzbfs = 0;
- for (var k = 0; k < radioButtonObject.length; k++) {
- var str = radioButtonObject[k].name;
- var strindex = str.lastIndexOf("_") + 1;
- var sNewStr = str.substring(strindex);
- arrList.push(sNewStr);//将评价指标权重加入数组记录起来
- }
- var pjzbSum = "";
- arrList.sort();
- newarrList = $.unique(arrList);//去除重复元素、新指标权重
- var targetIDs = newarrList.join(','); //获取指标这个数组的和
- if (targetIDs != "") {
- $.ajax({
- type: "POST",
- url: "/EvaluationEnter/GetWeightSum",
- data: { targetIDs: targetIDs },
- dataType: "json",
- async: false,
- success: function (result) {
- //将返回数据添加到页面表格中
- $("#ProjectWeightSum").val(result);
- }
- });
- }
- pjzbSum = $("#ProjectWeightSum").val();
- var zb = 0;
- var bg = 0;
- var tableWeight = '@ViewBag.TableWeight';//评价表格
- var CodeSum = new Array();
- var ProjectSum = 0;
- for (var i = 0; i < radioButtonObject.length; i++) {
- var qzxmf = radioButtonObject.parent().parent().prev().prev().find("div").eq(i).html();//评价权重
- var qz = radioButtonObject.parent().parent().prev().find("div").eq(i).html();//项目权重数据
- pjxmID = radioButtonObject.parent().parent().prev().prev().prev().prev().find("div").eq(i).html();//评价项目ID
- var targetID = $(radioButtonObject[i]).closest("tr").find("td[field='TargetID'] div").text();
- if (targetIDs != "") {
- $.ajax({
- type: "POST",
- url: "/EvaluationEnter/GetProjectWeightSum",
- data: { targetID: targetID },
- dataType: "json",
- async: false,
- success: function (result) {
- ProjectSum = result;
- //将返回数据添加到页面表格中
- }
- });
- }
- var pfbz = radioButtonObject[i].value;
- var xm = radioButtonObject[i].value / 100 * qz;
- zb = xm / parseInt(ProjectSum) * qzxmf/*指标权重*/;
- bg = zb / parseInt(pjzbSum) * parseInt(tableWeight);
- CodeSum.push(bg.toFixed(5));
- evaluationScore += pfbz / 100 * qz
- pjzbfs = ((pfbz / 100) * qz) / 100 * (qzxmf)
- pjzbfsArry.push(pjzbfs.toFixed(2));
- xmqzarrList.push(qz);//记录项目权重
- jsonStr += "{ \"ProjectID\":\"" + pjxmID + "\",\"EvaluationScore\":\"" + pfbz + "\"}" + ","; //拼接json、返回后台操作
- }
- jsonStr = jsonStr.substring(0, jsonStr.length - 1);
- var jsonData = "[ " + jsonStr + " ]";
- var SumValue = eval(CodeSum.join('+')) //获取项目权重这个数组的和
- // var sum = eval(pjzbfsArry.join('+')) //获取项目权重这个数组的和
- var TableWeight = '@ViewBag.TableWeight';
- var st = 0;
- $("#EvaluationScoreSp").html(((SumValue * 100) / 100).toFixed(2));
- if ($("#EvaluationScoreSp").html() == "NaN") {
- $("#EvaluationScoreSp").html(0);
- }
- $("#EvaluationScore").val(evaluationScore);
- $("#ProjectID").val(pjxmID);
- $("#jsonDataStr").val(jsonData);
- $("#EvaluationEnterID").val('@ViewBag.evaluationEnterID')
- $("#EducationMissionClassID").val('@ViewBag.EducationMissionClassID')
- }
-
- Number.prototype.toFixed2 = function () {
- return parseFloat(this.toString().replace(/(\.\d{2})\d+$/, "$1"));
- }
- </script>
- }
|