|
|
@@ -141,8 +141,9 @@ namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
pa_makecode.Text = dt.Rows[0]["pd_makecode"].ToString();
|
|
|
- if (!Cancel.Checked) {
|
|
|
- if (!CheckBoxNum())
|
|
|
+ if (!Cancel.Checked)
|
|
|
+ {
|
|
|
+ if (!CheckBoxNum() && CheckBox.Checked)
|
|
|
{
|
|
|
OperateResult.AppendText(">>采集箱号" + outboxcode.Text + "不连续\n", Color.Red, outboxcode);
|
|
|
return;
|
|
|
@@ -218,7 +219,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
}
|
|
|
if (!Cancel.Checked)
|
|
|
{
|
|
|
- if (!CheckBoxNum())
|
|
|
+ if (!CheckBoxNum() && CheckBox.Checked)
|
|
|
{
|
|
|
OperateResult.AppendText(">>采集箱号" + outboxcode.Text + "不连续\n", Color.Red, outboxcode);
|
|
|
return;
|
|
|
@@ -401,7 +402,8 @@ namespace UAS_MES_NEW.Packing
|
|
|
dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_makecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
|
|
|
}
|
|
|
BaseUtil.FillDgvWithDataTable(PackageInf, dt);
|
|
|
- if (PackageInf.RowCount > 0) {
|
|
|
+ if (PackageInf.RowCount > 0)
|
|
|
+ {
|
|
|
PackageInf.FirstDisplayedScrollingRowIndex = PackageInf.RowCount - 1;
|
|
|
}
|
|
|
}
|
|
|
@@ -493,26 +495,32 @@ namespace UAS_MES_NEW.Packing
|
|
|
}
|
|
|
else OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
private bool CheckBoxNum()
|
|
|
{
|
|
|
- string maxbox = dh.getFieldDataByCondition("packagedetail left join package on PD_INNERBOXCODE=pa_outboxcode", "max(pa_zxcode)", "pd_makecode='" + pa_makecode.Text + "'").ToString();
|
|
|
+ string maxbox = dh.getFieldDataByCondition("packagedetail left join package on PD_INNERBOXCODE=pa_outboxcode left join source on sc_code=pa_sccode", "max(pa_zxcode)", "pd_makecode='" + pa_makecode.Text + "' and sc_linecode='" + User.UserLineCode + "'").ToString();
|
|
|
+ //已经装箱的最大箱号
|
|
|
int maxnum = 0;
|
|
|
+ //当前装箱的箱号流水
|
|
|
int currentnum = 0;
|
|
|
if (maxbox != "")
|
|
|
{
|
|
|
maxnum = int.Parse(maxbox.Substring(maxbox.Length - 4));
|
|
|
}
|
|
|
- string currentbox = dh.getFieldDataByCondition("package", "(pa_zxcode)", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
|
|
|
+ string currentbox = dh.getFieldDataByCondition("package left join source on sc_code=pa_sccode", "(pa_zxcode)", "pa_outboxcode='" + outboxcode.Text + "' and sc_linecode='" + User.UserLineCode + "'").ToString();
|
|
|
if (currentbox != "")
|
|
|
{
|
|
|
currentnum = int.Parse(currentbox.Substring(currentbox.Length - 4));
|
|
|
}
|
|
|
+ //如果和前面的箱号连续
|
|
|
if ((maxnum + 1) == currentnum)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
+ //如果是换线的话,比如从2001开始的流水
|
|
|
+ if (maxnum == 0 && currentnum > 1)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
//outboxcode.Text
|
|
|
return false;
|
|
|
}
|