Browse Source

报表加模糊查询

master
qian 10 months ago
parent
commit
a8a35eea3b
  1. 582
      北京北汽/Controller/SCP_ASK_CONTROLLER.cs
  2. 47
      北京北汽/Controller/SCP_PO_CONTROLLER.cs
  3. 1
      北京北汽/Models/CK.SCP.Models.csproj
  4. 1
      北京北汽/Models/ScpEntities.cs
  5. 4
      北京北汽/Models/ScpEntity/V_TB_ASK.cs
  6. 54
      北京北汽/Models/ScpEntity/V_TB_ASK_DETAIL_PO.cs
  7. 8
      北京北汽/SCP/SCP.csproj
  8. 27
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx
  9. 21
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs
  10. 53
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.designer.cs
  11. 7
      北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx
  12. 4
      北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs
  13. 103
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx
  14. 161
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.cs
  15. 179
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.designer.cs

582
北京北汽/Controller/SCP_ASK_CONTROLLER.cs

File diff suppressed because it is too large

47
北京北汽/Controller/SCP_PO_CONTROLLER.cs

@ -5395,5 +5395,52 @@ namespace CK.SCP.Controller
return p_list; return p_list;
} }
#endregion #endregion
public static List<V_TB_ASK_DETAIL_PO> LOAD_ASK_DETAIL_PO_SUM(List<V_TB_ASK_DETAIL_PO> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
foreach (V_TB_ASK_DETAIL_PO _detail in p_list)
{
var rec = db.TB_RECEIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ReceiveState.Check && p.BillType == 0)
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { ReceiveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode });
var asn = db.TB_ASN_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && (p.State == (int)AsnState.Ship || p.State == (int)AsnState.Receive))
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode })
.Select(p => new { AsSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode });
var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == (int)ArriveBillType.Receive)
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.SubSite }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode, Subsite = p.Key.SubSite });
rec.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode)
{
_detail.ReceivedQty = itm.ReceiveSum;
}
});
asn.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode)
{
_detail.ShippedQty = itm.AsSum;
}
});
arrive.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode && _detail.SubSite == itm.Subsite)
{
_detail.ArriveQty = itm.ArriveSum;
}
});
}
}
}
return p_list;
}
} }
} }

1
北京北汽/Models/CK.SCP.Models.csproj

@ -429,6 +429,7 @@
<Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_ASK.cs" /> <Compile Include="ScpEntity\V_TB_ASK.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" /> <Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PO.cs" />
<Compile Include="ScpEntity\V_TB_FORECAST.cs" /> <Compile Include="ScpEntity\V_TB_FORECAST.cs" />
<Compile Include="ScpEntity\V_TB_INCOMOLETE_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_INCOMOLETE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" /> <Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" />

1
北京北汽/Models/ScpEntities.cs

@ -163,6 +163,7 @@ namespace CK.SCP.Models
public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; } public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; } public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; }
public virtual DbSet<V_TB_ASK_DETAIL_PO> V_TB_ASK_DETAIL_PO { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) protected override void OnModelCreating(DbModelBuilder modelBuilder)
{ {

4
北京北汽/Models/ScpEntity/V_TB_ASK.cs

@ -78,6 +78,10 @@ namespace CK.SCP.Models.ScpEntity
public string Month { get; set; } public string Month { get; set; }
[NotMapped] [NotMapped]
public bool IsComplete { get; set; } public bool IsComplete { get; set; }
[NotMapped]
public string PartCode { get; set; }
[NotMapped]
public string PartCodeDesc { get; set; }
#endregion #endregion
} }
} }

54
北京北汽/Models/ScpEntity/V_TB_ASK_DETAIL_PO.cs

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TB_ASK_DETAIL_PO
{
[Key]
public long UID { get; set; }
public string PoBillNum { get; set; }
public int ModType { get; set; }
public string ModType_DESC { get; set; }
public string AskBillNum { get; set; }
public string VendName { get; set; }
public string VendId { get; set; }
public DateTime BeginTime { get; set; }
public int PoLine { get; set; }
public string PartCode { get; set; }
public string PartDesc { get; set; }
public string VendPartCode { get; set; }
public string PoUnit { get; set; }
public decimal Price { get; set; }
public decimal AskQty { get; set; }
public decimal ShippedQty { get; set; }
public decimal ReceivedQty { get; set; }
public decimal ArriveQty { get; set; }
public DateTime EndTime { get; set; }
public string Site_Desc { get; set; }
public string Buyer { get; set; }
public string BuyerPhone { get; set; }
[NotMapped]
public string Site { get; set; }
[NotMapped]
public string SubSite { get; set; }
#region 查询条件
[NotMapped]
public DateTime? TimeBegin { get; set; }
[NotMapped]
public DateTime? TimeEnd { get; set; }
[NotMapped]
public List<string> UserInAddress { set; get; }
[NotMapped]
public List<string> UserInSubSite { set; get; }
[NotMapped]
public string UserName { set; get; }
#endregion
}
}

8
北京北汽/SCP/SCP.csproj

@ -2925,6 +2925,7 @@
<Content Include="grf\SmallBarCode.grf" /> <Content Include="grf\SmallBarCode.grf" />
<Content Include="grf\InvRecBill.grf" /> <Content Include="grf\InvRecBill.grf" />
<Content Include="Handlers\MakeVerifyCode.ashx" /> <Content Include="Handlers\MakeVerifyCode.ashx" />
<Content Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx" />
<Content Include="Views\PlanData\SCP_PO_CQ.aspx" /> <Content Include="Views\PlanData\SCP_PO_CQ.aspx" />
<Content Include="Views\PlanData\SCP_PO_DETAIL_CQ.aspx" /> <Content Include="Views\PlanData\SCP_PO_DETAIL_CQ.aspx" />
<None Include="Properties\PublishProfiles\COM.pubxml" /> <None Include="Properties\PublishProfiles\COM.pubxml" />
@ -5469,6 +5470,13 @@
<Compile Include="Views\PlanData\SCP_ASK.aspx.designer.cs"> <Compile Include="Views\PlanData\SCP_ASK.aspx.designer.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon> <DependentUpon>SCP_ASK.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx.cs">
<DependentUpon>SCP_TB_ASK_DETAIL_PO.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx.designer.cs">
<DependentUpon>SCP_TB_ASK_DETAIL_PO.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_ASN_EXCEPTION_DETAIL.aspx.cs"> <Compile Include="Views\PlanData\SCP_ASN_EXCEPTION_DETAIL.aspx.cs">
<DependentUpon>SCP_ASN_EXCEPTION_DETAIL.aspx</DependentUpon> <DependentUpon>SCP_ASN_EXCEPTION_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

27
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx

@ -101,29 +101,42 @@
<%-- <f:ListItem Text="已收货" Value="4" /> <%-- <f:ListItem Text="已收货" Value="4" />
<f:ListItem Text="已完成" Value="5" />--%> <f:ListItem Text="已完成" Value="5" />--%>
</f:DropDownList> </f:DropDownList>
<f:TextBox ID="TXT_Buyer" runat="server" Label="采购员"></f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%"> <f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items> <Items>
<f:TextBox ID="TXT_Buyer" runat="server" Label="采购员"></f:TextBox>
<f:TextBox ID="TXT_BuyerPhone" runat="server" Label="采购员电话"></f:TextBox> <f:TextBox ID="TXT_BuyerPhone" runat="server" Label="采购员电话"></f:TextBox>
<f:TextBox ID="TextBox_PartCode" runat="server" Label="零件编号"/>
<f:TextBox ID="TextBox_PartCodeDesc" runat="server" Label="零件名称"/>
<f:TextBox ID="TXT_Remark" runat="server" Label="备注" /> <f:TextBox ID="TXT_Remark" runat="server" Label="备注" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button> <f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找"/>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找"> <f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"/>
</f:Button>
</Items> </Items>
</f:FormRow> </f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:GroupPanel runat="server" ID="gp2" Hidden="true" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:TextBox runat="server" Required="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode"></f:TextBox> <f:TextBox runat="server" Required="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode"></f:TextBox>
<f:Button ID="BtnSearchDetail" runat="server" OnClick="BtnSearchDetail_Click" Text="快速查找订单明细"> <f:TextBox runat="server" Required="true" Label="零件名称" EmptyText="查询请填写零件名称" ID="TXT_PartCodeDesc"/>
</f:Button> <f:Button ID="Button10" runat="server" OnClick="BtnSearchDetail_Click" Text="订单明细快速查找"/>
<f:Button runat="server" Text="关闭" ID="Button8" OnClick="Btn2Close_Click"/>
</Items> </Items>
</f:FormRow> </f:FormRow>
</Rows> </Rows>

21
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs

@ -96,9 +96,16 @@ namespace SCP.PlanData
public void BindAsk() public void BindAsk()
{ {
SearchV_TB_ASKData((result) => { SearchV_TB_ASKData((result) => {
Grid_V_TB_ASK.RecordCount = result.Count(); //var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK);
var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK); if (Grid_V_TB_ASK.PageIndex >= Grid_V_TB_ASK.PageCount && Grid_V_TB_ASK.PageCount >= 1)
var _ls=SCP_ASK_CONTROLLER.GET_IS_COMPLETED_SEND(list.ToList()); {
Grid_V_TB_ASK.PageIndex = Grid_V_TB_ASK.PageCount - 1;
}
result = result.SortBy(Grid_V_TB_ASK.SortField + " " + Grid_V_TB_ASK.SortDirection);
var list1 = SCP_ASK_CONTROLLER.GET_Likesearch(result.ToList(), TextBox_PartCode.Text, TextBox_PartCodeDesc.Text);
Grid_V_TB_ASK.RecordCount = list1.Count();
list1 = list1.Skip(Grid_V_TB_ASK.PageIndex * Grid_V_TB_ASK.PageSize).Take(Grid_V_TB_ASK.PageSize).ToList();
var _ls=SCP_ASK_CONTROLLER.GET_IS_COMPLETED_SEND(list1);
Grid_V_TB_ASK.DataSource = _ls .OrderBy(p => p.State).ThenByDescending(p => p.BeginTime); Grid_V_TB_ASK.DataSource = _ls .OrderBy(p => p.State).ThenByDescending(p => p.BeginTime);
Grid_V_TB_ASK.DataBind(); Grid_V_TB_ASK.DataBind();
}); });
@ -303,12 +310,17 @@ namespace SCP.PlanData
protected void btnShow_Click(object sender, EventArgs e) protected void btnShow_Click(object sender, EventArgs e)
{ {
gp1.Hidden = false; gp1.Hidden = false;
gp2.Hidden = false;
} }
protected void BtnClose_Click(object sender, EventArgs e) protected void BtnClose_Click(object sender, EventArgs e)
{ {
gp1.Hidden = true; gp1.Hidden = true;
} }
protected void Btn2Close_Click(object sender, EventArgs e)
{
gp2.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e) protected void BtnSearch_Click(object sender, EventArgs e)
{ {
@ -392,7 +404,8 @@ namespace SCP.PlanData
string VendName = ddl_Vender.SelectedValue; string VendName = ddl_Vender.SelectedValue;
string State = DDL_State.SelectedValue; string State = DDL_State.SelectedValue;
string PartCode = TXT_PartCode.Text; string PartCode = TXT_PartCode.Text;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}", AskBillNum, VendName, State, PartCode))); string PartCodeDesc = TXT_PartCodeDesc.Text;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}&&PartCodeDesc={4}", AskBillNum, VendName, State, PartCode,PartCodeDesc)));
} }
protected void Grid_V_TB_ASK_RowDataBound(object sender, GridRowEventArgs e) protected void Grid_V_TB_ASK_RowDataBound(object sender, GridRowEventArgs e)
{ {

53
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.designer.cs

@ -320,6 +320,24 @@ namespace SCP.PlanData
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_BuyerPhone; protected global::FineUI.TextBox TXT_BuyerPhone;
/// <summary>
/// TextBox_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox_PartCode;
/// <summary>
/// TextBox_PartCodeDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox_PartCodeDesc;
/// <summary> /// <summary>
/// TXT_Remark 控件。 /// TXT_Remark 控件。
/// </summary> /// </summary>
@ -329,6 +347,15 @@ namespace SCP.PlanData
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Remark; protected global::FineUI.TextBox TXT_Remark;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary> /// <summary>
/// BtnClose 控件。 /// BtnClose 控件。
/// </summary> /// </summary>
@ -339,13 +366,13 @@ namespace SCP.PlanData
protected global::FineUI.Button BtnClose; protected global::FineUI.Button BtnClose;
/// <summary> /// <summary>
/// BtnSearch 控件。 /// gp2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnSearch; protected global::FineUI.GroupPanel gp2;
/// <summary> /// <summary>
/// TXT_PartCode 控件。 /// TXT_PartCode 控件。
@ -357,13 +384,31 @@ namespace SCP.PlanData
protected global::FineUI.TextBox TXT_PartCode; protected global::FineUI.TextBox TXT_PartCode;
/// <summary> /// <summary>
/// BtnSearchDetail 控件。 /// TXT_PartCodeDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCodeDesc;
/// <summary>
/// Button10 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button10;
/// <summary>
/// Button8 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnSearchDetail; protected global::FineUI.Button Button8;
/// <summary> /// <summary>
/// Grid_V_TB_ASK 控件。 /// Grid_V_TB_ASK 控件。

7
北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx

@ -103,8 +103,11 @@
<f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" Hidden="true" DataFormatString = "{0:F}" /> <f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" Hidden="true" DataFormatString = "{0:F}" />
<f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="库位" ColumnID="ReceivedPort" /> <f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="库位" ColumnID="ReceivedPort" />
<f:BoundField SortField="Extend1" DataField="Extend1" HeaderText="唯一码" ColumnID="Extend1" /> <f:BoundField SortField="Extend1" DataField="Extend1" HeaderText="唯一码" ColumnID="Extend1" />
<f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark" /> <f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark" />
<f:BoundField SortField="BeginTime" DataField="BeginTime" HeaderText="订货日期" ColumnID="BeginTime" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单号" ColumnID="PoBillNum" />
<f:BoundField DataField="AskBillNum" HeaderText="要货看板编号" SortField="AskBillNum" ColumnID="AskBillNum" />
<f:BoundField SortField="VendId" DataField="VendId" HeaderText="供应商" ColumnID="VendId" />
</Columns> </Columns>
</f:Grid> </f:Grid>

4
北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs

@ -429,6 +429,10 @@ namespace SCP.PlanData
{ {
_entity.State = int.Parse(Request["State"]); _entity.State = int.Parse(Request["State"]);
} }
if (!string.IsNullOrEmpty(Request["PartCodeDesc"]))
{
_entity.PartDesc1 = Request["PartCodeDesc"];
}
} }
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>

103
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx

@ -0,0 +1,103 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_TB_ASK_DETAIL_PO.aspx.cs" Inherits="SCP.PlanData.SCP_TB_ASK_DETAIL_PO" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();"/>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="15% 15% 15% 15% ">
<Items>
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PoBillNum" />
<f:TextBox runat="server" Label="要货看板号" EmptyText="" ID="TXT_AskBillNum" />
<f:TextBox runat="server" Label="供应商" EmptyText="" ID="TXT_VendName" />
<f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendID" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="15% 15% 15% 15%">
<Items>
<f:TextBox runat="server" Label="零件号" EmptyText="" ID="TXT_PartCode" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="TimeBegin" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="TimeEnd" />
<f:TextBox runat="server" Label="采购人" EmptyText="" ID="Text_Buyer" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:Button runat="server" Text="重置" ID="BtnReset" OnClick="BtnReset_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
<f:Button ID="BTN_EXCEL" runat="server" OnClick="BTN_EXCEL_Click" Text="导出EXCEL">
</f:Button>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid ID="Grid_V_TB_ASK_DETAIL_PO" ShowBorder="true" ShowHeader="true" PageSize="15" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,PoBillNum,ModType_DESC,AskBillNum,VendName,VendId,BeginTime,PoLine,PartCode,PartDesc,VendPartCode,PoUnit,Price,AskQty,ShippedQty,ReceivedQty,ArriveQty,EndTime,Site_Desc,Buyer,BuyerPhone"
IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True"
OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PO_PageIndexChange">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="20" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="80px" DataField="PoBillNum" DataFormatString="{0}" HeaderText="订单号" />
<f:BoundField Width="80px" DataField="ModType_DESC" DataFormatString="{0}" HeaderText="单据类型" />
<f:BoundField Width="80px" DataField="AskBillNum" DataFormatString="{0}" HeaderText="要货看板号" />
<f:BoundField Width="80px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
<f:BoundField Width="100px" DataField="VendId" DataFormatString="{0}" HeaderText="供应商编码" />
<f:BoundField Width="100px" DataField="BeginTime" DataFormatString="{0}" HeaderText="订货日期" />
<f:BoundField Width="50px" DataField="PoLine" DataFormatString="{0}" HeaderText="行号" />
<f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="零件号" />
<f:BoundField Width="100px" DataField="PartDesc" DataFormatString="{0}" HeaderText="零件名称" />
<f:BoundField Width="100px" DataField="VendPartCode" DataFormatString="{0}" HeaderText="供应商零件名称" />
<f:BoundField Width="50px" DataField="PoUnit" DataFormatString="{0}" HeaderText="单位" />
<f:BoundField Width="80px" DataField="Price" DataFormatString="{0:F}" HeaderText="价格" />
<f:BoundField Width="100px" DataField="AskQty" DataFormatString="{0:F}" HeaderText="要货数量" />
<f:BoundField Width="100px" DataField="ShippedQty" DataFormatString="{0:F}" HeaderText="发货数量" />
<f:BoundField Width="100px" DataField="ReceivedQty" DataFormatString="{0:F}" HeaderText="收货数量" />
<f:BoundField Width="100px" DataField="ArriveQty" DataFormatString="{0:F}" HeaderText="到货数量" />
<f:BoundField Width="100px" DataField="EndTime" DataFormatString="{0}" HeaderText="到货日期" />
<f:BoundField Width="100px" DataField="Site_Desc" DataFormatString="{0}" HeaderText="地点" />
<f:BoundField Width="100px" DataField="Buyer" DataFormatString="{0}" HeaderText="采购人员" />
<f:BoundField Width="100px" DataField="BuyerPhone" DataFormatString="{0}" HeaderText="采购电话" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

161
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.cs

@ -0,0 +1,161 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using FineUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
namespace SCP.PlanData
{
public partial class SCP_TB_ASK_DETAIL_PO : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDetail();
TimeBegin.MinDate = DateTime.Now.AddYears(-1);
TimeBegin.MaxDate = DateTime.Now;
TimeEnd.MaxDate = DateTime.Now;
TimeEnd.MinDate = TimeBegin.MinDate;
}
}
public List<V_TB_ASK_DETAIL_PO> SearchV_TB_ASK_DETAILData()
{
List<V_TB_ASK_DETAIL_PO> list = new List<V_TB_ASK_DETAIL_PO>();
V_TB_ASK_DETAIL_PO _entity = new V_TB_ASK_DETAIL_PO();
_entity.PoBillNum = TXT_PoBillNum.Text;
_entity.AskBillNum = TXT_AskBillNum.Text;
_entity.PartCode = TXT_PartCode.Text;
_entity.VendName = TXT_VendName.Text;
_entity.VendId = TXT_VendID.Text;
if (TimeBegin.SelectedDate != null)
{
_entity.TimeBegin = TimeBegin.SelectedDate;
}
else
{
_entity.TimeBegin = DateTime.Now.AddYears(-1);
}
if (TimeEnd.SelectedDate != null)
{
_entity.TimeEnd = TimeEnd.SelectedDate;
}
else
{
_entity.TimeEnd = DateTime.Now;
}
#region 权限
if (!string.IsNullOrEmpty(CurrentUser.Name))
{
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
if (!string.IsNullOrEmpty(this.Text_Buyer.Text))
{
_entity.Buyer = Text_Buyer.Text;
}
}
}
_entity.UserInAddress = CurrentUser.FactoryList;
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
_entity.UserName = User.Identity.Name;
}
//_entity.UserInSubSite = CurrentUser.SubSiteList;
#endregion
list = SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_PO_List(_entity);
return list;
}
public void BindDetail()
{
List<V_TB_ASK_DETAIL_PO> list = SearchV_TB_ASK_DETAILData();
Grid_V_TB_ASK_DETAIL_PO.RecordCount = list.Count();
list = list.OrderByDescending(q=>q.AskBillNum).ToList();
if (Grid_V_TB_ASK_DETAIL_PO.PageIndex >= Grid_V_TB_ASK_DETAIL_PO.PageCount && Grid_V_TB_ASK_DETAIL_PO.PageCount >= 1)
{
Grid_V_TB_ASK_DETAIL_PO.PageIndex = Grid_V_TB_ASK_DETAIL_PO.PageCount - 1;
}
list = list.Skip(Grid_V_TB_ASK_DETAIL_PO.PageIndex * Grid_V_TB_ASK_DETAIL_PO.PageSize).Take(Grid_V_TB_ASK_DETAIL_PO.PageSize).ToList();
Grid_V_TB_ASK_DETAIL_PO.DataSource = list;
Grid_V_TB_ASK_DETAIL_PO.DataBind();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK_DETAIL_PO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void Grid_V_TB_ASK_DETAIL_PO_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
/// <summary>
/// 重置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnReset_Click(object sender, EventArgs e)
{
TXT_PoBillNum.Text = string.Empty;
TXT_AskBillNum.Text = string.Empty;
TXT_PartCode.Text = string.Empty;
TXT_VendName.Text = string.Empty;
TXT_VendID.Text = string.Empty;
TimeBegin.SelectedDate = null;
TimeEnd.SelectedDate = null;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindDetail();
}
protected void BTN_EXCEL_Click(object sender, EventArgs e)
{
List<V_TB_ASK_DETAIL_PO> list = SearchV_TB_ASK_DETAILData();
if (list == null)
{
Alert.Show("没有数据!");
return;
}
Dictionary<string, string> cellheader = new Dictionary<string, string>(){
{"PoBillNum" , "订单号" },
{"ModType_DESC" , "单据类型" },
{ "AskBillNum" , "要货看板号" },
{ "VendName" , "供应商" },
{ "VendId" , "供应商编码" },
{ "BeginTime" , "订货日期" },
{ "PoLine" , "行号" },
{ "PartCode" , "零件号" },
{ "PartDesc" , "零件名称" },
{ "VendPartCode" , "供应商零件名称" },
{ "PoUnit" , "单位" },
{ "Price" , "价格" },
{ "AskQty" , "要货数量" },
{ "ShippedQty" , "发货数量" },
{ "ReceivedQty" , "收货数量" },
{ "ArriveQty" , "到货数量" },
{ "EndTime" , "到货日期" },
{ "Site_Desc" , "地点" },
{ "Buyer" , "采购人员" },
{ "BuyerPhone" , "采购电话" },
};
string url = EntityListToExcel2003(cellheader, list, "报表明细");
}
}
}

179
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.designer.cs

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.PlanData
{
public partial class SCP_TB_ASK_DETAIL_PO
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// TXT_PoBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum;
/// <summary>
/// TXT_AskBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_AskBillNum;
/// <summary>
/// TXT_VendName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// TXT_VendID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendID;
/// <summary>
/// TXT_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCode;
/// <summary>
/// TimeBegin 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TimeBegin;
/// <summary>
/// TimeEnd 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TimeEnd;
/// <summary>
/// Text_Buyer 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox Text_Buyer;
/// <summary>
/// BtnReset 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnReset;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// BTN_EXCEL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_EXCEL;
/// <summary>
/// Grid_V_TB_ASK_DETAIL_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL_PO;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}
Loading…
Cancel
Save