yidi.wu
10 months ago
15 changed files with 996 additions and 256 deletions
@ -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
|
|||
|
|||
|
|||
} |
|||
} |
@ -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> |
|||
|
|||
|
|||
|
|||
|
@ -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, "报表明细"); |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
@ -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…
Reference in new issue