章政 8 жил өмнө
parent
commit
c9ed0c8169

+ 16 - 12
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -128,23 +128,27 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        //判断线外,必须已完工并且未入库
-                        dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view  left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
-                        if (dt.Rows[0][0].ToString() == "")
+                        //未空表示线外
+                        if (pa_nextstep == "")
                         {
-                            //判断未入库
-                            dt = (DataTable)dh.ExecuteSql("select count(1) from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_iostatus,0)<>0", "select");
-                            if (dt.Rows[0][0].ToString() != "0")
+                            //判断线外,必须已完工并且未入库
+                            dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view  left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
+                            if (dt.Rows[0][0].ToString() == "")
                             {
-                                OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "已入库,不允许装箱\n", Color.Red);
+                                //判断箱未入库
+                                dt = (DataTable)dh.ExecuteSql("select count(1) from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_iostatus,0)<>0", "select");
+                                if (dt.Rows[0][0].ToString() != "0")
+                                {
+                                    OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "已入库,不允许装箱\n", Color.Red);
+                                    return;
+                                }
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "尚未完工\n", Color.Red);
                                 return;
                             }
                         }
-                        else
-                        {
-                            OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "尚未完工\n", Color.Red);
-                            return;
-                        }
                     }
                     if (!dh.CheckExist("package", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2"))
                     {