Ver Fonte

优化提示

yhluo há 2 dias atrás
pai
commit
84c3e9df7a

+ 10 - 2
UAS_MES_YTDZ/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -78,6 +78,7 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PackageCollectionWeigh_Load(object sender, EventArgs e)
         {
+            AutoGenBoxCode.Checked = true;
             ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
             Baurate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
             //设置DbFind的必须的数据
@@ -344,7 +345,7 @@ namespace UAS_MES_NEW.Packing
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         sql.Clear();
                         sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pr_code from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
@@ -393,7 +394,14 @@ namespace UAS_MES_NEW.Packing
                             {
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.DarkRed, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
                             }