提交代码
This commit is contained in:
@@ -205,7 +205,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
this.btnMenuAdd.Hidden = true;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.btnMenuDown.Hidden = false;
|
||||
//this.btnMenuDown.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
if (this.GetButtonPower(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuDown.Hidden = false;
|
||||
//this.btnMenuDown.Hidden = false;
|
||||
}
|
||||
}
|
||||
this.ConstructionLogId = this.tvControlItem.SelectedNodeID;
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DayConstructionLogWorkEfficiency.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.DayConstructionLogWorkEfficiency" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>工效录入</title>
|
||||
<style type="text/css">
|
||||
.f-grid-row.noEdit {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工效情况" BoxFlex="1" AllowColumnLocking="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="Id,ProjectName,ShowId" EnableTree="true" EnableColumnLines="true" ClicksToEdit="1" AllowCellEditing="true"
|
||||
DataIDField="Id">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DatePicker ID="txtCompileDate" runat="server" Label="日期" LabelAlign="Right" LabelWidth="120px" AutoPostBack="true" OnTextChanged="txtCompileDate_TextChanged"></f:DatePicker>
|
||||
<f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="60px" ColumnID="Code" DataField="Code" FieldType="String" EnableLock="true" Locked="true"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectCode" DataField="ProjectCode" SortField="ProjectCode" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目编码" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectName" DataField="ProjectName" SortField="ProjectName" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目名称" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UnitOfMeasurement" DataField="UnitOfMeasurement" SortField="UnitOfMeasurement" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="单位" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PhysicalCompletionQuantity" DataField="PhysicalCompletionQuantity" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="实物完成量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialConsumption" DataField="MaterialConsumption" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="材料消耗量(净量+损耗量)" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var hdIdClientID = '<%= hdId.ClientID %>';
|
||||
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
var me = this, columnId = params.columnId, rowId = params.rowId;
|
||||
if (columnId.indexOf('ConsumeHours') != -1) {
|
||||
var physicalCompletionQuantity = me.getCellValue(rowId, 'PhysicalCompletionQuantity');
|
||||
var hours = me.getCellValue(rowId, columnId);
|
||||
var workEfficiencyId = columnId.replace('ConsumeHours', 'WorkEfficiency');
|
||||
if (physicalCompletionQuantity.toString() != "" && hours.toString() != "") {
|
||||
me.updateCellValue(rowId, workEfficiencyId, (physicalCompletionQuantity / hours).toFixed(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,196 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
public partial class DayConstructionLogWorkEfficiency : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载表头
|
||||
/// </summary>
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitGrid();
|
||||
}
|
||||
|
||||
#region 表头
|
||||
/// <summary>
|
||||
/// 表头
|
||||
/// </summary>
|
||||
private void InitGrid()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
List<string> workPostIds = (from x in workEfficiencys
|
||||
where x.Type == "Person"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
List<string> machineIds = (from x in workEfficiencys
|
||||
where x.Type == "Machine"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
GroupField gf1 = new GroupField();
|
||||
gf1.ColumnID = "Person";
|
||||
gf1.HeaderText = "人工消耗(工·h)";
|
||||
gf1.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Person" + i.ToString();
|
||||
gf.HeaderText = BLL.WorkPostService.getWorkPostNameById(workPostIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "PersonConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "PersonConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗工时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf1.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf1);
|
||||
GroupField gf2 = new GroupField();
|
||||
gf2.ColumnID = "Machine";
|
||||
gf2.HeaderText = "机械消耗(台·h)";
|
||||
gf2.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < machineIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Machine" + i.ToString();
|
||||
gf.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(machineIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "MachineConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "MachineConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗台时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf2.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf2);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
GetData();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void GetData()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string contractNo = string.Empty, professional = string.Empty;
|
||||
var personLogs = from x in db.ZHGL_ConstructionLog
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == Funs.GetNewDateTime(this.txtCompileDate.Text.Trim())
|
||||
orderby x.CompileDate descending
|
||||
select x;
|
||||
if (personLogs.Count() > 0)
|
||||
{
|
||||
foreach (var personLog in personLogs)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(personLog.ContractNo))
|
||||
{
|
||||
contractNo += "," + personLog.ContractNo;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personLog.Professional))
|
||||
{
|
||||
professional += "," + personLog.Professional;
|
||||
}
|
||||
}
|
||||
}
|
||||
List<string> contractNoList = Funs.GetStrListByStr(contractNo, ',');
|
||||
List<string> professionalList = Funs.GetStrListByStr(professional, ',');
|
||||
var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
List<string> workPostIds = (from x in workEfficiencys
|
||||
where x.Type == "Person"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
List<string> machineIds = (from x in workEfficiencys
|
||||
where x.Type == "Machine"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
DataTable table = BLL.PhtglContractTrackService.GetProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, this.txtCompileDate.Text.Trim());
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString()))
|
||||
{
|
||||
foreach (GridColumn column in Grid1.Columns)
|
||||
{
|
||||
if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2)
|
||||
{
|
||||
if (column.ColumnIndex > 5)
|
||||
{
|
||||
GroupField gf1 = column as GroupField;
|
||||
foreach (var column1 in gf1.Columns)
|
||||
{
|
||||
GroupField gf2 = column1 as GroupField;
|
||||
foreach (var column2 in gf2.Columns)
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void txtCompileDate_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
||||
{
|
||||
GetData();
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
Alert.ShowInTop("请选择日期!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+78
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject {
|
||||
|
||||
|
||||
public partial class DayConstructionLogWorkEfficiency {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// hdId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox hdId;
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonthConstructionLogWorkEfficiencySum.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.MonthConstructionLogWorkEfficiencySum" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>工效录入</title>
|
||||
<style type="text/css">
|
||||
.f-grid-row.noEdit {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工效情况" BoxFlex="1" AllowColumnLocking="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="Id,ProjectName,ShowId" EnableTree="true" EnableColumnLines="true" ClicksToEdit="1" AllowCellEditing="true"
|
||||
DataIDField="Id">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DatePicker ID="txtMonth" runat="server" Label="月份" LabelAlign="Right" DateFormatString="yyyy-MM" LabelWidth="120px" AutoPostBack="true" OnTextChanged="txtMonth_TextChanged"></f:DatePicker>
|
||||
<f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="60px" ColumnID="Code" DataField="Code" FieldType="String" EnableLock="true" Locked="true"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectCode" DataField="ProjectCode" SortField="ProjectCode" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目编码" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectName" DataField="ProjectName" SortField="ProjectName" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目名称" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UnitOfMeasurement" DataField="UnitOfMeasurement" SortField="UnitOfMeasurement" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="单位" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PhysicalCompletionQuantity" DataField="PhysicalCompletionQuantity" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="实物完成量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialConsumption" DataField="MaterialConsumption" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="材料消耗量(净量+损耗量)" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var hdIdClientID = '<%= hdId.ClientID %>';
|
||||
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
var me = this, columnId = params.columnId, rowId = params.rowId;
|
||||
if (columnId.indexOf('ConsumeHours') != -1) {
|
||||
var physicalCompletionQuantity = me.getCellValue(rowId, 'PhysicalCompletionQuantity');
|
||||
var hours = me.getCellValue(rowId, columnId);
|
||||
var workEfficiencyId = columnId.replace('ConsumeHours', 'WorkEfficiency');
|
||||
if (physicalCompletionQuantity.toString() != "" && hours.toString() != "") {
|
||||
me.updateCellValue(rowId, workEfficiencyId, (physicalCompletionQuantity / hours).toFixed(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
public partial class MonthConstructionLogWorkEfficiencySum : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载表头
|
||||
/// </summary>
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitGrid();
|
||||
}
|
||||
|
||||
#region 表头
|
||||
/// <summary>
|
||||
/// 表头
|
||||
/// </summary>
|
||||
private void InitGrid()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
List<string> workPostIds = (from x in workEfficiencys
|
||||
where x.Type == "Person"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
List<string> machineIds = (from x in workEfficiencys
|
||||
where x.Type == "Machine"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
GroupField gf1 = new GroupField();
|
||||
gf1.ColumnID = "Person";
|
||||
gf1.HeaderText = "人工消耗(工·h)";
|
||||
gf1.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Person" + i.ToString();
|
||||
gf.HeaderText = BLL.WorkPostService.getWorkPostNameById(workPostIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "PersonConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "PersonConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗工时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf1.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf1);
|
||||
GroupField gf2 = new GroupField();
|
||||
gf2.ColumnID = "Machine";
|
||||
gf2.HeaderText = "机械消耗(台·h)";
|
||||
gf2.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < machineIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Machine" + i.ToString();
|
||||
gf.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(machineIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "MachineConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "MachineConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗台时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf2.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf2);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
GetData();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void GetData()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
DateTime startDate = Funs.GetNewDateTimeOrNow(this.txtMonth.Text.Trim() + "-01");
|
||||
DateTime endDate = startDate.AddMonths(1);
|
||||
string contractNo = string.Empty, professional = string.Empty;
|
||||
var personLogs = from x in db.ZHGL_ConstructionLog
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate >= startDate && x.CompileDate < endDate
|
||||
orderby x.CompileDate descending
|
||||
select x;
|
||||
if (personLogs.Count() > 0)
|
||||
{
|
||||
foreach (var personLog in personLogs)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(personLog.ContractNo))
|
||||
{
|
||||
contractNo += "," + personLog.ContractNo;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personLog.Professional))
|
||||
{
|
||||
professional += "," + personLog.Professional;
|
||||
}
|
||||
}
|
||||
}
|
||||
List<string> contractNoList = Funs.GetStrListByStr(contractNo, ',');
|
||||
List<string> professionalList = Funs.GetStrListByStr(professional, ',');
|
||||
var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
List<string> workPostIds = (from x in workEfficiencys
|
||||
where x.Type == "Person"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
List<string> machineIds = (from x in workEfficiencys
|
||||
where x.Type == "Machine"
|
||||
select x.TypeId).Distinct().ToList();
|
||||
DataTable table = BLL.PhtglContractTrackService.GetMonthProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, startDate, endDate);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString()))
|
||||
{
|
||||
foreach (GridColumn column in Grid1.Columns)
|
||||
{
|
||||
if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2)
|
||||
{
|
||||
if (column.ColumnIndex > 5)
|
||||
{
|
||||
GroupField gf1 = column as GroupField;
|
||||
foreach (var column1 in gf1.Columns)
|
||||
{
|
||||
GroupField gf2 = column1 as GroupField;
|
||||
foreach (var column2 in gf2.Columns)
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void txtMonth_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim()))
|
||||
{
|
||||
GetData();
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+78
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject {
|
||||
|
||||
|
||||
public partial class MonthConstructionLogWorkEfficiencySum {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtMonth 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtMonth;
|
||||
|
||||
/// <summary>
|
||||
/// hdId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox hdId;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
this.btnMenuAdd.Hidden = true;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.btnMenuDown.Hidden = false;
|
||||
//this.btnMenuDown.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
@@ -333,6 +333,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
this.GridCQMSTomorrowPlan.DataSource = cqmss;
|
||||
this.GridCQMSTomorrowPlan.DataBind();
|
||||
}
|
||||
ChangeText();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user