Browse Source

78798978

master
TML 4 years ago
parent
commit
f5513ce668
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 667
      Controller/SCP_ASK_CONTROLLER.cs
  3. 477
      Controller/SCP_ASN_CONTROLLER.cs
  4. 7
      Controller/SCP_BARCODE_CONTROLLER.cs
  5. 9
      Controller/SCP_BILLCODE_CONTROLLER.cs
  6. 164
      Controller/SCP_FORECAST_CONTROLLER.cs
  7. 388
      Controller/SCP_INVOICE_CONTROLLER.cs
  8. 524
      Controller/SCP_MoldSharing_Controller.cs
  9. 5
      Controller/SCP_PLAN_CONTROLLER.cs
  10. 161
      Controller/SCP_PO_CONTROLLER.cs
  11. 403
      Controller/SCP_RECEIVE_CONTROLLER.cs
  12. 117
      Controller/SCP_REJECT_CONTROLLER.cs
  13. 236
      Controller/SCP_REPORT_CONTROLLER.cs
  14. 1
      Controller/SCP_TB_PRICE_CONTROLLER.cs
  15. 82
      Controller/SCP_TB_VENDER_CONTROLLER.cs
  16. 105
      Controller/SCP_TS_BARCODE_CONTROLLER.cs
  17. 92
      Controller/SCP_WMS_CONTROLLER.cs
  18. 50
      Controller/UniApiController.cs
  19. 7
      Models/CK.SCP.Models.csproj
  20. 20
      Models/ScpEntities.cs
  21. 9
      Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs
  22. 17
      Models/ScpEntity/ExcelExportEnttity/SCP_MOLDSHARING_EXPORT.cs
  23. 22
      Models/ScpEntity/ExcelExportEnttity/SCP_OTD_VendId_REPORT_EXPORT.cs
  24. 25
      Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs
  25. 23
      Models/ScpEntity/ExcelImportEntity/SCP_ASN_EXCEL.cs
  26. 10
      Models/ScpEntity/ExcelImportEntity/SCP_PO_EXCEL.cs
  27. 31
      Models/ScpEntity/TA_MOLDSHARING_INVOICE.cs
  28. 34
      Models/ScpEntity/TA_MoldSharing.cs
  29. 49
      Models/ScpEntity/TB_FORECAST.cs
  30. 2
      Models/ScpEntity/TB_INVOICE_DETAIL.cs
  31. 5
      Models/ScpEntity/TS_BARCODE.cs
  32. 4
      Models/ScpEntity/V_TB_ASK.cs
  33. 5
      Models/ScpEntity/V_TB_ASN_DETAIL.cs
  34. 28
      Models/ScpEntity/V_TB_FORECAST.cs
  35. 1
      Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs
  36. 2
      Models/ScpEntity/V_TB_INVOICE.cs
  37. 2
      Models/ScpEntity/V_TB_INVOICE_DETAIL.cs
  38. 6
      Models/ScpEntity/V_TB_RECEIVE.cs
  39. 2
      Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs
  40. 1
      Models/ScpEntity/V_TB_RECEIVE_LIST.cs
  41. 48
      Models/ScpEntity/V_TS_BARCODE.cs
  42. 37
      Models/WmsEntity/VIEW_STOCK_REPORT.cs
  43. 1
      Models/WmsEntity/WmsEntities.cs
  44. 57
      SCP/Admin/UNIAPI.aspx
  45. 74
      SCP/Admin/UNIAPI.aspx.cs
  46. 78
      SCP/Admin/UNIAPI.aspx.designer.cs
  47. 15
      SCP/Business/PageBase.cs
  48. 60
      SCP/Common/MailHelper.cs
  49. 212
      SCP/SCP.csproj
  50. 76
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx
  51. 88
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.cs
  52. 134
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.designer.cs
  53. 92
      SCP/Views/BasicData/SCP_MoldSharing.aspx
  54. 175
      SCP/Views/BasicData/SCP_MoldSharing.aspx.cs
  55. 73
      SCP/Views/BasicData/SCP_MoldSharing.aspx.designer.cs
  56. 17
      SCP/Views/BasicData/Supplier.aspx
  57. 44
      SCP/Views/BasicData/Supplier.aspx.cs
  58. 33
      SCP/Views/BasicData/Supplier.aspx.designer.cs
  59. 9
      SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx
  60. 39
      SCP/Views/PlanData/SCP_PO.aspx
  61. 2
      SCP/Views/PlanData/SCP_PO.aspx.cs
  62. 12
      SCP/Views/PlanData/SCP_PO.aspx.designer.cs
  63. 3
      SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx
  64. 8
      SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx
  65. 3
      SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx.cs
  66. 3
      SCP/Views/SupplierData/SCP_ASK_DETAIL.aspx
  67. 3
      SCP/Views/SupplierData/SCP_INVOICE.aspx
  68. 16
      SCP/Views/SupplierData/SCP_INVOICE.aspx.cs
  69. 32
      SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx.cs
  70. 35
      SCP/Views/SupplierData/SCP_INVOICE_EDIT.aspx.cs
  71. 26
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx
  72. 19
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs
  73. 60
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs
  74. 35
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx
  75. 63
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.cs
  76. 42
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.designer.cs
  77. 161
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx
  78. 225
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs
  79. 126
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs
  80. 103
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx
  81. 416
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs
  82. 143
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs
  83. 152
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx
  84. 560
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.cs
  85. 152
      SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.designer.cs
  86. 250
      SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx
  87. 512
      SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.cs
  88. 395
      SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.designer.cs
  89. 154
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx
  90. 351
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.cs
  91. 368
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.designer.cs
  92. 116
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx
  93. 144
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.cs
  94. 64
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.designer.cs
  95. 129
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx
  96. 175
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.cs
  97. 323
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.designer.cs
  98. 217
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx
  99. 491
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.cs
  100. 359
      SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.designer.cs

1
Controller/CK.SCP.Controller.csproj

@ -59,6 +59,7 @@
<Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" />
<Compile Include="SCP_DC_UNI_CONTROLLER.cs" />
<Compile Include="SCP_FORECAST_CONTROLLER.cs" />
<Compile Include="SCP_MoldSharing_Controller.cs" />
<Compile Include="SCP_PALLET_CONTROLLER.cs" />
<Compile Include="SCP_PLAN_CONTROLLER.cs" />
<Compile Include="SCP_QUALITY_CONTROLLER.cs" />

667
Controller/SCP_ASK_CONTROLLER.cs

File diff suppressed because it is too large

477
Controller/SCP_ASN_CONTROLLER.cs

@ -14,6 +14,7 @@ using System.Data.Entity.Core;
using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Data.SqlClient;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
namespace CK.SCP.Controller
{
@ -308,6 +309,72 @@ namespace CK.SCP.Controller
throw e;
}
}
public static void Get_V_TB_ASN_DETAIL_MODIFY(V_TB_ASN_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASN_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_ASN_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASN_DETAIL>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_ASN_DETAIL> q = db.V_TB_ASN_DETAIL;
if (p_entity.UID!=0)
{
q = q.Where(p => p.UID==p_entity.UID);
}
if (p_entity.IsDeleted != false)
{
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_List", e.Message);
throw e;
}
}
public static void Get_V_TB_ASN_DETAIL_List(V_TB_ASN_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASN_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_ASN_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASN_DETAIL>>();
@ -471,6 +538,112 @@ namespace CK.SCP.Controller
}
public static ResultObject<bool> Save_TB_ASN_DETAIL_MODIFY(V_TB_ASN_DETAIL p_asn,string p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _ls = db.TB_ASN_DETAIL.FirstOrDefault(p => p.UID==p_asn.UID);
if (p_state == "Modify")
{
if (_ls != null)
{
_ls.ProduceDate = p_asn.ProduceDate;
_ls.PackQty = p_asn.PackQty;
_ls.Qty = p_asn.Qty;
_ls.VendBatch = p_asn.VendBatch;
db.TB_ASN_DETAIL.AddOrUpdate(_ls);
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据不存在!";
}
}
if (p_state == "Delete")
{
if (_ls != null)
{
_ls.State =(int)AsnState.Reject;
_ls.IsDeleted = true;
db.TB_ASN_DETAIL.AddOrUpdate(_ls);
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据不存在!";
}
}
if (string.IsNullOrEmpty(_ret.Message))
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据更新失败!";
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_ASN_STATE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_ASN_STATE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_ASN_STATE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_ASN_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
public static ResultObject<bool> Save_TB_ASN_STATE(List<string> p_list, AsnState p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -817,7 +990,8 @@ namespace CK.SCP.Controller
List<V_ARRIVE_PRINT_DETAIL> _lsDetail = new List<V_ARRIVE_PRINT_DETAIL>();
var _ls = retobj.Result.ToList();
_ls.ForEach(p => {
if (p.Qty > 0)
{
V_ARRIVE_PRINT_DETAIL _detail = new V_ARRIVE_PRINT_DETAIL();
_detail.PartNo = p.PartCode;
_detail.PartDesc = p.PartDesc1;
@ -826,7 +1000,14 @@ namespace CK.SCP.Controller
_detail.Boxes = (Math.Truncate((p.Qty / p.PackQty)) + (((p.Qty % p.PackQty) > 0) ? 1 : 0)).ToString();
_detail.DeliverQty = p.Qty.ToString();
_detail.ReceiveQty = p.Qty.ToString();
_detail.PoNo = _print.DeliveryNo+"("+p.PoBillNum+")";
if (p.Site == "0210")
{
_detail.PoNo = p.AskBillNum + "(" + p.PoBillNum + ")";
}
else
{
_detail.PoNo = _print.DeliveryNo + "(" + p.PoBillNum + ")";
}
_detail.LineNO = p.PoLine.ToString();
_detail.Memo = p.Remark;
_detail.DockCode = p.DockCode;
@ -844,6 +1025,7 @@ namespace CK.SCP.Controller
// stdtemp +=_detail.Boxes;
stdtemp += Convert.ToDecimal( _detail.Boxes);
_lsDetail.Add(_detail);
}
});
ds.Tables[0].Rows[0]["STDCOUNT"] = stdtemp.ToString();
var tb = ConvertHelper.ToDataTable(_lsDetail);
@ -2589,10 +2771,293 @@ namespace CK.SCP.Controller
}
return _ret;
}
/// <summary>
/// 数据导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <param name="p_buyer"></param>
/// <param name="p_site"></param>
/// <param name="p_time"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_ASN(List<SCP_ASN_EXCEL> p_order_list, string p_creator, string p_buyer, string p_site, DateTime p_time)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
p_order_list.ForEach
(p =>
{
var _ls = CheckExcel(db, p);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
var GroupList = p_order_list.GroupBy(p => new { p., p., p., p., p., p. }).Select(p => new { = p.Sum(itm => decimal.Parse(itm.)), = p.Key., = p.Key., p.Key., p.Key., p.Key., p.Key. }).ToList();
var OrderList = GroupList.GroupBy(p => p.).ToList();
OrderList.ForEach((p) =>
{
var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
var list = p.ToList();
if (list_distinct.Count < list.Count)
{
_ret.MessageList.Add("相同组号,存在同一编号、行号的数据");
return;
}
if (list.Count > 0)
{
var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.State = (int)AskState.Receive;
_ask.PoBillNum = _entity..ToUpper();
_ask.ModType = (int)BillModType.Contract;
_ask.Site = p_site;
_ask.BeginTime = p_time;
_ask.Buyer = p_creator;
_ask.BuyerPhone = "";
_ask.ErpBillNum = _entity..ToUpper();
_ask.EndTime = p_time;
_ask.CreateTime = p_time;
_ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid();
_ask.IsDeleted = false;
db.TB_ASK.Add(_ask);
TB_ASN _asn = new TB_ASN();
_asn.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
_asn.AskBillNum = _ask.AskBillNum;
_asn.VendId = _entity..ToUpper(); ;
_asn.State = (int)AsnState.Receive;
_asn.PoBillNum = _entity..ToUpper();
_asn.Site = p_site;
_asn.CreateTime = p_time;
_asn.CreateUser = p_creator;
_asn.UpdateTime = p_time;
_asn.UpdateUser = p_creator;
_asn.ShipTime = p_time;
_asn.ShipUser = p_creator;
_asn.ReceiveTime = p_time;
_asn.ReceiveUser = p_creator;
_asn.GUID = Guid.NewGuid();
_asn.IsDeleted = false;
db.TB_ASN.Add(_asn);
list.ForEach((itm) =>
{
TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL();
_t_ASK_Detail.PoLine = Int32.Parse(itm.);
_t_ASK_Detail.Currency = "";
_t_ASK_Detail.AskBillNum = _ask.AskBillNum;
_t_ASK_Detail.PoBillNum = _ask.PoBillNum;
_t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper();
_t_ASK_Detail.BeginTime = p_time;
_t_ASK_Detail.EndTime = p_time;
_t_ASK_Detail.TempQty = itm.;
_t_ASK_Detail.AskQty = itm.;
_t_ASK_Detail.IsDeleted = false;
_t_ASK_Detail.LocUnit = itm.;
_t_ASK_Detail.UnConv = 1;
_t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid();
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
TB_ASN_DETAIL _t_ASN_Detail = new TB_ASN_DETAIL();
_t_ASN_Detail.AsnBillNum = _asn.AsnBillNum;
_t_ASN_Detail.PoLine = Int32.Parse(itm.);
_t_ASN_Detail.Currency = "";
_t_ASN_Detail.PoBillNum = _asn.PoBillNum;
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.CreateTime = DateTime.Now;
_t_ASN_Detail.CreateUser = _asn.CreateUser;
_t_ASN_Detail.PartCode = itm..ToUpper();
_t_ASN_Detail.Batch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.VendBatch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.Qty = itm.;
_t_ASN_Detail.State = (int)AsnState.Receive;
_t_ASN_Detail.CreateTime = p_time;
_t_ASN_Detail.CreateUser = p_creator;
_t_ASN_Detail.IsDeleted = false;
_t_ASN_Detail.GUID = Guid.NewGuid();
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.ProduceDate = p_time;
db.TB_ASN_DETAIL.Add(_t_ASN_Detail);
var _reclist = p_order_list.Where(t => t. == itm. && t. == itm. && t. == itm.).GroupBy(t => t.).ToList();
_reclist.ForEach((q) =>
{
var reclist = q.FirstOrDefault();
TB_RECEIVE _rec = new TB_RECEIVE();
_rec.RecvBillNum = reclist.;
_rec.State = (int)FormState.;
_rec.Remark = _ask.AskBillNum;
_rec.CreateTime = p_time;
_rec.CreateUser = p_creator;
_rec.IsDeleted = false;
_rec.GUID = System.Guid.NewGuid();
_rec.BillType = 0;
_rec.PoBillNum = reclist..ToUpper();
_rec.AsnBillNum = reclist..ToUpper();
_rec.Site = p_site;
_rec.VendId = reclist..ToUpper();
_rec.ShipTime = p_time;
db.TB_RECEIVE.Add(_rec);
var _recdetaillist = p_order_list.Where(f => f. == reclist.).ToList();
_recdetaillist.ForEach((n) =>
{
TB_RECEIVE_DETAIL _t_RECEIVE_Detail = new TB_RECEIVE_DETAIL();
_t_RECEIVE_Detail.RecvBillNum = n.;
_t_RECEIVE_Detail.PoBillNum = n..ToUpper();
_t_RECEIVE_Detail.PoLine = Int32.Parse(n.);
_t_RECEIVE_Detail.PartCode = n..ToUpper();
_t_RECEIVE_Detail.Batch = n.;
_t_RECEIVE_Detail.VendBatch = n.;
_t_RECEIVE_Detail.PoUnit = n.;
_t_RECEIVE_Detail.LocUnit = "";
_t_RECEIVE_Detail.Qty = decimal.Parse(n.);
_t_RECEIVE_Detail.State = (int)FormState.;
_t_RECEIVE_Detail.Remark = _ask.AskBillNum;
_t_RECEIVE_Detail.CreateTime = p_time;
_t_RECEIVE_Detail.CreateUser = p_creator;
_t_RECEIVE_Detail.IsDeleted = false;
_t_RECEIVE_Detail.GUID = System.Guid.NewGuid();
_t_RECEIVE_Detail.BillType = 0;
db.TB_RECEIVE_DETAIL.Add(_t_RECEIVE_Detail);
});
});
});
}
else
{
_ret.MessageList.Add("请检查数据后,重新导入!");
return;
}
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
);
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "EXCEL_ASN", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "EXCEL_ASN", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "EXCEL_ASN", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "EXCEL_ASN", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
private static List<string> CheckExcel(ScpEntities db, SCP_ASN_EXCEL p_excel)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.&&p.PartCode== p_excel.&&p.PoLine== Int32.Parse( p_excel.));
if (count == 0)
{
ErrorList.Add(string.Format("订单编号{0}零件号{1}行号{2}不存在!", p_excel.,p_excel., p_excel.));
}
}
else
{
ErrorList.Add(string.Format("订单编号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("收货单号【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
}
}

7
Controller/SCP_BARCODE_CONTROLLER.cs

@ -267,6 +267,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.LocUnit.Contains(p_entity.LocUnit));
}
if (p_entity.IsScanned)
{
q = q.Where(p => p.IsScanned==false);
}
//if (!string.IsNullOrEmpty(p_entity.PartName))
//{
// q = q.Where(p => p.PartName.Contains(p_entity.PartName));
@ -648,7 +652,8 @@ namespace CK.SCP.Controller
State = 0,
Remark = p_entity.UpdateInfo,
PackQty = p_entity.PackQty,
Site = p_entity.Site
Site = p_entity.Site,
IsScanned = false
};

9
Controller/SCP_BILLCODE_CONTROLLER.cs

@ -66,7 +66,16 @@ namespace CK.SCP.Controller
return GetTablePK("E", "TB_ASK", "AskBillNum", "yyMMdd", 4);
}
/// <summary>
/// 生成收货单码
/// </summary>
/// <returns></returns>
public static string MakeReviceCode_ASN()
{
return GetTablePK("C", "TB_RECEIVE", "RecvBillNum", "yyMMdd", 4);
}
public static string MakePLAN_EXTEND_ASKCode()
{

164
Controller/SCP_FORECAST_CONTROLLER.cs

@ -45,10 +45,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC));
}
//if (!string.IsNullOrEmpty(p_entity.Month))
//{
// q = q.Where(p => p.Month == p_entity.Month);
//}
if (!string.IsNullOrEmpty(p_entity.Month))
{
q = q.Where(p => p.Month == p_entity.Month);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{
@ -288,7 +288,163 @@ namespace CK.SCP.Controller
}
return ErrorList;
}
/// <summary>
/// EXCEL导入(沈阳金杯)
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_FORECAST_MOD_SYJB(List<SCP_FORECAST_EXPORT_SYJB> p_order_list, string p_creator, string site)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
_lst.ForEach
(p =>
{
var _ls = CheckExcelMode_Forecast_SYJB(db, p);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
_lst.ForEach(p =>
{
var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p..ToUpper() && t.VendId == p. && t.Month == p.&&t.State!=(int)ForecastState.Reject) ??
new TB_FORECAST { PartCode = p..ToUpper(), VendId = p., Month = p., GUID = System.Guid.NewGuid() };
_item.MonthQty1 = decimal.Parse(p.1);
_item.MonthQty2 = decimal.Parse(p.2);
_item.MonthQty3 = decimal.Parse(p.3);
_item.IsDeleted = false;
_item.CreateUser = p_creator;
_item.CreateTime = DateTime.Now;
_item.State = (int)ForecastState.New;
_item.UpdateInfo = "";
_item.Site = site;
db.TB_FORECAST.AddOrUpdate(_item);
});
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 导入验证(沈阳金杯)
/// </summary>
/// <param name="db"></param>
/// <param name="p_excel"></param>
/// <returns></returns>
private static List<string> CheckExcelMode_Forecast_SYJB(ScpEntities db, SCP_FORECAST_EXPORT_SYJB p_excel)
{
List<string> ErrorList = new List<string>();
var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p_excel..ToUpper() && t.VendId == p_excel. && t.Month == p_excel. && t.State == (int)ForecastState.Confirm);
if (_item != null)
{
ErrorList.Add(string.Format("零件编号【{0}】,月份【{1}】,供应商【{2}】的数据供应商已确认无法修改", p_excel., p_excel., p_excel.));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty((p_excel.).ToString()) ||
string.IsNullOrEmpty(p_excel.1) ||
string.IsNullOrEmpty(p_excel.2) ||
string.IsNullOrEmpty(p_excel.3))
{
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.));
}
return ErrorList;
}
public static ResultObject<bool> Save_TB_FORECAST_STATE(List<long> p_list, string p_user, ForecastState State)
{
ResultObject<bool> _ret = new ResultObject<bool>();

388
Controller/SCP_INVOICE_CONTROLLER.cs

@ -167,9 +167,6 @@ namespace CK.SCP.Controller
}
public static List<string> Get_V_TB_INVOICE_BY_TIME(string p_begin,string p_end,string p_po,string p_asn)
{
List<string> _list = new List<string>();
@ -201,7 +198,6 @@ namespace CK.SCP.Controller
return _list;
}
public static void Get_V_TB_INVOICE_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action)
{
ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>();
@ -272,6 +268,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser));
}
if (!string.IsNullOrEmpty(p_entity.AskCreateUser))
{
q = q.Where(p => p.AskCreateUser==p_entity.AskCreateUser);
}
if (p_entity.InvoiceList!=null && p_entity.InvoiceList.Count>0)
{
q = q.Where(p => p_entity.InvoiceList.Contains(p.InvcBillNum));
@ -335,11 +335,8 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message);
throw e;
}
}
public static void Get_V_TB_INVOICE_ERP_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action)
{
ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>();
@ -940,7 +937,6 @@ namespace CK.SCP.Controller
}
public static ResultObject<bool> CREATE_TB_INVOICE(V_TB_INVOICE p_entity,List<V_TB_RECEIVE_LIST> p_list)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -1090,6 +1086,166 @@ namespace CK.SCP.Controller
return _ret;
}
/// <summary>
/// 创建发票(模具分摊计数)
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_list"></param>
/// <param name="p_quota">是否限额验证</param>
/// <returns></returns>
public static ResultObject<bool> CREATE_TB_INVOICE_MOLDSHARING(V_TB_INVOICE p_entity, List<V_TB_RECEIVE_LIST> p_list)
{
ResultObject<bool> _ret = new ResultObject<bool>();
List<string> _list = new List<string>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
decimal _total = 0;
TB_INVOICE invoice = new TB_INVOICE();
invoice.InvcBillNum = SCP_BILLCODE_CONTROLLER.MakeInvoiceCode();
invoice.VendId = p_entity.VendId;
invoice.CreateTime = DateTime.Now;
invoice.InvoiceNum = "";
invoice.ExpressNum = "";
invoice.Remark = p_entity.Remark;
invoice.CreateUser = p_entity.CreateUser;
invoice.CreateTime = DateTime.Now;
invoice.Site = p_entity.Site;
invoice.State = (int)InvoiceState.New;
invoice.IsDeleted = false;
invoice.GUID = Guid.NewGuid();
invoice.Tax = p_entity.Tax;
invoice.IsRed = false;
db.TB_INVOICE.AddOrUpdate(invoice);
p_list.ForEach(p => {
TB_INVOICE_DETAIL invocieDetail = new TB_INVOICE_DETAIL();
invocieDetail.InvcBillNum = invoice.InvcBillNum;
invocieDetail.AsnBillNum = p.AsnBillNum;
invocieDetail.AskBillNum = p.Remark;
invocieDetail.PoBillNum = p.PoBillNum;
invocieDetail.PoLineNum = p.PoLine;
invocieDetail.RecvBillNum = p.RecvBillNum;
invocieDetail.ErpRecvBillNum = p.ErpRecvBillNum;
invocieDetail.CreateUser = invoice.CreateUser;
invocieDetail.CreateTime = invoice.CreateTime;
invocieDetail.PoUnit = p.PoUnit; //自己改数据库
invocieDetail.PartCode = p.PartCode;
invocieDetail.Price = p.Price;//自己改数据库
invocieDetail.Batch = p.Batch;
invocieDetail.VendBatch = p.VendBatch;
invocieDetail.Qty = p.Qty;
invocieDetail.Currency = p.Currency;//自己改数据库
invocieDetail.IsDeleted = false;
invocieDetail.State = (int)InvoiceState.New;
invocieDetail.GUID = Guid.NewGuid();
invocieDetail.Remark ="";
invocieDetail.IsRed = false;
invocieDetail.BlancePrice = p.BlancePrice;//模具分摊价格
invocieDetail.DiscountPrice = p.DiscountPrice;//供应商价格
db.TB_INVOICE_DETAIL.AddOrUpdate(invocieDetail);
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.VendId == p.VendId.ToUpper() && t.PartCode == p.PartCode.ToUpper()&&t.Qty!=t.Count);
if(_moldsharing!=null )
{
var _num = _moldsharing.Count + p.Qty;
if (_moldsharing.Qty < _num)
{
string _str ="供应商"+ _moldsharing .VendId+ "零件名称"+ _moldsharing.PartCode+"超过分摊数量"+ (_num- _moldsharing.Qty).ToString();
_list.Add(_str);
}
else
{
_moldsharing.Count = _num;
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
TA_MOLDSHARING_INVOICE MoldSharingInvoice = new TA_MOLDSHARING_INVOICE();
MoldSharingInvoice.InvcBillNum = invoice.InvcBillNum;
MoldSharingInvoice.MoldSharingId = _moldsharing.UID;
MoldSharingInvoice.PoLineNum = p.PoLine;
MoldSharingInvoice.PartCode = p.PartCode;
MoldSharingInvoice.Batch = p.Batch;
MoldSharingInvoice.ErpRecvBillNum = p.ErpRecvBillNum;
MoldSharingInvoice.RecvBillNum = p.RecvBillNum;
MoldSharingInvoice.Price = p.Price;
MoldSharingInvoice.Qty = p.Qty;
MoldSharingInvoice.InvcGUID = invocieDetail.GUID;
db.TA_MoldSharing_Invoice.Add(MoldSharingInvoice);
}
_total += Convert.ToDecimal(p.Qty * p.Price);
});
if (_list.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.MessageList = _list;
}
else
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(string p_billno, InvoiceState p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -1330,10 +1486,7 @@ namespace CK.SCP.Controller
return _ret;
}
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(V_TB_INVOICE invoice, InvoiceState p_state,string p_username="")
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(V_TB_INVOICE invoice, InvoiceState p_state,string p_username="", string p_flag = "")
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -1365,7 +1518,7 @@ namespace CK.SCP.Controller
_entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice;
_entity.DiscountPrice = invoice.DiscountPrice;//问题
}
if (p_state == InvoiceState.CheckFail)
{
@ -1490,7 +1643,7 @@ namespace CK.SCP.Controller
}
_entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice;
_entity.DiscountPrice = invoice.DiscountPrice;//问题
}
var _list = db.TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == invoice.InvcBillNum).ToList();
@ -1510,6 +1663,18 @@ namespace CK.SCP.Controller
_list.ForEach(p => {
p.State = (int)p_state;
p.IsDeleted = true;
if (!string.IsNullOrEmpty(p_flag))//修改分摊数量
{
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.VendId == invoice.VendId.ToUpper() && t.PartCode == p.PartCode.ToUpper());
var _ms_detail = db.TA_MoldSharing_Invoice.SingleOrDefault(t =>t.InvcGUID==p.GUID);
if (_moldsharing != null&& _ms_detail!=null)
{
db.TA_MoldSharing_Invoice.Remove(_ms_detail);
var _num = _moldsharing.Count - p.Qty;
_moldsharing.Count = _num;
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
}
});
}
@ -1673,9 +1838,10 @@ namespace CK.SCP.Controller
return _ret;
}
public static ResultObject<bool> SAVE_TB_INVOICE_APPLY(V_TB_INVOICE p_invoice, List<V_TB_INVOICE_DETAIL> p_list)
public static ResultObject<bool> SAVE_TB_INVOICE_APPLY(V_TB_INVOICE p_invoice, List<V_TB_INVOICE_DETAIL> p_list,string p_flag="")
{
ResultObject<bool> _ret = new ResultObject<bool>();
List<string> _list = new List<string>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
@ -1697,6 +1863,7 @@ namespace CK.SCP.Controller
db.TB_INVOICE.AddOrUpdate(p => p.InvcBillNum, _bill);
p_list.ForEach(p => {
var _detail=db.TB_INVOICE_DETAIL.Where(itm => itm.UID == p.UID).FirstOrDefault();
var _qty = _detail.Qty - p.Qty;
_detail.State =(int)p.State;
_detail.Qty = p.Qty;
_detail.Price = p.Price;
@ -1711,6 +1878,26 @@ namespace CK.SCP.Controller
}
_detail.Remark = p.Remark;
db.TB_INVOICE_DETAIL.AddOrUpdate(itm=>itm.UID,_detail);
if(!string.IsNullOrEmpty(p_flag))//修改发票数量对分摊数修改
{
var _ms = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.PartCode == _detail.PartCode && t.VendId == _bill.VendId);
var _ms_detail= db.TA_MoldSharing_Invoice.SingleOrDefault(t =>t.InvcGUID== _detail.GUID);
if (_ms != null&& _ms_detail!=null)
{
_ms.Count = _ms.Count - _qty;
if (_ms.Count > _ms.Qty)
{
string _str = "供应商" + _ms.VendId + "零件名称" + _ms.PartCode + "超出分摊数量" + (_ms.Count - _ms.Qty).ToString();
_list.Add(_str);
}
else
{
_ms_detail.Qty = p.Qty;
}
db.TA_MoldSharing.AddOrUpdate(_ms);
db.TA_MoldSharing_Invoice.AddOrUpdate(_ms_detail);
}
}
});
#region 供应商代办采购退回任务新
@ -1728,6 +1915,14 @@ namespace CK.SCP.Controller
db.TB_PENING_ITEMS.Add(_item);
#endregion
if (_list.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.MessageList = _list;
}
else
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
@ -1737,6 +1932,7 @@ namespace CK.SCP.Controller
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
@ -1798,6 +1994,7 @@ namespace CK.SCP.Controller
}
return _ret;
}
public static ResultObject<bool> SAVE_TB_INVOICE_APPLY2(V_TB_INVOICE_RED p_invoice, List<V_TB_INVOICE_DETAIL_RED> p_list)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -2079,7 +2276,6 @@ namespace CK.SCP.Controller
return _ret;
}
public ResultObject<bool> Del_TB_INVOICE_DETAIL(List<TB_INVOICE_DETAIL> p_entitys)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -2160,7 +2356,6 @@ namespace CK.SCP.Controller
}
return _ret;
}
public static ResultObject<bool> CaiWu_Return_Reason(string p_InvcBillNum,string p_Memo)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -2279,8 +2474,7 @@ namespace CK.SCP.Controller
}
return _ret;
}
public static ResultObject<bool> UpdateMemoByInvcBillNum(string p_InvcBillNum, string p_Memo)
public static ResultObject<bool> UpdateMemoByInvcBillNum_SYJB(string p_InvcBillNum, string p_Memo, DateTime updatetime, decimal p_blan = 0, decimal p_contranctprice = 0, string p_InvoiceNumber = null)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -2288,10 +2482,11 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_INVOICE invoice = db.TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
invoice.InvoiceNum = p_InvoiceNumber;
invoice.BlancePrice = p_blan;
invoice.ContractPrice = p_contranctprice;
invoice.Remark = p_Memo;
invoice.UpdateTime = updatetime;
db.TB_INVOICE.AddOrUpdate(invoice);
if (db.SaveChanges() != -1)
@ -2321,7 +2516,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", sb.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -2330,7 +2525,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
@ -2340,7 +2535,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
@ -2359,12 +2554,11 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", e.Message); throw e;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", e.Message); throw e;
}
return _ret;
}
public static ResultObject<bool> UpdateMemoByInvcBillNum(string p_InvcBillNum, string p_Memo, decimal p_blan, string p_inv,DateTime p_time)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -2451,9 +2645,141 @@ namespace CK.SCP.Controller
return _ret;
}
public static ResultObject<bool> SET_INVOICE_STATE_SYJB(string p_InvcBillNum, InvoiceState p_state, string datetime = null)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_INVOICE invoice = db.TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
if (invoice != null)
{
invoice.State = (int)p_state;
db.TB_INVOICE.AddOrUpdate(invoice);
if (p_state == InvoiceState.Mail)
{
List<TB_INVOICE_DETAIL> invoicedetail = db.TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == p_InvcBillNum).ToList();
foreach (TB_INVOICE_DETAIL det in invoicedetail)
{
det.State = (int)p_state;
}
}
//财务审核通过,把所有代办信息设为已办状态
if (p_state == InvoiceState.FinanceReceive)
{
if (string.IsNullOrEmpty(datetime))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "请填写确认收票时间";
return _ret;
}
DateTime updatetime = DateTime.Parse(datetime);
invoice.UpdateTime = updatetime;//确认收票时间
List<TB_PENING_ITEMS> items = db.TB_PENING_ITEMS.Where(p => p.ITEM_NO == p_InvcBillNum).ToList();
foreach (TB_PENING_ITEMS item in items)
{
item.ITEM_STATE = (int)PENDING_STATE.COMPLETED;
}
List<V_TB_INVOICE_DETAIL> _ls = db.V_TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == p_InvcBillNum).ToList();
V_TB_INVOICE _bill = db.V_TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
foreach (V_TB_INVOICE_DETAIL itm in _ls)
{
_bill.UpdateTime = updatetime;//确认收票时间
itm.UpdateTime = updatetime;//确认收票时间
TS_UNI_API _api = UniApiController.CreateBy(_bill, itm, UniApiType.Invoice);
_api.State = 1;
db.TS_UNI_API.AddOrUpdate(_api);
itm.State = (int)p_state;
}
}
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
_ret.Message = invoice.VendId;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = invoice.VendId;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = invoice.VendId;
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", e.Message); throw e;
}
return _ret;
}
public static ResultObject<bool> SET_INVOICE_STATE(string p_InvcBillNum, InvoiceState p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -2689,7 +3015,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", sb.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -2698,7 +3024,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
@ -2708,7 +3034,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
@ -2725,7 +3051,7 @@ namespace CK.SCP.Controller
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", e.Message);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;

524
Controller/SCP_MoldSharing_Controller.cs

@ -0,0 +1,524 @@
using System;
using System.Linq;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Models;
using System.Data;
using System.Data.Entity.Core;
using System.Text;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
namespace CK.SCP.Controller
{
public class SCP_MoldSharing_Controller
{
/// <summary>
/// 获取模具分摊列表
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TA_MoldSharing_List(TA_MOLDSHARING p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING>>> p_action)
{
ResultObject<IQueryable<TA_MOLDSHARING>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TA_MOLDSHARING> q = db.TA_MoldSharing;
if (p_entity.UID!=0)
{
q = q.Where(p => p.UID == p_entity.UID);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId == p_entity.VendId);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", e.Message);
throw e;
}
}
public static void Get_V_TA_MOLDSHARING_INVOICE_List(TA_MOLDSHARING_INVOICE p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>> p_action)
{
ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TA_MOLDSHARING_INVOICE> q = db.TA_MoldSharing_Invoice;
if (p_entity.MoldSharingId != 0)
{
q = q.Where(p => p.MoldSharingId == p_entity.MoldSharingId);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", e.Message);
throw e;
}
}
/// <summary>
/// 模具分摊导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="site"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_MOLDSHARING_MOD(List<SCP_MOLDSHARING_EXPORT> p_order_list, string site, string p_creator)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
_lst.ForEach(p =>
{
var _ls = CheckExcelMode_MoldSharing(db, p, site);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
_lst.ForEach(p =>
{
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t => t.VendId == p..ToUpper() && t.PartCode == p..ToUpper()) ??
new TA_MOLDSHARING
{
VendId = p..ToUpper(),
PartCode = p..ToUpper(),
CreateTime = DateTime.Now,
CreateUser = p_creator,
IsDeleted = false,
Count = 0,
};
_moldsharing.Price = decimal.Parse(p.);
_moldsharing.TotalCount = decimal.Parse(p.);
_moldsharing.InitialQty = decimal.Parse(p.);
_moldsharing.Qty = (_moldsharing.TotalCount - _moldsharing.InitialQty);
_moldsharing.UpdateTime = DateTime.Now;
_moldsharing.UpdateUser = p_creator;
_moldsharing.Site = site;
if(_moldsharing.Qty< _moldsharing.Count)
{
_ret.MessageList.Add(string.Format("零件号{0}(分摊总量-初始已分摊数量)小于已累计数量!", _moldsharing.PartCode));
}
else
{
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
});
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 数据检验
/// </summary>
/// <param name="db"></param>
/// <param name="p_excel"></param>
/// <param name="site"></param>
/// <returns></returns>
public static List<string> CheckExcelMode_MoldSharing(ScpEntities db, SCP_MOLDSHARING_EXPORT p_excel, string site)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TA_VENDER.Count(p => p.VendId == p_excel. && p.Site == site);
if (count <= 0)
{
ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.));
}
}
else
{
ErrorList.Add(string.Format("供应商代码为空!"));
}
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TA_PART.Count(p => p.PartCode == p_excel. && p.Site == site);
if (count <= 0)
{
ErrorList.Add(string.Format("零件编号{0}不存在!", p_excel.));
}
}
else
{
ErrorList.Add(string.Format("零件号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.)||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("供应商代码【{0}】零件编号【{1}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
/// <summary>
/// 获取模具分摊价格(沈阳模具分摊)
/// </summary>
/// <param name="p_list"></param>
/// <returns></returns>
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST_SYJB(List<V_TB_RECEIVE_LIST> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
//var entity_price = db.V_TB_PRICE.Where(t => t.VendId == p.VendId && t.PartCode == p.PartCode && t.StartTime <= DateTime.Now).FirstOrDefault();
//if (entity_price != null)
//{
// p.Price = entity_price.Amt;
//}
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty!= itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault();
if (_entity != null)
{
p.Price += decimal.Parse(_entity.Price.ToString());
}
});
}
}
return p_list;
}
/// <summary>
/// 获取模具分摊价格
/// </summary>
/// <param name="p_list"></param>
/// <returns></returns>
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST(List<V_TB_RECEIVE_LIST> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty > itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault();
if (_entity != null)
{
p.BlancePrice = decimal.Parse(_entity.Price.ToString());
}
else
{
p.BlancePrice = 0;
}
});
}
}
return p_list;
}
public static ResultObject<bool> Save_TA_MOLDSHARING_STATE (List<long> p_list, string p_user, bool p_isdelete)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_isdelete == true)
{
var _ls = db.TA_MoldSharing.Where(p => p_list.Contains(p.UID)&& p.Count <= 0).ToList();
if (_ls.Count > 0)
{
_ls.ForEach(p =>
{
p.IsDeleted = true;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
}
);
db.TA_MoldSharing.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,已经开始计数不能删除!";
}
}
if (string.IsNullOrEmpty(_ret.Message))
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据更新失败!";
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

5
Controller/SCP_PLAN_CONTROLLER.cs

@ -1004,6 +1004,7 @@ namespace CK.SCP.Controller
_extend.VendId = dr["供应商编码"].ToString();
_extend.CreateTime = DateTime.Now;
_extend.Site = dr["域"].ToString();
_extend.PoUnit = dr["单位"].ToString();
_ls.Add(_extend);
}
@ -1603,6 +1604,7 @@ namespace CK.SCP.Controller
_ask.BuyerPhone = p_user.CellPhone;
_ask.ErpBillNum = _entity.PoBillNum;
_ask.EndTime = _entity.EndTime;
_ask.SubSite = _entity.Site;
_ask.CreateTime = DateTime.Now;
_ask.CreateUser = p_user.Name;
_ask.VendId = _entity.VendId;
@ -1649,7 +1651,8 @@ namespace CK.SCP.Controller
_t_ASK_Detail.IsDeleted = false;
_t_ASK_Detail.LocUnit = itm.PoUnit;
_t_ASK_Detail.UnConv = 1;
_t_ASK_Detail.Remark =_ask.Site;
_t_ASK_Detail.Site =_ask.Site;
_t_ASK_Detail.SubSite = _ask.SubSite;
_t_ASK_Detail.State = _ask.State;
// _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.价格);
_t_ASK_Detail.GUID = Guid.NewGuid();

161
Controller/SCP_PO_CONTROLLER.cs

@ -32,7 +32,7 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{
q = q.Where(p => p.PoBillNum.Contains( p_entity.PoBillNum));
q = q.Where(p => p.PoBillNum == p_entity.PoBillNum);
}
if (!string.IsNullOrEmpty(p_entity.ErpBillNum))
{
@ -607,28 +607,29 @@ namespace CK.SCP.Controller
}
var _count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel. && p.PoLine.ToString() == p_excel.);
var _list = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel.).ToList();
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.QAD订单号) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("分组【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
}
if (_count == 0)
if (_list.Count == 0)
{
ErrorList.Add(string.Format("分组【{2}】零件号【{0}】行号【{1}】不存在!", p_excel., p_excel., p_excel.));
}
else
{
p_excel. = _list[0].PoLine.ToString();
p_excel.= _list[0].Price.ToString();
p_excel. = _list[0].PoUnit.ToString();
p_excel. = _list[0].Currency.ToString();
}
return ErrorList;
@ -1011,9 +1012,6 @@ namespace CK.SCP.Controller
_t_ASK_Detail.GUID = Guid.NewGuid();
_t_ASK_Detail.Remark = _ask.Site;
_t_ASK_Detail.UpdateInfo = itm.;
_t_ASK_Detail.Extend1 = itm.;
_t_ASK_Detail.Extend2 = itm.;
_t_ASK_Detail.Extend3 = itm.;
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
_ls.Add(_t_ASK_Detail);
// _number++;
@ -1895,7 +1893,7 @@ namespace CK.SCP.Controller
}
return ErrorList;
}
public static ResultObject<bool> EXCEL_PO_TO_ASK(List<SCP_PO_EXCEL> p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, bool IsAutoPublish = false)
public static ResultObject<bool> EXCEL_PO_TO_ASK(List<SCP_PO_EXCEL> p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, string p_site, bool IsAutoPublish = false)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -1928,9 +1926,9 @@ namespace CK.SCP.Controller
p_order_list = p_order_list.Where(p => int.Parse(p.) != 0).ToList();
var VenderList = p_order_list.Select(p => p.).Distinct();
var PartCodeList = p_order_list.Select(p => p.).Distinct();
var OrderList = p_order_list.GroupBy(p => p.).ToList();
//var VenderList = p_order_list.Select(p => p.供应商编号).Distinct();
//var PartCodeList = p_order_list.Select(p => p.零件号).Distinct();
var OrderList = p_order_list.GroupBy(p =>new { p., p. }).ToList();
OrderList.ForEach((p) =>
{
var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
@ -1946,11 +1944,10 @@ namespace CK.SCP.Controller
var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.VendId = _entity.;
_ask.State = (int)AskState.New;
_ask.PoBillNum = _entity.QAD订单号.ToUpper();
_ask.ModType = (int)BillModType.Contract;
_ask.Site = _entity.;
_ask.Site = p_site;
if (IsAutoPublish)
{
_ask.State = (int)AskState.Release;
@ -1959,12 +1956,12 @@ namespace CK.SCP.Controller
{
_ask.State = (int)AskState.New;
}
_ask.BeginTime = DateTime.Parse(_entity.);
_ask.BeginTime = DateTime.Now;
_ask.Buyer = _entity.;
_ask.BuyerPhone = _entity.;
_ask.ErpBillNum = _entity.QAD订单号.ToUpper();
_ask.EndTime = DateTime.Parse(_entity.);
_ask.CreateTime = DateTime.Parse(_entity.);
_ask.CreateTime = DateTime.Now;
_ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid();
@ -1996,8 +1993,8 @@ namespace CK.SCP.Controller
_t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper();
_t_ASK_Detail.BeginTime = DateTime.Parse(itm.);
_t_ASK_Detail.PartCode = (itm..ToUpper()).TrimEnd();
_t_ASK_Detail.BeginTime = _ask.BeginTime;
_t_ASK_Detail.EndTime = DateTime.Parse(itm.);
_t_ASK_Detail.TempQty = decimal.Parse(itm.);
_t_ASK_Detail.AskQty = decimal.Parse(itm.);
@ -2007,6 +2004,7 @@ namespace CK.SCP.Controller
_t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid();
_t_ASK_Detail.Remark = itm.;
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
// _number++;
@ -2096,7 +2094,14 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
if (e.InnerException != null)
{
_ret.MessageList.Add(e.InnerException.Message);
}
else
{
_ret.MessageList.Add(e.Message);
}
}
return _ret;
@ -2599,114 +2604,6 @@ namespace CK.SCP.Controller
return _ret;
}
public static void Get_V_TB_PO_DETAIL_List_STATISTICS(V_TB_PO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_PO_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_PO_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_PO_DETAIL>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_PO_DETAIL> q = db.V_TB_PO_DETAIL;
if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{
q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum));
}
if (!string.IsNullOrEmpty(p_entity.ErpBillNum))
{
q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum));
}
if (p_entity.BeginTime != null)
{
q = q.Where(p => p.BeginTime >= p_entity.BeginTime);
}
if (p_entity.EndTime != null)
{
q = q.Where(p => p.BeginTime <= p_entity.EndTime);
}
if (!string.IsNullOrEmpty(p_entity.VendName))
{
q = q.Where(p => p.VendName.Contains(p_entity.VendName));
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
if (p_entity.State != null)
{
q = q.Where(p => p.State == p_entity.State);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
//IQueryable<TB_ASK_DETAIL> _aq = db.TB_ASK_DETAIL;
//_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum);
//var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key });
//if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
//{
// q = q.Where(p => p_entity.UserInAddress.Contains(p.Address));
//}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message);
throw e;
}
}
public static void Get_V_TA_VENDER(V_TB_PO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TA_VENDER>>> p_action)
{

403
Controller/SCP_RECEIVE_CONTROLLER.cs

@ -15,6 +15,7 @@ using System.Data.SqlClient;
using System.Data;
using System.Text.RegularExpressions;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
namespace CK.SCP.Controller
{
@ -33,6 +34,14 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.RecvBillNum.Contains(p_entity.RecvBillNum));
}
if (!string.IsNullOrEmpty(p_entity.ErpRecvBillNum))
{
q = q.Where(p => p.ErpRecvBillNum.Contains(p_entity.ErpRecvBillNum));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId==p_entity.VendId);
}
if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{
q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum));
@ -60,7 +69,14 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.CreateUser))
{
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)||p.CreateUser==null);
if (p_entity.CreateUser == "无")
{
q = q.Where(p => string.IsNullOrEmpty(p.CreateUser));
}
else
{
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser));
}
}
if (p_entity.IsDeleted != false)
{
@ -86,6 +102,14 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (p_entity.ShipTimeStart != null && !p_entity.ShipTimeStart.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.ShipTime >= p_entity.ShipTimeStart);
}
if (p_entity.ShipTimeEnd != null && !p_entity.ShipTimeEnd.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.ShipTime <= p_entity.ShipTimeEnd);
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
@ -798,7 +822,41 @@ namespace CK.SCP.Controller
return p_list;
}
public static List<V_TB_INVOICE_DETAIL> Get_V_TB_INVOICE_LIST_SYJB(List<V_TB_INVOICE_DETAIL> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
p_list.ForEach(itm =>
{
try
{
var _recSum = db.V_TB_RECEIVE_DETAIL.Where(p => p.Remark== itm.AskBillNum && p.RecvBillNum == itm.RecvBillNum && p.PartCode == itm.PartCode && p.Batch == itm.Batch && p.IsDeleted == false).Select(p => p.Qty).Sum();
if (itm.RecvBillNum.Substring(0, 1) == "R")
{
_recSum = 0 - Math.Abs(_recSum);
}
var _sum = db.V_TB_INVOICE_DETAIL.Where(p =>p.AskBillNum==itm.AskBillNum && p.RecvBillNum == itm.RecvBillNum && p.PartCode == itm.PartCode && p.Batch == itm.Batch && p.IsDeleted == false).Select(p => p.Qty).Sum();
if (_recSum - _sum <= 0)
{
itm.CanQty = 0;
}
else
{
itm.CanQty = _recSum - _sum;
}
}
catch
{
itm.CanQty = 0;
}
});
}
return p_list;
}
public static List<V_TB_INVOICE_DETAIL> Get_V_TB_INVOICE_LIST(List<V_TB_INVOICE_DETAIL> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
@ -854,10 +912,29 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.RecvBillNum == p_entity.RecvBillNum);
}
if (!string.IsNullOrEmpty(p_entity.ErpRecvBillNum))
{
if (p_entity.ErpRecvBillNum == "可开票")
{
q = q.Where(p => !string.IsNullOrEmpty(p.ErpRecvBillNum));
}
else if(p_entity.ErpRecvBillNum == "不可开票")
{
q = q.Where(p => string.IsNullOrEmpty( p.ErpRecvBillNum) );
}
else
{
q = q.Where(p => p.ErpRecvBillNum == p_entity.ErpRecvBillNum);
}
}
if (p_entity.PoLine != 0)
{
q = q.Where(p => p.PoLine == p_entity.PoLine);
}
if (!string.IsNullOrEmpty(p_entity.AskCreateUser))
{
q = q.Where(p => p.AskCreateUser.Contains(p_entity.AskCreateUser));
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
@ -892,7 +969,7 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.Site))
{
q = q.Where(p => p.Site.Contains(p_entity.Site));
q = q.Where(p => p.Site==p_entity.Site);
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
@ -1802,7 +1879,329 @@ namespace CK.SCP.Controller
return _ds;
}
/// <summary>
/// 数据导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <param name="p_buyer"></param>
/// <param name="p_site"></param>
/// <param name="p_time"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_RECEIVE(List<SCP_ASN_EXCEL> p_order_list, string p_creator, string p_buyer, string p_site, DateTime p_time)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
p_order_list.ForEach
(p =>
{
var _ls = CheckExcel(db, p);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
var Ask_list = p_order_list.Where(f => decimal.Parse(f.) > 0);
var GroupList = Ask_list.GroupBy(p => new { p., p., p., p., p., p. }).Select(p => new { = p.Sum(itm => decimal.Parse(itm.)), = p.Key., = p.Key., p.Key., p.Key., p.Key., p.Key. }).ToList();
var OrderList = GroupList.GroupBy(p => p.).ToList();
List<string> _list = new List<string>();
OrderList.ForEach((p) =>
{
var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
var list = p.ToList();
if (list_distinct.Count < list.Count)
{
_ret.MessageList.Add("相同组号,存在同一编号、行号的数据");
return;
}
if (list.Count > 0)
{
var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.State = (int)AskState.Receive;
_ask.PoBillNum = _entity..ToUpper();
_ask.ModType = (int)BillModType.Contract;
_ask.Site = p_site;
_ask.BeginTime = p_time;
_ask.Buyer = p_creator;
_ask.BuyerPhone = "";
_ask.ErpBillNum = _entity..ToUpper();
_ask.EndTime = p_time;
_ask.CreateTime = p_time;
_ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid();
_ask.IsDeleted = false;
db.TB_ASK.Add(_ask);
TB_ASN _asn = new TB_ASN();
_asn.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
_asn.AskBillNum = _ask.AskBillNum;
_asn.VendId = _entity..ToUpper(); ;
_asn.State = (int)AsnState.Receive;
_asn.PoBillNum = _entity..ToUpper();
_asn.Site = p_site;
_asn.CreateTime = p_time;
_asn.CreateUser = p_creator;
_asn.UpdateTime = p_time;
_asn.UpdateUser = p_creator;
_asn.ShipTime = p_time;
_asn.ShipUser = p_creator;
_asn.ReceiveTime = p_time;
_asn.ReceiveUser = p_creator;
_asn.GUID = Guid.NewGuid();
_asn.IsDeleted = false;
db.TB_ASN.Add(_asn);
list.ForEach((itm) =>
{
TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL();
_t_ASK_Detail.PoLine = Int32.Parse(itm.);
_t_ASK_Detail.Currency = "";
_t_ASK_Detail.AskBillNum = _ask.AskBillNum;
_t_ASK_Detail.PoBillNum = _ask.PoBillNum;
_t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper();
_t_ASK_Detail.BeginTime = p_time;
_t_ASK_Detail.EndTime = p_time;
_t_ASK_Detail.TempQty = itm.;
_t_ASK_Detail.AskQty = itm.;
_t_ASK_Detail.IsDeleted = false;
_t_ASK_Detail.LocUnit = itm.;
_t_ASK_Detail.UnConv = 1;
_t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid();
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
TB_ASN_DETAIL _t_ASN_Detail = new TB_ASN_DETAIL();
_t_ASN_Detail.AsnBillNum = _asn.AsnBillNum;
_t_ASN_Detail.PoLine = Int32.Parse(itm.);
_t_ASN_Detail.Currency = "";
_t_ASN_Detail.PoBillNum = _asn.PoBillNum;
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.CreateTime = DateTime.Now;
_t_ASN_Detail.CreateUser = _asn.CreateUser;
_t_ASN_Detail.PartCode = itm..ToUpper();
_t_ASN_Detail.Batch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.VendBatch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.Qty = itm.;
_t_ASN_Detail.State = (int)AsnState.Receive;
_t_ASN_Detail.CreateTime = p_time;
_t_ASN_Detail.CreateUser = p_creator;
_t_ASN_Detail.IsDeleted = false;
_t_ASN_Detail.GUID = Guid.NewGuid();
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.ProduceDate = p_time;
db.TB_ASN_DETAIL.Add(_t_ASN_Detail);
var _reclist = p_order_list.Where(t => t. == itm. && t. == itm. && t. == itm.).GroupBy(t => t.).ToList();
_reclist.ForEach((q) =>
{
var reclist = q.FirstOrDefault();
TB_RECEIVE _rec = new TB_RECEIVE();
_rec.RecvBillNum = reclist.;
_rec.State = (int)FormState.;
_rec.Remark = _ask.AskBillNum;
_rec.CreateTime = p_time;
_rec.CreateUser = p_creator;
_rec.IsDeleted = false;
_rec.GUID = System.Guid.NewGuid();
if (Convert.ToInt32(reclist.) < 0)
{
_rec.RecvBillNum = "R." + _rec.RecvBillNum;
_rec.BillType = 1;
}
else
{
_rec.BillType = 0;
}
_rec.PoBillNum = reclist..ToUpper();
_rec.AsnBillNum = reclist..ToUpper();
_rec.Site = p_site;
_rec.VendId = reclist..ToUpper();
_rec.ShipTime = p_time;
if (!_list.Contains(reclist.))
{
_list.Add(reclist.);
db.TB_RECEIVE.Add(_rec);
}
var _recdetaillist = p_order_list.Where(f => f. == reclist. && f. == reclist. && f. == reclist. && f. == reclist.).ToList();
_recdetaillist.ForEach((n) =>
{
TB_RECEIVE_DETAIL _t_RECEIVE_Detail = new TB_RECEIVE_DETAIL();
_t_RECEIVE_Detail.RecvBillNum = n.;
_t_RECEIVE_Detail.PoBillNum = n..ToUpper();
_t_RECEIVE_Detail.PoLine = Int32.Parse(n.);
_t_RECEIVE_Detail.PartCode = n..ToUpper();
_t_RECEIVE_Detail.Batch = n.;
_t_RECEIVE_Detail.VendBatch = n.;
_t_RECEIVE_Detail.PoUnit = n.;
_t_RECEIVE_Detail.LocUnit = "";
_t_RECEIVE_Detail.Qty = decimal.Parse(n.);
_t_RECEIVE_Detail.State = (int)FormState.;
_t_RECEIVE_Detail.Remark = _ask.AskBillNum;
_t_RECEIVE_Detail.CreateTime = p_time;
_t_RECEIVE_Detail.CreateUser = p_creator;
_t_RECEIVE_Detail.IsDeleted = false;
_t_RECEIVE_Detail.GUID = System.Guid.NewGuid();
if (_t_RECEIVE_Detail.Qty < 0)
{
// _t_RECEIVE_Detail.RecvBillNum = "R." + _t_RECEIVE_Detail.RecvBillNum;
_t_RECEIVE_Detail.Qty = System.Math.Abs(_t_RECEIVE_Detail.Qty);
_t_RECEIVE_Detail.BillType = 1;
}
else
{
_t_RECEIVE_Detail.BillType = 0;
}
db.TB_RECEIVE_DETAIL.Add(_t_RECEIVE_Detail);
});
});
});
}
else
{
_ret.MessageList.Add("请检查数据后,重新导入!");
return;
}
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
);
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
private static List<string> CheckExcel(ScpEntities db, SCP_ASN_EXCEL p_excel)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PartCode == p_excel. && p.PoLine.ToString() == p_excel.);
if (count == 0)
{
ErrorList.Add(string.Format("订单编号{0}零件号{1}行号{2}不存在!", p_excel., p_excel., p_excel.));
}
}
else
{
ErrorList.Add(string.Format("订单编号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("收货单号【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
}
}

117
Controller/SCP_REJECT_CONTROLLER.cs

@ -9,6 +9,7 @@ using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
using System.Data.Entity.Core;
namespace CK.SCP.Controller
{
@ -243,5 +244,121 @@ namespace CK.SCP.Controller
}
return _ret;
}
/// <summary>
/// 保存退货
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_list"></param>
/// <param name="currentuser"></param>
/// <returns></returns>
public static ResultObject<bool> Save_TB_REJECT(V_TB_ASN_DETAIL p_entity, List<V_TB_ASN_DETAIL> p_list, string currentuser)
{
ResultObject<bool> _ret = new ResultObject<bool>();
var scpRcvList = new List<TB_RECEIVE>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_RECEIVE scpRcv = new TB_RECEIVE();
scpRcv.RecvBillNum = SCP_BILLCODE_CONTROLLER.MakeReviceCode();//退货单号
scpRcv.State = (int)FormState.;
scpRcv.Remark = "";
scpRcv.CreateTime = DateTime.Now;//创建日期
scpRcv.CreateUser = currentuser;//创建用户
scpRcv.IsDeleted = false;
scpRcv.GUID = System.Guid.NewGuid();
scpRcv.BillType = 1;
scpRcv.PoBillNum = p_entity.PoBillNum;//采购单
scpRcv.AsnBillNum = p_entity.AsnBillNum;//发货单号
scpRcv.Site = p_entity.Site;//地点
scpRcv.VendId = p_entity.VendId;//供货商名称
scpRcv.ShipTime = DateTime.Now;//收货日期
scpRcvList.Add(scpRcv);
db.TB_RECEIVE.AddOrUpdate(p => p.UID, scpRcvList.ToArray());
p_list.ForEach(item =>
{
TB_RECEIVE_DETAIL scpRcvDetail = new TB_RECEIVE_DETAIL();
scpRcvDetail.RecvBillNum = SCP_BILLCODE_CONTROLLER.MakeReviceCode();//退货单号
scpRcvDetail.PoBillNum = item.PoBillNum;//采购单
scpRcvDetail.PoLine = item.PoLine;//订单行
scpRcvDetail.PartCode = item.PartCode;//零件号
scpRcvDetail.Batch = item.Batch;//批次
scpRcvDetail.VendBatch = item.VendBatch;//供应商批号
scpRcvDetail.PoUnit = item.PoUnit;//采购单位
scpRcvDetail.LocUnit = item.LocUnit;//基本单位
scpRcvDetail.Qty = item.RejectQty;//退货数量
scpRcvDetail.State = (int)FormState.;// (int)FormState.关闭,
scpRcvDetail.Remark = item.Remark;
scpRcvDetail.CreateTime = DateTime.Now;//创建日期
scpRcvDetail.CreateUser = currentuser;//创建用户
scpRcvDetail.IsDeleted = false;
scpRcvDetail.GUID = System.Guid.NewGuid();
scpRcvDetail.BillType = 1;
scpRcveDetailList.Add(scpRcvDetail);
});
db.TB_RECEIVE_DETAIL.AddOrUpdate(p => p.UID, scpRcveDetailList.ToArray());
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

236
Controller/SCP_REPORT_CONTROLLER.cs

@ -19,85 +19,6 @@ namespace CK.SCP.Controller
public class SCP_REPORT_CONTROLLER
{
// public static DataTable GET_SCP_UNPAIED(V_SUPPLIERS_REGUALARLY p_entity)
// {
// StringBuilder _buffer = new StringBuilder();
//// SELECT VendId AS 供应商编码, VendName AS 供应商名称, Site AS 域, 税前金额, 税额, 税后金额
//// FROM(SELECT VendId, VendName, Site, SUM(ROUND(Qty * Price, 2)) AS 税前金额, SUM(ROUND(ROUND(Qty * Price, 2)
//// * 0.13, 2)) AS 税额, SUM(ROUND(Qty * Price, 2)) + SUM(ROUND(ROUND(Qty * Price, 2) * 0.13, 2))
//// AS 税后金额
//// FROM dbo.V_TB_RECEIVE_LIST
//// WHERE(State = 1) AND(Qty < 0)
//// GROUP BY VendId, VendName, Site) AS a
// }
//public override DataTable GetPagedDataTable(int pageIndex, int pageSize)
//{
// //SetWhere();
// //if (StrOrder == "") StrOrder = "UserType desc, UserName asc";
// int rowbegin = (pageIndex * pageSize) + 1;
// int rowend = (pageIndex + 1) * pageSize;
// return GetDataLimit(rowbegin, rowend, "", StrWhere + " and " + StrSearch, StrOrder);
//}
//public virtual DataTable GetDataLimit(int rows1, int rows2, string fields, string strwhere, string orderby,string p_tableview)
//{
// var dbSetting = GlobalConfig.ScpDatabase;
// try
// {
// if (fields == "")
// { fields = "*"; }
// string sql = @"
// select {0} from (
// select ROW_NUMBER() over(order by {1}) as rows_number_9999999, {0} from {2} where {5}
// ) as query_temp_table_9999999 where rows_number_9999999 between {3} and {4} and ({5})
// ";
// object[] obj = new object[6];
// obj[0] = fields;
// obj[1] = orderby;
// obj[2] = p_tableview;
// obj[3] = rows1;
// obj[4] = rows2;
// obj[5] = strwhere;
// sql = string.Format(sql, obj);
// DataTable dt = new DataTable();
// var strConn = EntitiesFactory.GetEfConnectionString(dbSetting);
// SqlConnection conn = new System.Data.SqlClient.SqlConnection();
// conn.ConnectionString = strConn;
// if (conn.State != ConnectionState.Open)
// {
// conn.Open();
// }
// #region 结束时间范围
// SqlCommand cmd = new SqlCommand();
// cmd.Connection = conn;
// cmd.CommandText = sql;
// SqlDataAdapter adapter = new SqlDataAdapter(cmd);
// adapter.Fill(dt);
// return dt;
// }
// catch
// { }
//}
public static string GET_V_SUPPLIERS_REGUALARLY_LIST_SQL(V_SUPPLIERS_REGUALARLY p_entity)
{
StringBuilder _buffer = new StringBuilder();
@ -133,7 +54,6 @@ namespace CK.SCP.Controller
}
public static DataTable Get_RECEIVE_YEAR(V_TB_RECEIVE_DETAIL p_detail, string p_year)
{
string _sql = "SELECT D.*,E.VENDNAME,F.PROJECTID FROM({0}) c pivot(sum(c.数量) for c.M in (一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月)) as d LEFT JOIN TA_VENDER E on D.vendid=E.VENDID AND D.SITE=E.SITE LEFT JOIN TA_PART F ON f.partcode =d.partcode and f.site=e.site where {1}";
@ -283,8 +203,6 @@ namespace CK.SCP.Controller
return dt;
}
public static DataTable Get_PART_LIFE(V_TB_PO_DETAIL p_detail)
{
DataTable dt = new DataTable();
@ -531,65 +449,6 @@ namespace CK.SCP.Controller
}
public string GetASN_REC_REPORT(V_TB_ASK_DETAIL p_detail)
{
string sqlString = "SELECT a.PartCode,a.PoLine,a.AskBillNum,AskQty,isnull(sum(b.Qty),0) asnQty,isNull(SUM(c.Qty),0) as RecQty,a.PoBillNum FROM TB_ASK_DETAIL A\n" +
"LEFT JOIN\n" +
"\n" +
"(select\n" +
"TB_ASN_DETAIL.Qty,\n" +
"TB_ASN.AsnBillNum,\n" +
"TB_ASN.AskBillNum,\n" +
"TB_ASN_DETAIL.PartCode,\n" +
"TB_ASN_DETAIL.PoLine\n" +
"from TB_ASN_DETAIL inner join TB_ASN on TB_ASN_DETAIL.AsnBillNum=tb_asn.AsnBillNum and TB_ASN.State<>-1) as\n" +
" B on a.AskBillNum=b.AskBillNum and a.PartCode=b.PartCode and a.PoLine=b.PoLine\n" +
"Left join\n" +
"(\n" +
"select\n" +
"TB_RECEIVE_DETAIL.Qty,\n" +
"TB_RECEIVE.AsnBillNum,\n" +
"TB_RECEIVE_DETAIL.PartCode,\n" +
"TB_RECEIVE_DETAIL.PoLine\n" +
"from TB_RECEIVE_DETAIL inner join TB_RECEIVE on TB_RECEIVE_DETAIL.RecvBillNum=TB_RECEIVE.RecvBillNum and TB_RECEIVE.State<>-1) as\n" +
"\n" +
" C on B.AsnBillNum=C.AsnBillNum and B.PartCode=C.PartCode and B.PoLine=C.PoLine\n" +
" where a.State<>-1 {0}" +
"\n" +
" GROUP BY a.PartCode,a.PoLine,a.AskBillNum,a.AskQty,a.PoBillNum";
if (!string.IsNullOrEmpty(p_detail.PartCode))
{
}
if (!string.IsNullOrEmpty(p_detail.VendId))
{
}
if (!string.IsNullOrEmpty(p_detail.AskBillNum))
{
}
if (!string.IsNullOrEmpty(p_detail.PoBillNum))
{
}
if (!string.IsNullOrEmpty(p_detail.PoBillNum))
{
}
return sqlString;
}
public static string GET_SQE(V_TB_ASN_DETAIL p_entity)
{
StringBuilder _buffer = new StringBuilder();
@ -793,8 +652,8 @@ namespace CK.SCP.Controller
_builder.Append(" select h.Site, h.AskBillNum,h.EndTime, h.VendId, h.PartCode ,sum (h.Qty) as ArriveQty , AskQty ,(AskQty -sum (h.Qty)) as Qty ,sum(h.NntimelyQty) as NntimelyQty , ");
_builder.Append(" (CASE WHEN AskQty=0 Then 0 ELSE (sum (NntimelyQty)/AskQty) END) as OTD ,( CASE WHEN AskQty=0 Then 0 ELSE (sum (h.Qty)/AskQty) END ) AS ArriveOTD from ( SELECT p.Site, p.VendId, p.AskBillNum, p.PartCode, ISNULL(A.Qty,0) as Qty, ");
_builder.Append(" (p.AskQty- ISNULL(p.ReduceQty,0)) as AskQty , (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) >= -1 THEN A.Qty ELSE 0 END) as NntimelyQty ,a.ShipTime ,p.EndTime FROM dbo.V_TB_ASK_DETAIL AS p LEFT OUTER JOIN ");
_builder.Append(" V_TB_ASN AS B on p.AskBillNum=b.AskBillNum LEFT OUTER JOIN dbo.V_TB_ARRIVE_DETAIL AS A ON b.AsnBillNum=A.AsnBillNum AND A.PoLine = p.PoLine AND A.PartCode = p.PartCode where p.IsDeleted=0 ");
_builder.Append(" (p.AskQty- ISNULL(p.ReduceQty,0)) as AskQty , (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) >= -1 THEN A.Qty ELSE 0 END) as NntimelyQty ,a.ShipTime ,p.EndTime FROM dbo.V_TB_ASK_DETAIL AS p LEFT OUTER JOIN ");
_builder.Append(" dbo.V_TB_ARRIVE_DETAIL AS A ON A.Remark = p.AskBillNum AND A.PoLine = p.PoLine AND A.PartCode = p.PartCode LEFT OUTER JOIN dbo.V_TB_ARRIVE AS B ON A.ArrvBillNum = B.ArrvBillNum where p.IsDeleted=0 ");
if (p_entity.BeginTime != null)
{
_builder.AppendFormat(" AND p.EndTime>='{0}'", p_entity.BeginTime);
@ -1133,6 +992,88 @@ namespace CK.SCP.Controller
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_List", e.Message);
throw e;
}
}
public static void Get_V_TIMELY_DELIVERY_List(V_TIMELY_DELIVERY p_entity, Action<ResultObject<IQueryable<V_TIMELY_DELIVERY>>> p_action)
{
ResultObject<IQueryable<V_TIMELY_DELIVERY>> _ret = new ResultObject<IQueryable<V_TIMELY_DELIVERY>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
string _sql = GetV_TIMELY_DELIVERY_SQL(p_entity);
IQueryable<V_TIMELY_DELIVERY> q = db.Database.SqlQuery<V_TIMELY_DELIVERY>(_sql).AsQueryable();
if (p_entity.RecvBeginTime != null)
{
q = q.Where(p => p.RecvTime >= p_entity.RecvBeginTime);
}
if (p_entity.RecvEndTime != null)
{
q = q.Where(p => p.RecvTime <= p_entity.RecvEndTime);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
var _ls = p_entity.PartCode.Split(new char[] { ',' });
q = q.Where(p => _ls.Contains(p.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.PartDesc1))
{
q = q.Where(p => p.PartDesc1.Contains(p.PartDesc1));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
@ -1179,7 +1120,6 @@ namespace CK.SCP.Controller
throw e;
}
}
public static void Get_TB_ASK_UNCOMPLETE_List(TB_UNCOMPLETE_TEMPASK p_entity, Action<ResultObject<IQueryable<TB_UNCOMPLETE_TEMPASK>>> p_action)
{
@ -1269,7 +1209,7 @@ namespace CK.SCP.Controller
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", sb.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -1277,14 +1217,14 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
@ -1300,7 +1240,7 @@ namespace CK.SCP.Controller
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", e.Message);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", e.Message);
throw e;
}
}

1
Controller/SCP_TB_PRICE_CONTROLLER.cs

@ -18,6 +18,5 @@ namespace CK.SCP.Controller
return db.TB_PRICE.ToList();
}
}
}
}

82
Controller/SCP_TB_VENDER_CONTROLLER.cs

@ -86,6 +86,88 @@ namespace CK.SCP.Controller
}
//public static ResultObject<bool> Save_TA_VENDER(List<TA_VENDER> p_entitys)
//{
// ResultObject<bool> _ret = new ResultObject<bool>();
// try
// {
// using (ScpEntities db = EntitiesFactory.CreateScpInstance())
// {
// foreach (var itm in p_entitys)
// {
// var _entity = db.TA_VENDER.Where(p => p.UID == itm.UID).FirstOrDefault();
// _entity.Quota = itm.Quota;
// db.TA_VENDER.AddOrUpdate(p => p.UID, _entity);
// }
// if (_ret.MessageList.Count > 0)
// {
// _ret.State = ReturnStatus.Failed;
// }
// else
// {
// if (db.SaveChanges() != -1)
// {
// _ret.State = ReturnStatus.Succeed;
// _ret.Result = true;
// }
// else
// {
// _ret.State = ReturnStatus.Failed;
// _ret.Result = false;
// }
// }
// }
// }
// catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
// {
// var sb = new StringBuilder();
// foreach (var error in dbEx.EntityValidationErrors.ToList())
// {
// error.ValidationErrors.ToList().ForEach(i =>
// {
// sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
// });
// }
// _ret.State = ReturnStatus.Failed;
// _ret.Result = false;
// _ret.ErrorList.Add(dbEx);
// LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_VENDER_CONTROLLER), "Save_TA_VENDER", sb.ToString());
// throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
// }
// catch (OptimisticConcurrencyException ex)//并发冲突异常
// {
// _ret.State = ReturnStatus.Failed;
// _ret.Result = false;
// _ret.ErrorList.Add(ex);
// LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_VENDER_CONTROLLER), "Save_TA_VENDER", ex.ToString());
// throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
// }
// catch (ScpException ex)
// {
// _ret.State = ReturnStatus.Failed;
// _ret.Result = false;
// _ret.ErrorList.Add(ex);
// LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_VENDER_CONTROLLER), "Save_TA_VENDER", ex.ToString());
// if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
// {
// var inner = (UpdateException)ex.InnerException;
// throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
// }
// else
// {
// if (ex.InnerException != null) throw ex.InnerException;
// }
// }
// catch (Exception e)
// {
// _ret.State = ReturnStatus.Failed;
// LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_VENDER_CONTROLLER), "Save_TA_VENDER", e.Message);
// _ret.Result = false;
// _ret.ErrorList.Add(e);
// throw e;
// }
// return _ret;
//}
}
}

105
Controller/SCP_TS_BARCODE_CONTROLLER.cs

@ -158,6 +158,103 @@ namespace CK.SCP.Controller
throw e;
}
}
public static void Get_V_TS_BARCODE_List(V_TS_BARCODE p_entity, Action<ResultObject<IQueryable<V_TS_BARCODE>>> p_action)
{
ResultObject<IQueryable<V_TS_BARCODE>> _ret = new ResultObject<IQueryable<V_TS_BARCODE>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TS_BARCODE> q = db.V_TS_BARCODE;
if (!string.IsNullOrEmpty(p_entity.BarCode))
{
q = q.Where(p => p.BarCode.Contains(p_entity.BarCode));
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.Batch))
{
q = q.Where(p => p.Batch.Contains(p_entity.Batch));
}
if (!string.IsNullOrEmpty(p_entity.BillNum))
{
q = q.Where(p => p.BillNum.Contains(p_entity.BillNum));
}
if (p_entity.PoBillLine != 0)
{
q = q.Where(p => p.PoBillLine == p_entity.PoBillLine);
}
if (!string.IsNullOrEmpty(p_entity.VendBatch))
{
q = q.Where(p => p.VendBatch.Contains(p_entity.VendBatch));
}
if (p_entity.PackQty != 0)
{
q = q.Where(p => p.PackQty == p_entity.PackQty);
}
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
q = q.Where(p => p.IsScanned == p_entity.IsScanned);
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_List", e.Message);
throw e;
}
}
public static void Get_TS_BARCODE_CUSTOM_List(TS_BARCODE_CUSTOM p_entity, Action<ResultObject<IQueryable<TS_BARCODE_CUSTOM>>> p_action)
{
@ -269,21 +366,21 @@ namespace CK.SCP.Controller
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", sb.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
@ -298,7 +395,7 @@ namespace CK.SCP.Controller
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", e.Message);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", e.Message);
throw e;
}

92
Controller/SCP_WMS_CONTROLLER.cs

@ -103,6 +103,98 @@ namespace CK.SCP.Controller
throw e;
}
}
public static List<VIEW_STOCK_REPORT> GET_INVOICE_CANQTY(List<VIEW_STOCK_REPORT> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
var entity = db.V_TB_RECEIVE_LIST.Where(itm => itm.PartCode == p.PartCode&&itm.VendId==p.VendId ).ToList();
decimal canqty = entity.Sum(t => t.CanQty);
p.InvoiceQty = canqty;
});
}
}
return p_list;
}
public static void Get_VIEW_STOCK_REPORT(VIEW_STOCK_REPORT p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_REPORT>>> p_action)
{
ResultObject<IQueryable<VIEW_STOCK_REPORT>> _ret = new ResultObject<IQueryable<VIEW_STOCK_REPORT>>();
try
{
using (WmsEntities db = EntitiesFactory.CreateWmsInstance())
{
IQueryable<VIEW_STOCK_REPORT> q = db.VIEW_STOCK_REPORT;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", e.Message);
throw e;
}
}
public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_QTY p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_QTY>>> p_action)
{

50
Controller/UniApiController.cs

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Core;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using CK.SCP.Models;
@ -13,6 +15,7 @@ namespace CK.SCP.Controller
{
public static class UniApiController
{
public static void Get_TS_UNI_API_List(TS_UNI_API p_entity, Action<ResultObject<IQueryable<TS_UNI_API>>> p_action)
{
ResultObject<IQueryable<TS_UNI_API>> _ret = new ResultObject<IQueryable<TS_UNI_API>>();
@ -218,6 +221,53 @@ namespace CK.SCP.Controller
return asp;
}
public static DataTable FindUniapi(string p_type, string p_billNum, string p_domain)
{
string sql = string.Empty;
switch (p_type)
{
case "xxqad_pod_det":
sql ="SELECT * FROM[xxqad_pod_det] a inner join xxqad_ctrl b on a.xxqad_pod_seq = b.xxqad_seq where xxqad_domain = '{1}' and xxqad_pod_nbr in ({0}) order by xxqad_pod_nbr, b.xxqad_seq ";
break;
case "xxqad_prh_det":
sql = "SELECT * FROM[xxqad_prh_det] a inner join xxqad_ctrl b on a.xxqad_prh_seq = b.xxqad_seq where xxqad_domain = '{1}' and (xxqad_prh_psnbr in ({0}) or xxqad_prh_receiver in ({0})) order by xxqad_prh_psnbr, b.xxqad_seq ";
break;
case "xxwms_rc_det":
sql = "select * from xxwms_rc_det a inner join xxwms_ctrl b on a.xxwms_rc_seq = b.xxwms_seq where xxwms_domain = '{1}' and (xxwms_rc_nbr in ({0}) order by xxwms_rc_nbr, b.xxwms_seq";
break;
case "xxscm_tx_mstr":
sql = "select * from xxscm_tx_mstr a inner join xxscm_ctrl b on a.xxscm_tx_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_tx_nbr in ({0}) order by xxscm_tx_nbr, b.xxscm_seq";
break;
case "xxscm_inv_det":
sql = "select * from xxscm_inv_det a inner join xxscm_ctrl b on a.xxscm_inv_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_inv_nbr IN({0}) order by xxscm_inv_nbr,b.xxscm_seq";
break;
}
DataTable _dt = new DataTable();
var dbSetting = GlobalConfig.UniApiDatabase;
var strConn = EntitiesFactory.GetEfConnectionString(dbSetting);
SqlConnection conn = new System.Data.SqlClient.SqlConnection();
try
{
conn.ConnectionString = strConn;
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = string.Format(sql, p_billNum, p_domain);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
adapter.Fill(_dt);
conn.Close();
}
catch (Exception e)
{
conn.Close();
}
return _dt;
}
//创建发货单
public static TS_UNI_API CreateBy(V_TB_ASN bill, V_TB_ASN_DETAIL detail, UniApiType uniApiType)

7
Models/CK.SCP.Models.csproj

@ -332,11 +332,16 @@
<Compile Include="GlobalConfig.cs" />
<Compile Include="ScpCache.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_FORECAST_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_MOLDSHARING_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_VendId_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelImportEntity\SCP_ASN_EXCEL.cs" />
<Compile Include="ScpEntity\TA_MoldSharing.cs" />
<Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.cs" />
<Compile Include="ScpEntity\TA_VENDER_EXTEND.cs" />
<Compile Include="ScpEntity\TB_CLAIM_APPEND.cs" />
<Compile Include="ScpEntity\TB_PALLETS.cs" />
@ -442,6 +447,7 @@
<Compile Include="ScpEntity\V_TB_REJECT_DETAIL.cs" />
<Compile Include="ScpEntity\V_TIMELY_DELIVERY.cs" />
<Compile Include="ScpEntity\V_TM_HYANTOLIN_REVIEW.cs" />
<Compile Include="ScpEntity\V_TS_BARCODE.cs" />
<Compile Include="UniApiEntity\xxwms_review_det.cs" />
<Compile Include="ScpEntity\TM_HUANTOLIN_REVIEW.cs" />
<Compile Include="ScpException.cs" />
@ -701,6 +707,7 @@
<Compile Include="WmsEntity\VIEW_STOCK_GROUP.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_MOVE.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_QTY.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_REPORT.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_VEND.cs" />
<Compile Include="WmsEntity\VIEW_STORE_WHSE.cs" />
<Compile Include="WmsEntity\VIEW_TRANSACTION.cs" />

20
Models/ScpEntities.cs

@ -52,6 +52,7 @@ namespace CK.SCP.Models
public virtual DbSet<TL_BILL> TL_BILL { get; set; }
public virtual DbSet<TL_OPER> TL_OPER { get; set; }
public virtual DbSet<TS_BARCODE> TS_BARCODE { get; set; }
public virtual DbSet<V_TS_BARCODE> V_TS_BARCODE { get; set; }
public virtual DbSet<TS_BARCODE_SMALL> TS_BARCODE_SMALL { get; set; }
public virtual DbSet<TS_STOCK> TS_STOCK { get; set; }
public virtual DbSet<TS_UNI_API> TS_UNI_API { get; set; }
@ -123,33 +124,30 @@ namespace CK.SCP.Models
public virtual DbSet<TB_PRICE> TB_PRICE { get; set; }
public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; }
public virtual DbSet<V_TB_FORECAST> V_TB_FORECAST { get; set; }
public virtual DbSet<TA_MOLDSHARING> TA_MoldSharing { get; set; }
public virtual DbSet<TA_MOLDSHARING_INVOICE> TA_MoldSharing_Invoice { get; set; }
public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; }
public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; }
public virtual DbSet<TM_HYANTOLIN_REVIEW> TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_CLAIM_APPEND> TB_CLAIM_APPEND { get; set; }
public virtual DbSet<V_TM_HYANTOLIN_REVIEW> V_TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_PLAN_CUSTOM> TB_PLAN_CUSTOM { get; set; }
public virtual DbSet<TB_PO_PLAN> TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN> V_TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN_DETAIL> V_TB_PO_PLAN_DETAIL { get; set; }
public virtual DbSet<TB_PO_PLAN_EXTEND> TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_PO_PLAN_EXTEND> V_TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_ASK_RECEIVE> V_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<V_TB_PO_INCOMPLETE> V_TB_PO_INCOMPLETE { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<TA_MOLDSHARING>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_INVOICE_DETAIL>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TA_REVICE_PORT>()
.Property(e => e.PORT_NO)
.IsUnicode(false);

9
Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs

@ -27,4 +27,13 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string { get; set; }
public string { get; set; }
}
public class SCP_FORECAST_EXPORT_SYJB
{
public string { get; set; }
public string { get; set; }
public string 1 { get; set; }
public string 2 { get; set; }
public string 3 { get; set; }
public string { get; set; }
}
}

17
Models/ScpEntity/ExcelExportEnttity/SCP_MOLDSHARING_EXPORT.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_MOLDSHARING_EXPORT
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

22
Models/ScpEntity/ExcelExportEnttity/SCP_OTD_VendId_REPORT_EXPORT.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_OTD_VendId_REPORT_EXPORT
{
public string { get; set; }
public string { get; set; } //VendId
public string { get; set; } //VendName
public string { get; set; }//endtime
public string { get; set; } //AskQty
public string { get; set; } //ArriveQty
public string { get; set; } //Qty
public string { get; set; } //NntimelyQty
public string { get; set; }//OTD
public string { get; set; }//ArriveOTD
}
}

25
Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs

@ -45,31 +45,6 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
//public class SCP_PO_EXPORT_IMPORT_MODEL
//{

23
Models/ScpEntity/ExcelImportEntity/SCP_ASN_EXCEL.cs

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
{
public class SCP_ASN_EXCEL
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

10
Models/ScpEntity/ExcelImportEntity/SCP_PO_EXCEL.cs

@ -15,11 +15,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
public string QAD订单号 {set;get;}
public string { set; get; }
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
public string {set;get;}
@ -27,13 +25,7 @@ namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
public string {set;get;}
public string { set; get; }
public string {set;get;}
//public string 是否免费 {set;get;}
//public string 是否批量 {set;get;}
//public string 是否紧急要货 {set;get;}
public string { set; get; }
}
public class SCP_PO_DETAIL_IMPORT_MODEL
{

31
Models/ScpEntity/TA_MOLDSHARING_INVOICE.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
public class TA_MOLDSHARING_INVOICE
{
[Key]
public long UID { set; get; }
public long MoldSharingId { set; get; }
public System.Guid InvcGUID { get; set; }
[Required, StringLength(50)]
public string InvcBillNum { set; get; }
public int PoLineNum { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[StringLength(50)]
public string Batch { get; set; }
public string RecvBillNum { get; set; }
[StringLength(50)]
public string ErpRecvBillNum { get; set; }
public decimal Price { get; set; }
[Column(TypeName = "money")]
public decimal Qty { get; set; }
}
}

34
Models/ScpEntity/TA_MoldSharing.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class TA_MOLDSHARING
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public long UID { get; set; }
[StringLength(50)]
public string VendId { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[StringLength(50)]
public string Site { get; set; }
public System.DateTime CreateTime { get; set; }
[StringLength(50)]
public string CreateUser { get; set; }
public Nullable<System.DateTime> UpdateTime { get; set; }
[StringLength(50)]
public string UpdateUser { get; set; }
public decimal? TotalCount { get; set; }//分摊总数(已分摊期初数+分摊数量)
public decimal? InitialQty { get; set; }//已分摊期初数
public decimal? Qty { get; set; }//分摊数量
public decimal? Count { get; set; }//累计分摊数量
// [Column(TypeName = "money")]
public decimal? Price { get; set; }
public bool IsDeleted { get; set; }
}
}

49
Models/ScpEntity/TB_FORECAST.cs

@ -20,25 +20,15 @@ namespace CK.SCP.Models.ScpEntity
/// <summary>
/// 零件编号
/// </summary>
[StringLength(50)]
public string PoType { get; set; }
[StringLength(50)]
[StringLength(50)]
public string PartCode { get; set; }
/// </summary>
/// 供应商编号
/// </summary>
public string VendId { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
public int PoLine { get; set; }
[StringLength(50)]
public string Specifications { get; set; }
public string Unit { get; set; }
/// <summary>
/// N+1
/// </summary>
public decimal Qty { get; set; }
public string ProductStatus { get; set; }
public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; }
public decimal MonthQty1 { get; set; }
/// <summary>
/// N+2
@ -48,21 +38,32 @@ namespace CK.SCP.Models.ScpEntity
/// N+3
/// </summary>
public decimal MonthQty3 { get; set; }
/// <summary>
/// 月份
/// </summary>
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
/// <summary>
/// <summary>
/// 状态
/// </summary>
public int State { get; set; }
/// <summary>
/// 地点
/// </summary>
[StringLength(50)]
public string Site { get; set; }
/// <summary>
/// 月份
/// </summary>
public string Month { get; set; }
public string PoType { get; set; }
public int PoLine { get; set; }
[StringLength(50)]
public string Specifications { get; set; }
public string Unit { get; set; }
public decimal Qty { get; set; }
public string ProductStatus { get; set; }
public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; }
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
}
}

2
Models/ScpEntity/TB_INVOICE_DETAIL.cs

@ -19,6 +19,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)]
public string AsnBillNum { get; set; }
[StringLength(50)]
public string AskBillNum { get; set; }
[StringLength(50)]
public string PoBillNum { get; set; }
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int PoLineNum { get; set; }

5
Models/ScpEntity/TS_BARCODE.cs

@ -99,6 +99,11 @@ namespace CK.SCP.Models.ScpEntity
public string PartName => ScpCache.GetPartDesc1(PartCode,Site);
[NotMapped]
public List<long> UIDList { get; set; }
[DisplayName("是否扫描")]
public bool IsScanned { get; set; }
[DisplayName("是否扫描")]
[NotMapped]
public string IsScanned_Desc => IsScanned ? "已扫描" : "未扫描";
[NotMapped]
public decimal CanQty { get; set; }

4
Models/ScpEntity/V_TB_ASK.cs

@ -50,6 +50,10 @@ namespace CK.SCP.Models.ScpEntity
public DateTime? BeginTime { get; set; }
[NotMapped]//订货结束日期
public DateTime? BeginTime_End { get; set; }
[NotMapped]//到货开始日期
public DateTime? EndTime_start { get; set; }
public DateTime? EndTime { get; set; }
public string Extend1 { get; set; }

5
Models/ScpEntity/V_TB_ASN_DETAIL.cs

@ -95,5 +95,10 @@ namespace CK.SCP.Models.ScpEntity
public string Extend3 { get; set; }
public string SubSite { get; set; }
/// <summary>
/// 可退货数量
/// </summary>
[NotMapped]
public decimal CanRejectQty { get; set; }
}
}

28
Models/ScpEntity/V_TB_FORECAST.cs

@ -13,36 +13,34 @@ namespace CK.SCP.Models.ScpEntity
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[StringLength(50)]
public string PoType { get; set; }
[StringLength(50)]
[StringLength(50)]
public string PartCode { get; set; }
[StringLength(50)]
public string VendId { get; set; }
public int? State { get; set; }
public decimal MonthQty1 { get; set; }
public decimal MonthQty2 { get; set; }
public decimal MonthQty3 { get; set; }
[StringLength(50)]
public string State_DESC { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
public string Site { get; set; }
public string Month { get; set; }
[StringLength(50)]
public string PoType { get; set; }
public int PoLine { get; set; }
[StringLength(50)]
public string Specifications { get; set; }
public string Unit { get; set; }
public decimal Qty { get; set; }
public string ProductStatus { get; set; }
public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; }
public decimal MonthQty1 { get; set; }
public decimal MonthQty2 { get; set; }
public decimal MonthQty3 { get; set; }
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
public int? State { get; set; }
[StringLength(50)]
public string State_DESC { get; set; }
[StringLength(50)]
public string Site { get; set; }
}
}

1
Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs

@ -34,7 +34,6 @@
[NotMapped]
public decimal OnRoadQty { get; set; }//在途数量
public DateTime? BeginTime { get; set; }
public DateTime? EndTime { get; set; }
public int ValidityDays { get; set; }

2
Models/ScpEntity/V_TB_INVOICE.cs

@ -66,6 +66,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)]
public string DiscountRemark { get; set; }
public bool IsRed { get; set; }
public decimal? MoldSharingPrice { get; set; } //分摊价格
public string AskCreateUser { get; set; } //要货看板创建人
/// <summary>
/// 采购价
/// </summary>

2
Models/ScpEntity/V_TB_INVOICE_DETAIL.cs

@ -22,6 +22,7 @@ namespace CK.SCP.Models.ScpEntity
public string PoBillNum { get; set; }
public int PoLineNum { get; set; }
public string AsnBillNum { get; set; }
public string AskBillNum { get; set; }
public string PartCode { get; set; }
public string Batch { get; set; }
public Nullable<System.DateTime> ProduceDate { get; set; }
@ -29,6 +30,7 @@ namespace CK.SCP.Models.ScpEntity
public decimal Qty { get; set; }
public string PoUnit { get; set; }
public decimal Price { get; set; }
public decimal OldPrice { get; set; }
public string Currency { get; set; }
public Nullable<decimal> PackQty { get; set; }
public Nullable<int> State { get; set; }

6
Models/ScpEntity/V_TB_RECEIVE.cs

@ -58,6 +58,12 @@ namespace CK.SCP.Models.ScpEntity
public string ErpRecvBillNum { get; set; }
[NotMapped]
public DateTime ShipTimeStart { set; get; }
[NotMapped]
public DateTime ShipTimeEnd { set; get; }
public string Extend1 { get; set; }
public string Extend2 { get; set; }

2
Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs

@ -71,8 +71,6 @@ namespace CK.SCP.Models.ScpEntity
[NotMapped]
public string ProjectId { set; get; }
public string Extend1 { get; set; }
public string Extend2 { get; set; }
public string Extend3 { get; set; }

1
Models/ScpEntity/V_TB_RECEIVE_LIST.cs

@ -94,5 +94,6 @@ namespace CK.SCP.Models.ScpEntity
public string Tax { set; get; }
public string AskCreateUser { get; set; }
}
}

48
Models/ScpEntity/V_TS_BARCODE.cs

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TS_BARCODE
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[StringLength(50)]
public string BarCode { get; set; }
[Required]
[StringLength(50)]
public string PartCode { get; set; }
[Required]
[StringLength(50)]
public string Batch { get; set; }
[Column(TypeName = "money")]
public decimal Qty { get; set; }
[Required]
[StringLength(50)]
public string BillNum { get; set; }
public int PoBillLine { get; set; }
[StringLength(50)]
public string VendId { get; set; }
[StringLength(50)]
public string VendBatch { get; set; }
[DisplayName("是否扫描")]
public bool IsScanned { get; set; }
[DisplayName("是否描述")]
public string IsScanned_Desc { get; set; }
[Column(TypeName = "money")]
public decimal PackQty { get; set; }
public string Site { get; set; }
[NotMapped]
public List<string> UserInVendIds { set; get; }
[NotMapped]
public List<string> UserInAddress { set; get; }
}
}

37
Models/WmsEntity/VIEW_STOCK_REPORT.cs

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ChangKeTec.Wms.Models.Wms
{
public partial class VIEW_STOCK_REPORT
{
[Key]
[Column(Order = 0)]
[StringLength(50)]
public string PartCode { get; set; }
[Key]
[Column(Order = 2)]
public string VendId { get; set; }
/// <summary>
/// WMS待检验数量
/// </summary>
public decimal InspectQty { get; set; }
/// <summary>
/// WMS合格数量
/// </summary>
public decimal QualifiedQty { get; set; }
/// <summary>
/// SCP待开票数量
/// </summary>
[NotMapped]
public decimal InvoiceQty { get; set; }
[NotMapped]
public List<string> UserInVendIds { set; get; }
}
}

1
Models/WmsEntity/WmsEntities.cs

@ -22,6 +22,7 @@ namespace ChangKeTec.Wms.Models.Wms
public virtual DbSet<VIEW_PRODUCT_DETAIL> VIEW_PRODUCT_DETAIL { get; set; }
public virtual DbSet<VIEW_STOCK_VEND> VIEW_STOCK_VEND { get; set; }
public virtual DbSet<VIEW_STOCK_QTY> VIEW_STOCK_QTY { get; set; }
public virtual DbSet<VIEW_STOCK_REPORT> VIEW_STOCK_REPORT { get; set; }
public virtual DbSet<TA_BILLTYPE> TA_BILLTYPE { get; set; }
public virtual DbSet<TA_BOM> TA_BOM { get; set; }
public virtual DbSet<TA_CELL> TA_CELL { get; set; }

57
SCP/Admin/UNIAPI.aspx

@ -0,0 +1,57 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UNIAPI.aspx.cs" Inherits="SCP.Admin.UNIAPI" %>
<!DOCTYPE html>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:DropDownList runat="server" ID="DDL_State" Label="查询接口" LabelWidth="60px" >
<f:ListItem Text="订单接口" Value="xxqad_pod_det"/>
<f:ListItem Text="QAD收货单接口" Value="xxqad_prh_det" />
<f:ListItem Text="WMS收货单接口" Value="xxwms_rc_det" />
<f:ListItem Text="发货单接口" Value="xxscm_tx_mstr" />
<f:ListItem Text="发票接口" Value="xxscm_inv_det" />
</f:DropDownList>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找" Icon="Zoom">
</f:Button>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:TextArea runat="server" Label="单据号" ID="TXT_billnum" Width="600" LabelWidth="60px" EmptyText="填写单据号(可多单号查询用 , 号隔开)" ></f:TextArea>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID="Grid" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server">
<Columns>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

74
SCP/Admin/UNIAPI.aspx.cs

@ -0,0 +1,74 @@
using CK.SCP.Controller;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Admin
{
public partial class UNIAPI : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Bind();
}
}
private void Bind()
{
var _domain = Request["Domain"];
var _billNum =TXT_billnum.Text= Request.Params["BillNum"];
var _tableName=DDL_State.SelectedValue= Request.Params["TableName"];
if (!string.IsNullOrEmpty(_billNum) && !string.IsNullOrEmpty(_domain) && !string.IsNullOrEmpty(_tableName))
{
var _ary = _billNum.Split(new char[] { ',' }).ToList();
var sqlstr = string.Empty;
_ary.ForEach(p =>
{
sqlstr += string.Format("'{0}',", p);
});
sqlstr = sqlstr.Substring(0, sqlstr.Length - 1);
DataTable _dt = UniApiController.FindUniapi(_tableName, sqlstr, _domain);
foreach (DataColumn column in _dt.Columns)
{
FineUI.BoundField bf;
bf = new FineUI.BoundField();
bf.DataField = column.ColumnName;
bf.SortField = column.ColumnName;
bf.HeaderText = column.ColumnName;
Grid.Columns.Add(bf);
}
Grid.DataSource = _dt;
Grid.DataBind();
}
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
StringBuilder _buffer = new StringBuilder();
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_buffer.AppendFormat("TableName={0}&&", DDL_State.SelectedValue);
}
if (!string.IsNullOrEmpty(TXT_billnum.Text))
{
_buffer.AppendFormat("BillNum={0}&&", TXT_billnum.Text);
}
if (!string.IsNullOrEmpty(CurrentUser.UsedDomain))
{
_buffer.AppendFormat("Domain={0}",CurrentUser.UsedDomain);
}
string s = _buffer.ToString();
PageContext.Redirect(string.Format("UNIAPI.aspx?{0}", s));
}
}
}

78
SCP/Admin/UNIAPI.aspx.designer.cs

@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Admin {
public partial class UNIAPI {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// TXT_billnum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextArea TXT_billnum;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid;
}
}

15
SCP/Business/PageBase.cs

@ -275,7 +275,20 @@ namespace SCP
}
}
}
protected void IsPriceEdit(Grid p_grid, params string[] p_str)
{
if (CurrentUser.RoleList.Contains("查看价格"))
{
foreach (var itm in p_grid.Columns)
{
if (p_str.Contains(itm.HeaderText))
{
itm.Hidden = false;
itm.Enabled = false;
}
}
}
}
public void UpdateDataRow<T>(Dictionary<string, object> rowDict, T entity)
{

60
SCP/Common/MailHelper.cs

@ -71,14 +71,21 @@ namespace SCP.Common
{
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{
var _userList=db.Users.Where(p => p.SupplierCode == p_VendId).ToList();
StringBuilder _buffer = new StringBuilder();
_buffer.Append("SELECT b.Email ");
_buffer.Append(" FROM VenderUsers AS a INNER JOIN ");
_buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN ");
_buffer.Append(" RoleUsers AS g ON a.UserId = g.UserID INNER JOIN ");
_buffer.Append(" Roles AS h ON g.RoleID = h.ID ");
_buffer.AppendFormat(" WHERE(h.Name = '供应商' and a.VenderId='{0}' ) ", p_VendId);
var _userList = db.Database.SqlQuery<string>(_buffer.ToString()).ToList();
//var _vender = ScpCache.VenderList.Where(itm => itm.VendId == p_VendId).FirstOrDefault();
if (_userList != null && _userList.Count>0)
{
foreach (var itm in _userList)
{
string mails = "";
mails += itm.Email + ",";
mails += itm + ",";
if (mails != "")
{
mails = mails.Substring(0, mails.Length - 1);
@ -94,7 +101,56 @@ namespace SCP.Common
}
}
}
/// <summary>
/// 发邮件给采购
/// </summary>
/// <param name="p_VendId"></param>
/// <param name="p_Content"></param>
/// <param name="p_title"></param>
/// <param name="p_site"></param>
public static void SendMailToUser(string p_VendId, string p_Content, string p_title, string p_site)
{
try
{
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{
StringBuilder _buffer = new StringBuilder();
_buffer.Append("SELECT b.Email ");
_buffer.Append(" FROM VenderUsers AS a INNER JOIN ");
_buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN ");
_buffer.Append(" FactoryUsers AS c ON a.UserId = c.UserID INNER JOIN ");
_buffer.Append(" TA_FACTORY AS d ON c.FACTORY_ID = d.ID INNER JOIN ");
_buffer.Append(" RoleUsers AS g ON a.UserId = g.UserID INNER JOIN ");
_buffer.Append(" Roles AS h ON g.RoleID = h.ID ");
_buffer.AppendFormat(" WHERE(h.Name = '采购人员' and a.VenderId='{0}' and d.FactoryId='{1}' ) ", p_VendId, p_site);
var _userList = db.Database.SqlQuery<string>(_buffer.ToString()).ToList();
if (_userList != null && _userList.Count > 0)
{
foreach (var itm in _userList)
{
string mails = "";
mails += itm + ",";
if (mails != "")
{
mails = mails.Substring(0, mails.Length - 1);
}
string mailbody = "";
mailbody += "尊敬的采购计划人员<br>";
mailbody += "你好!<br><br>";
mailbody += "<b>" + p_Content + "</b> ,请到供应商协同网站" + HttpContext.Current.Request.Url.Host + "打开查看!<br>";
mailbody += "<br><br><br><br>日期:" + DateTime.Now;
MyWebSmtpMail webmail = new MyWebSmtpMail();
webmail.Send(mails, mailbody, p_title);
}
}
}
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message);
}
}
public static void SendCompanyMail(string p_tl,string p_User, string p_Content, string p_title)
{

212
SCP/SCP.csproj

@ -197,6 +197,7 @@
<Content Include="Admin\title_new.aspx" />
<Content Include="Admin\title_user.aspx" />
<Content Include="Admin\title_user_addnew.aspx" />
<Content Include="Admin\UNIAPI.aspx" />
<Content Include="Admin\user.aspx" />
<Content Include="Admin\user_changepassword.aspx" />
<Content Include="Admin\user_edit.aspx" />
@ -254,6 +255,8 @@
<Content Include="Views\BasicData\SCP_FACTORY.aspx" />
<Content Include="Views\BasicData\SCP_FACTORY_EDIT.aspx" />
<Content Include="Views\BasicData\SCP_LANGUAGE.aspx" />
<Content Include="Views\BasicData\SCP_MoldSharing.aspx" />
<Content Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx" />
<Content Include="Views\BasicData\SCP_RECIVE_PORT.aspx" />
<Content Include="Views\BasicData\SCP_TA_VEND_PART.aspx" />
<Content Include="Views\BasicData\SCP_VenderUser.aspx" />
@ -4502,6 +4505,15 @@
<Content Include="Views\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx" />
<Content Include="ViewSwitcher.ascx" />
<Content Include="Views\SupplierData\SCP_UNPAID.aspx" />
<Content Include="Views\SupplierData\SupplierFinance\SCP_INVOICE.aspx" />
<Content Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_CREATE.aspx" />
<Content Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_EDIT.aspx" />
<Content Include="Views\SupplierData\SupplierFinance\SCP_RECEIVE_LIST.aspx" />
<Content Include="Views\SupplierData\SupplierLogistics\SCP_ASK.aspx" />
<Content Include="Views\SupplierData\SupplierLogistics\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\SupplierData\SupplierLogistics\SCP_ASN.aspx" />
<Content Include="Views\SupplierData\SupplierLogistics\SCP_ASN_CREATE.aspx" />
<Content Include="Views\SupplierData\SupplierLogistics\SCP_ASN_DETAIL.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_VIEW.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_RECVICE.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" />
@ -4516,36 +4528,36 @@
<Content Include="Views\WarehouseData\SCP_RECEIVE_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT_VendID.aspx" />
<Content Include="Views\沈阳金杯\SCP_ARRIVE.aspx" />
<Content Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_CREATE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_CREATE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_EDIT.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_PRODUCT_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CHECKFAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_RECEIVE.aspx" />
@ -4793,6 +4805,13 @@
<Compile Include="Admin\title_user_addnew.aspx.designer.cs">
<DependentUpon>title_user_addnew.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\UNIAPI.aspx.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Admin\UNIAPI.aspx.designer.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\user.aspx.cs">
<DependentUpon>user.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4976,6 +4995,20 @@
<Compile Include="Views\BasicData\SCP_LANGUAGE.aspx.designer.cs">
<DependentUpon>SCP_LANGUAGE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_MoldSharing.aspx.cs">
<DependentUpon>SCP_MoldSharing.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_MoldSharing.aspx.designer.cs">
<DependentUpon>SCP_MoldSharing.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx.cs">
<DependentUpon>SCP_MOLDSHARING_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MOLDSHARING_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_RECIVE_PORT.aspx.cs">
<DependentUpon>SCP_RECIVE_PORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5580,6 +5613,69 @@
<Compile Include="Views\SupplierData\SCP_UNPAID.aspx.designer.cs">
<DependentUpon>SCP_UNPAID.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE.aspx.designer.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_CREATE.aspx.cs">
<DependentUpon>SCP_INVOICE_CREATE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_CREATE.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_CREATE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_EDIT.aspx.cs">
<DependentUpon>SCP_INVOICE_EDIT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_INVOICE_EDIT.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_EDIT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_RECEIVE_LIST.aspx.cs">
<DependentUpon>SCP_RECEIVE_LIST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierFinance\SCP_RECEIVE_LIST.aspx.designer.cs">
<DependentUpon>SCP_RECEIVE_LIST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASK.aspx.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASK.aspx.designer.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASK_DETAIL.aspx.cs">
<DependentUpon>SCP_ASK_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASK_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASK_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN.aspx.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN.aspx.designer.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN_CREATE.aspx.cs">
<DependentUpon>SCP_ASN_CREATE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN_CREATE.aspx.designer.cs">
<DependentUpon>SCP_ASN_CREATE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN_DETAIL.aspx.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SupplierLogistics\SCP_ASN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\WarehouseData\SCP_INVOICE_VIEW.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5678,6 +5774,13 @@
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASK_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx.cs">
<DependentUpon>SCP_ASK_DETAIL_PARTCODE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx.designer.cs">
<DependentUpon>SCP_ASK_DETAIL_PARTCODE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5692,6 +5795,27 @@
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx.designer.cs">
<DependentUpon>SCP_ASN_LIST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx.cs">
<DependentUpon>SCP_PRODUCT_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_PRODUCT_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.designer.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx.cs">
<DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5727,34 +5851,6 @@
<Compile Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ARRIVE_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO.aspx.cs">
<DependentUpon>SCP_PO.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO.aspx.designer.cs">
<DependentUpon>SCP_PO.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx.cs">
<DependentUpon>SCP_PO_ARRIVE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx.designer.cs">
<DependentUpon>SCP_PO_ARRIVE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx.cs">
<DependentUpon>SCP_PO_STATISTICS.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx.designer.cs">
<DependentUpon>SCP_PO_STATISTICS.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx.cs">
<DependentUpon>SCP_PO_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_PO_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5790,6 +5886,20 @@
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx.cs">
<DependentUpon>SCP_ASN_DETAIL_Modify.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL_Modify.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5825,19 +5935,19 @@
<Compile Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx.designer.cs">
<DependentUpon>SCP_RECEIVE_LIST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_DELTAIL_RED.aspx</DependentUpon>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx.cs">
<DependentUpon>SCP_TS_BARCODE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_DELTAIL_RED.aspx</DependentUpon>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx.designer.cs">
<DependentUpon>SCP_TS_BARCODE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_RED.aspx</DependentUpon>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx.cs">
<DependentUpon>SCP_WMS_STOCK_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_RED.aspx</DependentUpon>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx.designer.cs">
<DependentUpon>SCP_WMS_STOCK_REPORT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
@ -5874,20 +5984,6 @@
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_DELTAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW_DETAIL_RED.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_VIEW_DETAIL_RED.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW_RED.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_VIEW_RED.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

76
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx

@ -0,0 +1,76 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MOLDSHARING_DETAIL.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MOLDSHARING_DETAIL" %>
<!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:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:TextBox ID="TextVendId" runat="server" Label="供应商" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextPartCode" runat="server" Label="零件编号" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextPrice" runat="server" Label="价格" Text="" Width="600" Readonly="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:TextBox ID="TextTotal" runat="server" Label="分摊总量" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TexInitialQty" runat="server" Label="初始已分摊数量" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextCount" runat="server" Label="已累计数量" Text="" Width="600" Readonly="true" />
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Toolbar runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:ToolbarFill runat="server" />
</Items>
</f:Toolbar>
<f:Grid ID="Grid_MOLDSHARING_DETAIL" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True" SortField="PartCode" SortDirection="DESC"
EnableRowSelectEvent="False" AutoScroll="True" OnPageIndexChange="Grid1_OnPageIndexChange">
<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_OnSelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="InvcBillNum" DataField="InvcBillNum" HeaderText="发票号" ColumnID="InvcBillNum" Width="100px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件编号" ColumnID="PartCode" Width="120px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="PoLineNum" Width="60px" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty" Width="60px" />
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="60px" />
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="WM单号" ColumnID="RecvBillNum" Width="80px" />
<f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP单号" ColumnID="ErpRecvBillNum" Width="80px" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

88
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.cs

@ -0,0 +1,88 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using FineUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views.BasicData
{
public partial class SCP_MOLDSHARING_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
BindData();
}
}
public void LoadData()
{
var item = new TA_MOLDSHARING();
item.UID =long.Parse( GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(item, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
var _rec = _ret.Result.FirstOrDefault();
TextVendId.Text = _rec.VendId;
TextPartCode.Text = _rec.PartCode;
TextPrice.Text = _rec.Price.ToString();
TextTotal.Text = _rec.TotalCount.ToString();
TexInitialQty.Text = _rec.InitialQty.ToString();
TextCount.Text = _rec.Count.ToString();
}
});
}
public void BindData()
{
var _entity = new TA_MOLDSHARING_INVOICE();
_entity.MoldSharingId = long.Parse(GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
Grid_MOLDSHARING_DETAIL.RecordCount = ret.Result.Count();
var _ls = SortAndPage(ret.Result, Grid_MOLDSHARING_DETAIL);
Grid_MOLDSHARING_DETAIL.DataSource = _ls;
Grid_MOLDSHARING_DETAIL.DataBind();
}
});
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void btnOutput_OnClick(object sender, EventArgs e)
{
var _entity = new TA_MOLDSHARING_INVOICE();
_entity.MoldSharingId= long.Parse(GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
Dictionary<string, string> cellheader = new Dictionary<string, string> {
{ "InvcBillNum", "发票号" },
{ "PartCode", "零件编号" },
{ "PoLineNum", "订单行" },
{ "Qty", "数量" },
{ "Price", "价格" },
};
string url = EntityListToExcel2003(cellheader, ret.Result.ToList(), "分摊明细");
}
});
}
}
}

134
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.designer.cs

@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.BasicData
{
public partial class SCP_MOLDSHARING_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPrice;
/// <summary>
/// TextTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextTotal;
/// <summary>
/// TexInitialQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TexInitialQty;
/// <summary>
/// TextCount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextCount;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// Grid_MOLDSHARING_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_MOLDSHARING_DETAIL;
/// <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;
}
}

92
SCP/Views/BasicData/SCP_MoldSharing.aspx

@ -0,0 +1,92 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MoldSharing.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MoldSharing" %>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="Add" Hidden="true">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server" BodyPadding="10px">
<Rows>
<f:FormRow runat="server" ColumnWidths="50% 50%">
<Items>
<f:Label runat="server" Label="供应商编号" />
<f:TextBox ID="textVendId" runat="server" />
<f:Label runat="server" Label="零件编码" />
<f:TextBox ID="textPartCode" runat="server" />
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" ID="btnClose" Text="关闭" OnClick="btnClose_OnClick"></f:Button>
<f:Button ID="btnSearch" runat="server" OnClick="btnSearch_OnClick" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableRowDoubleClickEvent="True"
runat="server" DataKeyNames="UID,VendId" IsDatabasePaging="true" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" SortField="VendId" SortDirection="ASC" AllowSorting="True" OnRowDoubleClick="Grid1_RowDoubleClick">
<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_OnSelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" />
<f:BoundField runat="server" HeaderText="零件编码" ColumnID="" DataField="PartCode" SortField="PartCode" />
<f:BoundField runat="server" HeaderText="价格" ColumnID="" DataField="Price" SortField="Price" />
<f:BoundField runat="server" HeaderText="分摊总量" DataFormatString="{0:F0}" ColumnID="" DataField="TotalCount" SortField="TotalCount" />
<f:BoundField runat="server" HeaderText="初始已分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="InitialQty" SortField="InitialQty" />
<f:BoundField runat="server" HeaderText="分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" SortField="Qty" />
<f:BoundField runat="server" HeaderText="已累计数量" DataFormatString="{0:F0}" ColumnID="" DataField="Count" SortField="Count" />
<f:BoundField runat="server" HeaderText="创建人" ColumnID="" DataField="CreateUser" SortField="CreateUser" />
<f:BoundField runat="server" HeaderText="创建时间" ColumnID="" DataField="CreateTime" SortField="CreateTime" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1024px" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" OnClose="Window1_Close" CloseAction="HidePostBack"
IFrameUrl="about:blank" />
</form>
</body>
</html>

175
SCP/Views/BasicData/SCP_MoldSharing.aspx.cs

@ -0,0 +1,175 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views.BasicData
{
public partial class SCP_MoldSharing : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TA_MoldSharingData((result) =>
{
Grid1.RecordCount = result.Count();
var list = SortAndPage<TA_MOLDSHARING>(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TA_MoldSharingData(Action<IQueryable<TA_MOLDSHARING>> p_action)
{
TA_MOLDSHARING _entity = new TA_MOLDSHARING();
_entity.PartCode = textPartCode.Text;
_entity.VendId = textVendId.Text;
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 显示查询面板事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnShow_OnClick(object sender, EventArgs e)
{
gp1.Hidden = false;
}
/// <summary>
/// 关闭显示查询面板事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnClose_OnClick(object sender, EventArgs e)
{
gp1.Hidden = true;
}
/// <summary>
/// 查询事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void btnInput_Click(object sender, EventArgs e)
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_MOLDSHARING_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_MoldSharing_Controller.EXCEL_MOLDSHARING_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid1.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid1.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_MoldSharing_Controller.Save_TA_MOLDSHARING_STATE(_UidList, CurrentUser.Name, true);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
object[] rowDataKeys = Grid1.DataKeys[e.RowIndex];
string UID = rowDataKeys[0].ToString();
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../BasicData/SCP_MOLDSHARING_DETAIL.aspx?ID={0}", UID)));
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindData();
}
}
}

73
SCP/Views/沈阳金杯/SCP_PO_DETAIL.aspx.designer.cs → SCP/Views/BasicData/SCP_MoldSharing.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SYJB {
namespace SCP.Views.BasicData
{
public partial class SCP_PO_DETAIL {
public partial class SCP_MoldSharing
{
/// <summary>
/// form1 控件。
@ -40,94 +42,112 @@ namespace SCP.SYJB {
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// BTN_REFRESH 控件。
/// BtnRefersh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_REFRESH;
protected global::FineUI.Button BtnRefersh;
/// <summary>
/// BTN_RELESE 控件。
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_RELESE;
protected global::FineUI.Button btnDelete;
/// <summary>
/// TXT_State_DESC 控件。
/// BtnOutPut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_State_DESC;
protected global::FineUI.Button BtnOutPut;
/// <summary>
/// TXT_PoBillNum 控件。
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum;
protected global::FineUI.Button btnShow;
/// <summary>
/// TXT_VendName 控件。
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendName;
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// DP_BeginTime 控件。
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_BeginTime;
protected global::FineUI.Button btnInput;
/// <summary>
/// TXT_Site 控件。
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// txtRemark 控件。
/// textVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtRemark;
protected global::FineUI.TextBox textVendId;
/// <summary>
/// HF_GRID_INDEX 控件。
/// textPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX;
protected global::FineUI.TextBox textPartCode;
/// <summary>
/// Grid_V_TB_PO_DETAIL 控件。
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_PO_DETAIL;
protected global::FineUI.Button btnClose;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
@ -164,14 +184,5 @@ namespace SCP.SYJB {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

17
SCP/Views/BasicData/Supplier.aspx

@ -10,13 +10,13 @@
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload">
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick">
</f:Button>
@ -76,6 +76,19 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="VendId" IsDatabasePaging="False" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" OnSort="Grid1_OnSort" SortField="VendName" SortDirection="ASC" AllowSorting="True">
<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="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" />
<f:BoundField runat="server" HeaderText="供应商名称" ColumnID="" DataField="VendName" SortField="VendName" />

44
SCP/Views/BasicData/Supplier.aspx.cs

@ -42,7 +42,8 @@ namespace SCP.BasicData
_ls.Insert(0, new TB_FACTORY() { FactoryId = "", FactoryName = "" });
DPL_Factory.DataSource = _ls;
DPL_Factory.DataBind();
_list = SCP_TB_VENDER_CONTROLLER.Getlist();
// _list = SCP_TB_VENDER_CONTROLLER.Getlist();
_list= SearchData();
var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid1);
Grid1.DataSource = list;
@ -120,7 +121,38 @@ namespace SCP.BasicData
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
//public void BtnSave_OnClick(object sender, EventArgs e)
//{
// List<TA_VENDER> _list = new List<TA_VENDER>();
// for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
// {
// GridRow row = Grid1.Rows[i];
// TA_VENDER _entity = new TA_VENDER();
// object[] rowDataKeys = Grid1.DataKeys[i];
// _entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
// System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQuota");
// if (string.IsNullOrEmpty(_txt.Text))
// {
// _txt.Text = "0";
// }
// _entity.Quota = decimal.Parse(_txt.Text);
// if (_entity.Quota > 0)
// {
// _list.Add(_entity);
// }
// }
// var ret = SCP_TB_VENDER_CONTROLLER.Save_TA_VENDER(_list);
// if (ret.State == ReturnStatus.Succeed)
// {
// var list = ret.Result;
// Alert.Show("保存成功!");
// BindData();
// }
// else
// {
// Alert.Show("保存失败!");
// }
//}
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
{
@ -166,9 +198,13 @@ namespace SCP.BasicData
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_OnSort(object sender, GridSortEventArgs e)
{

33
SCP/Views/BasicData/Supplier.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.BasicData {
namespace SCP.BasicData
{
public partial class Supplier {
public partial class Supplier
{
/// <summary>
/// form1 控件。
@ -147,6 +149,33 @@ namespace SCP.BasicData {
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <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;
/// <summary>
/// Window1 控件。
/// </summary>

9
SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx

@ -92,6 +92,7 @@
</ItemTemplate>
</f:TemplateField>
<f:BoundField Width = "100px" SortField="VendName" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商名称" />
<f:BoundField Width = "80px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单单号" />
<f:BoundField Width = "80px" SortField="AskBillNum" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板号" />
<f:BoundField Width = "80px" SortField="AsnBillNum" DataField = "AsnBillNum" DataFormatString = "{0}" HeaderText = "发货单号" />
@ -100,12 +101,12 @@
<f:BoundField Width = "100px" SortField="PartCode" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编号" />
<f:BoundField Width = "100px" SortField="PartDesc1" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" />
<f:BoundField Width = "50px" SortField="CurrencyDesc" DataField = "CurrencyDesc" DataFormatString = "{0}" HeaderText = "币种" Hidden="true"/>
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<f:BoundField Width = "100px" SortField="Batch" DataField = "Batch" DataFormatString = "{0}" HeaderText = "批次" />
<f:BoundField Width = "100px" SortField="VendBatch" DataField = "VendBatch" DataFormatString = "{0}" HeaderText = "供应商批次" />
<f:BoundField Width = "100px" SortField="ShipTime" DataField = "ShipTime" DataFormatString = "{0}" HeaderText = "发货日期" />
<f:BoundField Width = "100px" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0}" HeaderText = "承诺到货日期" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0}" HeaderText = "实际到货日期" />
<f:BoundField Width = "100px" SortField="ShipTime" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货日期" />
<f:BoundField Width = "100px" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "承诺到货日期" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "实际到货日期" />
<f:BoundField Width = "50px" SortField="PoUnit" DataField = "PoUnit" DataFormatString = "{0}" HeaderText = "单位" />
<f:BoundField Width = "80px" SortField="Price" DataField = "Price" DataFormatString = "{0}" HeaderText = "价格" Hidden="true"/>

39
SCP/Views/PlanData/SCP_PO.aspx

@ -83,21 +83,18 @@
<f:ListItem Text="关闭" Value="0" />
<f:ListItem Text="开放" Value="1" />
</f:DropDownList>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:Button>
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" />
<%-- <f:DropDownList runat="server" ID="DropDownList1" Label="零件状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="开发" Value="0" />
<f:ListItem Text="关闭" Value="1" />
</f:DropDownList> --%>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<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>
<f:Button ID="BtnSearchDetail" runat="server" OnClick="BtnSearchDetail_Click" Text="快速查找订单明细">
</f:Button>
</Items>
@ -131,18 +128,18 @@
<Columns>
<f:BoundField Width = "60px" DataField = "State" DataFormatString = "{0}" HeaderText = "状态" Hidden="true" />
<f:BoundField Width = "60px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" SortField="State_DESC" />
<f:BoundField Width = "80px" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" SortField="ModType_DESC"/>
<f:BoundField Width = "100px" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单编号" SortField="PoBillNum"/>
<f:BoundField Width = "100px" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="项目编号" SortField="ErpBillNum"/>
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" SortField="VendName"/>
<f:BoundField Width = "100px" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商编码" SortField="VendId"/>
<f:BoundField Width = "60px" SortField="State" DataField = "State" DataFormatString = "{0}" HeaderText = "状态" Hidden="true" />
<f:BoundField Width = "60px" SortField="State_DESC" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField Width = "80px" SortField="ModType_DESC" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" />
<f:BoundField Width = "100px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单编号" />
<f:BoundField Width = "100px" SortField="ErpBillNum" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="项目编号" />
<f:BoundField Width = "100px" SortField="VendName" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<f:BoundField Width = "100px" SortField="VendId" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商编码" />
<%-- <f:BoundField Width = "100px" DataField = "Contacter" DataFormatString = "{0}" HeaderText = "发布人" />--%>
<f:BoundField Width = "100px" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "订货日期" SortField="BeginTime"/>
<f:BoundField Width = "100px" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" SortField="Site_Desc" />
<f:BoundField Width = "100px" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" SortField="Buyer"/>
<f:BoundField Width = "100px" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" />
<f:BoundField Width = "100px" SortField="BeginTime" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "订货日期" />
<f:BoundField Width = "100px" SortField="Site_Desc" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" />
<f:BoundField Width = "100px" SortField="Buyer" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField Width = "100px" SortField="BuyerPhone" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" />
</Columns>

2
SCP/Views/PlanData/SCP_PO.aspx.cs

@ -110,6 +110,8 @@ namespace SCP.PlanData
protected void Grid_V_TB_PO_Sort(object sender, FineUI.GridSortEventArgs e)
{
Grid_V_TB_PO.SortDirection = e.SortDirection;
Grid_V_TB_PO.SortField = e.SortField;
BindOrder();
}

12
SCP/Views/PlanData/SCP_PO.aspx.designer.cs

@ -231,31 +231,31 @@ namespace SCP.PlanData
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// BtnClose 控件。
/// TXT_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
protected global::FineUI.TextBox TXT_PartCode;
/// <summary>
/// BtnSearch 控件。
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
protected global::FineUI.Button BtnClose;
/// <summary>
/// TXT_PartCode 控件。
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCode;
protected global::FineUI.Button BtnSearch;
/// <summary>
/// BtnSearchDetail 控件。

3
SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx

@ -96,11 +96,10 @@
<f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,PlanQty,ShippedQty,ReceivedQty,RejectQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,ErpBillNum,ModType,Contacter,Site,Buyer,BuyerPhone,VendName,PartDesc2,TempQty,PublishQty,ReceivedPort,SubSite,Extend1,Extend2,Extend3"
SortField="PoLine"
AllowSorting="true"
AllowPaging="True"
AllowCellEditing="true" ClicksToEdit="2"
IsDatabasePaging="true" PageSize="1000"
IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange"
OnRowDataBound="Grid_V_TB_PO_DETAIL_RowDataBound"
>
<PageItems>

8
SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx

@ -57,7 +57,7 @@
<f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" Title="采购明细" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2"
SortField="PoLine"
BoxFlex="1"
BoxFlex="1"
AllowPaging="True"
IsDatabasePaging="true" PageSize="500" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<PageItems>
@ -79,7 +79,7 @@
<f:BoundField Width = "50px" DataField = "PoLine" DataFormatString = "{0}" HeaderText = "行号" />
<f:BoundField Width = "100px" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" />
<f:BoundField Width = "80px" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编码" />
<f:BoundField Width="300px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
<f:BoundField Width="300px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
</Columns>
</f:Grid>
</Items>
@ -99,9 +99,7 @@
</f:Toolbar>
<f:Grid ID = "Grid1" ColumnWidth="45%" EnableCollapse = "true" ShowBorder = "true" Title="模板导出区" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2" PageSize="500"
SortField="PoLine"
BoxFlex="1"
AllowPaging="True">
SortField="PoLine" BoxFlex="1" AllowPaging="True">
<Columns>
<f:BoundField Width="100px" DataField="ProjectId" HeaderText="项目编码"></f:BoundField>

3
SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx.cs

@ -113,9 +113,6 @@ namespace SCP.PlanData
{"域名" ,"域名" },
{"站点" ,"站点" },
{"收货口" ,"收货口" },
{"预测一" ,"预测一" },
{"预测二" ,"预测二" },
{"预测三" ,"预测三" },
{"备注" ,"备注" }
};

3
SCP/Views/SupplierData/SCP_ASK_DETAIL.aspx

@ -96,9 +96,6 @@
<f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数" ColumnID="ReceiveQty" Width="60px" />--%>
<f:BoundField SortField="Remrk" DataField="Remark" HeaderText="说明" ColumnID="RejectQty" />
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" />
<f:BoundField SortField="OneMonth" DataField="OneMonth" HeaderText="预测一" ColumnID="OneMonth" />
<f:BoundField SortField="TwoMonth" DataField="TwoMonth" HeaderText="预测二" ColumnID="TwoMonth" />
<f:BoundField SortField="ThreeMonth" DataField="ThreeMonth" HeaderText="预测三" ColumnID="ThreeMonth" />
</Columns>
</f:Grid>

3
SCP/Views/SupplierData/SCP_INVOICE.aspx

@ -90,7 +90,7 @@
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
AllowPaging="True" PageSize="20" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" SortField="State" OnRowDataBound="Grid_V_TB_INVOICE_RowDataBound" >
<PageItems>
@ -100,7 +100,6 @@
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />

16
SCP/Views/SupplierData/SCP_INVOICE.aspx.cs

@ -46,9 +46,6 @@ namespace SCP.Views.SupplierData
SearchInvoice(ret => {
Grid_V_TB_INVOICE.RecordCount = ret.Count();
ret = SortAndPage(ret, Grid_V_TB_INVOICE);
var _ls=ret.ToList();
Grid_V_TB_INVOICE.DataSource = ret;
Grid_V_TB_INVOICE.DataBind();
});
@ -151,15 +148,6 @@ namespace SCP.Views.SupplierData
//导出
protected void btnOutput_OnClick(object sender, EventArgs e)
{
//List<string> _ls = new List<string>();
//for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++)
//{
// object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i];
// _ls.Add(rowDataKeys[1] as string);
//}
//DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls);
//PageBase.DataSetToExcel(ds, "财务确认");
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0)
{
@ -205,10 +193,6 @@ namespace SCP.Views.SupplierData
catch
{ }
}
//if (i > 0)
//{
// Alert.Show("请尽快处理索赔和退货数据,如果不处理新建发票将")
//}
}
protected void BTN_INV_Click(object sender, EventArgs e)

32
SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx.cs

@ -127,38 +127,6 @@ namespace SCP.Views.SupplierData
{
_vendId = CurrentUser.VenderList[0];
}
//SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_PRICE(_vendId, temp, (rs) =>
//{
// if (rs.State == ReturnStatus.Succeed)
// {
// temp.ForEach(itm =>
// {
// var _entityList = rs.Result.ToList().Where(p => p.PartCode == itm.PartCode && itm.CreateTime >= p.StartTime && itm.CreateTime <= p.EndTime).ToList();
// if (_entityList.Count > 0)
// {
// var _max = _entityList.Select(p => p.UID).Max();
// var _entity = _entityList.Where(p => p.UID == _max).FirstOrDefault();
// if (itm.ModType == (int)BillModType.Contract)
// {
// if (CurrentUser.FactoryList.FirstOrDefault() == "CNS")
// {
// itm.Price = _entity.Amt;
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// });
// }
//});
var _isall=parm.IsAll;
if(_isall=="0")
{

35
SCP/Views/SupplierData/SCP_INVOICE_EDIT.aspx.cs

@ -56,21 +56,6 @@ namespace SCP.Views.SupplierData
IsPriceVisible(Grid1, "要货日期");
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
//if (tempOdds > num)
//{
// num = (decimal)((double)(tempOdds - (decimal)Math.Pow(10, -scale)));
//}
//else
//{
// num = (decimal)((double)tempOdds);
//}
//return num;
return tempOdds;
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{
@ -96,20 +81,6 @@ namespace SCP.Views.SupplierData
//Grid1.DataSource =SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
List<V_TB_INVOICE_DETAIL> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp);
//decimal htjgSum = 0;//合同总价
//decimal htceSum = 0;//合同差额
//foreach (V_TB_INVOICE_DETAIL rec in temp)
//{
// rec.Qty = ToDecimal(rec.Qty, 2);
// rec.CanQty = ToDecimal(rec.CanQty, 2);
// htjgSum += rec.Qty * (rec.ContractPrice == null ? 0 : Convert.ToDecimal(rec.ContractPrice));//开票数量*合同价格
// htceSum += rec.Qty * (rec.BlancePrice == null ? 0 : Convert.ToDecimal(rec.BlancePrice));//开票数量*合同差额
//}
//txtContractPrice1.Text = htjgSum.ToString();
//txtBlancePrice1.Text = htceSum.ToString();
GetInvoice();
Grid1.DataSource = temp;
Grid1.DataBind();
@ -210,15 +181,11 @@ namespace SCP.Views.SupplierData
txtExpressNumber.Readonly = false;
txtContractPrice1.Readonly = false;
txtContractPrice1.Required = false;
txtBlancePrice1.Readonly = true;
txtBlancePrice1.Readonly = false;
txtBlancePrice1.Required = false;
this.btnMail.Hidden = false;
this.btnReject.Hidden = false;
this.btnOK.Hidden = false;
txtContractPrice1.Readonly = true;
txtContractPrice1.Required = false;
txtContractPrice1.Enabled = false;
txtBlancePrice1.Readonly = false;
}
if (_Model.State ==(int) InvoiceState.CheckSuccess)
{

26
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx

@ -10,12 +10,10 @@
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
@ -24,6 +22,9 @@
</f:Button>
<f:Button ID="btnPrintRe" runat="server" Text="补打条码" OnClick="btnPrintRe_Click" Icon="Printer">
</f:Button>
<f:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
</f:ToolbarSeparator>
<f:CheckBox runat="server" ID="ckbox" Label="未扫描" LabelWidth="45px" Text="" AutoPostBack="true" OnCheckedChanged="ckbox_CheckedChanged"></f:CheckBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:TextBox ID="txtKeyword" runat="server" Label="" Text="">
@ -36,15 +37,26 @@
</f:Toolbar>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" ShowHeader="False" BoxFlex="1"
AllowPaging="True" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
ShowBorder="False" AutoScroll="true"
ShowBorder="False" AutoScroll="true" SortDirection="DESC" SortField="BarCode"
DataKeyNames="UID,BarCode" AllowSorting="true" IsDatabasePaging="true" >
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"></f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText2" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="200" />
<f:BoundField SortField="IsScanned_Desc" DataField="IsScanned_Desc" HeaderText="状态" ColumnID="IsScanned_Desc" Width="100" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode"/>
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="ProductName" Width="300px"/>
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="ProductName" Width="200px" />
<f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch"/>
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty"/>
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackageQty"/>

19
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs

@ -27,7 +27,8 @@ namespace SCP.SupplierData
{
Search(ret => {
Grid1.RecordCount = ret.Count();
Grid1.DataSource = ret.ToList();
var list = SortAndPage<TS_BARCODE>(ret, Grid1);
Grid1.DataSource = list.ToList();
Grid1.DataBind();
});
@ -37,9 +38,13 @@ namespace SCP.SupplierData
string billnum = GetQueryValue("BillNo");
TS_BARCODE _code = new TS_BARCODE();
_code.BillNum = billnum;
if (ckbox.Checked)
{
_code.IsScanned = true;
}
if (!string.IsNullOrEmpty(txtKeyword.Text))
{
_code.PartCode = txtKeyword.Text;
_code.BarCode = txtKeyword.Text;
}
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_code, ret => {
if (ret.State == ReturnStatus.Succeed)
@ -68,6 +73,7 @@ namespace SCP.SupplierData
{
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "IsScanned_Desc", "状态" },
{ "BarCode", "包装箱码" },
{ "Qty", "数量" },
{ "PartCode", "零件编号" },
@ -110,5 +116,14 @@ namespace SCP.SupplierData
{
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void ckbox_CheckedChanged(object sender, CheckedEventArgs e)
{
BindData();
}
}
}

60
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SupplierData {
namespace SCP.SupplierData
{
public partial class SCP_SHIP_DETAIL_BARCODE {
public partial class SCP_SHIP_DETAIL_BARCODE
{
/// <summary>
/// form1 控件。
@ -48,15 +50,6 @@ namespace SCP.SupplierData {
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
@ -93,6 +86,24 @@ namespace SCP.SupplierData {
/// </remarks>
protected global::FineUI.Button btnPrintRe;
/// <summary>
/// ToolbarSeparator3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
/// <summary>
/// ckbox 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.CheckBox ckbox;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -137,5 +148,32 @@ namespace SCP.SupplierData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText2;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

35
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx

@ -10,17 +10,17 @@
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add">
</f:Button>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="Button3_OnClick">
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="ButtonOut_OnClick">
</f:Button>
<f:Button ID="Button2" runat="server" EnablePostBack="True" Text="补打条码" Icon="Printer" OnClick="Button2_OnClick">
<f:Button ID="Button2" runat="server" EnablePostBack="True" Text="补打条码" Icon="Printer" OnClick="ButtonPrint_OnClick">
</f:Button>
<f:Button ID="btnSearch" runat="server" Text="快速查找" Icon="Printer" OnClick="btnSearch_OnClick">
<f:Button ID="btnSearch" runat="server" Text="快速查找" Icon="Printer" OnClick="BtnSearch_OnClick">
</f:Button>
</Items>
</f:Toolbar>
@ -28,8 +28,10 @@
<Items>
<f:Form runat="server" Layout="Column" ID="FormRow_1">
<Items>
<f:FormRow runat="server" BoxFlex="1">
<f:FormRow runat="server" BoxFlex="1" Margin="5">
<Items>
<f:Label runat="server" Label="发货单号" />
<f:TextBox ID="txtAsnNumBill" runat="server" />
<f:Label runat="server" Label="条码" />
<f:TextBox ID="txtBarCode" runat="server" />
<f:Label runat="server" Label="零件号" />
@ -40,17 +42,30 @@
</f:FormRow>
</Items>
</f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="10" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True" SortField="BarCode" SortDirection="DESC"
EnableRowSelectEvent="True" AutoScroll="True">
<f:Grid ID="Grid1" ShowBorder="false" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,BarCode" IsDatabasePaging="True" AllowPaging="True" SortField="BarCode" SortDirection="DESC"
EnableCheckBoxSelect="true" AutoScroll="True" OnPageIndexChange="Grid_V_TS_BARCODE_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="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="IsScanned_Desc" DataField="IsScanned_Desc" HeaderText="是否扫描" ColumnID="IsScanned_Desc" Width="100" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PartCode" Width="100px" />
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="PartName" Width="300px" />
<f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch" Width="100px" />
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="装箱数量" ColumnID="PackQty" Width="100px" DataFormatString = "{0:F}" />
<f:BoundField SortField="BillNum" DataField="BillNum" HeaderText="发货单号" ColumnID="BillNum" Width="300px" />
</Columns>
</f:Grid>
</Items>

63
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.cs

@ -6,6 +6,8 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
namespace SCP.SupplierData
{
@ -16,35 +18,38 @@ namespace SCP.SupplierData
{
if (!IsPostBack)
{
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid1);
TranslatorAgents(FormRow_1);
LoadData();
}
}
public void LoadData()
{
SearchData((ret) => {
SearchData((ret) =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage<TS_BARCODE>(ret, Grid1);
Grid1.DataSource = list;
var list = SortAndPage<V_TS_BARCODE>(ret, Grid1);
Grid1.DataSource = list.ToList();
Grid1.DataBind();
});
}
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
protected void BtnSearch_OnClick(object sender, EventArgs e)
{
LoadData();
}
public void SearchData(Action<IQueryable<TS_BARCODE>> p_action)
public void SearchData(Action<IQueryable<V_TS_BARCODE>> p_action)
{
string billnum = GetQueryValue("BillNum");
var _barCode = new TS_BARCODE();
_barCode.BillNum = billnum;
SCP_TS_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_barCode, (ret) =>
var _barCode = new V_TS_BARCODE();
_barCode.BillNum = txtAsnNumBill.Text;
_barCode.BarCode = txtBarCode.Text;
_barCode.PartCode = txtPartCode.Text;
_barCode.Batch = txtBatch.Text;
_barCode.IsScanned = false;
_barCode.UserInAddress = CurrentUser.FactoryList;
_barCode.UserInVendIds = CurrentUser.VenderList;
SCP_TS_BARCODE_CONTROLLER.Get_V_TS_BARCODE_List(_barCode, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
@ -53,30 +58,50 @@ namespace SCP.SupplierData
});
}
//导出
protected void Button3_OnClick(object sender, EventArgs e)
protected void ButtonOut_OnClick(object sender, EventArgs e)
{
SearchData((ret)=> {
var list = SortAndPage<TS_BARCODE>(ret, Grid1).ToList();
SearchData((ret) =>
{
var list = SortAndPage<V_TS_BARCODE>(ret, Grid1).ToList();
// 2.设置单元格抬头
// key:实体对象属性名称,可通过反射获取值
// value:Excel列的名称
Dictionary<string, string> cellheader = new Dictionary<string, string> {
{ "IsScanned_Desc", "是否扫描" },
{ "BarCode", "条码" },
{ "PartCode", "零件号" },
{ "PartName", "零件名称" },
{ "Batch", "批次" },
{ "PackQty", "装箱数量" },
};
string url = EntityListToExcel2003(cellheader, list, "条码列表");
});
}
//补打条码
protected void Button2_OnClick(object sender, EventArgs e)
protected void ButtonPrint_OnClick(object sender, EventArgs e)
{
List<string> _ls = new List<string>();
for(int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
if (Grid1.SelectedRowIndexArray.Contains(i))
{
object[] rowDataKeys = Grid1.DataKeys[i];
int id= ConvertHelper.To<int>(rowDataKeys[0]);
_ls.Add(id.ToString());
}
}
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=Material&data=101&type=pdf&filename=标签.pdf&Barcode={0}&open=\")", string.Join("_", _ls.ToArray()));
PageContext.RegisterStartupScript(str);
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
throw new NotImplementedException();
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
LoadData();
}
protected void Grid_V_TS_BARCODE_PageIndexChange(object sender, GridPageEventArgs e)
{
LoadData();
}
}
}

42
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SupplierData {
namespace SCP.SupplierData
{
public partial class SCP_TS_BARCODE {
public partial class SCP_TS_BARCODE
{
/// <summary>
/// form1 控件。
@ -84,6 +86,15 @@ namespace SCP.SupplierData {
/// </remarks>
protected global::FineUI.Form FormRow_1;
/// <summary>
/// txtAsnNumBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAsnNumBill;
/// <summary>
/// txtBarCode 控件。
/// </summary>
@ -119,5 +130,32 @@ namespace SCP.SupplierData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <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;
}
}

161
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx

@ -0,0 +1,161 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE" %>
<!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 ID="PageManager1" runat="server" AutoSizePanelID="Panel1"/>
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnView" runat="server" EnablePostBack="True" Text="查看发票" Icon="Zoom" OnClick="btnView_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" Icon="Find" OnClick="btnShow_OnClick">
</f:Button>
<f:DropDownList ID="DDL_VEND_LIST" DataValueField="VendId" DataTextField="VendName" runat="server" Label="供应商编码" EnableEdit="true" EnableMultiSelect="false" Hidden="true"/>
<f:Button ID="BTN_INV" runat="server" EnablePostBack="True" Text="确认供应商发票管理" OnClick="BTN_INV_Click" Hidden="true"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:CheckBoxList runat="server" ID="ckb" Label="状态">
<%--<f:CheckItem Text="新建" Value="0" Selected="True" />
<f:CheckItem Text="供应商申请" Value="1" />
<f:CheckItem Text="采购审核退回" Value="2" />
<f:CheckItem Text="采购审核通过" Value="3" />
<f:CheckItem Text="发票寄出" Value="4" />
<f:CheckItem Text="财务退回" Value="5" />
<f:CheckItem Text="财务收票" Value="6" />
<f:CheckItem Text="发票作废" Value="-1" />--%>
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox ID="TXT_InvcBillNum" runat="server" Label="发票单号"/>
<f:TextBox ID="TXT_VendName" runat="server" Label="供应商"/>
<f:TextBox ID="TXT_InvoiceNum" runat="server" Label="金税票号" MaxLength="22"/>
<f:TextBox ID="TXT_PO" runat="server" Label="订单编号"/>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:TextBox ID="TXT_Site" runat="server" Label="收货地点"/>
<f:TextBox ID="TXT_ASN" runat="server" Label="发货单号"/>
<f:DatePicker ID="DP_CreateTime1" runat="server" Required="true" Label="收货时间" />
<f:DatePicker ID="DP_CreateTime2" runat="server" Required="true" Label="至" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_4">
<Items>
<f:Button runat="server" Text="关闭" OnClick="OnClick"></f:Button>
<f:Button ID="BTN_SEARCH" runat="server" OnClick="BTN_SEARCH_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" SortField="State" OnRowDataBound="Grid_V_TB_INVOICE_RowDataBound" >
<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="10" Value="10" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="发票单号" ColumnID="" DataField="InvcBillNum" />
<f:BoundField runat="server" HeaderText="金税票号" ColumnID="" DataField="InvoiceNum" />
<f:BoundField runat="server" HeaderText="快递单号" ColumnID="" DataField="ExpressNum" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="金额" ColumnID="" DataField="Amount" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="采购金额" ColumnID="" DataField="PurCost" DataFormatString = "{0:F}" />
<f:BoundField runat="server" HeaderText="成本金额" ColumnID="" DataField="StdCost" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税率" ColumnID="" DataField="Tax" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税额" ColumnID="" DataField="TaxAmount" DataFormatString = "{0:F}"/>
<%-- <f:BoundField runat="server" HeaderText="开票金额" ColumnID="" DataField="Total" />--%>
<f:TemplateField HeaderText="税后金额" Width="70px" ColumnID="Total">
<ItemTemplate>
<asp:label ID="Total1" runat="server" Width="60px" Text='<%# Eval("Total") %>' ></asp:label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField runat="server" HeaderText="折扣金额" ColumnID="" DataField="DiscountPrice" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="索赔金额" ColumnID="" DataField="ContractPrice" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="调整税额" ColumnID="" DataField="BlancePrice" DataFormatString = "{0:F}"/>
<%--<f:BoundField runat="server" HeaderText="创建时间" ColumnID="" DataField="CreateTime" />--%>
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="发票编辑" Target="Parent" EnableIFrame="true" OnClose="Window1_Close"
IFrameUrl="about:blank" Height="550px" Width="1024px">
</f:Window>
<f:Window ID="Window2" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="300px" Width="400px">
</f:Window>
<f:Window ID="WindowUpload" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px" OnClose="WindowUpload_Close" >
</f:Window>
<script type="text/javascript">
</script>
</form>
</body>
</html>

225
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs

@ -0,0 +1,225 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Data;
using System.Drawing;
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE :PageBase
{
public void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
TranslatorAgents(Toolbar1);
TranslatorAgent(Grid_V_TB_INVOICE);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgents(FormRow_4);
BindInvoice();
BindVender(DDL_VEND_LIST);
}
}
public void IsRoleRight()
{
if (CurrentUser.RoleList.Contains("采购人员"))
{
DDL_VEND_LIST.Hidden = false;
BTN_INV.Hidden = false;
}
}
public void BindInvoice()
{
SearchInvoice(ret => {
Grid_V_TB_INVOICE.RecordCount = ret.Count();
ret = SortAndPage(ret, Grid_V_TB_INVOICE);
var _ls=ret.ToList();
Grid_V_TB_INVOICE.DataSource = ret;
Grid_V_TB_INVOICE.DataBind();
});
}
public void SearchInvoice(Action<IQueryable<V_TB_INVOICE>> p_action)
{
V_TB_INVOICE _entity = new V_TB_INVOICE();
_entity.InvcBillNum = TXT_InvcBillNum.Text;
_entity.VendName = TXT_VendName.Text;
_entity.InvoiceNum = TXT_InvoiceNum.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
if (CurrentUser.RoleList.Contains("采购人员"))
{
if (string.IsNullOrEmpty(DDL_VEND_LIST.SelectedValue))
{
Alert.Show("选择开票的供应商,并点击确认!");
return;
}
var _venderId = DDL_VEND_LIST.SelectedValue;
_entity.VendId = _venderId;
}
else
{
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
_entity.VendId = CurrentUser.VenderList[0];
}
}
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
_entity.Site = CurrentUser.FactoryList[0];
}
if (string.IsNullOrEmpty(_entity.VendId))
{
return;
}
if (DP_CreateTime1.SelectedDate != null || DP_CreateTime2.SelectedDate != null || !string.IsNullOrEmpty(TXT_PO.Text) || !string.IsNullOrEmpty(TXT_ASN.Text))
{
_entity.InvoiceList = SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_BY_TIME(DP_CreateTime1.Text, DP_CreateTime2.Text, TXT_PO.Text, TXT_ASN.Text);
}
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
//if (_entity.InvoiceList == null || _entity.InvoiceList.Count == 0)
//{
// Alert.Show("未查询到符合条件的发票!");
//}
p_action(ret.Result);
}
});
}
protected void btnView_OnClick(object sender, EventArgs e)
{
if (Grid_V_TB_INVOICE.SelectedRowIndexArray.Length != 1)
{
Alert.Show("请选择一行要操作的记录!");
return;
}
string roleID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx?ID={0}", roleID);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
//显示面板
protected void btnShow_OnClick(object sender, EventArgs e)
{
gp1.Hidden = false;
}
//关闭面板
protected void OnClick(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void Grid_V_TB_INVOICE_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
{
BindInvoice();
}
protected void Grid_V_TB_INVOICE_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
//string roleID = GetSelectedDataKey(Grid1, 1);
//string url = String.Format("../SupplierData/InvoiceDetail.aspx?ID={0}", roleID);
//PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_INVOICE.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindInvoice();
}
protected void BTN_SEARCH_Click(object sender, EventArgs e)
{
BindInvoice();
}
//导出
protected void btnOutput_OnClick(object sender, EventArgs e)
{
//List<string> _ls = new List<string>();
//for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++)
//{
// object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i];
// _ls.Add(rowDataKeys[1] as string);
//}
//DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls);
//PageBase.DataSetToExcel(ds, "财务确认");
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0)
{
Alert.Show("请选择发票记录导出!");
}
List<string> _ls = new List<string>();
for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i];
_ls.Add(rowDataKeys[1] as string);
}
}
if (_ls.Count == 0)
{
Alert.Show("请选择记录导出!");
return;
}
DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls);
ds.Tables[1].Columns.Remove("成本价");
PageBase.DataSetToExcel(ds, "导出发票");
}
protected void Grid_V_TB_INVOICE_RowDataBound(object sender, GridRowEventArgs e)
{
int i = 0;
System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_V_TB_INVOICE.Rows[e.RowIndex].FindControl("Total1");
if (!string.IsNullOrEmpty(_label.Text))
{
try
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
i++;
}
}
catch
{ }
}
//if (i > 0)
//{
// Alert.Show("请尽快处理索赔和退货数据,如果不处理新建发票将")
//}
}
protected void BTN_INV_Click(object sender, EventArgs e)
{
BindInvoice();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
}
}
}

126
SCP/Views/沈阳金杯/WarehouseData/SCP_INVOICE_VIEW_RED.aspx.designer.cs → SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData {
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE_VIEW_RED {
public partial class SCP_INVOICE
{
/// <summary>
/// form1 控件。
@ -49,175 +51,193 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
protected global::FineUI.Button Button3;
/// <summary>
/// btnRefresh 控件。
/// btnView 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
protected global::FineUI.Button btnView;
/// <summary>
/// btnView 控件。
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnView;
protected global::FineUI.Button btnOutput;
/// <summary>
/// ToolbarSeparator2 控件。
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
protected global::FineUI.Button btnShow;
/// <summary>
/// btnOutput 控件。
/// DDL_VEND_LIST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
protected global::FineUI.DropDownList DDL_VEND_LIST;
/// <summary>
/// ToolbarFill1 控件。
/// BTN_INV 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarFill ToolbarFill1;
protected global::FineUI.Button BTN_INV;
/// <summary>
/// txtKeyword 控件。
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtKeyword;
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// btnSearch 控件。
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// ToolbarText1 控件。
/// ckb 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
protected global::FineUI.CheckBoxList ckb;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TXT_InvcBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvcBillNum;
/// <summary>
/// extForm1 控件。
/// TXT_VendName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// txtBillNo 控件。
/// TXT_InvoiceNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillNo;
protected global::FineUI.TextBox TXT_InvoiceNum;
/// <summary>
/// txtBillTime1 控件。
/// TXT_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker txtBillTime1;
protected global::FineUI.TextBox TXT_PO;
/// <summary>
/// txtBillTime2 控件。
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker txtBillTime2;
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// txtState 控件。
/// TXT_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList txtState;
protected global::FineUI.TextBox TXT_Site;
/// <summary>
/// txtSupplierCode 控件。
/// TXT_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtSupplierCode;
protected global::FineUI.TextBox TXT_ASN;
/// <summary>
/// txtInvoiceNumber 控件。
/// DP_CreateTime1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtInvoiceNumber;
protected global::FineUI.DatePicker DP_CreateTime1;
/// <summary>
/// btnQuery 控件。
/// DP_CreateTime2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnQuery;
protected global::FineUI.DatePicker DP_CreateTime2;
/// <summary>
/// Label4 控件。
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label4;
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// Label3 控件。
/// BTN_SEARCH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label3;
protected global::FineUI.Button BTN_SEARCH;
/// <summary>
/// Grid_V_TB_INVOICE 控件。
@ -229,22 +249,22 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
protected global::FineUI.Grid Grid_V_TB_INVOICE;
/// <summary>
/// ToolbarSeparator3 控件。
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText2 控件。
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText2;
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
@ -255,6 +275,15 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Total1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Total1;
/// <summary>
/// Window1 控件。
/// </summary>
@ -264,6 +293,15 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window2;
/// <summary>
/// WindowUpload 控件。
/// </summary>

103
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx

@ -0,0 +1,103 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_CREATE.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE_CREATE" %>
<!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:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="btnOk" runat="server" EnablePostBack="True" Text="确认创建发票" Icon="Add" OnClick="btnOk_OnClick">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:TextArea runat="server" Label="备注" Text="" MaxLength="100" AutoGrowHeight="True" ID="txtRemark"/>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_SCP_INVOICE_CREATE" runat="server"
ShowBorder ="true"
ShowHeader="true"
PageSize="1000"
BoxFlex="1"
CssClass="maingrid"
DataKeyNames="UID,RecvBillNum,PoLine,PartCode,Batch,Qty,DockCode,Remark,CreateTime,CreateUser,IsDeleted,GUID,AsnBillNum,Site,VendId,ShipTime,OperName,PartDesc1,State,PoBillNum,VendName,Site_Desc,PoUnit,LocUnit,Price,VendBatch,Currency,BillType_DESC,ErpRecvBillNum,PurCost,StdCost"
IsDatabasePaging="True"
AllowPaging="True"
SortDirection="DESC"
SortField="CreateTime"
EnableRowSelectEvent="True" AutoScroll="True" OnRowDataBound="Grid_SCP_INVOICE_CREATE_RowDataBound">
<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="10" Value="10" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="项目编码" ColumnID="" DataField="ProjectId" />
<f:BoundField runat="server" HeaderText="订单" ColumnID="" DataField="PoBillNum" />
<f:BoundField runat="server" HeaderText="订单行" ColumnID="" DataField="PoLine" />
<f:BoundField runat="server" HeaderText="WMS收货单" ColumnID="" DataField="RecvBillNum" />
<f:BoundField runat="server" HeaderText="ERP收货单" ColumnID="" DataField="ErpRecvBillNum" />
<f:BoundField runat="server" HeaderText="发货单" ColumnID="" DataField="AsnBillNum" />
<f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="零件名称" ColumnID="" DataField="PartDesc1" />
<f:BoundField runat="server" HeaderText="币种" ColumnID="" DataField="Currency" />
<f:TemplateField Width="90px" HeaderText="单价">
<ItemTemplate>
<asp:TextBox ID="txtPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("Price") %>' MaxLength="12" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="可用开票数量" Width="70px" ColumnID="Total">
<ItemTemplate>
<asp:label ID="Total1" runat="server" Width="60px" Text='<%# Eval("CanQty") %>' ></asp:label>
</ItemTemplate>
</f:TemplateField>
<%--<f:BoundField runat="server" HeaderText="可用开票数量" ColumnID="CanQty" DataField="CanQty" />--%>
<f:TemplateField Width="90px" HeaderText="开票数量">
<ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Width="80px" onkeyup="this.value=this.value.replace(/,'')" onafterpaste="this.value=this.value.replace(/-?\D/g,'')"
MaxLength="12" Text='<%# Eval("InputQty") %>' ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField runat="server" HeaderText="合同价格" ColumnID="" DataField="ContractPrice" Hidden="true" />
<f:BoundField runat="server" HeaderText="合同差额" ColumnID="" DataField="BlancePrice" Hidden="true" />
<f:BoundField runat="server" HeaderText="要货日期" ColumnID="" DataField="BeginTime" Hidden="true" />
<f:TemplateField Width="100px" HeaderText="备注">
<ItemTemplate>
<asp:TextBox ID="txtLineMemo" runat="server" Width="100px"
Text='' MaxLength="50"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

416
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs

@ -0,0 +1,416 @@
using System;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Controller;
using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
using NPOI.OpenXmlFormats.Dml;
using SCP.Code;
using SCP.WarehouseData;
using System.Drawing;
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE_CREATE : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid_SCP_INVOICE_CREATE);
TranslatorAgents(FormRow_1);
LoadData();
SetRoleRule();
}
}
public void IsRoleRight()
{
//if (!CurrentUser.RoleList.Contains("供应商"))
//{
// Alert.Show("当前用户角色不能操作该模块!");
// return;
//}
//if (CurrentUser.VenderList == null || CurrentUser.VenderList.Count == 0)
//{
// Alert.Show("当前用户未选择地点!");
// return;
//}
}
private void SetRoleRule()
{
//IsPriceVisible(Grid_SCP_INVOICE_CREATE, "合同价格");
//IsPriceVisible(Grid_SCP_INVOICE_CREATE, "合同差额");
IsPriceVisible(Grid_SCP_INVOICE_CREATE, "要货日期");
}
public void LoadData()
{
BindData();
}
private void SearchData(Action<IQueryable<V_TB_RECEIVE_LIST>> p_action)
{
V_TB_RECEIVE_LIST _entity = new V_TB_RECEIVE_LIST();
if (Session["InvoiceCreateQueryParm"] != null)
{
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm;
if (string.IsNullOrEmpty(parm.ReceiveID))
{ Alert.Show("参数不正确!"); return; }
var ary = parm.ReceiveID.Split(',');
if (ary != null && ary.Length > 0)
{
_entity.UIDList = new List<long>();
foreach (var itm in ary)
{
_entity.UIDList.Add(long.Parse(itm));
}
_entity.State = 1;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
p_action(ret.Result);
}
});
}
}
else
{
Alert.Show("操作超时!");
}
}
public void BindData()
{
SearchData(q =>
{
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm;
Grid_SCP_INVOICE_CREATE.RecordCount = q.Count();
q = SortAndPage<V_TB_RECEIVE_LIST>(q, Grid_SCP_INVOICE_CREATE);
// List<V_TB_RECEIVE_LIST> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST(q.ToList());
List<V_TB_RECEIVE_LIST> temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(q.ToList());
foreach (V_TB_RECEIVE_LIST rec in temp)
{
rec.Qty = ToDecimal(rec.Qty, 2);
rec.CanQty = ToDecimal(rec.CanQty, 2);
}
string _vendId = string.Empty;
if (CurrentUser.RoleList.Contains("采购人员"))
{
_vendId = parm.VendId;
}
else
{
_vendId = CurrentUser.VenderList[0];
}
//SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_PRICE(_vendId, temp, (rs) =>
//{
// if (rs.State == ReturnStatus.Succeed)
// {
// temp.ForEach(itm =>
// {
// var _entityList = rs.Result.ToList().Where(p => p.PartCode == itm.PartCode && itm.CreateTime >= p.StartTime && itm.CreateTime <= p.EndTime).ToList();
// if (_entityList.Count > 0)
// {
// var _max = _entityList.Select(p => p.UID).Max();
// var _entity = _entityList.Where(p => p.UID == _max).FirstOrDefault();
// if (itm.ModType == (int)BillModType.Contract)
// {
// if (CurrentUser.FactoryList.FirstOrDefault() == "CNS")
// {
// itm.Price = _entity.Amt;
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// });
// }
//});
var _isall=parm.IsAll;
if(_isall=="0")
{
temp.ForEach(p => {
p.InputQty =0;
if (p.CanQty < 0)
{
p.InputQty = p.CanQty;
}
});
}
else
{
temp.ForEach(p => { p.InputQty = p.CanQty; });
}
Grid_SCP_INVOICE_CREATE.DataSource = temp;
Grid_SCP_INVOICE_CREATE.DataBind();
});
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
return tempOdds;
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_SCP_INVOICE_CREATE.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
//确认创建发票
protected void btnOk_OnClick(object sender, EventArgs e)
{
if (Session["InvoiceCreateQueryParm"] != null)
{
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm;
V_TB_INVOICE invoice = new V_TB_INVOICE();
invoice.InvcBillNum = SCP_BILLCODE_CONTROLLER.MakeInvoiceCode();
invoice.CreateTime = DateTime.Now;
invoice.InvoiceNum = "";
invoice.Remark = txtRemark.Text;
invoice.CreateUser = CurrentUser.Name;
string _VendId = parm.VendId;
string _tax = parm.Tax;
invoice.VendId = _VendId;
invoice.State = (int)InvoiceState.New;
invoice.Tax = decimal.Parse(_tax);
string _cj = parm.CJ;
string _tz = parm.TZ;
invoice.BlancePrice = decimal.Parse(_tz);
invoice.ContractPrice = decimal.Parse(_cj);
int num = 0;
List<V_TB_RECEIVE_LIST> _list = new List<V_TB_RECEIVE_LIST>();
for (int i = 0; i < Grid_SCP_INVOICE_CREATE.Rows.Count; i++)
{
object[] rowDataKeys = Grid_SCP_INVOICE_CREATE.DataKeys[i];
string uid = rowDataKeys[0].ToString();
var _entity = new V_TB_RECEIVE_LIST();
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.RecvBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.Batch = rowDataKeys[4] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[5]);
_entity.DockCode = rowDataKeys[6] as string;
_entity.Remark = rowDataKeys[7] as string;
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[8]);
_entity.CreateUser = rowDataKeys[9] as string;
if (string.IsNullOrEmpty(_entity.CreateUser))
{
_entity.CreateUser = CurrentUser.Name;
}
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[10]);
_entity.AsnBillNum = rowDataKeys[12] as string;
_entity.Site = rowDataKeys[13] as string;
invoice.Site = rowDataKeys[13] as string;
_entity.VendId = rowDataKeys[14] as string;
_entity.ShipTime = ConvertHelper.To<DateTime?>(rowDataKeys[15]);
_entity.OperName = rowDataKeys[16] as string;
_entity.PartDesc1 = rowDataKeys[17] as string;
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[18]);
_entity.PoBillNum = rowDataKeys[19] as string;
_entity.VendName = rowDataKeys[20] as string;
_entity.Site_Desc = rowDataKeys[21] as string;
_entity.PoUnit = rowDataKeys[22] as string;
_entity.LocUnit = rowDataKeys[23] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[24]);
_entity.VendBatch = rowDataKeys[25] as string;
_entity.Currency = rowDataKeys[26] as string;
_entity.BillType_DESC = rowDataKeys[27] as string;
_entity.ErpRecvBillNum= rowDataKeys[28] as string;
System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_SCP_INVOICE_CREATE.Rows[i].FindControl("Total1");
_entity.CanQty = ConvertHelper.To<Decimal>(_label.Text);//ConvertHelper.To < Int32 >(rowDataKeys[2]);
GridRow row = Grid_SCP_INVOICE_CREATE.Rows[i];
System.Web.UI.WebControls.TextBox txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
System.Web.UI.WebControls.TextBox txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice");
System.Web.UI.WebControls.TextBox txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
decimal Qty = 0;
try
{
if (txtQty.Text.Trim() != "")
{
Qty = Convert.ToDecimal(txtQty.Text.Trim());
}
}
catch
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("开票数量输入不正确"));
return;
}
decimal Price = 0;
try
{
if (txtPrice.Text.Trim() != "")
{
Price = Convert.ToDecimal(txtPrice.Text.Trim());
}
}
catch
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("单价输入不正确"));
return;
}
if (Qty == 0)
{
continue;
}
if (Qty > _entity.CanQty)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("开票数量不能大于可用开票数量"));
return;
}
_entity.Qty = Qty;
_entity.Price = Price;
_entity.Remark = txtLineMemo.Text;
_list.Add(_entity);
num++;
}
if (num == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有可用的开票记录"));
return;
}
int _number = 0;
_list.ForEach(p =>
{
if (p.Qty > 0)
{
_number++;
}
});
if (_number == _list.Count)
{
string _modify = parm.Modify;
if (_modify == "1")
{
Alert.Show("有退货单未处理!");
return;
}
}
var ret = SCP_INVOICE_CONTROLLER.CREATE_TB_INVOICE(invoice, _list);
if (ret.State == ReturnStatus.Succeed)
{
string script = $"alert(\'发票 {invoice.InvcBillNum} 生成成功\');";
script += ActiveWindow.GetHidePostBackReference();
PageContext.RegisterStartupScript(script);
}
}
else
{
Alert.Show("操作超时");
}
}
protected void Grid_SCP_INVOICE_CREATE_RowDataBound(object sender, GridRowEventArgs e)
{
object[] rowDataKeys = Grid_SCP_INVOICE_CREATE.DataKeys[e.RowIndex];
System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_SCP_INVOICE_CREATE.Rows[e.RowIndex].FindControl("Total1");
var _number = ConvertHelper.To<Decimal>(_label.Text);
if (_number<= 0)
{
GridRow row = Grid_SCP_INVOICE_CREATE.Rows[e.RowIndex];
System.Web.UI.WebControls.TextBox txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
txtQty.ReadOnly = true;
txtQty.Enabled = false;
if (_number < 0)
{
if (!string.IsNullOrEmpty(_label.Text))
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
}
}
}
}
}
private decimal? GetTax()
{
decimal? strTax = null;
string name = GetIdentityName();
User modelUsers = DB.Users.SingleOrDefault(p => p.Name == name);
VenderUsers vu = null;
TA_VENDER tv = null;
if (modelUsers != null)
{
vu = DB.VenderUsers.SingleOrDefault(p => p.UserId == modelUsers.ID);
if (vu != null)
{
tv = SCPDB.TA_VENDER.SingleOrDefault(p => p.VendId == vu.VenderId);
if (tv != null)
{
strTax = tv.Tax;
}
}
//_info.SupplierCode = vu.VenderId;
}
Session["InvoiceCreateQueryParm"] = null;
return strTax;
}
}
}

143
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs

@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE_CREATE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// btnOk 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOk;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextArea txtRemark;
/// <summary>
/// Grid_SCP_INVOICE_CREATE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_SCP_INVOICE_CREATE;
/// <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;
/// <summary>
/// txtPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPrice;
/// <summary>
/// Total1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Total1;
/// <summary>
/// txtQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtQty;
/// <summary>
/// txtLineMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLineMemo;
}
}

152
SCP/Views/沈阳金杯/WarehouseData/SCP_INVOICE_DELTAIL_RED.aspx → SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx

@ -1,28 +1,46 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_DELTAIL_RED.aspx.cs" Inherits="SCP.Views.沈阳金杯.WarehouseData.SCP_INVOICE_DELTAIL_RED" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_EDIT.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE_EDIT" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="btnNewRed" runat="server" Text="确定创建" Hidden="true" OnClientClick="if(!confirm('是否要创建红字发票?'))return false;" Icon="ApplicationEdit" OnClick="btnNewRed_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form runat="server" Title="">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnOK" runat="server" Text="修改数据" Hidden="true" OnClientClick="if(!confirm('是否要修改发票?'))return false;" Icon="ApplicationEdit" OnClick="btnOK_Click">
</f:Button>
<f:Button ID="btnApply" runat="server" Text="提交申请" Hidden="true" OnClientClick="if(!confirm('是否要提交申请?'))return false;" Icon="Accept" OnClick="btnApply_Click">
</f:Button>
<f:Button ID="btnMail" runat="server" Text="寄出发票" Hidden="true" OnClientClick="if(!confirm('是否寄出发票?寄出前请检查发票时间和纸质发票时间是否一致!'))return false;" Icon="Mail" OnClick="btnMail_Click" ValidateForms="extForm1">
</f:Button>
<f:Button ID="btnReject" runat="server" Text="发票作废" Hidden="true" OnClientClick="if(!confirm('是否要作废收票?'))return false;" Icon="Exclamation" OnClick="btnReject_Click">
</f:Button>
<f:Button ID="btnRed" runat="server" Hidden="true" Text="添加红字发票" OnClientClick="if(!confirm('是否要添加红字发票?'))return false;" Icon="Exclamation" OnClick="btnRed_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Layout="HBox" >
<Items>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%">
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%" ID="FormRow_1">
<Items>
<f:TextBox ID="txtBillNo" runat="server" Label="发票单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
@ -33,88 +51,91 @@
<f:Label runat="server" ID="Label3" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%">
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%" ID="FormRow_2">
<Items>
<f:TextBox ID="txtAmount" runat="server" Label="金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtTax" runat="server" Label="税率" Text="" MaxLength="100" Readonly="true" Enabled="false">
<f:TextBox ID="txtAmount" runat="server" Label="金额" Text="" Readonly="true" Enabled="false" />
<f:Label runat="server" ID="Label1" Text="税率" /><f:DropDownList runat="server" Label="税率" ID="txtTax" AutoPostBack="true" >
<f:ListItem Text="0.16" Value="0.16" />
<f:ListItem Text="0.13" Value="0.13" />
<f:ListItem Text="0" Value="0" />
</f:DropDownList>
<f:TextBox ID="txtTaxAmount" runat="server" Label="税额" Text="" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtTaxAmount" runat="server" Label="税额" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtTotal" runat="server" Label="开票金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:Label runat="server" ID="Label2" />
<f:TextBox ID="txtTotal" runat="server" Label="税后金额" Text="" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%">
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%" ID="FormRow_3">
<Items>
<f:TextBox ID="txtInvoiceNumber" runat="server" Label="金税票号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtExpressNumber" runat="server" Label="快递单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
<f:NumberBox ID="txtContractPrice1" runat="server" Label="索赔金额" Readonly="true"/>
<f:NumberBox ID="txtDiscountPrice" runat="server" Label="折扣金额" />
<f:NumberBox ID="txtBlancePrice1" runat="server" Label="调整税额" MaxValue="1" />
<f:TextBox ID="txtInvoiceNumber" runat="server" Label="金税票号" Text="" MaxLength="22" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtContractPrice1" runat="server" Label="合同价格" Text="0" MaxLength="100" Readonly="true" Enabled="false"/>
<f:TextBox ID="txtBlancePrice1" runat="server" Label="合同差额" Text="0" MaxLength="100" Readonly="true" Enabled="false"/>
<f:Label runat="server" ID="Label1" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%">
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%" ID="FormRow_4">
<Items>
<f:TextBox ID="txtMemo" runat="server" Label="备注" Text="" MaxLength="100" Readonly="true" Enabled="false">
<f:TextBox ID="txtExpressNumber" runat="server" Label="快递单号" Text="" MaxLength="100" Readonly="true">
</f:TextBox>
<f:DatePicker runat="server" ID ="dpUpdateTime" Label="发票时间"></f:DatePicker>
<f:TextBox ID="txtMemo" runat="server" Label="备注" Text="" MaxLength="100">
</f:TextBox>
<f:TextBox ID="txtDiscountPrice1" runat="server" Label="折扣价格" Text="0" MaxLength="100" Readonly="true" Enabled="false"/>
<f:TextBox ID="txtDiscountRemark1" runat="server" Label="折扣备注" Text="0" MaxLength="100" Readonly="true" Enabled="false"/>
<f:Label runat="server" ID="l3" />
<f:Label runat="server" ID="l4" />
<f:Label runat="server" ID="l1" />
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="10" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,InvcBillNum,Qty,CanQty,State,Site,InvoiceNum,ExpressNum,VendId,Tax,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,AsnBillNum,Batch,BeginTime,Currency,CurrencyDesc,DiscountPrice,DiscountRemark,PackQty,PartCode,PartDesc1,PoBillNum,PoLineNum,PoUnit,ProduceDate,RecvBillNum,VendBatch,GUID,Price,ContractPrice,BlancePrice" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True" SortField="CreateTime">
</f:GroupPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="500" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,InvcBillNum,Qty,CanQty,State" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoBillNum" OnRowDataBound="Grid1_RowDataBound">
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="ProjectId" DataField="ProjectId" HeaderText="项目编号" ColumnID="ProjectId" Width="100px" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单" ColumnID="Line" Width="100px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="ProductCode" Width="80px" />
<%-- <f:BoundField SortField="ProductName" DataField="AsnBillNum" HeaderText="收货单" ColumnID="ProductName" Width="100px" />--%>
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单" ColumnID="UnitCode" Width="120px" />
<%--<f:BoundField SortField="ProductName" DataField="AsnBillNum" HeaderText="收货单" ColumnID="ProductName" Width="100px" />--%>
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单" ColumnID="UnitCode" Width="120px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PackageQty" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="300px" />
<f:BoundField SortField="Currency" DataField="Currency" HeaderText="币种" ColumnID="Price" Width="80px" />
<f:TemplateField Width="90px" HeaderText="单价">
<ItemTemplate>
<asp:TextBox ID="txtPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("Price") %>' MaxLength="12" Enabled="false" ></asp:TextBox>
Text='<%# Eval("Price") %>' MaxLength="12" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="合同价格" Width="90px" Hidden="true">
<ItemTemplate>
<asp:TextBox ID="txtContractPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("ContractPrice") %>' MaxLength="12" Enabled="false"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="合同差额" Width="90px" Hidden="true">
<ItemTemplate>
<asp:TextBox ID="txtBlancePrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("BlancePrice") %>' MaxLength="12" Enabled="false"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField SortField="BeginTime" runat="server" HeaderText="要货日期" Hidden="true" ColumnID="" DataField="BeginTime" />
<f:BoundField SortField="DiscountPrice" runat="server" HeaderText="折扣价格" ColumnID="" DataField="DiscountPrice" />
<f:BoundField SortField="DiscountRemark" runat="server" HeaderText="折扣备注" ColumnID="" DataField="DiscountRemark" />
<%--<f:BoundField SortField="Qty" DataField="Qty" HeaderText="开票数量" ColumnID="OpenQty" Width="80px" />--%>
<f:BoundField SortField="PurCost" runat="server" HeaderText="采购价格" ColumnID="" DataField="PurCost" />
<f:BoundField SortField="UpdateTime" runat="server" HeaderText="收货日期" ColumnID="" DataField="UpdateTime" />
<f:BoundField SortField="CanQty" DataField="CanQty" HeaderText="可开票数量" ColumnID="OpenQty" Width="80px" />
<f:TemplateField HeaderText="开票数量" Width="90px">
<ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Width="80px" onkeyup="JHshNumberText(this)" onafterpaste="JHshNumberText(this)"
<asp:TextBox ID="txtQty" runat="server" Width="80px"
Text='<%# Eval("Qty") %>' MaxLength="12"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="备注" Width="100px">
<f:TemplateField HeaderText="备注" Width="100px">
<ItemTemplate>
<asp:TextBox ID="txtLineMemo" runat="server" Width="300px"
Text='<%# Eval("Remark") %>' MaxLength="200" Enabled="false"></asp:TextBox>
Text='<%# Eval("Remark") %>' MaxLength="200" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:Grid>
</Items>
@ -127,20 +148,5 @@
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form>
<script type="text/javascript">
function JHshNumberText(a)
{
var fa="-";
if(a.value.substring(0,1)=="-")
fa="-";
var str=(a.value.replace(/[^0-9.]/g,'')).replace(/[.][0-9]*[.]/, '.');
if (str.substring(0,1)==".")
str="0"+str;
a.value=fa+str;
}
</script>
</body>
</html>

560
SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.cs

@ -0,0 +1,560 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Common;
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
using System.Drawing;
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE_EDIT : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid1);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgents(FormRow_4);
BindData();
GetInvoice();
SetRoleRule();
}
}
public void IsRoleRight()
{
//if (!CurrentUser.RoleList.Contains("供应商"))
//{
// Alert.Show("当前用户角色不能操作该模块!");
// return;
//}
//if (CurrentUser.VenderList == null || CurrentUser.VenderList.Count == 0)
//{
// Alert.Show("当前用户未选择地点!");
// return;
//}
}
private void SetRoleRule()
{
//IsPriceVisible(Grid1, "合同价格");
//IsPriceVisible(Grid1, "合同差额");
IsPriceVisible(Grid1, "要货日期");
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
//if (tempOdds > num)
//{
// num = (decimal)((double)(tempOdds - (decimal)Math.Pow(10, -scale)));
//}
//else
//{
// num = (decimal)((double)tempOdds);
//}
//return num;
return tempOdds;
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{
string id = GetQueryValue("ID");
V_TB_INVOICE_DETAIL _tb = new V_TB_INVOICE_DETAIL();
_tb.InvcBillNum = id;
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_DETAIL_List(_tb, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
p_list(ret.Result);
}
});
}
public void BindData()
{
Search(ret =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage(ret, Grid1);
//Grid1.DataSource =SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
List<V_TB_INVOICE_DETAIL> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp);
//decimal htjgSum = 0;//合同总价
//decimal htceSum = 0;//合同差额
//foreach (V_TB_INVOICE_DETAIL rec in temp)
//{
// rec.Qty = ToDecimal(rec.Qty, 2);
// rec.CanQty = ToDecimal(rec.CanQty, 2);
// htjgSum += rec.Qty * (rec.ContractPrice == null ? 0 : Convert.ToDecimal(rec.ContractPrice));//开票数量*合同价格
// htceSum += rec.Qty * (rec.BlancePrice == null ? 0 : Convert.ToDecimal(rec.BlancePrice));//开票数量*合同差额
//}
//txtContractPrice1.Text = htjgSum.ToString();
//txtBlancePrice1.Text = htceSum.ToString();
GetInvoice();
Grid1.DataSource = temp;
Grid1.DataBind();
});
}
private void GetInvoice()
{
string id = GetQueryValue("ID");
string vendid = "";
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
vendid = CurrentUser.VenderList[0];
}
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(new V_TB_INVOICE { InvcBillNum = id, VendId = vendid }, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
var _ls = ret.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _Model = _ls[0];
Session["Invoice"] = _Model;
txtState.Text = _Model.State_DESC;
txtBillNo.Text = _Model.InvcBillNum;
txtBillTime.Text = Convert.ToDateTime(_Model.CreateTime).ToString("yyyy-MM-dd");
txtSupplierName.Text = _Model.VendName;
txtInvoiceNumber.Text = _Model.InvoiceNum;
txtExpressNumber.Text = _Model.ExpressNum;
dpUpdateTime.SelectedDate = _Model.UpdateTime;
txtTax.SelectedValue = _Model.Tax != null ? _Model.Tax.Value.ToString() : "0";
txtTaxAmount.Text = _Model.TaxAmount!=null?_Model.TaxAmount.Value.ToString():"0";
txtDiscountPrice.Text = _Model.DiscountPrice != null ? _Model.DiscountPrice.Value.ToString() : "0";
//if (_Model.State != (int)InvoiceState.New)
//{
txtContractPrice1.Text = _Model.ContractPrice != null ? _Model.ContractPrice.ToString() : string.Empty;
txtBlancePrice1.Text = _Model.BlancePrice != null ? _Model.BlancePrice.ToString() : string.Empty;
//}
txtAmount.Text = _Model.Amount.ToString();
txtTotal.Text = _Model.Total != null ? _Model.Total.ToString() : string.Empty;
txtMemo.Text = _Model.Remark;
if (_Model.State == (int)InvoiceState.New || _Model.State == (int)InvoiceState.CheckFail)
{
this.btnOK.Hidden = false;
this.btnApply.Hidden = false;
this.btnReject.Hidden = false;
}
if (_Model.State == (int)InvoiceState.Reject)
{
this.btnReject.Hidden = true;
this.btnOK.Hidden = false;
}
//提交之后不能作废
if (_Model.State == (int)InvoiceState.New)
{
this.btnOK.Hidden = false;
this.btnReject.Hidden = false;
}
if (_Model.State == (int)InvoiceState.Apply)
{
this.btnOK.Hidden = false;
this.btnApply.Hidden = true;//提交申请
this.btnReject.Hidden = true;//发票作废
this.btnMail.Hidden = true;//寄出发票
}
if (_Model.State == (int)InvoiceState.Mail)
{
this.btnOK.Hidden = true;//确定修改
this.btnApply.Hidden = true;//提交申请
this.btnReject.Hidden = true;//发票作废
this.btnMail.Hidden = true;//寄出发票
txtInvoiceNumber.Readonly = true;
txtInvoiceNumber.Required = false;
txtExpressNumber.Readonly = true;
txtExpressNumber.Required = false;
txtContractPrice1.Readonly = true;
txtContractPrice1.Required = false;
txtBlancePrice1.Readonly = true;
txtBlancePrice1.Required = false;
}
if ( _Model.State == (int)InvoiceState.FinanceFail || _Model.State == (int)InvoiceState.CheckSuccess )
{
txtInvoiceNumber.Readonly = false;
txtInvoiceNumber.Required = true;
txtExpressNumber.Readonly = false;
txtContractPrice1.Readonly = false;
txtContractPrice1.Required = false;
txtBlancePrice1.Readonly = true;
txtBlancePrice1.Required = false;
this.btnMail.Hidden = false;
this.btnReject.Hidden = false;
this.btnOK.Hidden = false;
txtContractPrice1.Readonly = true;
txtContractPrice1.Required = false;
txtContractPrice1.Enabled = false;
txtBlancePrice1.Readonly = false;
}
if (_Model.State ==(int) InvoiceState.CheckSuccess)
{
this.btnOK.Hidden = true;
txtMemo.Enabled = false;
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
var txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice");
var txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
txtPrice.ReadOnly = true;
txtPrice.Enabled = false;
txtQty.ReadOnly = true;
txtQty.Enabled = false;
txtLineMemo.ReadOnly = true;
txtLineMemo.Enabled = false;
}
}
}
}
});
}
protected void btnOK_Click(object sender, EventArgs e)
{
var _invoice = Session["Invoice"] as V_TB_INVOICE;
string InvoiceNumber = MyWebString.GetString(this.txtInvoiceNumber.Text.Trim());
string Memo = MyWebString.GetString(this.txtMemo.Text.Trim());
string ExpressNumber = MyWebString.GetString(this.txtExpressNumber.Text.Trim());
string ContractPrice1 = MyWebString.GetString(this.txtContractPrice1.Text.Trim());//合同价格
string BlancePrice1 = MyWebString.GetString(this.txtBlancePrice1.Text.Trim());//合同差额
string DiscountPrice1 = MyWebString.GetString(this.txtDiscountPrice.Text.Trim());
//if (_invoice.State != (int)InvoiceState.New &&
// _invoice.State != (int)InvoiceState.CheckFail)
//{
// Alert.Show(_invoice.InvcBillNum + " 不允许修改,只有状态为 " + "新建" + " 或 " +
// "采购退回" + " 才能修改");
// return;
//}
if (!string.IsNullOrEmpty(txtTax.SelectedValue))
{
_invoice.Tax = decimal.Parse(txtTax.SelectedValue);
}
_invoice.InvoiceNum = InvoiceNumber;
_invoice.Remark = Memo;
_invoice.ExpressNum = ExpressNumber;
//_invoice.UpdateTime = dpUpdateTime.SelectedDate.Value;
//_invoice.State = (int)InvoiceState.Apply;
if (string.IsNullOrEmpty(ContractPrice1))
{
_invoice.ContractPrice = 0;
}
if (string.IsNullOrEmpty(BlancePrice1))
{
_invoice.BlancePrice = 0;
}
if (string.IsNullOrEmpty(DiscountPrice1))
{
_invoice.DiscountPrice = 0;
}
if (_invoice.State == (int)InvoiceState.CheckSuccess)
{
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("发票时间必须填写,时间为纸质发票开票时间");
return;
}
else
{
_invoice.UpdateTime = dpUpdateTime.SelectedDate.Value;
}
}
decimal c1;
decimal b1;
decimal d1;
if (decimal.TryParse(ContractPrice1, out c1))
{
_invoice.ContractPrice = c1;
}
//else
//{
// Alert.Show("折扣金额请填写数字!");
// return;
//}
if (decimal.TryParse(BlancePrice1, out b1))
{
_invoice.BlancePrice = b1;
}
if (decimal.TryParse(DiscountPrice1, out d1))
{
_invoice.DiscountPrice = d1;
}
//else
//{
// Alert.Show("调整请填写数字!");
// return;
//}
List<V_TB_INVOICE_DETAIL> _ls = new List<V_TB_INVOICE_DETAIL>();
if (this.txtQty.ReadOnly == false)
{
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
V_TB_INVOICE_DETAIL _entity = new V_TB_INVOICE_DETAIL();
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.InvcBillNum = rowDataKeys[1] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[2]);
_entity.CanQty = ConvertHelper.To<Decimal>(rowDataKeys[3]);
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[4]);
var txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
var txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice");
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
//var txtContractPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtContractPrice");
//var txtBlancePrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBlancePrice");
decimal QtyNew = 0;
try
{
if (txtQty.Text.Trim() != "")
{
QtyNew = Convert.ToDecimal(txtQty.Text.Trim());
}
}
catch
{
Alert.Show("开票数量输入不正确");
return;
}
if (QtyNew > _entity.CanQty + _entity.Qty)
{
Alert.Show("开票数量不能大于可用开数票");
return;
}
decimal PriceNew = 0;
try
{
if (txtPrice.Text.Trim() != "")
{
PriceNew = Convert.ToDecimal(txtPrice.Text.Trim());
}
}
catch
{
Alert.Show("单价输入不正确");
return;
}
_entity.Remark = txtLineMemo.Text;
_entity.Price = PriceNew;
_entity.Qty = QtyNew;
_ls.Add(_entity);
}
}
// SCPDB.Database.SqlQuery<V_TB_INVOICE>("select * from V_TB_INVOICE WHERE STATE==0 AND ").ToArray
if (_ls.Count > 0)
{
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_APPLY(_invoice,_ls);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("发票明细修改成功!");
BindData();
}
}
else
{
Alert.Show("更改记录数为零");
}
}
private void SET_INVOICE_STATE(string p_msg, InvoiceState p_state)
{
if (Session["Invoice"] != null)
{
var _Invoice = Session["Invoice"] as V_TB_INVOICE;
string InvoiceNumber = MyWebString.GetString(this.txtInvoiceNumber.Text.Trim());//金税票号
string ExpressNumber = MyWebString.GetString(this.txtExpressNumber.Text.Trim());//快递单号
string ContractPrice1 = MyWebString.GetString(this.txtContractPrice1.Text.Trim());//合同价格
string BlancePrice1 = MyWebString.GetString(this.txtBlancePrice1.Text.Trim());//合同差额
string DiscountPrice1 = MyWebString.GetString(this.txtDiscountPrice.Text.Trim());
_Invoice.InvoiceNum = InvoiceNumber;
_Invoice.ExpressNum = ExpressNumber;
_Invoice.UpdateTime = dpUpdateTime.SelectedDate;
if (string.IsNullOrEmpty(ContractPrice1))
{
_Invoice.ContractPrice = 0;
}
if (string.IsNullOrEmpty(BlancePrice1))
{
_Invoice.BlancePrice = 0;
}
decimal c1;
decimal b1;
decimal d1;
if (decimal.TryParse(ContractPrice1, out c1))
{
_Invoice.ContractPrice = c1;
}
else
{
_Invoice.ContractPrice = 0;
}
if (decimal.TryParse(BlancePrice1, out b1))
{
_Invoice.BlancePrice = b1;
}
else
{
_Invoice.BlancePrice = 0;
}
if (decimal.TryParse(DiscountPrice1, out d1))
{
_Invoice.DiscountPrice = d1;
}
else
{
_Invoice.DiscountPrice = 0;
}
if (p_state == InvoiceState.Mail)
{
if (string.IsNullOrEmpty(InvoiceNumber))
{
Alert.Show("请填写金税票号!");
return;
}
if (string.IsNullOrEmpty(ExpressNumber))
{
Alert.Show("请填写快递单号!");
return;
}
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("发票时间必须填写,时间为纸质发票开票时间");
return;
}
}
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_STATE(_Invoice, p_state,CurrentUser.ChineseName);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg);
BindData();
GetInvoice();
}
else
{
Alert.Show(ret.Message);
}
}
}
protected void btnApply_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票申请成功!", InvoiceState.Apply);
}
protected void btnMail_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票已经寄出!", InvoiceState.Mail);
}
protected void btnReject_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票已经作废!", InvoiceState.Reject);
}
protected void Window1_OnClose(object sender, WindowCloseEventArgs e)
{
//string id = GetQueryValue("ID");
//TB_INVOICE model = InvoiceController.GetDataByBillInvoiceBillNum(id);
//InvoiceController.UpdateDataRemark(e.CloseArgument, model);
}
protected void btnRed_Click(object sender, EventArgs e)
{
string id = GetQueryValue("ID");
V_TB_INVOICE _tb = new V_TB_INVOICE();
_tb.InvcBillNum = id;
var ret = SCP_INVOICE_CONTROLLER.Add_New_Red_Invoice(_tb);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
GetInvoice();
}
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
System.Web.UI.WebControls.TextBox _label = (System.Web.UI.WebControls.TextBox)Grid1.Rows[e.RowIndex].FindControl("txtQty");
if (!string.IsNullOrEmpty(_label.Text))
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
}
}
}
}
}

152
SCP/Views/沈阳金杯/WarehouseData/SCP_INVOICE_DELTAIL_RED.aspx.designer.cs → SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData {
namespace SCP.Views.SupplierData.SupplierFinance
{
public partial class SCP_INVOICE_DELTAIL_RED {
public partial class SCP_INVOICE_EDIT
{
/// <summary>
/// form1 控件。
@ -40,13 +42,76 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// btnNewRed 控件。
/// ToolbarSeparator3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnNewRed;
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
/// <summary>
/// btnOK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOK;
/// <summary>
/// btnApply 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnApply;
/// <summary>
/// btnMail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnMail;
/// <summary>
/// btnReject 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReject;
/// <summary>
/// btnRed 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRed;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// txtBillNo 控件。
@ -94,67 +159,67 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
protected global::FineUI.Label Label3;
/// <summary>
/// txtAmount 控件。
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAmount;
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// txtTax 控件。
/// txtAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTax;
protected global::FineUI.TextBox txtAmount;
/// <summary>
/// txtTaxAmount 控件。
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTaxAmount;
protected global::FineUI.Label Label1;
/// <summary>
/// txtTotal 控件。
/// txtTax 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTotal;
protected global::FineUI.DropDownList txtTax;
/// <summary>
/// Label2 控件。
/// txtTaxAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label2;
protected global::FineUI.TextBox txtTaxAmount;
/// <summary>
/// txtInvoiceNumber 控件。
/// txtTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtInvoiceNumber;
protected global::FineUI.TextBox txtTotal;
/// <summary>
/// txtExpressNumber 控件。
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExpressNumber;
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// txtContractPrice1 控件。
@ -163,106 +228,97 @@ namespace SCP.Views.沈阳金杯.WarehouseData {
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtContractPrice1;
/// <summary>
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBlancePrice1;
protected global::FineUI.NumberBox txtContractPrice1;
/// <summary>
/// Label1 控件。
/// txtDiscountPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label1;
protected global::FineUI.NumberBox txtDiscountPrice;
/// <summary>
/// txtMemo 控件。
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtMemo;
protected global::FineUI.NumberBox txtBlancePrice1;
/// <summary>
/// txtDiscountPrice1 控件。
/// txtInvoiceNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtDiscountPrice1;
protected global::FineUI.TextBox txtInvoiceNumber;
/// <summary>
/// txtDiscountRemark1 控件。
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtDiscountRemark1;
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// l3 控件。
/// txtExpressNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label l3;
protected global::FineUI.TextBox txtExpressNumber;
/// <summary>
/// l4 控件。
/// dpUpdateTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label l4;
protected global::FineUI.DatePicker dpUpdateTime;
/// <summary>
/// Grid1 控件。
/// txtMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
protected global::FineUI.TextBox txtMemo;
/// <summary>
/// txtPrice 控件。
/// l1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPrice;
protected global::FineUI.Label l1;
/// <summary>
/// txtContractPrice 控件。
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtContractPrice;
protected global::FineUI.Grid Grid1;
/// <summary>
/// txtBlancePrice 控件。
/// txtPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtBlancePrice;
protected global::System.Web.UI.WebControls.TextBox txtPrice;
/// <summary>
/// txtQty 控件。

250
SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx

@ -0,0 +1,250 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_RECEIVE_LIST.aspx.cs" Inherits="SCP.SupplierData.SupplierFinance.ReceiveList" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<%@ Import Namespace="CK.SCP.Utils" %>
<%@ Import Namespace="CK.SCP.Models.Enums" %>
<!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>
<style>
.totalpanel .x-panel-body {
border-top-width: 0 !important;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnCreate" runat="server" EnablePostBack="True" Text="生成发票" OnClick="btnCreate_OnClick" Icon="Add" Hidden="true">
</f:Button>
<f:Button ID="btnCreateAll" runat="server" EnablePostBack="True" Text="生成发票" Icon="Add" OnClick="btnCreateAll_Click" OnClientClick="if(!confirm('生成发票时请先处理退货数量,如发现收票时还有退货数量未处理,造成不能收票自行负责!'))return false;">
</f:Button>
<f:Button ID="btn" runat="server" EnablePostBack="True" Text="补开发票" Icon="Add" Hidden="true">
</f:Button>
<f:Button ID="Button2" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:Button ID="btnCanIn" runat="server" EnablePostBack="True" Text="只看可开票零件" Icon="Zoom" OnClick="btnCanIn_Click" Hidden="true">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="查询面板" Icon="Zoom" OnClick="btnShow_Click">
</f:Button>
<f:ToolbarFill runat="server" Hidden="true"/>
<f:TextBox ID="tb_RecvBillNum" runat="server" Label="单据号" Hidden="true"/>
<f:Button ID="btn_Search" runat="server" EnablePostBack="True" Text="快速查找" OnClick="btnSearch_Click" Hidden="true"></f:Button>
<f:DropDownList ID="DDL_VEND_LIST" DataValueField="VendId" DataTextField="VendName" runat="server" Label="供应商编码" EnableEdit="true" EnableMultiSelect="false" Hidden="true"/>
<f:Button ID="BTN_INV" runat="server" EnablePostBack="True" Text="确认" OnClick="BTN_INV_Click" Hidden="true" Icon="Accept" ></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="true" Layout="HBox" >
<Items>
<f:Form runat="server" >
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" />
<f:TextBox runat = "server" Label = "发货单号" EmptyText = "" ID = "TXT_ASNBill" />
<f:TextBox runat = "server" Label = "供应商名称" EmptyText = "" ID = "TXT_VendName" />
<f:TextBox runat = "server" Label = "供应商编号" EmptyText = "" ID = "TXT_VendId" />
<f:DropDownList runat="server" ID="DDL_State" Label="单据类型" Hidden="true">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="退货单" Value="退货单" />
<f:ListItem Text="收货单" Value="收货单" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox runat = "server" Label = "项目编号" EmptyText = "" ID = "TXT_ProjectId" />
<f:TextBox runat = "server" Label = "零件编号" EmptyText = "" ID = "TXT_PartCode" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="收货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" EmptyText="请选择日期" Label="至" ID="Date_EndDate" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:TextBox runat = "server" Label = "收(退)货单号" EmptyText = "" ID = "TXT_RECEIVE" />
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%" ID="FormRow1">
<Items>
<f:NumberBox ID="txtContractPrice1" runat="server" Label="折扣金额" Hidden="true" />
<f:NumberBox ID="txtBlancePrice1" runat="server" Label="调整税额" MaxValue="1" Hidden="true" />
<f:Label runat="server"></f:Label>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%" ID="FormRow2">
<Items>
<f:DropDownList runat="server" Label="供应商税率" ID="lbTaxRate" AutoPostBack="true" >
<f:ListItem Text="0.16" Value="0.16" />
<f:ListItem Text="0.13" Value="0.13" />
<f:ListItem Text="0" Value="0" />
</f:DropDownList>
<f:Button ID="btnTax" runat="server" Text="使用税率" OnClientClick="updateTotal();" Icon="Accept" ></f:Button>
<f:Label runat="server"></f:Label>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid ID="Grid_V_TB_RECEIVE_LIST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,ProjectId,RecvBillNum,PartCode,PoLine,Qty,Price" IsDatabasePaging="true" AllowPaging="True" SortField="RecvBillNum"
AutoScroll="True" OnPageIndexChange="Grid_V_TB_RECEIVE_LIST_PageIndexChange" EnableCheckBoxSelect = "true" OnRowDataBound="Grid_V_TB_RECEIVE_LIST_RowDataBound" >
<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_OnSelectedIndexChanged" runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<%-- <f:RowNumberField runat="server" ID="chb" HeaderText="行号" />--%>
<%-- <f:TemplateField HeaderText="否可开票" Width="120px" ColumnID="IsCheck">
<ItemTemplate>
<asp:Label runat="server" DataField="Qty" ID="Label1" Text='<%# Eval("IsCheck") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>--%>
<f:BoundField runat="server" HeaderText="项目编码" DataField="ProjectId" width="80"/>
<f:BoundField runat="server" HeaderText="单据类型" ColumnID="BillType_DESC" DataField="BillType_DESC" width="80"/>
<f:BoundField runat="server" HeaderText="ERP单据号" ColumnID="ErpRecvBillNum" DataField="ErpRecvBillNum" width="80" />
<f:BoundField runat="server" HeaderText="WMS单据号" ColumnID="RecvBillNum" DataField="RecvBillNum" width="80" />
<f:BoundField runat="server" HeaderText="发货单号" ColumnID="AsnBillNum" DataField="AsnBillNum" width="80"/>
<f:BoundField runat="server" HeaderText="供应商" ColumnID="VendName" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" DataField="VendId" width="80"/>
<f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" width="80"/>
<f:BoundField runat="server" HeaderText="订单行" ColumnID="" DataField="PoLine" width="50" />
<f:BoundField runat="server" HeaderText="单价" ColumnID="" DataField="Price" width="80"/>
<f:BoundField runat="server" HeaderText="采购价格" ColumnID="" DataField="PurPrice" width="80"/>
<f:TemplateField HeaderText="可开票数量" ColumnID="Qty" width="100">
<ItemTemplate>
<input type="hidden" class="price" runat="server" value='<%# Eval("Price") %>' />
<input type="hidden" class="number" runat="server" value='<%# Eval("CanQty") %>' />
<asp:Label runat="server" DataField="Qty" ID="Qty1" Text='<%# Eval("CanQty") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" width="80"/>
<f:BoundField runat="server" HeaderText="零件名称" ColumnID="" DataField="PartDesc1" />
<f:BoundField runat="server" HeaderText="单位" ColumnID="LocUnit" DataField="LocUnit" width="50"/>
<f:BoundField runat="server" HeaderText="币种" ColumnID="Currency" DataField="Currency" width="50"/>
<f:BoundField runat="server" HeaderText="Erp收货单税率" ColumnID="Tax" DataField="Tax" width="50" Hidden="true"/>
<f:BoundField runat="server" HeaderText="要货日期" ColumnID="BeginTime" DataField="BeginTime" Hidden="true"/>
<f:BoundField runat="server" HeaderText="收货时间" ColumnID="CreateTime" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="Remark" DataField="Remark" />
</Columns>
</f:Grid>
<f:ContentPanel runat="server" CssClass="totalpanel" ShowBorder="true" ShowHeader="false" ColumnWidth="50%">
<div style="margin-bottom: 10px; ">
<input type="hidden" id="TOTAL_PRICE" name="TOTAL_PRICE" />
总计:<span id="totalPrice" style="color: red; font-size: 1.5em; font-weight: bold;" ></span>
<input type="hidden" id="TOTAL_PRICE1" name="TOTAL_PRICE1" />
<input type="hidden" id="TOTAL_PRICE_TAX" name="TOTAL_PRICE_TAX" />
税额:<span id="totalPriceTax" style="color: red; font-size: 1.5em; font-weight: bold;" ></span>
税后金额:<span id="totalPrice1" style="color: red; font-size: 1.5em; font-weight: bold;" ></span>
</div>
<%--<div style="margin-bottom: 10px;">
</div>
<div style="margin-bottom: 10px;">
</div>--%>
</f:ContentPanel>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" />
</form>
<script src="../../res/js/jquery.min.js"></script>
<script type="text/javascript">
var gridClientID = '<%= Grid_V_TB_RECEIVE_LIST.ClientID %>';
var taxRateClientID = '<%= lbTaxRate.ClientID %>';
var priceSelector = '.f-grid-tpl input.price';
var numberSelector = '.f-grid-tpl input.number';
function getRowPrice(row) {
return parseFloat(row.find(priceSelector).val());
}
function getRowNumber(row) {
var num = parseFloat(row.find(numberSelector).val(), 10);
return num;
}
function updateTotal() {
var grid = F(gridClientID);
var tax = F(taxRateClientID);
var selection = grid.getSelectionModel().getSelection();
var store = grid.getStore();
var total = 0;
$.each(selection, function (index, item) {
var rowIndex = store.indexOf(item);
var row = $(grid.body.el.dom).find('.x-grid-item').eq(rowIndex);
total += getRowNumber(row) * getRowPrice(row);
});
$('#totalPrice').text( total.toFixed(4));
$('#TOTAL_PRICE').val(total.toFixed(4));
var _tax = total.toFixed(4) * parseFloat(tax.value);
var _totalPrice1 =parseFloat(total) + parseFloat(_tax);
$('#totalPriceTax').text( _tax.toFixed(4));
$('#TOTAL_PRICE_TAX').val(_tax.toFixed(4));
$('#totalPrice1').text( _totalPrice1.toFixed(4));
$('#TOTAL_PRICE1').val(_totalPrice1);
}
function registerSelectionChangeEvents() {
var grid = F(gridClientID);
grid.on('selectionchange', function (cmp, selected) {
updateTotal();
});
}
// 页面第一次加载完成后调用的函数
F.ready(function () {
registerSelectionChangeEvents();
updateTotal();
});
</script>
</body>
</html>

512
SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.cs

@ -0,0 +1,512 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using SCP.Code;
using System.Drawing;
using CK.SCP.Models.Enums;
namespace SCP.SupplierData.SupplierFinance
{
public partial class ReceiveList : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid_V_TB_RECEIVE_LIST);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
LoadData();
SetRoleRule();
BindVender(DDL_VEND_LIST);
}
}
public void IsRoleRight()
{
//if (!CurrentUser.RoleList.Contains("供应商"))
//{
// Alert.Show("当前用户角色不能操作该模块!");
// return;
//}
//else
//{
//}
//if (CurrentUser.VenderList == null || CurrentUser.VenderList.Count == 0)
//{
// Alert.Show("当前用户未选择地点!");
// return;
//}
}
private void SetRoleRule()
{
if (CurrentUser.RoleList.Contains("采购人员"))
{
DDL_VEND_LIST.Hidden = false;
BTN_INV.Hidden = false;
if( CurrentUser.FactoryList!=null && CurrentUser.FactoryList.Count>0)
{
var _site= CurrentUser.FactoryList.FirstOrDefault();
if(_site=="CNS")
{
txtContractPrice1.Enabled = false;
}
}
}
}
public void LoadData()
{
// 每页记录数
//Grid_V_TB_RECEIVE_LIST.PageSize = ConfigHelper.PageSize;
//ddlGridPageSize.SelectedValue = ConfigHelper.PageSize.ToString();
//BindData();
}
private void SearchData(Action<IQueryable<V_TB_RECEIVE_LIST>> p_action)
{
V_TB_RECEIVE_LIST _ls = new V_TB_RECEIVE_LIST();
_ls.PoBillNum = TXT_BillNo.Text;
_ls.VendName = TXT_VendName.Text;
_ls.AsnBillNum = TXT_ASNBill.Text;
_ls.PartCode = TXT_PartCode.Text;
_ls.VendId = TXT_VendId.Text;
_ls.ProjectId = TXT_ProjectId.Text;
if (DP_StartDate.SelectedDate != null)
{
_ls.BeginTime = DP_StartDate.SelectedDate;
}
if (Date_EndDate.SelectedDate != null)
{
_ls.ShipTime = Date_EndDate.SelectedDate;
}
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_ls.BillType_DESC = DDL_State.SelectedValue;
}
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
_ls.Site = CurrentUser.FactoryList[0];
}
_ls.State = 1;
if (CurrentUser.RoleList.Contains("采购人员"))
{
if (string.IsNullOrEmpty(DDL_VEND_LIST.SelectedValue))
{
Alert.Show("请在工具栏里选择要开票的供应商,并点击确认!");
return;
}
var _venderId = DDL_VEND_LIST.SelectedValue;
_ls.VendId = DDL_VEND_LIST.SelectedValue;
if (!string.IsNullOrEmpty(_ls.Site) && !string.IsNullOrEmpty(_venderId))
{
var _vender = SCP_TB_VENDER_CONTROLLER.GetVender(_venderId, _ls.Site);
if (_vender.Tax != null)
{
lbTaxRate.SelectedValue = _vender.Tax.ToString();
}
else
{
lbTaxRate.SelectedValue = "0";
}
}
}
else
{
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
var _venderId = CurrentUser.VenderList.FirstOrDefault();
_ls.VendId = _venderId;
if (!string.IsNullOrEmpty(_ls.Site) && !string.IsNullOrEmpty(_venderId))
{
var _vender = SCP_TB_VENDER_CONTROLLER.GetVender(_venderId, _ls.Site);
if (_vender.Tax != null)
{
lbTaxRate.SelectedValue = _vender.Tax.ToString();
}
else
{
lbTaxRate.SelectedValue = _vender.Tax.ToString();
}
}
}
}
if (string.IsNullOrEmpty(_ls.VendId))
{
return;
}
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_List(_ls, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
p_action(ret.Result);
}
});
}
public void BindData()
{
SearchData(ret =>
{
if (CurrentUser.RoleList.Contains("采购人员"))
{
Grid_V_TB_RECEIVE_LIST.RecordCount = ret.Count();
ret = SortAndPage(ret, Grid_V_TB_RECEIVE_LIST,"DESC");
List<V_TB_RECEIVE_LIST> temp = ret.ToList();
if (string.IsNullOrEmpty(DDL_VEND_LIST.SelectedValue))
{
Alert.Show("请在工具栏里选择要开票的供应商,并点击确认!");
return;
}
Grid_V_TB_RECEIVE_LIST.DataSource = temp;
Grid_V_TB_RECEIVE_LIST.DataBind();
}
else
{
Grid_V_TB_RECEIVE_LIST.RecordCount = ret.Count();
ret = SortAndPage(ret, Grid_V_TB_RECEIVE_LIST,"DESC");
List<V_TB_RECEIVE_LIST> temp = ret.ToList();
Grid_V_TB_RECEIVE_LIST.DataSource = temp;
Grid_V_TB_RECEIVE_LIST.DataBind();
}
});
// 排列和数据库分页
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid_V_TB_RECEIVE_LIST.PageIndex = e.NewPageIndex;
BindData();
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_RECEIVE_LIST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
//生成发票
protected void btnCreate_OnClick(object sender, EventArgs e)
{
CreateInvoice("0");
}
private void CreateInvoice(string p_all)
{
try
{
string vender = string.Empty;
if (CurrentUser.RoleList.Contains("采购人员"))
{
if (string.IsNullOrEmpty(DDL_VEND_LIST.SelectedValue))
{
Alert.Show("请在工具栏里选择要开票的供应商,并点击确认!");
return;
}
vender = DDL_VEND_LIST.SelectedValue;
}
else
{
vender = CurrentUser.VenderList[0];
}
TM_HYANTOLIN_REVIEW _entity = new TM_HYANTOLIN_REVIEW();
_entity.UltimateName = vender;
_entity.State = 0;
var _state = 0;
SCP_QUALITY_CONTROLLER.Get_TM_HYANTOLIN_REVIEW_List(_entity, (rs) =>
{
if (rs.State == ReturnStatus.Succeed)
{
var _ls = rs.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _sum = _ls.Sum(p => p.ClaimAmount);
var _ary = _ls.Select(p => p.ReviewBillNum).ToList();
_state = 1;
if (_sum == 0)
{
_state = 0;
}
if (_sum > 0)
{
Alert.Show(string.Format("索赔金额合计{0}供应商存在未处理索赔单{1}!", _sum.ToString(), string.Join(",", _ary.ToArray())), "索赔管理查看");
}
}
}
});
if (_state == 1)
{
return;
}
var _tax = lbTaxRate.SelectedValue;
var _cj = string.IsNullOrEmpty(txtContractPrice1.Text) ? "0" : txtContractPrice1.Text;
var _tz = string.IsNullOrEmpty(txtBlancePrice1.Text) ? "0" : txtBlancePrice1.Text;
string IsCreate = "0";
if (Grid_V_TB_RECEIVE_LIST.SelectedRowIndexArray.Length == 0)
{
Alert.Show("请选择要创建发票的记录!");
return;
}
string IDS = "";
List<string> _list = new List<string>();
List<string> _projectList = new List<string>();
List<string> _rejList = new List<string>();
string _projectId = string.Empty;
List<string> _recList = new List<string>();
List<int> IdList = new List<int>();
decimal _total = 0;
for (int i = 0; i < Grid_V_TB_RECEIVE_LIST.SelectedRowIndexArray.Length; i++)
{
int rowIndex = Grid_V_TB_RECEIVE_LIST.SelectedRowIndexArray[i];
int ID = Convert.ToInt32(Grid_V_TB_RECEIVE_LIST.DataKeys[rowIndex][0]);
decimal _qty = decimal.Parse(Grid_V_TB_RECEIVE_LIST.DataKeys[rowIndex][5].ToString());
decimal _price = decimal.Parse(Grid_V_TB_RECEIVE_LIST.DataKeys[rowIndex][6].ToString());
_total += (_qty * _price);
IDS += ID + ",";
_projectId = Grid_V_TB_RECEIVE_LIST.DataKeys[rowIndex][1].ToString();
_projectList.Add(_projectId);
var _recbill = Grid_V_TB_RECEIVE_LIST.DataKeys[rowIndex][2].ToString();
if (!string.IsNullOrEmpty(_recbill) && _recbill.IndexOf("R.") > 0)
{
_rejList.Add(_projectId);
}
IdList.Add(ID);
}
if (_total < 0)
{
Alert.Show("不允许开负数发票!退货、索赔零件数量有问题,请联系工厂库房和质量解决!");
return;
}
if (IdList.Count > 200)
{
Alert.Show("选择零件记录超过,发票允许条数!");
return;
}
if (_list.Distinct().Count() > 1)
{
Alert.Show("请选择的记录不是同一个供应商,请选择供应商!");
return;
}
if (IDS != "") IDS = IDS.Substring(0, IDS.Length - 1);
if (CurrentUser.FactoryList.FirstOrDefault() != "BJCIAI")
{
var _ls = GetIsAllChecked(vender, IDS);
if (_ls.Count > 0)
{
Alert.Show(string.Format("退货或索赔单{0}未开票!", string.Join(",", _ls.ToArray())));
return;
}
}
InvoiceCreateQueryParm parm = new InvoiceCreateQueryParm();
parm.ReceiveID = IDS;
parm.VendId = vender;
parm.Modify = IsCreate;
parm.IsAll = p_all;
parm.Tax = _tax;
parm.CJ = _cj;
parm.TZ = _tz;
Session["InvoiceCreateQueryParm"] = parm;
string ret = Window1.GetShowReference("../../Views/SupplierData/SCP_INVOICE_CREATE.aspx", "生成发票");
PageContext.RegisterStartupScript(ret);
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
private List<string> GetIsAllChecked(string p_VendId,string p_VendIds)
{
List<string> unSelected = new List<string>();
var _ls = SCPDB.V_TB_RECEIVE_LIST.Where(p => p.VendId == p_VendId && p.State == 1 && (p.BillType_DESC == "索赔单" || p.BillType_DESC == "退货单")).Select(p => new { p.UID, p.RecvBillNum }).ToList();
//SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_List(_ent, (ret) =>
//{
// if (ret.State == ReturnStatus.Succeed)
// {
var _lsCompare = p_VendIds.Split(new char[] { ',' });
// var _ls = ret.Result.Select(p => new { p.UID, p.RecvBillNum }).ToList();
foreach (var itm in _ls)
{
if (!_lsCompare.Contains(itm.UID.ToString()))
{
unSelected.Add(itm.RecvBillNum);
}
}
// }
//});
return unSelected.Distinct().ToList();
}
protected void Grid_V_TB_RECEIVE_LIST_PageIndexChange(object sender, GridPageEventArgs e)
{
BindData();
}
//导出
protected void btnOutput_OnClick(object sender, EventArgs e)
{
V_TB_RECEIVE_LIST _ls = new V_TB_RECEIVE_LIST();
_ls.PoBillNum = TXT_BillNo.Text;
_ls.VendName = TXT_VendName.Text;
_ls.UserInVendIds = CurrentUser.VenderList;
_ls.AsnBillNum = TXT_ASNBill.Text;
_ls.PartCode = TXT_PartCode.Text;
_ls.VendId = TXT_VendId.Text;
_ls.ProjectId = TXT_ProjectId.Text;
_ls.RecvBillNum = TXT_RECEIVE.Text;
if (DP_StartDate.SelectedDate != null)
{
_ls.BeginTime = DP_StartDate.SelectedDate;
}
if (Date_EndDate.SelectedDate != null)
{
_ls.ShipTime = Date_EndDate.SelectedDate;
}
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_ls.BillType_DESC = DDL_State.SelectedValue;
}
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
_ls.Site = CurrentUser.FactoryList[0];
}
_ls.State = 1;
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
var _venderId = CurrentUser.VenderList.FirstOrDefault();
if (!string.IsNullOrEmpty(_ls.Site) && !string.IsNullOrEmpty(_venderId))
{
var _vender = SCP_TB_VENDER_CONTROLLER.GetVender(_venderId, _ls.Site);
if (_vender.Tax != null)
{
lbTaxRate.SelectedValue = _vender.Tax.ToString();
}
else
{
lbTaxRate.Text = "0";
}
}
}
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_List(_ls, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
var _lst = ret.Result.ToList();
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "ProjectId", "项目编号" },
{ "BillType_DESC", "单据类型" },
{ "RecvBillNum", "单据编号" },
{ "AsnBillNum", "发货单号" },
{ "VendName", "供应商" },
{ "VendId", "供应商编码" },
{ "PoBillNum", "订单号" },
{ "PoLine", "订单行" },
{ "PartCode", "零件号" },
{ "PartDesc1", "零件名称" },
{ "LocUnit", "单位" },
{ "Currency", "币种" },
{ "CanQty", "可开票数量" },
{ "Price", "单价" },
{ "CreateTime", "创建时间" }
};
string url = EntityListToExcel2003(cellheader,_lst , "审核明细");
}
});
}
//快速查找
protected void btnSearch_Click(object sender, EventArgs e)
{
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void Grid_V_TB_RECEIVE_LIST_RowDataBound(object sender, GridRowEventArgs e)
{
System.Web.UI.WebControls.Label _label= (System.Web.UI.WebControls.Label)Grid_V_TB_RECEIVE_LIST.Rows[e.RowIndex].FindControl("Qty1");
if (!string.IsNullOrEmpty(_label.Text))
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
}
}
}
protected void btnCanIn_Click(object sender, EventArgs e)
{
}
protected void BTN_INV_Click(object sender, EventArgs e)
{
BindData();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
Session["InvoiceCreateQueryParm"] = null;
BindData();
}
protected void btnCreateAll_Click(object sender, EventArgs e)
{
CreateInvoice("1");
}
}
}

395
SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.designer.cs

@ -0,0 +1,395 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SupplierData.SupplierFinance
{
public partial class ReceiveList
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// btnCreate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCreate;
/// <summary>
/// btnCreateAll 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCreateAll;
/// <summary>
/// btn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btn;
/// <summary>
/// Button2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button2;
/// <summary>
/// btnCanIn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCanIn;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// tb_RecvBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox tb_RecvBillNum;
/// <summary>
/// btn_Search 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btn_Search;
/// <summary>
/// DDL_VEND_LIST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_VEND_LIST;
/// <summary>
/// BTN_INV 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_INV;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TXT_BillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_BillNo;
/// <summary>
/// TXT_ASNBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASNBill;
/// <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>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TXT_ProjectId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ProjectId;
/// <summary>
/// TXT_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCode;
/// <summary>
/// DP_StartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_StartDate;
/// <summary>
/// Date_EndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker Date_EndDate;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// TXT_RECEIVE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_RECEIVE;
/// <summary>
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// FormRow1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow1;
/// <summary>
/// txtContractPrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtContractPrice1;
/// <summary>
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtBlancePrice1;
/// <summary>
/// FormRow2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow2;
/// <summary>
/// lbTaxRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList lbTaxRate;
/// <summary>
/// btnTax 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnTax;
/// <summary>
/// Grid_V_TB_RECEIVE_LIST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_RECEIVE_LIST;
/// <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;
/// <summary>
/// Qty1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Qty1;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

154
SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx

@ -0,0 +1,154 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASK.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierLogistics.SCP_ASK" %>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click" >
</f:Button>
<f:Button ID="btnDetail" runat="server" Text="明细" Icon="Find" OnClick="btnDetail_Click">
</f:Button>
<f:Button ID="btnAsn" runat="server" Text="生成发货单" Icon="Add" OnClick="btnAsn_Click">
</f:Button>
<f:Button ID="btn" runat="server" Text="生成发货单(默认全发)" Icon="Add" OnClick="btn_Click" OnClientClick="if(!confirm('是否要将剩余零件,全部生成到发货单,请确认标包数量是否准确,发货数量必须与物料实际数量一致?'))return false;" >
</f:Button>
<f:Button ID="btnShow" runat="server" Text="查询面板" Icon="Zoom" OnClick="btnShow_Click">
</f:Button>
<f:Button ID="Button6" runat="server" Text="全部" Icon="Reload" OnClick="Button6_Click" >
</f:Button>
<%-- <f:Button ID="Button1" runat="server" Text="新建" Icon="Reload" OnClick="Button1_Click" >
</f:Button>--%>
<f:Button ID="Button2" runat="server" Text="发布" Icon="Reload" OnClick="Button2_Click" >
</f:Button>
<f:Button ID="Button4" runat="server" Text="已确认" Icon="Reload" OnClick="Button4_Click" >
</f:Button>
<f:Button ID="Button5" runat="server" Text="已发货" Icon="Reload" OnClick="Button5_Click" >
</f:Button>
<f:ToolbarSeparator runat="server" />
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="true" Layout="HBox" >
<Items>
<f:Form runat="server" >
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" />
<f:DropDownList runat="server" ID="DropDownList1" Label="地点" DataTextField="FactoryName" DataValueField=" ErpDomain">
</f:DropDownList>
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend1" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend2" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend3" Hidden="true" />
<f:TextBox runat = "server" Label = "看板编号" EmptyText = "" ID = "TXT_AskBillNo" />
<f:TextBox runat = "server" Label = "供应商编码" EmptyText = "" ID = "TXT_VendId" />
<f:TextBox runat = "server" Label = "送货地点" EmptyText = "" ID = "TXT_Site_Desc" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox runat = "server" Label = "项目编码" EmptyText = "" ID = "TXT_ProjectId" />
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="发布" Value="1" />
<f:ListItem Text="已确认" Value="2" />
<f:ListItem Text="已发货" Value="3" />
<f:ListItem Text="已收货" Value="4" />
</f:DropDownList>
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="至" ID="Date_EndDate" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<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>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID = "Grid_V_TB_ASK" PageSize="50" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect="true"
DataKeyNames = "UID,PoBillNum,AskBillNum,VendId,Site,Buyer,BuyerPhone,State,Remark,VendName,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID"
CssClass="maingrid" EnableRowDoubleClickEvent="True" OnSort="Grid_V_TB_ASK_Sort" SortField="CreateTime"
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_ASK_RowDoubleClick"
AutoScroll="True" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_ASK_PageIndexChange" OnRowDataBound="Grid_V_TB_ASK_RowDataBound" BoxFlex="1">
<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="50" Value="50" />
<f:ListItem Text="100" Value="100" />
</f:DropDownList>
</PageItems>
<Columns>
<f:TemplateField HeaderText="状态" Width="70px" ColumnID="State_DESC1">
<ItemTemplate>
<asp:label ID="State_DESC" runat="server" Width="65px" Text='<%# Eval("State_DESC") %>' ></asp:label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField Width = "80px" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" />
<f:BoundField Width = "100px" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板号" />
<f:BoundField Width = "100px" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单编号" />
<f:BoundField Width = "100px" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="ERP订单号" />
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<%--<f:BoundField Width = "100px" DataField = "Contacter" DataFormatString = "{0}" HeaderText = "发布人" />--%>
<f:BoundField Width = "100px" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "开始日期" />
<f:BoundField Width = "100px" DataField = "EndTime" DataFormatString = "{0:yyyy-MM-dd}" 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>
<f:HiddenField ID="highlightRows" runat="server">
</f:HiddenField>
<f:Window runat="server" ID="Window1" Hidden="True" AutoScroll="True" Width="1024px" Height="600px" CloseAction="HidePostBack"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" OnClose="Window1_Close"
IFrameUrl="about:blank" />
<f:Window ID="WindowUpload" runat="server" Hidden="True" OnClose="WindowUpload_Close"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form>
</body>
</html>

351
SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.cs

@ -0,0 +1,351 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models;
using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Common;
using CK.SCP.Controller;
using EntityFramework.Audit;
using FineUI;
using Microsoft.Diagnostics.Instrumentation.Extensions.Intercept;
using SCP.Code;
using EntitiesHelper = CK.SCP.Controller.EntitiesHelper;
using System.IO;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
using System.Drawing;
namespace SCP.Views.SupplierData.SupplierLogistics
{
public partial class SCP_ASK : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindAsk();
CheckRolesMenu();
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgent(Grid_V_TB_ASK);
TranslatorAgents(Toolbar2);
}
}
//public void LoadData()
//{
// BindAsk();
//}
public void BindAsk()
{
SearchV_TB_ASKData((result) => {
Grid_V_TB_ASK.RecordCount = result.Count();
var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK);
var ls=SCP_ASK_CONTROLLER.GET_IS_COMPLETED_SEND(list.ToList());
Grid_V_TB_ASK.DataSource = ls;
Grid_V_TB_ASK.DataBind();
});
}
private void CheckRolesMenu()
{
if (CurrentUser.RoleList.Contains("采购人员"))
{
btnOutput.Hidden = false;
btnDetail.Hidden = false;
this.BtnSearch.Hidden = false;
//this.btnEdit.Hidden = true;
}
else
{
foreach (var itm in Grid_V_TB_ASK.Columns)
{
if (itm.HeaderText == "要货数量")
{
itm.Enabled = false;
}
}
btnOutput.Hidden = false;
btnDetail.Hidden = true;
this.BtnSearch.Hidden = true;
this.btnShow.Hidden = true;
}
}
public void SearchV_TB_ASKData(Action<IQueryable<V_TB_ASK>> p_action)
{
var ls = SCPDB.TB_FACTORY.Where(p => p.ErpDomain == CurrentUser.UsedDomain).ToList();
DropDownList1.DataSource = ls;
DropDownList1.DataBind();
V_TB_ASK _entity = new V_TB_ASK();
_entity.IsDeleted = false;
_entity.PoBillNum = TXT_BillNo.Text;
_entity.VendId = TXT_VendId.Text;
_entity.State_DESC = TXT_Site_Desc.Text;
_entity.AskBillNum = TXT_AskBillNo.Text;
_entity.ErpBillNum = TXT_ProjectId.Text;
_entity.SubSite = DropDownList1.SelectedValue;
_entity.Extend1 = TXT_Extend1.Text;
_entity.Extend2 = TXT_Extend2.Text;
_entity.Extend3 = TXT_Extend3.Text;
if (DP_StartDate.SelectedDate != null)
{
_entity.BeginTime = DP_StartDate.SelectedDate;
}
if (DP_StartDate.SelectedDate != null)
{
_entity.EndTime = DP_StartDate.SelectedDate;
}
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) };
}
_entity.UserInAddress = CurrentUser.FactoryList;
if (CurrentUser.RoleList.Contains("供应商"))
{
if (CurrentUser.VenderList == null && CurrentUser.VenderList.Count == 0)
{
CurrentUser.VenderList = new List<string>() { "00000000000" };
}
_entity.UserInVendIds = CurrentUser.VenderList;
}
//if (CurrentUser.RoleList.Contains("供应商"))
//{
// _entity.BillStateList = new List<int> { (int)AskState.Confirm, (int)AskState.Release, (int)AskState.Ship, (int)AskState.Receive };
//}
SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_ASK_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[e.RowIndex];
string AskBillNum = rowDataKeys[2] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASK_DETAIL.aspx?AskBillNum={0}", AskBillNum)));
}
protected void Grid_V_TB_ASK_Sort(object sender, GridSortEventArgs e)
{
}
protected void Grid_V_TB_ASK_PageIndexChange(object sender, GridPageEventArgs e)
{
BindAsk();
}
protected void btnOutput_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASK.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
List<string> _ls = new List<string>();
for (int i = 0, count = Grid_V_TB_ASK.Rows.Count; i < count; i++)
{
if (Grid_V_TB_ASK.SelectedRowIndexArray.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[i];
_ls.Add(rowDataKeys[2] as string);
}
}
DataSet ds = SCP_EXCEL_CONTROLLER.GET_ASK_EXECEL(_ls);
PageBase.DataSetToExcel(ds, "要货看板");
}
protected void btnDetail_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASK.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[Grid_V_TB_ASK.SelectedRowIndex];
string AskBillNum = rowDataKeys[2] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASK_DETAIL.aspx?AskBillNum={0}", AskBillNum)));
}
protected void BtnPublish_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_ASK.SelectedRowIndexArray;
List<string> _AskList = new List<string>();
for (int i = 0, count = Grid_V_TB_ASK.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[2].ToString()))
{
_AskList.Add(rowDataKeys[2].ToString());
}
}
}
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(_AskList, AskState.Release);
if (ret.State == ReturnStatus.Succeed)
{
BindAsk();
}
else
{
Alert.Show(ret.Message);
}
}
protected void BtnCanclePublish_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_ASK.SelectedRowIndexArray;
List<string> _AskList = new List<string>();
for (int i = 0, count = Grid_V_TB_ASK.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[2].ToString()))
{
_AskList.Add(rowDataKeys[2].ToString());
}
}
}
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(_AskList, AskState.Confirm);
if (ret.State == ReturnStatus.Succeed)
{
BindAsk();
}
else
{
Alert.Show(ret.Message);
}
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindAsk();
}
protected void btnAsn_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASK.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[Grid_V_TB_ASK.SelectedRowIndex];
if (rowDataKeys.Count() > 0)
{
if (ConvertHelper.To<Int32>(rowDataKeys[7]) == (int)AskState.New || ConvertHelper.To<Int32>(rowDataKeys[7]) == (int)AskState.Release)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选择记录不是供应商确认单据"));
return;
}
string AskBillNum = rowDataKeys[2] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_CREATE.aspx?AskBillNum={0}", AskBillNum)));
}
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindAsk();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
if (Session["Ask"] != null)
{
Session["Ask"] = null;
}
BindAsk();
}
protected void Grid_V_TB_ASK_RowDataBound(object sender, GridRowEventArgs e)
{
var itm = e.DataItem as V_TB_ASK;
if (itm.IsComplete==false)
{
System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_V_TB_ASK.Rows[e.RowIndex].FindControl("State_DESC");
// _label.Text = "发货未完";
_label.ForeColor = Color.Red;
}
}
protected void btn_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASK.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[Grid_V_TB_ASK.SelectedRowIndex];
if (rowDataKeys.Count() > 0)
{
if (ConvertHelper.To<Int32>(rowDataKeys[7]) == (int)AskState.New || ConvertHelper.To<Int32>(rowDataKeys[7]) == (int)AskState.Release)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选择记录不是供应商确认单据"));
return;
}
string AskBillNum = rowDataKeys[2] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_CREATE.aspx?AskBillNum={0}&State=1", AskBillNum)));
}
}
protected void Button1_Click(object sender, EventArgs e)
{
DDL_State.SelectedValue = "0";
BindAsk();
}
protected void Button2_Click(object sender, EventArgs e)
{
DDL_State.SelectedValue = "1";
BindAsk();
}
protected void Button4_Click(object sender, EventArgs e)
{
DDL_State.SelectedValue = "2";
BindAsk();
}
protected void Button6_Click(object sender, EventArgs e)
{
DDL_State.SelectedValue = string.Empty;
BindAsk();
}
protected void Button5_Click(object sender, EventArgs e)
{
DDL_State.SelectedValue = "3";
BindAsk();
}
}
}

368
SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.designer.cs

@ -0,0 +1,368 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData.SupplierLogistics
{
public partial class SCP_ASK
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button button3;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnAsn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnAsn;
/// <summary>
/// btn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btn;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// Button6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button6;
/// <summary>
/// Button2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button2;
/// <summary>
/// Button4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button4;
/// <summary>
/// Button5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button5;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TXT_BillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_BillNo;
/// <summary>
/// DropDownList1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DropDownList1;
/// <summary>
/// TXT_Extend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend1;
/// <summary>
/// TXT_Extend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend2;
/// <summary>
/// TXT_Extend3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend3;
/// <summary>
/// TXT_AskBillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_AskBillNo;
/// <summary>
/// TXT_VendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendId;
/// <summary>
/// TXT_Site_Desc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site_Desc;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TXT_ProjectId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ProjectId;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// DP_StartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_StartDate;
/// <summary>
/// Date_EndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker Date_EndDate;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_ASK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASK;
/// <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;
/// <summary>
/// State_DESC 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label State_DESC;
/// <summary>
/// highlightRows 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField highlightRows;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

116
SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx

@ -0,0 +1,116 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASK_DETAIL.aspx.cs" Inherits="SCP.SupplierData.SupplierLogistics.SCP_ASK_DETAIL" %>
<!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">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="BTN_refresh" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button>
<f:Button ID="btnConfirm" runat="server" EnablePostBack="True" OnClick="btnConfirm_Click" Text="确认订单" Icon="CssAdd">
</f:Button>
<f:Button ID="btnNoConfirm" runat="server" EnablePostBack="True" OnClick="btnNoConfirm_Click" Text="取消确认" Icon="CssAdd">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%" ID="FormRow_1">
<Items>
<f:TextBox runat = "server" Label = "单据状态" EmptyText = "" Readonly="true" ID = "TXT_State_DESC" />
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_PoBillNum" />
<f:TextBox runat = "server" Label = "供应商" EmptyText = "" ID = "TXT_VendName" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%" ID="FormRow_2">
<Items>
<f:TextBox runat = "server" Label = "发往地点" EmptyText = "" ID = "TXT_Site" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_BeginTime" />
<%-- <f:DatePicker runat="server" ID="DP_EndTime" Label="截止日期" Text="" DateFormatString="yyyy-MM-dd" />--%>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" Text="">
</f:TextBox>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL"
DataKeyNames ="UID,PoBillNum,PoLine,PartCode,ShippedQty,ReceivedQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,Site,VendName,PartDesc2,AskBillNum,AskQty,TempQty,ReceivedPort"
IsDatabasePaging="True" AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoLine" SortDirection="DESC" >
<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="10" 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 SortField="State" DataField="State" HeaderText="状态" ColumnID="State" Width="50px" Hidden="true" />
<f:BoundField SortField="Line" DataField="PoLine" HeaderText="行号" ColumnID="Line" Width="40px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="PartDesc1" Width="200px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="80px" />
<f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" ColumnID="PoUnit" Width="40px" />
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackQty" Width="80px" DataFormatString = "{0:F}"/>
<f:BoundField SortField="CurrencyDesc" DataField="CurrencyDesc" HeaderText="币种" ColumnID="CurrencyDesc" Width="40px" />
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="80px" Hidden="true" />
<f:BoundField SortField="AskQty" DataField="AskQty" HeaderText="要货数量" ColumnID="AskQty" Width="80px" DataFormatString = "{0:F}" />
<f:BoundField SortField="EndTime" DataField="EndTime" HeaderText="截止日期" ColumnID="EndTime" Width="100px" />
<f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="减产数量" ColumnID="ReduceQty" Width="100px" Hidden="true"/>
<%--<f:BoundField SortField="TempQty" DataField="TempQty" HeaderText="待发数" ColumnID="TempQty" Width="60px" />
<f:BoundField SortField="ShipQty" DataField="ShippedQty" HeaderText="发货数" ColumnID="ShipQty" Width="60px" />
<f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数" ColumnID="ReceiveQty" Width="60px" />--%>
<f:BoundField SortField="Remrk" DataField="Remark" HeaderText="说明" ColumnID="RejectQty" />
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" />
</Columns>
</f:Grid>
<f:HiddenField runat="server" ID="TXT_ModType"></f:HiddenField>
<f:HiddenField runat="server" ID="TXT_State"></f:HiddenField>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="840px" Width="700px" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form>
</body>
</html>

144
SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.cs

@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Controller;
using FineUI;
using SCP.Code;
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_ASK_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetV_TB_POData();
BindDetail();
//SetRoleRule();
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid_V_TB_ASK_DETAIL);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
}
}
private void SetRoleRule()
{
IsPriceVisible(Grid_V_TB_ASK_DETAIL, "价格");
}
private void BindResource()
{
BTN_refresh.Text = GetNameByKey(BTN_refresh.Text);
TXT_PoBillNum.Label = GetNameByKey(TXT_PoBillNum.Label);
TXT_Site.Label = GetNameByKey(TXT_Site.Label);
TXT_State_DESC.Label = GetNameByKey(TXT_State_DESC.Label);
TXT_VendName.Label = GetNameByKey(TXT_VendName.Label);
DP_BeginTime.Label = GetNameByKey(DP_BeginTime.Label);
//DP_EndTime.Label = GetNameByKey(DP_EndTime.Label);
foreach (var itm in Grid_V_TB_ASK_DETAIL.Columns)
{
GetNameByKey(itm.HeaderText);
}
}
public void SearchV_TB_ASK_DETAILData(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum= Request["AskBillNum"];
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void GetV_TB_POData()
{
V_TB_ASK _entity = new V_TB_ASK();
_entity.AskBillNum = Request["AskBillNum"];
//_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
var _result = _ret.Result.FirstOrDefault();
Session["Ask"] = _result;
this.TXT_PoBillNum.Text = _result.PoBillNum;
this.TXT_Site.Text = _result.Site_Desc;
this.TXT_State_DESC.Text = _result.State_DESC;
TXT_ModType.Text = _result.ModType.ToString();
this.TXT_VendName.Text = _result.VendName;
this.txtRemark.Text = _result.Remark;
DP_BeginTime.SelectedDate = _result.BeginTime;
}
});
}
public void BindDetail()
{
SearchV_TB_ASK_DETAILData((ret) => {
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = list;
Grid_V_TB_ASK_DETAIL.DataBind();
});
}
protected void btnOutput_Click(object sender, EventArgs e)
{
}
protected void btnConfirm_Click(object sender, EventArgs e)
{
SET_ASK_STATE("供应商确认成功!", AskState.Confirm);
}
private void SET_ASK_STATE(string p_msg,AskState p_state)
{
if (Session["Ask"] != null)
{
var _ask = Session["Ask"] as V_TB_ASK;
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(new List<string>() { _ask.AskBillNum },p_state);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg);
GetV_TB_POData();
BindDetail();
}
else
{
Alert.Show(ret.Message);
}
}
}
protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void btnNoConfirm_Click(object sender, EventArgs e)
{
SET_ASK_STATE("取消确认成功!", AskState.NoConfirm);
}
}
}

64
SCP/Views/沈阳金杯/SCP_PO_ARRIVE.aspx.designer.cs → SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP. {
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_PO_ARRIVE {
public partial class SCP_ASK_DETAIL
{
/// <summary>
/// form1 控件。
@ -40,40 +42,40 @@ namespace SCP.沈阳金杯 {
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// BTN_REFRESH 控件。
/// BTN_refresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_REFRESH;
protected global::FineUI.Button BTN_refresh;
/// <summary>
/// BTN_RELESE 控件。
/// btnConfirm 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_RELESE;
protected global::FineUI.Button btnConfirm;
/// <summary>
/// btn_query 控件。
/// btnNoConfirm 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btn_query;
protected global::FineUI.Button btnNoConfirm;
/// <summary>
/// btn_export 控件。
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btn_export;
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TXT_State_DESC 控件。
@ -103,58 +105,58 @@ namespace SCP.沈阳金杯 {
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// DP_BeginTime 控件。
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_BeginTime;
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// DP_EndTime 控件。
/// TXT_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_EndTime;
protected global::FineUI.TextBox TXT_Site;
/// <summary>
/// TXT_Site 控件。
/// DP_BeginTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
protected global::FineUI.DatePicker DP_BeginTime;
/// <summary>
/// txtRemark 控件。
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtRemark;
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// HF_GRID_INDEX 控件。
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX;
protected global::FineUI.TextBox txtRemark;
/// <summary>
/// Grid_V_TB_PO_DETAIL 控件。
/// Grid_V_TB_ASK_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_PO_DETAIL;
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL;
/// <summary>
/// ToolbarSeparator1 控件。
@ -183,6 +185,24 @@ namespace SCP.沈阳金杯 {
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// TXT_ModType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField TXT_ModType;
/// <summary>
/// TXT_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField TXT_State;
/// <summary>
/// Window1 控件。
/// </summary>

129
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx

@ -0,0 +1,129 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASN.aspx.cs" Inherits="SCP.SupplierData.SupplierLogistics.SCP_ASN" %>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" EnablePostBack="True" Text="明细" Icon="Find" OnClick="btnDetail_Click">
</f:Button>
<f:Button ID="btnNew" runat="server" EnablePostBack="True" Text="新建发货单" Icon="Add" OnClick="btnNew_Click">
</f:Button>
<%--<f:Button ID="btnDelete" runat="server" EnablePostBack="True" Text="删除" Icon="Add" OnClick="btnDelete_Click" Hidden="True">
</f:Button>--%>
<f:Button ID="btnShow" runat="server" Icon="Find" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:Button ID="btnPallet" runat="server" Icon="Add" Text="创建托盘" OnClick="btnPallet_Click" >
</f:Button>
<f:Button ID="btnPalletDetail" runat="server" Icon=" Zoom" Text="查看托盘" OnClick="btnPalletDetail_Click" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Label runat="server" Label="物料发出前,请确认发货单是【已发货】状态,如果是发货单是【新建】状态请进入明细,点击【确认发货】按钮。" LabelWidth="800" ColumnWidth="800" Width="800" />
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ID="FormRow_1" Hidden="true">
<Items>
<f:DropDownList runat="server" ID="ddl" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已发货" Value="1" />
<f:ListItem Text="已收货" Value="2" />
<f:ListItem Text="已作废" Value="-1" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox ID="txtBill" runat="server" Label="发货单号"/>
<f:TextBox ID="TXT_VenderName" runat="server" Label="供应商"/>
<f:TextBox ID="TXT_ASK" runat="server" Label="看板编号" />
<f:TextBox ID="txtPO" runat="server" Label="订单编号" />
<f:DropDownList runat="server" ID="DropDownList1" Label="地点" DataTextField="FactoryName" DataValueField=" ErpDomain">
</f:DropDownList>
<f:TextBox ID="TXT_Extend1" runat="server" Label="子网站" Hidden="true" />
<f:TextBox ID="TXT_Extend2" runat="server" Label="子网站" Hidden="true" />
<f:TextBox ID="TXT_Extend3" runat="server" Label="子网站" Hidden="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3" Hidden="true">
<Items>
<f:Label runat="server" Label="发往地点" />
<f:TextBox ID="txtShipTosite" runat="server" />
<f:DatePicker ID="dateShip" runat="server" Required="True" Label="发货时间" />
<f:Label runat="server" Label="发货时间" />
<f:DatePicker ID="dateReceive" runat="server" Required="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_4">
<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>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_ASN" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,AsnBillNum,AskBillNum,PoBillNum,VendId,State,Remark,ShipTime,ShipUser,ReceiveTime,ReceiveUser,ErpBillNum,ModType,Contacter,Buyer,BuyerPhone,VendName,Site,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID"
IsDatabasePaging="true" AllowPaging="true" SortDirection="DESC" SortField="ShipTime"
AutoScroll="True" EnableRowDoubleClickEvent="True" OnRowDoubleClick="Grid_V_TB_ASN_RowDoubleClick" OnPageIndexChange="Grid_V_TB_ASN_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:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width = "100px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField runat="server" HeaderText="发货单号" ColumnID="" DataField="AsnBillNum" />
<f:BoundField runat="server" HeaderText="要货单号" ColumnID="" DataField="AskBillNum" />
<f:BoundField runat="server" HeaderText="车牌号" ColumnID="" DataField="PlateNumber" Hidden="false"></f:BoundField>
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" />
<f:BoundField Width = "100px" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货时间" Hidden="true" />
<f:BoundField Width = "100px" DataField = "ShipUser" DataFormatString = "{0}" HeaderText = "发货人" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "收货时间" Hidden="true" />
<f:BoundField Width = "100px" DataField = "ReceiveUser" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField runat="server" HeaderText="发往地点" ColumnID="" DataField="Site_Desc" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="发货明细" Target="Parent" EnableIFrame="true" CloseAction="HidePostBack"
IFrameUrl="about:blank" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close" />
</form>
</body>
</html>

175
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.cs

@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Data;
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_ASN : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid_V_TB_ASN);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgents(FormRow_4);
}
}
public void LoadData()
{
//if (!CurrentUser.RoleList.Contains("供应商"))
//{
// Alert.Show("当前用户角色不能操作模块!");
// return;
//}
if (CurrentUser.VenderList.Count == 0 && CurrentUser.Name!="admin")
{
if (CurrentUser.RoleList.Contains("分厂管理员"))
{
BindASN();
}
else
{
Alert.Show("当前用户未分配供应商!");
return;
}
;
}
BindASN();
}
public void BindASN()
{
SearchV_TB_ASN((result) => {
Grid_V_TB_ASN.RecordCount = result.Count();
var list = SortAndPage<V_TB_ASN>(result, Grid_V_TB_ASN);
Grid_V_TB_ASN.DataSource = list;
Grid_V_TB_ASN.DataBind();
});
}
public void SearchV_TB_ASN(Action<IQueryable<V_TB_ASN>> p_action)
{
var ls = SCPDB.TB_FACTORY.Where(p => p.ErpDomain == CurrentUser.UsedDomain).ToList();
DropDownList1.DataSource = ls;
DropDownList1.DataBind();
V_TB_ASN _entity = new V_TB_ASN();
_entity.IsDeleted = false;
_entity.VendId = TXT_VenderName.Text;
_entity.PoBillNum = txtPO.Text;
_entity.AsnBillNum = txtBill.Text;
_entity.AskBillNum = TXT_ASK.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.SubSite = DropDownList1.SelectedValue;
_entity.Extend1 = TXT_Extend1.Text;
_entity.Extend2 = TXT_Extend2.Text;
_entity.Extend3 = TXT_Extend3.Text;
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_ASN_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[e.RowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_DETAIL.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void BtnOutPut_Click(object sender, EventArgs e)
{
List<string> _ls = new List<string>();
SearchV_TB_ASN(rs => {
_ls=rs.Select(p => p.AsnBillNum).ToList();
DataSet ds = SCP_EXCEL_CONTROLLER.GET_ASN_EXECEL(_ls);
PageBase.DataSetToExcel(ds, "发货单");
});
}
protected void btnDetail_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_DETAIL.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void btnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindASN();
}
protected void Grid_V_TB_ASN_PageIndexChange(object sender, GridPageEventArgs e)
{
BindASN();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASN.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindASN();
}
protected void BtnOutPut_Click1(object sender, EventArgs e)
{
}
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference("../SupplierData/SCP_ASK.aspx"));
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindASN();
}
protected void btnPallet_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0 )
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_PALLET_CREATE.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void btnPalletDetail_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_PALLET.aspx?AsnBillNum={0}", AsnBillNum)));
}
}
}

323
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.designer.cs

@ -0,0 +1,323 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_ASN
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// BtnOutPut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnOutPut;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnNew;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// btnPallet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPallet;
/// <summary>
/// btnPalletDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPalletDetail;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// ddl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddl;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// txtBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBill;
/// <summary>
/// TXT_VenderName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VenderName;
/// <summary>
/// TXT_ASK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASK;
/// <summary>
/// txtPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPO;
/// <summary>
/// DropDownList1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DropDownList1;
/// <summary>
/// TXT_Extend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend1;
/// <summary>
/// TXT_Extend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend2;
/// <summary>
/// TXT_Extend3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend3;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// txtShipTosite 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtShipTosite;
/// <summary>
/// dateShip 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dateShip;
/// <summary>
/// dateReceive 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dateReceive;
/// <summary>
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASN;
/// <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;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

217
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx

@ -0,0 +1,217 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASN_CREATE.aspx.cs" Inherits="SCP.SupplierData.SupplierLogistics.SCP_ASN_CREATE" %>
<!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" ID="pmg1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Toolbar runat="server" ID="Toolbar1">
<Items>
<f:Button ID="btnCreate" runat="server" EnablePostBack="True" OnClick="btnCreate_Click" Text="生成发货单" Icon="CssAdd">
</f:Button>
<f:ToolbarFill runat="server" />
</Items>
</f:Toolbar>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_1">
<Items>
<f:TextBox runat = "server" Label = "单据状态" Enabled="false" EmptyText = "" ID = "TXT_State_Desc" />
<f:TextBox runat = "server" Label = "要货看板编号" Enabled="false" EmptyText = "" ID = "TXT_AskBillNum" />
<f:TextBox runat = "server" Label = "供应商" Enabled="false" EmptyText = "" ID = "TXT_VendName" />
<f:TextBox runat = "server" Enabled="false" Label = "发往地点" EmptyText = "" ID = "TXT_Site" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_SubSite" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend1" Hidden="true"/>
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend2" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend3" Hidden="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_2">
<Items>
<f:TextBox ID="TXT_PlateNumber" runat="server" Label="车牌/快递单号" />
<f:TextBox runat = "server" Label = "发货人" EmptyText = "" ID = "TXT_ShipUser" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="发货日期" EmptyText="请选择日期" ID="DP_ShipTime" />
<f:DatePicker runat="server" Required ="true" Label="承诺到货日期" EmptyText="请选择日期" ID="DP_ReceiveTime" Readonly="false" CompareControl="DP_ShipTime" DateFormatString="yyyy-MM-dd HH:mm"
CompareOperator="GreaterThan" CompareMessage="到货日期应该大于发货日期"
ShowRedStar="True" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%" ID="FormRow_3" Hidden="true">
<Items>
<f:DropDownList ID="DDL_PORT" DataTextField="PORT_DESCRIPTION" DataValueField="PORT_NO" Required="true" runat="server" Label="收货口">
</f:DropDownList>
<f:TextBox ID="TXT_Remark" runat="server" Label="备注" Text="">
</f:TextBox>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL"
DataKeyNames ="UID,PoBillNum,PoLine,PartCode,ShippedQty,ReceivedQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,Site,VendName,PartDesc2,AskBillNum,AskQty,TempQty,ReceivedPort,ProduceDate,ReduceQty,ValidityDays,Batch,SubSite,Extend1,Extend2,Extend3"
IsDatabasePaging="True" AllowPaging="True" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange" OnRowDataBound="Grid_V_TB_ASK_DETAIL_RowDataBound"
EnableRowSelectEvent="True" PageSize="500" AutoScroll="True" SortField="PoLine" SortDirection="DESC" AllowCellEditing="true" ClicksToEdit="1" >
<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="100" Value="500" />
<f:ListItem Text="200" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="PartDesc1" Width="100px" ToolTip='<%# Eval("PartDesc1") %>'/>
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="100px" />
<f:BoundField SortField="VendPartCode" DataField="VendPartCode" HeaderText="供应商零件号" ColumnID="VendPartCode" Width="100px" />
<f:RenderField Width="80px" ColumnID="PackQty" DataField="PackQty" FieldType="Float"
HeaderText="标包数量">
<Editor>
<f:NumberBox ID="TXT_PackQty" runat="server" MinValue="0"
MaxValue="99999999" DecimalPrecision="2" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Batch" DataField="Batch" FieldType="String" HeaderText="发货批次">
<Editor>
<f:TextBox ID="txtBatch1" Text="" runat="server" Regex="\d{6}" ></f:TextBox>
</Editor>
</f:RenderField>
<%--<f:BoundField SortField="Batch1" DataField="Batch" HeaderText="发货批次" ColumnID="Batch1" Width="100px" /> --%>
<f:RenderField Width="100px" ColumnID="TempQty" FieldType="Float" DataField="TempQty"
HeaderText="发货数量">
<Editor>
<f:NumberBox ID="NumberBox1" runat="server" MinValue="0"
MaxValue="99999999" DecimalPrecision="3" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="120px" ColumnID="ProduceDate" DataField="ProduceDate" FieldType="Date"
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="生产日期">
<Editor>
<f:DatePicker ID="DatePicker1" EnableBlurEvent="true" Required="true" runat="server" >
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Batch2" Hidden="true"
HeaderText="发货批次">
<Editor>
<f:TextBox ID="TextBox1" runat="server" MaxLength="6" >
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Qty2" FieldType="Float" Hidden="true"
HeaderText="发货数量">
<Editor>
<f:NumberBox ID="NumberBox2" runat="server" MinValue="0"
MaxValue="99999999" DecimalPrecision="3" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Batch3" Hidden="true"
HeaderText="发货批次">
<Editor>
<f:TextBox ID="TextBox2" runat="server" MaxLength="6" >
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Qty3" FieldType="Float" Hidden="true"
HeaderText="发货数量">
<Editor>
<f:NumberBox ID="NumberBox4" runat="server" MinValue="0"
MaxValue="99999999" DecimalPrecision="3" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="VendBatch" Hidden="true"
HeaderText="供应商批次(YYMMDD)">
<Editor>
<f:TextBox ID="TXT_VendBatch" runat="server" >
</f:TextBox>
</Editor>
</f:RenderField>
<f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" ColumnID="PoUnit" Width="40px" />
<f:BoundField SortField="CanQty" DataField="CanQty" HeaderText="可发数量" ColumnID="CanQty" Width="70px" DataFormatString = "{0:F}"/>
<f:BoundField SortField="EndTime" DataField="EndTime" HeaderText="到货截至日期" ColumnID="EndTime" Width="100px" />
<f:BoundField SortField="SubSite" DataField="SubSite" HeaderText="子网站" ColumnID="SubSite" Width="100px" Hidden="true"/>
<f:BoundField SortField="Extend1" DataField="Extend1" HeaderText="子网站" ColumnID="Extend1" Width="100px" Hidden="true" />
<f:BoundField SortField="Extend2" DataField="Extend2" HeaderText="子网站" ColumnID="Extend2" Width="100px" Hidden="true"/>
<f:BoundField SortField="Extend3" DataField="Extend3" HeaderText="子网站" ColumnID="Extend3" Width="100px" Hidden="true"/>
<f:BoundField SortField="AskQty" DataField="AskQty" HeaderText="要货数量" ColumnID="AskQty" Width="70px" Hidden="true" DataFormatString = "{0:F}"/>
<f:BoundField SortField="ReduceQty" Hidden="true" DataField="ReduceQty" HeaderText="减产数量" ColumnID="ReduceQty" Width="70px" DataFormatString = "{0:F}"/>
<f:BoundField SortField="ShipQty" DataField="ShippedQty" HeaderText="发货数量" ColumnID="ShippedQty" Width="70px" Hidden="true" />
<f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数量" ColumnID="ReceiveQty" Width="70px" Hidden="true" />
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="50px" Hidden="true" />
<f:BoundField SortField="CurrencyDesc" DataField="CurrencyDesc" HeaderText="币种" ColumnID="CurrencyDesc" Width="40px" Hidden="true" />
<f:BoundField SortField="UpdateInfo" DataField="UpdateInfo" HeaderText="备注" Hidden="true" />
<f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="收货口" ColumnID="ReceivedPort" Hidden="true" />
</Columns>
<Listeners>
<f:Listener Event="afteredit" Handler="f_onAfterEdit" />
</Listeners>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="640px" Width="700px" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
<f:HiddenField runat="server" ID ="TXT_State"></f:HiddenField>
</form>
<script>
//function onGridAfterEdit(event, value, params) {
// var me = this, columnId = params.columnId, rowId = params.rowId;
// alert("me:" + me)
// alert("columnId:" + columnId);
// alert("rowValue:" + value.value);
// alert("params:" + rowId);
// if (columnId == undefined) {
// alert("22:");
// //var chineseScore = me.getCellValue(rowId, 'ProduceDate');
// //alert("chineseScore:"+chineseScore);
// me.updateCellValue('1', 'Batch1', "180712");
// }
//}
function f_onAfterEdit(event, value, params)
{
alert("11:");
var me = this, rowId = params.rowId;
if (params.columnId === 'ProduceDate') {
me.updateCellValue(rowId, 'Batch1', value);
}
alert("33:");
}
</script>
</body>
</html>

491
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.cs

@ -0,0 +1,491 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Controller;
using FineUI;
using SCP.Code;
using CK.SCP.Models.Enums;
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_ASN_CREATE : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetV_TB_POData();
if (Request.QueryString["State"] != null)
{
if (Request.QueryString["State"] == "1")
{
BindDetail(true);
}
else
{
BindDetail();
}
}
else
{
BindDetail();
}
SetRoleRule();
TranslatorAgents(Toolbar1);
TranslatorAgent(Grid_V_TB_ASK_DETAIL);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
}
}
private void SetRoleRule()
{
IsPriceVisible(Grid_V_TB_ASK_DETAIL, "价格");
}
public void SearchV_TB_ASK_DETAILData(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum = Request["AskBillNum"];
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void GetV_TB_POData()
{
V_TB_ASK _entity = new V_TB_ASK();
_entity.AskBillNum = Request["AskBillNum"];
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
var _result = _ret.Result.FirstOrDefault();
Session["Ask"] = _result;
this.TXT_AskBillNum.Text = _result.AskBillNum;
this.TXT_State.Text = _result.State.ToString();
this.TXT_Site.Text = _result.Site_Desc;
this.TXT_State_Desc.Text = _result.State_DESC;
this.TXT_VendName.Text = _result.VendName;
this.TXT_Remark.Text = _result.Remark;
this.TXT_SubSite.Text = _result.SubSite;
this.TXT_Extend1.Text = _result.Extend1;
this.TXT_Extend2.Text = _result.Extend2;
this.TXT_Extend3.Text = _result.Extend3;
DP_ShipTime.SelectedDate = DateTime.Now;
DDL_PORT.DataSource = ScpCache.PortList.Where(p => CurrentUser.FactoryList.Contains(p.FACTORY_ID));
DDL_PORT.DataBind();
DDL_PORT.SelectedValue = _result.ReceivedPort;
#region 按钮控制
#endregion
}
});
}
public void BindDetail(bool p_state=false)
{
SearchV_TB_ASK_DETAILData((ret) => {
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
var _ls = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(list.ToList());
var _notifyList = new List<string>();
_ls.ForEach(p =>
{
if (p.PackQty == 1 || p.PackQty == 0)
{
_notifyList.Add(string.Format("请注意零件编号{0}行号{1}标包数为1是否填写正确,如果不正确请修改", p.PartCode, p.PoLine));
}
p.Batch = DateTime.Now.ToString("yyMMdd");
p.ProduceDate = DateTime.Now;
if (p_state == true)
{
p.TempQty = p.CanQty;
}
else
{
p.TempQty = 0;
}
}
);
Grid_V_TB_ASK_DETAIL.DataSource = _ls;
Grid_V_TB_ASK_DETAIL.DataBind();
if (_notifyList.Count > 0)
{
Alert.Show(string.Join("<br>", _notifyList));
}
});
}
private void IsBatch(string batch)
{
try
{
batch = batch.Trim();
if (batch.Length != 6)
{
Alert.Show($"批次号【{batch}】必需是6位,格式为 YYMMDD");
}
int y = Convert.ToInt32(batch.Substring(0, 2));
int m = Convert.ToInt32(batch.Substring(2, 2));
int d = Convert.ToInt32(batch.Substring(4, 2));
var date = new DateTime(y, m, d);
if (date.Date > DateTime.Now.Date)
{
Alert.Show($"批次号【{batch}】错误,不应大于发货日期");
}
}
catch
{
Alert.Show($"批次号【{batch}】错误,批次必需是 YYMMDD ");
}
}
List<V_TB_ASK_DETAIL> _askDetaillist = new List<V_TB_ASK_DETAIL>();
protected void btnCreate_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(TXT_AskBillNum.Text) || string.IsNullOrEmpty(TXT_ShipUser.Text) || DP_ReceiveTime.SelectedDate==null || DP_ShipTime.SelectedDate==null)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("要货看板单据编号、发货人、到货时间、收货时间不能为空"));
return;
}
var _model=Session["Ask"] as V_TB_ASK;
if (_model == null)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("编辑的数据不正确"));
return;
}
if (_model.State != (int)AskState.Confirm && _model.State != (int)AskState.Receive && _model.State != (int)AskState.Ship)
{
Alert.Show("要货看板必须为确认后状态");
return;
}
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_ASK_DETAIL.GetModifiedDict();
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.PoBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.ShippedQty = ConvertHelper.To<Decimal>(rowDataKeys[4]);
_entity.ReceivedQty = ConvertHelper.To<Decimal>(rowDataKeys[5]);
_entity.BeginTime = ConvertHelper.To<DateTime>(rowDataKeys[6]);
_entity.EndTime = ConvertHelper.To<DateTime>(rowDataKeys[7]);
_entity.PoUnit = rowDataKeys[8] as string;
_entity.LocUnit = rowDataKeys[9] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[10]);
_entity.Currency = rowDataKeys[11] as string;
_entity.PackQty = ConvertHelper.To<Decimal>(rowDataKeys[12]);
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[13]);
_entity.DockCode = rowDataKeys[14] as string;
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[15]);
_entity.Remark = rowDataKeys[21] as string; //把用户信息传给备注
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[17]);
_entity.CreateUser = rowDataKeys[18] as string;
_entity.UpdateTime = ConvertHelper.To<DateTime?>(rowDataKeys[19]);
_entity.UpdateUser = rowDataKeys[20] as string;
_entity.UpdateInfo = rowDataKeys[21] as string;
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[22]);
_entity.PartDesc1 = rowDataKeys[23] as string;
_entity.CurrencyDesc = rowDataKeys[24] as string;
_entity.Site = rowDataKeys[25] as string;
_entity.VendName = rowDataKeys[26] as string;
_entity.PartDesc2 = rowDataKeys[27] as string;
_entity.AskBillNum = rowDataKeys[28] as string;
_entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[29]);
_entity.TempQty = ConvertHelper.To<decimal>(rowDataKeys[30]);
_entity.ReceivedPort = rowDataKeys[31] as string;
_entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[33]);
_entity.ValidityDays = ConvertHelper.To<int>(rowDataKeys[34]);
_entity.Batch = ConvertHelper.To<string>(rowDataKeys[35]);
_entity.ProduceDate = DateTime.Now;
if (Convert.ToDecimal(_entity.AskQty) == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("要货看板数量不能为 0"));
return;
}
if (modifiedDict.Keys.Contains(i))
{
var modifyValue = modifiedDict[i];
var _Qty1 = modifyValue.Keys.Contains("TempQty") ? modifyValue["TempQty"] : _entity.TempQty;
var _Batch1 = modifyValue.Keys.Contains("Batch") ? modifyValue["Batch"] : _entity.Batch;
var _VendBatch = modifyValue.Keys.Contains("VendBatch") ? modifyValue["VendBatch"].ToString() : _entity.Batch;
var _ProduceDate = modifyValue.Keys.Contains("ProduceDate") ? modifyValue["ProduceDate"].ToString() : _entity.ProduceDate.ToString();
if (modifyValue.Keys.Contains("SubSite"))
{
_entity.SubSite = modifyValue["SubSite"].ToString();
}
if (modifyValue.Keys.Contains("Extend1"))
{
_entity.Extend1 = modifyValue["Extend1"].ToString();
}
if (modifyValue.Keys.Contains("Extend2"))
{
_entity.Extend2 = modifyValue["Extend2"].ToString();
}
if (modifyValue.Keys.Contains("Extend3"))
{
_entity.Extend3 = modifyValue["Extend3"].ToString();
}
if (string.IsNullOrEmpty(_VendBatch) || string.IsNullOrEmpty(_ProduceDate))
{
Alert.Show("供应商批次和生产日期不能为空!");
return;
}
object _PackQty = 0;
if (modifyValue.Keys.Contains("PackQty"))
{
_PackQty = modifyValue["PackQty"];
}
else
{
_PackQty = _entity.PackQty;
}
decimal QtyAll = 0;
if (ConvertHelper.To<decimal>(_Qty1) > 0)
{
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
var number = ConvertHelper.To<decimal>(_Qty1);
QtyAll += number;
if (QtyAll > 0)
{
DateTime _d = DateTime.Now;
if (_ProduceDate == null && DateTime.TryParse(_ProduceDate.ToString(), out _d) == false)
{
Alert.Show("日期填写错误!");
return;
}
DateTime dt = DateTime.Parse(_ProduceDate.ToString());
_detail.Batch = _Batch1.ToString().Trim();
_detail.TempQty = number;
_detail.PackQty = ConvertHelper.To<decimal>(_PackQty);
_detail.VendBatch = _VendBatch.ToString();
_detail.ProduceDate = dt;
_askDetaillist.Add(_detail);
}
}
if (modifyValue.Keys.Contains("Qty2") && modifyValue.Keys.Contains("Batch2"))
{
var _Qty2 = modifyValue["Qty2"];
var _Batch2 = modifyValue["Batch2"];
if (_Batch2.ToString().Trim() != "" && ConvertHelper.To<decimal>(_Qty2) > 0)
{
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
IsBatch(_Batch2.ToString().Trim());
var number = ConvertHelper.To<decimal>(_Qty2);
QtyAll += number;
if (QtyAll > 0)
{
_detail.Batch = _Batch2.ToString().Trim();
_detail.TempQty = number;
_detail.PackQty = ConvertHelper.To<decimal>(_PackQty);
_detail.VendBatch = _VendBatch.ToString();
_detail.ProduceDate = DateTime.Parse(_ProduceDate.ToString());
_askDetaillist.Add(_detail);
}
}
}
if (modifyValue.Keys.Contains("Qty3") && modifyValue.Keys.Contains("Batch3"))
{
var _Qty3 = modifyValue["Qty3"];
var _Batch3 = modifyValue["Batch3"];
if (_Batch3.ToString().Trim() != "" && ConvertHelper.To<decimal>(_Qty3) > 0)
{
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
IsBatch(_Batch3.ToString().Trim());
var number = ConvertHelper.To<decimal>(_Qty3);
QtyAll += number;
if (QtyAll > 0)
{
_detail.Batch = _Batch3.ToString().Trim();
_detail.TempQty = number;
_detail.PackQty = ConvertHelper.To<decimal>(_PackQty);
_detail.VendBatch = _VendBatch.ToString();
_detail.ProduceDate = DateTime.Parse(_ProduceDate.ToString());
_askDetaillist.Add(_detail);
}
}
}
if (QtyAll > _entity.AskQty - _entity.ShippedQty - _entity.ReduceQty)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "发货数量>可发数量-减产数量"));
return;
}
_entity.ShippedQty = _entity.ShippedQty + QtyAll;
}
else
{
if (_entity.TempQty > 0)
{
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
_entity.Batch = DateTime.Now.ToString("yyMMdd");
_entity.VendBatch = DateTime.Now.ToString("yyMMdd");
_entity.ShippedQty = _entity.TempQty;
_entity.ProduceDate = DateTime.Now;
_entity.PackQty = _entity.PackQty;
_askDetaillist.Add(_detail);
}
}
}
_model.ShipTime = DP_ShipTime.SelectedDate;
_model.ShipUser = TXT_ShipUser.Text;
_model.ReceiveTime = DP_ReceiveTime.SelectedDate;
_model.ReceiveUser = _model.Buyer;
List<string> _ls = new List<string>();
if (_askDetaillist.Count == 0)
{
Alert.Show("发货数量未填写");
return;
}
if (CurrentUser.FactoryList.Count > 0)
{
if (CurrentUser.FactoryList.FirstOrDefault()== "CNS" || CurrentUser.FactoryList.FirstOrDefault() == "BJCIAI")
{
_askDetaillist.ForEach(p =>
{
p.VendBatch = p.Batch;
});
}
}
var ret=SCP_ASK_CONTROLLER.Save_ASK_TO_ASN(_model, _askDetaillist, TXT_PlateNumber.Text, CurrentUser.ChineseName ,CurrentUser.CellPhone);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("生成发货单成功!");
GetV_TB_POData();
BindDetail();
}
}
private string GetBatch(DateTime dt)
{
string strResult = "";
if (dt != null)
{
string strYear = dt.Year.ToString().Substring(2, 2);
string strMonth = "";
int iMonth = dt.Month;
if (iMonth.ToString().Length == 1)
{
strMonth = "0" + iMonth.ToString();
}
else
{
strMonth = iMonth.ToString();
}
string strDay = dt.Day.ToString();
if (strDay.Length == 1)
{
strDay = "0" + strDay;
}
strResult = strYear + strMonth + strDay;
}
return strResult;
}
protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void Grid_V_TB_ASK_DETAIL_RowDataBound(object sender, GridRowEventArgs e)
{
//GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex];
//object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[e.RowIndex];
////var TXT_PackQty = (NumberBox)row.FindControl("TXT_PackQty");
////var txtBatch1 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBatch1");
////var txtBatch2 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBatch2");
////var txtBatch3 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBatch3");
////var txtQty1 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty1");
////var txtQty2 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty2");
////var txtQty3 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty3");
//var _shippedQty = ConvertHelper.To<Decimal>(rowDataKeys[4]);
//var _askQty = ConvertHelper.To<Decimal>(rowDataKeys[29]);
//var a = row.TemplateContainers;
//if (_shippedQty >= _askQty)
//{
// //foreach (GridColumn column in Grid_V_TB_ASK_DETAIL.Columns)
// //{
// // e
// // e.CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable";
// //}
//}
//else
//{
// //txtQty1.Text = "0";
// //txtBatch1.Text = DateTime.Now.ToString("yyMMdd");
//}
}
protected void btnAll_Click(object sender, EventArgs e)
{
BindDetail(true);
}
//protected void btnSet_Click(object sender, EventArgs e)
//{
//}
}
}

359
SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.designer.cs

@ -0,0 +1,359 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.SupplierData.SupplierLogistics
{
public partial class SCP_ASN_CREATE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// pmg1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager pmg1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// btnCreate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCreate;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TXT_State_Desc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_State_Desc;
/// <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_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
/// <summary>
/// TXT_SubSite 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_SubSite;
/// <summary>
/// TXT_Extend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend1;
/// <summary>
/// TXT_Extend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend2;
/// <summary>
/// TXT_Extend3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Extend3;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TXT_PlateNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PlateNumber;
/// <summary>
/// TXT_ShipUser 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ShipUser;
/// <summary>
/// DP_ShipTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_ShipTime;
/// <summary>
/// DP_ReceiveTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_ReceiveTime;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// DDL_PORT 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_PORT;
/// <summary>
/// TXT_Remark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Remark;
/// <summary>
/// Grid_V_TB_ASK_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL;
/// <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;
/// <summary>
/// TXT_PackQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox TXT_PackQty;
/// <summary>
/// txtBatch1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBatch1;
/// <summary>
/// NumberBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox NumberBox1;
/// <summary>
/// DatePicker1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker1;
/// <summary>
/// TextBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox1;
/// <summary>
/// NumberBox2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox NumberBox2;
/// <summary>
/// TextBox2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox2;
/// <summary>
/// NumberBox4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox NumberBox4;
/// <summary>
/// TXT_VendBatch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendBatch;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
/// <summary>
/// TXT_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField TXT_State;
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save