|
@ -28,6 +28,7 @@ namespace PaintingPC |
|
|
private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>(); |
|
|
private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>(); |
|
|
private string _foreighColor = string.Empty; |
|
|
private string _foreighColor = string.Empty; |
|
|
private string _lineCode = string.Empty; |
|
|
private string _lineCode = string.Empty; |
|
|
|
|
|
private string _stationType = string.Empty; |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 从tb_ForeignColorMap表得到的零件号
|
|
|
/// 从tb_ForeignColorMap表得到的零件号
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -42,6 +43,7 @@ namespace PaintingPC |
|
|
this.Size = new Size(1280, 1020); |
|
|
this.Size = new Size(1280, 1020); |
|
|
this._isWmsQuality = isWmsQuality; |
|
|
this._isWmsQuality = isWmsQuality; |
|
|
_lineCode = ConfigurationManager.AppSettings["LineCode"].ToString(); |
|
|
_lineCode = ConfigurationManager.AppSettings["LineCode"].ToString(); |
|
|
|
|
|
_stationType = ConfigurationManager.AppSettings["Position"].ToString(); |
|
|
string disableButtons = ConfigurationManager.AppSettings["DisableButtons"].ToString(); |
|
|
string disableButtons = ConfigurationManager.AppSettings["DisableButtons"].ToString(); |
|
|
if (!string.IsNullOrEmpty(disableButtons)) |
|
|
if (!string.IsNullOrEmpty(disableButtons)) |
|
|
{ |
|
|
{ |
|
@ -73,7 +75,11 @@ namespace PaintingPC |
|
|
// if(_lineCode == "2")
|
|
|
// if(_lineCode == "2")
|
|
|
// {
|
|
|
// {
|
|
|
HidenColorSelect(true); |
|
|
HidenColorSelect(true); |
|
|
|
|
|
if(_stationType == "下线一检") |
|
|
|
|
|
{ |
|
|
btnAllowChangeColor.Visible = true; |
|
|
btnAllowChangeColor.Visible = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// }
|
|
|
// }
|
|
|
} |
|
|
} |
|
|
void HidenColorSelect(bool isHidden) |
|
|
void HidenColorSelect(bool isHidden) |
|
@ -111,7 +117,7 @@ namespace PaintingPC |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
string title = ConfigurationManager.AppSettings["Position"].ToString(); |
|
|
string title = _stationType; |
|
|
string workClass = Function.GetWorkClass2(); |
|
|
string workClass = Function.GetWorkClass2(); |
|
|
string station = ConfigurationManager.AppSettings["Station"].ToString(); |
|
|
string station = ConfigurationManager.AppSettings["Station"].ToString(); |
|
|
|
|
|
|
|
@ -624,6 +630,16 @@ namespace PaintingPC |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
string bcode = txtBarCode.Text.Trim(); |
|
|
string bcode = txtBarCode.Text.Trim(); |
|
|
|
|
|
|
|
|
|
|
|
bool ispass = ScanCodeValidVerify(bcode); |
|
|
|
|
|
if (ispass == false) |
|
|
|
|
|
{ |
|
|
|
|
|
txtBarCode.SelectAll(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//保存
|
|
|
//保存
|
|
|
string id = SaveInspect(state, colorName, partName, userName); |
|
|
string id = SaveInspect(state, colorName, partName, userName); |
|
|
|
|
|
|
|
@ -819,7 +835,7 @@ namespace PaintingPC |
|
|
InspectModel model1 = new InspectModel(); |
|
|
InspectModel model1 = new InspectModel(); |
|
|
|
|
|
|
|
|
model1.barcode = Function.UniteBarCodeToOne(txtBarCode.Text.Trim()); |
|
|
model1.barcode = Function.UniteBarCodeToOne(txtBarCode.Text.Trim()); |
|
|
model1.position = "下线质检"; |
|
|
model1.position = _stationType; |
|
|
model1.stationNo = labStation.Text; |
|
|
model1.stationNo = labStation.Text; |
|
|
model1.workClass = labWorkClass.Text; |
|
|
model1.workClass = labWorkClass.Text; |
|
|
model1.inspectResult =inspectResult; |
|
|
model1.inspectResult =inspectResult; |
|
@ -964,6 +980,12 @@ namespace PaintingPC |
|
|
txtBarCode.Text = ""; |
|
|
txtBarCode.Text = ""; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
bool ispass = ScanCodeValidVerify(barcode); |
|
|
|
|
|
if (ispass == false) |
|
|
|
|
|
{ |
|
|
|
|
|
txtBarCode.SelectAll(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
|
if (_isWmsQuality) |
|
|
if (_isWmsQuality) |
|
@ -1026,6 +1048,11 @@ namespace PaintingPC |
|
|
DataTable dt3 = Function.SearchDefectInfo(ConfigurationManager.AppSettings["Station"].Trim()); |
|
|
DataTable dt3 = Function.SearchDefectInfo(ConfigurationManager.AppSettings["Station"].Trim()); |
|
|
if (dt3 != null && dt3.Rows.Count > 0) |
|
|
if (dt3 != null && dt3.Rows.Count > 0) |
|
|
{ |
|
|
{ |
|
|
|
|
|
DataRow newRow = dt3.NewRow(); |
|
|
|
|
|
newRow.ItemArray = dt3.Rows[0].ItemArray; |
|
|
|
|
|
newRow["DefectName"] = "点修补"; |
|
|
|
|
|
dt3.Rows.InsertAt(newRow, 0); |
|
|
|
|
|
|
|
|
drow = Convert.ToInt32(Math.Ceiling((double)dt3.Rows.Count / dcol)); |
|
|
drow = Convert.ToInt32(Math.Ceiling((double)dt3.Rows.Count / dcol)); |
|
|
Label[] dLb = new Label[7]; |
|
|
Label[] dLb = new Label[7]; |
|
|
string[] dstr = new string[dt3.Rows.Count]; |
|
|
string[] dstr = new string[dt3.Rows.Count]; |
|
@ -1042,6 +1069,19 @@ namespace PaintingPC |
|
|
dLb[i] = new Label(); |
|
|
dLb[i] = new Label(); |
|
|
if ((i + dcol * j) < dstr.Length) |
|
|
if ((i + dcol * j) < dstr.Length) |
|
|
{ |
|
|
{ |
|
|
|
|
|
//if(i==0 && j == 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// Label lbl = new Label();
|
|
|
|
|
|
// lbl.Text = "点修补";
|
|
|
|
|
|
// lbl.Font = new Font(dLb[i].Font.FontFamily, 36, FontStyle.Bold);
|
|
|
|
|
|
// lbl.Size = new Size(170, 60);
|
|
|
|
|
|
// lbl.Location = new Point(20 + i * (dLb[i].Size.Width + 25), 5 + j * (dLb[i].Size.Height + 20));
|
|
|
|
|
|
// lbl.BorderStyle = BorderStyle.FixedSingle;
|
|
|
|
|
|
// lbl.BackColor = Color.Red;
|
|
|
|
|
|
// lbl.TextAlign = ContentAlignment.MiddleCenter;
|
|
|
|
|
|
// panel2.Controls.Add(lbl);
|
|
|
|
|
|
// continue;
|
|
|
|
|
|
//}
|
|
|
dLb[i].Text = dstr[i + dcol * j].ToString(); |
|
|
dLb[i].Text = dstr[i + dcol * j].ToString(); |
|
|
dLb[i].Font = new Font(dLb[i].Font.FontFamily, 24, FontStyle.Bold); |
|
|
dLb[i].Font = new Font(dLb[i].Font.FontFamily, 24, FontStyle.Bold); |
|
|
dLb[i].Size = new Size(150, 50); |
|
|
dLb[i].Size = new Size(150, 50); |
|
@ -1049,6 +1089,13 @@ namespace PaintingPC |
|
|
dLb[i].BorderStyle = BorderStyle.FixedSingle; |
|
|
dLb[i].BorderStyle = BorderStyle.FixedSingle; |
|
|
dLb[i].BackColor = Color.Transparent; |
|
|
dLb[i].BackColor = Color.Transparent; |
|
|
dLb[i].TextAlign = ContentAlignment.MiddleCenter; |
|
|
dLb[i].TextAlign = ContentAlignment.MiddleCenter; |
|
|
|
|
|
|
|
|
|
|
|
if (dLb[i].Text.Contains("点修补")) |
|
|
|
|
|
{ |
|
|
|
|
|
dLb[i].Font = new Font(dLb[i].Font.FontFamily, 36, FontStyle.Bold); |
|
|
|
|
|
dLb[i].Size = new Size(170, 60); |
|
|
|
|
|
dLb[i].ForeColor = Color.Blue; |
|
|
|
|
|
} |
|
|
panel2.Controls.Add(dLb[i]); |
|
|
panel2.Controls.Add(dLb[i]); |
|
|
dLb[i].Click += new EventHandler(dLbRoom_Click); |
|
|
dLb[i].Click += new EventHandler(dLbRoom_Click); |
|
|
} |
|
|
} |
|
@ -1287,6 +1334,99 @@ namespace PaintingPC |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool ScanCodeValidVerify(string barcode) |
|
|
|
|
|
{ |
|
|
|
|
|
string position = _stationType; |
|
|
|
|
|
switch (position) |
|
|
|
|
|
{ |
|
|
|
|
|
case "下线一检": return First(barcode); |
|
|
|
|
|
case "下线二检": return Second(barcode);break; |
|
|
|
|
|
case "点修补": return Third(barcode); |
|
|
|
|
|
default:return true; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool First(string barcode) |
|
|
|
|
|
{ |
|
|
|
|
|
DataTable dt = Function.GetLastResult(barcode); |
|
|
|
|
|
if (dt.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("扫描条码["+ barcode + "]已存在质检记录,无法在[下线一检]工位进行重新扫码." , false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool Second(string barcode) |
|
|
|
|
|
{ |
|
|
|
|
|
DataTable dt = Function.GetLastResult(barcode); |
|
|
|
|
|
if (dt.Rows.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("扫描条码[" + barcode + "]不存在[下线一检]记录,无法在[下线二检]工位进行扫码.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
DataRow dr = dt.Rows[0]; |
|
|
|
|
|
if (dr["reason"].ToString().Contains("点修补") && dr["inspectResult"].ToString().Contains("其它")) |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("扫描条码[" + barcode + "]上次质量判定为[点修补],无法进行二检扫码.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if (dr["inspectResult"].ToString().Contains("报废")) |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("上次质量判定为[报废],无法进行二检扫码.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 点修补扫码校验
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="barcode"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private bool Third(string barcode) |
|
|
|
|
|
{ |
|
|
|
|
|
string errorMsg = string.Empty; |
|
|
|
|
|
bool isExsit = Function. GetPointRepairFrWms(barcode, ref errorMsg); |
|
|
|
|
|
if(isExsit == false) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(errorMsg)) |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("在wms系统的查询返修出库记录时发生错误,错误原因:"+errorMsg, false); |
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
ShowHint("没有在wms系统的返修出库记录,无法进行点修补.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
DataTable dt = Function.GetLastResult(barcode); |
|
|
|
|
|
if (dt.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
if(dt.Rows[0]["reason"].ToString().Contains("点修补") && dt.Rows[0]["inspectResult"].ToString().Contains("其它")) |
|
|
|
|
|
{ |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("必须上次质量判定记录为点修补,类型为其它,才能在当前[点修补]工位扫码.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
ShowHint("没有初始质量判定记录,无法在[点修补]工位扫码.", false); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 设置按钮不可用
|
|
|
/// 设置按钮不可用
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|