| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraLayout.Utils; |
| | | using Gs.DevApp.DevFrm.Ck; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | strType = _strType; |
| | | txt_bl017.Text = _strType; |
| | | txt_bl017.Tag = "moren." + _strType; |
| | | if(_strType == "委外领料") |
| | | { |
| | | layoutControlItem14.Visibility = LayoutVisibility.Never; |
| | | } |
| | | } |
| | | protected override void OnCreateControl() |
| | | { |
| | |
| | | toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Form parentForm = this.FindForm(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter( gridView1, picCheckBox, parentForm, "bl018", "", (value) => |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, parentForm, "bl018", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | }, tips); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value); |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | }; |
| | | |
| | | //选择需要入库的明细 |
| | | btnSelect.Click += (s, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(this.txt_orgId.GetId())) |
| | | { |
| | | MsgHelper.ShowError("请选择生产组织!"); |
| | | txt_orgId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(this.txt_aboutGuid.GetId())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择生产工单!"); |
| | | return; |
| | | } |
| | | var frm = new UcWwBlclSelect(txt_aboutGuid.GetId(), this.txt_orgId.GetId()); |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | try |
| | | { |
| | | var lst = ee.DynamicList; |
| | | DataTable _Table = (DataTable)gcMx1.DataSource; |
| | | int idx = 1; |
| | | foreach (dynamic dym in lst) |
| | | { |
| | | DataRow _row = _Table.NewRow(); |
| | | _row["bld002"] = dym.itemNo;//物料编号 |
| | | _row["bld003"] = dym.itemName;//物料名称 |
| | | _row["bld004"] = dym.itemModel;//规格型号 |
| | | _row["dabGuid"] = dym.dabGuid; |
| | | _row["bld008"] = dym.dab007;//项次 |
| | | _row["bld009"] = dym.dwName;//项次 |
| | | _Table.Rows.Add(_row); |
| | | |
| | | idx++; |
| | | } |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = _Table; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | gvMx1.BestFitColumns(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | } |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList= Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | | Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | |
| | | lbGuid, txt_blNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 分页事件 |
| | | /// </summary> |
| | |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | gridView1.ActiveFilter.Clear(); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList, parentForm.GetType().FullName); |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList, parentForm.GetType().FullName); |
| | | frm.UpdateParent += Frm_UpdateParent; |
| | | frm.ShowDialog(); |
| | | } |
| | |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); |
| | | } |
| | | //2025/07/12加上修改状态下不能修改 |
| | | txt_orgId.IsReadly = true; |
| | | txt_aboutGuid.IsReadly = true; |
| | | } |
| | | /// <summary> |
| | | /// 新增事件 |
| | |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | //增加时,默认组织 |
| | | string deftOrg = UtilityHelper.GetFirstOrg(txt_orgId); |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | toolBarMenu1.isSetBtn = false; |
| | | string inGdId = txt_aboutGuid.GetId();//工单号 |
| | | string inCkId = txt_bl010.GetId();//发料仓 |
| | | string inFlOrg= txt_orgId.GetId();//发料组织 |
| | | string inFlOrg = txt_orgId.GetId();//发料组织 |
| | | if (string.IsNullOrEmpty(inFlOrg)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择发料组织!"); |
| | |
| | | /// <param name="pageSize">每页几条</param> |
| | | private void getPageList(int curPage) |
| | | { |
| | | var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | _sbSqlWhere += " and a.bl008='" + strType + "'"; |
| | | gcMain1.DataSource = null; |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.bl008='" + strType + "'"); |
| | | _sbSqlWhere.Append(" and a.org_id in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit; |
| | | DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); |
| | | gvMx1.SetFocusedRowCellValue("bld002", SelectedDataRow["itemNo"]); |
| | | gvMx1.SetFocusedRowCellValue("bld003", SelectedDataRow["itemName"]); |
| | | gvMx1.SetFocusedRowCellValue("bld004", SelectedDataRow["itemModel"]); |
| | | gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]); |
| | | gvMx1.SetFocusedRowCellValue("bld008", SelectedDataRow["dab007"]);//已领用量 |
| | | gvMx1.SetFocusedRowCellValue("bld009", SelectedDataRow["dwName"]);//单位 |
| | | } |
| | | |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |