This commit is contained in:
2024-09-25 15:13:49 +08:00
parent 5d5bc5598d
commit 5d70e1689a
16 changed files with 372 additions and 419 deletions
@@ -28,6 +28,7 @@
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="请选择导入的Eexce文件" Width="500px">
</f:FileUpload>
<f:HiddenField ID="hdFileName" runat="server"></f:HiddenField>
<f:Label runat="server" ID="lb1" Text="采购入库不区分管段和管件"></f:Label>
</Items>
</f:Panel>
</form>
@@ -94,5 +94,14 @@ namespace FineUIPro.Web.CLGL
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// lb1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lb1;
}
}
+9 -6
View File
@@ -119,6 +119,12 @@
<f:RenderField Width="150px" ColumnID="StateString" DataField="StateString" SortField="StateString"
FieldType="String" HeaderText="状态" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ReqUnitName" DataField="ReqUnitName" SortField="ReqUnitName"
FieldType="String" HeaderText="领料单位" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="CreateManName" DataField="CreateManName" SortField="CreateManName"
FieldType="String" HeaderText="发起人" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -137,10 +143,7 @@
<f:RenderField Width="150px" ColumnID="AuditDate2" DataField="AuditDate2" SortField="AuditDate2" Renderer="Date"
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(材控)" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ReqUnitName" DataField="ReqUnitName" SortField="ReqUnitName"
FieldType="String" HeaderText="领料单位" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu1" />
@@ -220,9 +223,9 @@
IsModal="true" Width="700px" Height="470px" OnClose="Window2_Close">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<%--<f:MenuButton ID="btnMenuInOutPlanMasterEdit" OnClick="btnMenuInOutPlanMasterEdit_Click" EnablePostBack="true"
<f:MenuButton ID="btnMenuInOutPlanMasterEdit" OnClick="btnMenuInOutPlanMasterEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>--%>
</f:MenuButton>
<f:MenuButton ID="btnMenuInOutPlanMasterDelete" OnClick="btnMenuInOutPlanMasterDelete_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server"
Text="删除" Icon="Delete">
+29 -2
View File
@@ -243,7 +243,16 @@ namespace FineUIPro.Web.CLGL
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutPlanMasterMenuId, Const.BtnAdd))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx", "新增 - ")));
if (string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
Alert.ShowInTop("请选择单位工程!", MessageBoxIcon.Warning);
return;
}
else
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?UnitWorkId={0} ", tvControlItem.SelectedNodeID, "新增 - ")));
}
}
else
{
@@ -329,6 +338,23 @@ namespace FineUIPro.Web.CLGL
protected void btnMenuInOutPlanMasterEdit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string planId = Grid1.SelectedRowID;
var planMaster = BLL.TwInOutplanmasterService.GetById(planId);
if (planMaster.State != (int)TwConst.State. || planMaster.TypeInt != (int)TwConst.TypeInt.)
{
Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning);
return;
}
else
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?UnitWorkId={0}&Id={1} ", tvControlItem.SelectedNodeID, planId, "新增 - ")));
}
}
protected void btnPassMaster_OnClick(object sender, EventArgs e)
@@ -573,8 +599,9 @@ namespace FineUIPro.Web.CLGL
}
}
}
#endregion
}
}
+9
View File
@@ -320,6 +320,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuInOutPlanMasterEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterEdit;
/// <summary>
/// btnMenuInOutPlanMasterDelete 控件。
/// </summary>
@@ -17,7 +17,7 @@
<form id="form1" runat="server">
<div>
<f:PageManager runat="server" AutoSizePanelID="Form2" />
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true" Title="出库单详情"
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" Title="出库单详情"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="TbCreate" Position="Top" ToolbarAlign="Right" runat="server">
@@ -47,7 +47,10 @@
<f:DropDownList ID="drpTypeInt" runat="server" Label="类型" ColumnWidth="20%"
LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList>
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="40%" runat="server">
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="20%"
LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList>
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="20%" runat="server" ShowRedStar="true" Required="true">
</f:TextBox>
</Items>
</f:Panel>
@@ -70,7 +73,7 @@
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnSelect" Icon="ShapeSquareSelect" Text="选择" runat="server" ToolTip="选择" ValidateForms="SimpleForm1"
<f:Button ID="btnSelect" Icon="ShapeSquareSelect" Text="选择" runat="server" ToolTip="选择"
OnClick="btnSelect_Click">
</f:Button>
</Items>
@@ -107,7 +110,7 @@
</div>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true"
Title="编辑" EnableIFrame="true" Height="650px"
Title="编辑" EnableIFrame="true" Height="650px" OnClose="Window1_Close"
Width="1200px">
</f:Window>
</form>
@@ -1,4 +1,5 @@
using BLL;
using FastReport.Utils;
using FineUIPro.Web.DataShow;
using FineUIPro.Web.HJGL.WeldingManage;
using FineUIPro.Web.ProjectData;
@@ -48,18 +49,35 @@ namespace FineUIPro.Web.CLGL
if (!IsPostBack)
{
InitDrpList();
UnitWorkId = Request.QueryString["UnitWorkId"];
Id = Request.QueryString["Id"];
UnitWorkId = Request.Params["UnitWorkId"];
Id = Request.Params["Id"];
if (!string.IsNullOrEmpty(Id))
{
var queryModel = new Model.Tw_InOutMasterOutput()
{
Id=Id,
};
var result = BLL.TwInOutplanmasterService.GetListData(queryModel).FirstOrDefault();
if (!string .IsNullOrEmpty(result.WeldTaskId) && result.WeldTaskId.Contains("|"))
{
UnitWorkId = result.WeldTaskId.Split('|')[0];
}
else
{
UnitWorkId = result.WeldTaskId;
}
txtCreateMan.Text = result.CreateManName;
txtCreateDate.Text =result.CreateDate.Value.ToString("yyyy-MM-dd");
drpReqUnit.SelectedValue = result.ReqUnitId;
drpTypeInt.SelectedValue = result.TypeInt.ToString();
drpWarehouse.SelectedValue = result.WarehouseCode;
drpCategory.SelectedValue = result.Category.ToString();
txtRemark.Text = result.Remark;
txtCusBillCode.Text = result.CusBillCode;
drpCategory.Readonly = true;
BindGrid(Id);
}
else
@@ -78,15 +96,18 @@ namespace FineUIPro.Web.CLGL
drpWarehouse.DataTextField = "Text";
drpWarehouse.DataValueField = "Value";
drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode();
drpWarehouse.DataBind();
Funs.FineUIPleaseSelect(this.drpWarehouse);
drpWarehouse.DataBind();
drpTypeInt.DataTextField = "Key";
drpTypeInt.DataValueField = "Value";
drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("出库")); ;
drpTypeInt.DataBind();
Funs.FineUIPleaseSelect(this.drpTypeInt);
drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("散件出库")); ;
drpTypeInt.DataBind();
UnitService.InitUnitDropDownList(drpReqUnit, this.CurrUser.LoginProjectId, true);
drpCategory.DataTextField = "Key";
drpCategory.DataValueField = "Value";
drpCategory.DataSource = BLL.TwConst.CategoryMap;
drpCategory.DataBind();
}
private void BindGrid(string inOutPlanMasterId)
{
@@ -105,7 +126,8 @@ namespace FineUIPro.Web.CLGL
/// <param name="e"></param>
protected void btnSelect_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelect.aspx", "选择- ")));
Save(Const.BtnSave);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelect.aspx?UnitWorkId={0}&Id={1}",UnitWorkId,Id, "选择- ")));
}
#endregion
@@ -153,18 +175,17 @@ namespace FineUIPro.Web.CLGL
TypeInt = int.Parse( drpTypeInt.SelectedValue),
Remark = txtRemark.Text,
InOutType=(int)TwConst.InOutType.,
Category= (int)TwConst.Category.,
Category= int.Parse(drpCategory.SelectedValue),
State=state
};
TwInOutplanmasterService.Add(model);
}
else
{
var model = TwInOutplanmasterService.GetById(Id);
model.ProjectId = this.CurrUser.LoginProjectId;
var model = TwInOutplanmasterService.GetById(Id);
model.CusBillCode = txtCusBillCode.Text;
model.WarehouseCode = drpWarehouse.SelectedValue;
model.WeldTaskId = UnitWorkId;
// model.WeldTaskId = UnitWorkId;
model.Source = 1;
model.CreateDate = DateTime.Now;
model.CreateMan = this.CurrUser.PersonId;
@@ -172,11 +193,11 @@ namespace FineUIPro.Web.CLGL
model.TypeInt = int.Parse(drpTypeInt.SelectedValue);
model.Remark = txtRemark.Text;
model.InOutType = (int)TwConst.InOutType.;
model.Category = (int)TwConst.Category.;
model.Category = int.Parse(drpCategory.SelectedValue);
model.State = state;
TwInOutplanmasterService.Update(model);
}
}
SaveDetail();
}
/// <summary>
@@ -192,8 +213,9 @@ namespace FineUIPro.Web.CLGL
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
string id = teamGroupRow.Value<string>("id");
var mdoel=TwInoutplandetailRelationService.GetById(values.Value<string>("Id"));
var mdoel=TwInoutplandetailRelationService.GetById(id);
if (mdoel != null)
{
mdoel.Number= values.Value<decimal>("Number");
@@ -214,5 +236,10 @@ namespace FineUIPro.Web.CLGL
BindGrid(Id);
}
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid(Id);
}
}
}
+11 -2
View File
@@ -24,13 +24,13 @@ namespace FineUIPro.Web.CLGL
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Form2 控件。
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form2;
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// TbCreate 控件。
@@ -95,6 +95,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.DropDownList drpTypeInt;
/// <summary>
/// drpCategory 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCategory;
/// <summary>
/// txtCusBillCode 控件。
/// </summary>
@@ -32,7 +32,7 @@ namespace FineUIPro.Web.CLGL
if (!string.IsNullOrEmpty(Id))
{
Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput();
table.InOutPlanMasterId = Id;
table.Id = Id;
var model = TwInOutplanmasterService.GetListData(table).FirstOrDefault();
txtCusBillCode.Text = TwOutputmasterService.GetCusBillCodeByTaskCode(model.WeldTaskCode, (TwConst.TypeInt)model.TypeInt, (BLL.TwConst.Category)model.Category);
@@ -64,11 +64,11 @@
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊口信息"
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1" OnRowDataBound="Grid1_RowDataBound" DisableUnselectableRows="true"
DataKeyNames="WeldJointId" EnableColumnLines="true"
DataIDField="WeldJointId" EnableTextSelection="True" AllowSorting="true" SortField="WeldJointNum,WeldJointNumStr"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="false" IsDatabasePaging="true" OnRowCommand="Grid1_RowCommand"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title=""
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1" DisableUnselectableRows="true"
DataKeyNames="PipeLineMatId" EnableColumnLines="true"
DataIDField="PipeLineMatId" EnableTextSelection="True" AllowSorting="true" SortField="MaterialCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="false" IsDatabasePaging="true"
PageSize="1000" EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
@@ -11,7 +11,7 @@ namespace FineUIPro.Web.CLGL
public partial class OutPlanMasterSelect : PageBase
{
#region
/// <summary>
/// 单位工程主键
/// </summary>
@@ -52,7 +52,10 @@ namespace FineUIPro.Web.CLGL
{
if (!IsPostBack)
{
UnitWorkId=Request.QueryString["UnitWorkId"];
Id = Request.QueryString["Id"];
this.InitTreeMenu();//加载树
InitDropList();
}
}
#endregion
@@ -209,20 +212,64 @@ namespace FineUIPro.Web.CLGL
/// </summary>
private void BindGrid()
{
//var tb=from x in Funs.DB.HJGL_PipeLineMat
// join y in Funs.DB.HJGL_Pipeline on x.PipelineId equals y.PipelineId
// join z in Funs.DB.Tw_MaterialStock on x.MaterialCode equals z.PipeLineMatCode
// where y.ProjectId == this.CurrUser.LoginProjectId && y.UnitWorkId == this.UnitWorkId && y.PipelineId== this.tvControlItem.SelectedNodeID
// 确保 SelectedNodeID 不为空
if (this.tvControlItem.SelectedNodeID == null)
{
return; // 或者显示一个提示
}
int Category=(int)TwInOutplanmasterService.GetById(Id).Category;
var tb = (from x in Funs.DB.HJGL_PipeLineMat
join y in Funs.DB.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in Funs.DB.Tw_MaterialStock on x.MaterialCode equals z.PipeLineMatCode into zz
from z in zz.DefaultIfEmpty()
join lib in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals lib.MaterialCode
where y.ProjectId == this.CurrUser.LoginProjectId
&& y.UnitWorkId == this.UnitWorkId
&& y.PipelineId == this.tvControlItem.SelectedNodeID
&& (x.PrefabricatedComponents==null||x.PrefabricatedComponents=="")
select new
{
x.PipeLineMatId,
x.PipelineId,
x.MaterialCode,
lib.MaterialName,
lib.MaterialSpec,
lib.MaterialUnit,
PlanNum = x.Number,
StockNum=z.StockNum??0,
x.IsLooseParts,
}).ToList();
if (Category == (int)TwConst.Category.)
{
tb=tb.Where(x=>x.MaterialUnit.Contains("米")).ToList();
}
else
{
tb = tb.Where(x => x.MaterialUnit.Contains("个")).ToList();
}
var inoutplandetail = (from x in Funs.DB.Tw_InOutPlanDetail_Relation
where x.InOutPlanMasterId == Id && x.PipelineId == this.tvControlItem.SelectedNodeID
select x).ToList();
// 优化 Linq 过滤条件
tb = (from x in tb
join y in inoutplandetail on x.MaterialCode equals y.MaterialCode into yy
from y in yy.DefaultIfEmpty()
where y == null
select x).ToList();
////var tb = PipelineMatService.GetPipeLineMatsByPipelineId(this.tvControlItem.SelectedNodeID);
//Grid1.DataSource = tb;
//Grid1.DataBind();
Grid1.RecordCount = tb.Count;
Grid1.DataSource = tb;
Grid1.DataBind();
}
private void InitDropList()
{
/* var pipeline = (from x in Funs.DB.HJGL_Pipeline
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.UnitWorkId
select x.FlowingSection).Distinct().ToList();
@@ -230,7 +277,7 @@ namespace FineUIPro.Web.CLGL
this.drpFlowingSection.DataValueField = "Value";
this.drpFlowingSection.DataSource = pipeline;
this.drpFlowingSection.DataBind();
Funs.FineUIPleaseSelect(drpFlowingSection);*/
Funs.FineUIPleaseSelect(drpFlowingSection);
}
#endregion
@@ -268,254 +315,43 @@ namespace FineUIPro.Web.CLGL
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(txtTaskDate.Text) + ActiveWindow.GetHidePostBackReference());
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
protected void btnSave_Click(object sender, EventArgs e)
{
/*if (string.IsNullOrEmpty(this.txtTaskCode.Text.Trim()))
{
ShowNotify("请输入焊接任务单编号", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(txtTaskDate.Text))
{
if (!string.IsNullOrEmpty(TaskDate))
{
SaveTask(false);
BindGrid();
}
else
{
var task = from x in Funs.DB.HJGL_WeldTask
where x.UnitWorkId == UnitWorkId && x.UnitId == this.drpUnit.SelectedValue
&& x.TaskDate.Value.Date.ToString() == Convert.ToDateTime(txtTaskDate.Text.Trim()).ToString("yyyy-MM-dd")
select x;
if (task.Count() > 0)
{
ShowNotify("所选预计焊接日期已存在,请重新选择!", MessageBoxIcon.Warning);
return;
}
else
{
SaveTask(false);
TaskDate = txtTaskDate.Text;
BindGrid();
}
}
}
else
{
ShowNotify("请选择预计焊接日期", MessageBoxIcon.Warning);
return;
}*/
}
private void SaveTask(bool IsCloseForm)
{
/*var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x;
var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x;
string[] selectRowId = Grid1.SelectedRowIDArray;
for (int i = 0; i < selectRowId.Count(); i++)
{
string canWeldingRodName = string.Empty;
string canWeldingWireName = string.Empty;
Model.HJGL_WeldTask NewTask = new Model.HJGL_WeldTask();
NewTask.ProjectId = this.CurrUser.LoginProjectId;
NewTask.UnitWorkId = this.UnitWorkId;
NewTask.UnitId = drpUnit.SelectedValue;
NewTask.TaskCode = this.txtTaskCode.Text.Trim();
NewTask.WeldTaskId = SQLHelper.GetNewID();
NewTask.WeldJointId = selectRowId[i];
var oldWeldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(NewTask.WeldJointId);
if (oldWeldTask != null)
{
ShowNotify("所选焊口已存在任务单,无法保存!", MessageBoxIcon.Warning);
return;
}
Model.HJGL_WeldJoint weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(NewTask.WeldJointId);
if (weldJoint != null)
{
NewTask.WeldingRod = weldJoint.WeldingRod;
NewTask.WeldingWire = weldJoint.WeldingWire;
//获取可替代焊丝焊条
var mat = BLL.Base_MaterialService.GetMaterialByMaterialId(weldJoint.Material1Id);
string matClass = mat.MaterialClass;
var matRod = weldingRods.FirstOrDefault(x => x.ConsumablesId == weldJoint.WeldingRod);
if (matRod != null)
{
foreach (var item in weldingRods)
{
if (matClass == "Fe-1" || matClass == "Fe-3")
{
if (IsCoverClass(matRod.SteelType, item.SteelType))
{
canWeldingRodName = canWeldingRodName + item.ConsumablesName + ",";
}
}
else
{
if (matRod.SteelType == item.SteelType)
{
canWeldingRodName = canWeldingRodName + item.ConsumablesName + ",";
}
}
}
if (!string.IsNullOrEmpty(canWeldingRodName))
{
NewTask.CanWeldingRodName = canWeldingRodName.Substring(0, canWeldingRodName.Length - 1);
}
}
var matWire = weldingWires.FirstOrDefault(x => x.ConsumablesId == weldJoint.WeldingWire);
if (matWire != null)
{
foreach (var item in weldingWires)
{
if (matClass == "Fe-1" || matClass == "Fe-3")
{
if (IsCoverClass(matWire.SteelType, item.SteelType))
{
canWeldingWireName = canWeldingWireName + item.ConsumablesName + ",";
}
}
else
{
if (matWire.SteelType == item.SteelType)
{
canWeldingWireName = canWeldingWireName + item.ConsumablesName + ",";
}
}
}
if (!string.IsNullOrEmpty(canWeldingWireName))
{
NewTask.CanWeldingWireName = canWeldingWireName.Substring(0, canWeldingWireName.Length - 1);
}
}
}
//NewTask.JointAttribute = drpJointAttribute.SelectedValue;
NewTask.JointAttribute = weldJoint.JointAttribute;
NewTask.WeldingMode = drpWeldingMode.SelectedValue;
NewTask.TaskDate = Convert.ToDateTime(txtTaskDate.Text);
NewTask.Tabler = this.CurrUser.PersonId;
NewTask.TableDate = DateTime.Now;
weldJoint.WeldingMode = drpWeldingMode.SelectedValue;
BLL.WeldJointService.UpdateWeldJoint(weldJoint);
BLL.WeldTaskService.AddWeldTask(NewTask);
}
//string pipelineId = this.tvControlItem.SelectedNodeID;
//var model = BLL.PipelineService.GetPipelineByPipelineId(pipelineId);
//model.State = 1;
//PipelineService.UpdatePipeline(model);
ShowNotify("保存成功!", MessageBoxIcon.Success);
if (IsCloseForm)
{
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(txtTaskDate.Text) + ActiveWindow.GetHidePostBackReference());
}*/
//PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 判断耗材强度是否大于WPS耗材强度,如是为true,否则为false
/// </summary>
/// <param name="wpsClass"></param>
/// <param name="matClass"></param>
/// <returns></returns>
private bool IsCoverClass(string wpsClass, string matClass)
{
bool isCover = false;
/*int wpsSn = 0;
int matSn = 0;
if (wpsClass.Length > 2 && matClass.Length > 2)
{
string wpsPre = wpsClass.Substring(0, wpsClass.Length - 2);
string matPre = matClass.Substring(0, matClass.Length - 2);
string wps = wpsClass.Substring(wpsClass.Length - 1, 1);
wpsSn = Funs.GetNewInt(wps).HasValue ? Funs.GetNewInt(wps).Value : 0;
string mat = matClass.Substring(matClass.Length - 1, 1);
matSn = Funs.GetNewInt(mat).HasValue ? Funs.GetNewInt(mat).Value : 0;
if (wpsPre == matPre && matSn >= wpsSn)
{
return true;
}
}*/
return isCover;
}
#endregion
protected void txtTaskDate_TextChanged(object sender, EventArgs e)
{
// this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue);
}
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
{
//this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue);
}
protected void drpJointAttribute_SelectedIndexChanged(object sender, EventArgs e)
{
Save();
BindGrid();
}
/// <summary>
/// 行绑定事件(没有焊接方法无法选择)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
private void Save()
{
/*DataRowView row = e.DataItem as DataRowView;
if (string.IsNullOrEmpty(row["WeldingMethodCode"].ToString()))
var List_Id = Grid1.SelectedRowIDArray;
if (List_Id != null)
{
e.RowSelectable = false;
};*/
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "ResetWpq")
{
/*var weldJointId = e.RowID;
var model = WeldJointService.GetWeldJointByWeldJointId(weldJointId);
if (model != null)
foreach (var id in List_Id)
{
model.WPQId = null;
WeldJointService.UpdateWeldJoint(model);
List<Model.View_HJGL_WPQ> wpqList = BLL.WPQListServiceService.GetMatchWPQ(model, this.CurrUser.LoginProjectId, drpUnit.SelectedValue);
if (wpqList != null)
var hJGL_PipeLineMat = BLL.PipelineMatService.GetPipeLineMat(id);
if (hJGL_PipeLineMat != null)
{
Model.HJGL_WeldJoint newJot = new Model.HJGL_WeldJoint();
Model.WPQ_WPQList wps = BLL.WPQListServiceService.GetWPQById(wpqList.First().WPQId);
newJot.WPQId = wps.WPQId;
newJot.WeldJointId = model.WeldJointId;
newJot.WeldingRod = wps.WeldingRod;
newJot.WeldingWire = wps.WeldingWire;
newJot.WeldingMethodId = wps.WeldingMethodId;
newJot.GrooveTypeId = wps.GrooveType;
newJot.PreTemperature = wps.PreTemperature;
newJot.IsHotProess = wps.IsHotProess;
newJot.MatchableWPQ = string.Join(",", wpqList.Select(x => x.WPQCode));
BLL.WeldJointService.UpdateConWeldJoint(newJot);
var model = new Model.Tw_InOutPlanDetail_Relation()
{
Id = SQLHelper.GetNewID(),
PipelineId = hJGL_PipeLineMat.PipelineId,
MaterialCode = hJGL_PipeLineMat.MaterialCode,
Number = hJGL_PipeLineMat.Number,
PrefabricatedComponents = hJGL_PipeLineMat.PrefabricatedComponents,
InOutPlanMasterId = Id,
};
TwInoutplandetailRelationService.Add(model);
}
BindGrid();
ShowNotify("焊评已重置!", MessageBoxIcon.Success);
}*/
}
}
}
TwInOutplandetailService.GenInOutPlanDetailByInoutPlanMasterId(Id);
}
#endregion
}
}
+7 -4
View File
@@ -122,6 +122,12 @@
<f:RenderField Width="150px" ColumnID="StateString" DataField="StateString" SortField="StateString"
FieldType="String" HeaderText="状态" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ReqUnitName" DataField="ReqUnitName" SortField="ReqUnitName"
FieldType="String" HeaderText="领料单位" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="CreateManName" DataField="CreateManName" SortField="CreateManName"
FieldType="String" HeaderText="发起人" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -133,10 +139,7 @@
</f:RenderField>
<f:RenderField Width="150px" ColumnID="AuditDate" DataField="AuditDate" SortField="AuditDate" Renderer="Date"
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ReqUnitName" DataField="ReqUnitName" SortField="ReqUnitName"
FieldType="String" HeaderText="领料单位" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</f:RenderField>
</Columns>
<Listeners>