|
|
@@ -62,12 +62,14 @@ namespace UAS_MES_NEW.Query
|
|
|
|
|
|
private void Print_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- string makecode = dh.getFieldDataByCondition("package_view", "pa_makecode", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
|
|
|
- if (makecode != "")
|
|
|
+ DataTable dt = dh.getFieldsDataByCondition("package_view", new string[] { "pa_makecode", "pa_prodcode" }, "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ string pr_code = "";
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- ma_code.Text = makecode;
|
|
|
+ ma_code.Text = dt.Rows[0]["pa_makecode"].ToString();
|
|
|
+ pr_code = dt.Rows[0]["pa_prodcode"].ToString();
|
|
|
}
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select * from package_view where pa_makecode='" + ma_code.Text + "'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select * from package_view where pa_makecode='" + ma_code.Text + "'", "select");
|
|
|
string ErrorMessage = "";
|
|
|
string outboxcode = "";
|
|
|
if (dt.Rows.Count == 0)
|
|
|
@@ -86,11 +88,15 @@ namespace UAS_MES_NEW.Query
|
|
|
}
|
|
|
if (pa_outboxcode.Text != "")
|
|
|
{
|
|
|
- DataTable dt1 = (DataTable)dh.ExecuteSql("select * from packagedetail left join make on PD_MAKECODE||'-1'=ma_code left join craftmaterial on cm_sncode=pd_barcode where CM_PRDETAIL='CPU' and pd_makecode='" + ma_code.Text + "' and pd_outboxcode='" + pa_outboxcode.Text + "' and ma_prodcode in (select PC_CODE from pcba_cust) and cm_barcode is null", "select");
|
|
|
- if (dt1.Rows.Count > 0)
|
|
|
+ string WorkProcess = dh.getFieldDataByCondition("configs", "data", "CODE='WorkProcess' and caller='MESSetting'").ToString();
|
|
|
+ if (WorkProcess == "1")
|
|
|
{
|
|
|
- OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "CPU关键物料绑定不完整,不允许打印\n", Color.Black);
|
|
|
- return;
|
|
|
+ string Err = "";
|
|
|
+ if (!LogicHandler.CheckSNInfo(pa_outboxcode.Text, pr_code, ma_code.Text.Replace("-1", ""), "客户端", out Err))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>" + Err + "\n", Color.Black);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
@@ -99,7 +105,7 @@ namespace UAS_MES_NEW.Query
|
|
|
if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, outboxcode, 1, "", "", "卡通箱标", "0", out ErrorMessage))
|
|
|
{
|
|
|
OperateResult.AppendText(">>开始打印箱号" + outboxcode + "\n", Color.Black);
|
|
|
- LogicHandler.DoCommandLog("LabelPrint", User.UserCode, makecode, User.UserLineCode, User.UserSourceCode, "包装标签打印", "打印成功", outboxcode, "");
|
|
|
+ LogicHandler.DoCommandLog("LabelPrint", User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "包装标签打印", "打印成功", outboxcode, "");
|
|
|
}
|
|
|
}
|
|
|
}
|