提交代码

This commit is contained in:
2025-03-18 16:34:06 +08:00
parent 090ec3b62d
commit 4242a6af49
8 changed files with 97 additions and 1382 deletions
@@ -25,7 +25,8 @@
<f:DropDownList ID="drpProject" runat="server" Label="项目" Width="300px" LabelWidth="60px" EmptyText="请选择项目"
EnableEdit="true">
</f:DropDownList>
<f:TextBox runat="server" ID="txtDrawingNo" Label="图号" LabelWidth="60px" LabelAlign="Right" Width="200px"></f:TextBox>
<f:DropDownList ID="drpDrawingNo" OnSelectedIndexChanged="drpDrawingNo_SelectedIndexChanged" AutoPostBack="true" ShowRedStar="true" runat="server" LabelWidth="120px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:TextBox runat="server" ID="txtPart" Label="部位" LabelWidth="60px" LabelAlign="Right" Width="200px"></f:TextBox>
<f:TextBox runat="server" ID="txtProjectContent" Label="项目内容" LabelWidth="100px" LabelAlign="Right" Width="240px"></f:TextBox>
<f:DatePicker runat="server" DateFormatString="yyyy-MM" DisplayType="Month" Label="选择月份" ID="txtMonths" LabelAlign="right" LabelWidth="110px">
@@ -55,6 +56,9 @@
<f:RenderField ColumnID="DrawingName" DataField="DrawingName" FieldType="String" HeaderText="图纸名称" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
<f:RenderField ColumnID="Major" DataField="Major" FieldType="String" HeaderText="专业" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Part" DataField="Part" FieldType="String" HeaderText="部位" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
@@ -103,7 +107,7 @@
</form>
<script type="text/javascript">
function onGridDataLoad(event) {
this.mergeColumns(['WorkSection','DrawingNo','DrawingName', 'Part', 'ProjectContent','Amount','Remain'], {
this.mergeColumns(['WorkSection','DrawingNo','DrawingName', 'Major', 'Part', 'ProjectContent','Amount','Remain'], {
depends: true
});
}
@@ -84,7 +84,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
days.Add(startDate);
startDate = startDate.AddDays(1);
} while (startDate <= endDate);
GroupField gd = Grid1.Columns[12] as GroupField;
GroupField gd = Grid1.Columns[13] as GroupField;
for (int i = 0; i < days.Count; i++)
{
RenderField d = new RenderField();
@@ -110,9 +110,11 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
{
if (!IsPostBack)
{
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, this.CurrUser.LoginProjectId, true);
//BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, this.CurrUser.LoginProjectId, true);
if (!string.IsNullOrEmpty(Request.Params["DrawingNo"]))
{
this.txtDrawingNo.Text = Request.Params["DrawingNo"];
this.drpDrawingNo.SelectedValue = Request.Params["DrawingNo"];
}
if (!string.IsNullOrEmpty(Request.Params["Part"]))
{
@@ -147,10 +149,10 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue));
if (!string.IsNullOrEmpty(this.txtDrawingNo.Text.Trim()))
if (this.drpDrawingNo.SelectedValue != BLL.Const._Null)
{
strSql += " AND DrawingNo like @DrawingNo";
listStr.Add(new SqlParameter("@DrawingNo", "%" + this.txtDrawingNo.Text.Trim() + "%"));
strSql += " AND DrawingNo = @DrawingNo";
listStr.Add(new SqlParameter("@DrawingNo", this.drpDrawingNo.SelectedItem.Text));
}
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
{
@@ -274,7 +276,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
var dayInput = dayInputs.FirstOrDefault(x => x.BaseId == baseId && x.Date == d && x.WorkTeam == workTeamId);
if (dayInput != null)
{
this.Grid1.Rows[i].Values[13 + j] = dayInput.DayAmount.Value.ToString("0.##");
this.Grid1.Rows[i].Values[14 + j] = dayInput.DayAmount.Value.ToString("0.##");
monthComplete += dayInput.DayAmount.Value;
}
j++;
@@ -287,9 +289,9 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
}
decimal completedAmount = dayInputs.Where(x => x.BaseId == baseId && x.WorkTeam == workTeamId).ToList().Sum(x => x.DayAmount ?? 0);
decimal totalCompletedAmount = dayInputs.Where(x => x.BaseId == baseId).ToList().Sum(x => x.DayAmount ?? 0);
this.Grid1.Rows[i].Values[9] = completedAmount.ToString("0.##");
this.Grid1.Rows[i].Values[10] = (totalAmount - totalCompletedAmount).ToString("0.##");
this.Grid1.Rows[i].Values[11] = monthComplete.ToString("0.##");
this.Grid1.Rows[i].Values[10] = completedAmount.ToString("0.##");
this.Grid1.Rows[i].Values[11] = (totalAmount - totalCompletedAmount).ToString("0.##");
this.Grid1.Rows[i].Values[12] = monthComplete.ToString("0.##");
}
}
#endregion
@@ -337,7 +339,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
string url = "~/CQMS/QuantityManagement/DayInputStatistics.aspx?Date=" + this.txtMonths.Text.Trim() + "&DrawingNo=" + this.txtDrawingNo.Text.Trim()
string url = "~/CQMS/QuantityManagement/DayInputStatistics.aspx?Date=" + this.txtMonths.Text.Trim() + "&DrawingId=" + this.drpDrawingNo.SelectedValue
+ "&Part=" + this.txtPart.Text.Trim() + "&ProjectContent=" + this.txtProjectContent.Text.Trim() + "&ProjectId=" + this.drpProject.SelectedValue;
PageContext.Redirect(url, "_self");
}
@@ -523,18 +525,18 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
row = sheet.GetRow(r0);
for (int i = 0; i < days.Count; i++)
{
cell = row.CreateCell(12 + i);
cell = row.CreateCell(13 + i);
cell.CellStyle = cellStyle;
cell.SetCellValue("完成工程量");
}
row = sheet.GetRow(r);
for (int i = 0; i < days.Count; i++)
{
cell = row.CreateCell(12 + i);
cell = row.CreateCell(13 + i);
cell.CellStyle = cellStyle;
cell.SetCellValue(string.Format("{0:MM-dd}", days[i]));
}
sheet.AddMergedRegion(new CellRangeAddress(0, 0, 12, 11 + days.Count));
sheet.AddMergedRegion(new CellRangeAddress(0, 0, 13, 12 + days.Count));
r++;
for (int i = 0; i < Grid1.Rows.Count; i++)
{
@@ -575,11 +577,14 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
cell = row.CreateCell(11);
cell.CellStyle = cellStyle;
cell.SetCellValue(Grid1.Rows[i].Values[11].ToString());
cell = row.CreateCell(12);
cell.CellStyle = cellStyle;
cell.SetCellValue(Grid1.Rows[i].Values[12].ToString());
for (int j = 0; j < days.Count; j++)
{
cell = row.CreateCell(12 + j);
cell = row.CreateCell(13 + j);
cell.CellStyle = cellStyle;
cell.SetCellValue(Grid1.Rows[i].Values[13 + j].ToString());
cell.SetCellValue(Grid1.Rows[i].Values[14 + j].ToString());
}
}
// 第三步:写入文件流
@@ -610,5 +615,39 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
}
}
#endregion
protected void drpDrawingNo_SelectedIndexChanged(object sender, EventArgs e)
{
Model.QuantityManagement_Drawing drawing = BLL.DrawingService.GetDrawingById(this.drpDrawingNo.SelectedValue);
Model.QuantityManagement_Change change = BLL.ChangeService.GetChangeById(this.drpDrawingNo.SelectedValue);
if (drawing != null)
{
//this.txtWorkSection.Text = drawing.WorkSection;
//this.txtDrawingName.Text = drawing.DrawingName;
//BLL.BaseService.InitPartDropDownList(this.drpPart, drawing.DrawingId, true);
//this.drpPart.SelectedValue = BLL.Const._Null;
}
else if (change != null)
{
//this.txtWorkSection.Text = change.WorkSection;
//this.txtDrawingName.Text = change.ChangeName;
//BLL.BaseService.InitPartDropDownList(this.drpPart, change.ChangeId, true);
//this.drpPart.SelectedValue = BLL.Const._Null;
}
else
{
//this.txtWorkSection.Text = string.Empty;
//this.txtDrawingName.Text = string.Empty;
//this.drpPart.Items.Clear();
//Funs.FineUIPleaseSelect(this.drpPart);
//this.drpPart.SelectedValue = BLL.Const._Null;
}
//this.drpProjectContent.Items.Clear();
//Funs.FineUIPleaseSelect(this.drpProjectContent);
//this.drpProjectContent.SelectedValue = BLL.Const._Null;
//this.txtUnit.Text = string.Empty;
//this.txtAmount.Text = string.Empty;
//this.drpWorkTeam.SelectedValue = BLL.Const._Null;
}
}
}
@@ -67,13 +67,13 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
protected global::FineUIPro.DropDownList drpProject;
/// <summary>
/// txtDrawingNo 控件。
/// drpDrawingNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDrawingNo;
protected global::FineUIPro.DropDownList drpDrawingNo;
/// <summary>
/// txtPart 控件。