This commit is contained in:
2024-06-18 10:34:42 +08:00
parent 3d69c04346
commit 20904bda17
11 changed files with 465 additions and 219 deletions
@@ -213,7 +213,7 @@
var target = $(event.target);
var cellEl = target.closest('.f-grid-cell');
var rowId = grid1.getRowId(cellEl);
console.log(rowId);
//console.log(rowId);
var columnId = grid1.getColumnId(cellEl);
var columnName = grid1.getColumn(columnId).columnId;
@@ -14,11 +14,18 @@
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;
}
.f-grid-cell.ycl .f-grid-cell-inner {
display: none;
}
@@ -67,6 +74,9 @@
<f:HiddenField runat="server" ID="hidisDepScore4"></f:HiddenField>
<f:HiddenField runat="server" ID="hidisDepScore5"></f:HiddenField>
<f:HiddenField runat="server" ID="hidisDepScore6"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMaxScore1"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMaxScore2"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMsg"></f:HiddenField>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="承包商<br/>Contractor" HeaderTextAlign="Center" Width="200px">
@@ -138,7 +148,7 @@
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
BoxFlex="1" DataKeyNames="SES_No" AllowCellEditing="true" ClicksToEdit="2" DataIDField="SES_No"
PageSize="15" EnableRowSelectEvent="true" Height="200px">
PageSize="15" EnableRowSelectEvent="true" Height="200px" OnRowDataBound="Grid2_RowDataBound">
<Columns>
<f:RenderField ColumnID="SES_No" DataField="SES_No" SortField="SES_No"
FieldType="String" HeaderText="SES No." HeaderTextAlign="Center">
@@ -161,6 +171,12 @@
<f:RenderField ColumnID="Requisitioner" DataField="Requisitioner" Width="200px" SortField="Requisitioner"
FieldType="String" HeaderText="Requisitioner" HeaderTextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="ShowViolationDegree" Width="110px" HeaderText="违章程度"
HeaderTextAlign="Center" TextAlign="Center" SortField="ShowViolationDegree">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertViolationDegree(Eval("ShowViolationDegree")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:Grid>
</Items>
@@ -183,10 +199,12 @@
function renderRateUser(value, row) {
var evaltype = row.rowValue["IsEvaluateType"];
return F.rateHtml(value, {
allowClear: true,
readonly: evaltype == 1 ? true : false,
allowHalf: true,
textVisible: false
});
return html;
}
F.ready(function () {
var grid1 = F(grid1ClientID);
@@ -194,13 +212,46 @@
F.rateEvents(grid1.el, function (event, value) {
var target = $(event.target);
var cellEl = target.closest('.f-grid-cell');
var rowId = grid1.getRowId(cellEl);
//console.log(rowId);
var columnId = grid1.getColumnId(cellEl);
var columnName = grid1.getColumn(columnId).columnId;
//更新单元格的值
grid1.updateCellValue(rowId, columnId, value);
//获取控件值1()
var maxScore1 = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMaxScore1-inputEl").val();
//获取控件值2()
var maxScore2 = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMaxScore2-inputEl").val()
var hidMsg = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMsg-inputEl").val()
// 用户EHSS
if (columnName == "Score3" && value > parseFloat(maxScore1)) {
F.alert(hidMsg + "最大只能评" + maxScore1 + "星");
var html = F.rateHtml(0, {
allowClear: true,
allowHalf: true,
textVisible: false
});
grid1.getCellEl(rowId, columnId).html(html)
}
// 部门安全监管
else if (columnName == "Score1" && value > parseFloat(maxScore2)) {
F.alert(hidMsg + "最大只能评" + maxScore2 + "星");
var html = F.rateHtml(0, {
allowClear: true,
allowHalf: true,
textVisible: false
});
grid1.getCellEl(rowId, columnId).html(html)
}
else {
//更新单元格的值
grid1.updateCellValue(rowId, columnId, value);
}
});
});
</script>
</body>
@@ -1,15 +1,19 @@
using BLL;
using BLL.Common;
using FineUIPro.Web.common.SysManage;
using Model;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
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;
using System.Web.UI.WebControls;
using static NPOI.POIFS.Crypt.CryptoFunctions;
namespace FineUIPro.Web.Evaluation
{
@@ -247,10 +251,15 @@ 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;
HiddenField hidMsg = Grid1.Rows[i].FindControl("hidMsg") 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 +269,63 @@ 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).OrderByDescending(t => t.ViolationDegree).FirstOrDefault();
switch (sesList?.ViolationDegree)
{
case "1":
hidMaxScore1.Text = "4.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在一般违章,";
break;
case "2":
hidMaxScore1.Text = "4";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在严重违章,";
break;
case "3":
hidMaxScore1.Text = "3.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在零容忍违章,";
break;
default:
hidMaxScore1.Text = "5";
hidMsg.Text = "";
break;
}
}
else
{
var sesList = Funs.DB.FC_SESReportView.AsQueryable();
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 = sesList.Where(p => p.FO_NO == foNo && p.Requisitioner != "" && p.Requisitioner != null && p.Requisitioner != string.Empty).OrderByDescending(t => t.ViolationDegree);
else
sesList = sesList.Where(p => p.FO_NO == foNo && (p.MainCoordinatorUser == CurrUser.Account || p.ContractAdminUser == CurrUser.Account || p.UserRepresentativeUser == CurrUser.Account)).OrderByDescending(t => t.ViolationDegree);
var max = sesList.FirstOrDefault();
switch (max?.ViolationDegree)
{
case "1":
hidMaxScore2.Text = "4.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在一般违章,";
break;
case "2":
hidMaxScore2.Text = "4";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在严重违章,";
break;
case "3":
hidMaxScore2.Text = "3.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在零容忍违章,";
break;
default:
hidMaxScore2.Text = "5";
hidMsg.Text = "";
break;
}
}
if (isEvaluateType == "1")
{
Grid1.Rows[i].RowCssClass = "color1";
@@ -758,6 +824,21 @@ namespace FineUIPro.Web.Evaluation
}
Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList);
}
// 回写违章捐款(用户)
var PunishList = from x in pjSESReport where x.ViolationDegree != null select x;
if (PunishList.Count() > 0)
{
foreach (var p in PunishList)
{
var punish = Funs.DB.EMC_Punishment.FirstOrDefault(x => x.FO_NO == p.FO_NO && x.ViolationRelatedSes == p.SES_No);
if (punish != null)
{
punish.IsUserEvaluated = true;
Funs.DB.SubmitChanges();
}
}
}
}
//部门
if (item.EvaluateType == "Dep")
@@ -872,6 +953,21 @@ namespace FineUIPro.Web.Evaluation
}
Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList);
}
// 回写违章捐款(部门)
var PunishList = from x in pjSESReport where x.ViolationDegree != null select x;
if (PunishList.Count() > 0)
{
foreach (var p in PunishList)
{
var punish = Funs.DB.EMC_Punishment.FirstOrDefault(x => x.FO_NO == p.FO_NO && x.ViolationRelatedSes == p.SES_No);
if (punish != null)
{
punish.IsDepEvaluated = true;
Funs.DB.SubmitChanges();
}
}
}
}
}
}
@@ -908,7 +1004,7 @@ namespace FineUIPro.Web.Evaluation
{
sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == FoNo && p.Requisitioner == CurrUser.Account).ToList();
}
Grid2.DataSource = sesList;
Grid2.DataSource = sesList.OrderByDescending(x => x.ShowViolationDegree);
Grid2.DataBind();
}
#endregion
@@ -1357,5 +1453,38 @@ namespace FineUIPro.Web.Evaluation
BindGrid();
}
#endregion
protected void Grid2_RowDataBound(object sender, GridRowEventArgs e)
{
var row = e.DataItem as Model.FC_SESReportView;
if (!string.IsNullOrEmpty(row.ShowViolationDegree))
{
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;
}
}
}
+68 -30
View File
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Evaluation {
public partial class SafetyEvaluation {
namespace FineUIPro.Web.Evaluation
{
public partial class SafetyEvaluation
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelTopRegion 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelTopRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// rdbUserType 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rdbUserType;
/// <summary>
/// drpUser 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUser;
/// <summary>
/// drpContractNo 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpContractNo;
/// <summary>
/// btnUndo 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnUndo;
/// <summary>
/// btnAutoEvaluation 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAutoEvaluation;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// hdFo 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFo;
/// <summary>
/// BatchEvaluation 控件。
/// </summary>
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BatchEvaluation;
/// <summary>
/// LinkFoNo 控件。
/// </summary>
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton LinkFoNo;
/// <summary>
/// hidisDepScore1 控件。
/// </summary>
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore1;
/// <summary>
/// hidisDepScore2 控件。
/// </summary>
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore2;
/// <summary>
/// hidisDepScore3 控件。
/// </summary>
@@ -173,7 +175,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore3;
/// <summary>
/// hidisDepScore4 控件。
/// </summary>
@@ -182,7 +184,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore4;
/// <summary>
/// hidisDepScore5 控件。
/// </summary>
@@ -191,7 +193,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore5;
/// <summary>
/// hidisDepScore6 控件。
/// </summary>
@@ -200,7 +202,34 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore6;
/// <summary>
/// hidMaxScore1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMaxScore1;
/// <summary>
/// hidMaxScore2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMaxScore2;
/// <summary>
/// hidMsg 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMsg;
/// <summary>
/// lblContractor 控件。
/// </summary>
@@ -209,7 +238,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblContractor;
/// <summary>
/// wjsc 控件。
/// </summary>
@@ -218,7 +247,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField wjsc;
/// <summary>
/// panelBottomRegion 控件。
/// </summary>
@@ -227,7 +256,7 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelBottomRegion;
/// <summary>
/// Grid2 控件。
/// </summary>
@@ -236,7 +265,16 @@ namespace FineUIPro.Web.Evaluation {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid2;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// Window1 控件。
/// </summary>