材料管理修改(打印修改,出库单已审核已完成不计算匹配率)材料匹配修改,焊接任务单修改
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
.f-grid-row.red {
|
||||
background-color: Yellow;
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -50,6 +51,16 @@ namespace FineUIPro.Web.CLGL
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
{
|
||||
var model = Grid1.Rows[i].DataItem as Tw_ArrivalStatisticsOutPut;
|
||||
|
||||
if (model?.MatchRate < 1 || model?.MatchRate == null)
|
||||
{
|
||||
Grid1.Rows[i].RowCssClass = "red";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -16,10 +16,15 @@
|
||||
color: blue;
|
||||
font-weight: bold;
|
||||
}
|
||||
.f-grid-row-summary .f-grid-cell-inner {
|
||||
|
||||
.f-grid-row-summary .f-grid-cell-inner {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.f-grid-row.red {
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -85,7 +90,7 @@
|
||||
<f:Button ID="btnGenInOutMaster" Text="出库" Icon="ArrowRefresh" runat="server" OnClick="btnGenInOutMaster_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnRevokeGenInOutMaster" Text="撤销出库" Icon="ArrowRefresh" runat="server" OnClick="btnRevokeGenInOutMaster_Click" Hidden="true">
|
||||
</f:Button>
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
@@ -136,7 +141,7 @@
|
||||
FieldType="String" HeaderText="审核人(专工)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="AuditDate" DataField="AuditDate" SortField="AuditDate" Renderer="Date"
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(专工" TextAlign="Left" HeaderTextAlign="Center">
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(专工)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="AuditManName2" DataField="AuditManName2" SortField="AuditManName2"
|
||||
FieldType="String" HeaderText="审核人(材控)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
@@ -162,7 +167,7 @@
|
||||
<Tabs>
|
||||
<f:Tab ID="TabDetail" Title="出库明细" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" ShowBorder="False" ShowHeader="False" Title="出库明细" EnableCollapse="true"
|
||||
<f:Grid ID="Grid2" ShowBorder="False" ShowHeader="False" Title="出库明细" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
|
||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode"
|
||||
SortDirection="DESC" EnableColumnLines="true" EnableTextSelection="True"
|
||||
@@ -192,8 +197,8 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid3" ShowBorder="False" ShowHeader="False" Title="管线材料明细" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Id"
|
||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" ExpandAllRowGroups="false"
|
||||
SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000" RowGroupRendererFunction="onGrid3RowGroupRenderer">
|
||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" ExpandAllRowGroups="false"
|
||||
SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000" RowGroupRendererFunction="onGrid3RowGroupRenderer">
|
||||
<Columns>
|
||||
<f:RenderField Width="100px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
|
||||
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
|
||||
@@ -239,6 +244,45 @@
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Tab>
|
||||
<f:Tab ID="TabStrip3" Title="管线材料明细" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true" Hidden="True">
|
||||
<Items>
|
||||
<f:Grid ID="Grid4" ShowBorder="False" ShowHeader="False" Title="管线材料明细" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Id"
|
||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" ExpandAllRowGroups="false"
|
||||
SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
|
||||
<Columns>
|
||||
<f:RenderField Width="100px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
|
||||
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PrefabricatedComponents" DataField="PrefabricatedComponents" SortField="PrefabricatedComponents"
|
||||
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
|
||||
FieldType="String" HeaderText="材料编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
|
||||
FieldType="String" HeaderText="材料名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
|
||||
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
|
||||
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="NeedNum" DataField="NeedNum" SortField="NeedNum"
|
||||
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
</f:TabStrip>
|
||||
</Items>
|
||||
@@ -281,23 +325,35 @@
|
||||
}
|
||||
function onGrid3RowGroupRenderer(groupValue, rowData) {
|
||||
var Total = 0,
|
||||
SumMatchNum = 0,
|
||||
SumNeedNum = 0,
|
||||
Len = rowData.children.length;
|
||||
for (var i = 0; i < Len; i++) {
|
||||
var childData = rowData.children[i];
|
||||
var genderValue = childData.values['MatchRate'];
|
||||
|
||||
console.log(genderValue);
|
||||
var MatchNum = childData.values['MatchNum'];
|
||||
var NeedNum = childData.values['NeedNum'];
|
||||
console.log(genderValue);
|
||||
|
||||
// 确保值存在再进行累加
|
||||
if (genderValue !== undefined) {
|
||||
genderValue = parseFloat(genderValue); // 确保是数字
|
||||
genderValue = genderValue > 0 ? genderValue : 0;
|
||||
Total += genderValue;
|
||||
|
||||
if (MatchNum !== undefined) {
|
||||
MatchNum = parseFloat(MatchNum); // 确保是数字
|
||||
MatchNum = MatchNum > 0 ? MatchNum : 0;
|
||||
SumMatchNum += MatchNum;
|
||||
}
|
||||
if (NeedNum !== undefined) {
|
||||
NeedNum = parseFloat(NeedNum); // 确保是数字
|
||||
NeedNum = NeedNum > 0 ? NeedNum : 0;
|
||||
SumNeedNum += NeedNum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 检查 Len 是否大于零,以防止除以零
|
||||
var TotalRate = Len > 0 ? ((Total * 100) / Len).toFixed(2) + "%" : "0%";
|
||||
var TotalRate = SumNeedNum > 0 ? ((SumMatchNum * 100) / SumNeedNum).toFixed(2) + "%" : "0%";
|
||||
|
||||
return F.formatString('{0},匹配率:{1}', groupValue, TotalRate);
|
||||
}
|
||||
|
||||
@@ -102,28 +102,41 @@ namespace FineUIPro.Web.CLGL
|
||||
}
|
||||
private void BindDetailRelationGrid(string inOutPlanMasterId)
|
||||
{
|
||||
/* Model.Tw_InOutPlanDetail_Relation table = new Model.Tw_InOutPlanDetail_Relation();
|
||||
table.InOutPlanMasterId = inOutPlanMasterId;
|
||||
var tb = BLL.TwInoutplandetailRelationService.GetListData(table, Grid3);
|
||||
Grid3.DataSource = tb;
|
||||
Grid3.DataBind();
|
||||
*/
|
||||
|
||||
var inOutPlanMasterModel = TwInOutplanmasterService.GetById(inOutPlanMasterId);
|
||||
var tb = BLL.TwArrivalStatisticsService.GetMatMatchByOutPlanMasterId(inOutPlanMasterId);
|
||||
Grid3.DataSource = tb;
|
||||
Grid3.DataBind();
|
||||
//if (tb!= null && tb.Count > 0)
|
||||
//{
|
||||
// string Rate = Math.Round((decimal)tb.Average(item => item.MatchRate) * 100, 2).ToString() + "%";
|
||||
|
||||
// JObject summary = new JObject();
|
||||
// //summary.Add("Major", "全部合计");
|
||||
// summary.Add("MatchRateString", Rate);
|
||||
if (inOutPlanMasterModel != null)
|
||||
{
|
||||
if (inOutPlanMasterModel.State== (int)TwConst.State.已完成|| inOutPlanMasterModel.State == (int)TwConst.State.已审核)
|
||||
{
|
||||
TabStrip2.Hidden = true;
|
||||
TabStrip3.Hidden = false;
|
||||
Grid4.DataSource = tb;
|
||||
Grid4.DataBind();
|
||||
|
||||
// Grid3.SummaryData = summary;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
TabStrip2.Hidden = false;
|
||||
TabStrip3.Hidden = true;
|
||||
Grid3.DataSource = tb;
|
||||
Grid3.DataBind();
|
||||
for (int i = 0; i < Grid3.Rows.Count; i++)
|
||||
{
|
||||
var model = Grid3.Rows[i].DataItem as Tw_PipeMatMatchOutput;
|
||||
|
||||
if (model?.MatchRate < 1 || model?.MatchRate == null)
|
||||
{
|
||||
Grid3.Rows[i].RowCssClass = "red";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -284,6 +284,24 @@ namespace FineUIPro.Web.CLGL
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid3;
|
||||
|
||||
/// <summary>
|
||||
/// TabStrip3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tab TabStrip3;
|
||||
|
||||
/// <summary>
|
||||
/// Grid4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid4;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -132,10 +132,16 @@
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="发起时间" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="AuditManName" DataField="AuditManName" SortField="AuditManName"
|
||||
FieldType="String" HeaderText="审核人" TextAlign="Left" HeaderTextAlign="Center">
|
||||
FieldType="String" HeaderText="审核人(专工)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="AuditDate" DataField="AuditDate" SortField="AuditDate" Renderer="Date"
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间" TextAlign="Left" HeaderTextAlign="Center">
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(专工)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="AuditManName2" DataField="AuditManName2" SortField="AuditManName2"
|
||||
FieldType="String" HeaderText="审核人(材控)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="AuditDate2" DataField="AuditDate2" SortField="AuditDate2" Renderer="Date"
|
||||
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(材控)" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField Width="150px" ColumnID="btnInPlanMasterPrint" TextAlign="Center" CommandName="btnInPlanMasterPrint" Text="出库单打印" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user