| | |
| | | string _webServiceName = "MesCgthSqManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | string _ucGys = "";//供应商 |
| | | string _ucBm = "";//部门 |
| | | public Frm_MesCgthSq() |
| | | { |
| | | InitializeComponent(); |
| | |
| | | if (string.IsNullOrEmpty(orgId)) |
| | | return; |
| | | txt_suppId.getSuppler(orgId, _ucGys); |
| | | txt_fPurchaseDeptId.getSuppler(orgId, _ucBm); |
| | | // txt_fPurchaserId.getSuppler(); |
| | | }; |
| | | //选择需要的明细 |
| | | btnSelect.Click += (s, e) => |
| | |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择供应商!"); |
| | | return; |
| | | } |
| | | var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId()); |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | if (txt_fHasLinkRad.SelectedIndex == 0) |
| | | { |
| | | try |
| | | var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId()); |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | var lst = new List<string>(); |
| | | lst = ee.StringList; |
| | | var _obj = lst; |
| | | var strReturn = UtilityHelper.HttpPost("", |
| | | _webServiceName + "SelectFormTo", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var dt = UtilityHelper.ReturnToList(strReturn); |
| | | DataTable _newTable = dt.rtnData; |
| | | DataTable _oldTable = (DataTable)gcMx1.DataSource; |
| | | DataRow[] sourceRows = _newTable.Select(); |
| | | for (int i = 0; i < sourceRows.Length; i++) |
| | | try |
| | | { |
| | | _oldTable.ImportRow(sourceRows[i]); |
| | | var lst = new List<string>(); |
| | | lst = ee.StringList; |
| | | var _obj = lst; |
| | | var strReturn = UtilityHelper.HttpPost("", |
| | | _webServiceName + "SelectFormTo", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var dt = UtilityHelper.ReturnToList(strReturn); |
| | | DataTable _newTable = dt.rtnData; |
| | | DataTable _oldTable = (DataTable)gcMx1.DataSource; |
| | | DataRow[] sourceRows = _newTable.Select(); |
| | | for (int i = 0; i < sourceRows.Length; i++) |
| | | { |
| | | _oldTable.ImportRow(sourceRows[i]); |
| | | } |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = _oldTable; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); |
| | | } |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = _oldTable; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); |
| | | } |
| | | catch (Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | return; |
| | | } |
| | | if (txt_fHasLinkRad.SelectedIndex == 1) |
| | | { |
| | | var frm2 = new SelectMesCgthSqLink(this.txt_thOrgId.GetId()); |
| | | frm2.UpdateParent += (ss, ee) => |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | frm2.ShowDialog(); |
| | | return; |
| | | } |
| | | }; |
| | | //源单事件 |
| | | txt_fHasLinkRad.SelectedIndex = 0; |
| | | layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | txt_fHasLinkRad.SelectedIndexChanged += (s, e) => |
| | | { |
| | | setSrm(); |
| | | }; |
| | | } |
| | | private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); |
| | | } |
| | | //2025/07/12加上修改状态下不能修改 |
| | | setSrm(); |
| | | txt_thOrgId.IsReadly = true; |
| | | txt_suppId.IsReadly = true; |
| | | txt_fHasLinkRad.ReadOnly = true; |
| | | txt_fRequireOrgId.IsReadly = true; |
| | | txt_fOwnerIdHead.IsReadly = true; |
| | | txt_fPurchaseDeptId.IsReadly = true; |
| | | txt_fPurchaserId.IsReadly = true; |
| | | } |
| | | /// <summary> |
| | | /// 新增事件 |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | //增加时,默认组织 |
| | | string deftOrg = UtilityHelper.GetFirstOrg(txt_thOrgId); |
| | | |
| | | string deftXqOrg = UtilityHelper.GetFirstOrg(txt_fRequireOrgId); |
| | | string deftHzOrg = UtilityHelper.GetFirstOrg(txt_fOwnerIdHead); |
| | | setSrm(); |
| | | } |
| | | /// <summary> |
| | | /// 保存事件 |
| | |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | var _gysId = txt_suppId.GetId(); //供应商编号 |
| | | string _orgId = txt_thOrgId.GetId(); |
| | | string _orgId = txt_thOrgId.GetId();//退货组织 |
| | | string _xqzz = txt_fRequireOrgId.GetId();//需求组织 |
| | | string _hz = txt_fOwnerIdHead.GetId();//货主 |
| | | string _bm = txt_fPurchaseDeptId.GetId();//部门 |
| | | string _ygbh = txt_fPurchaserId.GetId();//员工 |
| | | if (string.IsNullOrEmpty(_orgId)) |
| | | { |
| | | MsgHelper.Warning("请选择组织!"); |
| | | MsgHelper.ShowError("请选择组织!"); |
| | | txt_thOrgId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_gysId)) |
| | | { |
| | | MsgHelper.Warning("请选择供应商!"); |
| | | MsgHelper.ShowError("请选择供应商!"); |
| | | txt_suppId.Focus(); |
| | | return; |
| | | } |
| | | if (txt_returnMethod.SelectedIndex <= 0) |
| | | { |
| | | MsgHelper.Warning("请选择退料方式!"); |
| | | MsgHelper.ShowError("请选择退料方式!"); |
| | | txt_returnMethod.Focus(); |
| | | return; |
| | | } |
| | | if (txt_returnType.SelectedIndex <= 0) |
| | | { |
| | | MsgHelper.Warning("请选择退料原因!"); |
| | | MsgHelper.ShowError("请选择退料原因!"); |
| | | txt_returnType.Focus(); |
| | | return; |
| | | } |
| | | //无源单要加上条件 |
| | | if (txt_fHasLinkRad.SelectedIndex == 1) |
| | | { |
| | | if (string.IsNullOrEmpty(_xqzz)) |
| | | { |
| | | MsgHelper.ShowError("请选择需求组织!"); |
| | | txt_fRequireOrgId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_hz)) |
| | | { |
| | | MsgHelper.ShowError("请选择货主!"); |
| | | txt_fOwnerIdHead.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_bm)) |
| | | { |
| | | MsgHelper.ShowError("请选择部门!"); |
| | | txt_fPurchaseDeptId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_ygbh)) |
| | | { |
| | | MsgHelper.ShowError("请选择员工!"); |
| | | txt_fPurchaserId.Focus(); |
| | | return; |
| | | } |
| | | } |
| | | var _obj = new |
| | | { |
| | |
| | | FType = txt_isOut.Checked == true ? 1 : 0, //0=采购,1=委外 |
| | | Fmrmode = txt_returnMethod.Text,//退料方式 |
| | | Reason = txt_returnType.Text,//退料原因 |
| | | thOrgId = _orgId, |
| | | fHasLink = txt_fHasLinkRad.SelectedIndex, |
| | | fRequireOrgId = _xqzz, |
| | | fPurchaseDeptId = _bm, |
| | | fPurchaserId = _ygbh, |
| | | fOwnerIdHead = _hz, |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | |
| | | _webServiceName + "EditModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_billNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | | if (string.IsNullOrEmpty(strGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); |
| | | ToolBox.MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | var _obj = new |
| | |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | _ucGys = dy.suppId; |
| | | _ucBm = dy.fPurchaseDeptId; |
| | | 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); |
| | | _ucGys = ""; |
| | | _ucBm = ""; |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | setSrm(); |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | case 0: |
| | | strMsg = "反审核"; |
| | | break; |
| | | }; |
| | | } |
| | | ; |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | |
| | | _webServiceName + "EditModelSubmit", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); |
| | | if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) |
| | | { |
| | | MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString()); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString()); |
| | | } |
| | | else |
| | | MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text); |
| | | getModel(lbGuid.Text); |
| | | MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | } |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | //var dr = gvMx1.GetDataRow(rowhandle); |
| | | var strOrgGuid = txt_thOrgId.GetId(); |
| | | if (string.IsNullOrEmpty(strOrgGuid)) |
| | | { |
| | | MsgHelper.Warning("提示:请先选择调出组织!"); |
| | | MsgHelper.ShowError("提示:请先选择调出组织!"); |
| | | return; |
| | | }; |
| | | } |
| | | ; |
| | | SelectCk frm = new SelectCk(strOrgGuid); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | |
| | | }; |
| | | frm.ShowDialog(); |
| | | } |
| | | |
| | | |
| | | private void setSrm() |
| | | { |
| | | int ddd = txt_fHasLinkRad.SelectedIndex; |
| | | if (ddd == 0) |
| | | { |
| | | layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | } |
| | | else |
| | | { |
| | | layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
| | | layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
| | | layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
| | | layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |