Browse Source

解析型号

callm 1 year ago
parent
commit
47dfb5c507

+ 99 - 74
UAS_BARCODEIO/入库条码规则解析.Designer.cs

@@ -32,6 +32,13 @@
             this.pi_inoutno = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.Prodiodetail = new System.Windows.Forms.DataGridView();
+            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bi_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.PR_CODE = new System.Windows.Forms.TextBox();
             this.label3 = new System.Windows.Forms.Label();
             this.INQTY = new System.Windows.Forms.TextBox();
@@ -60,13 +67,8 @@
             this.label9 = new System.Windows.Forms.Label();
             this.es_custcode = new UAS_BARCODEIO.SearchTextBox();
             this.ChooseAll = new System.Windows.Forms.Button();
-            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_orispeccode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bi_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode2 = new System.Windows.Forms.TextBox();
+            this.原厂型号 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Prodiodetail)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.BarcodeIO)).BeginInit();
             this.SuspendLayout();
@@ -125,9 +127,70 @@
             this.Prodiodetail.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.Prodiodetail_CellPainting);
             this.Prodiodetail.SelectionChanged += new System.EventHandler(this.Prodiodetail_SelectionChanged);
             // 
+            // pd_prodcode
+            // 
+            this.pd_prodcode.DataPropertyName = "pd_prodcode";
+            this.pd_prodcode.HeaderText = "物料编号";
+            this.pd_prodcode.MinimumWidth = 10;
+            this.pd_prodcode.Name = "pd_prodcode";
+            this.pd_prodcode.ReadOnly = true;
+            this.pd_prodcode.Width = 200;
+            // 
+            // pr_orispeccode1
+            // 
+            this.pr_orispeccode1.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode1.HeaderText = "原厂型号";
+            this.pr_orispeccode1.MinimumWidth = 10;
+            this.pr_orispeccode1.Name = "pr_orispeccode1";
+            this.pr_orispeccode1.Width = 200;
+            // 
+            // pr_brand
+            // 
+            this.pr_brand.DataPropertyName = "pr_brand";
+            this.pr_brand.HeaderText = "品牌";
+            this.pr_brand.MinimumWidth = 10;
+            this.pr_brand.Name = "pr_brand";
+            this.pr_brand.Width = 200;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "物料名称";
+            this.pr_detail.MinimumWidth = 10;
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.ReadOnly = true;
+            this.pr_detail.Width = 200;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "物料规格";
+            this.pr_spec.MinimumWidth = 10;
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.ReadOnly = true;
+            this.pr_spec.Width = 200;
+            // 
+            // pd_inqty
+            // 
+            this.pd_inqty.DataPropertyName = "pd_inqty";
+            this.pd_inqty.HeaderText = "入库数量";
+            this.pd_inqty.MinimumWidth = 10;
+            this.pd_inqty.Name = "pd_inqty";
+            this.pd_inqty.ReadOnly = true;
+            this.pd_inqty.Width = 200;
+            // 
+            // bi_inqty
+            // 
+            this.bi_inqty.DataPropertyName = "bi_inqty";
+            this.bi_inqty.HeaderText = "已生成条码数量";
+            this.bi_inqty.MinimumWidth = 10;
+            this.bi_inqty.Name = "bi_inqty";
+            this.bi_inqty.ReadOnly = true;
+            this.bi_inqty.Width = 200;
+            // 
             // PR_CODE
             // 
-            this.PR_CODE.Location = new System.Drawing.Point(168, 771);
+            this.PR_CODE.Location = new System.Drawing.Point(168, 763);
             this.PR_CODE.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.PR_CODE.Name = "PR_CODE";
             this.PR_CODE.Size = new System.Drawing.Size(436, 35);
@@ -137,7 +200,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(27, 768);
+            this.label3.Location = new System.Drawing.Point(27, 760);
             this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(133, 38);
@@ -146,7 +209,7 @@
             // 
             // INQTY
             // 
-            this.INQTY.Location = new System.Drawing.Point(168, 851);
+            this.INQTY.Location = new System.Drawing.Point(168, 895);
             this.INQTY.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.INQTY.Name = "INQTY";
             this.INQTY.Size = new System.Drawing.Size(436, 35);
@@ -156,7 +219,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(27, 848);
+            this.label4.Location = new System.Drawing.Point(27, 892);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(133, 38);
@@ -165,7 +228,7 @@
             // 
             // DC
             // 
-            this.DC.Location = new System.Drawing.Point(168, 929);
+            this.DC.Location = new System.Drawing.Point(168, 973);
             this.DC.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.DC.Name = "DC";
             this.DC.Size = new System.Drawing.Size(436, 35);
@@ -175,7 +238,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(27, 926);
+            this.label5.Location = new System.Drawing.Point(27, 970);
             this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(58, 38);
@@ -184,7 +247,7 @@
             // 
             // LOTNO
             // 
-            this.LOTNO.Location = new System.Drawing.Point(168, 1013);
+            this.LOTNO.Location = new System.Drawing.Point(168, 1057);
             this.LOTNO.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.LOTNO.Name = "LOTNO";
             this.LOTNO.Size = new System.Drawing.Size(436, 35);
@@ -194,7 +257,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(27, 1010);
+            this.label6.Location = new System.Drawing.Point(27, 1054);
             this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(103, 38);
@@ -203,7 +266,7 @@
             // 
             // ZXBZ
             // 
-            this.ZXBZ.Location = new System.Drawing.Point(168, 1097);
+            this.ZXBZ.Location = new System.Drawing.Point(168, 1141);
             this.ZXBZ.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ZXBZ.Name = "ZXBZ";
             this.ZXBZ.Size = new System.Drawing.Size(436, 35);
@@ -213,7 +276,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(27, 1094);
+            this.label7.Location = new System.Drawing.Point(27, 1138);
             this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(133, 38);
@@ -402,72 +465,32 @@
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             // 
-            // pd_prodcode
-            // 
-            this.pd_prodcode.DataPropertyName = "pd_prodcode";
-            this.pd_prodcode.HeaderText = "物料编号";
-            this.pd_prodcode.MinimumWidth = 10;
-            this.pd_prodcode.Name = "pd_prodcode";
-            this.pd_prodcode.ReadOnly = true;
-            this.pd_prodcode.Width = 200;
-            // 
-            // pr_orispeccode1
-            // 
-            this.pr_orispeccode1.DataPropertyName = "pr_orispeccode";
-            this.pr_orispeccode1.HeaderText = "原厂型号";
-            this.pr_orispeccode1.MinimumWidth = 10;
-            this.pr_orispeccode1.Name = "pr_orispeccode1";
-            this.pr_orispeccode1.Width = 200;
-            // 
-            // pr_brand
-            // 
-            this.pr_brand.DataPropertyName = "pr_brand";
-            this.pr_brand.HeaderText = "品牌";
-            this.pr_brand.MinimumWidth = 10;
-            this.pr_brand.Name = "pr_brand";
-            this.pr_brand.Width = 200;
-            // 
-            // pr_detail
+            // pr_orispeccode2
             // 
-            this.pr_detail.DataPropertyName = "pr_detail";
-            this.pr_detail.HeaderText = "物料名称";
-            this.pr_detail.MinimumWidth = 10;
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.ReadOnly = true;
-            this.pr_detail.Width = 200;
+            this.pr_orispeccode2.Location = new System.Drawing.Point(168, 829);
+            this.pr_orispeccode2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.pr_orispeccode2.Name = "pr_orispeccode2";
+            this.pr_orispeccode2.Size = new System.Drawing.Size(436, 35);
+            this.pr_orispeccode2.TabIndex = 41;
             // 
-            // pr_spec
+            // 原厂型号
             // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "物料规格";
-            this.pr_spec.MinimumWidth = 10;
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.ReadOnly = true;
-            this.pr_spec.Width = 200;
-            // 
-            // pd_inqty
-            // 
-            this.pd_inqty.DataPropertyName = "pd_inqty";
-            this.pd_inqty.HeaderText = "入库数量";
-            this.pd_inqty.MinimumWidth = 10;
-            this.pd_inqty.Name = "pd_inqty";
-            this.pd_inqty.ReadOnly = true;
-            this.pd_inqty.Width = 200;
-            // 
-            // bi_inqty
-            // 
-            this.bi_inqty.DataPropertyName = "bi_inqty";
-            this.bi_inqty.HeaderText = "已生成条码数量";
-            this.bi_inqty.MinimumWidth = 10;
-            this.bi_inqty.Name = "bi_inqty";
-            this.bi_inqty.ReadOnly = true;
-            this.bi_inqty.Width = 200;
+            this.原厂型号.AutoSize = true;
+            this.原厂型号.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.原厂型号.Location = new System.Drawing.Point(27, 826);
+            this.原厂型号.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.原厂型号.Name = "原厂型号";
+            this.原厂型号.Size = new System.Drawing.Size(133, 38);
+            this.原厂型号.TabIndex = 40;
+            this.原厂型号.Text = "原厂型号";
             // 
             // 入库条码规则解析
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2136, 1225);
+            this.Controls.Add(this.pr_orispeccode2);
+            this.Controls.Add(this.原厂型号);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.label9);
             this.Controls.Add(this.PrinterList);
@@ -545,6 +568,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_inqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_inqty;
+        private System.Windows.Forms.TextBox pr_orispeccode2;
+        private System.Windows.Forms.Label 原厂型号;
     }
 }
 

+ 8 - 7
UAS_BARCODEIO/入库条码规则解析.cs

@@ -100,9 +100,9 @@ namespace UAS_BARCODEIO
         private void LoadGridData()
         {
             string sql = "select pd_inqty,pd_prodcode,pr_detail,pr_orispeccode,pr_spec,bi_inqty,pr_brand from " +
-                "(select max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pd_prodcode=pr_code where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode)" +
-                " left join (select max(bi_prodcode)bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio left join product on pr_code=bi_prodcode" +
-                "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode order by pr_code";
+                "(select max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pd_prodcode=pr_code where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pr_brand)" +
+                " left join (select max(bi_prodcode)bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio left join product on pr_code=bi_prodcode " +
+                "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pr_brand) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode order by pr_code";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             BaseUtil.FillDgvWithDataTable(Prodiodetail, dt);
         }
@@ -139,7 +139,7 @@ namespace UAS_BARCODEIO
                             DC.Text = str[int.Parse(index) - 1];
                             break;
                         case "PROD":
-                            PR_CODE.Text = str[int.Parse(index) - 1];
+                            pr_orispeccode2.Text = str[int.Parse(index) - 1];
                             break;
                         case "QTY":
                             INQTY.Text = str[int.Parse(index) - 1];
@@ -202,10 +202,10 @@ namespace UAS_BARCODEIO
         private void GenBarCode_Click(object sender, EventArgs e)
         {
             string sql = "select pr_zxbzs,pd_piid,pd_piclass,pd_inqty,pd_prodcode,pr_detail,pr_spec,nvl(bi_inqty,0)bi_inqty from " +
-               "(select max(pd_piid)pd_piid,max(pd_piclass)pd_piclass,max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pr_code=pd_prodcode where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode)" +
+               "(select max(pd_piid)pd_piid,max(pd_piclass)pd_piclass,max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pr_code=pd_prodcode where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pr_brand)" +
                " left join (select max(bi_prodcode)bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio left join product on pr_code=bi_prodcode " +
-               "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode " +
-               "where pd_prodcode='" + PR_CODE.Text + "'";
+               "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pr_brand) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode " +
+               "where pr_code='" + PR_CODE.Text + "'";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             if (dt.Rows.Count == 0)
             {
@@ -351,6 +351,7 @@ namespace UAS_BARCODEIO
                 LoadBarcodeioData(Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString());
                 Console.WriteLine(Prodiodetail.Rows[e.RowIndex].Cells["pr_brand"].Value.ToString());
                 es_custcode.Text = Prodiodetail.Rows[e.RowIndex].Cells["pr_brand"].Value.ToString();
+                PR_CODE.Text= Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString();
                 LoadBarcodeioData(Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString());
             }
         }

+ 48 - 0
UAS_BARCODEIO/入库条码规则解析.resx

@@ -138,6 +138,54 @@
   <metadata name="bi_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_orispeccode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_brand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="CheckBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_inqty1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_vendbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_madedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="CheckBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>