DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/ToolBox/UpdateParentEventArgs.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/SelectCheckDt.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/SelectCheckDt.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.Designer.cs
@@ -29,11 +29,16 @@ /// </summary> private void InitializeComponent() { DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject9 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject(); 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.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.gvMx1pid = new DevExpress.XtraGrid.Columns.GridColumn(); this.gvMx1facLevel = new DevExpress.XtraGrid.Columns.GridColumn(); this.rptJSSP = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); @@ -99,8 +104,19 @@ this.pageBar1 = new UserControls.Data.UcPageBar(); this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); this.tabMx = new DevExpress.XtraTab.XtraTabControl(); this.panel1 = new System.Windows.Forms.Panel(); this.xtraTabPage3 = new DevExpress.XtraTab.XtraTabPage(); this.gridControl2 = new DevExpress.XtraGrid.GridControl(); this.gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn14 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn15 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemButtonEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.btnSelect = new DevExpress.XtraEditors.SimpleButton(); this.panel1 = new System.Windows.Forms.Panel(); this.txt_itemModel = new DevExpress.XtraEditors.MemoEdit(); this.txt_ItemId = new Gs.DevApp.UserControl.UcLookItems(); this.txt_isenabled = new DevExpress.XtraEditors.CheckEdit(); @@ -137,6 +153,12 @@ this.xtraTabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tabMx)).BeginInit(); this.tabMx.SuspendLayout(); this.xtraTabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridControl2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gridView2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); this.panelControl1.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_isenabled.Properties)).BeginInit(); @@ -350,7 +372,7 @@ this.tabMxPage1.Controls.Add(this.gcMx1); this.tabMxPage1.Name = "tabMxPage1"; this.tabMxPage1.Size = new System.Drawing.Size(1125, 371); this.tabMxPage1.Text = "明细"; this.tabMxPage1.Text = "检验项目明细"; // // gcMx1 // @@ -429,10 +451,10 @@ // repositoryItemButtonEdit1 // this.repositoryItemButtonEdit1.AutoHeight = false; editorButtonImageOptions3.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16; editorButtonImageOptions3.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter; editorButtonImageOptions1.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16; editorButtonImageOptions1.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, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)}); 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)}); this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick); @@ -919,12 +941,149 @@ this.tabMx.Size = new System.Drawing.Size(1127, 403); this.tabMx.TabIndex = 2; this.tabMx.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabMxPage1}); this.tabMxPage1, this.xtraTabPage3}); // // xtraTabPage3 // this.xtraTabPage3.Controls.Add(this.gridControl2); this.xtraTabPage3.Controls.Add(this.panelControl1); this.xtraTabPage3.Name = "xtraTabPage3"; this.xtraTabPage3.Size = new System.Drawing.Size(1125, 371); this.xtraTabPage3.Text = "复制到其它物料"; // // gridControl2 // this.gridControl2.Dock = System.Windows.Forms.DockStyle.Fill; this.gridControl2.Location = new System.Drawing.Point(0, 43); this.gridControl2.MainView = this.gridView2; this.gridControl2.Name = "gridControl2"; this.gridControl2.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemButtonEdit3}); this.gridControl2.Size = new System.Drawing.Size(1125, 328); this.gridControl2.TabIndex = 1; this.gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2}); // // gridView2 // this.gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gridColumn11, this.gridColumn12, this.gridColumn13, this.gridColumn14, this.gridColumn15, this.gridColumn6}); this.gridView2.GridControl = this.gridControl2; this.gridView2.Name = "gridView2"; this.gridView2.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True; this.gridView2.OptionsFind.ShowSearchNavButtons = false; this.gridView2.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; this.gridView2.OptionsView.ShowGroupPanel = false; // // gridColumn11 // this.gridColumn11.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gridColumn11.AppearanceCell.Options.UseFont = true; this.gridColumn11.Caption = "使用组织"; this.gridColumn11.FieldName = "fSubsidiary"; this.gridColumn11.MinWidth = 150; this.gridColumn11.Name = "gridColumn11"; this.gridColumn11.Tag = "query_a.FCHECK_ITEM"; this.gridColumn11.Visible = true; this.gridColumn11.VisibleIndex = 0; this.gridColumn11.Width = 150; // // gridColumn12 // this.gridColumn12.Caption = "物料ID"; this.gridColumn12.FieldName = "id"; this.gridColumn12.MinWidth = 150; this.gridColumn12.Name = "gridColumn12"; this.gridColumn12.Visible = true; this.gridColumn12.VisibleIndex = 1; this.gridColumn12.Width = 150; // // gridColumn13 // this.gridColumn13.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gridColumn13.AppearanceCell.Options.UseFont = true; this.gridColumn13.Caption = "物料编号"; this.gridColumn13.FieldName = "itemNo"; this.gridColumn13.MinWidth = 150; this.gridColumn13.Name = "gridColumn13"; this.gridColumn13.Tag = "query_a.MEMO"; this.gridColumn13.Visible = true; this.gridColumn13.VisibleIndex = 2; this.gridColumn13.Width = 150; // // gridColumn14 // this.gridColumn14.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gridColumn14.AppearanceCell.Options.UseFont = true; this.gridColumn14.Caption = "物料名称"; this.gridColumn14.FieldName = "itemName"; this.gridColumn14.MinWidth = 150; this.gridColumn14.Name = "gridColumn14"; this.gridColumn14.Tag = "query_a.FCHECK_TOOL"; this.gridColumn14.Visible = true; this.gridColumn14.VisibleIndex = 3; this.gridColumn14.Width = 150; // // gridColumn15 // this.gridColumn15.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gridColumn15.AppearanceCell.Options.UseFont = true; this.gridColumn15.Caption = "规格型号"; this.gridColumn15.FieldName = "itemModel"; this.gridColumn15.MinWidth = 150; this.gridColumn15.Name = "gridColumn15"; this.gridColumn15.Tag = "query_a.SAMPLE_SIZE_NO"; this.gridColumn15.Visible = true; this.gridColumn15.VisibleIndex = 4; this.gridColumn15.Width = 150; // // gridColumn6 // this.gridColumn6.Caption = "移出"; this.gridColumn6.ColumnEdit = this.repositoryItemButtonEdit3; this.gridColumn6.MinWidth = 25; this.gridColumn6.Name = "gridColumn6"; this.gridColumn6.Visible = true; this.gridColumn6.VisibleIndex = 5; this.gridColumn6.Width = 94; // // repositoryItemButtonEdit3 // this.repositoryItemButtonEdit3.AutoHeight = false; editorButtonImageOptions2.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16; editorButtonImageOptions2.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter; this.repositoryItemButtonEdit3.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { 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.repositoryItemButtonEdit3.Name = "repositoryItemButtonEdit3"; this.repositoryItemButtonEdit3.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; // // panelControl1 // this.panelControl1.Controls.Add(this.btnSelect); this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top; this.panelControl1.Location = new System.Drawing.Point(0, 0); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(1125, 43); this.panelControl1.TabIndex = 0; // // btnSelect // this.btnSelect.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.lookup_reference_16x16; this.btnSelect.Location = new System.Drawing.Point(10, 5); this.btnSelect.Name = "btnSelect"; this.btnSelect.Size = new System.Drawing.Size(101, 29); this.btnSelect.TabIndex = 449; this.btnSelect.Text = "选择物料"; // // panel1 // this.panel1.BackColor = System.Drawing.Color.White; this.panel1.Controls.Add(this.btnSelect); this.panel1.Controls.Add(this.txt_itemModel); this.panel1.Controls.Add(this.txt_ItemId); this.panel1.Controls.Add(this.txt_isenabled); @@ -960,15 +1119,6 @@ this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(1127, 167); this.panel1.TabIndex = 1; // // btnSelect // this.btnSelect.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.lookup_reference_16x16; this.btnSelect.Location = new System.Drawing.Point(612, 131); this.btnSelect.Name = "btnSelect"; this.btnSelect.Size = new System.Drawing.Size(85, 29); this.btnSelect.TabIndex = 449; this.btnSelect.Text = "去复制"; // // txt_itemModel // @@ -1118,6 +1268,12 @@ this.xtraTabPage2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tabMx)).EndInit(); this.tabMx.ResumeLayout(false); this.xtraTabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridControl2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gridView2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); this.panelControl1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).EndInit(); @@ -1223,5 +1379,16 @@ private DevExpress.XtraGrid.Columns.GridColumn gvMxDel; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; private System.Windows.Forms.PictureBox picCheckBox; private DevExpress.XtraTab.XtraTabPage xtraTabPage3; private DevExpress.XtraEditors.PanelControl panelControl1; private DevExpress.XtraGrid.GridControl gridControl2; private DevExpress.XtraGrid.Views.Grid.GridView gridView2; private DevExpress.XtraGrid.Columns.GridColumn gridColumn11; private DevExpress.XtraGrid.Columns.GridColumn gridColumn12; private DevExpress.XtraGrid.Columns.GridColumn gridColumn13; private DevExpress.XtraGrid.Columns.GridColumn gridColumn14; private DevExpress.XtraGrid.Columns.GridColumn gridColumn15; private DevExpress.XtraGrid.Columns.GridColumn gridColumn6; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit3; } } DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
@@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraEditors; @@ -39,10 +40,10 @@ //初始化物料选择和各种下拉 _setIno(); } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); Task.Delay(100); Task.Delay(100); getPageList(1); } /// <summary> @@ -333,9 +334,9 @@ /// </summary> /// <param name="curPage">第几页</param> /// <param name="pageSize">每页几条</param> private void getPageList(int curPage) private void getPageList(int curPage) { var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.create_date", "asc", "", _sbSqlWhere.ToString()); @@ -372,7 +373,7 @@ { MsgHelper.Warning("提示:" + ex.Message); } } private void getModel(string strGuid, bool isEdit, int tabIdx) @@ -439,53 +440,30 @@ #region 以下为种种下拉 private void getCopyMx(string strGuid) private DataTable ListToTable<T>(List<T> items) { if (string.IsNullOrEmpty(strGuid)) DataTable dataTable = new DataTable(typeof(T).Name); // 获取所有的属性 PropertyInfo[] Props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (PropertyInfo prop in Props) { MsgHelper.Warning("请先选择你要复制的行!"); return; // 设置列的名字和数据类型 dataTable.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType); } var _obj = new // 遍历所有的对象 foreach (T item in items) { guid = strGuid }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModelIQC", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) var values = new object[Props.Length]; for (int i = 0; i < Props.Length; i++) { var dy = _rtn.rtnData; var _job = JObject.Parse(strJson); var array = new JArray(); foreach (var a in _job["rtnData"]["list"]) array.Add(a); var dt = JsonConvert.DeserializeObject<DataTable>( array.ToString()); if (dt.Rows.Count > 0) { gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); } else { MsgHelper.Warning("提示:没找到相应的明细,请选择其它试试!"); } // 插入属性值到datatable values[i] = Props[i].GetValue(item, null); } else { MsgHelper.Warning("提示:" + _rtn.rtnMsg); } dataTable.Rows.Add(values); } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } return dataTable; } private void _setIno() @@ -500,10 +478,12 @@ var frm = new SelectCheckDt(); frm.UpdateParent += (ss, ee) => { var lst = new List<string>(); lst = ee.StringList; getCopyMx(lst[0]); var lst = new List<dynamic>(); lst = ee.DynamicList; DataTable table = ListToTable(lst); gridControl2.BindingContext = new BindingContext(); gridControl2.DataSource = table; gridControl2.ForceInitialize(); }; frm.ShowDialog(); }; DevApp/Gs.DevApp/ToolBox/UpdateParentEventArgs.cs
@@ -12,5 +12,7 @@ public List<FilterEntity> FilterList { get; set; } public List<string> StringList { get; set; } public List<dynamic> DynamicList { get; set; } } } DevApp/Gs.DevApp/UserControl/SelectCheckDt.Designer.cs
@@ -31,16 +31,17 @@ this.gcMain = new DevExpress.XtraGrid.GridControl(); this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gv_guid = new DevExpress.XtraGrid.Columns.GridColumn(); this.是否可用 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_chk = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_salesOrderId = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_orderLineId = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_itemId = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_purchaseUnit = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_purchaseQty = new DevExpress.XtraGrid.Columns.GridColumn(); this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.pageBar1 = new UserControls.Data.UcPageBar(); this.btnIn = new DevExpress.XtraEditors.SimpleButton(); ((System.ComponentModel.ISupportInitialize)(this.gcMain)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit(); @@ -57,7 +58,7 @@ this.gcMain.Location = new System.Drawing.Point(0, 0); this.gcMain.MainView = this.gridView1; this.gcMain.Name = "gcMain"; this.gcMain.Size = new System.Drawing.Size(941, 607); this.gcMain.Size = new System.Drawing.Size(1112, 609); this.gcMain.TabIndex = 1; this.gcMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1}); @@ -68,12 +69,12 @@ this.gridView1.Appearance.Row.Options.UseFont = true; this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gv_guid, this.是否可用, this.gv_chk, this.gridColumn1, this.gv2, this.gv_salesOrderId, this.gv_orderLineId, this.gv_itemId, this.gv_purchaseUnit, this.gv_purchaseQty}); this.gv_itemId}); this.gridView1.GridControl = this.gcMain; this.gridView1.IndicatorWidth = 50; this.gridView1.Name = "gridView1"; @@ -93,89 +94,83 @@ this.gv_guid.Tag = "query_a.guid"; this.gv_guid.Width = 94; // // 是否可用 // gv_chk // this.是否可用.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.是否可用.AppearanceCell.Options.UseFont = true; this.是否可用.Caption = "采购单号 "; this.是否可用.FieldName = "isEnabled"; this.是否可用.MinWidth = 100; this.是否可用.Name = "是否可用"; this.是否可用.OptionsColumn.AllowEdit = false; this.是否可用.Tag = "query_a.BILL_NO"; this.是否可用.Visible = true; this.是否可用.VisibleIndex = 0; this.是否可用.Width = 100; this.gv_chk.Caption = "选择"; this.gv_chk.FieldName = "gvChk"; this.gv_chk.MaxWidth = 40; this.gv_chk.MinWidth = 40; this.gv_chk.Name = "gv_chk"; this.gv_chk.Visible = true; this.gv_chk.VisibleIndex = 0; this.gv_chk.Width = 40; // // gridColumn1 // this.gridColumn1.Caption = "使用组织"; this.gridColumn1.FieldName = "fSubsidiary"; this.gridColumn1.MinWidth = 25; this.gridColumn1.Name = "gridColumn1"; this.gridColumn1.Tag = "org.FNumber"; this.gridColumn1.Visible = true; this.gridColumn1.VisibleIndex = 1; this.gridColumn1.Width = 94; // // gv2 // this.gv2.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv2.AppearanceCell.Options.UseFont = true; this.gv2.Caption = "物料ID"; this.gv2.FieldName = "id"; this.gv2.MinWidth = 100; this.gv2.Name = "gv2"; this.gv2.OptionsColumn.AllowEdit = false; this.gv2.Tag = "query_a.id"; this.gv2.Visible = true; this.gv2.VisibleIndex = 2; this.gv2.Width = 100; // // gv_salesOrderId // this.gv_salesOrderId.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv_salesOrderId.AppearanceCell.Options.UseFont = true; this.gv_salesOrderId.Caption = "审批标志"; this.gv_salesOrderId.FieldName = "fOneChecked"; this.gv_salesOrderId.Caption = "物料编号"; this.gv_salesOrderId.FieldName = "itemNo"; this.gv_salesOrderId.MinWidth = 100; this.gv_salesOrderId.Name = "gv_salesOrderId"; this.gv_salesOrderId.OptionsColumn.AllowEdit = false; this.gv_salesOrderId.Tag = "query_a.SALES_ORDER_ID"; this.gv_salesOrderId.Tag = "query_a.itemNo"; this.gv_salesOrderId.Visible = true; this.gv_salesOrderId.VisibleIndex = 1; this.gv_salesOrderId.VisibleIndex = 3; this.gv_salesOrderId.Width = 100; // // gv_orderLineId // this.gv_orderLineId.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv_orderLineId.AppearanceCell.Options.UseFont = true; this.gv_orderLineId.Caption = "批准标记"; this.gv_orderLineId.FieldName = "fTwoChecked"; this.gv_orderLineId.Caption = "物料名称"; this.gv_orderLineId.FieldName = "itemName"; this.gv_orderLineId.MinWidth = 100; this.gv_orderLineId.Name = "gv_orderLineId"; this.gv_orderLineId.OptionsColumn.AllowEdit = false; this.gv_orderLineId.Tag = "query_a.ORDER_LINE_ID"; this.gv_orderLineId.Tag = "query_a.itemName"; this.gv_orderLineId.Visible = true; this.gv_orderLineId.VisibleIndex = 2; this.gv_orderLineId.VisibleIndex = 4; this.gv_orderLineId.Width = 100; // // gv_itemId // this.gv_itemId.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv_itemId.AppearanceCell.Options.UseFont = true; this.gv_itemId.Caption = "物料编码 "; this.gv_itemId.FieldName = "itemNo"; this.gv_itemId.Caption = "物料规格"; this.gv_itemId.FieldName = "itemModel"; this.gv_itemId.MinWidth = 100; this.gv_itemId.Name = "gv_itemId"; this.gv_itemId.OptionsColumn.AllowEdit = false; this.gv_itemId.Tag = "query_a.ITEM_ID"; this.gv_itemId.Tag = "query_a.itemModel"; this.gv_itemId.Visible = true; this.gv_itemId.VisibleIndex = 3; this.gv_itemId.VisibleIndex = 5; this.gv_itemId.Width = 100; // // gv_purchaseUnit // this.gv_purchaseUnit.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv_purchaseUnit.AppearanceCell.Options.UseFont = true; this.gv_purchaseUnit.Caption = "物料名称"; this.gv_purchaseUnit.FieldName = "itemName"; this.gv_purchaseUnit.MinWidth = 100; this.gv_purchaseUnit.Name = "gv_purchaseUnit"; this.gv_purchaseUnit.OptionsColumn.AllowEdit = false; this.gv_purchaseUnit.Tag = "query_a.PURCHASE_UNIT"; this.gv_purchaseUnit.Visible = true; this.gv_purchaseUnit.VisibleIndex = 4; this.gv_purchaseUnit.Width = 100; // // gv_purchaseQty // this.gv_purchaseQty.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 10F); this.gv_purchaseQty.AppearanceCell.Options.UseFont = true; this.gv_purchaseQty.Caption = "物料规格"; this.gv_purchaseQty.FieldName = "itemModel"; this.gv_purchaseQty.MinWidth = 100; this.gv_purchaseQty.Name = "gv_purchaseQty"; this.gv_purchaseQty.OptionsColumn.AllowEdit = false; this.gv_purchaseQty.Tag = "query_a.PURCHASE_QTY"; this.gv_purchaseQty.Visible = true; this.gv_purchaseQty.VisibleIndex = 5; this.gv_purchaseQty.Width = 100; // // xtraTabControl1 // @@ -183,7 +178,7 @@ this.xtraTabControl1.Location = new System.Drawing.Point(0, 0); this.xtraTabControl1.Name = "xtraTabControl1"; this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1; this.xtraTabControl1.Size = new System.Drawing.Size(943, 682); this.xtraTabControl1.Size = new System.Drawing.Size(1114, 682); this.xtraTabControl1.TabIndex = 3; this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.xtraTabPage1}); @@ -193,35 +188,46 @@ this.xtraTabPage1.Controls.Add(this.gcMain); this.xtraTabPage1.Controls.Add(this.panelControl1); this.xtraTabPage1.Name = "xtraTabPage1"; this.xtraTabPage1.Size = new System.Drawing.Size(941, 650); this.xtraTabPage1.Size = new System.Drawing.Size(1112, 650); this.xtraTabPage1.Text = "请选择需要导入的数据"; // // panelControl1 // this.panelControl1.Controls.Add(this.btnIn); this.panelControl1.Controls.Add(this.pageBar1); this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panelControl1.Location = new System.Drawing.Point(0, 607); this.panelControl1.Location = new System.Drawing.Point(0, 609); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(941, 43); this.panelControl1.Size = new System.Drawing.Size(1112, 41); this.panelControl1.TabIndex = 4; // // pageBar1 // this.pageBar1.CurrentPage = 1; this.pageBar1.Dock = System.Windows.Forms.DockStyle.Right; this.pageBar1.Location = new System.Drawing.Point(-45, 2); this.pageBar1.Location = new System.Drawing.Point(126, 2); this.pageBar1.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); this.pageBar1.Name = "pageBar1"; this.pageBar1.RecordCount = 0; this.pageBar1.Size = new System.Drawing.Size(984, 39); this.pageBar1.Size = new System.Drawing.Size(984, 37); this.pageBar1.TabIndex = 3; this.pageBar1.TotalPages = 0; // // btnIn // this.btnIn.Dock = System.Windows.Forms.DockStyle.Left; this.btnIn.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.checkbuttons_16x161; this.btnIn.Location = new System.Drawing.Point(2, 2); this.btnIn.Name = "btnIn"; this.btnIn.Size = new System.Drawing.Size(94, 37); this.btnIn.TabIndex = 6; this.btnIn.Text = "确定导入"; // // SelectCheckDt // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(943, 682); this.ClientSize = new System.Drawing.Size(1114, 682); this.Controls.Add(this.xtraTabControl1); this.IconOptions.Image = global::Gs.DevApp.Properties.Resources.logo_png_black; this.MaximizeBox = false; @@ -246,13 +252,14 @@ private DevExpress.XtraTab.XtraTabControl xtraTabControl1; private DevExpress.XtraTab.XtraTabPage xtraTabPage1; private UserControls.Data.UcPageBar pageBar1; private DevExpress.XtraGrid.Columns.GridColumn gv_purchaseQty; private DevExpress.XtraGrid.Columns.GridColumn gv_purchaseUnit; private DevExpress.XtraGrid.Columns.GridColumn gv_itemId; private DevExpress.XtraGrid.Columns.GridColumn gv_orderLineId; private DevExpress.XtraGrid.Columns.GridColumn gv_salesOrderId; private DevExpress.XtraGrid.Columns.GridColumn 是否可用; private DevExpress.XtraGrid.Columns.GridColumn gv2; private DevExpress.XtraGrid.Columns.GridColumn gv_guid; private DevExpress.XtraEditors.PanelControl panelControl1; private DevExpress.XtraGrid.Columns.GridColumn gridColumn1; private DevExpress.XtraGrid.Columns.GridColumn gv_chk; private DevExpress.XtraEditors.SimpleButton btnIn; } } DevApp/Gs.DevApp/UserControl/SelectCheckDt.cs
@@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraEditors; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Newtonsoft.Json; @@ -11,42 +11,43 @@ { public partial class SelectCheckDt : DevExpress.XtraEditors.XtraForm { private readonly List<FilterEntity> _filterList = new List<FilterEntity>(); private List<FilterEntity> _filterList = new List<FilterEntity>(); private readonly string _webServiceName = "MesQmCheckitemManager/"; public SelectCheckDt() { InitializeComponent(); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; getPageList(1, UtilityHelper.GetPageSize()); gridView1.IndicatorWidth = 50; gridView1.CustomDrawRowIndicator += (s, e) => Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1); btnIn.Click += (s, e) => { if (e.Info.IsRowIndicator && e.RowHandle >= 0) e.Info.DisplayText = (e.RowHandle + 1).ToString(); var list = new List<dynamic>(); for (var i = 0; i < gridView1.DataRowCount; i++) { var checkBox = gridView1.GetRowCellDisplayText(i, "gvChk"); if (checkBox == "Checked") { list.Add(new { guid = gridView1.GetRowCellValue(i, "guid").ToString(), fSubsidiary = gridView1.GetRowCellValue(i, "fSubsidiary").ToString(), id = gridView1.GetRowCellValue(i, "id").ToString(), itemNo = gridView1.GetRowCellValue(i, "itemNo").ToString(), itemName = gridView1.GetRowCellValue(i, "itemName").ToString(), itemModel = gridView1.GetRowCellValue(i, "itemModel").ToString(), }); } } UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list }); Close(); }; } /// <summary> /// 双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { var rowGuid = UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); if (string.IsNullOrEmpty(rowGuid)) return; var list = new List<string>(); list.Add(rowGuid); UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close(); _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); Task.Delay(100); getPageList(1); } /// <summary> @@ -61,36 +62,44 @@ /// <param name="pageSize"></param> private void PageBar1_PagerEvent(int curPage, int pageSize) { getPageList(curPage, pageSize); getPageList(curPage); } /// <summary> /// </summary> /// <param name="curPage">第几页</param> /// <param name="pageSize">每页几条</param> private void getPageList(int curPage, int pageSize) private void getPageList(int curPage) { var _sbSqlWhere = new StringBuilder(); foreach (var itm in _filterList) _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); var pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "item_no", "asc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); try { var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); var strReturn = UtilityHelper.HttpPost("", "MesItemsManager/GetListSelect", json); var dd = UtilityHelper.ReturnToTablePage(strReturn); var dt = dd.rtnData.list; gcMain.BindingContext = new BindingContext(); gcMain.DataSource = dt; gcMain.ForceInitialize(); var dddd = dd.rtnData.pages; //总页 pageBar1.TotalPages = dddd; pageBar1.RecordCount = dd.rtnData.total; //记录总数 pageBar1.CurrentPage = curPage; //当前页 pageBar1.setTxt(); if (dd.rtnCode > 0) { DataTable dt = dd.rtnData.list; gcMain.BindingContext = new BindingContext(); gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; if (dt.Rows.Count > 0) { gcMain.DataSource = dt; gcMain.ForceInitialize(); } else UtilityHelper.SetDefaultTable(gcMain, gridView1); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; pageBar1.TotalPages = dd.rtnData.pages;//总页 pageBar1.CurrentPage = curPage;//当前页 pageBar1.RecordCount = dd.rtnData.total;//总记录数 } else { ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg); } } catch (Exception ex) {