|
|
@@ -103,7 +103,7 @@ namespace UAS_LabelMachine
|
|
|
sg_brand.SetValueField = new string[] { "sg_brand" };
|
|
|
sg_brand.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
|
|
|
sg_brand.TableName = "scangroup";
|
|
|
- sg_brand.DbChange += Sg_code_DbChange;
|
|
|
+ sg_brand.DbChange += Sg_brand_DbChange;
|
|
|
|
|
|
pr_code.FormName = Name;
|
|
|
pr_code.SetValueField = new string[] { "pr_code" };
|
|
|
@@ -115,8 +115,6 @@ namespace UAS_LabelMachine
|
|
|
cu_code.TableName = "customer";
|
|
|
cu_code.SelectField = "cu_code # 客户编号,cu_name # 客户名称";
|
|
|
|
|
|
-
|
|
|
- CollectionUnit.Text = "盘";
|
|
|
Point pt = new Point();
|
|
|
//禁止所有列的排序
|
|
|
foreach (DataGridViewColumn dgv in LabelInf.Columns)
|
|
|
@@ -134,7 +132,7 @@ namespace UAS_LabelMachine
|
|
|
asc.controlAutoSize(this);
|
|
|
}
|
|
|
|
|
|
- private void Sg_code_DbChange(object sender, EventArgs e)
|
|
|
+ private void Sg_brand_DbChange(object sender, EventArgs e)
|
|
|
{
|
|
|
DataTable dt = sg_brand.ReturnData;
|
|
|
BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
@@ -163,7 +161,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
采集策略 form = new 采集策略(sg_brand.Text);
|
|
|
form.WindowState = FormWindowState.Maximized;
|
|
|
- form.FormClosed += sg_code_UserControlTextChanged;
|
|
|
+ form.FormClosed += sg_brand_UserControlTextChanged;
|
|
|
BaseUtil.SetFormCenter(form);
|
|
|
form.ShowDialog();
|
|
|
}
|
|
|
@@ -189,7 +187,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
|
|
|
//放大镜选择后出发的事件
|
|
|
- private void sg_code_UserControlTextChanged(object sender, EventArgs e)
|
|
|
+ private void sg_brand_UserControlTextChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
//取已启用的的按照采集次序排序
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_brand='" + sg_brand.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
|
|
|
@@ -230,7 +228,7 @@ namespace UAS_LabelMachine
|
|
|
if (ScanData.ToArray().Length > 0)
|
|
|
{
|
|
|
object[] arr = (ScanData.ToArray()[0] as ArrayList<string>).ToArray();
|
|
|
- if (arr.Contains("MPN"))
|
|
|
+ if (arr.Contains("MPN") || arr.Contains("CPN"))
|
|
|
{
|
|
|
AutoMatch.CheckState = CheckState.Checked;
|
|
|
AutoMatch.Enabled = true;
|
|
|
@@ -292,15 +290,17 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
for (int j = 0; j < arr.Length; j++)
|
|
|
{
|
|
|
- if (LabelInf.Rows[i].Cells["pr_orispeccode"].Value.ToString() == MatchStr(arr[j].ToString(), "MPN") && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
|
|
|
- {
|
|
|
- CurrentRowIndex = i;
|
|
|
- FindAutoMatch = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "CPN") && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
|
|
|
+ string orispeccode = LabelInf.Rows[i].Cells["pr_orispeccode"].Value.ToString();
|
|
|
+ if ((MatchStr(arr[j].ToString(), "MPN").Contains(orispeccode) || MatchStr(arr[j].ToString(), "MPN").Trim().Contains(orispeccode) || orispeccode == MatchStr(arr[j].ToString(), "MPN") || LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "CPN")) && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
|
|
|
{
|
|
|
CurrentRowIndex = i;
|
|
|
+ if (CurrentRowIndex - 5 > 0)
|
|
|
+ LabelInf.FirstDisplayedScrollingRowIndex = CurrentRowIndex - 5;
|
|
|
+ else
|
|
|
+ LabelInf.FirstDisplayedScrollingRowIndex = 0;
|
|
|
+ Brand = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].FormattedValue.ToString();
|
|
|
+ if (Brand != "")
|
|
|
+ sg_brand.Text = Brand;
|
|
|
FindAutoMatch = true;
|
|
|
break;
|
|
|
}
|
|
|
@@ -407,48 +407,14 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
//如果按盒号采集,所有的此盒的均更新为
|
|
|
DataTable dt = (DataTable)MidSource.DataSource;
|
|
|
- if (CollectionUnit.Text == "盒")
|
|
|
- {
|
|
|
- for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
- {
|
|
|
- dt.Rows[i]["pib_lotno"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
|
|
|
- dt.Rows[i]["pib_datecode"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
|
|
|
- dt.Rows[i]["pib_datecode1"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode1"].Value;
|
|
|
- LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
|
|
|
- LabelInf.Rows[i].Cells["Choose"].Value = true;
|
|
|
- LabelInf.Invalidate();
|
|
|
- //当前行的索引随循环增长
|
|
|
- CurrentRowIndex = i;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else if (CollectionUnit.Text == "全部")
|
|
|
- {
|
|
|
- for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
- {
|
|
|
- dt.Rows[i]["pib_lotno"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
|
|
|
- dt.Rows[i]["pib_datecode"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
|
|
|
- dt.Rows[i]["pib_datecode1"] = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode1"].Value;
|
|
|
- CurrentRowIndex = i;
|
|
|
- LabelInf.Refresh();
|
|
|
- LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
|
|
|
- LabelInf.Rows[i].Cells["Choose"].Value = true;
|
|
|
- LabelInf.Invalidate();
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
|
|
|
- string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
- string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
|
|
|
- string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
- ErrorType.Clear();
|
|
|
- dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
- LabelInf.Invalidate();
|
|
|
- }
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
|
|
|
+ string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
+ string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
|
|
|
+ string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
+ ErrorType.Clear();
|
|
|
+ dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
+ LabelInf.Invalidate();
|
|
|
}
|
|
|
//采集未通过的时候
|
|
|
else
|
|
|
@@ -549,19 +515,19 @@ namespace UAS_LabelMachine
|
|
|
cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_orispeccode"];
|
|
|
Matchstr = MatchStr(data[j], "MPN");
|
|
|
//采集的供应商号不匹配的话
|
|
|
- if (cell.Value.ToString() != Matchstr)
|
|
|
+ if (cell.Value.ToString() == Matchstr || Matchstr.Trim().Contains(cell.Value.ToString()) || Matchstr.Contains(cell.Value.ToString()))
|
|
|
{
|
|
|
- ErrorType.Add("NG_MPN");
|
|
|
- CollectVeProdCodePass = false;
|
|
|
- //添加需要重绘的Cell
|
|
|
+ ErrorType.Add("OK_MPN");
|
|
|
LabelInf.Refresh();
|
|
|
- MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
|
|
|
+ CollectVeProdCodePass = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ErrorType.Add("OK_MPN");
|
|
|
+ ErrorType.Add("NG_MPN");
|
|
|
+ CollectVeProdCodePass = false;
|
|
|
+ //添加需要重绘的Cell
|
|
|
LabelInf.Refresh();
|
|
|
- CollectVeProdCodePass = true;
|
|
|
+ MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
|
|
|
}
|
|
|
setdata.Remove("MPN");
|
|
|
length--;
|