2023-05-23 16:13:17 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using DevExpress.XtraBars;
|
|
|
|
|
using DevExpress.XtraGrid.Views.Base;
|
|
|
|
|
//using DeiNiu.wms.Logical;
|
|
|
|
|
using DeiNiu.wms.Data;
|
|
|
|
|
using DevExpress.XtraGrid.Columns;
|
|
|
|
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
|
|
|
using DevExpress.XtraEditors.DXErrorProvider;
|
|
|
|
|
using DeiNiu.wms.Data.Model;
|
|
|
|
|
using DevExpress.XtraEditors;
|
|
|
|
|
using DevExpress.XtraEditors.Controls;
|
|
|
|
|
using DeiNiu.Utils;
|
|
|
|
|
using DeiNiu.wms.win.ServiceReferenceStockOutPickRequest;
|
|
|
|
|
using System.ServiceModel;
|
|
|
|
|
using DeiNiu.wms.win.utils.print;
|
|
|
|
|
using DevExpress.XtraLayout;
|
|
|
|
|
using DeiNiu.wms.win.ServiceReferenceLot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DeiNiu.wms.win
|
|
|
|
|
{
|
|
|
|
|
public partial class GoodsOutValidationForm : BasicRibbonForm
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// lWmsStock ls = new lWmsStock();
|
|
|
|
|
//lWmsOutPickRequest lgt = new lWmsOutPickRequest();
|
|
|
|
|
//lWmsOutRequest lgOutReq = new lWmsOutRequest();
|
|
|
|
|
// lWmsOutPickRequest outPickRequest = new lWmsOutPickRequest();
|
|
|
|
|
// private string lastQuery = "";
|
|
|
|
|
DataSet dsPickOrders;
|
|
|
|
|
|
|
|
|
|
private DataTable dtPickOrders;
|
|
|
|
|
private DataTable dtPickOrdersDetail;
|
|
|
|
|
private DataTable dtPickOrders4Validation;
|
|
|
|
|
private DataTable dtPickOrdersValidated;
|
|
|
|
|
private DataTable dtPickDetails;
|
|
|
|
|
private DataTable dtExceptionSolutions;
|
|
|
|
|
private int selectedRowIndex = -1;
|
|
|
|
|
private WmsOutPickDetail_tmp currentDetail;
|
|
|
|
|
string lastScanBarcode = "";
|
|
|
|
|
bool isDoubleChk = false;
|
|
|
|
|
|
|
|
|
|
// Thread threadPreProcess;
|
|
|
|
|
bool autoOrder;
|
|
|
|
|
string currentPickOrder = "";
|
|
|
|
|
string currentWave = "";
|
|
|
|
|
string boxWave = "";
|
|
|
|
|
int boxDesk = 0;
|
|
|
|
|
Dictionary<string, string> isDoublChk = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
public GoodsOutValidationForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
initialControls();
|
|
|
|
|
initialBackGroundTasks();
|
|
|
|
|
initialTimer();
|
|
|
|
|
isDoublChk.Add("N", "否");
|
|
|
|
|
isDoublChk.Add("Y", "是");
|
|
|
|
|
}
|
|
|
|
|
#region initialControls
|
|
|
|
|
private void initialControls()
|
|
|
|
|
{
|
|
|
|
|
initialComboBoxes();
|
|
|
|
|
// initialPagerControls();
|
|
|
|
|
initialDataGrid();
|
|
|
|
|
initialQueryInput();
|
|
|
|
|
setValidationRule();
|
|
|
|
|
textEditBarcode.GotFocus += new EventHandler(textEditBarcode_GotFocus);
|
|
|
|
|
textEditBarcode.MouseUp += new MouseEventHandler(textEditBarcode_MouseUp);
|
|
|
|
|
txtBoxId.GotFocus += new EventHandler(textBoxId_GotFocus);
|
|
|
|
|
txtBoxId.MouseUp += new MouseEventHandler(textBoxId_MouseUp);
|
|
|
|
|
textEditValidCount.Enabled = false;
|
|
|
|
|
// this.checkEditPass.Enabled = false;
|
|
|
|
|
// layoutControlItem11.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
|
|
combColors.Enabled= checkPermission(WmsConstants.SPECIAL_ALL_CHANGE_DESK_COLOR );
|
|
|
|
|
// layoutControlGroup15.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
|
|
|
|
|
|
|
spinBulkBag.Value = 1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void initialBackGroundTasks()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swAutoOrder.IsOn = WmsConstants.AUTO_PICK_BULK_VALIDATION_ORDER;
|
|
|
|
|
autoOrder = swAutoOrder.IsOn;
|
|
|
|
|
// lgOutReq.UpdateUIDelegate += updateValidationList;
|
|
|
|
|
|
|
|
|
|
if (autoOrder)
|
|
|
|
|
{
|
|
|
|
|
this.getValidationOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
string oldDesk = "";
|
|
|
|
|
private int desk
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (combColors.SelectedIndex == -1)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(null, "请选择控制台");
|
|
|
|
|
|
|
|
|
|
combColors.Focus();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2023-09-04 22:41:19 +08:00
|
|
|
|
// return Convert.ToInt32( ((Node)combColors.SelectedItem).name);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
if (oldDesk != combColors.Text)
|
|
|
|
|
{
|
|
|
|
|
oldDesk = combColors.Text;
|
|
|
|
|
writeConfig("Desk", combColors.Text);
|
|
|
|
|
}
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (string v in enumColors.Values)
|
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
if (v == combColors.Text)
|
|
|
|
|
{
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*private int desk
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (combColors.SelectedIndex == -1)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(null, "请选择控制台");
|
|
|
|
|
|
|
|
|
|
combColors.Focus();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2023-09-04 22:41:19 +08:00
|
|
|
|
return Convert.ToInt32(((Node)combColors.SelectedItem).name);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
private void initialComboBoxes()
|
|
|
|
|
{
|
|
|
|
|
DataTable dtDesk = pickClient.getDeskList((int)enumDeskType.复核);
|
|
|
|
|
|
|
|
|
|
List<string> desks = new List<string>();
|
|
|
|
|
foreach (DataRow dr in dtDesk.Rows)
|
|
|
|
|
{
|
|
|
|
|
desks.Add(dr["deskName"].ToString());
|
|
|
|
|
}
|
|
|
|
|
oldDesk = "-1";
|
|
|
|
|
initialComboBoxs(this.combColors, desks.ToArray());
|
|
|
|
|
oldDesk = System.Configuration.ConfigurationManager.AppSettings["Desk"];
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (string desk in desks)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(oldDesk) && oldDesk == desk)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (combColors.SelectedIndex == i)
|
|
|
|
|
{
|
|
|
|
|
queryOrders();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
combColors.SelectedIndex = i;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDeskStatus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Node[] nds = { };
|
|
|
|
|
|
|
|
|
|
DataTable dt = Park.getDictionary(false);
|
|
|
|
|
if (dt.Rows.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
DataRow[] drs = dt.Select("flag >0");
|
|
|
|
|
foreach (DataRow dr in drs)
|
|
|
|
|
{
|
|
|
|
|
int flag = Convert.ToInt32(dr["flag"].ToString());
|
|
|
|
|
int parentId = Convert.ToInt32(dr["id"].ToString());
|
|
|
|
|
DataRow[] drss = Park.getDictionary(false).Select("parentId =" + parentId);
|
|
|
|
|
switch (flag)
|
|
|
|
|
{
|
|
|
|
|
case 2006:
|
|
|
|
|
initialComboBoxs(this.comValidException, drss,false); //
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/*case 4001:
|
|
|
|
|
initialComboBoxs(this.combColors, drss,false); //复合台
|
|
|
|
|
if (combColors.Properties.Items.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
combColors.SelectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getDeskStatus()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
WmsOutDesk wod = new WmsOutDesk();
|
|
|
|
|
DataTable dtdesk = pickClient.getDeskByColor(desk);
|
|
|
|
|
pickClient.Close();
|
|
|
|
|
if (dtdesk.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
wod = new WmsOutDesk(dtdesk.Rows[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swStatus.IsOn = !wod.available;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch(Exception er)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(er);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void setValidationRule()
|
|
|
|
|
{
|
|
|
|
|
// dxValidationProvider.SetValidationRule(comWarehouse, ValidationRules.notEmptyValidationRule);
|
|
|
|
|
//txtGoodType.Properties.MaxLength = 40;
|
|
|
|
|
//txtGoodDesc.Properties.MaxLength = 250;
|
|
|
|
|
//textEdit1.Properties.MaxLength = txtGoodType.Properties.MaxLength;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initialQueryInput()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void initialBoxColumns(GridView gridView1)
|
|
|
|
|
{
|
|
|
|
|
setupGridView(gridView1, false,false);
|
|
|
|
|
//setupGridView(gridView2, false,false);
|
|
|
|
|
//setupGridView(gridView3, false,false);
|
|
|
|
|
// gridviewGoodsType.PopulateColumns();
|
|
|
|
|
gridView1.Columns.Clear();
|
|
|
|
|
// gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);
|
|
|
|
|
GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" };
|
|
|
|
|
myCol0.Visible = false;
|
|
|
|
|
gridView1.Columns.Add(myCol0);
|
|
|
|
|
GridColumn myCol1 = new GridColumn() { Caption = "颜色", Visible = true, FieldName = "color" };
|
|
|
|
|
GridColumn myCol2 = new GridColumn() { Caption = "箱子编号", Visible = true, FieldName = "boxid" };
|
|
|
|
|
GridColumn myCol3 = new GridColumn() { Caption = "容积", Visible = true, FieldName = "volume" };
|
|
|
|
|
GridColumn myCol4 = new GridColumn() { Caption = "", Visible = true, FieldName = " " };
|
|
|
|
|
|
|
|
|
|
// gridView1.Columns.Add(myCol1);
|
|
|
|
|
|
|
|
|
|
gridView1.Columns.Add(myCol2);
|
|
|
|
|
|
|
|
|
|
gridView1.Columns.Add(myCol3);
|
|
|
|
|
//to show bottom scroll bar
|
|
|
|
|
gridView1.OptionsView.ColumnAutoWidth = true;
|
|
|
|
|
// gridView1.BestFitColumns();
|
|
|
|
|
gridView1.Focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initialGridView2Columns();
|
|
|
|
|
//gridControl2.DataSource = null;
|
|
|
|
|
}
|
|
|
|
|
private void initialDataGridColumns()
|
|
|
|
|
{
|
|
|
|
|
setupGridView(gridView1,false,false);
|
|
|
|
|
//setupGridView(gridView2, false,false);
|
|
|
|
|
//setupGridView(gridView3, false,false);
|
|
|
|
|
// gridviewGoodsType.PopulateColumns();
|
|
|
|
|
gridView1.Columns.Clear();
|
|
|
|
|
// gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);
|
|
|
|
|
GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" };
|
|
|
|
|
myCol0.Visible = false;
|
|
|
|
|
this.gridView1.Columns.Add(myCol0);
|
|
|
|
|
GridColumn myCol1 = new GridColumn() { Caption = "单号", Visible = true, FieldName = WmsOutPickRequest.fields.pickOrderNo.ToString() };
|
|
|
|
|
// GridColumn myCol2 = new GridColumn() { Caption = "类别", Visible = true, FieldName = WmsOutPickRequest.fields.orderTypeName.ToString() };
|
|
|
|
|
GridColumn myCol3 = new GridColumn() { Caption = "状态", Visible = true, FieldName = "orderState" };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol4 = new GridColumn() { Caption = "客户", Visible = true, FieldName = WmsOutPickRequest.fields.customerName. ToString() };
|
|
|
|
|
GridColumn myCol5 = new GridColumn() { Caption = "备注", Visible = true, FieldName = WmsOutPickRequest.fields.description.ToString() };
|
|
|
|
|
//GridColumn myCol6 = new GridColumn() { Caption = "日期", Visible = true, FieldName = WmsOutPickRequest.fields.orderDate.ToString() };
|
|
|
|
|
GridColumn myCol7 = new GridColumn() { Caption = "波次", Visible = true, FieldName = "dpsOrder" };
|
|
|
|
|
GridColumn myCol51 = new GridColumn() { Caption = "序号", Visible = true, FieldName = "xuhao" };
|
|
|
|
|
GridColumn myCol52 = new GridColumn() { Caption = "状态", Visible = true, FieldName = "orderBulkPickstate" ,MinWidth=80};
|
|
|
|
|
GridColumn myCol53 = new GridColumn() { Caption = "分拣单", Visible = true, FieldName = "pickOrderNo", MinWidth = 80 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.gridView1.Columns.Add(myCol51);
|
|
|
|
|
this.gridView1.Columns.Add(myCol52);
|
|
|
|
|
this.gridView1.Columns.Add(myCol4);
|
|
|
|
|
// this.gridView1.Columns.Add(myCol1);
|
|
|
|
|
// this.gridView1.Columns.Add(myCol7);
|
|
|
|
|
|
|
|
|
|
this.gridView1.Columns.Add(myCol5);
|
|
|
|
|
this.gridView1.Columns.Add(myCol53);
|
|
|
|
|
|
|
|
|
|
//to show bottom scroll bar
|
|
|
|
|
gridView1.OptionsView.ColumnAutoWidth = false;
|
|
|
|
|
gridView1.BestFitColumns();
|
|
|
|
|
// gridView1.Focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initialGridView2Columns();
|
|
|
|
|
//gridControl2.DataSource = null;
|
|
|
|
|
}
|
|
|
|
|
private void initialGridView2Columns(GridView gridview)
|
|
|
|
|
{
|
|
|
|
|
setupGridView(gridview, false, false, false);
|
|
|
|
|
gridview.FocusRectStyle = DrawFocusRectStyle.None;
|
|
|
|
|
// gridviewGoodsType.PopulateColumns();
|
|
|
|
|
gridview.Columns.Clear();
|
|
|
|
|
// gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);
|
|
|
|
|
GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" };
|
|
|
|
|
myCol0.Visible = false;
|
|
|
|
|
gridview.Columns.Add(myCol0);
|
|
|
|
|
GridColumn myCol1 = new GridColumn() { Caption = "商品编码", Visible = true, FieldName = WmsGoods.fields.goodsId.ToString() };
|
|
|
|
|
GridColumn myCol2 = new GridColumn() { Caption = "商品名称", Visible = true, FieldName = WmsGoods.exfields.goodsName.ToString() };
|
|
|
|
|
GridColumn myCol3 = new GridColumn() { Caption = "厂家", Visible = true, FieldName = WmsGoods.exfields.manufacturer.ToString() };
|
|
|
|
|
GridColumn myCol4 = new GridColumn() { Caption = "规格", Visible = true, FieldName = WmsGoods.exfields.spec.ToString() };
|
|
|
|
|
GridColumn myCol5 = new GridColumn() { Caption = "单位", Visible = true, FieldName = WmsGoods.exfields.unit.ToString() };
|
|
|
|
|
GridColumn myCol6 = new GridColumn() { Caption = "大包装数量", Visible = true, FieldName = WmsGoods.exfields.bigCount.ToString() };
|
|
|
|
|
GridColumn myCol7 = new GridColumn() { Caption = "剂型", Visible = true, FieldName = WmsGoods.exfields.type.ToString() };
|
|
|
|
|
GridColumn myCol8 = new GridColumn() { Caption = "商品类型", Visible = true, FieldName = WmsGoods.exfields.goodsTypeName.ToString() };
|
|
|
|
|
// GridColumn myCol9 = new GridColumn() { Caption = "大零", Visible = true, FieldName = WmsGoods.fields.bulkMax.ToString() };
|
|
|
|
|
// GridColumn myCol10 = new GridColumn() { Caption = "小整", Visible = true, FieldName = WmsGoods.fields.batchMax1.ToString() };
|
|
|
|
|
// GridColumn myCol11 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsGoods.fields.batchMax2.ToString() };
|
|
|
|
|
GridColumn myCol12 = new GridColumn() { Caption = "国药准字", Visible = true, FieldName = WmsGoods.exfields.regeditCode.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol100 = new GridColumn() { Caption = "数量", Visible = true, FieldName = WmsOutDetail.fields.count.ToString() };
|
|
|
|
|
GridColumn myCol101 = new GridColumn() { Caption = "应拣数量", Visible = true, FieldName = WmsOutDetail.fields.bulkCount.ToString() };
|
|
|
|
|
GridColumn myCol102 = new GridColumn() { Caption = "双人复核", Visible = true, FieldName = "IsDouChk" };
|
|
|
|
|
|
|
|
|
|
// GridColumn myCol102 = new GridColumn() { Caption = "小整", Visible = true, FieldName = WmsOutDetail.fields.batch1Count.ToString() };
|
|
|
|
|
// GridColumn myCol103 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsOutDetail.fields.batch2Count.ToString() };
|
|
|
|
|
// GridColumn myCol104 = new GridColumn() { Caption = "箱", Visible = true, FieldName = WmsOutDetail.fields.boxcnt.ToString() };
|
|
|
|
|
GridColumn myCol14 = new GridColumn() { Caption = "批号", Visible = true, FieldName = WmsOutDetail.fields.batch.ToString() };
|
|
|
|
|
GridColumn myCol15 = new GridColumn() { Caption = "生产日期", Visible = true, FieldName = WmsOutDetail.fields.productDate.ToString() };
|
|
|
|
|
GridColumn myCol16 = new GridColumn() { Caption = "有效期", Visible = true, FieldName = WmsOutDetail.fields.validDate.ToString() };
|
|
|
|
|
GridColumn myCol161 = new GridColumn() { Caption = "复核状态", Visible = true, FieldName = WmsOutPickDetail.fields.bulkPickState.ToString() };
|
|
|
|
|
GridColumn myCol17 = new GridColumn() { Caption = "状态", Visible = true, FieldName = WmsOutDetail.fields.state.ToString() };
|
|
|
|
|
// GridColumn myCol18 = new GridColumn() { Caption = "说明", Visible = true, FieldName = WmsOutDetail.fields.description.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol25 = new GridColumn() { Caption = "订单", Visible = true, FieldName = WmsOutRequest.fields.orderNo.ToString() };
|
|
|
|
|
// GridColumn myCol26 = new GridColumn() { Caption = "条码", Visible = true, FieldName = "BarCode" };
|
|
|
|
|
|
|
|
|
|
// GridColumn myCol29 = new GridColumn() { Caption = "复核结果", Visible = true, FieldName = "validResult" };
|
|
|
|
|
// GridColumn myCol27 = new GridColumn() { Caption = "异常回馈", Visible = true, FieldName = "solution" };
|
|
|
|
|
// GridColumn myCol28 = new GridColumn() { Caption = "回馈说明", Visible = true, FieldName = WmsOutPickDetail.fields.solutionRemark.ToString() };
|
|
|
|
|
GridColumn myCol30 = new GridColumn() { Caption = "复核数量", Visible = true, FieldName = WmsOutPickDetail.fields.confirmedCount.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol130 = new GridColumn() { Caption = "skuId", Visible = true, FieldName = "skuId" };
|
|
|
|
|
// GridColumn myCol131 = new GridColumn() { Caption = "sku", Visible = true, FieldName = "skuCode" };
|
|
|
|
|
// GridColumn myCol132 = new GridColumn() { Caption = "货主", Visible = true, FieldName = "ownerName" };
|
|
|
|
|
GridColumn myCol133 = new GridColumn() { Caption = "条码", Visible = true, FieldName = "barcode" };
|
|
|
|
|
|
|
|
|
|
if (gridview == gridViewSaleOrders)
|
|
|
|
|
{
|
|
|
|
|
gridview.Columns.Add(myCol25);
|
|
|
|
|
}
|
|
|
|
|
gridview.Columns.Add(myCol2);
|
|
|
|
|
gridview.Columns.Add(myCol4);
|
|
|
|
|
gridview.Columns.Add(myCol5);
|
|
|
|
|
gridview.Columns.Add(myCol7);
|
|
|
|
|
gridview.Columns.Add(myCol101);
|
|
|
|
|
// gridview.Columns.Add(myCol130);
|
|
|
|
|
gridview.Columns.Add(myCol14);
|
|
|
|
|
gridview.Columns.Add(myCol1);
|
|
|
|
|
gridview.Columns.Add(myCol100);
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol6);
|
|
|
|
|
|
|
|
|
|
// gridview.Columns.Add(myCol131);
|
|
|
|
|
gridview.Columns.Add(myCol15);
|
|
|
|
|
gridview.Columns.Add(myCol16);
|
|
|
|
|
gridview.Columns.Add(myCol3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol3);
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol8);
|
|
|
|
|
//gridview.Columns.Add(myCol9);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// gridview.Columns.Add(myCol6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol12);
|
|
|
|
|
gridview.Columns.Add(myCol133);
|
|
|
|
|
// gridview.Columns.Add(myCol17);
|
|
|
|
|
// gridview.Columns.Add(myCol18);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//to show bottom scroll bar
|
|
|
|
|
gridview.OptionsView.ColumnAutoWidth = false;
|
|
|
|
|
gridview.BestFitColumns();
|
|
|
|
|
// gridView2.Focus();
|
|
|
|
|
if (dtPickOrders4Validation.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
switchGridViewRowSelection(gridView4Valid, true);
|
|
|
|
|
switchGridViewRowSelection(gridViewValidated, false);
|
|
|
|
|
|
|
|
|
|
if (gridView4Valid.IsFocusedView)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
gridView4Valid.Focus();
|
|
|
|
|
}
|
|
|
|
|
else if (dtPickOrdersValidated!=null && dtPickOrdersValidated.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
if (gridViewValidated.IsFocusedView)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.gridViewValidated.Focus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initialGridView3Columns(GridView gridview)
|
|
|
|
|
{
|
|
|
|
|
setupGridView(gridview, false, true, false);
|
|
|
|
|
gridview.FocusRectStyle = DrawFocusRectStyle.None;
|
|
|
|
|
// gridviewGoodsType.PopulateColumns();
|
|
|
|
|
gridview.Columns.Clear();
|
|
|
|
|
// gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);
|
|
|
|
|
GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" };
|
|
|
|
|
myCol0.Visible = false;
|
|
|
|
|
gridview.Columns.Add(myCol0);
|
|
|
|
|
GridColumn myCol1 = new GridColumn() { Caption = "商品编码", Visible = true, FieldName = WmsGoods.fields.goodsId.ToString() };
|
|
|
|
|
GridColumn myCol2 = new GridColumn() { Caption = "商品名称", Visible = true, FieldName = WmsGoods.exfields.goodsName.ToString() };
|
|
|
|
|
GridColumn myCol3 = new GridColumn() { Caption = "厂家", Visible = true, FieldName = WmsGoods.exfields.manufacturer.ToString() };
|
|
|
|
|
GridColumn myCol4 = new GridColumn() { Caption = "规格", Visible = true, FieldName = WmsGoods.exfields.spec.ToString() };
|
|
|
|
|
GridColumn myCol5 = new GridColumn() { Caption = "单位", Visible = true, FieldName = WmsGoods.exfields.unit.ToString() };
|
|
|
|
|
// GridColumn myCol6 = new GridColumn() { Caption = "大包装数量", Visible = true, FieldName = WmsGoods.exfields.bigCount.ToString() };
|
|
|
|
|
GridColumn myCol7 = new GridColumn() { Caption = "剂型", Visible = true, FieldName = WmsGoods.exfields.type.ToString() };
|
|
|
|
|
GridColumn myCol8 = new GridColumn() { Caption = "商品类型", Visible = true, FieldName = WmsGoods.exfields.goodsTypeName.ToString() };
|
|
|
|
|
// GridColumn myCol9 = new GridColumn() { Caption = "大零", Visible = true, FieldName = WmsGoods.fields.bulkMax.ToString() };
|
|
|
|
|
// GridColumn myCol10 = new GridColumn() { Caption = "小整", Visible = true, FieldName = WmsGoods.fields.batchMax1.ToString() };
|
|
|
|
|
// GridColumn myCol11 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsGoods.fields.batchMax2.ToString() };
|
|
|
|
|
GridColumn myCol12 = new GridColumn() { Caption = "国药准字", Visible = true, FieldName = WmsGoods.exfields.regeditCode.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol100 = new GridColumn() { Caption = "数量", Visible = true, FieldName ="pdaOuting"};// WmsOutDetail.fields.count.ToString() };
|
|
|
|
|
// GridColumn myCol101 = new GridColumn() { Caption = "零货", Visible = true, FieldName = WmsOutDetail.fields.count.ToString() };
|
|
|
|
|
// GridColumn myCol102 = new GridColumn() { Caption = "整货", Visible = true, FieldName = WmsOutDetail.fields.batch1Count.ToString() };
|
|
|
|
|
// GridColumn myCol103 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsOutDetail.fields.batch2Count.ToString() };
|
|
|
|
|
// GridColumn myCol104 = new GridColumn() { Caption = "箱", Visible = true, FieldName = WmsOutDetail.fields.boxcnt.ToString() };
|
|
|
|
|
GridColumn myCol14 = new GridColumn() { Caption = "批号", Visible = true, FieldName = WmsOutDetail.fields.batch.ToString() };
|
|
|
|
|
GridColumn myCol15 = new GridColumn() { Caption = "生产日期", Visible = true, FieldName = WmsOutDetail.fields.productDate.ToString() };
|
|
|
|
|
GridColumn myCol16 = new GridColumn() { Caption = "有效期", Visible = true, FieldName = WmsOutDetail.fields.validDate.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol17 = new GridColumn() { Caption = "状态", Visible = true, FieldName = WmsOutDetail.fields.state.ToString() };
|
|
|
|
|
GridColumn myCol18 = new GridColumn() { Caption = "说明", Visible = true, FieldName = WmsOutDetail.fields.description.ToString() };
|
|
|
|
|
GridColumn myCol19 = new GridColumn() { Caption = "分拣状态", Visible = true, FieldName = "pickState" };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol20 = new GridColumn() { Caption = "波次", Visible = true, FieldName = WmsOutPickLable.fields.dpsOrder.ToString() };
|
|
|
|
|
GridColumn myCol21 = new GridColumn() { Caption = "颜色", Visible = true, FieldName = WmsOutPickLable.fields.color.ToString() };
|
|
|
|
|
GridColumn myCol22 = new GridColumn() { Caption = "货位", Visible = true, FieldName = WmsOutPickLable.fields.locationId.ToString() };
|
|
|
|
|
GridColumn myCol23 = new GridColumn() { Caption = "标签", Visible = true, FieldName = WmsOutPickLable.fields.elabId.ToString() };
|
|
|
|
|
GridColumn myCol24 = new GridColumn() { Caption = "客户", Visible = true, FieldName = WmsOutPickRequest.fields.customerName.ToString() };
|
|
|
|
|
GridColumn myCol25 = new GridColumn() { Caption = "订单", Visible = true, FieldName = WmsOutPickDetail.fields.pickOrderNo.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol26 = new GridColumn() { Caption = "异常回馈", Visible = true, FieldName = "solution" };
|
|
|
|
|
GridColumn myCol27 = new GridColumn() { Caption = "回馈说明", Visible = true, FieldName = WmsOutPickDetail.fields.solutionRemark.ToString() };
|
|
|
|
|
|
|
|
|
|
GridColumn myCol130 = new GridColumn() { Caption = "skuId", Visible = true, FieldName = "skuId" };
|
|
|
|
|
GridColumn myCol131 = new GridColumn() { Caption = "sku", Visible = true, FieldName = "skuCode" };
|
|
|
|
|
GridColumn myCol132 = new GridColumn() { Caption = "货主", Visible = true, FieldName = "ownerName" };
|
|
|
|
|
// GridColumn myCol133 = new GridColumn() { Caption = "条码", Visible = true, FieldName = "barcode" };
|
|
|
|
|
|
|
|
|
|
if (gridview == gridViewException)
|
|
|
|
|
{
|
|
|
|
|
gridview.Columns.Add(myCol25);
|
|
|
|
|
gridview.Columns.Add(myCol26);
|
|
|
|
|
gridview.Columns.Add(myCol27);
|
|
|
|
|
gridViewException.OptionsSelection.EnableAppearanceFocusedRow = true;
|
|
|
|
|
gridViewException.FocusRectStyle = DrawFocusRectStyle.RowFocus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// gridview.Columns.Add(myCol25);
|
|
|
|
|
gridview.Columns.Add(myCol2);
|
|
|
|
|
gridview.Columns.Add(myCol1);
|
|
|
|
|
gridview.Columns.Add(myCol19);
|
|
|
|
|
// gridview.Columns.Add(myCol130);
|
|
|
|
|
gridview.Columns.Add(myCol14);
|
|
|
|
|
|
|
|
|
|
// gridview.Columns.Add(myCol21);
|
|
|
|
|
gridview.Columns.Add(myCol100);
|
|
|
|
|
gridview.Columns.Add(myCol22);
|
|
|
|
|
// gridview.Columns.Add(myCol131);
|
|
|
|
|
// gridview.Columns.Add(myCol132);
|
|
|
|
|
gridview.Columns.Add(myCol23);
|
|
|
|
|
// gridview.Columns.Add(myCol133);
|
|
|
|
|
/*
|
|
|
|
|
gridview.Columns.Add(myCol5);
|
|
|
|
|
gridview.Columns.Add(myCol17);
|
|
|
|
|
gridview.Columns.Add(myCol24);
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol7);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol3);
|
|
|
|
|
|
|
|
|
|
gridview.Columns.Add(myCol15);
|
|
|
|
|
gridview.Columns.Add(myCol16);
|
|
|
|
|
gridview.Columns.Add(myCol3);
|
|
|
|
|
gridview.Columns.Add(myCol8);
|
|
|
|
|
//gridview.Columns.Add(myCol9);
|
|
|
|
|
gridview.Columns.Add(myCol2);
|
|
|
|
|
// gridview.Columns.Add(myCol6);
|
|
|
|
|
gridview.Columns.Add(myCol4);
|
|
|
|
|
gridview.Columns.Add(myCol12);
|
|
|
|
|
gridview.Columns.Add(myCol1);
|
|
|
|
|
gridview.Columns.Add(myCol18);
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//to show bottom scroll bar
|
|
|
|
|
gridview.OptionsView.ColumnAutoWidth = false;
|
|
|
|
|
gridview.BestFitColumns();
|
|
|
|
|
// gridView2.Focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 预处理,按客户分拆订单,生成分拣单,并出库
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void getValidationOrders()
|
|
|
|
|
{
|
|
|
|
|
this.getPickOrders4Validation();
|
|
|
|
|
//threadPreProcess = new Thread(this.getPickOrders4Validation);
|
|
|
|
|
//threadPreProcess.IsBackground = true;
|
|
|
|
|
//threadPreProcess.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void getPickOrders4Validation()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
clearDetails();
|
|
|
|
|
setOrderFilter();
|
|
|
|
|
showWaitForm();
|
|
|
|
|
dsPickOrders = pickClient.getPickRequest4BulkValidate(desk);
|
|
|
|
|
// dtExceptionSolutions = pickClient.getBulkValidationExceptionSolutions(desk);
|
|
|
|
|
// closeClient();
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
|
|
|
|
|
dtPickOrders = dsPickOrders.Tables[2];
|
|
|
|
|
dtPickOrdersDetail = dsPickOrders.Tables[0];
|
|
|
|
|
dtPickOrders.PrimaryKey = new DataColumn[] { dtPickOrders.Columns["pickOrderNo"] };
|
|
|
|
|
// dtPickOrders.PrimaryKey = new DataColumn[] { dtPickOrders.Columns["dpsOrder"] };
|
|
|
|
|
dtPickOrdersDetail.PrimaryKey = new DataColumn[] { dtPickOrdersDetail.Columns["id"] };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e,e.Message);
|
|
|
|
|
LogHelper.WriteLog(this.GetType(), e);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// updateValidationList(null,null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (InvokeRequired)
|
|
|
|
|
{
|
|
|
|
|
this.Invoke(new loadNewPickOrders(delegate()
|
|
|
|
|
{
|
|
|
|
|
swAutoOrder.Enabled = true;
|
|
|
|
|
btnPickOrders.Enabled = !autoOrder;
|
|
|
|
|
this.loadPickOrders();
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
swAutoOrder.Enabled = true;
|
|
|
|
|
btnPickOrders.Enabled = !autoOrder;
|
|
|
|
|
this.loadPickOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getValidationOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime lastRefreshTime;
|
|
|
|
|
int refreshInterval = 5;
|
|
|
|
|
//完成任务时需要调用
|
|
|
|
|
delegate void loadNewPickOrders();
|
|
|
|
|
private void updateValidationList(object source, System.Timers.ElapsedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//还可以进行其他的一些完任务完成之后的逻辑处理
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (autoOrder)
|
|
|
|
|
{
|
|
|
|
|
TimeSpan ts = DateTime.Now - lastRefreshTime;
|
|
|
|
|
|
|
|
|
|
if ( ts.TotalSeconds < refreshInterval)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
lastRefreshTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
refreshInterval = Convert.ToInt32( spinOrder.Value * 60);
|
|
|
|
|
|
|
|
|
|
getValidationOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Thread.CurrentThread.Join(refreshInterval);
|
|
|
|
|
//继续后台处理
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.Timers.Timer timer = new System.Timers.Timer();//实例化Timer类
|
|
|
|
|
|
|
|
|
|
private void timeCnt()
|
|
|
|
|
{
|
|
|
|
|
timer.Start(); ;
|
|
|
|
|
}
|
|
|
|
|
private void initialTimer()
|
|
|
|
|
{
|
|
|
|
|
int intTime = 10000;
|
|
|
|
|
timer.Interval = intTime;//设置间隔时间,为毫秒;
|
|
|
|
|
timer.Elapsed += new System.Timers.ElapsedEventHandler(updateValidationList);//到达时间的时候执行事件;
|
|
|
|
|
timer.AutoReset = true;//设置是执行一次(false)还是一直执行(true);
|
|
|
|
|
timer.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件;
|
|
|
|
|
timer.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新拣选明细
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void updatePickDetails() {
|
|
|
|
|
gridPickDetails.DataSource = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Thread threadPickdetail = new Thread(this.getPickOrdersPickDetail);
|
|
|
|
|
threadPickdetail.IsBackground = true;
|
|
|
|
|
threadPickdetail.Start();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLog(this.GetType(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void getPickOrdersPickDetail()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
dtPickDetails = pickClient.getPickDetailByPickOrderNo(this.currentPickOrder);
|
|
|
|
|
// closeClient();
|
|
|
|
|
}
|
|
|
|
|
catch(Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e,e.Message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (InvokeRequired)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
this.Invoke(new loadNewPickOrders(delegate()
|
|
|
|
|
{
|
|
|
|
|
bindPickDetails();
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception er)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLog(this.GetType(), er);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bindPickDetails();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bindPickDetails()
|
|
|
|
|
{
|
|
|
|
|
gridPickDetails.DataSource = dtPickDetails;
|
|
|
|
|
initialGridView3Columns(gridViewPickDetails);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// loading waiting pick orders
|
|
|
|
|
/// </summary>
|
|
|
|
|
private int pagerQuery()
|
|
|
|
|
{
|
|
|
|
|
// initialRequestOrders();
|
|
|
|
|
//this.gridviewGoodsType.DataSource = lgt.GetAllActiveData().Tables[0].DefaultView;
|
|
|
|
|
showWaitForm();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// this.splashScreenManager1.ShowWaitForm();
|
|
|
|
|
string query = string.Format("{0} =#'{1}';", WmsOutRequest.fields.orderType.ToString(), (int)enumOutOrderType.pickOrder);
|
|
|
|
|
query += string.Format("{0} =#'{1}';", WmsOutRequest.fields.state.ToString(), (int) enumOutStockRequestStatus.prePicking );
|
|
|
|
|
bool isQueryNotChanged = lastQuery.Equals(query);
|
|
|
|
|
this.pager1.PageCurrent = isQueryNotChanged ? this.pager1.PageCurrent : 1; //根据查询条件的变化给pager赋值
|
|
|
|
|
int start = (pager1.PageSize * (pager1.PageCurrent - 1) + 1);
|
|
|
|
|
int end = (pager1.PageSize * pager1.PageCurrent);
|
|
|
|
|
lastQuery = query;
|
|
|
|
|
DataSet ds = lgt.Query(query, start, end);
|
|
|
|
|
dtPickOrders = ds.Tables[0];
|
|
|
|
|
int cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString());
|
|
|
|
|
//dt = lgt.Query(query, start, end); //string.IsNullOrEmpty(query) ? lgt.GetGoodType.getAllData(start, end) : lgt.g;
|
|
|
|
|
|
|
|
|
|
dtPickOrders.PrimaryKey = new DataColumn[] { dtPickOrders.Columns["pickOrderNo"] };
|
|
|
|
|
bool firstLoad = !isQueryNotChanged || this.gridControl1.DataSource == null;
|
|
|
|
|
this.gridControl1.DataSource = dtPickOrders.DefaultView;
|
|
|
|
|
initialDataGridColumns();
|
|
|
|
|
//update selected row index to the last updated one.
|
|
|
|
|
|
|
|
|
|
if (false && !string.IsNullOrEmpty( currentPickOrder))
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex = -1;
|
|
|
|
|
DataRow dr = dtPickOrders.Rows.Find(currentPickOrder);
|
|
|
|
|
if (dr != null)
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex = dtPickOrders.Rows.IndexOf(dr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectedRowIndex >= 0 && dtPickOrders.Rows.Count > selectedRowIndex)
|
|
|
|
|
{
|
|
|
|
|
// gridView1.SelectRow(selectedRowIndex);
|
|
|
|
|
gridView1.FocusedRowHandle = selectedRowIndex;
|
|
|
|
|
// gridView1.MakeRowVisible(selectedRowIndex);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//gridView1.FocusedRowHandle = selectedRowIndex;
|
|
|
|
|
}else
|
|
|
|
|
// if (firstLoad)
|
|
|
|
|
{
|
|
|
|
|
gridView1.FocusedRowHandle = 0;
|
|
|
|
|
gridView1.SelectRow(0);
|
|
|
|
|
setCurrentRequestDetail();
|
|
|
|
|
}
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
return cnt;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e.Message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
return 0;// lgt.getRowCount(query);
|
|
|
|
|
// return lgt.GetGoodType.QueryCount();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void bindDetail()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void setDataBack()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private bool validData()
|
|
|
|
|
{
|
|
|
|
|
bool isvalid = dxValidationProvider1.Validate();
|
|
|
|
|
|
|
|
|
|
// MessageBox.Show("goodtype is " + txtGoodType.Text +", is valid ? " + isvalid);
|
|
|
|
|
|
|
|
|
|
return isvalid;
|
|
|
|
|
//String gdtype = txtGoodType.Text.Trim();
|
|
|
|
|
//if (gdtype.Length == 0)
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
// dxValidationProvider.Validate();
|
|
|
|
|
// return false;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页控件产生的事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
private int pager_EventPaging(DeiNiu.Controls.pager.EventPagingArg e)
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex = 0; //reset currentRowIndex
|
|
|
|
|
return pagerQuery();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initialPagerControls()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
pager1.MaximumSize = new Size(0, 20);
|
|
|
|
|
pager1.EventPaging += new DeiNiu.Controls.pager.EventPagingHandler(pager_EventPaging);
|
|
|
|
|
#region DataGridView与Pager控件绑定
|
|
|
|
|
this.pager1.PageCurrent = 1;//当前页为第一页
|
|
|
|
|
pager1.PageSize = 200;//每页行数
|
|
|
|
|
this.pager1.Bind();//绑定
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
private void gridView1_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (gridView1.FocusedRowHandle < 0 || gridView1.FocusedRowHandle == selectedRowIndex || isDataSourceChanged && selectedRowIndex >0)
|
|
|
|
|
{
|
|
|
|
|
if (gridView1.IsGroupRow(e.RowHandle)) //set first row of group selected
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex = gridView1.GetChildRowHandle(e.RowHandle, 0);
|
|
|
|
|
setCurrentRequestDetail();
|
|
|
|
|
}
|
|
|
|
|
isDataSourceChanged = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
isDataSourceChanged = false;
|
|
|
|
|
selectedRowIndex = gridView1.FocusedRowHandle ;
|
|
|
|
|
// showErrorMsg("selection:"+ selectedRowIndex);
|
|
|
|
|
setCurrentRequestDetail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isDataSourceChanged = false;
|
|
|
|
|
private void gridView1_DataSourceChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
isDataSourceChanged = true;
|
|
|
|
|
if (selectedRowIndex >= 0 && dtPickOrders.Rows.Count > selectedRowIndex)
|
|
|
|
|
{
|
|
|
|
|
gridView1.FocusedRowHandle = selectedRowIndex;
|
|
|
|
|
gridView1.MakeRowVisible(selectedRowIndex);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnDelete_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void query()
|
|
|
|
|
{
|
|
|
|
|
// pager1.Bind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void loadPickOrders()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// showWaitForm();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
lbCustmer.Text = "";
|
|
|
|
|
bool firstLoad = this.gridControl1.DataSource == null;
|
|
|
|
|
// gridControl1.DataSource = dtPickOrders;
|
|
|
|
|
|
|
|
|
|
//dt = lgt.Query(query, start, end); //string.IsNullOrEmpty(query) ? lgt.GetGoodType.getAllData(start, end) : lgt.g;
|
|
|
|
|
|
|
|
|
|
//dtPickOrders.PrimaryKey = new DataColumn[] { dtPickOrders.Columns["pickOrderNo"] };
|
|
|
|
|
// DataRow drx = dtPickOrders.Rows.Find(currentPickOrder);
|
|
|
|
|
|
|
|
|
|
string boxId = txtBoxId.Text.Trim();
|
|
|
|
|
DataView dvp = dtPickOrders.DefaultView;
|
|
|
|
|
dvp.RowFilter =filter;
|
|
|
|
|
if (!string.IsNullOrEmpty(boxId) && !string.IsNullOrEmpty(boxWave) && desk == boxDesk)
|
|
|
|
|
{
|
|
|
|
|
dvp.RowFilter = string.Format(" and dpsOrder='{0}' and desk={1}", boxWave,boxDesk);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.gridControl1.DataSource = dvp;
|
|
|
|
|
|
|
|
|
|
//update selected row index to the last updated one.
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(currentPickOrder) )
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex = -1;
|
|
|
|
|
DataRow dr = dtPickOrders.Rows.Find(currentPickOrder);
|
|
|
|
|
if (dr != null)
|
|
|
|
|
{
|
|
|
|
|
// selectedRowIndex = dtPickOrders.Rows.IndexOf(dr);
|
|
|
|
|
selectedRowIndex = 0;
|
|
|
|
|
foreach (DataRowView drv in GetGridViewFilteredAndSortedData(gridView1))
|
|
|
|
|
{
|
|
|
|
|
if (drv["pickOrderNo"].ToString().Equals(currentPickOrder))
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
selectedRowIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
selectedRowIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectedRowIndex >= 0 && dtPickOrders.Rows.Count > selectedRowIndex)
|
|
|
|
|
{
|
|
|
|
|
// gridView1.SelectRow(selectedRowIndex);
|
|
|
|
|
gridView1.FocusedRowHandle = selectedRowIndex;
|
|
|
|
|
// gridView1.MakeRowVisible(selectedRowIndex);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//gridView1.FocusedRowHandle = selectedRowIndex;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
// if (firstLoad)
|
|
|
|
|
{
|
|
|
|
|
gridView1.FocusedRowHandle = 0;
|
|
|
|
|
|
|
|
|
|
gridView1.SelectRow(0);
|
|
|
|
|
// setCurrentRequestDetail();
|
|
|
|
|
}
|
|
|
|
|
if (firstLoad && dvp.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
selectedRowIndex =0;
|
|
|
|
|
selectedValidatedItem =0;
|
|
|
|
|
selectedValidationItem = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setCurrentRequestDetail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//to load exception solutions
|
|
|
|
|
|
|
|
|
|
// DataView dv = dtExceptionSolutions.DefaultView;
|
|
|
|
|
#if DEBUG
|
|
|
|
|
#else
|
|
|
|
|
// dv.RowFilter = "desk =" + desk;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// gridControlException.DataSource = dv;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// initialGridView3Columns(gridViewException);
|
|
|
|
|
initialDataGridColumns();
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
if (firstLoad)
|
|
|
|
|
{
|
|
|
|
|
setCurrentValidatedDetail();
|
|
|
|
|
setCurrentValidationDetail();
|
|
|
|
|
textEditBarcode.Focus();
|
|
|
|
|
textEditBarcode.SelectAll();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e.Message);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
// WaitFormService.Close();
|
|
|
|
|
// closeWaitForm();
|
|
|
|
|
bbQuery.Enabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bbQuery_ItemClick_1(object sender, ItemClickEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.bbQuery.Enabled = false;
|
|
|
|
|
loadPickOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateObjects(List<WmsGoods> goods)
|
|
|
|
|
{
|
|
|
|
|
showWaitForm();
|
|
|
|
|
//WaitFormService.Show(this);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// lgt.update(goods);
|
|
|
|
|
|
|
|
|
|
//get updated data
|
|
|
|
|
query();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e.Message);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
// WaitFormService.Close();
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool getCurrentObject()
|
|
|
|
|
{
|
|
|
|
|
if (selectedRowIndex <0 || selectedRowIndex >= dtPickOrders.Rows.Count)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//clearDetails();
|
|
|
|
|
int cnt = GetGridViewFilteredAndSortedData(gridView1).Count;
|
|
|
|
|
if (selectedRowIndex + 1 > cnt)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// DataRow currentRow = dtPickOrders.Rows[selectedRowIndex];
|
|
|
|
|
DataRowView currentRow = (DataRowView)(GetGridViewFilteredAndSortedData(gridView1)[selectedRowIndex]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// selectedRequest = new WmsOutPickRequest(currentRow);
|
|
|
|
|
currentPickOrder = currentRow["pickOrderNo"].ToString();
|
|
|
|
|
lbCustmer.Text = currentPickOrder;
|
|
|
|
|
lbCustmer.Text = currentRow["customerName"].ToString();
|
|
|
|
|
currentWave = currentRow["dpsOrder"].ToString();
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnQuery_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
clearDetails();
|
|
|
|
|
loadPickOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void gridView1_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (gridView1.FocusedRowHandle <0 || gridView1.FocusedRowHandle == selectedRowIndex)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
selectedRowIndex = gridView1.FocusedRowHandle;
|
|
|
|
|
// showErrorMsg("selection:"+ selectedRowIndex);
|
|
|
|
|
setCurrentRequestDetail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initialDataGrid()
|
|
|
|
|
{
|
|
|
|
|
gridView1.OptionsSelection.MultiSelect = false;//按shift / control 多选
|
|
|
|
|
this.gridView1.OptionsBehavior.AutoPopulateColumns = false;
|
|
|
|
|
this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
|
|
|
|
this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.CellFocus;
|
|
|
|
|
this.gridView1.OptionsBehavior.Editable = false;
|
|
|
|
|
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
|
|
|
|
|
this.gridView1.FocusedRowObjectChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventHandler(this.gridView1_FocusedRowObjectChanged);
|
|
|
|
|
this.gridView1.DataSourceChanged += new System.EventHandler(this.gridView1_DataSourceChanged);
|
|
|
|
|
|
|
|
|
|
gridView1.CustomColumnDisplayText += gridView2_CustomColumnDisplayText;
|
|
|
|
|
//show line number
|
|
|
|
|
// this.gridView1.IndicatorWidth = 40;
|
|
|
|
|
// this.gridView1.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
|
|
|
|
|
this.gridViewValidated.IndicatorWidth = 40;
|
|
|
|
|
this.gridViewValidated.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
|
|
|
|
|
this.gridViewSaleOrders .IndicatorWidth = 40;
|
|
|
|
|
this.gridViewSaleOrders.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
gridViewSaleOrders.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.gridViewPickDetails.IndicatorWidth = 40;
|
|
|
|
|
this.gridViewPickDetails.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
|
|
|
|
|
gridViewPickDetails.OptionsSelection.MultiSelect = false;
|
|
|
|
|
gridViewPickDetails.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.gridView4Valid.IndicatorWidth = 40;
|
|
|
|
|
this.gridView4Valid.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
this.gridView4Valid.FocusedRowObjectChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventHandler(this.gridView4Validation_FocusedRowObjectChanged);
|
|
|
|
|
gridView4Valid.OptionsSelection.MultiSelect = false;
|
|
|
|
|
gridView4Valid.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
|
|
|
|
gridView4Valid.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
gridView4Valid.CustomColumnDisplayText += gridView2_CustomColumnDisplayText;
|
|
|
|
|
gridView4Valid.CustomDrawCell += gridView_CustomDrawCell;
|
|
|
|
|
|
|
|
|
|
this.gridView4Valid.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
this.gridViewValidated.FocusedRowObjectChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventHandler(this.gridViewValidated_FocusedRowObjectChanged);
|
|
|
|
|
|
|
|
|
|
this.gridViewValidated.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
|
|
|
|
gridViewValidated.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
gridViewValidated.OptionsSelection.MultiSelect = false;
|
|
|
|
|
|
|
|
|
|
this.gridViewException.IndicatorWidth = 40;
|
|
|
|
|
this.gridViewException.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
this.gridViewException.FocusedRowObjectChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventHandler(this.gridViewException_FocusedRowObjectChanged);
|
|
|
|
|
gridViewException.OptionsSelection.MultiSelect = false;
|
|
|
|
|
gridViewException.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
|
|
|
|
gridViewException.OptionsSelection.EnableAppearanceFocusedCell = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridView4Valid.GotFocus += new EventHandler(gridview_GotFocus);
|
|
|
|
|
gridViewValidated.GotFocus += new EventHandler(gridview_GotFocus);
|
|
|
|
|
|
|
|
|
|
switchGridViewRowSelection(gridViewException,false);
|
|
|
|
|
switchGridViewRowSelection(gridViewPickDetails, false);
|
|
|
|
|
switchGridViewRowSelection(gridViewSaleOrders, false);
|
|
|
|
|
|
|
|
|
|
gridViewException.LostFocus += new EventHandler(gridview_LostFocus);
|
|
|
|
|
gridViewSaleOrders.LostFocus += new EventHandler(gridview_LostFocus);
|
|
|
|
|
gridViewPickDetails.LostFocus += new EventHandler(gridview_LostFocus);
|
|
|
|
|
|
|
|
|
|
gridViewException.GotFocus += new EventHandler(gridview_GotFocus);
|
|
|
|
|
gridViewSaleOrders.GotFocus += new EventHandler(gridview_GotFocus);
|
|
|
|
|
gridViewPickDetails.GotFocus += new EventHandler(gridview_GotFocus);
|
|
|
|
|
|
|
|
|
|
gridViewValidated.RowCellStyle += gridView_RowCellStyle;
|
|
|
|
|
//gridView1.RowCellStyle += gridView_RowCellStyle;
|
|
|
|
|
gridViewValidated.CustomColumnDisplayText += gridView2_CustomColumnDisplayText;
|
|
|
|
|
gridViewPickDetails.CustomColumnDisplayText += gridView2_CustomColumnDisplayText;
|
|
|
|
|
this.gridViewException.CustomColumnDisplayText += gridView2_CustomColumnDisplayText;
|
|
|
|
|
|
|
|
|
|
this.gvBox.IndicatorWidth = 40;
|
|
|
|
|
this.gvBox.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void gridView2_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//if (sender == gridViewValidated)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e.Column.FieldName == "state")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!pickDetailStatus.ContainsValue(e.DisplayText))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int display = -100;
|
|
|
|
|
string disTxt = e.DisplayText;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-04 22:41:19 +08:00
|
|
|
|
display = Convert.ToInt32(e.DisplayText);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
e.DisplayText = pickDetailStatus[display];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (e.Column.FieldName == "pickState")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!pickStatus.ContainsValue(e.DisplayText))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int display = -100;
|
|
|
|
|
string disTxt = e.DisplayText;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-04 22:41:19 +08:00
|
|
|
|
display = Convert.ToInt32(e.DisplayText);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
e.DisplayText = pickStatus[display];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (e.Column.FieldName == "IsDouChk")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!isDoublChk.ContainsValue(e.DisplayText))
|
|
|
|
|
{
|
|
|
|
|
string disTxt = e.DisplayText;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
e.DisplayText = isDoublChk[disTxt];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (e.Column.FieldName == "orderBulkPickstate")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!pickStatus.ContainsValue(e.DisplayText))
|
|
|
|
|
{
|
|
|
|
|
string disTxt = e.DisplayText;
|
|
|
|
|
|
|
|
|
|
int display = -100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-04 22:41:19 +08:00
|
|
|
|
display = Convert.ToInt32(e.DisplayText);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
e.DisplayText = this.pickStatus[display];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void gridView_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//var currentView = sender as GridView;
|
|
|
|
|
//if (currentView != null && e.RowHandle == currentView.FocusedRowHandle) return;
|
|
|
|
|
Rectangle r = e.Bounds;
|
|
|
|
|
if (e.Column.FieldName == "IsDouChk" && e.CellValue != null)
|
|
|
|
|
{
|
|
|
|
|
string a = e.CellValue.ToString();
|
|
|
|
|
string b = e.DisplayText;
|
|
|
|
|
if (b.Equals("是"))
|
|
|
|
|
{
|
|
|
|
|
e.Appearance.ForeColor = Color.Red;
|
|
|
|
|
e.Appearance.DrawString(e.Cache, e.DisplayText, r);
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gridView_RowCellStyle(object sender,DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var currentView = sender as GridView;
|
|
|
|
|
// if( currentView != null){return;}
|
|
|
|
|
string state = currentView.GetDataRow(e.RowHandle)["bulkPickState"].ToString().Trim();
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(state))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 22:41:19 +08:00
|
|
|
|
enumOutStockPickStatus status = (enumOutStockPickStatus)Convert.ToInt32(state);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isFocused = e.RowHandle == currentView.FocusedRowHandle;
|
|
|
|
|
DevExpress.Utils.AppearanceDefault rowStyle = null;
|
|
|
|
|
DevExpress.Utils.AppearanceDefault appBlueRed =
|
|
|
|
|
new DevExpress.Utils.AppearanceDefault (Color.White, Color.Red, Color.Empty, Color.Blue, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
|
|
|
|
|
DevExpress.Utils.AppearanceDefault appYB =
|
|
|
|
|
new DevExpress.Utils.AppearanceDefault(Color.White, Color.Red, Color.Green);
|
|
|
|
|
|
|
|
|
|
//DevExpress.Utils.AppearanceDefault alertFocus = new DevExpress.Utils.AppearanceDefault(Color.White, Color.Red, Color.Green, Color.Yellow);
|
|
|
|
|
DevExpress.Utils.AppearanceDefault alertFocus = new DevExpress.Utils.AppearanceDefault(Color.White,Color.Red);
|
|
|
|
|
DevExpress.Utils.AppearanceDefault alert = new DevExpress.Utils.AppearanceDefault(Color.Red, Color.White );
|
|
|
|
|
|
|
|
|
|
DevExpress.Utils.AppearanceDefault passedFocus = new DevExpress.Utils.AppearanceDefault(Color.Gray, Color.WhiteSmoke);
|
|
|
|
|
DevExpress.Utils.AppearanceDefault passed = new DevExpress.Utils.AppearanceDefault(Color.Gray,Color.White);
|
|
|
|
|
|
|
|
|
|
DevExpress.Utils.AppearanceDefault solutionFocus = new DevExpress.Utils.AppearanceDefault(Color.Green, Color.Yellow);
|
|
|
|
|
DevExpress.Utils.AppearanceDefault solution = new DevExpress.Utils.AppearanceDefault(Color.Green, Color.White);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (status == enumOutStockPickStatus.复核完成)
|
|
|
|
|
{
|
|
|
|
|
rowStyle = isFocused ? passedFocus : passed;
|
|
|
|
|
}
|
|
|
|
|
else if (status == enumOutStockPickStatus.复核异常)
|
|
|
|
|
{
|
|
|
|
|
rowStyle = isFocused ? alertFocus : alert;
|
|
|
|
|
}
|
|
|
|
|
else if (status == enumOutStockPickStatus.复核异常处理)
|
|
|
|
|
{
|
|
|
|
|
rowStyle = isFocused ? solutionFocus : solution;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, rowStyle);
|
|
|
|
|
/*
|
|
|
|
|
if (sender == this.gridView2)
|
|
|
|
|
{
|
|
|
|
|
if (this.gridView2.GetDataRow(e.RowHandle)["state"].ToString().Trim() == "2")
|
|
|
|
|
{
|
|
|
|
|
DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alert);
|
|
|
|
|
}
|
|
|
|
|
}else if(sender == this.gridView1){
|
|
|
|
|
|
|
|
|
|
if ( state == "2")
|
|
|
|
|
{
|
|
|
|
|
if (currentView != null && e.RowHandle == currentView.FocusedRowHandle)
|
|
|
|
|
{
|
|
|
|
|
DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alertFocus);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alert);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (state == "1")
|
|
|
|
|
{
|
|
|
|
|
DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, passed);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setCurrentRequestDetail()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!getCurrentObject() || string.IsNullOrEmpty( currentPickOrder))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// showWaitForm();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// DataView dv = dtPickOrdersDetail.DefaultView;
|
|
|
|
|
// dv.Sort = "orderNo ASC";
|
|
|
|
|
// dv.RowFilter = string.Format("pickOrderNo ='{0}'", currentPickOrder);
|
|
|
|
|
|
|
|
|
|
bindValidationTables();
|
|
|
|
|
|
|
|
|
|
if (lgOutPickDetail.Expanded)
|
|
|
|
|
{
|
|
|
|
|
showOrderPickDetail();
|
|
|
|
|
}
|
|
|
|
|
bindBoxes();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e,e.Message);
|
|
|
|
|
}
|
|
|
|
|
// closeWaitForm();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void bindBoxes()
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(currentWave))
|
|
|
|
|
{
|
|
|
|
|
this.gridControlBox.DataSource = null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = pickClient.getBoxsByWave(currentWave, desk);
|
|
|
|
|
initialBoxColumns(gvBox);
|
|
|
|
|
this.gridControlBox.DataSource = dt;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(e, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void showOrderPickDetail()
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(currentPickOrder))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
this.gridSaleOrders.DataSource = pickClient.getOutRequestDetail(currentPickOrder).DefaultView;
|
|
|
|
|
// closeClient();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(ex,ex.Message);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initialGridView2Columns(gridViewSaleOrders);
|
|
|
|
|
//set pick details
|
|
|
|
|
updatePickDetails();
|
|
|
|
|
}
|
|
|
|
|
private void bindValidationTables()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
resetValidationDetails();
|
|
|
|
|
//set sales order details
|
|
|
|
|
DataView dv = dtPickOrdersDetail.DefaultView;
|
|
|
|
|
// dv.Sort = "orderNo ASC";
|
|
|
|
|
dv.RowFilter = string.Format("pickOrderNo ='{0}'", currentPickOrder);
|
|
|
|
|
|
|
|
|
|
dtPickOrders4Validation = dv.ToTable();
|
|
|
|
|
|
|
|
|
|
// dtPickOrders4Validation.PrimaryKey = new DataColumn[] { dtPickOrders4Validation.Columns["barCode"] };
|
|
|
|
|
|
|
|
|
|
//bind data validated
|
|
|
|
|
|
|
|
|
|
dtPickOrdersValidated = dv.ToTable();
|
|
|
|
|
DataView dv2 = dtPickOrdersValidated.DefaultView;
|
|
|
|
|
dv2.RowFilter = string.Format("bulkCount>0 and bulkPickState >{0}", (int)enumOutStockPickStatus.分拣完成);
|
|
|
|
|
dv2.Sort = "lastmodified desc";
|
|
|
|
|
this.gridValidated.DataSource = dv2;
|
|
|
|
|
initialGridView2Columns(gridViewValidated);
|
|
|
|
|
//gridViewValidated.FocusedRowHandle = -1;
|
|
|
|
|
//gridViewValidated.SelectRow(-1);
|
|
|
|
|
|
|
|
|
|
dtPickOrdersValidated = dv2.ToTable();
|
|
|
|
|
dtPickOrdersValidated.PrimaryKey = new DataColumn[] { dtPickOrdersValidated.Columns["id"] };
|
|
|
|
|
|
|
|
|
|
//bind data to be validated
|
|
|
|
|
|
|
|
|
|
DataView dv1 = dtPickOrders4Validation.DefaultView;
|
|
|
|
|
dv1.RowFilter = string.Format("bulkCount>0 and bulkPickState <={0}", (int)enumOutStockPickStatus.分拣完成);
|
|
|
|
|
|
|
|
|
|
dtPickOrders4Validation = dv1.ToTable();
|
|
|
|
|
dtPickOrders4Validation.PrimaryKey = new DataColumn[] { dtPickOrders4Validation.Columns["id"] };
|
|
|
|
|
this.grid4Valid.DataSource = dv1;
|
|
|
|
|
initialGridView2Columns(gridView4Valid);
|
|
|
|
|
btnPrint.Enabled = rd2.Checked && dtPickOrders4Validation.Rows.Count == 0 && dtPickOrdersValidated.Select("bulkpickstate < " + (int)enumOutStockPickStatus.复核完成).Length == 0;
|
|
|
|
|
btnOk.Enabled = rd1.Checked && dtPickOrders4Validation.Rows.Count == 0 && dtPickOrdersValidated.Select("bulkpickstate < " + (int)enumOutStockPickStatus.复核完成).Length == 0;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void clearDetails()
|
|
|
|
|
{
|
|
|
|
|
resetValidationDetails();
|
|
|
|
|
this.gridValidated.DataSource = null;
|
|
|
|
|
this.grid4Valid.DataSource = null;
|
|
|
|
|
// lbCustmer.Text = "";
|
|
|
|
|
// lbCustmer.Text = "";
|
|
|
|
|
spinBulkBox.Value = 0;
|
|
|
|
|
spinBulkBag.Value = 0;
|
|
|
|
|
isDoubleChk = false;
|
|
|
|
|
txtAccount.Text = txtPasswd.Text = "";
|
|
|
|
|
btnValidateItem.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnPickOrders_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
getValidationOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void swAutoOrder_Toggled(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
autoOrder = swAutoOrder.IsOn;
|
|
|
|
|
btnPickOrders.Enabled = !autoOrder;
|
|
|
|
|
if (autoOrder)
|
|
|
|
|
{
|
|
|
|
|
getValidationOrders();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ribbon_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void resetValidationDetails()
|
|
|
|
|
{
|
|
|
|
|
lastScanBarcode = "";
|
|
|
|
|
selectedValidationItem = -1;
|
|
|
|
|
currentDetail = null;
|
|
|
|
|
lbGoodsName.Text ="";
|
|
|
|
|
|
|
|
|
|
this.lbManufacturer.Text = "";
|
|
|
|
|
this.lbPickCount.Text = "";
|
|
|
|
|
this.lbSaleCount.Text = "";
|
|
|
|
|
this.textEditValidCount.Text = "";
|
|
|
|
|
this.textEditValidtionRemark.Text = "";
|
|
|
|
|
this.comValidException.SelectedIndex = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.lbType.Text = "";
|
|
|
|
|
this.lbUnit.Text = "";
|
|
|
|
|
this.checkEditPass.Checked = false;
|
|
|
|
|
textEditBarcode.Text = "";
|
|
|
|
|
this.btnValidateItem.Enabled = false;
|
|
|
|
|
textEditBarcode.BackColor = textEditValidCount.BackColor; ;
|
|
|
|
|
foreach (LotAtt la in SKUs.Keys)
|
|
|
|
|
{
|
|
|
|
|
SKUs[la].Text = "";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//gridviewvalidated
|
|
|
|
|
|
|
|
|
|
int selectedValidatedItem = -1;
|
|
|
|
|
private void gridViewValidated_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.gridViewValidated.FocusedRowHandle < 0 || gridViewValidated.FocusedRowHandle == selectedValidatedItem)
|
|
|
|
|
{
|
|
|
|
|
if (gridViewValidated.IsGroupRow(e.RowHandle)) //set first row of group selected
|
|
|
|
|
{
|
|
|
|
|
selectedValidatedItem = gridViewValidated.GetChildRowHandle(e.RowHandle, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
selectedValidatedItem = gridViewValidated.FocusedRowHandle >= 0 ? gridViewValidated.FocusedRowHandle : selectedValidatedItem;
|
|
|
|
|
setCurrentValidatedDetail();
|
|
|
|
|
gridView4Valid.FocusedRowHandle = -1;
|
|
|
|
|
gridView4Valid.SelectRow(-1);
|
|
|
|
|
}
|
|
|
|
|
private void setCurrentValidatedDetail()
|
|
|
|
|
{
|
|
|
|
|
if (!this.gridValidated.IsFocused)
|
|
|
|
|
{
|
|
|
|
|
// return;
|
|
|
|
|
}
|
|
|
|
|
if (selectedValidatedItem < 0 || selectedValidatedItem >= this.dtPickOrdersValidated .Rows.Count)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DataRow dr = dtPickOrdersValidated.Rows[selectedValidatedItem];
|
|
|
|
|
DataRowView dr = (DataRowView)(GetGridViewFilteredAndSortedData(gridViewValidated)[selectedValidatedItem]);
|
|
|
|
|
setValidataDetail(dr.Row);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//exception
|
|
|
|
|
int selectedExceptionItem = -1;
|
|
|
|
|
private void gridViewException_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.gridViewException.FocusedRowHandle < 0 || gridViewException.FocusedRowHandle == selectedExceptionItem)
|
|
|
|
|
{
|
|
|
|
|
if (gridViewException.IsGroupRow(e.RowHandle)) //set first row of group selected
|
|
|
|
|
{
|
|
|
|
|
selectedExceptionItem = gridViewException.GetChildRowHandle(e.RowHandle, 0);
|
|
|
|
|
setCurrentExceptionDetail();
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
selectedExceptionItem = gridViewException.FocusedRowHandle;
|
|
|
|
|
setCurrentExceptionDetail();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void setCurrentExceptionDetail()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (selectedExceptionItem < 0 || selectedExceptionItem >= dtExceptionSolutions.Rows.Count)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//DataRow dr = this.dtExceptionSolutions.Rows[selectedExceptionItem];
|
|
|
|
|
DataRowView dr = (DataRowView)(GetGridViewFilteredAndSortedData(gridViewException)[selectedExceptionItem]);
|
|
|
|
|
if (dr != null)
|
|
|
|
|
{
|
|
|
|
|
this.currentPickOrder = dr["pickOrderNo"].ToString();
|
|
|
|
|
isDataSourceChanged = true;
|
|
|
|
|
loadPickOrders();
|
|
|
|
|
this.setCurrentRequestDetail();
|
|
|
|
|
this.switchGridViewRowSelection(gridViewException, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg("no record found");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// gridview4validate
|
|
|
|
|
|
|
|
|
|
int selectedValidationItem = -1;
|
|
|
|
|
private void gridView4Validation_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.gridView4Valid.FocusedRowHandle < 0 || gridView4Valid.FocusedRowHandle == selectedValidationItem)
|
|
|
|
|
{
|
|
|
|
|
if (gridView4Valid.IsGroupRow(e.RowHandle)) //set first row of group selected
|
|
|
|
|
{
|
|
|
|
|
selectedValidationItem = gridView4Valid.GetChildRowHandle(e.RowHandle, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
selectedValidationItem = gridView4Valid.FocusedRowHandle >= 0 ? gridView4Valid.FocusedRowHandle : selectedValidationItem;
|
|
|
|
|
setCurrentValidationDetail();
|
|
|
|
|
gridViewValidated .FocusedRowHandle = -1;
|
|
|
|
|
gridViewValidated.SelectRow(-1);
|
|
|
|
|
}
|
|
|
|
|
private void setCurrentValidationDetail()
|
|
|
|
|
{
|
|
|
|
|
if (!grid4Valid.IsFocused)
|
|
|
|
|
{
|
|
|
|
|
//return;
|
|
|
|
|
}
|
|
|
|
|
if (selectedValidationItem < 0 || selectedValidationItem >= dtPickOrders4Validation.Rows.Count)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DataRow dr = dtPickOrders4Validation.Rows[selectedValidationItem];
|
|
|
|
|
DataRowView dr = (DataRowView)(GetGridViewFilteredAndSortedData(gridView4Valid)[selectedValidationItem]);
|
|
|
|
|
|
|
|
|
|
setValidataDetail(dr.Row);
|
|
|
|
|
this.textEditValidCount.Text = this.lbPickCount.Text;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setValidataDetail(DataRow dr)
|
|
|
|
|
{
|
|
|
|
|
if (currentDetail != null && currentDetail.ID == Convert.ToInt32(dr["id"].ToString()))
|
|
|
|
|
{
|
|
|
|
|
textEditBarcode.Focus();
|
|
|
|
|
textEditBarcode.SelectAll();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
currentDetail = new WmsOutPickDetail_tmp(dr);
|
|
|
|
|
lbGoodsName.Text = dr[WmsGoods.exfields.goodsName.ToString()].ToString(); ;
|
|
|
|
|
|
|
|
|
|
this.lbManufacturer.Text = dr[WmsGoods.exfields.manufacturer.ToString()].ToString();
|
|
|
|
|
this.lbPickCount.Text = dr[WmsOutPickDetail.fields.bulkCount.ToString()].ToString();
|
|
|
|
|
int i = this.lbPickCount.Text.IndexOf(".");
|
|
|
|
|
if (i > 0)
|
|
|
|
|
{
|
|
|
|
|
this.lbPickCount.Text = this.lbPickCount.Text.Substring(0, i);
|
|
|
|
|
}
|
|
|
|
|
this.lbSaleCount.Text = dr[WmsOutPickDetail.fields.bulkCount.ToString()].ToString();
|
|
|
|
|
this.textEditValidCount.Text = dr[WmsOutPickDetail.fields.confirmedCount.ToString()].ToString();
|
|
|
|
|
this.textEditValidtionRemark.Text = dr[WmsOutPickDetail.fields.validRemark.ToString()].ToString();
|
|
|
|
|
isDoubleChk = "Y".Equals( dr["isDouChk"].ToString().Trim());
|
|
|
|
|
lgDoulbeChk.Visibility = isDoubleChk ? DevExpress.XtraLayout.Utils.LayoutVisibility.Always
|
|
|
|
|
: DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string tmp = dr[WmsOutPickDetail.fields.validReason.ToString()].ToString();
|
|
|
|
|
if (string.IsNullOrEmpty(tmp))
|
|
|
|
|
{
|
|
|
|
|
this.comValidException.SelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2023-09-04 22:41:19 +08:00
|
|
|
|
int validReason = Convert.ToInt32(tmp);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
validReason = validReason > 0 ? validReason : 0;
|
|
|
|
|
if (validReason > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DataRow ndr = Park.getDictionary().Rows.Find(validReason);
|
|
|
|
|
|
|
|
|
|
Node n = new Node(ndr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (Node cc in comValidException.Properties.Items)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (cc.ID == n.ID)
|
|
|
|
|
{
|
|
|
|
|
comValidException.SelectedItem = cc;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.comValidException.SelectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
this.comValidException.SelectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
createSKUinputs(currentDetail.goodsId, currentDetail.skuId);
|
|
|
|
|
|
|
|
|
|
// this.lbBatch.Text = dr["batch"].ToString(); ;
|
|
|
|
|
// this.lbProductDate.Text = dr[WmsOutPickDetail.fields.productDate.ToString()].ToString();
|
|
|
|
|
// this.lbValidDate.Text = dr[WmsOutPickDetail.fields.validDate.ToString()].ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.lbType.Text = dr[WmsGoods.exfields.type.ToString()].ToString();
|
|
|
|
|
this.lbUnit.Text = dr[WmsGoods.exfields.unit.ToString()].ToString();
|
|
|
|
|
this.checkEditPass.Checked = true;
|
2023-09-04 22:41:19 +08:00
|
|
|
|
enumOutStockPickStatus state = (enumOutStockPickStatus)Convert.ToInt32(dr["bulkPickState"].ToString());
|
2023-05-23 16:13:17 +08:00
|
|
|
|
if (state == enumOutStockPickStatus.复核异常)
|
|
|
|
|
{
|
|
|
|
|
this.checkEditPass.Checked = false;
|
|
|
|
|
}
|
|
|
|
|
textEditBarcode.Text = dr[WmsGoods.exfields.barcode.ToString()].ToString();
|
|
|
|
|
//textEditBarcode.SelectedText = textEditBarcode.Text;
|
|
|
|
|
//textEditBarcode.SelectionLength = textEditBarcode.Text.Length;
|
|
|
|
|
textEditBarcode.Focus();
|
|
|
|
|
textEditBarcode.SelectAll();
|
|
|
|
|
|
|
|
|
|
this.btnValidateItem.Enabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void textEditBarcode_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnValidateItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
validation();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception er)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(er);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void validation()
|
|
|
|
|
{
|
|
|
|
|
if (currentDetail == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (currentDetail.bulkPickState < (int)enumOutStockPickStatus.分拣完成)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg("此货物还未完成分拣,不能复核");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isDoubleChk)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(txtAccount.Text) || string.IsNullOrEmpty(txtPasswd.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg("重点商品,需要双人验收!");
|
|
|
|
|
this.txtAccount.Focus();
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!checkPermission(WmsConstants.SPECIAL_AUTHS_DOUBLE_CHECK))
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(LoginInfo.Account + " 权限不足,需要特殊权限:" + WmsConstants.SPECIAL_AUTHS_DOUBLE_CHECK);
|
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentDetail.checkedBy1=checkPermission(txtAccount.Text, txtPasswd.Text, WmsConstants.SPECIAL_AUTHS_DOUBLE_CHECK);
|
|
|
|
|
if (currentDetail.checkedBy1<0)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(txtAccount.Text + " 权限不足,需要特殊权限:" + WmsConstants.SPECIAL_AUTHS_DOUBLE_CHECK);
|
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (comValidException.SelectedItem == null)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg("请选择复核结果");
|
|
|
|
|
this.comValidException.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentDetail.bulkPickState = checkEditPass.Checked ? (int)enumOutStockPickStatus.复核完成 : (int)enumOutStockPickStatus.复核异常;
|
|
|
|
|
currentDetail.validRemark = comValidException.Text +"; " +textEditValidtionRemark.Text.Trim();
|
|
|
|
|
currentDetail.validReason = ((Node)comValidException.SelectedItem).ID;
|
|
|
|
|
currentDetail.confirmedCount = Convert.ToDecimal(textEditValidCount.Text.Trim());
|
|
|
|
|
|
|
|
|
|
Thread completeThread = new Thread(printErrorCode);
|
|
|
|
|
completeThread.IsBackground = true;
|
|
|
|
|
completeThread.Start();
|
|
|
|
|
|
|
|
|
|
updateValidationItem();
|
|
|
|
|
|
|
|
|
|
//Thread updateValidation = new Thread(updateValidationItem);
|
|
|
|
|
//updateValidation.IsBackground = true;
|
|
|
|
|
//updateValidation.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataRow dr = this.dtPickOrdersDetail.Rows.Find(currentDetail.ID);
|
|
|
|
|
if (dr != null)
|
|
|
|
|
{
|
|
|
|
|
dr[WmsOutPickDetail.fields.validReason.ToString()] = currentDetail.validReason;
|
|
|
|
|
dr["bulkPickState"] = currentDetail.bulkPickState;
|
|
|
|
|
dr["validResult"] = this.comValidException.Text ;
|
|
|
|
|
dr[WmsOutPickDetail.fields.validRemark.ToString()] = this.textEditValidtionRemark.Text;
|
|
|
|
|
dr[WmsOutPickDetail.fields.confirmedCount.ToString()] = currentDetail.confirmedCount;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
bindValidationTables();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void printErrorCode()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (currentDetail.bulkPickState == (int)enumOutStockPickStatus.复核异常)
|
|
|
|
|
{
|
|
|
|
|
DataView dv = dtPickOrdersDetail.DefaultView;
|
|
|
|
|
dv.RowFilter = "ID =" + currentDetail.ID;
|
|
|
|
|
reqportPrint.printBulkValidError(dv.ToTable());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception er)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(er);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateValidationItem()
|
|
|
|
|
{
|
|
|
|
|
if (currentDetail == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool b = this.pickClient.updateValidBulkPickStatus(currentDetail.ID, currentDetail.bulkPickState, currentDetail.validRemark,
|
|
|
|
|
currentDetail.validReason, currentDetail.confirmedCount,currentDetail.checkedBy1);
|
|
|
|
|
//closeClient();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// currentDetail.Update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void gridView4Valid_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(e.KeyCode == Keys.Enter){
|
|
|
|
|
|
|
|
|
|
validation();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected new void gridview_GotFocus(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (sender == gridView4Valid && dtPickOrders4Validation !=null)
|
|
|
|
|
{
|
|
|
|
|
//grid4Valid.ForeColor = Color.Blue;
|
|
|
|
|
// gridView4Valid.OptionsSelection.EnableAppearanceHideSelection = true;
|
|
|
|
|
if (this.dtPickOrders4Validation.Rows.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
gridViewValidated.Focus();
|
|
|
|
|
}
|
|
|
|
|
this.setCurrentValidationDetail();
|
|
|
|
|
switchGridViewRowSelection(gridView4Valid,true);
|
|
|
|
|
switchGridViewRowSelection(gridViewValidated, false);
|
|
|
|
|
}
|
|
|
|
|
else if (sender == gridViewValidated)
|
|
|
|
|
{
|
|
|
|
|
this.setCurrentValidatedDetail();
|
|
|
|
|
switchGridViewRowSelection(gridViewValidated, true);
|
|
|
|
|
switchGridViewRowSelection(gridView4Valid, false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switchGridViewRowSelection((GridView)sender, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void textEditBarcode_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//如果鼠标左键操作并且标记存在,则执行全选
|
|
|
|
|
if (e.Button == MouseButtons.Left &&textEditBarcode.Tag!=null&& (bool)textEditBarcode.Tag == true)
|
|
|
|
|
{
|
|
|
|
|
textEditBarcode.SelectAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//取消全选标记
|
|
|
|
|
textEditBarcode.Tag = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void textBoxId_GotFocus(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.txtBoxId.Tag = true; //设置标记
|
|
|
|
|
txtBoxId.SelectAll(); //注意1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void textBoxId_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//如果鼠标左键操作并且标记存在,则执行全选
|
|
|
|
|
if (e.Button == MouseButtons.Left && txtBoxId.Tag != null && (bool)txtBoxId.Tag == true)
|
|
|
|
|
{
|
|
|
|
|
txtBoxId.SelectAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//取消全选标记
|
|
|
|
|
txtBoxId.Tag = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void textEditBarcode_GotFocus(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
textEditBarcode.Tag = true; //设置标记
|
|
|
|
|
textEditBarcode.SelectAll(); //注意1
|
|
|
|
|
}
|
|
|
|
|
string notGoodsExists = "不存在此商品";
|
|
|
|
|
private void textEditBarcode_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//Color a = new Color();
|
|
|
|
|
if (notGoodsExists.Equals(lbGoodsName.Text))
|
|
|
|
|
{
|
|
|
|
|
lbGoodsName.Text = "";
|
|
|
|
|
}
|
|
|
|
|
lbGoodsName.BackColor = Color.White;
|
|
|
|
|
if (e.KeyCode != Keys.Enter)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string barcode = textEditBarcode.Text;
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(barcode))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!WmsConstants.OUT_VALIDATION_ONE_ENTER &&
|
|
|
|
|
lastScanBarcode.Equals(barcode)){
|
|
|
|
|
validation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textEditBarcode.BackColor = textEditValidCount.BackColor; ;
|
|
|
|
|
|
|
|
|
|
DataRow[] drs = dtPickOrders4Validation.Select(string.Format("barcode ='{0}'", barcode));
|
|
|
|
|
lastScanBarcode = "norec";
|
|
|
|
|
|
|
|
|
|
if (drs.Length == 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//check validated
|
|
|
|
|
drs = this.dtPickOrdersValidated.Select(string.Format("barcode ='{0}'", barcode));
|
|
|
|
|
|
|
|
|
|
if (drs.Length == 0)
|
|
|
|
|
{
|
|
|
|
|
resetValidationDetails();
|
|
|
|
|
// clearDetails();
|
|
|
|
|
//setCurrentValidationDetail();
|
|
|
|
|
lbGoodsName.Text = notGoodsExists;
|
|
|
|
|
lbGoodsName.BackColor = Color.Yellow;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (drs.Length > 1)
|
|
|
|
|
{
|
|
|
|
|
textEditBarcode.BackColor = Color.OrangeRed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DataRow dr0 = drs[0];
|
|
|
|
|
if (drs != null)
|
|
|
|
|
{
|
|
|
|
|
// selectedValidatedItem = dtPickOrdersValidated.Rows.IndexOf(dr0);
|
|
|
|
|
selectedValidatedItem = 0;
|
|
|
|
|
foreach (DataRowView drv in GetGridViewFilteredAndSortedData(gridViewValidated))
|
|
|
|
|
{
|
|
|
|
|
if (drv["barcode"].ToString().Equals(barcode))
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
selectedValidatedItem++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectedValidatedItem >= 0 && dtPickOrdersValidated.Rows.Count > selectedValidatedItem)
|
|
|
|
|
{
|
|
|
|
|
this.gridViewValidated.FocusedRowHandle = selectedValidatedItem;
|
|
|
|
|
}
|
|
|
|
|
gridViewValidated.Focus();
|
|
|
|
|
this.setCurrentValidatedDetail();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastScanBarcode = barcode;
|
|
|
|
|
|
|
|
|
|
if (drs.Length > 1)
|
|
|
|
|
{
|
|
|
|
|
textEditBarcode.BackColor = Color.OrangeRed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DataRow dr = drs[0];
|
|
|
|
|
if (drs != null)
|
|
|
|
|
{
|
|
|
|
|
// selectedValidationItem = dtPickOrders4Validation.Rows.IndexOf(dr);
|
|
|
|
|
selectedValidationItem = 0;
|
|
|
|
|
foreach (DataRowView drv in GetGridViewFilteredAndSortedData(gridView4Valid))
|
|
|
|
|
{
|
|
|
|
|
if (drv["barcode"].ToString().Equals(barcode))
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
selectedValidationItem++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectedValidationItem >= 0 && dtPickOrders4Validation.Rows.Count > selectedValidationItem)
|
|
|
|
|
{
|
|
|
|
|
this.gridView4Valid.FocusedRowHandle = selectedValidationItem;
|
|
|
|
|
}
|
|
|
|
|
gridView4Valid.Focus();
|
|
|
|
|
setCurrentValidationDetail();
|
|
|
|
|
|
|
|
|
|
if (WmsConstants.OUT_VALIDATION_ONE_ENTER )
|
|
|
|
|
{
|
|
|
|
|
validation();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string tmpOrder = string.Empty;
|
|
|
|
|
int boxcnt =0;
|
|
|
|
|
int bagcnt = 0;
|
|
|
|
|
|
|
|
|
|
private void btnPrint_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
printCodes();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printIn reqportPrint = new printIn();
|
|
|
|
|
void completeValidation()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// pickClient.completeBulkValidation(tmpOrder,boxcnt, bagcnt, dtPickOrdersValidated);
|
|
|
|
|
pickClient.completeBulkValidation(tmpOrder, boxcnt, bagcnt);
|
|
|
|
|
pickClient.Close();
|
|
|
|
|
|
|
|
|
|
//TODO: print bulk boxs\bags label
|
|
|
|
|
//t_tmsStock
|
|
|
|
|
printCodes();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(ex );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// lgt.completeBulkValidation(currentPickOrder, dtPickOrdersValidated);
|
|
|
|
|
|
|
|
|
|
// currentPickOrder = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void printCodes()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-04 22:41:19 +08:00
|
|
|
|
boxcnt = Convert.ToInt32(spinBulkBox.Value);
|
|
|
|
|
bagcnt = Convert.ToInt32(spinBulkBag.Value);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
if (boxcnt + bagcnt == 0)
|
|
|
|
|
{
|
|
|
|
|
// showErrorMsg("请设置零货拼箱、拼袋数量");
|
|
|
|
|
// return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmpOrder = string.IsNullOrEmpty(tmpOrder) ? currentPickOrder : tmpOrder;
|
|
|
|
|
// tmpOrder="PK20210812025228";
|
|
|
|
|
DataTable dt = tmsClient.getTmsStockBulkDetail(tmpOrder);
|
|
|
|
|
|
|
|
|
|
reqportPrint.printBulkPackingNoStore(dt, boxcnt, bagcnt);
|
|
|
|
|
tmsClient.Close();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(ex );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void textEditValidCount_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (currentDetail == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.checkEditPass.Checked = textEditValidCount.Value == currentDetail.bulkCount;
|
|
|
|
|
if (textEditValidCount.Value != currentDetail.bulkCount)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
this.comValidException.SelectedIndex = -1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void comValidException_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.checkEditPass.Checked = comValidException.SelectedIndex == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnEndWave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GoodsOutValidationForm_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
timer.Stop();
|
|
|
|
|
timer.Close();
|
|
|
|
|
closeClient();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void lgOutPickDetail_CustomButtonChecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.gridSaleOrders.DataSource = null;
|
|
|
|
|
gridPickDetails.DataSource = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void lgOutPickDetail_CustomButtonUnchecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
showOrderPickDetail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void combColors_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (oldDesk == "-1")
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
queryOrders();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void queryOrders()
|
|
|
|
|
{
|
|
|
|
|
showWaitForm();
|
|
|
|
|
this.refreshInterval = 0;
|
|
|
|
|
clearDetails();
|
|
|
|
|
getValidationOrders();
|
|
|
|
|
getDeskStatus();
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void spinOrder_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
refreshInterval = Convert.ToInt32(spinOrder.Value * 60);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void txtBoxId_KeyUp(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string boxId = txtBoxId.Text.Trim();
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(boxId))
|
|
|
|
|
{
|
|
|
|
|
boxWave = string.Empty;
|
|
|
|
|
boxDesk = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (e.KeyCode != Keys.Enter)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(boxId))
|
|
|
|
|
{
|
|
|
|
|
boxWave = string.Empty;
|
|
|
|
|
boxDesk = 0;
|
|
|
|
|
getPickOrders4Validation();
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = pickClient.getWaveDeskByBoxId(boxId);
|
|
|
|
|
|
|
|
|
|
if (dt.Rows.Count==0)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg("未找到该箱子的注册信息");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boxWave = dt.Rows[0]["waveNo"].ToString();
|
|
|
|
|
|
2023-09-04 22:41:19 +08:00
|
|
|
|
boxDesk = Convert.ToInt32( dt.Rows[0]["color"].ToString());
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
if (boxDesk != desk)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(string.Format("该箱子属于复核台{0}",boxDesk));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPickOrders4Validation();
|
|
|
|
|
//loadPickOrders();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception er)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
showErrorMsg(er, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------create sku input controls
|
|
|
|
|
// List<LotAtt> ATTs = new List<LotAtt>();
|
|
|
|
|
// Dictionary<LotAtt, BaseEdit> SKUs = new Dictionary<LotAtt, BaseEdit>();
|
|
|
|
|
Dictionary<LotAtt, Label> SKUs = new Dictionary<LotAtt, Label>();
|
|
|
|
|
int lastLotId = 0;
|
|
|
|
|
private void createSKUinputs(string goodsId,int skuId)
|
|
|
|
|
{
|
|
|
|
|
// skuId = 1;
|
|
|
|
|
DataTable skuValues = null;
|
|
|
|
|
DataTable lotAtts = null;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
showWaitForm();
|
|
|
|
|
lotAtts = lotClient.getLotAtts(goodsId);
|
|
|
|
|
skuValues = lotClient.querySkuValues(skuId);
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
//closeClient();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
showErrorMsg(e, "出错了");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<LayoutControlItem> liSKU = new List<LayoutControlItem>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int pjCount = lotAtts.Rows.Count;
|
|
|
|
|
|
|
|
|
|
if (pjCount == 0)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 22:41:19 +08:00
|
|
|
|
int lotId = Convert.ToInt32(lotAtts.Rows[0]["lotId"].ToString());
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
if (lastLotId == lotId) //批次定义相同,不需从新创建sku控件
|
|
|
|
|
{
|
|
|
|
|
foreach (LotAtt la in SKUs.Keys)
|
|
|
|
|
{
|
|
|
|
|
SKUs[la].Text = "";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lcgSKUGroup.BeginUpdate();
|
|
|
|
|
lcgSKUGroup.Clear();
|
|
|
|
|
lcgSKUGroup.Items.Clear();
|
|
|
|
|
SKUs.Clear();
|
|
|
|
|
|
|
|
|
|
LayoutControlItem lastItem = null;
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (DataRow dr in lotAtts.Rows)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Label be;
|
|
|
|
|
|
|
|
|
|
LotAtt la = new LotAtt(dr);
|
|
|
|
|
enumLotAttType enLt = (enumLotAttType)la.attType;
|
|
|
|
|
|
|
|
|
|
be = new Label();
|
|
|
|
|
|
|
|
|
|
be.Name = "SKU" + la.ID;
|
|
|
|
|
be.TabIndex = 40 + (i * 8);
|
|
|
|
|
be.Font = new System.Drawing.Font("微软雅黑", 16F);
|
|
|
|
|
if (!la.isOptional)
|
|
|
|
|
{
|
|
|
|
|
be.ForeColor = Color.Red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LayoutControlItem item = lcgSKUGroup.AddItem(la.attName, be) as LayoutControlItem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
item.MaxSize = new System.Drawing.Size(300, 44);
|
|
|
|
|
item.MinSize = new System.Drawing.Size(270, 44);
|
|
|
|
|
item.Name = "lci" + la.attName;
|
|
|
|
|
item.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 2, 2, 2);
|
|
|
|
|
item.Size = new System.Drawing.Size(839, 44);
|
|
|
|
|
item.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
|
|
|
|
|
// this.layoutControlItem2.Text = "批次信息";
|
|
|
|
|
item.TextSize = new System.Drawing.Size(51, 14);
|
|
|
|
|
|
|
|
|
|
if (lastItem != null && i % 4 != 0)
|
|
|
|
|
{
|
|
|
|
|
item.Move(lastItem, DevExpress.XtraLayout.Utils.InsertType.Left);
|
|
|
|
|
}
|
|
|
|
|
lastItem = item;
|
|
|
|
|
|
|
|
|
|
SKUs.Add(la, be);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lcgSKUGroup.EndUpdate();
|
|
|
|
|
lastLotId = lotId;
|
|
|
|
|
|
|
|
|
|
foreach (LotAtt la in SKUs.Keys)
|
|
|
|
|
{
|
|
|
|
|
Label be = SKUs[la];
|
|
|
|
|
DataRow[] drs = skuValues.Select(string.Format("attID ={0}", la.ID));
|
|
|
|
|
if (la.isList && la.listId > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (DataRow drr in drs)
|
|
|
|
|
{
|
|
|
|
|
DataRow[] drss = Park.getDictionary(false).Select(string.Format("ID ={0}", drr["value"].ToString()));
|
|
|
|
|
if (drss.Length > 0)
|
|
|
|
|
be.Text = drss[0]["name"].ToString();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (drs.Length > 0)
|
|
|
|
|
be.Text = drs[0]["value"].ToString();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void swStatus_Toggled(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
showWaitForm();
|
|
|
|
|
pickClient.setDeskAvailable(desk, !swStatus.IsOn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception er)
|
|
|
|
|
{
|
|
|
|
|
showErrorMsg(er);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pickClient.Close();
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void rd1_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
rd2.Checked = !rd1.Checked;
|
|
|
|
|
setOrderFilter();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void rd2_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
rd1.Checked = !rd2.Checked;
|
|
|
|
|
setOrderFilter();
|
|
|
|
|
}
|
|
|
|
|
string filter = "orderState=" + (int)enumOutStockPickStatus.正在分拣;
|
|
|
|
|
private void setOrderFilter()
|
|
|
|
|
{
|
|
|
|
|
//clearDetails();
|
|
|
|
|
if (rd2.Checked)
|
|
|
|
|
{
|
|
|
|
|
filter = "orderState>" + (int)enumOutStockPickStatus.正在分拣;
|
|
|
|
|
}
|
|
|
|
|
else if (rd1.Checked)
|
|
|
|
|
{
|
|
|
|
|
filter = "orderState=" + (int)enumOutStockPickStatus.正在分拣;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnOk_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2023-09-04 22:41:19 +08:00
|
|
|
|
boxcnt = Convert.ToInt32(spinBulkBox.Value);
|
|
|
|
|
bagcnt = Convert.ToInt32(spinBulkBag.Value);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
if (boxcnt + bagcnt == 0)
|
|
|
|
|
{
|
|
|
|
|
// showErrorMsg("请设置零货拼箱、拼袋数量");
|
|
|
|
|
// return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//save the box/bag info
|
|
|
|
|
|
|
|
|
|
//handle tran system
|
|
|
|
|
|
|
|
|
|
//print
|
|
|
|
|
|
|
|
|
|
//close current order
|
|
|
|
|
getCurrentObject();
|
|
|
|
|
tmpOrder = currentPickOrder;
|
|
|
|
|
Thread completeThread = new Thread(completeValidation);
|
|
|
|
|
completeThread.IsBackground = true;
|
|
|
|
|
completeThread.Start();
|
|
|
|
|
//remove the order from pickorder list
|
|
|
|
|
clearDetails();
|
|
|
|
|
if (dtPickOrders.Rows.Count < 2)
|
|
|
|
|
{
|
|
|
|
|
showWaitForm();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
getPickOrders4Validation();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ee)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLog(typeof(GoodsOutValidationForm), ee);
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
}
|
|
|
|
|
closeWaitForm();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DataRow dr = dtPickOrders.Rows.Find(currentPickOrder);
|
|
|
|
|
if (dr != null)
|
|
|
|
|
{
|
|
|
|
|
dtPickOrders.Rows.Remove(dr);
|
|
|
|
|
}
|
|
|
|
|
currentPickOrder = null;
|
|
|
|
|
this.selectedRowIndex = 0;
|
|
|
|
|
loadPickOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|