This commit is contained in:
parent
ad9a022937
commit
2c3a636f42
|
@ -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;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script src="../Scripts/jquery-3.6.4.js"></script>
|
||||
</head>
|
||||
|
@ -67,8 +73,8 @@
|
|||
<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="3.5" ID="hidMaxScore1"></f:HiddenField>
|
||||
<f:HiddenField runat="server" Text="4.5" ID="hidMaxScore2"></f:HiddenField>
|
||||
<f:HiddenField runat="server" Text="" ID="hidMaxScore1"></f:HiddenField>
|
||||
<f:HiddenField runat="server" Text="" ID="hidMaxScore2"></f:HiddenField>
|
||||
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
@ -141,7 +147,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">
|
||||
|
@ -164,6 +170,12 @@
|
|||
<f:RenderField ColumnID="Requisitioner" DataField="Requisitioner" Width="200px" SortField="Requisitioner"
|
||||
FieldType="String" HeaderText="Requisitioner" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="ViolationDegree" Width="110px" HeaderText="违章程度"
|
||||
HeaderTextAlign="Center" TextAlign="Center" SortField="ViolationDegree">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# ConvertViolationDegree(Eval("ViolationDegree")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -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<FC_SESReportView>();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -257,6 +257,15 @@ 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>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="FCLDBConnectionString" connectionString="Data Source=.;Initial Catalog=FCLDB;uid=sa;pwd=Sh@nghai9;" providerName="System.Data.SqlClient"/>
|
||||
<add name="FCLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=FCLDB;uid=sa;pwd=1111;" providerName="System.Data.SqlClient"/>
|
||||
</connectionStrings>
|
||||
<FineUIPro DebugMode="false" CustomTheme="Metro_Dark_Blue" EnableAnimation="true" JSLibrary="All"/>
|
||||
<appSettings>
|
||||
|
|
|
@ -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<System.DateTime> _CreateDate;
|
||||
|
||||
private System.Nullable<bool> _IsEvaluated;
|
||||
|
||||
private EntityRef<Base_Depart> _Base_Depart;
|
||||
|
||||
private EntityRef<Sys_User> _Sys_User;
|
||||
|
@ -9815,6 +9813,8 @@ namespace Model
|
|||
partial void OnRelatedSesMailIsSendChanged();
|
||||
partial void OnCreateDateChanging(System.Nullable<System.DateTime> value);
|
||||
partial void OnCreateDateChanged();
|
||||
partial void OnIsEvaluatedChanging(System.Nullable<bool> 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<bool> 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")]
|
||||
|
|
Loading…
Reference in New Issue