Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

章政 8 years ago
parent
commit
8aefe8bb5a

+ 2 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.Designer.cs

@@ -59,8 +59,9 @@
             this.lock_outbox.AutoSize = true;
             this.lock_outbox.Location = new System.Drawing.Point(342, 35);
             this.lock_outbox.Name = "lock_outbox";
-            this.lock_outbox.Size = new System.Drawing.Size(22, 21);
+            this.lock_outbox.Size = new System.Drawing.Size(70, 22);
             this.lock_outbox.TabIndex = 2;
+            this.lock_outbox.Text = "锁定";
             this.lock_outbox.UseVisualStyleBackColor = true;
             this.lock_outbox.CheckedChanged += new System.EventHandler(this.lock_outbox_CheckedChanged);
             // 

+ 7 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.cs

@@ -100,7 +100,7 @@ namespace UAS_MES.Packing
                     //删除明细
                     dh.ExecuteSql("delete from packagedetail where pd_id='"+pd_id+"'", "select");
                     //更新序列号
-                    dh.ExecuteSql("update makeserial set ms_outboxcode='' where ms_id='"+ms_id+"'", "update");
+                    dh.ExecuteSql("update makeserial set ms_outboxcode='' , ms_nextstepcode=ms_stepcode where ms_id='"+ms_id+"'", "update");
                     //更新箱内当前数量
                     dh.ExecuteSql("update package set pa_currentqty=pa_currentqty-1 where pa_outboxcode='"+pa_outboxcode.Text+"'", "update");
                     //记录拆箱操作日志
@@ -165,6 +165,12 @@ namespace UAS_MES.Packing
                     return false;
                 }
             }
+            //验证mothercode是否为空,有没有装大箱
+            if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "")
+            {
+                OperateResult.AppendText("<<卡通箱:" + pa_outboxcode.Text + "已装箱,不允许拆箱\n", Color.Red, sncode);
+                return false;
+            }
             return true;
         }
 

+ 17 - 2
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -38,6 +38,7 @@ namespace UAS_MES.Packing
         string new_pa_salecode;
         string new_pa_checkno;
         string new_ob_result;
+        string new_pa_mothercode;
 
         public Packing_CartonTransfer()
         {
@@ -113,15 +114,21 @@ namespace UAS_MES.Packing
                     if (ms_outboxcode != "")
                     {
                         sql.Clear();
-                        sql.Append("select pa_id,pa_checkno,PA_CURRENTQTY pa_qty,PA_PACKTYPE,nvl(PA_DOWNSTATUS,0) PA_DOWNSTATUS,pa_prodcode  pa_macode,pa_salecode,pa_level,pa_custcode,pa_type,pa_packtype from package where pa_outboxcode='" + ms_outboxcode + "'");
+                        sql.Append("select pa_id,pa_checkno,PA_CURRENTQTY pa_qty,PA_PACKTYPE,nvl(PA_DOWNSTATUS,0) PA_DOWNSTATUS,pa_prodcode  pa_macode,pa_salecode,pa_level,pa_custcode,pa_type,pa_packtype,pa_mothercode from package where pa_outboxcode='" + ms_outboxcode + "'");
                         dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dtbar.Rows.Count > 0)
                         {
+                            string pa_mothercode = dtbar.Rows[0]["pa_mothercode"].ToString();
                             string PA_PACKTYPE = dtbar.Rows[0]["PA_PACKTYPE"].ToString();
                             string pa_checkno = dtbar.Rows[0]["pa_checkno"].ToString();
                             string PA_DOWNSTATUS = dtbar.Rows[0]["PA_DOWNSTATUS"].ToString();
                             string old_pa_id = dtbar.Rows[0]["pa_id"].ToString();
                             string ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_result", "ob_checkno = '" + pa_checkno + "'").ToString();
+                            if (pa_mothercode != "")
+                            {
+                                OperateResult.AppendText(">>原箱" + ms_outboxcode + "已装入大箱,不允许转移\n", Color.Red, sn_code);
+                                return;
+                            }
                             if (PA_DOWNSTATUS == "0")
                             {
                                 BaseUtil.SetFormValue(this.Controls, dtbar);
@@ -304,7 +311,7 @@ namespace UAS_MES.Packing
         private Boolean CheckBoxCode()
         {
             sql.Clear();
-            sql.Append("select pa_id,pa_outboxcode,pa_checkno,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_packtype,pa_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_salecode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            sql.Append("select pa_id,pa_outboxcode,pa_checkno,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_packtype,pa_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_salecode,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -315,6 +322,7 @@ namespace UAS_MES.Packing
                 new_pa_prodcode = dt.Rows[0]["pa_prodcode"].ToString();
                 new_pa_salecode = dt.Rows[0]["pa_salecode"].ToString();
                 new_pa_checkno = dt.Rows[0]["pa_checkno"].ToString();
+                new_pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString();
                 new_ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_result", "ob_checkno = '" + new_pa_checkno + "'").ToString();
                 if (new_pa_downstatus != "0")
                 {
@@ -331,6 +339,13 @@ namespace UAS_MES.Packing
                     pa_outboxcode.Focus();
                     return false;
                 }
+                else if (new_pa_mothercode != "")
+                {
+                    OperateResult.AppendText(">>目标箱号" + pa_outboxcode.Text + "装入大箱\n", Color.Red, pa_outboxcode);
+                    OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+                    pa_outboxcode.Focus();
+                    return false;
+                }
                 BaseUtil.SetFormValue(this.Controls, dt);
                 return true;
             }