浏览代码

完成采集策略的基础数据维护

章政 7 年之前
父节点
当前提交
3d2119a0b2

+ 3 - 3
UAS-出货标签管理(吉利通)/CustomControl/GroupBoxWithBorder.cs

@@ -18,9 +18,9 @@ namespace UAS_LabelMachine.CustomControl.GroupBoxWithBorder
             Pen LineColor = Pens.Gray;
             e.Graphics.DrawLine(LineColor, 1, 7, 8, 7);
             e.Graphics.DrawLine(LineColor, e.Graphics.MeasureString(this.Text, this.Font).Width + 8, 7, this.Width - 2, 7);
-            //e.Graphics.DrawLine(LineColor, 1, 7, 1, this.Height - 2);
-            //e.Graphics.DrawLine(LineColor, 1, this.Height - 2, this.Width - 2, this.Height - 2);
-            //e.Graphics.DrawLine(LineColor, this.Width - 2, 7, this.Width - 2, this.Height - 2);
+            e.Graphics.DrawLine(LineColor, 1, 7, 1, this.Height - 2);
+            e.Graphics.DrawLine(LineColor, 1, this.Height - 2, this.Width - 2, this.Height - 2);
+            e.Graphics.DrawLine(LineColor, this.Width - 2, 7, this.Width - 2, this.Height - 2);
         }
     }
 }

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

@@ -140,8 +140,6 @@
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -177,7 +175,6 @@
             this.label6 = new System.Windows.Forms.Label();
             this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
-            this.OutBoxLabelPackage = new System.Windows.Forms.Button();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
@@ -1174,8 +1171,6 @@
             this.pr_unit,
             this.pib_lotno,
             this.pib_datecode,
-            this.pib_cusbarcode,
-            this.pib_cusoutboxcode,
             this.pib_datecode1,
             this.pib_qty,
             this.pib_barcode,
@@ -1300,20 +1295,6 @@
             this.pib_datecode.Name = "pib_datecode";
             this.pib_datecode.Width = 78;
             // 
-            // pib_cusbarcode
-            // 
-            this.pib_cusbarcode.DataPropertyName = "pib_cusbarcode";
-            this.pib_cusbarcode.HeaderText = "ViVo条码号";
-            this.pib_cusbarcode.Name = "pib_cusbarcode";
-            this.pib_cusbarcode.Width = 90;
-            // 
-            // pib_cusoutboxcode
-            // 
-            this.pib_cusoutboxcode.DataPropertyName = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.HeaderText = "ViVo外箱";
-            this.pib_cusoutboxcode.Name = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.Width = 78;
-            // 
             // pib_datecode1
             // 
             this.pib_datecode1.DataPropertyName = "pib_datecode1";
@@ -1611,7 +1592,6 @@
             this.OutBoxLabel.Controls.Add(this.label6);
             this.OutBoxLabel.Controls.Add(this.OutBoxPrinter);
             this.OutBoxLabel.Controls.Add(this.OutboxCapacity);
-            this.OutBoxLabel.Controls.Add(this.OutBoxLabelPackage);
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelAutoPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
@@ -1705,18 +1685,6 @@
             0});
             this.OutboxCapacity.Leave += new System.EventHandler(this.MidBoxCapacity_Leave);
             // 
-            // OutBoxLabelPackage
-            // 
-            this.OutBoxLabelPackage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPackage.Location = new System.Drawing.Point(89, 113);
-            this.OutBoxLabelPackage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.OutBoxLabelPackage.Name = "OutBoxLabelPackage";
-            this.OutBoxLabelPackage.Size = new System.Drawing.Size(75, 26);
-            this.OutBoxLabelPackage.TabIndex = 81;
-            this.OutBoxLabelPackage.Text = "Vivo打印";
-            this.OutBoxLabelPackage.UseVisualStyleBackColor = true;
-            this.OutBoxLabelPackage.Click += new System.EventHandler(this.OutBoxLabelPackage_Click);
-            // 
             // OutBoxLabelPrint
             // 
             this.OutBoxLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -1856,7 +1824,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.NumericUpDown OutboxCapacity;
-        private System.Windows.Forms.Button OutBoxLabelPackage;
         private System.Windows.Forms.CheckBox OutBoxLabelAutoPrint;
         private System.Windows.Forms.ComboBox MidLabelCombox;
         private System.Windows.Forms.CheckBox MidLabelAutoPrint;
@@ -1950,6 +1917,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn si_item;
         private System.Windows.Forms.DataGridViewTextBoxColumn si_expressionitem;
         private System.Windows.Forms.Label pi_date;
+        private System.Windows.Forms.Button CleanBarCode;
+        private System.Windows.Forms.ListBox ListButtonMenu;
+        private System.Windows.Forms.Button ButtonSetting;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
@@ -1963,8 +1936,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_cusbarcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_cusoutboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
@@ -1975,11 +1946,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.Button CleanBarCode;
-        private System.Windows.Forms.ListBox ListButtonMenu;
-        private System.Windows.Forms.Button ButtonSetting;
-        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
-        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
-        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
     }
 }

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

@@ -2080,14 +2080,6 @@ namespace UAS_LabelMachine
             pr_code.Condition = "  pd_inoutno='" + pi_inoutno.Text + "'";
         }
 
-        private void OutBoxLabelPackage_Click(object sender, EventArgs e)
-        {
-            thread = new Thread(CusLabelPrint);
-            stw = new SetLoadingWindow(thread, "正在打印客户外箱号");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
-        }
-
         private void CusLabelPrint()
         {
             //MaxOutBoxCode = MaxOutBoxCode + 1;

+ 0 - 6
UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx

@@ -162,12 +162,6 @@
   <metadata name="pr_unit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pib_cusbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_cusoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="pib_datecode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 15 - 0
UAS-出货标签管理(吉利通)/采集策略_NEW.Designer.cs

@@ -155,6 +155,7 @@
             // 
             // si_name1
             // 
+            this.si_name1.Enabled = false;
             this.si_name1.Location = new System.Drawing.Point(557, 199);
             this.si_name1.Name = "si_name1";
             this.si_name1.Size = new System.Drawing.Size(65, 21);
@@ -162,6 +163,7 @@
             // 
             // si_name6
             // 
+            this.si_name6.Enabled = false;
             this.si_name6.Location = new System.Drawing.Point(557, 580);
             this.si_name6.Name = "si_name6";
             this.si_name6.Size = new System.Drawing.Size(65, 21);
@@ -169,6 +171,7 @@
             // 
             // si_name5
             // 
+            this.si_name5.Enabled = false;
             this.si_name5.Location = new System.Drawing.Point(557, 549);
             this.si_name5.Name = "si_name5";
             this.si_name5.Size = new System.Drawing.Size(65, 21);
@@ -176,6 +179,7 @@
             // 
             // si_name4
             // 
+            this.si_name4.Enabled = false;
             this.si_name4.Location = new System.Drawing.Point(557, 399);
             this.si_name4.Name = "si_name4";
             this.si_name4.Size = new System.Drawing.Size(65, 21);
@@ -183,6 +187,7 @@
             // 
             // si_name3
             // 
+            this.si_name3.Enabled = false;
             this.si_name3.Location = new System.Drawing.Point(557, 256);
             this.si_name3.Name = "si_name3";
             this.si_name3.Size = new System.Drawing.Size(65, 21);
@@ -190,6 +195,7 @@
             // 
             // si_name2
             // 
+            this.si_name2.Enabled = false;
             this.si_name2.Location = new System.Drawing.Point(557, 228);
             this.si_name2.Name = "si_name2";
             this.si_name2.Size = new System.Drawing.Size(65, 21);
@@ -317,6 +323,7 @@
             // 
             // si_remark2
             // 
+            this.si_remark2.Enabled = false;
             this.si_remark2.Location = new System.Drawing.Point(710, 228);
             this.si_remark2.Name = "si_remark2";
             this.si_remark2.Size = new System.Drawing.Size(195, 21);
@@ -324,6 +331,7 @@
             // 
             // si_remark3
             // 
+            this.si_remark3.Enabled = false;
             this.si_remark3.Location = new System.Drawing.Point(710, 256);
             this.si_remark3.Name = "si_remark3";
             this.si_remark3.Size = new System.Drawing.Size(195, 21);
@@ -331,6 +339,7 @@
             // 
             // si_remark4
             // 
+            this.si_remark4.Enabled = false;
             this.si_remark4.Location = new System.Drawing.Point(710, 399);
             this.si_remark4.Name = "si_remark4";
             this.si_remark4.Size = new System.Drawing.Size(195, 21);
@@ -338,6 +347,7 @@
             // 
             // si_remark5
             // 
+            this.si_remark5.Enabled = false;
             this.si_remark5.Location = new System.Drawing.Point(710, 549);
             this.si_remark5.Name = "si_remark5";
             this.si_remark5.Size = new System.Drawing.Size(195, 21);
@@ -345,6 +355,7 @@
             // 
             // si_remark6
             // 
+            this.si_remark6.Enabled = false;
             this.si_remark6.Location = new System.Drawing.Point(710, 580);
             this.si_remark6.Name = "si_remark6";
             this.si_remark6.Size = new System.Drawing.Size(195, 21);
@@ -352,6 +363,7 @@
             // 
             // si_remark1
             // 
+            this.si_remark1.Enabled = false;
             this.si_remark1.Location = new System.Drawing.Point(710, 199);
             this.si_remark1.Name = "si_remark1";
             this.si_remark1.Size = new System.Drawing.Size(195, 21);
@@ -399,6 +411,7 @@
             // 
             // sg_name
             // 
+            this.sg_name.Enabled = false;
             this.sg_name.Location = new System.Drawing.Point(409, 49);
             this.sg_name.Name = "sg_name";
             this.sg_name.Size = new System.Drawing.Size(195, 21);
@@ -434,6 +447,7 @@
             // 
             // si_expression4
             // 
+            this.si_expression4.Enabled = false;
             this.si_expression4.Location = new System.Drawing.Point(467, 457);
             this.si_expression4.Name = "si_expression4";
             this.si_expression4.Size = new System.Drawing.Size(438, 79);
@@ -442,6 +456,7 @@
             // 
             // si_expression3
             // 
+            this.si_expression3.Enabled = false;
             this.si_expression3.Location = new System.Drawing.Point(467, 309);
             this.si_expression3.Name = "si_expression3";
             this.si_expression3.Size = new System.Drawing.Size(438, 79);

+ 87 - 7
UAS-出货标签管理(吉利通)/采集策略_NEW.cs

@@ -40,6 +40,7 @@ namespace UAS_LabelMachine
         }
 
         string SGID = "0";
+        string SGBrand = "";
 
         private void CustomerTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
         {
@@ -67,6 +68,9 @@ namespace UAS_LabelMachine
                         e.Node.Nodes.Add(tn);
                     }
                 }
+                SGBrand = e.Node.Text;
+                SGID = "0";
+                CleanFormData();
             }
             //节点为子节点的时候查询界面的值
             if (e.Node.Level == 1)
@@ -97,21 +101,21 @@ namespace UAS_LabelMachine
 
         private void ButtonSaveScanGroup_Click(object sender, EventArgs e)
         {
-            //每次保存的时候明细删除重新插入
-            dh.ExecuteSql("delete from scanitem where si_sgid=" + SGID, "delete");
-            //更新主表数据
-            sql.Clear();
-            sql.Append("update scangroup set sg_name=:sg_name,sg_script=:sg_script,sg_step=:sg_step,sg_autolabel=:sg_autolabel where sg_id=" + SGID);
-            dh.ExecuteSql(sql.ToString(), "update", sg_name, sg_script.Text, sg_step.Value, sg_autolabel.Checked ? "-1" : "0");
             string[] si_item = new string[6];
             string[] si_name = new string[6];
             string[] si_remark = new string[6];
             string[] si_expression = new string[6];
             string[] si_enable = new string[6];
             //用数组的方式记录批量插入
+            string sgname = "";
             for (int i = 0; i < 6; i++)
             {
                 si_enable[i] = (Controls["si_item" + (i + 1)] as CheckBox).Checked ? "-1" : "0";
+                //如果是-1则拼接名称
+                if (si_enable[i] == "-1")
+                {
+                    sgname += Controls["si_name" + (i + 1)].Text.ToString() + "+";
+                }
                 si_item[i] = Controls["si_item" + (i + 1)].Tag.ToString();
                 si_name[i] = Controls["si_name" + (i + 1)].Text;
                 si_remark[i] = Controls["si_remark" + (i + 1)].Text;
@@ -120,6 +124,32 @@ namespace UAS_LabelMachine
                 else
                     si_expression[i] = "";
             }
+            try
+            {
+                sgname = sgname.Substring(0, sgname.LastIndexOf("+"));
+            }
+            catch (Exception)
+            {
+
+            }
+            if (SGID == "0")
+            {
+                if (!dh.CheckExist("scangroup", "sg_name='" + sgname + "' and sg_brand='" + SGBrand + "'"))
+                {
+                    SGID = dh.GetSEQ("scangroup_seq");
+                    dh.ExecuteSql("insert into scangroup(sg_id,sg_brand)values(" + SGID + ",'" + SGBrand + "')", "insert");
+                }
+                else
+                {
+                    SGID = dh.getFieldDataByCondition("scangroup", "sg_id", "sg_name='" + sgname + "' and sg_brand='" + SGBrand + "'").ToString();
+                }
+            }
+            //每次保存的时候明细删除重新插入
+            dh.ExecuteSql("delete from scanitem where si_sgid=" + SGID, "delete");
+            //更新主表数据
+            sql.Clear();
+            sql.Append("update scangroup set sg_name=:sg_name,sg_script=:sg_script,sg_step=:sg_step,sg_autolabel=:sg_autolabel where sg_id=" + SGID);
+            dh.ExecuteSql(sql.ToString(), "update", sgname, sg_script.Text, sg_step.Value, sg_autolabel.Checked ? "-1" : "0");
             sql.Clear();
             sql.Append("insert into scanitem(si_id,si_sgid,si_item,si_expression,si_remark,si_name,");
             sql.Append("si_enable) values(scanitem_seq.nextval,'" + SGID + "',:si_item,:si_expression,:si_remark,:si_name,:si_enable)");
@@ -130,11 +160,61 @@ namespace UAS_LabelMachine
         private void CheckChange(object sender, EventArgs e)
         {
             CheckBox cb = (CheckBox)sender;
-            switch (cb.Text)
+            int index = 0;
+            switch (cb.Tag.ToString())
             {
+                case "Order":
+                    index = 1;
+                    break;
+                case "PN":
+                    index = 2;
+                    break;
+                case "QTY":
+                    index = 3;
+                    break;
+                case "DateCode":
+                    index = 4;
+                    break;
+                case "LotNo":
+                    index = 5;
+                    break;
+                case "OutBox":
+                    index = 6;
+                    break;
                 default:
                     break;
             }
+            if (cb.Checked)
+            {
+                Controls["si_name" + index].Enabled = true;
+                Controls["si_remark" + index].Enabled = true;
+                if (Controls["si_expression" + index] != null)
+                    Controls["si_expression" + index].Enabled = true;
+            }
+            else
+            {
+
+                Controls["si_name" + index].Enabled = false;
+                Controls["si_remark" + index].Enabled = false;
+                if (Controls["si_expression" + index] != null)
+                    Controls["si_expression" + index].Enabled = false;
+            }
+        }
+
+        private void CleanFormData()
+        {
+            sg_name.Text = "";
+            sg_script.Text = "";
+            sg_step.Value = 0;
+            sg_autolabel.Checked = false;
+            for (int i = 0; i < 6; i++)
+            {
+                (Controls["si_item" + (i + 1)] as CheckBox).Checked = false;
+                Controls["si_name" + (i + 1)].Text = "";
+                Controls["si_remark" + (i + 1)].Text = "";
+                if (Controls["si_expression" + (i + 1)] != null)
+                    Controls["si_expression" + (i + 1)].Text = "";
+            }
         }
     }
 }