|
|
@@ -84,17 +84,15 @@ namespace UAS_MES.Make
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pa_makecode,pa_standardqty,pa_status,pa_packageqty,pa_currentqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
|
|
|
+ sql.Append("select pa_makecode,pa_id,pa_standardqty,pa_status,pa_packageqty,pa_currentqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
|
|
|
sql.Append("from package where pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type =3");
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
BaseUtil.SetFormValue(Controls, dt);
|
|
|
LoadGridData();
|
|
|
- dt = dh.getFieldsDataByCondition("Package", new string[] { "pa_standardqty", "pa_id" }, "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
pa_stanqty = int.Parse(dt.Rows[0]["pa_standardqty"].ToString());
|
|
|
pa_id = dt.Rows[0]["pa_id"].ToString();
|
|
|
- FillPrintLabel();
|
|
|
outboxcode.Focus();
|
|
|
}
|
|
|
else outboxcode.Focus();
|
|
|
@@ -114,16 +112,24 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pd_makecode pa_makecode,pa_id,pd_prodcode pa_prodcode,pa_mothercode,pa_status,pa_nextstep,nvl(pr_palletqty,0) pa_standardqty from packagedetail ");
|
|
|
+ sql.Append("select pd_makecode pa_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_id,pd_prodcode pa_prodcode,pa_mothercode,pa_status,pa_nextstep,nvl(pr_palletqty,0) pa_standardqty from packagedetail ");
|
|
|
sql.Append("left join package on pd_paid=pa_id left join product on pr_code=pd_prodcode where pd_outboxcode='" + outboxcode.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
+ if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "下地状态不允许采集\n", Color.Red, outboxcode);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (dt.Rows[0]["pa_mothercode"].ToString() != "")
|
|
|
{
|
|
|
- pa_outboxcode.Text = dt.Rows[0]["pa_mothercode"].ToString();
|
|
|
- palletcode_KeyDown(sender, e);
|
|
|
+ if (pa_outboxcode.Text == "")
|
|
|
+ {
|
|
|
+ pa_outboxcode.Text = dt.Rows[0]["pa_mothercode"].ToString();
|
|
|
+ palletcode_KeyDown(sender, e);
|
|
|
+ }
|
|
|
}
|
|
|
pa_nextstep = dt.Rows[0]["pa_nextstep"].ToString();
|
|
|
pa_stanqty = int.Parse(dt.Rows[0]["pa_standardqty"].ToString());
|
|
|
@@ -250,7 +256,13 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else OperateResult.AppendText(">>箱号" + outboxcode.Text + "尚未封箱\n", Color.Red, outboxcode);
|
|
|
}
|
|
|
- else OperateResult.AppendText(">>箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_mothercode"].ToString() == pa_outboxcode.Text)
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "已在本栈板内\n", Color.Red, outboxcode);
|
|
|
+ else
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "已采集至栈板" + dt.Rows[0]["pa_mothercode"].ToString() + "\n", Color.Red, outboxcode);
|
|
|
+ }
|
|
|
}
|
|
|
else OperateResult.AppendText(">>箱号" + outboxcode.Text + "不存在\n", Color.Red, outboxcode);
|
|
|
}
|
|
|
@@ -314,8 +326,11 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
|
|
|
doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
|
|
|
Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text));
|
|
|
- pa_outboxcode.Focus();
|
|
|
- pa_outboxcode.SelectAll();
|
|
|
+ if (!AutoOutBoxCode.Checked)
|
|
|
+ {
|
|
|
+ pa_outboxcode.Focus();
|
|
|
+ pa_outboxcode.SelectAll();
|
|
|
+ }
|
|
|
}
|
|
|
else OperateResult.AppendText(">>必须封栈板才能进行打印\n", Color.Red);
|
|
|
}
|