Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
qian | 25793d1fa5 | 1 week ago |
qian | 126acd70a5 | 1 week ago |
qian | 4620c1a86c | 1 week ago |
qian | e19742cce8 | 1 week ago |
qian | f7ea333dff | 1 month ago |
qian | eafd4aeac9 | 1 month ago |
qian | 243d98b11a | 5 months ago |
qian | f92c866451 | 6 months ago |
qian | c11b7139e9 | 7 months ago |
qian | 68825d4a2e | 7 months ago |
qian | 18b9f9037a | 8 months ago |
qian | b62c1736dc | 8 months ago |
qian | 0fb97336ff | 8 months ago |
qian | 0c57de2029 | 8 months ago |
qian | 4dfac2ff31 | 8 months ago |
qian | 79aaa56176 | 8 months ago |
qian | 50d7d979cc | 8 months ago |
qian | 3384584265 | 9 months ago |
qian | 439eae444e | 9 months ago |
qian | 9870629ef4 | 9 months ago |
qian | d6f2c5f6d7 | 10 months ago |
qian | 2f7e71783d | 10 months ago |
76 changed files with 6721 additions and 1019 deletions
@ -0,0 +1,42 @@ |
|||
using CK.SCP.Utils; |
|||
using MailKit.Security; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace CK.SCP.Common |
|||
{ |
|||
public class MailManager |
|||
{ |
|||
/// <summary>
|
|||
/// 发送邮件
|
|||
/// </summary>
|
|||
/// <param name="mails"></param>
|
|||
/// <param name="mailbody"></param>
|
|||
/// <param name="p_MailTitle"></param>
|
|||
public static void SendMailOrders(string mails = "", string mailbody = "", string p_MailTitle = "") |
|||
{ |
|||
try |
|||
{ |
|||
List<EmailAddress> toList = new List<EmailAddress>(); |
|||
EmailAddress add = new EmailAddress(mails, mails); |
|||
toList.Add(add); |
|||
var smtpMailSender = new MailKitMailSender(SecureSocketOptions.StartTls); |
|||
smtpMailSender.BuildOrderMessage( |
|||
toList, |
|||
p_MailTitle, |
|||
mailbody, |
|||
"BBC" |
|||
); |
|||
smtpMailSender.SendOrder(); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message + e.InnerException?.Message); |
|||
throw e; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,622 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Data.Entity.Migrations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using CK.SCP.Models; |
|||
using CK.SCP.Models.Enums; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Models.ScpEntity.ExcelImportEntity; |
|||
using CK.SCP.Utils; |
|||
using System.Data.Entity.Core; |
|||
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
|||
using System.Text.RegularExpressions; |
|||
using System.Threading; |
|||
using System.Data; |
|||
using Newtonsoft.Json; |
|||
using CK.SCP.Models.UniApiEntity; |
|||
using CK.SCP.Models.AppBoxEntity; |
|||
|
|||
namespace CK.SCP.Controller |
|||
{ |
|||
public class SCP_MPO_CONTROLLER |
|||
{ |
|||
/// <summary>
|
|||
/// 获取一般材料订单
|
|||
/// </summary>
|
|||
/// <param name="p_entity"></param>
|
|||
/// <param name="p_action"></param>
|
|||
public static void Get_V_TB_MPO_List(V_TB_MPO p_entity, Action<ResultObject<IQueryable<V_TB_MPO>>> p_action) |
|||
{ |
|||
ResultObject<IQueryable<V_TB_MPO>> _ret = new ResultObject<IQueryable<V_TB_MPO>>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
IQueryable<V_TB_MPO> q = db.V_TB_MPO; |
|||
if (p_entity.DocDateBegin != DateTime.MinValue) |
|||
{ |
|||
q = q.Where(p => p.DocDate >= p_entity.DocDateBegin); |
|||
} |
|||
if (p_entity.DocDateEnd != DateTime.MinValue) |
|||
{ |
|||
q = q.Where(p => p.DocDate <= p_entity.DocDateEnd); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(p_entity.PurdocNO)) |
|||
{ |
|||
q = q.Where(p => p.PurdocNO == p_entity.PurdocNO.Trim()); |
|||
} |
|||
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0) |
|||
{ |
|||
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendorNO)); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(p_entity.VendorNO)) |
|||
{ |
|||
q = q.Where(p => p.VendorNO.Contains(p_entity.VendorNO)); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(p_entity.VendorDesc)) |
|||
{ |
|||
q = q.Where(p => p.VendorDesc.Contains(p_entity.VendorDesc)); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(p_entity.CreatedBy)) |
|||
{ |
|||
q = q.Where(p => p.CreatedBy.Contains(p_entity.CreatedBy)); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(p_entity.AcceptStatusSelect)) |
|||
{ |
|||
var acceptStatus = int.Parse(p_entity.AcceptStatusSelect); |
|||
q = q.Where(p => p.AcceptStatus == acceptStatus); |
|||
} |
|||
_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_MPO_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_MPO_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_MPO_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_MPO_List", e.Message); |
|||
throw e; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取一般材料订单明细
|
|||
/// </summary>
|
|||
/// <param name="p_entity"></param>
|
|||
/// <param name="p_action"></param>
|
|||
public static void Get_V_TB_MPO_DETAIL_List(V_TB_MPO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_MPO_DETAIL>>> p_action) |
|||
{ |
|||
ResultObject<IQueryable<V_TB_MPO_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_MPO_DETAIL>>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
IQueryable<V_TB_MPO_DETAIL> q = db.V_TB_MPO_DETAIL; |
|||
if (!string.IsNullOrWhiteSpace(p_entity.Ctype)) |
|||
{ |
|||
q = q.Where(p => p.Ctype == p_entity.Ctype); |
|||
} |
|||
if (p_entity.purdocnolist != null && p_entity.purdocnolist.Count > 0) |
|||
{ |
|||
q = q.Where(p => p_entity.purdocnolist.Contains(p.PurdocNO)); |
|||
} |
|||
_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_MPO_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_MPO_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_MPO_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_MPO_DETAIL_List", e.Message); |
|||
throw e; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 一般材料订单明细列表
|
|||
/// </summary>
|
|||
/// <param name="p_lst">PurdocNOlist</param>
|
|||
/// <returns></returns>
|
|||
public static List<V_TB_MPO_DETAIL> GetMPODetailList(List<String> p_lst) |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
return db.V_TB_MPO_DETAIL.Where(p => p_lst.Contains(p.PurdocNO)).ToList(); |
|||
} |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 作废传接口
|
|||
/// </summary>
|
|||
/// <param name="ls"></param>
|
|||
/// <returns></returns>
|
|||
public static ResultObject<bool> Save_ts_uni_api(List<string> ls) |
|||
{ |
|||
ResultObject<bool> _ret = new ResultObject<bool>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
|
|||
{ |
|||
List<string> lineError = new List<string>(); |
|||
List<string> ErrorList = new List<string>(); |
|||
|
|||
foreach (var po in ls) |
|||
{ |
|||
var po1 = db.TB_MATERIALORDERS.FirstOrDefault(t => t.PurdocNO == po && t.Ctype != "D"); |
|||
po1.AcceptStatus = (int)GeneralMaterialOrderState.Finish; |
|||
db.TB_MATERIALORDERS.AddOrUpdate(po1); |
|||
var po2 = db.TB_MATERIALORDERS_DETAIL.Where(t => t.PurdocNO == po && t.Ctype != "D").ToList(); |
|||
foreach (var po3 in po2) |
|||
{ |
|||
po3.AcceptStatus = (int)GeneralMaterialOrderState.Finish; |
|||
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(po3); |
|||
} |
|||
var lx = db.TS_UNI_API.Where(t => t.BillNum == po && t.Receiver == "I").ToList(); |
|||
foreach (var po4 in lx) |
|||
{ |
|||
po4.State = 1; |
|||
po4.Receiver = "D"; |
|||
db.TS_UNI_API.AddOrUpdate(po4); |
|||
} |
|||
} |
|||
} |
|||
|
|||
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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(e); |
|||
throw e; |
|||
} |
|||
return _ret; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 保存状态
|
|||
/// </summary>
|
|||
/// <param name="p_list"></param>
|
|||
/// <param name="p_state"></param>
|
|||
/// <returns></returns>
|
|||
public static ResultObject<bool> Save_MPO_STATE(List<string> p_list, GeneralMaterialOrderState p_state) |
|||
{ |
|||
ResultObject<bool> _ret = new ResultObject<bool>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
|
|||
switch (p_state) |
|||
{ |
|||
case GeneralMaterialOrderState.Finish: |
|||
var orblist = db.TB_MATERIALORDERS.Where(q => p_list.Contains(q.PurdocNO)).ToList(); |
|||
var ctylist = orblist.Select(q => q.Ctype).ToList(); |
|||
if (ctylist.Contains("D")) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "存在已经作废的数据,请重新选择!"; |
|||
_ret.MessageList.Add(_ret.Message); |
|||
return _ret; |
|||
} |
|||
var acclist = orblist.Select(q => q.AcceptStatus).ToList(); |
|||
if (acclist.Contains((int)GeneralMaterialOrderState.Finish)) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "存在已经确认的数据,请重新选择!"; |
|||
_ret.MessageList.Add(_ret.Message); |
|||
return _ret; |
|||
} |
|||
foreach (var item in p_list) |
|||
{ |
|||
var tbMater = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == item); |
|||
tbMater.AcceptStatus = (int)GeneralMaterialOrderState.Finish; |
|||
var tbMaterList = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == item).ToList(); |
|||
tbMaterList.ForEach(q => |
|||
{ |
|||
q.AcceptStatus = (int)GeneralMaterialOrderState.Finish; |
|||
}); |
|||
db.TB_MATERIALORDERS.AddOrUpdate(itm1 => itm1.UID, tbMater); |
|||
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(itm => itm.UID, tbMaterList.ToArray()); |
|||
} |
|||
break; |
|||
case GeneralMaterialOrderState.New: |
|||
var MAblist = db.TB_MATERIALORDERS.Where(q => p_list.Contains(q.PurdocNO)).ToList(); |
|||
var ctypelist = MAblist.Select(q => q.Ctype).ToList(); |
|||
if (ctypelist.Contains("D")) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "存在已经作废的数据,请重新选择!"; |
|||
_ret.MessageList.Add(_ret.Message); |
|||
return _ret; |
|||
} |
|||
var acceplist = MAblist.Select(q => q.AcceptStatus).ToList(); |
|||
if (acceplist.Contains((int)GeneralMaterialOrderState.New)) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "存在已经待确认的数据,请重新选择!"; |
|||
_ret.MessageList.Add(_ret.Message); |
|||
return _ret; |
|||
} |
|||
foreach (var item in p_list) |
|||
{ |
|||
var tbMater = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == item); |
|||
tbMater.AcceptStatus = (int)GeneralMaterialOrderState.New; |
|||
var tbMaterList = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == item).ToList(); |
|||
tbMaterList.ForEach(q => |
|||
{ |
|||
q.AcceptStatus = (int)GeneralMaterialOrderState.New; |
|||
q.UpdateTime = DateTime.Now.ToString(); |
|||
}); |
|||
db.TB_MATERIALORDERS.AddOrUpdate(itm1 => itm1.UID, tbMater); |
|||
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(itm => itm.UID, tbMaterList.ToArray()); |
|||
} |
|||
break; |
|||
} |
|||
if (db.SaveChanges() != -1) |
|||
{ |
|||
_ret.State = ReturnStatus.Succeed; |
|||
_ret.Result = true; |
|||
return _ret; |
|||
|
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "数据更新失败!"; |
|||
_ret.MessageList.Add(_ret.Message); |
|||
return _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.Result = false; |
|||
_ret.ErrorList.Add(dbEx); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MPO_CONTROLLER), "Save_MPO_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_MPO_CONTROLLER), "Save_MPO_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_MPO_CONTROLLER), "Save_MPO_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_MPO_CONTROLLER), "Save_MPO_STATE", e.Message); |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(e); |
|||
} |
|||
return _ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取材料订单主表数据
|
|||
/// </summary>
|
|||
/// <param name="PurdocNO"></param>
|
|||
/// <returns></returns>
|
|||
public static TB_MATERIALORDERS GetTbMaterialorders(string PurdocNO) |
|||
{ |
|||
TB_MATERIALORDERS MATERIALORDERS = new TB_MATERIALORDERS(); |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
MATERIALORDERS = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == PurdocNO); |
|||
} |
|||
return MATERIALORDERS; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取材料订单明细表数据
|
|||
/// </summary>
|
|||
/// <param name="PurdocNO"></param>
|
|||
/// <returns></returns>
|
|||
public static List<TB_MATERIALORDERS_DETAIL> GetTbMaterialordersDetailList(string PurdocNO) |
|||
{ |
|||
List<TB_MATERIALORDERS_DETAIL> MATERIALORDERS = new List<TB_MATERIALORDERS_DETAIL>(); |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
MATERIALORDERS = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == PurdocNO).ToList(); |
|||
} |
|||
if (MATERIALORDERS.Count() > 0) |
|||
{ |
|||
MATERIALORDERS.ForEach(q => |
|||
{ |
|||
if (q.Ctype == "D") |
|||
{ |
|||
q.CType_DESC = "是"; |
|||
} |
|||
else |
|||
{ |
|||
q.CType_DESC = "否"; |
|||
} |
|||
}); |
|||
} |
|||
return MATERIALORDERS; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 打印数据
|
|||
/// </summary>
|
|||
/// <param name="p_AsnBillNum"></param>
|
|||
/// <returns></returns>
|
|||
public static DataSet MPO_REPORT(string PurdocNO) |
|||
{ |
|||
DataSet ds = new DataSet(); |
|||
|
|||
TB_MATERIALORDERS order = GetTbMaterialorders(PurdocNO); |
|||
V_MPO_PRINT print = new V_MPO_PRINT(); |
|||
print.PURDOCNO = order.PurdocNO; |
|||
print.DOCDATE = order.DocDate.ToString("yyyy-MM-dd"); |
|||
print.PHONE = order.PHONE; |
|||
print.FAXNUM = order.FAXNUM; |
|||
print.PURGRPDESC = order.PurgrpDesc; |
|||
print.VendorNO = order.VendorNO; |
|||
print.FIRSTTELNO = order.FIRSTTELNO; |
|||
print.STAGEDESC = order.STAGEDESC; |
|||
|
|||
TA_VENDER vender = GET_TA_VENDER(order.VendorNO); |
|||
if (vender != null) |
|||
{ |
|||
print.CAAIFax = vender.VendName; |
|||
print.CurrentUserAdress = vender.Address; |
|||
print.RESPONSIBLESALESPERSON = vender.Contacter; |
|||
print.SupplierFax = vender.Fax; |
|||
} |
|||
List<TB_MATERIALORDERS_DETAIL> detailList = GetTbMaterialordersDetailList(PurdocNO); |
|||
List<V_MPO_PRINT_DETAIL> lsDetail = new List<V_MPO_PRINT_DETAIL>(); |
|||
decimal SUM = 0.00M; |
|||
detailList.ForEach(p => |
|||
{ |
|||
V_MPO_PRINT_DETAIL _detail = new V_MPO_PRINT_DETAIL(); |
|||
_detail.PURCHASEREQNO = p.PurchaseReqNO; |
|||
_detail.PROPOSERDESC = p.ProposerDesc; |
|||
_detail.MTLNO = p.MtlNO; |
|||
_detail.SHORTTEXT = p.Shorttext; |
|||
_detail.SIZECOL = p.SizeCol; |
|||
_detail.UNITDES = p.Unitdes; |
|||
_detail.QUANTITY = p.Quantity.ToString("#.####"); |
|||
_detail.PRICE = p.PRICE.ToString("#.######"); |
|||
_detail.NETVALUE = p.NetValue.ToString("#.######"); |
|||
_detail.PURINFORECORD = p.PurinfoReCord; |
|||
_detail.ITEMDELIVERYDATE = p.ItemDeliveryDate.ToString("yyyy-MM-dd"); |
|||
_detail.GLACCTNODES = p.Glaccnum; |
|||
_detail.COSTCENTERDES = p.CostCenterDes; |
|||
_detail.PURDOCITEMNO = p.PURDOCITEMNO; |
|||
_detail.CType_DESC = p.CType_DESC; |
|||
lsDetail.Add(_detail); |
|||
if (p.Ctype != "D") |
|||
{ |
|||
SUM += p.NetValue; |
|||
} |
|||
}); |
|||
print.Total = SUM.ToString("F6"); |
|||
var detail = detailList.FirstOrDefault(q => !string.IsNullOrEmpty(q.Remake)); |
|||
if (detail != null) |
|||
{ |
|||
print.Remake = detail.Remake; |
|||
} |
|||
var dt = ConvertHelper.ToDataTable(new List<V_MPO_PRINT> { print }); |
|||
ds.Tables.Add(dt); |
|||
var dt1 = ConvertHelper.ToDataTable(lsDetail); |
|||
ds.Tables.Add(dt1); |
|||
return ds; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取打印相关的供应商信息
|
|||
/// </summary>
|
|||
/// <param name="VENDID"></param>
|
|||
/// <returns></returns>
|
|||
public static TA_VENDER GET_TA_VENDER (string VENDID) |
|||
{ |
|||
TA_VENDER _VENDER = new TA_VENDER(); |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
_VENDER = db.TA_VENDER.FirstOrDefault(q => q.VendId == VENDID); |
|||
} |
|||
return _VENDER; |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,330 @@ |
|||
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_ToleranceProportion_Controller |
|||
{ |
|||
/// <summary>
|
|||
/// 获取容差控制列表
|
|||
/// </summary>
|
|||
/// <param name="p_entity"></param>
|
|||
/// <param name="p_action"></param>
|
|||
public static void Get_TA_ToleranceProportion_List(TA_ToleranceProportion p_entity, Action<ResultObject<IQueryable<V_TA_ToleranceProportion>>> p_action) |
|||
{ |
|||
ResultObject<IQueryable<V_TA_ToleranceProportion>> _ret = new ResultObject<IQueryable<V_TA_ToleranceProportion>>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
IQueryable<V_TA_ToleranceProportion> q = db.V_TA_ToleranceProportion; |
|||
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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_List", e.Message); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
/// <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_PART_ToleranceProportion> p_order_list, string site, string p_creator) |
|||
{ |
|||
ResultObject<bool> _ret = new ResultObject<bool>(); |
|||
List<TA_ToleranceProportion> list = new List<TA_ToleranceProportion>(); |
|||
_ret.State = ReturnStatus.Succeed; |
|||
_ret.Result = true; |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
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) |
|||
{ |
|||
ErrorList.Add(string.Join("<br>", _ls.ToArray())); |
|||
} |
|||
}); |
|||
if (ErrorList.Count > 0) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.MessageList.AddRange(ErrorList); |
|||
_ret.Result = false; |
|||
} |
|||
else |
|||
{ |
|||
_lst.ForEach(p => |
|||
{ |
|||
var mold = db.TA_ToleranceProportion.FirstOrDefault(t => t.PartCode.ToUpper() == p.零件号.ToUpper() && t.Site == p.工厂编码.Trim()); |
|||
if (mold == null) |
|||
{ |
|||
mold = new TA_ToleranceProportion |
|||
{ |
|||
PartCode = p.零件号.ToUpper(), |
|||
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
|||
CreateUser = p_creator, |
|||
Site = p.工厂编码.Trim(), |
|||
ToleranceProportion = decimal.Parse(p.容差), |
|||
}; |
|||
} |
|||
else |
|||
{ |
|||
mold.ToleranceProportion = decimal.Parse(p.容差); |
|||
mold.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
|||
mold.UpdateUser = p_creator; |
|||
} |
|||
list.Add(mold); |
|||
}); |
|||
|
|||
if (_ret.MessageList.Count == 0) |
|||
{ |
|||
|
|||
db.TA_ToleranceProportion.AddOrUpdate(q => q.UID, list.ToArray()); |
|||
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_ToleranceProportion_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_ToleranceProportion_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_ToleranceProportion_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_ToleranceProportion_Controller), "EXCEL_MOLDSHARING_MOD", e.Message); |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(e); |
|||
_ret.MessageList.Add("保存失败" + e.Message); |
|||
} |
|||
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_PART_ToleranceProportion p_excel, string site) |
|||
{ |
|||
List<string> ErrorList = new List<string>(); |
|||
|
|||
if (string.IsNullOrEmpty(p_excel.零件号) || string.IsNullOrEmpty(p_excel.工厂编码) || string.IsNullOrEmpty(p_excel.容差)) |
|||
{ |
|||
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.零件号)); |
|||
} |
|||
else |
|||
{ |
|||
int count = db.TA_PART.Count(p => p.PartCode == p_excel.零件号 && p.Site == site); |
|||
if (count <= 0) |
|||
{ |
|||
ErrorList.Add(string.Format("零件编号{0}不存在!", p_excel.零件号)); |
|||
} |
|||
decimal ty = 0.00m; |
|||
if (!decimal.TryParse(p_excel.容差, out ty)) |
|||
{ |
|||
ErrorList.Add(string.Format("零件编号{0},容差填写不正确,不是数字类型!", p_excel.零件号)); |
|||
} |
|||
else |
|||
{ |
|||
if (ty > 1 || ty < 0) |
|||
{ |
|||
ErrorList.Add(string.Format("零件编号{0},容差填写不正确,只能填写0到1之间小数!", p_excel.零件号)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
return ErrorList; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 检查是否超出容差数据
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
/// <param name="QtyAll"></param>
|
|||
/// <returns></returns>
|
|||
public static List<string> CheckToleranceProportion(V_TB_ASK_DETAIL entity, decimal QtyAll) |
|||
{ |
|||
List<string> ErrorList = new List<string>(); |
|||
var canQty = entity.AskQty - entity.ShippedQty - entity.ReduceQty; |
|||
// WS 和 WG 类型物料 填写的 发货数 不能大于 (要货数量-已发数量)
|
|||
if (entity.DockCode == "WS" || entity.DockCode == "WG") |
|||
{ |
|||
if (canQty > 0) |
|||
{ |
|||
if (QtyAll > canQty) |
|||
{ |
|||
ErrorList.Add(entity.PartCode + "发货数量>可发数量"); |
|||
} |
|||
} |
|||
} |
|||
// YC 和 WT 填写的 发货数 能大于 (要货数 - 已发数量) 但是 不能 大于容差范围 并且 要货数 - 已发数量 不能小于等于0
|
|||
else if (entity.DockCode == "YC" || entity.DockCode == "WT") |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
var toleranceProportion = db.TA_ToleranceProportion.FirstOrDefault(q => q.PartCode == entity.PartCode); |
|||
if (toleranceProportion == null) |
|||
{ |
|||
ErrorList.Add(entity.PartCode + "没有容差控制,请联系管理员进行填写"); |
|||
} |
|||
else |
|||
{ |
|||
decimal maxqty = entity.AskQty * (1 + toleranceProportion.ToleranceProportion); |
|||
if (canQty <= 0) |
|||
{ |
|||
ErrorList.Add(entity.PartCode + "只能超发一次哦"); |
|||
} |
|||
// 最大要货数量(要货数* 1+容差) - 累计发货数量 <当前填写的 要货数量
|
|||
else if ((maxqty - entity.ShippedQty - entity.ReduceQty )< QtyAll) |
|||
{ |
|||
ErrorList.Add(entity.PartCode + "容差控制为"+ (toleranceProportion.ToleranceProportion * 100)+"% ,本次填写发货数量超出"+ Math.Abs((maxqty - entity.ShippedQty - QtyAll).Value)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
else if ((canQty <= 0) && (QtyAll > 0)) |
|||
{ |
|||
ErrorList.Add(entity.PartCode + "只能超发一次哦"); |
|||
} |
|||
|
|||
|
|||
return ErrorList; |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
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_PART_ToleranceProportion |
|||
{ |
|||
public string 零件号 { get; set; } |
|||
public string 工厂编码 { get; set; } |
|||
public string 容差 { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace CK.SCP.Models.ScpEntity |
|||
{ |
|||
public class TA_ToleranceProportion |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
|
|||
[StringLength(50)] |
|||
public string PartCode { get; set; } |
|||
[DisplayName("容差控制默认0.2 20%")] |
|||
public decimal ToleranceProportion { get; set; } |
|||
|
|||
[StringLength(20)] |
|||
public string CreateUser { get; set; } |
|||
public string CreateTime { get; set; } |
|||
public string UpdateUser { get; set; } |
|||
public string UpdateTime { get; set; } |
|||
[DisplayName("地点")] |
|||
public string Site { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace CK.SCP.Models.ScpEntity |
|||
{ |
|||
|
|||
public partial class TB_MATERIALORDERS |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
|
|||
[DisplayName("采购凭证号")] |
|||
public string PurdocNO { get; set; } |
|||
|
|||
[DisplayName("采购凭证类型描述")] |
|||
public string BuyListStrdes { get; set; } |
|||
[DisplayName("凭证日期(订货日期)")] |
|||
public DateTime DocDate { get; set; } |
|||
[DisplayName("供应商代码")] |
|||
public string VendorNO { get; set; } |
|||
|
|||
[DisplayName("供应商描述")] |
|||
public string VendorDesc { get; set; } |
|||
|
|||
[DisplayName("采购组描述(收货人)")] |
|||
public string PurgrpDesc { get; set; } |
|||
[DisplayName("审批状态 4=审批通过")] |
|||
public string ApprovalStatus { get; set; } |
|||
[DisplayName("供应商状态")] |
|||
public int AcceptStatus { get; set; } |
|||
[DisplayName("交货日程日期")] |
|||
public DateTime ItemdeliveryDate { get; set; } |
|||
[DisplayName("创建人描述")] |
|||
public string CreatedByDesc{ get; set; } |
|||
[DisplayName("创建人")] |
|||
public string CreatedBy { get; set; } |
|||
[DisplayName("状态")] |
|||
public string Ctype { get; set; } |
|||
|
|||
[DisplayName("供应商的联系电话")] |
|||
public string FIRSTTELNO { get; set; } |
|||
[DisplayName("电话")] |
|||
public string PHONE { get; set; } |
|||
[DisplayName("购组传真")] |
|||
public string FAXNUM { get; set; } |
|||
[DisplayName("付款条件描述")] |
|||
public string STAGEDESC { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
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 TB_MATERIALORDERS_DETAIL |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
|
|||
[DisplayName("采购凭证号")] |
|||
public string PurdocNO { get; set; } |
|||
|
|||
[DisplayName("申请单号")] |
|||
public string PurchaseReqNO { get; set; } |
|||
[DisplayName("申请人")] |
|||
public string ProposerDesc { get; set; } |
|||
[DisplayName("物料号")] |
|||
public string MtlNO { get; set; } |
|||
[DisplayName("审批状态 4=审批通过")] |
|||
public string ApprovalStatus { get; set; } |
|||
[DisplayName("供应商状态")] |
|||
public int AcceptStatus { get; set; } |
|||
|
|||
[DisplayName("物料描述")] |
|||
public string Shorttext { get; set; } |
|||
|
|||
[DisplayName("型号规格")] |
|||
public string SizeCol { get; set; } |
|||
[DisplayName("材料牌号")] |
|||
public string Matbrand { get; set; } |
|||
|
|||
[DisplayName("单位")] |
|||
public string Unitdes { get; set; } |
|||
[DisplayName("数量")] |
|||
public decimal Quantity { get; set; } |
|||
[DisplayName("价格")] |
|||
public decimal PRICE { get; set; } |
|||
[DisplayName("金额")] |
|||
public decimal NetValue { get; set; } |
|||
[DisplayName("采购信息")] |
|||
public string PurinfoReCord { get; set; } |
|||
[DisplayName("要求到货日期")] |
|||
public DateTime ItemDeliveryDate { get; set; } |
|||
[DisplayName("科目")] |
|||
public string Glaccnum { get; set; } |
|||
[DisplayName("状态")] |
|||
public string Ctype { get; set; } |
|||
[DisplayName("成本中心")] |
|||
public string CostCenterDes { get; set; } |
|||
[DisplayName("存储地点")] |
|||
public string StoreLocation { get; set; } |
|||
[DisplayName("更新时间")] |
|||
public string UpdateTime { get; set; } |
|||
[NotMapped] |
|||
public string CType_DESC { get; set; } |
|||
[DisplayName("订单行号")] |
|||
public string PURDOCITEMNO { get; set; } |
|||
[DisplayName("备注")] |
|||
public string Remake { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace CK.SCP.Models.ScpEntity |
|||
{ |
|||
public partial class TS_Email |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
[DisplayName("发送的人")] |
|||
[StringLength(50)] |
|||
public string EmailToUser { get; set; } |
|||
[DisplayName("发送的地址")] |
|||
public string EmailAddress { get; set; } |
|||
[DisplayName("发送内容")] |
|||
public string EmailString { get; set; } |
|||
[DisplayName("发送状态 0待发送 1发送成功 2发送失败")] |
|||
public int EmailSendState { get; set; } |
|||
[DisplayName("失败原因")] |
|||
public string EmailSendFailReason { get; set; } |
|||
[DisplayName("发送时间")] |
|||
public string UpdateTime { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,41 @@ |
|||
namespace CK.SCP.Models.ScpEntity |
|||
{ |
|||
public class V_MPO_PRINT |
|||
{ |
|||
public string PURDOCNO { get; set; } |
|||
public string DOCDATE { get; set; } |
|||
public string PHONE { get; set; } |
|||
public string FAXNUM { get; set; } |
|||
public string VendorNO { get; set; } |
|||
public string PURGRPDESC { get; set; } |
|||
public string CAAIFax { get; set; } |
|||
public string CurrentUserAdress { get; set; } |
|||
public string RESPONSIBLESALESPERSON { get; set; } |
|||
public string SupplierFax { get; set; } |
|||
public string FIRSTTELNO { get; set; } |
|||
public string STAGEDESC { get; set; } |
|||
public string Total { get; set; } |
|||
public string Remake { get; set; } |
|||
|
|||
} |
|||
|
|||
public class V_MPO_PRINT_DETAIL |
|||
{ |
|||
public string PURCHASEREQNO { get; set; } |
|||
public string PROPOSERDESC { get; set; } |
|||
public string MTLNO { get; set; } |
|||
public string SHORTTEXT { get; set; } |
|||
public string SIZECOL { get; set; } |
|||
public string UNITDES { get; set; } |
|||
public string QUANTITY { get; set; } |
|||
public string PRICE { get; set; } |
|||
public string NETVALUE { get; set; } |
|||
public string PURINFORECORD { get; set; } |
|||
public string ITEMDELIVERYDATE { get; set; } |
|||
public string GLACCTNODES { get; set; } |
|||
public string COSTCENTERDES { get; set; } |
|||
public string CType_DESC { get; set; } |
|||
public string PURDOCITEMNO { get; set; } |
|||
} |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace CK.SCP.Models.ScpEntity |
|||
{ |
|||
public class V_TA_ToleranceProportion |
|||
{ |
|||
[Key] |
|||
public long UID { get; set; } |
|||
|
|||
[StringLength(50)] |
|||
public string PartCode { get; set; } |
|||
[DisplayName("容差控制默认0.2 20%")] |
|||
public string VToleranceProportion { get; set; } |
|||
|
|||
[DisplayName("零件名称")] |
|||
public string PartName { get; set; } |
|||
[DisplayName("零件类型")] |
|||
public string PartGroup { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,63 @@ |
|||
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_TB_MPO |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
|
|||
[DisplayName("订单号")] |
|||
public string PurdocNO { get; set; } |
|||
|
|||
[DisplayName("采购凭证类型描述")] |
|||
public string BuyListStrdes { get; set; } |
|||
[DisplayName("凭证日期(订货日期)")] |
|||
public DateTime DocDate { get; set; } |
|||
[DisplayName("供应商代码")] |
|||
public string VendorNO { get; set; } |
|||
|
|||
[DisplayName("供应商描述")] |
|||
public string VendorDesc { get; set; } |
|||
|
|||
[DisplayName("采购组描述(收货人)")] |
|||
public string PurgrpDesc { get; set; } |
|||
public string ApprovalStatus { get; set; } |
|||
[DisplayName("当前确认状态")] |
|||
public int AcceptStatus { get; set; } |
|||
[DisplayName("OA审批状态")] |
|||
public string OASTATUS { get; set; } |
|||
|
|||
[DisplayName("交货日程日期")] |
|||
public DateTime ItemdeliveryDate { get; set; } |
|||
[DisplayName("创建人描述")] |
|||
public string CreatedByDesc { get; set; } |
|||
[DisplayName("创建人")] |
|||
public string CreatedBy { get; set; } |
|||
[DisplayName("创建人电话")] |
|||
public string CreatedByPhone { get; set; } |
|||
[DisplayName("状态")] |
|||
public string Ctype { get; set; } |
|||
[DisplayName("供应商的联系电话")] |
|||
public string FIRSTTELNO { get; set; } |
|||
[DisplayName("当前状态")] |
|||
public string State_DESC { get; set; } |
|||
[DisplayName("单据类型")] |
|||
public string CType_DESC { get; set; } |
|||
[NotMapped] |
|||
public DateTime DocDateBegin { get; set; } |
|||
[NotMapped] |
|||
public DateTime DocDateEnd { get; set; } |
|||
[NotMapped] |
|||
public List<string> UserInVendIds { get; set; } |
|||
[NotMapped] |
|||
public string AcceptStatusSelect { get; set; } |
|||
} |
|||
|
|||
} |
@ -0,0 +1,67 @@ |
|||
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_TB_MPO_DETAIL |
|||
{ |
|||
[Key] |
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public long UID { get; set; } |
|||
|
|||
[DisplayName("订单号")] |
|||
public string PurdocNO { get; set; } |
|||
|
|||
[DisplayName("申请单号")] |
|||
public string PurchaseReqNO { get; set; } |
|||
[DisplayName("申请人")] |
|||
public string ProposerDesc { get; set; } |
|||
[DisplayName("物料号")] |
|||
public string MtlNO { get; set; } |
|||
public string ApprovalStatus { get; set; } |
|||
[DisplayName("当前确认状态")] |
|||
public int AcceptStatus { get; set; } |
|||
[DisplayName("OA审批状态")] |
|||
public string OASTATUS { get; set; } |
|||
[DisplayName("物料描述")] |
|||
public string Shorttext { get; set; } |
|||
|
|||
[DisplayName("型号规格")] |
|||
public string SizeCol { get; set; } |
|||
[DisplayName("材料牌号")] |
|||
public string Matbrand { get; set; } |
|||
|
|||
[DisplayName("单位")] |
|||
public string Unitdes { get; set; } |
|||
[DisplayName("数量")] |
|||
public decimal Quantity { get; set; } |
|||
[DisplayName("价格")] |
|||
public decimal PRICE { get; set; } |
|||
[DisplayName("金额")] |
|||
public decimal NetValue { get; set; } |
|||
[DisplayName("采购信息")] |
|||
public string PurinfoReCord { get; set; } |
|||
[DisplayName("要求到货日期")] |
|||
public DateTime ItemDeliveryDate { get; set; } |
|||
[DisplayName("科目")] |
|||
public string Glaccnum { get; set; } |
|||
[DisplayName("状态")] |
|||
public string Ctype { get; set; } |
|||
[DisplayName("成本中心")] |
|||
public string CostCenterDes { get; set; } |
|||
[DisplayName("存储地点")] |
|||
public string StoreLocation { get; set; } |
|||
public string State_DESC { get; set; } |
|||
public string CType_DESC { get; set; } |
|||
[NotMapped] |
|||
public List<string> purdocnolist { get; set; } |
|||
|
|||
public string PURDOCITEMNO { get; set; } |
|||
public string Remake { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
namespace CK.SCP.Models.UniApiEntity |
|||
{ |
|||
public partial class xxDiMaxes_Order |
|||
{ |
|||
[Key] |
|||
public long UID { get; set; } |
|||
public string PURDOCNO { get; set; } |
|||
public int DI_BATCHNO { get; set; } |
|||
public string PURDOCITEMNO { get; set; } |
|||
public DateTime CREATEDDATE { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ToleranceProportion.aspx.cs" Inherits="SCP.Views.BasicData.SCP_ToleranceProportion" %> |
|||
|
|||
<!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"> |
|||
<Items> |
|||
<f:Toolbar ID="Toolbar1" runat="server"> |
|||
<Items> |
|||
|
|||
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();" /> |
|||
<f:TextBox ID="txtPartCode" runat="server" Label="零件号" Text=""> |
|||
</f:TextBox> |
|||
<f:Button ID="btnSearch" runat="server" Text="快速查找" OnClick="btnSearch_Click" Icon="SystemSearch"> |
|||
</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 ID="Button1" runat="server" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick" /> |
|||
</Items> |
|||
</f:Toolbar> |
|||
|
|||
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" BoxFlex="1" AutoScroll="True" |
|||
ShowHeader="False" |
|||
AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange" |
|||
ShowBorder="False" |
|||
DataKeyNames="PartCode" AllowSorting="true" IsDatabasePaging="true" SortField="PartCode"> |
|||
<Columns> |
|||
|
|||
<f:BoundField runat="server" SortField="PartCode" DataField="PartCode" HeaderText="零件号" Width="200px" /> |
|||
<f:BoundField runat="server" SortField="PartName" DataField="PartName" HeaderText="零件名称" Width="200px" /> |
|||
<f:BoundField runat="server" SortField="VToleranceProportion" DataField="VToleranceProportion" HeaderText="容差" Width="100px" /> |
|||
<f:BoundField runat="server" HeaderText="零件类型" ColumnID="" DataField="PartGroup" Width="200px" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
|
|||
<script type="text/javascript"> |
|||
|
|||
function onReady() { |
|||
var grid1 = Ext.getCmp('<%=Grid1.ClientID%>'); |
|||
var bodySize = Ext.getBody().getSize(); |
|||
grid1.setHeight(bodySize.height - 27); |
|||
} |
|||
$(window).bind("load resize", function () { |
|||
onReady(); |
|||
}); |
|||
</script> |
|||
|
|||
</form> |
|||
</body> |
|||
</html> |
|||
|
@ -0,0 +1,137 @@ |
|||
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; |
|||
using static System.Net.WebRequestMethods; |
|||
|
|||
namespace SCP.Views.BasicData |
|||
{ |
|||
public partial class SCP_ToleranceProportion : PageBase |
|||
{ |
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
BindData(); |
|||
} |
|||
} |
|||
|
|||
public void BindData() |
|||
{ |
|||
SearchData((result) => { |
|||
Grid1.RecordCount = result.Count(); |
|||
var list = SortAndPage(result, Grid1); |
|||
Grid1.DataSource = list; |
|||
Grid1.DataBind(); |
|||
}); |
|||
} |
|||
|
|||
public void SearchData(Action<IQueryable<V_TA_ToleranceProportion>> p_action) |
|||
{ |
|||
TA_ToleranceProportion _entity = new TA_ToleranceProportion(); |
|||
|
|||
_entity.PartCode = txtPartCode.Text; |
|||
SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
//导出
|
|||
public void BtnOutPut_OnClick(object sender, EventArgs e) |
|||
{ |
|||
TA_ToleranceProportion _entity = new TA_ToleranceProportion(); |
|||
|
|||
_entity.PartCode = txtPartCode.Text; |
|||
SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
Dictionary<string, string> cellheader = new Dictionary<string, string> { |
|||
{ "PartCode", "零件号" }, |
|||
{ "PartName", "零件名称" }, |
|||
{ "VToleranceProportion", "容差" }, |
|||
{ "PartGroup", "零件类型" }, |
|||
|
|||
}; |
|||
string url = EntityListToExcel2003(cellheader, _ret.Result.ToList(), "零件容差控制导出"); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
//查询
|
|||
protected void btnSearch_OnClick(object sender, EventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
|
|||
|
|||
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
|
|||
protected void btnSearch_Click(object sender, EventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 上传文件
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected 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_PART_ToleranceProportion>(ExcelHelper.RemoveEmpty(_dt)).ToList(); |
|||
var ret = SCP_ToleranceProportion_Controller.EXCEL_MOLDSHARING_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name); |
|||
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
|||
{ |
|||
Alert.Show("导入成功"); |
|||
BindData(); |
|||
FileUp.Reset(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
FileUp.Reset(); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.BasicData |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_ToleranceProportion |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// form1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
|||
|
|||
/// <summary>
|
|||
/// PageManager1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.PageManager PageManager1; |
|||
|
|||
/// <summary>
|
|||
/// Panel1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Panel Panel1; |
|||
|
|||
/// <summary>
|
|||
/// Toolbar1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar1; |
|||
|
|||
/// <summary>
|
|||
/// Button3 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button Button3; |
|||
|
|||
/// <summary>
|
|||
/// txtPartCode 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox txtPartCode; |
|||
|
|||
/// <summary>
|
|||
/// btnSearch 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnSearch; |
|||
|
|||
/// <summary>
|
|||
/// FileUp 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FileUpload FileUp; |
|||
|
|||
/// <summary>
|
|||
/// btnInput 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnInput; |
|||
|
|||
/// <summary>
|
|||
/// Button1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button Button1; |
|||
|
|||
/// <summary>
|
|||
/// Grid1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid1; |
|||
} |
|||
} |
@ -0,0 +1,74 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_MPO_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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
|||
<Toolbars> |
|||
<f:Toolbar ID="Toolbar2" runat="server"> |
|||
<Items> |
|||
<f:Button ID="BTN_REFRESH" runat="server" EnablePostBack="True" Text="刷新" Icon="box"> |
|||
</f:Button> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
<Items> |
|||
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField> |
|||
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true" |
|||
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype" |
|||
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC" |
|||
AllowPaging="True" |
|||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_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="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 Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="PURDOCITEMNO" HeaderText="行号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/> |
|||
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" /> |
|||
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" /> |
|||
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" /> |
|||
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" /> |
|||
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" /> |
|||
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" /> |
|||
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" /> |
|||
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" /> |
|||
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" /> |
|||
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" /> |
|||
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" /> |
|||
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" /> |
|||
<f:BoundField Width="80px" DataField="Remake" DataFormatString="{0}" HeaderText="备注" /> |
|||
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
|
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,169 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.PlanData |
|||
{ |
|||
public partial class SCP_MPO_DETAIL : PageBase |
|||
{ |
|||
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
if (!string.IsNullOrEmpty(Request["PurdocNO"])) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再查看明细!"); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action) |
|||
{ |
|||
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL(); |
|||
string purdocnolist =Request["PurdocNO"]; |
|||
_entity.purdocnolist = purdocnolist.Split(',').ToList(); |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> { |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
public void BindDetail() |
|||
{ |
|||
SearchV_TB_PO_DETAIL((ret)=>{ |
|||
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count(); |
|||
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL); |
|||
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList(); |
|||
Grid_V_TB_MPO_DETAIL.DataBind(); |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindDetail(); |
|||
} |
|||
///// <summary>
|
|||
///// 审批通过
|
|||
///// </summary>
|
|||
///// <param name="sender"></param>
|
|||
///// <param name="e"></param>
|
|||
//protected void btnAccept_Click(object sender, EventArgs e)
|
|||
//{
|
|||
// int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
|
|||
// List<string> NOList = new List<string>();
|
|||
// //List<string> ctylist = new List<string>();
|
|||
// List<int> AcceptStatusList = new List<int>();
|
|||
// if (selections.Count() ==0 )
|
|||
// {
|
|||
// Alert.Show("您未选择数据进行审批");
|
|||
// return;
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// foreach (int rowIndex in selections)
|
|||
// {
|
|||
// NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
|
|||
// //ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
|
|||
// var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
|
|||
// AcceptStatusList.Add(int.Parse(app));
|
|||
// }
|
|||
// NOList = NOList.Distinct().ToList();
|
|||
// //if (ctylist.Contains("D"))
|
|||
// //{
|
|||
// // Alert.Show("选择的数据包含已经作废的数据");
|
|||
// // return;
|
|||
// //}
|
|||
// if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
|
|||
// {
|
|||
// Alert.Show("选择的数据包含已确认的数据");
|
|||
// return;
|
|||
// }
|
|||
|
|||
// var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
|
|||
|
|||
// if (ret.State == ReturnStatus.Succeed)
|
|||
// {
|
|||
// Alert.Show("确认成功");
|
|||
// BindDetail();
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// Alert.Show(string.Join("<br>", ret.MessageList));
|
|||
// return;
|
|||
// }
|
|||
// }
|
|||
|
|||
|
|||
//}
|
|||
///// <summary>
|
|||
///// 取消审批
|
|||
///// </summary>
|
|||
///// <param name="sender"></param>
|
|||
///// <param name="e"></param>
|
|||
//protected void btnCancel_Click(object sender, EventArgs e)
|
|||
//{
|
|||
// int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
|
|||
// List<string> NOList = new List<string>();
|
|||
// List<string> ctylist = new List<string>();
|
|||
// List<int> AcceptStatusList = new List<int>();
|
|||
// if (selections.Count() == 0)
|
|||
// {
|
|||
// Alert.Show("您未选择数据进行取消审批");
|
|||
// return;
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// foreach (int rowIndex in selections)
|
|||
// {
|
|||
// NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
|
|||
// ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
|
|||
// AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
|
|||
// }
|
|||
// NOList = NOList.Distinct().ToList();
|
|||
// if (ctylist.Contains("D"))
|
|||
// {
|
|||
// Alert.Show("选择的数据包含已经作废的数据");
|
|||
// return;
|
|||
// }
|
|||
// if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
|
|||
// {
|
|||
// Alert.Show("选择的数据包含新建的数据");
|
|||
// return;
|
|||
// }
|
|||
// var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
|
|||
|
|||
// if (ret.State == ReturnStatus.Succeed)
|
|||
// {
|
|||
// Alert.Show("取消成功");
|
|||
// BindDetail();
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// Alert.Show(string.Join("<br>", ret.MessageList));
|
|||
// return;
|
|||
// }
|
|||
// }
|
|||
//}
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.PlanData |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_MPO_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>
|
|||
/// Toolbar2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar2; |
|||
|
|||
/// <summary>
|
|||
/// BTN_REFRESH 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BTN_REFRESH; |
|||
|
|||
/// <summary>
|
|||
/// HF_GRID_INDEX 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.HiddenField HF_GRID_INDEX; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO_DETAIL 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO_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; |
|||
} |
|||
} |
@ -0,0 +1,132 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_PO_MATERIAL" %> |
|||
|
|||
<!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="Zoom" OnClick="btnDetail_Click"> |
|||
</f:Button> |
|||
|
|||
<f:ToolbarSeparator runat="server" /> |
|||
|
|||
|
|||
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_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" ColumnWidths="25% 25% 25% 25%"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" /> |
|||
<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="至" EmptyText="请选择日期" ID="DP_EndDate" /> |
|||
<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="-1" /> |
|||
</f:DropDownList> |
|||
</Items> |
|||
</f:FormRow> |
|||
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="创建人" EmptyText="" ID="TXT_CreatedByDesc" /> |
|||
<f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendorNO" /> |
|||
<f:TextBox runat="server" Label="供应商描述" EmptyText="" ID="TXT_VendorDesc" /> |
|||
</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> |
|||
</Items> |
|||
</f:FormRow> |
|||
|
|||
|
|||
</Rows> |
|||
</f:Form> |
|||
|
|||
</Items> |
|||
</f:GroupPanel> |
|||
|
|||
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true" |
|||
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO" |
|||
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus" |
|||
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1" |
|||
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_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="10" Value="10" /> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="500" Value="500" /> |
|||
<f:ListItem Text="1000" Value="1000" /> |
|||
<f:ListItem Text="5000" Value="5000" /> |
|||
<f:ListItem Text="10000" Value="10000" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
|
|||
|
|||
<Columns> |
|||
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" /> |
|||
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" /> |
|||
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" /> |
|||
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" /> |
|||
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" /> |
|||
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" /> |
|||
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" /> |
|||
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" /> |
|||
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" /> |
|||
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" /> |
|||
</Columns> |
|||
|
|||
|
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack" |
|||
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" |
|||
IFrameUrl="about:blank" /> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,272 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using System.Text; |
|||
using CK.SCP.Models.Enums; |
|||
using Microsoft.Ajax.Utilities; |
|||
|
|||
namespace SCP.Views.PlanData |
|||
{ |
|||
public partial class SCP_PO_MATERIAL : PageBase |
|||
{ |
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
LoadData(); |
|||
} |
|||
} |
|||
public void LoadData() |
|||
{ |
|||
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0) |
|||
{ |
|||
Alert.Show("当前用户未选择地点"); |
|||
return; |
|||
} |
|||
BindOrder(); |
|||
} |
|||
|
|||
public void BindOrder() |
|||
{ |
|||
SearchV_TB_MPO((result) => |
|||
{ |
|||
Grid_V_TB_MPO.RecordCount = result.Count(); |
|||
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO); |
|||
Grid_V_TB_MPO.DataSource = list; |
|||
Grid_V_TB_MPO.DataBind(); |
|||
}); |
|||
|
|||
} |
|||
|
|||
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action) |
|||
{ |
|||
|
|||
V_TB_MPO _entity = new V_TB_MPO(); |
|||
|
|||
if (this.DP_StartDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate); |
|||
} |
|||
if (DP_EndDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_CreatedByDesc.Text)) |
|||
{ |
|||
_entity.CreatedBy = TXT_CreatedByDesc.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_VendorNO.Text)) |
|||
{ |
|||
_entity.VendorNO = TXT_VendorNO.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_VendorNO.Text)) |
|||
{ |
|||
_entity.VendorNO = TXT_VendorNO.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_VendorDesc.Text)) |
|||
{ |
|||
_entity.VendorDesc = TXT_VendorDesc.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_PurdocNO.Text)) |
|||
{ |
|||
_entity.PurdocNO = TXT_PurdocNO.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrEmpty( DDL_State.SelectedValue)) |
|||
{ |
|||
_entity.AcceptStatusSelect = DDL_State.SelectedValue; |
|||
} |
|||
_entity.UserInVendIds = CurrentUser.VenderList; |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
|
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnOutput_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string; |
|||
if (ctypesta == "D") |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!")); |
|||
return; |
|||
} |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!")); |
|||
return; |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList); |
|||
Dictionary<string, string> cellheader = new Dictionary<string, string> |
|||
{ |
|||
{ "PurdocNO", "订单号" }, |
|||
{"PURDOCITEMNO","行号" }, |
|||
{ "PurchaseReqNO", "申请单号" }, |
|||
{ "ProposerDesc", "申请人" }, |
|||
{"State_DESC","状态" }, |
|||
{ "OASTATUS", "OA审批状态" }, |
|||
{ "MtlNO", "物料号" }, |
|||
{ "Shorttext", "物料描述" }, |
|||
{ "SizeCol", "型号规格" }, |
|||
{ "Matbrand", "材料牌号" }, |
|||
{ "Unitdes", "单位" }, |
|||
{ "Quantity", "数量" }, |
|||
{ "PRICE", "价格" }, |
|||
{ "NetValue", "金额" }, |
|||
{ "PurinfoReCord", "采购信息" }, |
|||
{ "ItemDeliveryDate", "要求到货日期" }, |
|||
{ "Glaccnum", "科目" }, |
|||
{ "CostCenterDes", "成本中心" }, |
|||
{ "StoreLocation", "存储地点" }, |
|||
{ "CType_DESC","是否已作废"}, |
|||
}; |
|||
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细"); |
|||
|
|||
} |
|||
|
|||
protected void btnDetail_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
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) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindOrder(); |
|||
} |
|||
|
|||
protected void Window1_Close(object sender, WindowCloseEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
///// <summary>
|
|||
///// 打印
|
|||
///// </summary>
|
|||
///// <param name="sender"></param>
|
|||
///// <param name="e"></param>
|
|||
//protected void btnPrinter_Click(object sender, EventArgs e)
|
|||
//{
|
|||
// int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
|
|||
// string PurdocNO = "";
|
|||
// int acc = 0;
|
|||
// string status = "";
|
|||
// if (selections.Count() == 0)
|
|||
// {
|
|||
// Alert.Show("请选择要打印的数据");
|
|||
// return;
|
|||
// }
|
|||
// else if (selections.Count() > 1)
|
|||
// {
|
|||
// Alert.Show("只能选择一条数据进行打印");
|
|||
// return;
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// foreach (int rowIndex in selections)
|
|||
// {
|
|||
// PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
|
|||
// acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
|
|||
// status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
|
|||
// if (status =="D")
|
|||
// {
|
|||
// Alert.Show("已作废的数据不可以进行打印");
|
|||
// return;
|
|||
// }
|
|||
// }
|
|||
// if (acc == (int)GeneralMaterialOrderState.New)
|
|||
// {
|
|||
// Alert.Show("供应商确认过的数据才可以打印");
|
|||
// return;
|
|||
// }
|
|||
// var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
|
|||
// PageContext.RegisterStartupScript(str);
|
|||
// }
|
|||
//}
|
|||
} |
|||
} |
@ -0,0 +1,215 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.PlanData |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_PO_MATERIAL |
|||
{ |
|||
|
|||
/// <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>
|
|||
/// btnShow 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnShow; |
|||
|
|||
/// <summary>
|
|||
/// gp1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.GroupPanel gp1; |
|||
|
|||
/// <summary>
|
|||
/// TXT_PurdocNO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_PurdocNO; |
|||
|
|||
/// <summary>
|
|||
/// DP_StartDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_StartDate; |
|||
|
|||
/// <summary>
|
|||
/// DP_EndDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_EndDate; |
|||
|
|||
/// <summary>
|
|||
/// DDL_State 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList DDL_State; |
|||
|
|||
/// <summary>
|
|||
/// TXT_CreatedByDesc 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_CreatedByDesc; |
|||
|
|||
/// <summary>
|
|||
/// TXT_VendorNO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_VendorNO; |
|||
|
|||
/// <summary>
|
|||
/// TXT_VendorDesc 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_VendorDesc; |
|||
|
|||
/// <summary>
|
|||
/// BtnClose 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnClose; |
|||
|
|||
/// <summary>
|
|||
/// BtnSearch 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnSearch; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO; |
|||
|
|||
/// <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; |
|||
} |
|||
} |
@ -0,0 +1,77 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_MPO_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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
|||
<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="btnAccept" runat="server" Text="确认订单" Icon="Accept" OnClick="btnAccept_Click" > |
|||
</f:Button> |
|||
<f:Button ID="btnCancel" runat="server" Text="取消订单" Icon="Cancel" OnClick="btnCancel_Click" > |
|||
</f:Button> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
<Items> |
|||
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField> |
|||
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true" |
|||
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype" |
|||
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC" |
|||
AllowPaging="True" |
|||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_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="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 Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="PURDOCITEMNO" HeaderText="行号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/> |
|||
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" /> |
|||
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" /> |
|||
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" /> |
|||
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" /> |
|||
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" /> |
|||
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" /> |
|||
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" /> |
|||
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" /> |
|||
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" /> |
|||
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" /> |
|||
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" /> |
|||
<f:BoundField Width="80px" DataField="Remake" DataFormatString="{0}" HeaderText="备注" /> |
|||
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
|
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,170 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.SupplierData |
|||
{ |
|||
public partial class SCP_MPO_DETAIL : PageBase |
|||
{ |
|||
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
if (!string.IsNullOrEmpty(Request["PurdocNO"])) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再查看明细!"); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action) |
|||
{ |
|||
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL(); |
|||
string purdocnolist =Request["PurdocNO"]; |
|||
_entity.purdocnolist = purdocnolist.Split(',').ToList(); |
|||
_entity.Ctype = "N"; |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> { |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
public void BindDetail() |
|||
{ |
|||
SearchV_TB_PO_DETAIL((ret)=>{ |
|||
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count(); |
|||
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL); |
|||
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList(); |
|||
Grid_V_TB_MPO_DETAIL.DataBind(); |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindDetail(); |
|||
} |
|||
/// <summary>
|
|||
/// 审批通过
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnAccept_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
//List<string> ctylist = new List<string>();
|
|||
List<int> AcceptStatusList = new List<int>(); |
|||
if (selections.Count() ==0 ) |
|||
{ |
|||
Alert.Show("您未选择数据进行审批"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string); |
|||
//ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
|
|||
var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString(); |
|||
AcceptStatusList.Add(int.Parse(app)); |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
//if (ctylist.Contains("D"))
|
|||
//{
|
|||
// Alert.Show("选择的数据包含已经作废的数据");
|
|||
// return;
|
|||
//}
|
|||
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish)) |
|||
{ |
|||
Alert.Show("选择的数据包含已确认的数据"); |
|||
return; |
|||
} |
|||
|
|||
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish); |
|||
|
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
Alert.Show("确认成功"); |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 取消审批
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnCancel_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
List<string> ctylist = new List<string>(); |
|||
List<int> AcceptStatusList = new List<int>(); |
|||
if (selections.Count() == 0) |
|||
{ |
|||
Alert.Show("您未选择数据进行取消审批"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string); |
|||
ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string); |
|||
AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString())); |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
//if (ctylist.Contains("D"))
|
|||
//{
|
|||
// Alert.Show("选择的数据包含已经作废的数据");
|
|||
// return;
|
|||
//}
|
|||
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New)) |
|||
{ |
|||
Alert.Show("选择的数据包含新建的数据"); |
|||
return; |
|||
} |
|||
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New); |
|||
|
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
Alert.Show("取消成功"); |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.SupplierData |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_MPO_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>
|
|||
/// Toolbar2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar2; |
|||
|
|||
/// <summary>
|
|||
/// BTN_REFRESH 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BTN_REFRESH; |
|||
|
|||
/// <summary>
|
|||
/// btnAccept 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnAccept; |
|||
|
|||
/// <summary>
|
|||
/// btnCancel 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnCancel; |
|||
|
|||
/// <summary>
|
|||
/// HF_GRID_INDEX 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.HiddenField HF_GRID_INDEX; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO_DETAIL 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO_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; |
|||
} |
|||
} |
@ -0,0 +1,126 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_PO_MATERIAL" %> |
|||
|
|||
<!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="Zoom" OnClick="btnDetail_Click"> |
|||
</f:Button> |
|||
|
|||
<f:ToolbarSeparator runat="server" /> |
|||
|
|||
|
|||
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click"> |
|||
</f:Button> |
|||
|
|||
<f:ToolbarSeparator runat="server" /> |
|||
<f:Button ID="btnPrinter" runat="server" Text="打印" Icon="Printer" OnClick="btnPrinter_Click"></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" ColumnWidths="20% 20% 20% 20% 20%"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" /> |
|||
<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="至" EmptyText="请选择日期" ID="DP_EndDate" /> |
|||
<f:TextBox runat="server" Label="创建人" EmptyText="" ID="TXT_CreatedByDesc" /> |
|||
<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="-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> |
|||
</Items> |
|||
</f:FormRow> |
|||
|
|||
|
|||
</Rows> |
|||
</f:Form> |
|||
|
|||
</Items> |
|||
</f:GroupPanel> |
|||
|
|||
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true" |
|||
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO" |
|||
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus" |
|||
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1" |
|||
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_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="10" Value="10" /> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="500" Value="500" /> |
|||
<f:ListItem Text="1000" Value="1000" /> |
|||
<f:ListItem Text="5000" Value="5000" /> |
|||
<f:ListItem Text="10000" Value="10000" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
|
|||
|
|||
<Columns> |
|||
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" /> |
|||
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" /> |
|||
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" /> |
|||
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" /> |
|||
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" /> |
|||
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" /> |
|||
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" /> |
|||
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" /> |
|||
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" /> |
|||
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" /> |
|||
</Columns> |
|||
|
|||
|
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack" |
|||
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" |
|||
IFrameUrl="about:blank" /> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,265 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using System.Text; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.SupplierData |
|||
{ |
|||
public partial class SCP_PO_MATERIAL : PageBase |
|||
{ |
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
LoadData(); |
|||
} |
|||
} |
|||
public void LoadData() |
|||
{ |
|||
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0) |
|||
{ |
|||
Alert.Show("当前用户未选择地点"); |
|||
return; |
|||
} |
|||
BindOrder(); |
|||
} |
|||
|
|||
public void BindOrder() |
|||
{ |
|||
SearchV_TB_MPO((result) => |
|||
{ |
|||
Grid_V_TB_MPO.RecordCount = result.Count(); |
|||
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO); |
|||
Grid_V_TB_MPO.DataSource = list; |
|||
Grid_V_TB_MPO.DataBind(); |
|||
}); |
|||
|
|||
} |
|||
|
|||
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action) |
|||
{ |
|||
|
|||
V_TB_MPO _entity = new V_TB_MPO(); |
|||
|
|||
if (this.DP_StartDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate); |
|||
} |
|||
if (DP_EndDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_CreatedByDesc.Text)) |
|||
{ |
|||
_entity.CreatedBy = TXT_CreatedByDesc.Text.Trim(); |
|||
} |
|||
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
|||
{ |
|||
_entity.AcceptStatusSelect = DDL_State.SelectedValue; |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(TXT_PurdocNO.Text)) |
|||
{ |
|||
_entity.PurdocNO = TXT_PurdocNO.Text.Trim(); |
|||
} |
|||
_entity.UserInVendIds = CurrentUser.VenderList; |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
|
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnOutput_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string; |
|||
if (ctypesta == "D") |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!")); |
|||
return; |
|||
} |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!")); |
|||
return; |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList); |
|||
Dictionary<string, string> cellheader = new Dictionary<string, string> |
|||
{ |
|||
{ "PurdocNO", "订单号" }, |
|||
{ "PurchaseReqNO", "申请单号" }, |
|||
{ "ProposerDesc", "申请人" }, |
|||
{"State_DESC","状态" }, |
|||
{ "OASTATUS", "OA审批状态" }, |
|||
{ "MtlNO", "物料号" }, |
|||
{ "Shorttext", "物料描述" }, |
|||
{ "SizeCol", "型号规格" }, |
|||
{ "Matbrand", "材料牌号" }, |
|||
{ "Unitdes", "单位" }, |
|||
{ "Quantity", "数量" }, |
|||
{ "PRICE", "价格" }, |
|||
{ "NetValue", "金额" }, |
|||
{ "PurinfoReCord", "采购信息" }, |
|||
{ "ItemDeliveryDate", "要求到货日期" }, |
|||
{ "Glaccnum", "科目" }, |
|||
{ "CostCenterDes", "成本中心" }, |
|||
{ "StoreLocation", "存储地点" }, |
|||
{ "CType_DESC","是否已作废"}, |
|||
}; |
|||
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细"); |
|||
|
|||
} |
|||
|
|||
protected void btnDetail_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
List<string> order = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
order.Add(Grid_V_TB_MPO.DataKeys[rowIndex][12] as string); |
|||
} |
|||
if (order.Contains("D")) |
|||
{ |
|||
Alert.Show("请选择未被作废的数据进行查看明细"); |
|||
return; |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
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) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindOrder(); |
|||
} |
|||
|
|||
protected void Window1_Close(object sender, WindowCloseEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 打印
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnPrinter_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
string PurdocNO = ""; |
|||
int acc = 0; |
|||
string status = ""; |
|||
if (selections.Count() == 0) |
|||
{ |
|||
Alert.Show("请选择要打印的数据"); |
|||
return; |
|||
} |
|||
else if (selections.Count() > 1) |
|||
{ |
|||
Alert.Show("只能选择一条数据进行打印"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string; |
|||
acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString()); |
|||
status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string; |
|||
if (status =="D") |
|||
{ |
|||
Alert.Show("已作废的数据不可以进行打印"); |
|||
return; |
|||
} |
|||
} |
|||
if (acc == (int)GeneralMaterialOrderState.New) |
|||
{ |
|||
Alert.Show("供应商确认过的数据才可以打印"); |
|||
return; |
|||
} |
|||
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO); |
|||
PageContext.RegisterStartupScript(str); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,206 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.SupplierData |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_PO_MATERIAL |
|||
{ |
|||
|
|||
/// <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>
|
|||
/// btnShow 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnShow; |
|||
|
|||
/// <summary>
|
|||
/// btnPrinter 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnPrinter; |
|||
|
|||
/// <summary>
|
|||
/// gp1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.GroupPanel gp1; |
|||
|
|||
/// <summary>
|
|||
/// TXT_PurdocNO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_PurdocNO; |
|||
|
|||
/// <summary>
|
|||
/// DP_StartDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_StartDate; |
|||
|
|||
/// <summary>
|
|||
/// DP_EndDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_EndDate; |
|||
|
|||
/// <summary>
|
|||
/// TXT_CreatedByDesc 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_CreatedByDesc; |
|||
|
|||
/// <summary>
|
|||
/// DDL_State 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList DDL_State; |
|||
|
|||
/// <summary>
|
|||
/// BtnClose 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnClose; |
|||
|
|||
/// <summary>
|
|||
/// BtnSearch 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnSearch; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO; |
|||
|
|||
/// <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; |
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_MPO_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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
|||
<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="btnAccept" runat="server" Text="确认订单" Icon="Accept" OnClick="btnAccept_Click" Hidden="true"> |
|||
</f:Button> |
|||
<f:Button ID="btnCancel" runat="server" Text="取消订单" Icon="Cancel" OnClick="btnCancel_Click" Hidden="true"> |
|||
</f:Button> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
<Items> |
|||
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField> |
|||
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true" |
|||
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype" |
|||
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC" |
|||
AllowPaging="True" |
|||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_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="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 Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/> |
|||
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/> |
|||
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/> |
|||
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" /> |
|||
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" /> |
|||
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" /> |
|||
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" /> |
|||
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" /> |
|||
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" /> |
|||
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" /> |
|||
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" /> |
|||
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" /> |
|||
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" /> |
|||
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" /> |
|||
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
|
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,175 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.富维冲压件 |
|||
{ |
|||
public partial class SCP_MPO_DETAIL : PageBase |
|||
{ |
|||
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
if (!string.IsNullOrEmpty(Request["PurdocNO"])) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再查看明细!"); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action) |
|||
{ |
|||
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL(); |
|||
string purdocnolist =Request["PurdocNO"]; |
|||
_entity.purdocnolist = purdocnolist.Split(',').ToList(); |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> { |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
public void BindDetail() |
|||
{ |
|||
if (CurrentUser.RoleList.Contains("供应商")) |
|||
{ |
|||
//确认订单
|
|||
btnAccept.Hidden = false; |
|||
btnCancel.Hidden = false; |
|||
} |
|||
SearchV_TB_PO_DETAIL((ret)=>{ |
|||
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count(); |
|||
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL); |
|||
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList(); |
|||
Grid_V_TB_MPO_DETAIL.DataBind(); |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
BindDetail(); |
|||
} |
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindDetail(); |
|||
} |
|||
/// <summary>
|
|||
/// 审批通过
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnAccept_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
//List<string> ctylist = new List<string>();
|
|||
List<int> AcceptStatusList = new List<int>(); |
|||
if (selections.Count() ==0 ) |
|||
{ |
|||
Alert.Show("您未选择数据进行审批"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string); |
|||
//ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
|
|||
var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString(); |
|||
AcceptStatusList.Add(int.Parse(app)); |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
//if (ctylist.Contains("D"))
|
|||
//{
|
|||
// Alert.Show("选择的数据包含已经作废的数据");
|
|||
// return;
|
|||
//}
|
|||
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish)) |
|||
{ |
|||
Alert.Show("选择的数据包含已确认的数据"); |
|||
return; |
|||
} |
|||
|
|||
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish); |
|||
|
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
Alert.Show("确认成功"); |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 取消审批
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnCancel_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
List<string> ctylist = new List<string>(); |
|||
List<int> AcceptStatusList = new List<int>(); |
|||
if (selections.Count() == 0) |
|||
{ |
|||
Alert.Show("您未选择数据进行取消审批"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string); |
|||
ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string); |
|||
AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString())); |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
if (ctylist.Contains("D")) |
|||
{ |
|||
Alert.Show("选择的数据包含已经作废的数据"); |
|||
return; |
|||
} |
|||
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New)) |
|||
{ |
|||
Alert.Show("选择的数据包含新建的数据"); |
|||
return; |
|||
} |
|||
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New); |
|||
|
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
Alert.Show("取消成功"); |
|||
BindDetail(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.富维冲压件 |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_MPO_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>
|
|||
/// Toolbar2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar2; |
|||
|
|||
/// <summary>
|
|||
/// BTN_REFRESH 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BTN_REFRESH; |
|||
|
|||
/// <summary>
|
|||
/// btnAccept 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnAccept; |
|||
|
|||
/// <summary>
|
|||
/// btnCancel 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnCancel; |
|||
|
|||
/// <summary>
|
|||
/// HF_GRID_INDEX 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.HiddenField HF_GRID_INDEX; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO_DETAIL 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO_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; |
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_PO_MATERIAL" %> |
|||
|
|||
<!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="Zoom" OnClick="btnDetail_Click"> |
|||
</f:Button> |
|||
|
|||
<f:ToolbarSeparator runat="server" /> |
|||
|
|||
|
|||
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click"> |
|||
</f:Button> |
|||
|
|||
<f:ToolbarSeparator runat="server" /> |
|||
<f:Button ID="btnPrinter" runat="server" Text="打印" Icon="Printer" OnClick="btnPrinter_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" ColumnWidths="25% 25% 25% 25%"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" /> |
|||
<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="至" EmptyText="请选择日期" ID="DP_EndDate" /> |
|||
</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> |
|||
</Items> |
|||
</f:FormRow> |
|||
|
|||
|
|||
</Rows> |
|||
</f:Form> |
|||
|
|||
</Items> |
|||
</f:GroupPanel> |
|||
|
|||
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true" |
|||
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO" |
|||
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus" |
|||
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1" |
|||
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_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="10" Value="10" /> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="500" Value="500" /> |
|||
<f:ListItem Text="1000" Value="1000" /> |
|||
<f:ListItem Text="5000" Value="5000" /> |
|||
<f:ListItem Text="10000" Value="10000" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
|
|||
|
|||
<Columns> |
|||
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" /> |
|||
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" /> |
|||
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" /> |
|||
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" /> |
|||
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" /> |
|||
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" /> |
|||
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" /> |
|||
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" /> |
|||
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" /> |
|||
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" /> |
|||
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" /> |
|||
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" /> |
|||
</Columns> |
|||
|
|||
|
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack" |
|||
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" |
|||
IFrameUrl="about:blank" /> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,249 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Controller; |
|||
using FineUI; |
|||
using System.Text; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.富维冲压件 |
|||
{ |
|||
public partial class SCP_PO_MATERIAL : PageBase |
|||
{ |
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
LoadData(); |
|||
} |
|||
} |
|||
public void LoadData() |
|||
{ |
|||
if (CurrentUser.RoleList.Contains("供应商")) |
|||
{ |
|||
btnPrinter.Hidden = false; |
|||
} |
|||
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0) |
|||
{ |
|||
Alert.Show("当前用户未选择地点"); |
|||
return; |
|||
} |
|||
BindOrder(); |
|||
} |
|||
|
|||
public void BindOrder() |
|||
{ |
|||
SearchV_TB_MPO((result) => |
|||
{ |
|||
Grid_V_TB_MPO.RecordCount = result.Count(); |
|||
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO); |
|||
Grid_V_TB_MPO.DataSource = list; |
|||
Grid_V_TB_MPO.DataBind(); |
|||
}); |
|||
|
|||
} |
|||
|
|||
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action) |
|||
{ |
|||
|
|||
V_TB_MPO _entity = new V_TB_MPO(); |
|||
|
|||
if (this.DP_StartDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate); |
|||
} |
|||
if (DP_EndDate.SelectedDate != null) |
|||
{ |
|||
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate); |
|||
} |
|||
_entity.PurdocNO = TXT_PurdocNO.Text; |
|||
_entity.UserInVendIds = CurrentUser.VenderList; |
|||
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../富维冲压件/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
|
|||
} |
|||
|
|||
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnOutput_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string; |
|||
if (ctypesta == "D") |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!")); |
|||
return; |
|||
} |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!")); |
|||
return; |
|||
} |
|||
NOList = NOList.Distinct().ToList(); |
|||
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList); |
|||
Dictionary<string, string> cellheader = new Dictionary<string, string> |
|||
{ |
|||
{ "PurdocNO", "订单号" }, |
|||
{ "PurchaseReqNO", "申请单号" }, |
|||
{ "ProposerDesc", "申请人" }, |
|||
{ "OASTATUS", "OA审批状态" }, |
|||
{ "MtlNO", "物料号" }, |
|||
{ "Shorttext", "物料描述" }, |
|||
{ "SizeCol", "型号规格" }, |
|||
{ "Matbrand", "材料牌号" }, |
|||
{ "Unitdes", "单位" }, |
|||
{ "Quantity", "数量" }, |
|||
{ "PRICE", "价格" }, |
|||
{ "NetValue", "金额" }, |
|||
{ "PurinfoReCord", "采购信息" }, |
|||
{ "ItemDeliveryDate", "要求到货日期" }, |
|||
{ "Glaccnum", "科目" }, |
|||
{ "CostCenterDes", "成本中心" }, |
|||
{ "StoreLocation", "存储地点" }, |
|||
}; |
|||
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细"); |
|||
|
|||
} |
|||
|
|||
protected void btnDetail_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
List<string> NOList = new List<string>(); |
|||
if (selections.Count() > 0) |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string); |
|||
} |
|||
string BillNum = String.Join(",", NOList); |
|||
string url = string.Format("../富维冲压件/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum); |
|||
PageContext.RegisterStartupScript(Window1.GetShowReference(url)); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show("请选择数据后再进行查看明细"); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
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) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
|
|||
BindOrder(); |
|||
} |
|||
|
|||
protected void Window1_Close(object sender, WindowCloseEventArgs e) |
|||
{ |
|||
BindOrder(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 打印
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnPrinter_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray; |
|||
string PurdocNO = ""; |
|||
int acc = 0; |
|||
string status = ""; |
|||
if (selections.Count() == 0) |
|||
{ |
|||
Alert.Show("请选择要打印的数据"); |
|||
return; |
|||
} |
|||
else if (selections.Count() > 1) |
|||
{ |
|||
Alert.Show("只能选择一条数据进行打印"); |
|||
return; |
|||
} |
|||
else |
|||
{ |
|||
foreach (int rowIndex in selections) |
|||
{ |
|||
PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string; |
|||
acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString()); |
|||
status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string; |
|||
if (status =="D") |
|||
{ |
|||
Alert.Show("已作废的数据不可以进行打印"); |
|||
return; |
|||
} |
|||
} |
|||
if (acc == (int)GeneralMaterialOrderState.New) |
|||
{ |
|||
Alert.Show("供应商确认过的数据才可以打印"); |
|||
return; |
|||
} |
|||
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO); |
|||
PageContext.RegisterStartupScript(str); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,188 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.富维冲压件 |
|||
{ |
|||
|
|||
|
|||
public partial class SCP_PO_MATERIAL |
|||
{ |
|||
|
|||
/// <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>
|
|||
/// btnShow 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnShow; |
|||
|
|||
/// <summary>
|
|||
/// btnPrinter 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnPrinter; |
|||
|
|||
/// <summary>
|
|||
/// gp1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.GroupPanel gp1; |
|||
|
|||
/// <summary>
|
|||
/// TXT_PurdocNO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TXT_PurdocNO; |
|||
|
|||
/// <summary>
|
|||
/// DP_StartDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_StartDate; |
|||
|
|||
/// <summary>
|
|||
/// DP_EndDate 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DatePicker DP_EndDate; |
|||
|
|||
/// <summary>
|
|||
/// BtnClose 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnClose; |
|||
|
|||
/// <summary>
|
|||
/// BtnSearch 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button BtnSearch; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_MPO 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_MPO; |
|||
|
|||
/// <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; |
|||
} |
|||
} |
Loading…
Reference in new issue