Bladeren bron

优化标签打印

callm 1 dag geleden
bovenliggende
commit
8d509248d4

+ 95 - 70
UAS_MES_ZKLH/FunctionCode/Query/Query_Barcodeio.Designer.cs

@@ -35,24 +35,26 @@
             this.DGV = new System.Windows.Forms.DataGridView();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
+            this.ChooseAll = new System.Windows.Forms.Button();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.lm_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.DP_NAME = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.de_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.de_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.de_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.de_currentcentername = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.DP_NAME = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.de_startdate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lm_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -72,12 +74,13 @@
             this.DGV.AllowUserToAddRows = false;
             this.DGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.DGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.lm_id,
             this.choose,
             this.de_code,
             this.de_name,
             this.de_spec,
-            this.de_currentcentername});
+            this.de_currentcentername,
+            this.de_startdate,
+            this.lm_id});
             this.DGV.Location = new System.Drawing.Point(26, 79);
             this.DGV.Name = "DGV";
             this.DGV.RowHeadersWidth = 82;
@@ -108,6 +111,17 @@
             this.label3.Text = "标签";
             this.label3.Click += new System.EventHandler(this.label3_Click);
             // 
+            // ChooseAll
+            // 
+            this.ChooseAll.Location = new System.Drawing.Point(26, 79);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
+            this.ChooseAll.Name = "ChooseAll";
+            this.ChooseAll.Size = new System.Drawing.Size(76, 44);
+            this.ChooseAll.TabIndex = 226;
+            this.ChooseAll.Text = "全选";
+            this.ChooseAll.UseVisualStyleBackColor = true;
+            this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
+            // 
             // dataGridViewTextBoxColumn1
             // 
             this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -161,6 +175,15 @@
             this.dataGridViewTextBoxColumn5.ReadOnly = true;
             this.dataGridViewTextBoxColumn5.Width = 200;
             // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "lm_inman";
+            this.dataGridViewTextBoxColumn6.HeaderText = "录入人";
+            this.dataGridViewTextBoxColumn6.MinimumWidth = 10;
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.Width = 200;
+            // 
             // PrintLabel
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -180,59 +203,6 @@
             this.PrinterList.Size = new System.Drawing.Size(388, 50);
             this.PrinterList.TabIndex = 222;
             // 
-            // lm_id
-            // 
-            this.lm_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.lm_id.DataPropertyName = "lm_id";
-            this.lm_id.HeaderText = "ID";
-            this.lm_id.MinimumWidth = 10;
-            this.lm_id.Name = "lm_id";
-            this.lm_id.Visible = false;
-            this.lm_id.Width = 10;
-            // 
-            // choose
-            // 
-            this.choose.HeaderText = "勾选";
-            this.choose.MinimumWidth = 10;
-            this.choose.Name = "choose";
-            this.choose.Width = 80;
-            // 
-            // de_code
-            // 
-            this.de_code.DataPropertyName = "de_code";
-            this.de_code.HeaderText = "设备编号";
-            this.de_code.MinimumWidth = 10;
-            this.de_code.Name = "de_code";
-            this.de_code.ReadOnly = true;
-            this.de_code.Width = 150;
-            // 
-            // de_name
-            // 
-            this.de_name.DataPropertyName = "de_name";
-            this.de_name.HeaderText = "设备名称";
-            this.de_name.MinimumWidth = 10;
-            this.de_name.Name = "de_name";
-            this.de_name.ReadOnly = true;
-            this.de_name.Width = 200;
-            // 
-            // de_spec
-            // 
-            this.de_spec.DataPropertyName = "de_spec";
-            this.de_spec.HeaderText = "规格";
-            this.de_spec.MinimumWidth = 10;
-            this.de_spec.Name = "de_spec";
-            this.de_spec.ReadOnly = true;
-            this.de_spec.Width = 200;
-            // 
-            // de_currentcentername
-            // 
-            this.de_currentcentername.DataPropertyName = "de_currentcentername";
-            this.de_currentcentername.HeaderText = "使用部门";
-            this.de_currentcentername.MinimumWidth = 10;
-            this.de_currentcentername.Name = "de_currentcentername";
-            this.de_currentcentername.ReadOnly = true;
-            this.de_currentcentername.Width = 200;
-            // 
             // PrintBarCode
             // 
             this.PrintBarCode.AllPower = null;
@@ -274,15 +244,6 @@
             this.DP_NAME.TextBoxEnable = true;
             this.DP_NAME.UserControlTextChanged += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.pi_inoutno_UserControlTextChanged);
             // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.DataPropertyName = "lm_inman";
-            this.dataGridViewTextBoxColumn6.HeaderText = "录入人";
-            this.dataGridViewTextBoxColumn6.MinimumWidth = 10;
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.ReadOnly = true;
-            this.dataGridViewTextBoxColumn6.Width = 200;
-            // 
             // dataGridViewTextBoxColumn7
             // 
             this.dataGridViewTextBoxColumn7.DataPropertyName = "lm_mannum";
@@ -291,11 +252,73 @@
             this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
             this.dataGridViewTextBoxColumn7.Width = 200;
             // 
+            // choose
+            // 
+            this.choose.HeaderText = "勾选";
+            this.choose.MinimumWidth = 10;
+            this.choose.Name = "choose";
+            this.choose.Width = 80;
+            // 
+            // de_code
+            // 
+            this.de_code.DataPropertyName = "de_code";
+            this.de_code.HeaderText = "设备编号";
+            this.de_code.MinimumWidth = 10;
+            this.de_code.Name = "de_code";
+            this.de_code.ReadOnly = true;
+            this.de_code.Width = 150;
+            // 
+            // de_name
+            // 
+            this.de_name.DataPropertyName = "de_name";
+            this.de_name.HeaderText = "设备名称";
+            this.de_name.MinimumWidth = 10;
+            this.de_name.Name = "de_name";
+            this.de_name.ReadOnly = true;
+            this.de_name.Width = 200;
+            // 
+            // de_spec
+            // 
+            this.de_spec.DataPropertyName = "de_spec";
+            this.de_spec.HeaderText = "规格";
+            this.de_spec.MinimumWidth = 10;
+            this.de_spec.Name = "de_spec";
+            this.de_spec.ReadOnly = true;
+            this.de_spec.Width = 200;
+            // 
+            // de_currentcentername
+            // 
+            this.de_currentcentername.DataPropertyName = "de_currentcentername";
+            this.de_currentcentername.HeaderText = "使用部门";
+            this.de_currentcentername.MinimumWidth = 10;
+            this.de_currentcentername.Name = "de_currentcentername";
+            this.de_currentcentername.ReadOnly = true;
+            this.de_currentcentername.Width = 200;
+            // 
+            // de_startdate
+            // 
+            this.de_startdate.DataPropertyName = "de_startdate";
+            this.de_startdate.HeaderText = "启用日期";
+            this.de_startdate.MinimumWidth = 10;
+            this.de_startdate.Name = "de_startdate";
+            this.de_startdate.Width = 200;
+            // 
+            // lm_id
+            // 
+            this.lm_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.lm_id.DataPropertyName = "lm_id";
+            this.lm_id.HeaderText = "ID";
+            this.lm_id.MinimumWidth = 10;
+            this.lm_id.Name = "lm_id";
+            this.lm_id.Visible = false;
+            this.lm_id.Width = 10;
+            // 
             // Query_Barcodeio
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1960, 1075);
+            this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label3);
@@ -334,11 +357,13 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label3;
         private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
-        private System.Windows.Forms.DataGridViewTextBoxColumn lm_id;
+        private System.Windows.Forms.Button ChooseAll;
         private System.Windows.Forms.DataGridViewCheckBoxColumn choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn de_code;
         private System.Windows.Forms.DataGridViewTextBoxColumn de_name;
         private System.Windows.Forms.DataGridViewTextBoxColumn de_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn de_currentcentername;
+        private System.Windows.Forms.DataGridViewTextBoxColumn de_startdate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lm_id;
     }
 }

+ 17 - 1
UAS_MES_ZKLH/FunctionCode/Query/Query_Barcodeio.cs

@@ -91,7 +91,7 @@ namespace UAS_MES_NEW.Query
 
         private void LoadGridData()
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select * from device  where de_currentcentername='" + DP_NAME.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select de_code,de_name,de_spec,de_currentcentername,to_char(de_startdate,'yyyy-mm-dd')de_startdate from device  where de_currentcentername='" + DP_NAME.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(DGV, dt);
         }
 
@@ -143,5 +143,21 @@ namespace UAS_MES_NEW.Query
         {
 
         }
+        bool AllChecked = false;
+        private void ChooseAll_Click(object sender, EventArgs e)
+        {
+            if (AllChecked)
+            {
+                foreach (DataGridViewRow dr in DGV.Rows)
+                    dr.Cells[0].Value = false;
+                AllChecked = false;
+            }
+            else
+            {
+                foreach (DataGridViewRow dr in DGV.Rows)
+                    dr.Cells[0].Value = true;
+                AllChecked = true;
+            }
+        }
     }
 }

+ 6 - 3
UAS_MES_ZKLH/FunctionCode/Query/Query_Barcodeio.resx

@@ -120,9 +120,6 @@
   <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <metadata name="lm_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -138,6 +135,12 @@
   <metadata name="de_currentcentername.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="de_startdate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lm_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="PrintBarCode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>