From 45b0abd8850da515734792f01addd8aa5f18dd62 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 01 八月 2025 23:31:42 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/XtraForm1.Designer.cs | 30 +-
DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.Designer.cs | 264 +++++++++++--------------
DevApp/Gs.DevApp/DevFrm/QC/Jyxm.Designer.cs | 90 +++++---
DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs | 13 +
DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs | 198 +++++++++++++++----
5 files changed, 350 insertions(+), 245 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.Designer.cs b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.Designer.cs
index c3792b5..9440399 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.Designer.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.Designer.cs
@@ -29,18 +29,18 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- DevExpress.XtraLayout.ColumnDefinition columnDefinition1 = new DevExpress.XtraLayout.ColumnDefinition();
- DevExpress.XtraLayout.ColumnDefinition columnDefinition2 = new DevExpress.XtraLayout.ColumnDefinition();
- DevExpress.XtraLayout.ColumnDefinition columnDefinition3 = new DevExpress.XtraLayout.ColumnDefinition();
- DevExpress.XtraLayout.ColumnDefinition columnDefinition4 = new DevExpress.XtraLayout.ColumnDefinition();
- DevExpress.XtraLayout.RowDefinition rowDefinition1 = new DevExpress.XtraLayout.RowDefinition();
- DevExpress.XtraLayout.RowDefinition rowDefinition2 = new DevExpress.XtraLayout.RowDefinition();
- DevExpress.XtraLayout.RowDefinition rowDefinition3 = new DevExpress.XtraLayout.RowDefinition();
- DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
- DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
- DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
- DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
- DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
+ DevExpress.XtraLayout.ColumnDefinition columnDefinition5 = new DevExpress.XtraLayout.ColumnDefinition();
+ DevExpress.XtraLayout.ColumnDefinition columnDefinition6 = new DevExpress.XtraLayout.ColumnDefinition();
+ DevExpress.XtraLayout.ColumnDefinition columnDefinition7 = new DevExpress.XtraLayout.ColumnDefinition();
+ DevExpress.XtraLayout.ColumnDefinition columnDefinition8 = new DevExpress.XtraLayout.ColumnDefinition();
+ DevExpress.XtraLayout.RowDefinition rowDefinition4 = new DevExpress.XtraLayout.RowDefinition();
+ DevExpress.XtraLayout.RowDefinition rowDefinition5 = new DevExpress.XtraLayout.RowDefinition();
+ DevExpress.XtraLayout.RowDefinition rowDefinition6 = new DevExpress.XtraLayout.RowDefinition();
+ DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+ DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
+ DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
+ DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
+ DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
this.toolBarMenu1 = new Gs.DevApp.UserControl.UcToolBarMenu();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
@@ -119,6 +119,7 @@
this.gridColumn19 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gvMxDel = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
+ this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
this.rptStation = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -677,29 +678,29 @@
this.layoutControlItem6});
this.Root.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table;
this.Root.Name = "Root";
- columnDefinition1.SizeType = System.Windows.Forms.SizeType.Percent;
- columnDefinition1.Width = 100D;
- columnDefinition2.SizeType = System.Windows.Forms.SizeType.Percent;
- columnDefinition2.Width = 100D;
- columnDefinition3.SizeType = System.Windows.Forms.SizeType.Percent;
- columnDefinition3.Width = 100D;
- columnDefinition4.SizeType = System.Windows.Forms.SizeType.Percent;
- columnDefinition4.Width = 100D;
+ columnDefinition5.SizeType = System.Windows.Forms.SizeType.Percent;
+ columnDefinition5.Width = 100D;
+ columnDefinition6.SizeType = System.Windows.Forms.SizeType.Percent;
+ columnDefinition6.Width = 100D;
+ columnDefinition7.SizeType = System.Windows.Forms.SizeType.Percent;
+ columnDefinition7.Width = 100D;
+ columnDefinition8.SizeType = System.Windows.Forms.SizeType.Percent;
+ columnDefinition8.Width = 100D;
this.Root.OptionsTableLayoutGroup.ColumnDefinitions.AddRange(new DevExpress.XtraLayout.ColumnDefinition[] {
- columnDefinition1,
- columnDefinition2,
- columnDefinition3,
- columnDefinition4});
- rowDefinition1.Height = 100D;
- rowDefinition1.SizeType = System.Windows.Forms.SizeType.Percent;
- rowDefinition2.Height = 100D;
- rowDefinition2.SizeType = System.Windows.Forms.SizeType.Percent;
- rowDefinition3.Height = 100D;
- rowDefinition3.SizeType = System.Windows.Forms.SizeType.Percent;
+ columnDefinition5,
+ columnDefinition6,
+ columnDefinition7,
+ columnDefinition8});
+ rowDefinition4.Height = 100D;
+ rowDefinition4.SizeType = System.Windows.Forms.SizeType.Percent;
+ rowDefinition5.Height = 100D;
+ rowDefinition5.SizeType = System.Windows.Forms.SizeType.Percent;
+ rowDefinition6.Height = 100D;
+ rowDefinition6.SizeType = System.Windows.Forms.SizeType.Percent;
this.Root.OptionsTableLayoutGroup.RowDefinitions.AddRange(new DevExpress.XtraLayout.RowDefinition[] {
- rowDefinition1,
- rowDefinition2,
- rowDefinition3});
+ rowDefinition4,
+ rowDefinition5,
+ rowDefinition6});
this.Root.Size = new System.Drawing.Size(1127, 113);
this.Root.TextVisible = false;
//
@@ -893,6 +894,7 @@
this.gvMx1fdownAllow,
this.gridColumn19,
this.gvMxDel,
+ this.gridColumn11,
this.gridColumn6,
this.gridColumn9,
this.gridColumn10});
@@ -909,6 +911,7 @@
this.gvMx1guid.Caption = "瀛愯〃涓婚敭GUID";
this.gvMx1guid.FieldName = "guid";
this.gvMx1guid.Name = "gvMx1guid";
+ this.gvMx1guid.OptionsColumn.ReadOnly = true;
this.gvMx1guid.Tag = "query_a.guid";
this.gvMx1guid.Width = 94;
//
@@ -918,6 +921,7 @@
this.gvMx1pid.Caption = "涓昏〃涓婚敭GUID";
this.gvMx1pid.FieldName = "pid";
this.gvMx1pid.Name = "gvMx1pid";
+ this.gvMx1pid.OptionsColumn.ReadOnly = true;
this.gvMx1pid.Tag = "query_a.pid";
this.gvMx1pid.Width = 94;
//
@@ -930,7 +934,7 @@
this.gvMx1fcheckItem.Name = "gvMx1fcheckItem";
this.gvMx1fcheckItem.Tag = "edit";
this.gvMx1fcheckItem.Visible = true;
- this.gvMx1fcheckItem.VisibleIndex = 0;
+ this.gvMx1fcheckItem.VisibleIndex = 1;
this.gvMx1fcheckItem.Width = 150;
//
// rptJYXM
@@ -949,7 +953,7 @@
this.gvMx1forder.Name = "gvMx1forder";
this.gvMx1forder.Tag = "yz_quantity_0_edit";
this.gvMx1forder.Visible = true;
- this.gvMx1forder.VisibleIndex = 1;
+ this.gvMx1forder.VisibleIndex = 0;
this.gvMx1forder.Width = 50;
//
// rptShunXui
@@ -1139,13 +1143,22 @@
// repositoryItemButtonEdit1
//
this.repositoryItemButtonEdit1.AutoHeight = false;
- editorButtonImageOptions1.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16;
- editorButtonImageOptions1.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
+ editorButtonImageOptions2.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16;
+ editorButtonImageOptions2.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
- new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "绉婚櫎", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+ new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "绉婚櫎", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick);
+ //
+ // gridColumn11
+ //
+ this.gridColumn11.Caption = "鍗曚綅";
+ this.gridColumn11.FieldName = "funit";
+ this.gridColumn11.MinWidth = 25;
+ this.gridColumn11.Name = "gridColumn11";
+ this.gridColumn11.Tag = "edit";
+ this.gridColumn11.Width = 94;
//
// gridColumn6
//
@@ -1372,5 +1385,6 @@
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn10;
private DevExpress.XtraEditors.Repository.RepositoryItemComboBox rptGroup;
+ private DevExpress.XtraGrid.Columns.GridColumn gridColumn11;
}
}
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
index 2b0efee..b7e3ad6 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
@@ -20,7 +20,7 @@
private List<FilterEntity> _filterList = new List<FilterEntity>();
private readonly string _webServiceName = "MesQmCheckitemManager/";
public string strType = "";//iqc type
- public decimal dfValue = 1; //iqc鐨勬牱鍝佹暟閲忛粯璁�5锛屽惁鍒�1
+ public decimal dfValue = 1; //iqc鐨勬牱鍝佹暟閲忛粯璁�5锛屽惁鍒欑湅涓嬮潰
private string dftSsampleSizeName = "GB/T2828.1-2012/ISO";//榛樿
private string dftSsampleSizeNo = "GB/T2828.1-2012/ISO";//榛樿
private string dftFcheckLevel = "2.涓�鑸楠屾按骞�(II)";//榛樿妫�楠屾按骞�
@@ -49,7 +49,17 @@
if (strType == QcSeason.iqc.ToString())
dfValue = 5;
if (strType == QcSeason.fqc.ToString())
+ {
dfValue = 0;
+ gvMx1.Columns["ypsl"].Visible = false;
+ }
+ if (strType == QcSeason.ipqc棣栨.ToString())
+ {
+ dfValue = 0;
+ gvMx1.Columns["ypsl"].Visible = false;
+ gvMx1.Columns["funit"].Visible = true;
+ gvMx1.Columns["funit"].VisibleIndex = 13;
+ }
//濡傛灉鏄痠pqc宸℃锛屾樉绀哄伐浣�
if (strType != QcSeason.ipqc宸℃.ToString())
{
@@ -368,6 +378,7 @@
stationName = row["stationName"].ToString(),
FcheckType = row["FcheckType"].ToString(),
isRzxx = _isRzxx,
+ Funit = row["funit"].ToString(),
});
}
}
diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.Designer.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.Designer.cs
index 1df7602..76328e5 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.Designer.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.Designer.cs
@@ -47,10 +47,9 @@
this.txt_collectBy = new DevExpress.XtraEditors.TextEdit();
this.txt_barCode = new DevExpress.XtraEditors.TextEdit();
this.txt_currentBarCode = new DevExpress.XtraEditors.TextEdit();
- this.txt_gwm = new DevExpress.XtraEditors.TextEdit();
+ this.txt_gongWei = new DevExpress.XtraEditors.TextEdit();
this.txt_itemNo = new DevExpress.XtraEditors.TextEdit();
this.txt_bc = new DevExpress.XtraEditors.TextEdit();
- this.txt_gw = new DevExpress.XtraEditors.TextEdit();
this.txt_itemName = new DevExpress.XtraEditors.TextEdit();
this.txt_itemModel = new DevExpress.XtraEditors.TextEdit();
this.txt_sbNo = new DevExpress.XtraEditors.TextEdit();
@@ -67,17 +66,10 @@
this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem14 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem15 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
this.layShuiJian = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem16 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem17 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
- this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
this.layDianJian = new DevExpress.XtraLayout.LayoutControlItem();
this.simpleButton7 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton6 = new DevExpress.XtraEditors.SimpleButton();
@@ -134,6 +126,12 @@
this.gridColumn23 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn25 = new DevExpress.XtraGrid.Columns.GridColumn();
this.alertControl1 = new DevExpress.XtraBars.Alerter.AlertControl(this.components);
+ this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
+ this.layoutControlItem15 = new DevExpress.XtraLayout.LayoutControlItem();
+ this.layoutControlItem14 = new DevExpress.XtraLayout.LayoutControlItem();
+ this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
+ this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
+ this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.splitMx1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitMx1.Panel1)).BeginInit();
this.splitMx1.Panel1.SuspendLayout();
@@ -153,10 +151,9 @@
((System.ComponentModel.ISupportInitialize)(this.txt_collectBy.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_barCode.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_currentBarCode.Properties)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.txt_gwm.Properties)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.txt_gongWei.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemNo.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_bc.Properties)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.txt_gw.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemName.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_sbNo.Properties)).BeginInit();
@@ -171,17 +168,10 @@
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layShuiJian)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem16)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layDianJian)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.prog1.Properties)).BeginInit();
this.panel3.SuspendLayout();
@@ -196,6 +186,12 @@
this.tabMxPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gcMx2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gvMx2)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
this.SuspendLayout();
//
// splitMx1
@@ -256,10 +252,9 @@
this.layoutMx1.Controls.Add(this.txt_collectBy);
this.layoutMx1.Controls.Add(this.txt_barCode);
this.layoutMx1.Controls.Add(this.txt_currentBarCode);
- this.layoutMx1.Controls.Add(this.txt_gwm);
+ this.layoutMx1.Controls.Add(this.txt_gongWei);
this.layoutMx1.Controls.Add(this.txt_itemNo);
this.layoutMx1.Controls.Add(this.txt_bc);
- this.layoutMx1.Controls.Add(this.txt_gw);
this.layoutMx1.Controls.Add(this.txt_itemName);
this.layoutMx1.Controls.Add(this.txt_itemModel);
this.layoutMx1.Controls.Add(this.txt_sbNo);
@@ -326,17 +321,17 @@
this.txt_currentBarCode.StyleController = this.layoutMx1;
this.txt_currentBarCode.TabIndex = 8;
//
- // txt_gwm
+ // txt_gongWei
//
- this.txt_gwm.Location = new System.Drawing.Point(111, 152);
- this.txt_gwm.Name = "txt_gwm";
- this.txt_gwm.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
- this.txt_gwm.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(138)))), ((int)(((byte)(200)))));
- this.txt_gwm.Properties.Appearance.Options.UseFont = true;
- this.txt_gwm.Properties.Appearance.Options.UseForeColor = true;
- this.txt_gwm.Size = new System.Drawing.Size(99, 24);
- this.txt_gwm.StyleController = this.layoutMx1;
- this.txt_gwm.TabIndex = 9;
+ this.txt_gongWei.Location = new System.Drawing.Point(111, 152);
+ this.txt_gongWei.Name = "txt_gongWei";
+ this.txt_gongWei.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
+ this.txt_gongWei.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(138)))), ((int)(((byte)(200)))));
+ this.txt_gongWei.Properties.Appearance.Options.UseFont = true;
+ this.txt_gongWei.Properties.Appearance.Options.UseForeColor = true;
+ this.txt_gongWei.Size = new System.Drawing.Size(99, 24);
+ this.txt_gongWei.StyleController = this.layoutMx1;
+ this.txt_gongWei.TabIndex = 9;
//
// txt_itemNo
//
@@ -356,18 +351,9 @@
this.txt_bc.StyleController = this.layoutMx1;
this.txt_bc.TabIndex = 11;
//
- // txt_gw
- //
- this.txt_gw.Location = new System.Drawing.Point(313, 68);
- this.txt_gw.Name = "txt_gw";
- this.txt_gw.Properties.ReadOnly = true;
- this.txt_gw.Size = new System.Drawing.Size(99, 24);
- this.txt_gw.StyleController = this.layoutMx1;
- this.txt_gw.TabIndex = 12;
- //
// txt_itemName
//
- this.txt_itemName.Location = new System.Drawing.Point(515, 12);
+ this.txt_itemName.Location = new System.Drawing.Point(515, 40);
this.txt_itemName.Name = "txt_itemName";
this.txt_itemName.Properties.ReadOnly = true;
this.txt_itemName.Size = new System.Drawing.Size(99, 24);
@@ -376,16 +362,16 @@
//
// txt_itemModel
//
- this.txt_itemModel.Location = new System.Drawing.Point(717, 12);
+ this.txt_itemModel.Location = new System.Drawing.Point(515, 12);
this.txt_itemModel.Name = "txt_itemModel";
this.txt_itemModel.Properties.ReadOnly = true;
- this.txt_itemModel.Size = new System.Drawing.Size(99, 24);
+ this.txt_itemModel.Size = new System.Drawing.Size(301, 24);
this.txt_itemModel.StyleController = this.layoutMx1;
this.txt_itemModel.TabIndex = 14;
//
// txt_sbNo
//
- this.txt_sbNo.Location = new System.Drawing.Point(515, 68);
+ this.txt_sbNo.Location = new System.Drawing.Point(313, 68);
this.txt_sbNo.Name = "txt_sbNo";
this.txt_sbNo.Properties.ReadOnly = true;
this.txt_sbNo.Size = new System.Drawing.Size(99, 24);
@@ -394,7 +380,7 @@
//
// txt_sjXt
//
- this.txt_sjXt.Location = new System.Drawing.Point(515, 40);
+ this.txt_sjXt.Location = new System.Drawing.Point(515, 68);
this.txt_sjXt.Name = "txt_sjXt";
this.txt_sjXt.Properties.ReadOnly = true;
this.txt_sjXt.Size = new System.Drawing.Size(99, 24);
@@ -461,18 +447,17 @@
this.layoutControlItem4,
this.layoutControlItem7,
this.layoutControlItem8,
- this.layoutControlItem9,
- this.layoutControlItem10,
- this.layoutControlItem12,
- this.layoutControlItem14,
- this.layoutControlItem15,
this.layoutControlItem5,
this.layShuiJian,
this.layoutControlItem16,
this.layoutControlItem17,
+ this.layDianJian,
+ this.layoutControlItem12,
+ this.layoutControlItem15,
+ this.layoutControlItem14,
this.layoutControlItem13,
- this.layoutControlItem11,
- this.layDianJian});
+ this.layoutControlItem10,
+ this.layoutControlItem11});
this.Root.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table;
this.Root.Name = "Root";
columnDefinition1.SizeType = System.Windows.Forms.SizeType.Percent;
@@ -572,60 +557,6 @@
this.layoutControlItem8.Text = "鐝";
this.layoutControlItem8.TextSize = new System.Drawing.Size(87, 18);
//
- // layoutControlItem9
- //
- this.layoutControlItem9.Control = this.txt_gw;
- this.layoutControlItem9.Location = new System.Drawing.Point(202, 56);
- this.layoutControlItem9.Name = "layoutControlItem9";
- this.layoutControlItem9.OptionsTableLayoutItem.ColumnIndex = 1;
- this.layoutControlItem9.OptionsTableLayoutItem.RowIndex = 2;
- this.layoutControlItem9.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem9.Text = "宸ヤ綅";
- this.layoutControlItem9.TextSize = new System.Drawing.Size(87, 18);
- //
- // layoutControlItem10
- //
- this.layoutControlItem10.Control = this.txt_itemName;
- this.layoutControlItem10.Location = new System.Drawing.Point(404, 0);
- this.layoutControlItem10.Name = "layoutControlItem10";
- this.layoutControlItem10.OptionsTableLayoutItem.ColumnIndex = 2;
- this.layoutControlItem10.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem10.Text = "浜у搧鍚嶇О";
- this.layoutControlItem10.TextSize = new System.Drawing.Size(87, 18);
- //
- // layoutControlItem12
- //
- this.layoutControlItem12.Control = this.txt_sbNo;
- this.layoutControlItem12.Location = new System.Drawing.Point(404, 56);
- this.layoutControlItem12.Name = "layoutControlItem12";
- this.layoutControlItem12.OptionsTableLayoutItem.ColumnIndex = 2;
- this.layoutControlItem12.OptionsTableLayoutItem.RowIndex = 2;
- this.layoutControlItem12.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem12.Text = "璁惧缂栫爜";
- this.layoutControlItem12.TextSize = new System.Drawing.Size(87, 18);
- //
- // layoutControlItem14
- //
- this.layoutControlItem14.Control = this.txt_yjDate;
- this.layoutControlItem14.Location = new System.Drawing.Point(606, 28);
- this.layoutControlItem14.Name = "layoutControlItem14";
- this.layoutControlItem14.OptionsTableLayoutItem.ColumnIndex = 3;
- this.layoutControlItem14.OptionsTableLayoutItem.RowIndex = 1;
- this.layoutControlItem14.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem14.Text = "Mes璁″垝寮�宸�";
- this.layoutControlItem14.TextSize = new System.Drawing.Size(87, 18);
- //
- // layoutControlItem15
- //
- this.layoutControlItem15.Control = this.txt_sjDate;
- this.layoutControlItem15.Location = new System.Drawing.Point(606, 56);
- this.layoutControlItem15.Name = "layoutControlItem15";
- this.layoutControlItem15.OptionsTableLayoutItem.ColumnIndex = 3;
- this.layoutControlItem15.OptionsTableLayoutItem.RowIndex = 2;
- this.layoutControlItem15.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem15.Text = "Mes瀹為檯寮�宸�";
- this.layoutControlItem15.TextSize = new System.Drawing.Size(87, 18);
- //
// layoutControlItem5
//
this.layoutControlItem5.Control = this.txt_currentBarCode;
@@ -639,7 +570,7 @@
//
// layShuiJian
//
- this.layShuiJian.Control = this.txt_gwm;
+ this.layShuiJian.Control = this.txt_gongWei;
this.layShuiJian.Location = new System.Drawing.Point(0, 140);
this.layShuiJian.Name = "layShuiJian";
this.layShuiJian.OptionsTableLayoutItem.RowIndex = 5;
@@ -678,28 +609,6 @@
this.layoutControlItem17.Text = "涓嶈壇鍝佹寜閽�";
this.layoutControlItem17.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem17.TextVisible = false;
- //
- // layoutControlItem13
- //
- this.layoutControlItem13.Control = this.txt_sjXt;
- this.layoutControlItem13.CustomizationFormText = "鐢熶骇绾垮埆";
- this.layoutControlItem13.Location = new System.Drawing.Point(404, 28);
- this.layoutControlItem13.Name = "layoutControlItem13";
- this.layoutControlItem13.OptionsTableLayoutItem.ColumnIndex = 2;
- this.layoutControlItem13.OptionsTableLayoutItem.RowIndex = 1;
- this.layoutControlItem13.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem13.Text = "鐢熶骇绾垮埆";
- this.layoutControlItem13.TextSize = new System.Drawing.Size(87, 18);
- //
- // layoutControlItem11
- //
- this.layoutControlItem11.Control = this.txt_itemModel;
- this.layoutControlItem11.Location = new System.Drawing.Point(606, 0);
- this.layoutControlItem11.Name = "layoutControlItem11";
- this.layoutControlItem11.OptionsTableLayoutItem.ColumnIndex = 3;
- this.layoutControlItem11.Size = new System.Drawing.Size(202, 28);
- this.layoutControlItem11.Text = "浜у搧瑙勬牸";
- this.layoutControlItem11.TextSize = new System.Drawing.Size(87, 18);
//
// layDianJian
//
@@ -1296,6 +1205,73 @@
this.gridColumn25.VisibleIndex = 12;
this.gridColumn25.Width = 94;
//
+ // layoutControlItem12
+ //
+ this.layoutControlItem12.Control = this.txt_sbNo;
+ this.layoutControlItem12.Location = new System.Drawing.Point(202, 56);
+ this.layoutControlItem12.Name = "layoutControlItem12";
+ this.layoutControlItem12.OptionsTableLayoutItem.ColumnIndex = 1;
+ this.layoutControlItem12.OptionsTableLayoutItem.RowIndex = 2;
+ this.layoutControlItem12.Size = new System.Drawing.Size(202, 28);
+ this.layoutControlItem12.Text = "璁惧缂栫爜";
+ this.layoutControlItem12.TextSize = new System.Drawing.Size(87, 18);
+ //
+ // layoutControlItem15
+ //
+ this.layoutControlItem15.Control = this.txt_sjDate;
+ this.layoutControlItem15.Location = new System.Drawing.Point(606, 56);
+ this.layoutControlItem15.Name = "layoutControlItem15";
+ this.layoutControlItem15.OptionsTableLayoutItem.ColumnIndex = 3;
+ this.layoutControlItem15.OptionsTableLayoutItem.RowIndex = 2;
+ this.layoutControlItem15.Size = new System.Drawing.Size(202, 28);
+ this.layoutControlItem15.Text = "Mes瀹為檯寮�宸�";
+ this.layoutControlItem15.TextSize = new System.Drawing.Size(87, 18);
+ //
+ // layoutControlItem14
+ //
+ this.layoutControlItem14.Control = this.txt_yjDate;
+ this.layoutControlItem14.Location = new System.Drawing.Point(606, 28);
+ this.layoutControlItem14.Name = "layoutControlItem14";
+ this.layoutControlItem14.OptionsTableLayoutItem.ColumnIndex = 3;
+ this.layoutControlItem14.OptionsTableLayoutItem.RowIndex = 1;
+ this.layoutControlItem14.Size = new System.Drawing.Size(202, 28);
+ this.layoutControlItem14.Text = "Mes璁″垝寮�宸�";
+ this.layoutControlItem14.TextSize = new System.Drawing.Size(87, 18);
+ //
+ // layoutControlItem13
+ //
+ this.layoutControlItem13.Control = this.txt_sjXt;
+ this.layoutControlItem13.CustomizationFormText = "鐢熶骇绾垮埆";
+ this.layoutControlItem13.Location = new System.Drawing.Point(404, 56);
+ this.layoutControlItem13.Name = "layoutControlItem13";
+ this.layoutControlItem13.OptionsTableLayoutItem.ColumnIndex = 2;
+ this.layoutControlItem13.OptionsTableLayoutItem.RowIndex = 2;
+ this.layoutControlItem13.Size = new System.Drawing.Size(202, 28);
+ this.layoutControlItem13.Text = "鐢熶骇绾垮埆";
+ this.layoutControlItem13.TextSize = new System.Drawing.Size(87, 18);
+ //
+ // layoutControlItem10
+ //
+ this.layoutControlItem10.Control = this.txt_itemName;
+ this.layoutControlItem10.Location = new System.Drawing.Point(404, 28);
+ this.layoutControlItem10.Name = "layoutControlItem10";
+ this.layoutControlItem10.OptionsTableLayoutItem.ColumnIndex = 2;
+ this.layoutControlItem10.OptionsTableLayoutItem.RowIndex = 1;
+ this.layoutControlItem10.Size = new System.Drawing.Size(202, 28);
+ this.layoutControlItem10.Text = "浜у搧鍚嶇О";
+ this.layoutControlItem10.TextSize = new System.Drawing.Size(87, 18);
+ //
+ // layoutControlItem11
+ //
+ this.layoutControlItem11.Control = this.txt_itemModel;
+ this.layoutControlItem11.Location = new System.Drawing.Point(404, 0);
+ this.layoutControlItem11.Name = "layoutControlItem11";
+ this.layoutControlItem11.OptionsTableLayoutItem.ColumnIndex = 2;
+ this.layoutControlItem11.OptionsTableLayoutItem.ColumnSpan = 2;
+ this.layoutControlItem11.Size = new System.Drawing.Size(404, 28);
+ this.layoutControlItem11.Text = "浜у搧瑙勬牸";
+ this.layoutControlItem11.TextSize = new System.Drawing.Size(87, 18);
+ //
// Frm_Work01
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -1327,10 +1303,9 @@
((System.ComponentModel.ISupportInitialize)(this.txt_collectBy.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_barCode.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_currentBarCode.Properties)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.txt_gwm.Properties)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.txt_gongWei.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemNo.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_bc.Properties)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.txt_gw.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemName.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_sbNo.Properties)).EndInit();
@@ -1345,17 +1320,10 @@
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layShuiJian)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem16)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layDianJian)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.prog1.Properties)).EndInit();
this.panel3.ResumeLayout(false);
@@ -1374,6 +1342,12 @@
this.tabMxPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gcMx2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gvMx2)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
this.ResumeLayout(false);
}
@@ -1403,14 +1377,13 @@
private DevExpress.XtraEditors.TextEdit txt_collectBy;
private DevExpress.XtraEditors.TextEdit txt_barCode;
private DevExpress.XtraEditors.TextEdit txt_currentBarCode;
- private DevExpress.XtraEditors.TextEdit txt_gwm;
+ private DevExpress.XtraEditors.TextEdit txt_gongWei;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
private DevExpress.XtraEditors.TextEdit txt_itemNo;
private DevExpress.XtraEditors.TextEdit txt_bc;
- private DevExpress.XtraEditors.TextEdit txt_gw;
private DevExpress.XtraEditors.TextEdit txt_itemName;
private DevExpress.XtraEditors.TextEdit txt_itemModel;
private DevExpress.XtraEditors.TextEdit txt_sbNo;
@@ -1419,11 +1392,6 @@
private DevExpress.XtraEditors.TextEdit txt_sjDate;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem14;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem15;
private DevExpress.XtraEditors.SimpleButton btnGood;
private DevExpress.XtraEditors.SimpleButton btnBad;
private System.Windows.Forms.Panel panel3;
@@ -1448,8 +1416,6 @@
private DevExpress.XtraLayout.LayoutControlItem layShuiJian;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem16;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem17;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem13;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
@@ -1475,5 +1441,11 @@
private DevExpress.XtraLayout.LayoutControlItem layDianJian;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn24;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn25;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem15;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem14;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem13;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
+ private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
}
}
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
index 05488d1..9e8b054 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
@@ -1,14 +1,19 @@
-锘縰sing DevExpress.XtraGrid.Columns;
+锘縰sing DevExpress.Office.Utils;
+using DevExpress.XtraEditors;
+using DevExpress.XtraGrid.Columns;
using DevExpress.XtraLayout.Utils;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using NModbus;
using System;
using System.Collections.Generic;
using System.Data;
+using System.Data.SqlClient;
using System.Dynamic;
using System.IO;
+using System.Net.Sockets;
using System.Text;
using System.Windows.Forms;
@@ -16,6 +21,10 @@
{
public partial class Frm_Work01 : DevExpress.XtraEditors.XtraForm
{
+ string hostName = "192.168.60.51";
+ int hostNamePoint = 502;
+ string strConn = "Data Source=192.168.1.146;Initial Catalog=GS_MES;User ID=mesUser;Password =qixi1qaz@WSXmes";
+ bool isCleanDianJian = false;
string _webServiceName = "WorkCollect/";
string dianJianPath = "";//鐢垫鍙栧�艰矾寰�
string goodTag = "鈭�";
@@ -49,8 +58,27 @@
addColumn();
txt_barCode.KeyDown += (s, e) =>
{
- if (e.KeyCode == Keys.Enter) { addModel(goodTag); }
- ;
+ if (e.KeyCode == Keys.Enter)
+ {
+ //濡傛灉鏄按妫�锛岃繕瑕佹壂宸ヤ綅
+ if (txt_gx.Text.Trim() == fGxShouJian)
+ {
+ txt_gongWei.Focus();
+ }
+ else
+ addModel(goodTag);
+ }
+ };
+ txt_gongWei.KeyDown += (s, e) =>
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ //濡傛灉鏄按妫�锛屽彲浠ユ彁浜や簡
+ if (txt_gx.Text.Trim() == fGxShouJian)
+ {
+ addModel(goodTag);
+ }
+ }
};
btnGood.Click += (s, e) =>
{
@@ -87,13 +115,12 @@
};
frm.ShowDialog();
};
-
this.ActiveControl = this.txt_barCode;
txt_barCode.Focus();
}
/// <summary>
- /// 鏍规嵁宸ュ簭锛屾瀯閫犱笉鍚岀被鍨嬬殑瀹炰綋
+ /// 鏍规嵁宸ュ簭锛屾瀯閫犱笉鍚岀被鍨嬬殑瀹炰綋锛岃鍙栦笉鍚岀殑鏁版嵁
/// </summary>
/// <param name="_barCode">鏉$爜</param>
/// <param name="_checkResult">缁撴灉</param>
@@ -106,7 +133,7 @@
_obj.checkResult = _checkResult;//妫�娴嬬粨鏋�
_obj.processNo = txt_gx.Text.Trim();//宸ュ簭
_obj.banCi = txt_bc.Text.Trim();//鐝
- _obj.gongWei = txt_gw.Text.Trim();//宸ヤ綅
+ _obj.gongWei = txt_gongWei.Text.Trim();//宸ヤ綅
_obj.badDescription = _badDescription.Trim();//涓嶈壇鎻忚堪
if (txt_gx.Text.Trim() == fGxTouRu)
{
@@ -157,24 +184,27 @@
_obj.t009 = JNV;
_obj.t010 = XLV;
_obj.t011 = GVV;
- //姝e紡涓婄嚎瑕佹竻绌烘枃鏈暟鎹�
- //File.WriteAllText(dianJianPath, "");
+ if (isCleanDianJian == true)
+ File.WriteAllText(dianJianPath, "");
return _obj;
}
//姘存
if (txt_gx.Text.Trim() == fGxShouJian)
{
- string strCsl1 = "strCsl1";
- string strSw1 = "strSw1";
- string strCsl2 = "strCsl2";
- string strSw2 = "strSw2";
- string strCsl3 = "strCsl3";
- string strSw3 = "strSw3";
- string strCsl4 = "strCsl4";
- string strSw4 = "strSw4";
- string strCsl5 = "strCsl5";
- string strSw5 = "strSw5";
- string SJJG = "";
+ string strCsl1 = "";//妯″紡1鍑烘按閲�
+ string strSw1 = "";//妯″紡1姘存俯
+ string strCsl2 = "";
+ string strSw2 = "";
+ string strCsl3 = "";
+ string strSw3 = "";
+ string strCsl4 = "";
+ string strSw4 = "";
+ string strCsl5 = "";
+ string strSw5 = "";
+ string SJJG = "";//姘存鏌ョ粨鏋渙k銆乶g
+ string GWZT = "";//宸ヤ綅鐘舵��
+ string SJJGZ = "";//姘存鏌ョ粨鏋�1
+ (strCsl1, strSw1, SJJG, GWZT, SJJGZ) = getShuiJian();
_obj.t002 = strCsl1;
_obj.t003 = strSw1;
_obj.t004 = strCsl2;
@@ -185,9 +215,11 @@
_obj.t009 = strSw4;
_obj.t010 = strCsl5;
_obj.t011 = strSw5;
- // _obj.t012 = SJJG;杩欎釜寰呯‘瀹�
+ _obj.t012 = SJJGZ;
+ _obj.t013 = GWZT;
return _obj;
}
+ //缁堟
if (txt_gx.Text.Trim() == fGxZhongJian)
{
return _obj;
@@ -270,7 +302,6 @@
Toast vm = new Toast((goodTag == "鈭�" ? 1 : -1), _msg);
vm.Show();
}
- ;
}
else
{
@@ -284,6 +315,9 @@
vm.Show();
}
txt_barCode.Text = "";
+ txt_gongWei.Text = "";
+ this.ActiveControl = this.txt_barCode;
+ txt_barCode.Focus();
}
/// <summary>
@@ -301,7 +335,6 @@
layShuiJian.Visibility = LayoutVisibility.Always;
else
layShuiJian.Visibility = LayoutVisibility.Never;
-
List<dynamic> _lst = new List<dynamic>();
if (txt_gx.Text.Trim() == fGxDianJian)
{
@@ -337,29 +370,25 @@
{
ziduan = "t007",
wenben = "鎺ュ湴缁撴灉",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t009",
wenben = "浜よ�愮粨鏋�",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t010",
wenben = "娉勬紡缁撴灉",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t011",
wenben = "鍔熺巼缁撴灉",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
}
if (txt_gx.Text.Trim() == fGxShouJian)
@@ -382,55 +411,54 @@
{
ziduan = "t004",
wenben = "鍑烘按閲�2",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t005",
wenben = "姘存俯2",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t006",
wenben = "鍑烘按閲�3",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t007",
wenben = "姘存俯3",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t008",
wenben = "鍑烘按閲�4",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t009",
wenben = "姘存俯4",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t010",
wenben = "鍑烘按閲�5",
- kejian = true,
- visibleIndex = 1,
+ visibleIndex = -1,
});
_lst.Add(new
{
ziduan = "t011",
wenben = "姘存俯5",
+ visibleIndex = -1,
+ });
+ _lst.Add(new
+ {
+ ziduan = "t012",
+ wenben = "鏁版嵁缁撴灉",
kejian = true,
visibleIndex = 1,
});
@@ -440,10 +468,90 @@
GridColumn newColumn = new GridColumn();
newColumn.FieldName = item.ziduan; // 璁剧疆涓庢暟鎹簮瀵瑰簲鐨勫瓧娈靛悕
newColumn.Caption = item.wenben; // 璁剧疆鍒楃殑鏍囬
- //newColumn.Visible = item.visibleIndex; // 璁剧疆鍒楁槸鍚﹀彲瑙�
newColumn.VisibleIndex = item.visibleIndex; // 璁剧疆鍒楃殑鏄剧ず椤哄簭
gvMx1.Columns.Add(newColumn);
}
}
+
+
+ #region 璇诲彇姘存鏁版嵁
+ private (string, string, string, string, string) getShuiJian()
+ {
+ string strCsl1 = ""; //妯″紡1鍑烘按閲�
+ string strSw1 = "";//妯″紡1姘存俯
+ string SJJG = "";//姘存鏌ョ粨鏋渙k銆乶g
+ string GWZT = "";//宸ヤ綅鐘舵��
+ string SJJGZ = "";//姘存鏌ョ粨鏋�1
+ System.Text.StringBuilder sbSql1 = new StringBuilder();
+ sbSql1.Append($"select MIG004,MIG005 from BASMIG(nolock) where MIG001='ShuiJianZhanWei01' and MIG003='{((BaseEdit)this.txt_gongWei).EditValue.ToString()}'");
+ DataTable dataTable1 = this.GetDataTable(sbSql1.ToString(), "tmpBASMIG2");
+ if (dataTable1 == null || dataTable1.Rows.Count <= 0)
+ {
+ ((BaseEdit)this.txt_gongWei).EditValue = (object)"";
+ LogHelper.Debug(this.ToString(), txt_gongWei.Text + "璇ユ按妫�绔欎綅鐮佷笉瀛樺湪锛岃纭锛�");
+ //Toast vm = new Toast(-1, "璇ユ按妫�绔欎綅鐮佷笉瀛樺湪锛岃纭锛�");
+ //vm.Show();
+ }
+ else
+ {
+ ModbusFactory modbusFactory = new ModbusFactory();
+ byte num1 = byte.Parse("1");
+ ushort num2 = ushort.Parse("1");
+ System.Text.StringBuilder sbSql2 = new StringBuilder();
+ sbSql2.Append(string.Format($"select case when MIG006='D' then MIG003+{dataTable1.Rows[0][0]} else MIG003+{dataTable1.Rows[0][1]} end MIG003,MIG004 from BASMIG(nolock) where MIG001 = 'ShuiJianAddress01' order by MIG005"));
+ DataTable dataTable2 = GetDataTable(sbSql2.ToString(), "tmpBASMIG3");
+ if (dataTable2 == null || dataTable2.Rows.Count <= 0)
+ {
+ ((BaseEdit)this.txt_gongWei).EditValue = (object)"";
+ LogHelper.Debug(this.ToString(), txt_gongWei.Text + "姘存鍦板潃涓嶅瓨鍦紝璇风‘璁わ紒");
+ //Toast vm = new Toast(-1, "姘存鍦板潃涓嶅瓨鍦紝璇风‘璁わ紒");
+ //vm.Show();
+ }
+ else
+ {
+ try
+ {
+ IModbusMaster master = modbusFactory.CreateMaster(new TcpClient(this.hostName, this.hostNamePoint));
+ master.Transport.ReadTimeout = 10000;
+ master.Transport.Retries = 10000;
+ strCsl1 = master.ReadHoldingRegisters(num1, ushort.Parse(dataTable2.Rows[0]["MIG003"].ToString()), num2)[0].ToString();
+ strSw1 = (float.Parse(master.ReadHoldingRegisters(num1, ushort.Parse(dataTable2.Rows[1]["MIG003"].ToString()), num2)[0].ToString()) / 10f).ToString();
+ ushort[] numArray = master.ReadHoldingRegisters(num1, ushort.Parse(dataTable2.Rows[2]["MIG003"].ToString()), num2);
+ SJJGZ = numArray[0].ToString();
+ SJJG = numArray[0].ToString();
+ SJJG = (SJJG == "1" ? "OK" : (SJJG == "2" ? "NG" : SJJG));
+ GWZT = master.ReadCoils(num1, ushort.Parse(dataTable2.Rows[3]["MIG003"].ToString()), num2)[0].ToString();
+ }
+ catch (Exception ex)
+ {
+ ((BaseEdit)this.txt_gongWei).EditValue = (object)"";
+ LogHelper.Debug(this.ToString(), txt_gongWei.Text + ex.Message);
+ //Toast vm = new Toast(-1, ex.Message);
+ //vm.Show();
+ }
+ }
+ }
+ return (strCsl1, strSw1, SJJG, GWZT, SJJGZ);
+ }
+ private DataTable GetDataTable(string SQLString, string tmpBASMIG2)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var ds = new DataSet();
+ try
+ {
+ connection.Open();
+ var command = new SqlDataAdapter(SQLString, connection);
+ command.Fill(ds, tmpBASMIG2);
+ }
+ catch (SqlException ex)
+ {
+ LogHelper.Debug(this.ToString(), ex.Message);
+ }
+ return ds.Tables[0];
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/XtraForm1.Designer.cs b/DevApp/Gs.DevApp/XtraForm1.Designer.cs
index 5fee02e..288cce0 100644
--- a/DevApp/Gs.DevApp/XtraForm1.Designer.cs
+++ b/DevApp/Gs.DevApp/XtraForm1.Designer.cs
@@ -35,16 +35,16 @@
this.label1 = new System.Windows.Forms.Label();
this.txt_slaveAddress = new DevExpress.XtraEditors.ComboBoxEdit();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
+ this.btnEdit = new DevExpress.XtraEditors.ButtonEdit();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.txtGWM = new DevExpress.XtraEditors.TextEdit();
- this.btnEdit = new DevExpress.XtraEditors.ButtonEdit();
((System.ComponentModel.ISupportInitialize)(this.txtGs.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_slaveAddress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.txtGWM.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.btnEdit.Properties)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.txtGWM.Properties)).BeginInit();
this.SuspendLayout();
//
// simpleButton2
@@ -128,6 +128,16 @@
this.panelControl1.Size = new System.Drawing.Size(887, 120);
this.panelControl1.TabIndex = 7;
//
+ // btnEdit
+ //
+ this.btnEdit.Location = new System.Drawing.Point(683, 82);
+ this.btnEdit.Name = "btnEdit";
+ this.btnEdit.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+ new DevExpress.XtraEditors.Controls.EditorButton()});
+ this.btnEdit.Size = new System.Drawing.Size(125, 24);
+ this.btnEdit.TabIndex = 10;
+ this.btnEdit.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.btnEdit_ButtonClick);
+ //
// simpleButton1
//
this.simpleButton1.Location = new System.Drawing.Point(523, 84);
@@ -141,9 +151,9 @@
//
this.labelControl2.Location = new System.Drawing.Point(30, 82);
this.labelControl2.Name = "labelControl2";
- this.labelControl2.Size = new System.Drawing.Size(45, 18);
+ this.labelControl2.Size = new System.Drawing.Size(134, 18);
this.labelControl2.TabIndex = 8;
- this.labelControl2.Text = "宸ヤ綅鐮�";
+ this.labelControl2.Text = "宸ヤ綅鐮丏1008-D1118";
//
// txtGWM
//
@@ -151,16 +161,6 @@
this.txtGWM.Name = "txtGWM";
this.txtGWM.Size = new System.Drawing.Size(183, 24);
this.txtGWM.TabIndex = 7;
- //
- // btnEdit
- //
- this.btnEdit.Location = new System.Drawing.Point(683, 82);
- this.btnEdit.Name = "btnEdit";
- this.btnEdit.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
- new DevExpress.XtraEditors.Controls.EditorButton()});
- this.btnEdit.Size = new System.Drawing.Size(125, 24);
- this.btnEdit.TabIndex = 10;
- this.btnEdit.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.btnEdit_ButtonClick);
//
// XtraForm1
//
@@ -176,8 +176,8 @@
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.txtGWM.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.btnEdit.Properties)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.txtGWM.Properties)).EndInit();
this.ResumeLayout(false);
}
--
Gitblit v1.9.3