|
|
@@ -129,8 +129,6 @@ namespace UAS_LabelMachine
|
|
|
/*用于存放采集项目的Grid信息*/
|
|
|
Dictionary<string, Dictionary<string, string>> SiItem;
|
|
|
int CloumnCount = 0;
|
|
|
- /*需要重绘的Cell*/
|
|
|
- Dictionary<DataGridViewCell, bool> PaintCell = new Dictionary<DataGridViewCell, bool>();
|
|
|
//使用二维数组进行排序
|
|
|
ArrayList<ArrayList<string>> ScanData;
|
|
|
ArrayList<string> GetData;
|
|
|
@@ -537,20 +535,9 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
dt.Rows[i]["pib_lotno"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
|
|
|
dt.Rows[i]["pib_datecode"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
|
|
|
- //将采集数据正确的Cell添加到键值对中
|
|
|
- if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pr_vendprodcode"]))
|
|
|
- {
|
|
|
- PaintCell.Remove(LabelInf.Rows[i].Cells["pr_vendprodcode"]);
|
|
|
- }
|
|
|
- PaintCell.Add(LabelInf.Rows[i].Cells["pr_vendprodcode"], true);
|
|
|
- if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pib_qty"]))
|
|
|
- {
|
|
|
- PaintCell.Remove(LabelInf.Rows[i].Cells["pib_qty"]);
|
|
|
- }
|
|
|
- PaintCell.Add(LabelInf.Rows[i].Cells["pib_qty"], true);
|
|
|
- LabelInf.Refresh();
|
|
|
LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
|
|
|
LabelInf.Rows[i].Cells["Choose"].Value = true;
|
|
|
+ LabelInf.Invalidate();
|
|
|
//当前行的索引随循环增长
|
|
|
CurrentRowIndex = i;
|
|
|
if (SingleLabelAutoPrint.Checked)
|
|
|
@@ -576,20 +563,10 @@ namespace UAS_LabelMachine
|
|
|
dt.Rows[i]["pib_lotno"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
|
|
|
dt.Rows[i]["pib_datecode"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
|
|
|
CurrentRowIndex = i;
|
|
|
- //将采集数据正确的Cell添加到键值对中
|
|
|
- if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pr_vendprodcode"]))
|
|
|
- {
|
|
|
- PaintCell.Remove(LabelInf.Rows[i].Cells["pr_vendprodcode"]);
|
|
|
- }
|
|
|
- PaintCell.Add(LabelInf.Rows[i].Cells["pr_vendprodcode"], true);
|
|
|
- if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pib_qty"]))
|
|
|
- {
|
|
|
- PaintCell.Remove(LabelInf.Rows[i].Cells["pib_qty"]);
|
|
|
- }
|
|
|
- PaintCell.Add(LabelInf.Rows[i].Cells["pib_qty"], true);
|
|
|
LabelInf.Refresh();
|
|
|
LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
|
|
|
LabelInf.Rows[i].Cells["Choose"].Value = true;
|
|
|
+ LabelInf.Invalidate();
|
|
|
SetOutBoxCode2(true);
|
|
|
}
|
|
|
}
|
|
|
@@ -597,6 +574,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
|
|
|
+ LabelInf.Invalidate();
|
|
|
//勾选了单盘自动打印
|
|
|
if (SingleLabelAutoPrint.Checked)
|
|
|
{
|
|
|
@@ -772,17 +750,11 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
CollectVeProdCodePass = false;
|
|
|
//添加需要重绘的Cell
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, false);
|
|
|
LabelInf.Refresh();
|
|
|
MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, true);
|
|
|
LabelInf.Refresh();
|
|
|
CollectVeProdCodePass = true;
|
|
|
}
|
|
|
@@ -796,18 +768,11 @@ namespace UAS_LabelMachine
|
|
|
if (cell.Value.ToString() != Matchstr)
|
|
|
{
|
|
|
CollectQTYPass = false;
|
|
|
- //添加需要重绘的Cell
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, false);
|
|
|
LabelInf.Refresh();
|
|
|
MessageLog.AppendText(">>数量不匹配\n", Color.Red);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, true);
|
|
|
LabelInf.Refresh();
|
|
|
CollectQTYPass = true;
|
|
|
}
|
|
|
@@ -821,18 +786,11 @@ namespace UAS_LabelMachine
|
|
|
if (cell.Value.ToString() != Matchstr)
|
|
|
{
|
|
|
CollectQTYPass = false;
|
|
|
- //添加需要重绘的Cell
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, false);
|
|
|
LabelInf.Refresh();
|
|
|
MessageLog.AppendText(">>品牌不匹配\n", Color.Red);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (PaintCell.ContainsKey(cell))
|
|
|
- PaintCell.Remove(cell);
|
|
|
- PaintCell.Add(cell, true);
|
|
|
LabelInf.Refresh();
|
|
|
CollectQTYPass = true;
|
|
|
}
|
|
|
@@ -1148,7 +1106,7 @@ namespace UAS_LabelMachine
|
|
|
PI_ID = dt.Rows[0]["pi_id"].ToString();
|
|
|
if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
|
|
|
{
|
|
|
- string[] param = new string[] { PI_ID, "", "" };
|
|
|
+ string[] param = new string[] { PI_ID, "" };
|
|
|
dh.CallProcedure("GetCustBarcode", param);
|
|
|
}
|
|
|
LoadGridData(sender, e);
|
|
|
@@ -1520,6 +1478,7 @@ namespace UAS_LabelMachine
|
|
|
MessageBox.Show("单盘打印范围错误");
|
|
|
return;
|
|
|
}
|
|
|
+ LabelInf.Invalidate();
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
@@ -2054,38 +2013,18 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (e.RowIndex >= 0)
|
|
|
{
|
|
|
- //重绘制定的Cell,表示采集的数量不匹配
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_qty" && PaintCell.ContainsKey(LabelInf.Rows[e.RowIndex].Cells["pib_qty"]))
|
|
|
- {
|
|
|
- SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
|
|
|
- e.Graphics.FillRectangle(PaintCell[LabelInf.Rows[e.RowIndex].Cells["pib_qty"]] ? Brushes.ForestGreen : Brushes.Red, e.CellBounds);
|
|
|
- Rectangle border = e.CellBounds;
|
|
|
- border.Width -= 1;
|
|
|
- e.Graphics.DrawRectangle(Pens.Black, border);
|
|
|
- e.PaintContent(e.CellBounds);
|
|
|
- e.Handled = true;
|
|
|
- }
|
|
|
- //表示采集的供应商物料编号不匹配
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pr_vendprodcode" && PaintCell.ContainsKey(LabelInf.Rows[e.RowIndex].Cells["pr_vendprodcode"]))
|
|
|
+ if (LabelInf.Rows[e.RowIndex].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
|
|
|
{
|
|
|
- SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
|
|
|
- e.Graphics.FillRectangle(PaintCell[LabelInf.Rows[e.RowIndex].Cells["pr_vendprodcode"]] ? Brushes.ForestGreen : Brushes.Red, e.CellBounds);
|
|
|
- Rectangle border = e.CellBounds;
|
|
|
- border.Width -= 1;
|
|
|
- e.Graphics.DrawRectangle(Pens.Black, border);
|
|
|
- e.PaintContent(e.CellBounds);
|
|
|
- e.Handled = true;
|
|
|
- }
|
|
|
- //表示采集的供应商物料编号不匹配
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_brand" && PaintCell.ContainsKey(LabelInf.Rows[e.RowIndex].Cells["pib_brand"]))
|
|
|
- {
|
|
|
- SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
|
|
|
- e.Graphics.FillRectangle(PaintCell[LabelInf.Rows[e.RowIndex].Cells["pib_brand"]] ? Brushes.ForestGreen : Brushes.Red, e.CellBounds);
|
|
|
- Rectangle border = e.CellBounds;
|
|
|
- border.Width -= 1;
|
|
|
- e.Graphics.DrawRectangle(Pens.Black, border);
|
|
|
- e.PaintContent(e.CellBounds);
|
|
|
- e.Handled = true;
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
|
|
|
+ {
|
|
|
+ SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
|
|
|
+ e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
|
|
|
+ Rectangle border = e.CellBounds;
|
|
|
+ border.Width -= 1;
|
|
|
+ e.Graphics.DrawRectangle(Pens.Black, border);
|
|
|
+ e.PaintContent(e.CellBounds);
|
|
|
+ e.Handled = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|