564 lines
19 KiB
C#
564 lines
19 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Drawing;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using WMS.Frm.Base;
|
|||
|
|
using WMS.Model.RK;
|
|||
|
|
using WMS.Model.Base;
|
|||
|
|
using WMS.Common;
|
|||
|
|
|
|||
|
|
using WMS.Ctrl;
|
|||
|
|
using WMS.Business;
|
|||
|
|
using WMS.Business.Base;
|
|||
|
|
using WMS.Business.RK;
|
|||
|
|
using DevExpress.XtraEditors;
|
|||
|
|
using WMS.Model.SC;
|
|||
|
|
using WMS.Business.SC;
|
|||
|
|
|
|||
|
|
namespace WMS.FrmRK
|
|||
|
|
{
|
|||
|
|
public partial class FrmReceiveDet : FormBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
///// <summary>
|
|||
|
|
///// 收货MODEL
|
|||
|
|
///// </summary>
|
|||
|
|
//ReceivingModel receModel = new ReceivingModel();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 收货明细Model
|
|||
|
|
/// </summary>
|
|||
|
|
CodeDiskModel infomodel = new CodeDiskModel();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 收货明细数据源
|
|||
|
|
/// </summary>
|
|||
|
|
List<CodeDiskModel> InfoList = new List<CodeDiskModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 收货明细数据源Copy
|
|||
|
|
/// </summary>
|
|||
|
|
List<CodeDiskModel> CopyList = new List<CodeDiskModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细增加
|
|||
|
|
/// </summary>
|
|||
|
|
List<CodeDiskModel> AddList = new List<CodeDiskModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细修改
|
|||
|
|
/// </summary>
|
|||
|
|
List<CodeDiskModel> UpList = new List<CodeDiskModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细删除
|
|||
|
|
/// </summary>
|
|||
|
|
List<CodeDiskModel> DelList = new List<CodeDiskModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 业务类型
|
|||
|
|
/// </summary>
|
|||
|
|
int workflag=0;//0 增加 1 修改 2 删除 ;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 是否修改
|
|||
|
|
/// </summary>
|
|||
|
|
bool changeflag = false;
|
|||
|
|
string STORAGE_NAME = "";
|
|||
|
|
|
|||
|
|
string STORAGE_ID = "";
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 页面初始化
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model">收货单</param>
|
|||
|
|
/// <param name="list">收货单明细</param>
|
|||
|
|
/// <param name="flag">业务类型</param>
|
|||
|
|
public FrmReceiveDet(string _STORAGE_ID,string _STORAGE_NAME)
|
|||
|
|
{
|
|||
|
|
// receModel = model;
|
|||
|
|
// InfoList = list;
|
|||
|
|
// workflag = flag;
|
|||
|
|
InitializeComponent();
|
|||
|
|
STORAGE_ID = _STORAGE_ID;
|
|||
|
|
STORAGE_NAME = _STORAGE_NAME;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 页面加载
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void FrmReceiveDet_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
LoadForm load = new LoadForm();
|
|||
|
|
DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(load, load.GetType(), false, true, false, 70);
|
|||
|
|
DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormDescription("数据加载中...");
|
|||
|
|
|
|||
|
|
// BSReceve.DataSource = receModel;
|
|||
|
|
bindgrid();
|
|||
|
|
bindLEP();
|
|||
|
|
ct_starge.TextBoxValue = STORAGE_NAME;
|
|||
|
|
ct_starge.TextBoxFlag = STORAGE_ID;
|
|||
|
|
BindStandData(STORAGE_ID);
|
|||
|
|
BindLocData();
|
|||
|
|
// DicReceMan.TextBoxFlag = receModel.RECE_MAN;
|
|||
|
|
// DicPrintMan.TextBoxFlag = receModel.PRINT_MAN;
|
|||
|
|
|
|||
|
|
DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定明细
|
|||
|
|
/// </summary>
|
|||
|
|
private void bindgrid()
|
|||
|
|
{
|
|||
|
|
GCReceive.DataSource = InfoList;
|
|||
|
|
CopyList = InfoList.ToList();
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定下拉框
|
|||
|
|
/// </summary>
|
|||
|
|
private void bindLEP()
|
|||
|
|
{
|
|||
|
|
List<JWGoodsInfoModel> goodsListModel = IBussFactory<BussGoods>.Instance().GetGoodsList("", "", "", "");
|
|||
|
|
repositoryItemLookUpEdit1.DataSource = goodsListModel;
|
|||
|
|
repositoryItemLookUpEdit1.DisplayMember = "GOODS_NAME";
|
|||
|
|
repositoryItemLookUpEdit1.ValueMember = "GOODS_ID";
|
|||
|
|
repositoryItemLookUpEdit1.EditValueChanged += RepositoryItemLookUpEdit1_EditValueChanged1;
|
|||
|
|
|
|||
|
|
// PalletModel strmodel = new PalletModel();
|
|||
|
|
//List<PalletModel> palletModelList = IBussFactory<BussPallet>.Instance().GetPalletList(strmodel);
|
|||
|
|
|
|||
|
|
// if (palletModelList!=null)
|
|||
|
|
// {
|
|||
|
|
// repositoryItemLookUpEdit2.DataSource = palletModelList;
|
|||
|
|
// repositoryItemLookUpEdit2.DisplayMember = "PALLET_NAME";
|
|||
|
|
// repositoryItemLookUpEdit2.ValueMember = "PALLET_ID";
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
|
|||
|
|
//StorageAreaLocationModel model = new StorageAreaLocationModel();
|
|||
|
|
//model.STORAGE_ID = STORAGE_ID;
|
|||
|
|
//model.STATUS = "0";
|
|||
|
|
//List<StorageAreaLocationModel> listLoc = IBussFactory<BussStorageAreaLocation>.Instance().GetLocationInfoDS(model);
|
|||
|
|
//if (listLoc != null)
|
|||
|
|
//{
|
|||
|
|
// repositoryItemLookUpEdit3.DataSource = listLoc;
|
|||
|
|
// repositoryItemLookUpEdit3.DisplayMember = "LOCATION_ID";
|
|||
|
|
// repositoryItemLookUpEdit3.ValueMember = "LOCATION_ID";
|
|||
|
|
// repositoryItemLookUpEdit3.EditValueChanged += RepositoryItemLookUpEdit3_EditValueChanged;
|
|||
|
|
//}
|
|||
|
|
GoodsMaterialModel mn = new GoodsMaterialModel();
|
|||
|
|
List<GoodsMaterialModel> listMaterials = IBussFactory<BussGoodsMaterial>.Instance().GetGoodsMaterialList(mn);
|
|||
|
|
if (listMaterials != null && listMaterials.Count > 0)
|
|||
|
|
{
|
|||
|
|
repositoryItemLookUpEdit4.DataSource = listMaterials;
|
|||
|
|
repositoryItemLookUpEdit4.DisplayMember = "WIP_ENTITY";
|
|||
|
|
repositoryItemLookUpEdit4.ValueMember = "WIP_ENTITY";
|
|||
|
|
repositoryItemLookUpEdit4.EditValueChanged += repositoryItemLookUpEdit4_EditValueChanged1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void RepositoryItemLookUpEdit3_EditValueChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
LookUpEdit a = sender as LookUpEdit;
|
|||
|
|
infomodel.LOCATION_ID = a.EditValue.ToString();
|
|||
|
|
GVReceive.FocusedColumn = colGoods_Num;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void repositoryItemLookUpEdit4_EditValueChanged1(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
LookUpEdit a = sender as LookUpEdit;
|
|||
|
|
GoodsMaterialModel model= a.GetSelectedDataRow() as GoodsMaterialModel;
|
|||
|
|
if (model != null)
|
|||
|
|
{
|
|||
|
|
infomodel.PROVIDER_ID = a.EditValue.ToString();
|
|||
|
|
infomodel.Goods_id = model.GOODS_ID;
|
|||
|
|
infomodel.Goods_Num = model.STAND_NUM;
|
|||
|
|
}
|
|||
|
|
// GVReceive.FocusedColumn = colGoods_Num;
|
|||
|
|
}
|
|||
|
|
private void RepositoryItemLookUpEdit1_EditValueChanged1(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
LookUpEdit a = sender as LookUpEdit;
|
|||
|
|
infomodel.Goods_id = a.EditValue.ToString();
|
|||
|
|
GVReceive.FocusedColumn=colGoods_Num;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void GCReceive_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
// GVReceive.FocusedColumn = colARR_NUM;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细增加按钮
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnADD_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
infomodel = new CodeDiskModel() ;
|
|||
|
|
infomodel.STORAGE_ID = ct_starge.TextBoxFlag;
|
|||
|
|
infomodel.ConveyorID = comboBox1.Text;
|
|||
|
|
InfoList.Add(infomodel);
|
|||
|
|
|
|||
|
|
GCReceive.DataSource = InfoList;
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细删除按钮
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btDel_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (GVReceive.FocusedRowHandle < 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CodeDiskModel mod = InfoList[GVReceive.FocusedRowHandle];
|
|||
|
|
InfoList.Remove(mod);
|
|||
|
|
if(InfoList!=null)
|
|||
|
|
{
|
|||
|
|
GCReceive.DataSource = InfoList;
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细保存按钮
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnSave_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if(InfoList.Count==0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if (InfoList.Count(r => r.Pallet_id.Trim().Length == 0) > 0)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("选择托盘");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if (InfoList.Count(r => r.Goods_id.Trim().Length==0) > 0)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("选择物料");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if ( InfoList.Count(r => r.Goods_Num == 0)>0)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("数量不能为0");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
StorageInfoModel info = new StorageInfoModel();
|
|||
|
|
info.STORAGE_ID = ct_starge.TextBoxFlag;
|
|||
|
|
List<StorageInfoModel> str_list = IBussFactory<BussStorageInfo>.Instance().GetStorageInfoDS(info);
|
|||
|
|
if (str_list != null)
|
|||
|
|
{
|
|||
|
|
if (str_list[0].AUTOSTS)
|
|||
|
|
{
|
|||
|
|
//if (comboBox1.Text.Trim().Length == 0)
|
|||
|
|
//{
|
|||
|
|
// SystemCommon.ShowInfoMessageBox("站台号没有输入");
|
|||
|
|
|
|||
|
|
// comboBox1.Focus();
|
|||
|
|
|
|||
|
|
// return;
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string stand = comboBox1.Text;
|
|||
|
|
StorageLotModel stoLotModel = new StorageLotModel();
|
|||
|
|
stoLotModel.STO_ID = ct_starge.TextBoxFlag;// userData.STORAGE_ID;
|
|||
|
|
stoLotModel.OPERATORID = userData.USER_ID;
|
|||
|
|
|
|||
|
|
string errText = IBussFactory<BussStorageLot>.Instance().AddCodeDiskLotData(stoLotModel, InfoList, stand);
|
|||
|
|
if(errText.Trim().Length==0)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("保存成功");
|
|||
|
|
|
|||
|
|
if (GVReceive.FocusedRowHandle < 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CodeDiskModel mod = InfoList[GVReceive.FocusedRowHandle];
|
|||
|
|
InfoList.Remove(mod);
|
|||
|
|
if (InfoList != null)
|
|||
|
|
{
|
|||
|
|
GCReceive.DataSource = InfoList;
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
//DialogResult= DialogResult.OK;
|
|||
|
|
}
|
|||
|
|
//if (UpList.Count > 0 || AddList.Count > 0 || DelList.Count > 0)
|
|||
|
|
//{
|
|||
|
|
//string UpListModel = Newtonsoft.Json.JsonConvert.SerializeObject(UpList);
|
|||
|
|
//string AddListModel = Newtonsoft.Json.JsonConvert.SerializeObject(AddList);
|
|||
|
|
//string DelListModel = Newtonsoft.Json.JsonConvert.SerializeObject(DelList);
|
|||
|
|
|
|||
|
|
//string err = WebLockConfig.Instance.WebReceve.newReceivingInfoFuc(UpListModel, AddListModel, DelListModel);
|
|||
|
|
|
|||
|
|
//if (!string.IsNullOrEmpty(err))
|
|||
|
|
//{
|
|||
|
|
// SystemCommon.ShowErrorMessageBox(err);
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
//{
|
|||
|
|
// SystemCommon.ShowInfoMessageBox("明细修改成功!");
|
|||
|
|
// changeflag = true;
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 页面保存按钮
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnCommit_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (InfoList.Count == 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string err = "";
|
|||
|
|
// btnCommit.Focus();
|
|||
|
|
BSReceve.EndEdit();
|
|||
|
|
if (workflag == 0)//增加
|
|||
|
|
{
|
|||
|
|
// StorageLotInfoModel model = BSReceve.DataSource as StorageLotInfoModel;
|
|||
|
|
// string num = IBussFactory<BussReceve>.Instance().GetSerialNum();
|
|||
|
|
// model.RECE_ID = "SH" + Convert.ToDateTime(DateRece.EditValue).ToString("yyyyMMdd") + num;
|
|||
|
|
// model.STATUS = "0";
|
|||
|
|
//model.BUY_NUM = Convert.ToDecimal(colBUY_NUM.SummaryText);
|
|||
|
|
//model.ARR_NUM = Convert.ToDecimal(colARR_NUM.SummaryText);
|
|||
|
|
//model.STO_NUM = Convert.ToDecimal(colGoods_Num.SummaryText);
|
|||
|
|
// model.SHELVE_NUM = Convert.ToDecimal(colSHELVE_NUM.SummaryText);
|
|||
|
|
// model.OPERATORNAME = DicReceMan.TextBoxFlag;
|
|||
|
|
// model.OPERATORID = DicPrintMan.TextBoxFlag;
|
|||
|
|
// model.NOTICE_ID = receModel.NOTICE_ID;
|
|||
|
|
//model.ENTRY_MAN = userData.USER_ID;
|
|||
|
|
//model.ENTRY_MAN_NAME = userData.NAME;
|
|||
|
|
// model.OPERATEDATE = DateTime.Now;
|
|||
|
|
|
|||
|
|
//foreach (StorageLotInfoModel infomodel in InfoList)
|
|||
|
|
//{
|
|||
|
|
// infomodel.RECE_ID = model.RECE_ID;
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
// string receveModel = Newtonsoft.Json.JsonConvert.SerializeObject(model);
|
|||
|
|
// string receveInfoList = Newtonsoft.Json.JsonConvert.SerializeObject(InfoList);
|
|||
|
|
// err = WebLockConfig.Instance.WebReceve.execReceveAdd(receveModel, receveInfoList);
|
|||
|
|
}
|
|||
|
|
//else if (workflag == 1)
|
|||
|
|
//{
|
|||
|
|
// receModel.BUY_NUM_SUM = Convert.ToDecimal(colBUY_NUM.SummaryText);
|
|||
|
|
// receModel.ARR_NUM_SUM = Convert.ToDecimal(colARR_NUM.SummaryText) - receModel.ARR_NUM_SUM;
|
|||
|
|
// receModel.STO_NUM_SUM = Convert.ToDecimal(colSTO_NUM.SummaryText);
|
|||
|
|
// receModel.SHELVE_NUM_SUM = Convert.ToDecimal(colSHELVE_NUM.SummaryText);
|
|||
|
|
// receModel.RECE_MAN = DicReceMan.TextBoxFlag;
|
|||
|
|
// receModel.PRINT_MAN = DicPrintMan.TextBoxFlag;
|
|||
|
|
// receModel.ENTRY_MAN = userData.USER_ID;
|
|||
|
|
// receModel.ENTRY_MAN_NAME = userData.NAME;
|
|||
|
|
// receModel.ENTRY_DATE = DateTime.Now;
|
|||
|
|
|
|||
|
|
|
|||
|
|
// foreach (ReceivingInfoModel infomodel in InfoList)
|
|||
|
|
// {
|
|||
|
|
// infomodel.RECE_ID = receModel.RECE_ID;
|
|||
|
|
// }
|
|||
|
|
// err = IBussFactory<BussReceve>.Instance().Update(receModel, InfoList);
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
//if (!string.IsNullOrEmpty(err))
|
|||
|
|
//{
|
|||
|
|
// SystemCommon.ShowErrorMessageBox(err);
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
//{
|
|||
|
|
// changeflag = false;
|
|||
|
|
// SystemCommon.ShowInfoMessageBox("保存操作成功!");
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
// this.Close();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 打印
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnPrint_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
// receModel.PRINT_NUM = receModel.PRINT_NUM + 1;
|
|||
|
|
// receModel.PRINT_DATE = DateTime.Now;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 关闭
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
this.Close();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 明细修改
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void GVReceive_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.RowHandle < 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CodeDiskModel focModel = InfoList[e.RowHandle];
|
|||
|
|
|
|||
|
|
labelControl1.Focus();
|
|||
|
|
if (!AddList.Contains(focModel) && !CopyList.Contains(focModel))
|
|||
|
|
{
|
|||
|
|
AddList.Add(focModel);
|
|||
|
|
}
|
|||
|
|
if (!UpList.Contains(focModel) && CopyList.Contains(focModel))
|
|||
|
|
{
|
|||
|
|
UpList.Add(focModel);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//if (e.Column.Name == "colARR_NUM")
|
|||
|
|
//{
|
|||
|
|
// decimal ARR_NUM = Convert.ToDecimal(GVReceive.GetFocusedRowCellValue("ARR_NUM"));
|
|||
|
|
// decimal BUY_NUM = Convert.ToDecimal(GVReceive.GetFocusedRowCellValue("BUY_NUM"));
|
|||
|
|
|
|||
|
|
// if (ARR_NUM > BUY_NUM)
|
|||
|
|
// {
|
|||
|
|
// SystemCommon.ShowInfoMessageBox("请注意:" + Environment.NewLine + "您输入的接收数量大于采购数量!");
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
//{
|
|||
|
|
|
|||
|
|
if (e.Column.Name == "colGOODS_ID" && !CopyList.Contains(focModel))
|
|||
|
|
{
|
|||
|
|
if (InfoList.Find(r => r.Goods_id == focModel.Goods_id) != null)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("通知单明细中已包含商品:" + focModel.Goods_id);
|
|||
|
|
focModel.Goods_id = null;
|
|||
|
|
GVReceive.RefreshData();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 页面关闭
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void FrmReceiveDet_FormClosing(object sender, FormClosingEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (changeflag)
|
|||
|
|
{
|
|||
|
|
btnCommit_Click(null,null);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void GVReceive_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
|
|||
|
|
{
|
|||
|
|
CodeDiskModel focModel = InfoList[e.RowHandle];
|
|||
|
|
if (CopyList.Contains(focModel))
|
|||
|
|
{
|
|||
|
|
if (e.Column.Name != "colARR_NUM")
|
|||
|
|
{
|
|||
|
|
GVReceive.SetRowCellValue(e.RowHandle, e.Column, GVReceive.GetFocusedRowCellValue(e.Column.FieldName));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
void BindLocData()
|
|||
|
|
{
|
|||
|
|
StorageAreaLocationModel model = new StorageAreaLocationModel();
|
|||
|
|
model.STORAGE_ID = ct_starge.TextBoxFlag;
|
|||
|
|
List<StorageAreaLocationModel> listLoc = IBussFactory<BussStorageAreaLocation>.Instance().GetLocationInfoDS(model);
|
|||
|
|
if (listLoc != null)
|
|||
|
|
{
|
|||
|
|
repositoryItemLookUpEdit3.DataSource = listLoc;
|
|||
|
|
repositoryItemLookUpEdit3.DisplayMember = "LOCATION_ID";
|
|||
|
|
repositoryItemLookUpEdit3.ValueMember = "LOCATION_ID";
|
|||
|
|
|
|||
|
|
repositoryItemLookUpEdit3.EditValueChanged += RepositoryItemLookUpEdit3_EditValueChanged;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
void BindStandData(string STORAGE_ID)
|
|||
|
|
{
|
|||
|
|
DataTable tb= IBussFactory<BussAutoRk>.Instance().GetStandStorage(STORAGE_ID);
|
|||
|
|
if(tb!=null)
|
|||
|
|
{
|
|||
|
|
if(tb.Rows.Count>0)
|
|||
|
|
{
|
|||
|
|
comboBox1.Items.Clear();
|
|||
|
|
foreach (DataRow row in tb.Rows)
|
|||
|
|
{
|
|||
|
|
string rId = row["ConveyorID"].ToString();
|
|||
|
|
comboBox1.Items.Add(rId);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
comboBox1.Items.Clear();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
private void ct_starge_Button_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (ct_starge.TextBoxFlag.Trim().Length > 0)
|
|||
|
|
{
|
|||
|
|
BindLocData();
|
|||
|
|
BindStandData(ct_starge.TextBoxFlag);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnClose_Click_1(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
this.Close();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|