|
|
@@ -33,6 +33,7 @@ namespace UAS_MES.Make
|
|
|
|
|
|
string oMsId = "";
|
|
|
|
|
|
+ bool onlyPass = false;
|
|
|
bool hasSnList = false;//记录是否有转换后SN清单
|
|
|
|
|
|
bool hasMakeRule = false;//记录是否有工单防呆规则
|
|
|
@@ -163,6 +164,7 @@ namespace UAS_MES.Make
|
|
|
show_sncode.Text = bsncode;
|
|
|
OperateResult.AppendText(">>请输入SN号\n", Color.Green, sncode);
|
|
|
ChangeResult.Enabled = false;
|
|
|
+ onlyPass = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -206,8 +208,9 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
//防呆验证完成
|
|
|
- if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_id='" + oMsId + "' and ms_sncode='" + sncode.Text + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'") || (!ChangeResult.Checked && (bsncode == sncode.Text)))
|
|
|
+ if ((!ChangeResult.Checked && (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "'") && !onlyPass || onlyPass && bsncode == sncode.Text)) || (ChangeResult.Checked && !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "'")))
|
|
|
{
|
|
|
+ onlyPass = false;
|
|
|
string firstsn = "";
|
|
|
string updateSql = "";
|
|
|
//勾选了修改转换结果
|
|
|
@@ -256,7 +259,16 @@ namespace UAS_MES.Make
|
|
|
ChangeResult.Enabled = true;
|
|
|
}
|
|
|
else
|
|
|
- OperateResult.AppendText("<<序列号" + sncode.Text + "已存在,请输入其他序列号\n", Color.Red);
|
|
|
+ {
|
|
|
+ if (onlyPass)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<SN号"+sncode.Text+"错误,已完成转号只允许SN转SN\n", Color.Red);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<SN号" + sncode.Text + "已存在,请输入其他序列号\n", Color.Red);
|
|
|
+ }
|
|
|
+ }
|
|
|
sncode.Text = "";
|
|
|
}
|
|
|
}
|
|
|
@@ -284,6 +296,7 @@ namespace UAS_MES.Make
|
|
|
bsncode = "";
|
|
|
OperateResult.AppendText(">>请输入TSN号\n", Color.Green, show_sncode);
|
|
|
ChangeResult.Enabled = true;
|
|
|
+ onlyPass = false;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 工单号keydown
|