lu
2025-03-17 ca2aef7370cbfa419e3a0f0ea7467fa2c85f6c43
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
@@ -15,6 +15,8 @@
    {
        string _webServiceName = "MesCgthSqManager/";
        List<FilterEntity> _filterList = new List<FilterEntity>();
        string _ucCk = "";//发料仓库
        string _ucGys = "";//供应商
        public Frm_MesCgthSq()
        {
            InitializeComponent();
@@ -27,6 +29,8 @@
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) =>
            {
@@ -41,15 +45,14 @@
            });
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            txt_depotId.getSuppler("");
            txt_suppId.getSuppler("");
            //选择库存组织(仓库和供应商)
            txt_thOrgId.EditChanged += (s, e) =>
            {
                var orgId = txt_thOrgId.GetId();
                if (string.IsNullOrEmpty(orgId))
                    return;
                txt_suppId.getSuppler(orgId);
                txt_depotId.getSuppler(orgId);
                txt_suppId.getSuppler(orgId, _ucGys);
                txt_depotId.getSuppler(orgId, _ucCk);
            };
            //选择需要的明细
            btnSelect.Click += (s, e) =>
@@ -59,7 +62,7 @@
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择供应商!");
                    return;
                }
                var frm = new SelectMesCgthSq(this.txt_suppId.GetId(),this.txt_thOrgId.GetId(), (txt_isOut.Checked == true ? 1 : 0).ToString());
                var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId());
                //赋值给明细表
                frm.UpdateParent += (ss, ee) =>
                {
@@ -93,11 +96,23 @@
        }
        private async 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);
            await Task.Delay(100);
            getPageList(1);
        }
        /// <summary>
        /// 日志
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
        /// 分页事件
        /// </summary>
@@ -254,7 +269,7 @@
            {
                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
        }
        /// <summary>
@@ -268,7 +283,7 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
        }
        /// <summary>
@@ -300,13 +315,13 @@
                txt_depotId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_returnMethod.Text.Trim()))
            if (txt_returnMethod.SelectedIndex <= 0)
            {
                MsgHelper.Warning("请选择退料方式!");
                txt_returnMethod.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_returnType.Text.Trim()))
            if (txt_returnType.SelectedIndex <= 0)
            {
                MsgHelper.Warning("请选择退料原因!");
                txt_returnType.Focus();
@@ -324,6 +339,7 @@
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
            gvMx1.PostEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0)
            {
@@ -363,7 +379,10 @@
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_billNo.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                    toolBarMenu1.currentAction = "";
                }
            }
            catch (Exception ex)
@@ -389,16 +408,16 @@
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMain.BindingContext = new BindingContext();
                    gcMain1.BindingContext = new BindingContext();
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    if (dt.Rows.Count > 0)
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns();
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
@@ -435,10 +454,14 @@
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    _ucGys = dy.suppId;
                    _ucCk = dy.depotId;
                    lbGuid.Text = strGuid;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucGys = "";
                    _ucCk = "";
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list"])
@@ -523,6 +546,7 @@
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            gvMx1.CloseEditor();
            gvMx1.PostEditor();
            gvMx1.UpdateCurrentRow();
            var rowhandle = gvMx1.FocusedRowHandle;
            if (rowhandle < 0)