From 5811f0b9f7879766dc1f6166ad538f562cbce045 Mon Sep 17 00:00:00 2001 From: cdk <2441919651@qq.com> Date: 星期一, 30 六月 2025 15:41:44 +0800 Subject: [PATCH] 修改成扫码报工 --- GSBGBarcodeFrm.cs | 200 +++++++++++++++++++++++++------------------------ 1 files changed, 103 insertions(+), 97 deletions(-) diff --git a/GSBGBarcodeFrm.cs b/GSBGBarcodeFrm.cs index 77e129d..35209b5 100644 --- a/GSBGBarcodeFrm.cs +++ b/GSBGBarcodeFrm.cs @@ -42,8 +42,6 @@ private DataGridViewTextBoxColumn BianNo; private Label label9; private TextBox textBox5; - private Label label10; - private TextBox textBox6; private Label label8; private TextBox textBox4; private Label label7; @@ -51,8 +49,11 @@ private Label label6; private TextBox textBox2; private Timer timer2; - private TextBox textBox7; private Label label1; + private TextBox textBox6; + private Label label2; + private TextBox textBox7; + private DataTable tbBARDAB;//鏉$爜琛� String connectionString = "Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.19)(PORT =1521)))(CONNECT_DATA =(SERVICE_NAME = ORCL)));Persist Security Info=True;User Id = abtdev;Password=abt_dev"; //String connectionString = "Data Source = 192.168.1.19; Initial Catalog = abtdev; User ID = abtdev; Password=abt_dev"; #endregion @@ -98,9 +99,9 @@ { this.components = new System.ComponentModel.Container(); this.panel1 = new System.Windows.Forms.Panel(); + this.label2 = new System.Windows.Forms.Label(); this.textBox7 = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox5 = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); @@ -129,9 +130,9 @@ // // panel1 // + this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.textBox7); this.panel1.Controls.Add(this.label1); - this.panel1.Controls.Add(this.label10); this.panel1.Controls.Add(this.textBox6); this.panel1.Controls.Add(this.textBox5); this.panel1.Controls.Add(this.label9); @@ -148,21 +149,32 @@ this.panel1.ForeColor = System.Drawing.Color.Black; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1039, 449); + this.panel1.Size = new System.Drawing.Size(1356, 449); this.panel1.TabIndex = 0; this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(30, 361); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(79, 33); + this.label2.TabIndex = 23; + this.label2.Text = "鏁伴噺"; // // textBox7 // this.textBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox7.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox7.Location = new System.Drawing.Point(168, 382); + this.textBox7.Location = new System.Drawing.Point(170, 361); this.textBox7.Name = "textBox7"; this.textBox7.ReadOnly = true; - this.textBox7.Size = new System.Drawing.Size(815, 38); + this.textBox7.Size = new System.Drawing.Size(1131, 44); this.textBox7.TabIndex = 22; - this.textBox7.TextChanged += new System.EventHandler(this.textBox7_TextChanged); // // label1 // @@ -170,48 +182,32 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.Location = new System.Drawing.Point(30, 385); + this.label1.Location = new System.Drawing.Point(30, 361); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(120, 27); + this.label1.Size = new System.Drawing.Size(79, 33); this.label1.TabIndex = 23; - this.label1.Text = "宸叉姤宸ユ暟"; - this.label1.Click += new System.EventHandler(this.label1_Click); - // - // label10 - // - this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label10.AutoSize = true; - this.label10.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label10.Location = new System.Drawing.Point(30, 104); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(120, 27); - this.label10.TabIndex = 19; - this.label10.Text = "鎸囦护鍗曞彿"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.label10.Click += new System.EventHandler(this.label10_Click); + this.label1.Text = "鏁伴噺"; // // textBox6 // this.textBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox6.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox6.Location = new System.Drawing.Point(169, 101); + this.textBox6.Location = new System.Drawing.Point(170, 361); this.textBox6.Name = "textBox6"; this.textBox6.ReadOnly = true; - this.textBox6.Size = new System.Drawing.Size(815, 38); - this.textBox6.TabIndex = 18; - this.textBox6.TextChanged += new System.EventHandler(this.textBox6_TextChanged); + this.textBox6.Size = new System.Drawing.Size(1131, 44); + this.textBox6.TabIndex = 22; // // textBox5 // this.textBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox5.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox5.Location = new System.Drawing.Point(168, 321); + this.textBox5.Location = new System.Drawing.Point(169, 289); this.textBox5.Name = "textBox5"; this.textBox5.ReadOnly = true; - this.textBox5.Size = new System.Drawing.Size(816, 38); + this.textBox5.Size = new System.Drawing.Size(1132, 44); this.textBox5.TabIndex = 20; this.textBox5.TextChanged += new System.EventHandler(this.textBox5_TextChanged); // @@ -221,11 +217,11 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label9.AutoSize = true; this.label9.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label9.Location = new System.Drawing.Point(29, 324); + this.label9.Location = new System.Drawing.Point(30, 292); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(120, 27); + this.label9.Size = new System.Drawing.Size(79, 33); this.label9.TabIndex = 21; - this.label9.Text = "宸ュ崟鏁伴噺"; + this.label9.Text = "鍗曚綅"; this.label9.Click += new System.EventHandler(this.label9_Click); // // label8 @@ -234,9 +230,9 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label8.Location = new System.Drawing.Point(29, 271); + this.label8.Location = new System.Drawing.Point(30, 237); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(120, 27); + this.label8.Size = new System.Drawing.Size(143, 33); this.label8.TabIndex = 17; this.label8.Text = "浜у搧瑙勬牸"; // @@ -245,10 +241,10 @@ this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox4.Font = new System.Drawing.Font("瀹嬩綋", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox4.Location = new System.Drawing.Point(169, 268); + this.textBox4.Location = new System.Drawing.Point(170, 234); this.textBox4.Name = "textBox4"; this.textBox4.ReadOnly = true; - this.textBox4.Size = new System.Drawing.Size(815, 34); + this.textBox4.Size = new System.Drawing.Size(1132, 39); this.textBox4.TabIndex = 16; this.textBox4.TextChanged += new System.EventHandler(this.textBox4_TextChanged); // @@ -258,9 +254,9 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(30, 215); + this.label7.Location = new System.Drawing.Point(30, 175); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(120, 27); + this.label7.Size = new System.Drawing.Size(143, 33); this.label7.TabIndex = 15; this.label7.Text = "浜у搧鍚嶇О"; // @@ -269,10 +265,10 @@ this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox3.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox3.Location = new System.Drawing.Point(169, 212); + this.textBox3.Location = new System.Drawing.Point(169, 172); this.textBox3.Name = "textBox3"; this.textBox3.ReadOnly = true; - this.textBox3.Size = new System.Drawing.Size(815, 38); + this.textBox3.Size = new System.Drawing.Size(1132, 44); this.textBox3.TabIndex = 14; this.textBox3.TextChanged += new System.EventHandler(this.textBox3_TextChanged); // @@ -282,9 +278,9 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(30, 157); + this.label6.Location = new System.Drawing.Point(30, 115); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(120, 27); + this.label6.Size = new System.Drawing.Size(143, 33); this.label6.TabIndex = 13; this.label6.Text = "浜у搧缂栫爜"; // @@ -293,10 +289,10 @@ this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox2.Font = new System.Drawing.Font("瀹嬩綋", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox2.Location = new System.Drawing.Point(169, 154); + this.textBox2.Location = new System.Drawing.Point(169, 112); this.textBox2.Name = "textBox2"; this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(815, 38); + this.textBox2.Size = new System.Drawing.Size(1132, 44); this.textBox2.TabIndex = 12; // // textBox1 @@ -306,7 +302,7 @@ this.textBox1.Font = new System.Drawing.Font("瀹嬩綋", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox1.Location = new System.Drawing.Point(169, 42); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(815, 42); + this.textBox1.Size = new System.Drawing.Size(1132, 49); this.textBox1.TabIndex = 9; this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); // @@ -318,7 +314,7 @@ this.label5.Font = new System.Drawing.Font("瀹嬩綋", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Location = new System.Drawing.Point(29, 45); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(73, 30); + this.label5.Size = new System.Drawing.Size(87, 36); this.label5.TabIndex = 8; this.label5.Text = "鏉$爜"; this.label5.Click += new System.EventHandler(this.label5_Click); @@ -334,7 +330,7 @@ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(0, 449); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1039, 78); + this.panel2.Size = new System.Drawing.Size(1356, 260); this.panel2.TabIndex = 1; // // dataGridView1 @@ -349,7 +345,7 @@ this.dataGridView1.ReadOnly = true; this.dataGridView1.RowHeadersWidth = 51; this.dataGridView1.RowTemplate.Height = 27; - this.dataGridView1.Size = new System.Drawing.Size(1039, 78); + this.dataGridView1.Size = new System.Drawing.Size(1356, 260); this.dataGridView1.TabIndex = 0; this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); this.dataGridView1.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_ColumnHeaderMouseClick); @@ -383,11 +379,11 @@ // // GSBGBarcodeFrm // - this.ClientSize = new System.Drawing.Size(1039, 527); + this.ClientSize = new System.Drawing.Size(1356, 709); this.Controls.Add(this.panel2); this.Controls.Add(this.panel1); this.Name = "GSBGBarcodeFrm"; - this.Text = "浜х嚎鎶ュ伐"; + this.Text = "鎵爜鎶ュ伐"; this.Load += new System.EventHandler(this.GSBGBarcodeFrm_Load); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); @@ -404,31 +400,6 @@ private void GSBGBarcodeFrm_Load(object sender, EventArgs e) { this.textBox1.Focus(); - // TODO: 杩欒浠g爜灏嗘暟鎹姞杞藉埌琛ㄢ�渨eightCollectDataSet1.BGBarcode鈥濅腑銆傛偍鍙互鏍规嵁闇�瑕佺Щ鍔ㄦ垨鍒犻櫎瀹冦�� - //this.bGBarcodeTableAdapter.Fill(this.weightCollectDataSet1.BGBarcode); - //涓嬫媺閫夋嫨宸ュ崟 - //tbB = SQL.ExecuteDataTable("SELECT WORKNO FROM WORKN(NOLOCK)");//鏉$爜琛� - // tbB =OraSQL.ReturnDataSet("SELECT DAA001,DAA002,DAA003,DAA004,DAA006,DAA007,DAA008,DAA015,DAA021 FROM WOMDAA WHERE DAA006>SYSDATE-2", "WOMDAA").Tables[0]; - ////tbB.TableName = "WORKN"; - //foreach (DataRow dr in tbB.Rows) - //{ - // comboBox1.Items.Add(dr["DAA001"]); - //} - - //////涓嬫媺閫夋嫨浜х嚎 - ////tbC = OraSQL.ReturnDataSet("SELECT LinesName FROM XBNO", "XBNO").Tables[0];//绾垮埆琛� - ////foreach (DataRow dc in tbC.Rows) - ////{ - //// comboBox2.Items.Add(dc[0]); - ////} - - ////涓嬫媺閫夋嫨宸ヨ壓 - //tbD = OraSQL.ReturnDataSet("SELECT PolytechnicName FROM Polytechnic", "Polytechnic").Tables[0];//宸ヨ壓琛� - //foreach (DataRow dd in tbD.Rows) - //{ - // comboBox3.Items.Add(dd[0]); - //} - } #endregion @@ -437,27 +408,62 @@ { if (e.KeyChar == 13) { - SQL = new SQLHelper(connStr); - string sqlCommand = string.Format(@"EXEC dbo.[WMS_CREATE_SAOMIAOBG] '{0}'", textBox1.Text); - DataTable tb1 = SQL.ExecuteDataTable(sqlCommand); - b = b + 1; - //灏嗗�兼彃鍏ユ姤宸ュ璞$被涓� + string sqlstr = String.Format(@"SELECT * FROM BARDAB(NOLOCK) WHERE DAB001='{0}'", textBox1.Text.ToString()); + tbBARDAB = SQL.ExecuteDataTable(sqlstr); wc.BianNo = b.ToString(); //缂栧彿 wc.BarcodeNO = textBox1.Text.ToString(); //鏉$爜 - wc.CHEEKTIME = tb1.Rows[0]["STR2"].ToString(); //鏃堕棿 - wc.LinesName = tb1.Rows[0]["STR3"].ToString(); //宸ュ崟鍙� - wc.WorkNo = tb1.Rows[0]["STR4"].ToString(); //鎶ュ伐鏁伴噺 - wc.Product = tb1.Rows[0]["STR5"].ToString(); //缁撴灉 - wc.CheckCategory1 = tb1.Rows[0]["STR6"].ToString(); //閿欒淇℃伅 - textBox6.Text = tb1.Rows[0]["STR3"].ToString(); - textBox5.Text = tb1.Rows[0]["GSZS"].ToString(); - textBox7.Text = tb1.Rows[0]["BGZS"].ToString(); - textBox2.Text = tb1.Rows[0]["ITEMNO"].ToString(); - textBox3.Text = tb1.Rows[0]["ITEMNAME"].ToString(); - textBox4.Text = tb1.Rows[0]["ITEMMODEL"].ToString(); - InsertRowToDataTable(wc); + wc.CHEEKTIME = DateTime.Now.ToString(); //鏃堕棿 + wc.Product = ""; //缁撴灉 + wc.CheckCategory1 = ""; //閿欒淇℃伅 + + if (tbBARDAB.Rows.Count <= 0) + { + wc.LinesName = ""; //宸ュ崟鍙� + wc.WorkNo = ""; //鎶ュ伐鏁伴噺 + wc.Product = "鎶ュ伐澶辫触"; //缁撴灉 + wc.CheckCategory1 = "璇ユ潯鐮佷笉瀛樺湪"; //閿欒淇℃伅 + InsertRowToDataTable(wc); + textBox1.Text = ""; + return; + } + + wc.LinesName = tbBARDAB.Rows[0]["DAB031"].ToString(); //宸ュ崟鍙� + wc.WorkNo = tbBARDAB.Rows[0]["DAB005"].ToString(); //鎶ュ伐鏁伴噺 + if (tbBARDAB.Rows[0]["DAB049"].ToString() == "1") + { + + wc.Product = "鎶ュ伐澶辫触"; //缁撴灉 + wc.CheckCategory1 = "璇ユ潯鐮佸凡鎶ュ伐"; //閿欒淇℃伅 + InsertRowToDataTable(wc); + textBox1.Text = ""; + return; + } + textBox2.Text = tbBARDAB.Rows[0]["DAB020"].ToString(); + textBox3.Text = tbBARDAB.Rows[0]["DAB021"].ToString(); + textBox4.Text = tbBARDAB.Rows[0]["DAB008"].ToString(); + textBox5.Text = tbBARDAB.Rows[0]["DAB022"].ToString(); + textBox7.Text = tbBARDAB.Rows[0]["DAB005"].ToString(); + + string sqlstr2 = String.Format(@"EXEC WMS_CREATE_SAOMIAOBG '{0}'", textBox1.Text.ToString()); + DataTable table = SQL.ExecuteDataTable(sqlstr2); textBox1.Text = ""; - textBox1.Focus(); + this.textBox1.Focus(); + if(table!= null && table.Rows.Count > 0) + { + if(table.Rows[0]["RESULT"].ToString() == "1") + { + wc.Product = "鎶ュ伐澶辫触"; //缁撴灉 + wc.CheckCategory1 = table.Rows[0]["MSG"].ToString(); //閿欒淇℃伅 + } + else + { + wc.Product = "鎶ュ伐鎴愬姛"; //缁撴灉 + wc.CheckCategory1 = ""; //閿欒淇℃伅 + } + } + + InsertRowToDataTable(wc); + } } #endregion -- Gitblit v1.9.3