diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx index 6128036..3dde025 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx @@ -14,6 +14,13 @@ color: #fff; } + .f-grid-row.color2, + .f-grid-row.color2 .f-icon, + .f-grid-row.color2 a { + background-color: red; + color: #fff; + } + .f-rate .f-rate-star.f-rate-star-half .f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full .f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full .f-rate-star-second .f-rate-star-icon { color: #cc0033; @@ -22,7 +29,6 @@ .f-grid-cell.ycl .f-grid-cell-inner { display: none; } - @@ -67,8 +73,8 @@ - - + + @@ -141,7 +147,7 @@ + PageSize="15" EnableRowSelectEvent="true" Height="200px" OnRowDataBound="Grid2_RowDataBound"> @@ -164,6 +170,12 @@ + + + + + @@ -195,8 +207,9 @@ } F.ready(function () { var grid1 = F(grid1ClientID); - var control1 = '<%=this.hidMaxScore1.ClientID%>'; - var control2 = '<%=this.hidMaxScore2.ClientID%>'; + var control1 = '<%=hidMaxScore1==null?"":hidMaxScore1.ClientID%>'; + var control2 = '<%=hidMaxScore2==null?"":hidMaxScore2.ClientID%>'; + // 注册评分事件 F.rateEvents(grid1.el, function (event, value) { var target = $(event.target); @@ -208,18 +221,21 @@ var maxScore1 = grid1.getItem(control1).value; //获取控件值2() var maxScore2 = grid1.getItem(control2).value; + console.log(grid1.getPrevCellEl(cellEl)); + // 用户EHSS + if (columnName == "Score3" && value > parseFloat(maxScore1)) { + F.alert("最大只能评" + maxScore1 + "星"); + var html = F.rateHtml(0, { + allowClear: true, + allowHalf: true, + textVisible: false + }); + grid1.getCellEl(rowId, columnId).html(html) + } - if (columnName = "Score1" && value >= parseFloat(maxScore1)) { - F.alert("最大只能评" + maxScore1 + "分"); - var html = F.rateHtml(0, { - allowClear: true, - allowHalf: true, - textVisible: false - }); - grid1.getCellEl(rowId, columnId).html(html) - } - else if (columnName == "Score2" && value >= parseFloat(maxScore2)) { - F.alert("最大只能评" + maxScore2 + "分"); + // 部门安全监管 + else if (columnName == "Score1" && value > parseFloat(maxScore2)) { + F.alert("最大只能评" + maxScore2 + "星"); var html = F.rateHtml(0, { allowClear: true, allowHalf: true, @@ -227,11 +243,13 @@ }); grid1.getCellEl(rowId, columnId).html(html) } + else { //更新单元格的值 grid1.updateCellValue(rowId, columnId, value); } }); + }); diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs index 56d4593..822a7a7 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs @@ -1,11 +1,13 @@ using BLL; using BLL.Common; +using FineUIPro.Web.common.SysManage; using Model; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.Drawing; using System.Linq; using System.Web; using System.Web.UI; @@ -247,10 +249,14 @@ namespace FineUIPro.Web.Evaluation HiddenField hidisDepScore4 = Grid1.Rows[i].FindControl("hidisDepScore4") as HiddenField; HiddenField hidisDepScore5 = Grid1.Rows[i].FindControl("hidisDepScore5") as HiddenField; HiddenField hidisDepScore6 = Grid1.Rows[i].FindControl("hidisDepScore6") as HiddenField; + + HiddenField hidMaxScore1 = Grid1.Rows[i].FindControl("hidMaxScore1") as HiddenField; + HiddenField hidMaxScore2 = Grid1.Rows[i].FindControl("hidMaxScore2") as HiddenField; + var foNo = Grid1.Rows[i].DataKeys[0].ToString(); var isEvaluateType = Grid1.Rows[i].DataKeys[1].ToString(); var evaluateType = Grid1.Rows[i].DataKeys[2].ToString(); - + var userType = Grid1.Rows[i].DataKeys[3].ToString(); if (contractorList != null && contractorList.Count(p => p.FO_NO == foNo) > 0) { @@ -260,6 +266,58 @@ namespace FineUIPro.Web.Evaluation lblContractor.Text = contractModel.Contractor; } } + if (userType == "1") + { + var sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && p.Requisitioner == CurrUser.Account).ToList(); + var max = sesList.Select(x => x.ViolationDegree).Max(); + if (!string.IsNullOrEmpty(max)) + { + if (max == "1") + { + hidMaxScore1.Text = "4.5"; + } + if (max == "2") + { + hidMaxScore1.Text = "4"; + } + if (max == "3") + { + hidMaxScore1.Text = "3.5"; + } + } + } + else + { + var sesList = new List(); + var setList = Funs.DB.Sys_User.Where(p => new string[] { Const.Role_CTSSId, Const.Role_CTSCId, Const.Role_CTMTId }.Contains(p.RoleId) && p.UserId == CurrUser.UserId).ToList(); + if (setList.Count > 0) + { + sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && p.Requisitioner != "" && p.Requisitioner != null).ToList(); + } + else + { + sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && (p.MainCoordinatorUser == CurrUser.Account || p.ContractAdminUser == CurrUser.Account || p.UserRepresentativeUser == CurrUser.Account)).ToList(); + } + var max = sesList.Select(x => x.ViolationDegree).Max(); + switch (max) + { + case "1": + hidMaxScore2.Text = "4.5"; + break; + case "2": + hidMaxScore2.Text = "4"; + break; + case "3": + hidMaxScore2.Text = "3.5"; + break; + default: + hidMaxScore2.Text = "5"; + break; + } + + } + + if (isEvaluateType == "1") { Grid1.Rows[i].RowCssClass = "color1"; @@ -501,7 +559,7 @@ namespace FineUIPro.Web.Evaluation DepExtend6 = hidisDepScore6.Text, Status = item.Status, OriginalIndex = item.OriginalIndex - }); ; + }); } if (editLs.Count(p => p.EvaluateType == "1") > 0)//0:未评价 1:已评价 @@ -1357,5 +1415,37 @@ namespace FineUIPro.Web.Evaluation } #endregion + protected void Grid2_RowDataBound(object sender, GridRowEventArgs e) + { + var row = e.DataItem as Model.FC_SESReportView; + + if (!string.IsNullOrEmpty(row.ViolationDegree)) + { + e.RowCssClass = "color2"; + } + + } + + protected string ConvertViolationDegree(object violationDegree) + { + string degree = string.Empty; + if (violationDegree != null) + { + if (violationDegree.ToString() == "1") + { + degree = "一般违章"; + } + if (violationDegree.ToString() == "2") + { + degree = "严重违章"; + } + if (violationDegree.ToString() == "3") + { + degree = "零容忍违章"; + } + } + return degree; + } + } } \ No newline at end of file diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs index 8a31f41..718edb4 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs @@ -257,6 +257,15 @@ namespace FineUIPro.Web.Evaluation /// protected global::FineUIPro.Grid Grid2; + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + /// /// Window1 控件。 /// diff --git a/FCL/FineUIPro.Web/Web.config b/FCL/FineUIPro.Web/Web.config index 0d03a60..e55c6c8 100644 --- a/FCL/FineUIPro.Web/Web.config +++ b/FCL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/FCL/Model/Model.cs b/FCL/Model/Model.cs index ea8c2a0..a3563d7 100644 --- a/FCL/Model/Model.cs +++ b/FCL/Model/Model.cs @@ -29,11 +29,7 @@ namespace Model #region 可扩展性方法定义 partial void OnCreated(); - partial void OnCreated() - { - this.CommandTimeout = 600; - } - partial void InsertAttachFile(AttachFile instance); + partial void InsertAttachFile(AttachFile instance); partial void UpdateAttachFile(AttachFile instance); partial void DeleteAttachFile(AttachFile instance); partial void InsertAudiFlow(AudiFlow instance); @@ -9767,6 +9763,8 @@ namespace Model private System.Nullable _CreateDate; + private System.Nullable _IsEvaluated; + private EntityRef _Base_Depart; private EntityRef _Sys_User; @@ -9815,6 +9813,8 @@ namespace Model partial void OnRelatedSesMailIsSendChanged(); partial void OnCreateDateChanging(System.Nullable value); partial void OnCreateDateChanged(); + partial void OnIsEvaluatedChanging(System.Nullable value); + partial void OnIsEvaluatedChanged(); #endregion public EMC_Punishment() @@ -10232,6 +10232,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsEvaluated", DbType="Bit")] + public System.Nullable IsEvaluated + { + get + { + return this._IsEvaluated; + } + set + { + if ((this._IsEvaluated != value)) + { + this.OnIsEvaluatedChanging(value); + this.SendPropertyChanging(); + this._IsEvaluated = value; + this.SendPropertyChanged("IsEvaluated"); + this.OnIsEvaluatedChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_EMC_Punishment_Base_Depart", Storage="_Base_Depart", ThisKey="BYC_RU", OtherKey="DepartId", IsForeignKey=true)] public Base_Depart Base_Depart { @@ -18688,6 +18708,8 @@ namespace Model private string _Discipline; + private string _ViolationDegree; + public FC_SESReportView() { } @@ -18995,6 +19017,22 @@ namespace Model } } } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ViolationDegree", DbType="NChar(1)")] + public string ViolationDegree + { + get + { + return this._ViolationDegree; + } + set + { + if ((this._ViolationDegree != value)) + { + this._ViolationDegree = value; + } + } + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.FC_SignedContracts")]