| | |
| | | { |
| | | public partial class UcBlcl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | | string _ucCk = "";//仓库 |
| | | string _ucGd = "";//工单 |
| | | string _webServiceName = "MesItemBlManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | |
| | | { |
| | | string orgdId = txt_orgId.GetId(); |
| | | if (string.IsNullOrEmpty(orgdId)) return; |
| | | txt_bl010.getSuppler(orgdId, _ucCk); |
| | | txt_aboutGuid.getSuppler(orgdId, _ucGd, "and ( daa018<>'S:暂停') and ( daa018<>'W:完工')"); |
| | | }; |
| | | //设置仓库选择 |
| | | this.txt_bl010.EditChanged += (s, e) => |
| | | { |
| | | |
| | | }; |
| | | //设置工单 |
| | | this.txt_aboutGuid.EditChanged += (s, e) => |
| | |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | }; |
| | | |
| | | //选择需要入库的明细 |
| | | btnSelect.Click += (s, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(this.txt_orgId.GetId())) |
| | | { |
| | | MsgHelper.Warning("请选择生产组织!"); |
| | | txt_orgId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(this.txt_aboutGuid.GetId())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择生产工单!"); |
| | | return; |
| | | } |
| | | var frm = new UcBlclSelect(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["bld001"] = dym.gdh;//工单号 |
| | | _row["bld002"] = dym.itemNo;//物料编号 |
| | | _row["bld003"] = dym.itemName;//物料名称 |
| | | _row["bld004"] = dym.itemModel;//规格型号 |
| | | _row["dwName"] = dym.dwName; |
| | | _row["dabGuid"] = dym.dabGuid; |
| | | _row["bld013"] = idx.ToString();//项次 |
| | | _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) |
| | |
| | | toolBarMenu1.isSetBtn = false; |
| | | string inOrgId = txt_orgId.GetId();//工单号 |
| | | string inGdId = txt_aboutGuid.GetId();//工单号 |
| | | string inCkId = txt_bl010.GetId();//发料仓 |
| | | if (string.IsNullOrEmpty(inGdId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择工单!"); |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择工单!"); |
| | | txt_aboutGuid.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(inCkId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择仓库!"); |
| | | txt_bl010.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_bl017.Text.Trim())) |
| | |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | inOrgId = inOrgId,//工单号 |
| | | inGdId = inGdId,//工单号 |
| | | inCkId = inCkId,//仓库 |
| | | inYy = txt_bl007.Text.Trim(),//原因 |
| | | inType = txt_bl017.Text.Trim(), |
| | | list = new List<dynamic>(), |
| | |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | _ucCk = dy.bl010; |
| | | _ucGd = dy.aboutGuid; |
| | | lbGuid.Text = strGuid; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); |
| | | _ucCk = ""; |
| | | _ucGd = ""; |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit; |
| | | DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); |
| | | gvMx1.SetFocusedRowCellValue("bld001", SelectedDataRow["gdh"]); |
| | | gvMx1.SetFocusedRowCellValue("bld002", SelectedDataRow["itemNo"]); |
| | | gvMx1.SetFocusedRowCellValue("bld003", SelectedDataRow["itemName"]); |
| | | gvMx1.SetFocusedRowCellValue("bld004", SelectedDataRow["itemModel"]); |
| | | gvMx1.SetFocusedRowCellValue("dwName", SelectedDataRow["dwName"]); |
| | | gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]); |
| | | } |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |