|
|
@@ -193,10 +193,11 @@ namespace UAS_MES_NEW.Packing
|
|
|
//加载Grid数据
|
|
|
dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pd_makecode,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
|
|
|
BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
|
|
|
- if (PackageDetail.RowCount > 0) {
|
|
|
+ if (PackageDetail.RowCount > 0)
|
|
|
+ {
|
|
|
PackageDetail.FirstDisplayedScrollingRowIndex = PackageDetail.RowCount - 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
string choose_pd_barcode = dt.Rows[0]["pd_barcode"].ToString();
|
|
|
@@ -268,6 +269,11 @@ namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
|
|
|
{
|
|
|
+ string str = dh.getFieldDataByCondition("ztedata", "ZD_SN", "ZD_MAC_START='" + sn_code.Text + "'").ToString();
|
|
|
+ if (str != "")
|
|
|
+ {
|
|
|
+ sn_code.Text = str;
|
|
|
+ }
|
|
|
dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
|
|
|
if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
|
|
|
{
|
|
|
@@ -420,28 +426,28 @@ namespace UAS_MES_NEW.Packing
|
|
|
//如果未勾选了取消录入
|
|
|
if (!Cancel.Checked)
|
|
|
{
|
|
|
- if (inputweight.Text == "")
|
|
|
- {
|
|
|
- OperateResult.AppendText("请输入重量\n", Color.Green);
|
|
|
- inputweight.Focus();
|
|
|
- return;
|
|
|
- }
|
|
|
- double ActualWeight = double.Parse(inputweight.Text == "" ? "0" : inputweight.Text.Replace("kg", "").Replace("g", "").Trim());
|
|
|
- if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测检测合格\n", Color.Green);
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量合格", sn_code.Text, "");
|
|
|
- LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
- dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测未通过\n", Color.Red);
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量不合格", sn_code.Text, "");
|
|
|
- LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
- return;
|
|
|
- }
|
|
|
- inputweight.Text = "";
|
|
|
+ //if (inputweight.Text == "")
|
|
|
+ //{
|
|
|
+ // OperateResult.AppendText("请输入重量\n", Color.Green);
|
|
|
+ // inputweight.Focus();
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ //double ActualWeight = double.Parse(inputweight.Text == "" ? "0" : inputweight.Text.Replace("kg", "").Replace("g", "").Trim());
|
|
|
+ //if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
|
|
|
+ //{
|
|
|
+ // OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测检测合格\n", Color.Green);
|
|
|
+ // LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量合格", sn_code.Text, "");
|
|
|
+ // LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
+ // dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测未通过\n", Color.Red);
|
|
|
+ // LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量不合格", sn_code.Text, "");
|
|
|
+ // LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ //inputweight.Text = "";
|
|
|
|
|
|
//判断序列号是否已经装箱
|
|
|
string ms_outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
|