|
@ -18,7 +18,7 @@ namespace SCP.PlanData |
|
|
{ |
|
|
{ |
|
|
public partial class SCP_PO_CREATE_ASK : PageBase |
|
|
public partial class SCP_PO_CREATE_ASK : PageBase |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e) |
|
|
protected void Page_Load(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
if (!IsPostBack) |
|
|
if (!IsPostBack) |
|
@ -28,21 +28,38 @@ namespace SCP.PlanData |
|
|
SetRoleRule(); |
|
|
SetRoleRule(); |
|
|
CheckRolesMenu(); |
|
|
CheckRolesMenu(); |
|
|
BindDDL_Site(); |
|
|
BindDDL_Site(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
private void BindDDL_Site() |
|
|
private void BindDDL_Site() |
|
|
{ |
|
|
{ |
|
|
var _ls = ScpCache.ADRESSList; |
|
|
var _ls = ScpCache.ADRESSList; |
|
|
DDL_Site.DataSource = _ls; |
|
|
DDL_Site.DataSource = _ls; |
|
|
DDL_Site.DataBind(); |
|
|
DDL_Site.DataBind(); |
|
|
|
|
|
List<string> stinglist = new List<string>(); |
|
|
|
|
|
var list = _ls.Select(q => q.NamePone).ToList(); |
|
|
|
|
|
if (list != null) |
|
|
|
|
|
{ |
|
|
|
|
|
list.ForEach(q => |
|
|
|
|
|
{ |
|
|
|
|
|
if (q.Contains(' ')) |
|
|
|
|
|
{ |
|
|
|
|
|
stinglist.Add(q.Substring(0, q.IndexOf(' '))); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
if (stinglist != null) |
|
|
|
|
|
{ |
|
|
|
|
|
DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1?0: stinglist.IndexOf(CurrentUser.ChineseName); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void SetRoleRule() |
|
|
private void SetRoleRule() |
|
|
{ |
|
|
{ |
|
|
IsPriceVisible(Grid_V_TB_PO_DETAIL, "价格"); |
|
|
IsPriceVisible(Grid_V_TB_PO_DETAIL, "价格"); |
|
|
DDL_ReceivedPort.DataSource = ScpCache.PortList.Where(p=>CurrentUser.FactoryList.Contains(p.FACTORY_ID)); |
|
|
DDL_ReceivedPort.DataSource = ScpCache.PortList.Where(p => CurrentUser.FactoryList.Contains(p.FACTORY_ID)); |
|
|
DDL_ReceivedPort.DataBind(); |
|
|
DDL_ReceivedPort.DataBind(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
private void CheckRolesMenu() |
|
|
private void CheckRolesMenu() |
|
|
{ |
|
|
{ |
|
@ -56,7 +73,7 @@ namespace SCP.PlanData |
|
|
TXT_Site.Hidden = false; |
|
|
TXT_Site.Hidden = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
protected void BtnClose_Click(object sender, EventArgs e) |
|
|
protected void BtnClose_Click(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
gp1.Hidden = true; |
|
|
gp1.Hidden = true; |
|
|
} |
|
|
} |
|
@ -67,14 +84,15 @@ namespace SCP.PlanData |
|
|
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_PO_DETAIL>> p_action) |
|
|
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_PO_DETAIL>> p_action) |
|
|
{ |
|
|
{ |
|
|
V_TB_PO_DETAIL _entity = new V_TB_PO_DETAIL(); |
|
|
V_TB_PO_DETAIL _entity = new V_TB_PO_DETAIL(); |
|
|
_entity.PoBillNum=Request["PoBillNum"]; |
|
|
_entity.PoBillNum = Request["PoBillNum"]; |
|
|
SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity,(_ret)=> { |
|
|
SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity, (_ret) => |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (_ret.State == ReturnStatus.Succeed) |
|
|
if (_ret.State == ReturnStatus.Succeed) |
|
|
{ |
|
|
{ |
|
|
p_action(_ret.Result); |
|
|
p_action(_ret.Result); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
public void GetV_TB_POData() |
|
|
public void GetV_TB_POData() |
|
@ -105,7 +123,7 @@ namespace SCP.PlanData |
|
|
this.TXT_VendId.Text = _result.VendId; |
|
|
this.TXT_VendId.Text = _result.VendId; |
|
|
this.TXT_Site.Text = _result.Site_Desc; |
|
|
this.TXT_Site.Text = _result.Site_Desc; |
|
|
this.TXT_State_DESC.Text = _result.State_DESC; |
|
|
this.TXT_State_DESC.Text = _result.State_DESC; |
|
|
|
|
|
|
|
|
this.TXT_VendName.Text = _result.VendName; |
|
|
this.TXT_VendName.Text = _result.VendName; |
|
|
this.txtRemark.Text = _result.Remark; |
|
|
this.txtRemark.Text = _result.Remark; |
|
|
} |
|
|
} |
|
@ -114,7 +132,8 @@ namespace SCP.PlanData |
|
|
public void BindDetail() |
|
|
public void BindDetail() |
|
|
{ |
|
|
{ |
|
|
var qadOrder = Session["order"] as V_TB_PO; |
|
|
var qadOrder = Session["order"] as V_TB_PO; |
|
|
SearchV_TB_PO_DETAIL((ret)=> { |
|
|
SearchV_TB_PO_DETAIL((ret) => |
|
|
|
|
|
{ |
|
|
if (!string.IsNullOrEmpty(TextArea_PartCode.Text)) |
|
|
if (!string.IsNullOrEmpty(TextArea_PartCode.Text)) |
|
|
{ |
|
|
{ |
|
|
List<string> _strlist = new List<string>(); |
|
|
List<string> _strlist = new List<string>(); |
|
@ -125,9 +144,9 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
ret = ret.Where(p => _strlist.Contains(p.PartCode)); |
|
|
ret = ret.Where(p => _strlist.Contains(p.PartCode)); |
|
|
} |
|
|
} |
|
|
this.Grid_V_TB_PO_DETAIL.RecordCount = ret.Count(); |
|
|
this.Grid_V_TB_PO_DETAIL.RecordCount = ret.Count(); |
|
|
var list = SortAndPage<V_TB_PO_DETAIL>(ret, Grid_V_TB_PO_DETAIL); |
|
|
var list = SortAndPage<V_TB_PO_DETAIL>(ret, Grid_V_TB_PO_DETAIL); |
|
|
var _ls= SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_PO_CONTROLLER.LOAD_PO_DETAIL_SUM_ASK(list.ToList())); |
|
|
var _ls = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_PO_CONTROLLER.LOAD_PO_DETAIL_SUM_ASK(list.ToList())); |
|
|
if (qadOrder != null) |
|
|
if (qadOrder != null) |
|
|
{ |
|
|
{ |
|
|
if (qadOrder.ModType == (int)BillModType.Non_Contract) |
|
|
if (qadOrder.ModType == (int)BillModType.Non_Contract) |
|
@ -146,19 +165,19 @@ namespace SCP.PlanData |
|
|
_ls.ForEach(p => |
|
|
_ls.ForEach(p => |
|
|
{ |
|
|
{ |
|
|
p.EndTime = DateTime.Now; |
|
|
p.EndTime = DateTime.Now; |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//_ls.ForEach(p => p.EndTime = qadOrder.EndTime);
|
|
|
//_ls.ForEach(p => p.EndTime = qadOrder.EndTime);
|
|
|
|
|
|
|
|
|
Grid_V_TB_PO_DETAIL.DataSource = _ls; |
|
|
Grid_V_TB_PO_DETAIL.DataSource = _ls; |
|
|
Grid_V_TB_PO_DETAIL.DataBind(); |
|
|
Grid_V_TB_PO_DETAIL.DataBind(); |
|
|
|
|
|
|
|
|
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) |
|
|
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) |
|
|
{ |
|
|
{ |
|
|
if(CurrentUser.FactoryList.FirstOrDefault()== "CNS") |
|
|
if (CurrentUser.FactoryList.FirstOrDefault() == "CNS") |
|
|
{ |
|
|
{ |
|
|
if (qadOrder != null) |
|
|
if (qadOrder != null) |
|
|
{ |
|
|
{ |
|
@ -172,8 +191,8 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
|
|
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
|
|
{ |
|
|
{ |
|
@ -197,15 +216,15 @@ namespace SCP.PlanData |
|
|
{ |
|
|
{ |
|
|
var qadOrder = Session["order"] as V_TB_PO; |
|
|
var qadOrder = Session["order"] as V_TB_PO; |
|
|
//qadOrder.ReceivedPort = DDL_PORT.SelectedValue;
|
|
|
//qadOrder.ReceivedPort = DDL_PORT.SelectedValue;
|
|
|
if (DP_BeginTime.SelectedDate == null ) |
|
|
if (DP_BeginTime.SelectedDate == null) |
|
|
{ |
|
|
{ |
|
|
Alert.Show("要货日期没有填写!"); |
|
|
Alert.Show("要货日期没有填写!"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
qadOrder.BeginTime = DP_BeginTime.SelectedDate; |
|
|
qadOrder.BeginTime = DP_BeginTime.SelectedDate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<string> _lineList = new List<string>(); |
|
|
List<string> _lineList = new List<string>(); |
|
|
if (!string.IsNullOrEmpty(CurrentUser.Name)) |
|
|
if (!string.IsNullOrEmpty(CurrentUser.Name)) |
|
|
{ |
|
|
{ |
|
@ -235,7 +254,7 @@ namespace SCP.PlanData |
|
|
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[15]); |
|
|
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[15]); |
|
|
_entity.DockCode = rowDataKeys[16] as string; |
|
|
_entity.DockCode = rowDataKeys[16] as string; |
|
|
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[17]); |
|
|
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[17]); |
|
|
|
|
|
|
|
|
_entity.Remark = rowDataKeys[18] as string; |
|
|
_entity.Remark = rowDataKeys[18] as string; |
|
|
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[19]); |
|
|
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[19]); |
|
|
_entity.CreateUser = rowDataKeys[20] as string; |
|
|
_entity.CreateUser = rowDataKeys[20] as string; |
|
@ -255,7 +274,7 @@ namespace SCP.PlanData |
|
|
_entity.PartDesc2 = rowDataKeys[34] as string; |
|
|
_entity.PartDesc2 = rowDataKeys[34] as string; |
|
|
_entity.TempQty = ConvertHelper.To<Decimal>(rowDataKeys[35]); |
|
|
_entity.TempQty = ConvertHelper.To<Decimal>(rowDataKeys[35]); |
|
|
_entity.BeginTime = DP_BeginTime.SelectedDate; |
|
|
_entity.BeginTime = DP_BeginTime.SelectedDate; |
|
|
_entity.PartState = rowDataKeys[38] as string; |
|
|
_entity.PartState = rowDataKeys[38] as string; |
|
|
if (qadOrder.ModType == (int)BillModType.Non_Contract) |
|
|
if (qadOrder.ModType == (int)BillModType.Non_Contract) |
|
|
{ |
|
|
{ |
|
|
_entity.PublishQty = ConvertHelper.To<Decimal>(rowDataKeys[36]); |
|
|
_entity.PublishQty = ConvertHelper.To<Decimal>(rowDataKeys[36]); |
|
@ -267,14 +286,14 @@ namespace SCP.PlanData |
|
|
if (modifiedDict.Keys.Contains(i)) |
|
|
if (modifiedDict.Keys.Contains(i)) |
|
|
{ |
|
|
{ |
|
|
var modifyValue = modifiedDict[i]; |
|
|
var modifyValue = modifiedDict[i]; |
|
|
var Remark = modifyValue.Keys.Contains("Remark") ? modifyValue["Remark"] :_entity.Remark; |
|
|
var Remark = modifyValue.Keys.Contains("Remark") ? modifyValue["Remark"] : _entity.Remark; |
|
|
if (Remark!=null) |
|
|
if (Remark != null) |
|
|
{ |
|
|
{ |
|
|
_entity.Remark = Remark.ToString(); |
|
|
_entity.Remark = Remark.ToString(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (modifyValue.Keys.Contains("PublishQty")) |
|
|
if (modifyValue.Keys.Contains("PublishQty")) |
|
|
{ |
|
|
{ |
|
|
var _publishQty = modifyValue["PublishQty"]; |
|
|
var _publishQty = modifyValue["PublishQty"]; |
|
|
decimal _out = 0; |
|
|
decimal _out = 0; |
|
|
bool _result = decimal.TryParse(_publishQty.ToString(), out _out); |
|
|
bool _result = decimal.TryParse(_publishQty.ToString(), out _out); |
|
@ -313,7 +332,12 @@ namespace SCP.PlanData |
|
|
{ |
|
|
{ |
|
|
_lineList.Add(string.Format("产品名称:{0}截至日期:{1}", _entity.PartDesc1, _endTime.ToString())); |
|
|
_lineList.Add(string.Format("产品名称:{0}截至日期:{1}", _entity.PartDesc1, _endTime.ToString())); |
|
|
} |
|
|
} |
|
|
_entity.EndTime = _date; |
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.EndTime = _date; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -325,6 +349,10 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (DatePicker2.SelectedDate != null) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.EndTime = DatePicker2.SelectedDate; |
|
|
|
|
|
} |
|
|
if (_entity.PublishQty != null && _entity.PublishQty > 0) |
|
|
if (_entity.PublishQty != null && _entity.PublishQty > 0) |
|
|
{ |
|
|
{ |
|
|
qadOrderList.Add(_entity); |
|
|
qadOrderList.Add(_entity); |
|
@ -351,7 +379,7 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
if (p.PartState.ToUpper() == "SP") |
|
|
if (p.PartState.ToUpper() == "SP") |
|
|
{ |
|
|
{ |
|
|
_lineList.Add("(" + p.PartCode + ")" +"状态为SP不可以生成要货看板!"); |
|
|
_lineList.Add("(" + p.PartCode + ")" + "状态为SP不可以生成要货看板!"); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
if (_lineList.Count > 0) |
|
|
if (_lineList.Count > 0) |
|
@ -365,7 +393,7 @@ namespace SCP.PlanData |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
string str = string.Empty; |
|
|
string str = string.Empty; |
|
|
if (!string.IsNullOrEmpty(CurrentUser.HomePhone)) |
|
|
if (!string.IsNullOrEmpty(CurrentUser.HomePhone)) |
|
|
{ |
|
|
{ |
|
@ -383,14 +411,15 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(CurrentUser.FactoryList!=null && CurrentUser.FactoryList.Count>0) |
|
|
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) |
|
|
{ |
|
|
{ |
|
|
if(CurrentUser.FactoryList.FirstOrDefault()=="CNS") |
|
|
if (CurrentUser.FactoryList.FirstOrDefault() == "CNS") |
|
|
{ |
|
|
{ |
|
|
if (qadOrder.ModType == 2) |
|
|
if (qadOrder.ModType == 2) |
|
|
{ |
|
|
{ |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
qadOrderList.ForEach(p => { |
|
|
qadOrderList.ForEach(p => |
|
|
|
|
|
{ |
|
|
if (p.PlanQty != p.PublishQty) |
|
|
if (p.PlanQty != p.PublishQty) |
|
|
{ |
|
|
{ |
|
|
i = 1; |
|
|
i = 1; |
|
@ -406,12 +435,12 @@ namespace SCP.PlanData |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var _ls=qadOrderList.Where(itm => string.IsNullOrEmpty(itm.PartDesc1) && string.IsNullOrEmpty(itm.PartDesc2)).ToList(); |
|
|
var _ls = qadOrderList.Where(itm => string.IsNullOrEmpty(itm.PartDesc1) && string.IsNullOrEmpty(itm.PartDesc2)).ToList(); |
|
|
|
|
|
|
|
|
if (_ls.Count > 0) |
|
|
if (_ls.Count > 0) |
|
|
{ |
|
|
{ |
|
|
string _str = "不能生成要货看板原因\n\r"; |
|
|
string _str = "不能生成要货看板原因\n\r"; |
|
|
_str=_str+string.Join("\n\r", _ls.Select(itm => itm.PartCode).ToArray()); |
|
|
_str = _str + string.Join("\n\r", _ls.Select(itm => itm.PartCode).ToArray()); |
|
|
_str = _str + "零件不存在!"; |
|
|
_str = _str + "零件不存在!"; |
|
|
Alert.Show(_str); |
|
|
Alert.Show(_str); |
|
|
return; |
|
|
return; |
|
@ -424,14 +453,14 @@ namespace SCP.PlanData |
|
|
qadOrderList.ForEach(p => { p.Remark = string.Empty; }); |
|
|
qadOrderList.ForEach(p => { p.Remark = string.Empty; }); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
string Ssite=""; |
|
|
string Ssite = ""; |
|
|
if (CurrentUser.FactoryList.Contains("CQBMPT")) |
|
|
if (CurrentUser.FactoryList.Contains("CQBMPT")) |
|
|
{ |
|
|
{ |
|
|
Ssite = DDL_Site.SelectedValue; |
|
|
Ssite = DDL_Site.SelectedValue; |
|
|
} |
|
|
} |
|
|
string Stremark = txtRemark.Text; |
|
|
string Stremark = txtRemark.Text; |
|
|
|
|
|
|
|
|
var ret = SCP_PO_CONTROLLER.Save_PO_TO_ASK_CQ(qadOrder, qadOrderList, CurrentUser.ChineseName, str,CurrentUser.Name, Stremark, Ssite); |
|
|
var ret = SCP_PO_CONTROLLER.Save_PO_TO_ASK_CQ(qadOrder, qadOrderList, CurrentUser.ChineseName, str, CurrentUser.Name, Stremark, Ssite); |
|
|
if (ret.Result == true) |
|
|
if (ret.Result == true) |
|
|
{ |
|
|
{ |
|
|
if (ret.MessageList.Count > 0) |
|
|
if (ret.MessageList.Count > 0) |
|
@ -444,15 +473,15 @@ namespace SCP.PlanData |
|
|
Alert.Show("生成要货看板成功!"); |
|
|
Alert.Show("生成要货看板成功!"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//}
|
|
|
//}
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void Grid_V_TB_PO_DETAIL_RowDataBound(object sender, GridRowEventArgs e) |
|
|
protected void Grid_V_TB_PO_DETAIL_RowDataBound(object sender, GridRowEventArgs e) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|