Browse Source

条码生成管理

章政 6 years ago
parent
commit
663d78ecb6

+ 1 - 0
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -594,6 +594,7 @@
             this.ListButtonMenu.ItemHeight = 20;
             this.ListButtonMenu.Items.AddRange(new object[] {
             "采集策略设置",
+            "生成条码",
             "附加信息设置",
             "客户标签维护",
             "客户采集规则",

+ 35 - 20
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -333,6 +333,7 @@ namespace UAS_LabelMachine
                         }
                         break;
                     case "BackendCheck":
+
                         BackCheck.Text = msg;
                         if (BackendCheckFunction(msg, "Auto", out ErrorMsg))
                         {
@@ -347,22 +348,29 @@ namespace UAS_LabelMachine
                         }
                         break;
                     case "ManBackendCheck":
-                        BackCheck.Text = msg;
-                        if (BackendCheckFunction(msg, "Manual", out ErrorMsg))
+                        if (ManualBackCheck.Checked)
                         {
-                            ManualCheckCount.Add(1);
+                            BackCheck.Text = msg;
+                            if (BackendCheckFunction(msg, "Manual", out ErrorMsg))
+                            {
+                                ManualCheckCount.Add(1);
+                            }
+                            else
+                            {
+                                LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataDelete, adh);
+                                BaseUtil.PlaySound("Confirm.Error.wav");
+                                MessageLog.AppendText(">>" + ErrorMsg + "\n", Color.Red);
+                            }
+                            if (ManualCheckCount.Count == 2)
+                            {
+                                LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataPass, adh);
+                                BaseUtil.PlaySound("Confirm.Finish.wav");
+                                ManualCheckCount.Clear();
+                            }
                         }
                         else
                         {
-                            LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataDelete, adh);
-                            BaseUtil.PlaySound("Confirm.Error.wav");
-                            MessageLog.AppendText(">>" + ErrorMsg + "\n", Color.Red);
-                        }
-                        if (ManualCheckCount.Count == 2)
-                        {
-                            LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataPass, adh);
-                            BaseUtil.PlaySound("Confirm.Finish.wav");
-                            ManualCheckCount.Clear();
+                            MessageLog.AppendText(">>该串口为手动复核串口,请选择手动后端复核模式\n", Color.Red);
                         }
                         break;
                     default:
@@ -707,7 +715,6 @@ namespace UAS_LabelMachine
             //需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
             List<string> CheckItem = new List<string>();
             string pibid = "";
-         
             for (int i = 0; i < msgArr.Length; i++)
             {
                 if (RecheckCuprodcode.Checked)
@@ -1987,6 +1994,11 @@ namespace UAS_LabelMachine
                     BaseUtil.SetFormCenter(form);
                     form.ShowDialog();
                     break;
+                case "生成条码":
+                    生成条码 form3 = new 生成条码(pi_inoutno.Text);
+                    BaseUtil.SetFormCenter(form3);
+                    form3.ShowDialog();
+                    break;
                 case "附加信息设置":
                     if (pi_cardcode.Text != "")
                     {
@@ -2319,14 +2331,17 @@ namespace UAS_LabelMachine
 
         private void ManualCheck_CheckedChanged(object sender, EventArgs e)
         {
-            Control ctl = sender as Control;
-            switch (ctl.Name)
+            RadioButton ctl = sender as RadioButton;
+            if (ctl.Checked)
             {
-                case "ManualBackCheck":
-                    MessageLog.AppendText(">>切换为手动复核模式,需扫描两段数据\n", Color.Blue);
-                    break;
-                default:
-                    break;
+                switch (ctl.Name)
+                {
+                    case "ManualBackCheck":
+                        MessageLog.AppendText(">>切换为手动复核模式,需扫描两段数据\n", Color.Blue);
+                        break;
+                    default:
+                        break;
+                }
             }
         }
     }

+ 3 - 5
UAS-出货标签管理(吉利通)/生成条码.Designer.cs

@@ -243,18 +243,16 @@
             // 
             // pd_orderdetno
             // 
-            this.pd_orderdetno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.pd_orderdetno.DataPropertyName = "pd_orderdetno";
-            this.pd_orderdetno.HeaderText = "订单序号";
+            this.pd_orderdetno.HeaderText = "pd_orderdetno";
             this.pd_orderdetno.Name = "pd_orderdetno";
-            this.pd_orderdetno.Width = 78;
+            this.pd_orderdetno.Visible = false;
             // 
             // pd_pdno
             // 
             this.pd_pdno.DataPropertyName = "pd_pdno";
-            this.pd_pdno.HeaderText = "pd_pdno";
+            this.pd_pdno.HeaderText = "订单序号";
             this.pd_pdno.Name = "pd_pdno";
-            this.pd_pdno.Visible = false;
             // 
             // pr_id
             // 

+ 7 - 5
UAS-出货标签管理(吉利通)/生成条码.cs

@@ -90,11 +90,15 @@ namespace UAS_LabelMachine
         private void GenerateBarCode_Click(object sender, EventArgs e)
         {
             //获取编码规则
-            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + CustCode + "' order by nrd_detno", "select");
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + CustCode + "' order by nrd_detno", "select");
             //如果没有则取公共规则
             if (Nr.Rows.Count == 0)
-                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
             //用于过滤参数的正则表达式
+            if (Nr.Rows.Count > 0)
+            {
+                NrCode = Nr.Rows[0]["nr_code"].ToString();
+            }
             Regex match = new Regex("{\\w+}");
             //用于存放每一项的明细的数据
             string[] NrData = new string[Nr.Rows.Count];
@@ -147,7 +151,7 @@ namespace UAS_LabelMachine
                         break;
                     //流水需要通过MaxNumber去取
                     case "流水":
-                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + CustCode + "'").ToString();
+                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
                         Suffix = "";
                         PrefixFixed = Prefix;
                         //设置当前流水
@@ -438,8 +442,6 @@ namespace UAS_LabelMachine
         {
             //获取客户编号
             CustCode = dh.getFieldDataByCondition("ProdInOut", "pi_cardcode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
-            //获取编码规则编号
-            NrCode = dh.getFieldDataByCondition("NoRule", "nr_code", "nr_custcode='" + CustCode + "'").ToString();
             //用于存放每一项的明细的数据
             dt = (DataTable)dh.ExecuteSql("select pi_class,pi_id from prodinout where pi_inoutno='" + pi_inoutno.Text + "'", "select");
             if (dt.Rows.Count > 0)