lu
2025-04-14 ecb7a60de1639f520712ce95f99414b0dd2c9713
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -33,22 +33,23 @@
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1);
           Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter( gridView1, picCheckBox, this, "isSh", "", (value) =>
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
            }, tips);
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            });
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            //选择库存组织(变明细中的物料和变货主)
            this.txt_qt022.EditChanged += (s, e) =>
            {
@@ -58,7 +59,7 @@
                ucLookHuoZhu1.OrgId = _orgId;
                ucLookHuoZhu1.HzId = _ucHz;
                ucLookHuoZhu1.SetHzLx(_ucHzlx);
                txt_qt009.getSuppler(_orgId,_ucBm);
                txt_qt009.getSuppler(_orgId, _ucBm);
                txt_qt018.getSuppler(_orgId, _ucGys);
                txt_qt008.getSuppler(_orgId, _ucCk);
                System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
@@ -78,7 +79,6 @@
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            };
            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
            this.ucBtnPrint1.btnDesignClick += (s, e) =>
            {
@@ -111,15 +111,26 @@
                }
                this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
                       + "," + ""
                       + "," + ""
                       + "," + Gs.DevApp.ToolBox.UtilityHelper.PrintYuLiang(radOut).ToString()
                       + "," + txt_iCount_1.Text.Trim()
                       + "," + txt_psnQty_1.Text.Trim()
                       + "}";
            };
            //自动计算打印量
            txt_psnQty_1.TextChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut);
            };
            radOut.SelectedIndexChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut);
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
@@ -156,7 +167,7 @@
            gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
            gridView1.ActiveFilter.Clear();
            gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
            var frm = new ShowFilter(gridView1.Columns, _filterList);
            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
            frm.UpdateParent += Frm_UpdateParent;
            frm.ShowDialog();
        }
@@ -271,7 +282,7 @@
                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                gvList.Add(gvMx1);
                gvList.Add(gvMx2);
                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
                ucLookHuoZhu1.Enabled = true;
            }
        }
@@ -287,7 +298,7 @@
            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gridViews.Add(gvMx1);
            gridViews.Add(gvMx2);
            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
            ucLookHuoZhu1.Enabled = true;
@@ -337,9 +348,15 @@
                txt_qt019.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcBm) && string.IsNullOrEmpty(kcGys))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("部门或供应商必须选一个!");
                txt_qt009.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcCk))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择发料仓库!");
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!");
                txt_qt008.Focus();
                return;
            }
@@ -398,9 +415,10 @@
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    gvList.Add(gvMx2);
                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                    ucLookHuoZhu1.Enabled = false;
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
            }
            catch (Exception ex)
@@ -426,16 +444,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();
                        gridView1.BestFitColumns();
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
@@ -453,6 +471,7 @@
        }
        private void getModel(string strGuid)
        {
            gcMx1.DataSource = null;
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -481,8 +500,8 @@
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    gvList.Add(gvMx2);
                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                    _ucGys ="";
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucGys = "";
                    _ucBm = "";
                    _ucCk = "";
                    _ucHzlx = "";
@@ -501,6 +520,7 @@
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                    }
                    else
                    {
@@ -518,6 +538,7 @@
                        gcMx2.DataSource = dt2;
                        gcMx2.ForceInitialize();
                        gvMx2.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
                    }
                    else
                    {
@@ -652,8 +673,7 @@
                    }
                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                    gridView1.FocusedRowHandle = rowHandle;
                    Form parentForm = this.FindForm();
                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, parentForm, _inFieldValue.ToString());
                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
                }
            }
            catch (Exception ex)
@@ -663,6 +683,7 @@
        }
        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle >= 0)
            {
                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
@@ -671,9 +692,22 @@
                txtWlid.Text = row["qd002"].ToString();
                txtWlgg.Text = row["qd004"].ToString();
                txtWlmc.Text = row["qd003"].ToString();
                 txtQuantity.Text = row["qd007"].ToString();//申请总量
                 txtYdy.Text = row["ydy"].ToString();//已打印总量
                 txtKdy.Text = row["kdy"].ToString();//可打印总量
                txtQuantity.Text = row["qd007"].ToString();//申请总量
                txt_yQty.Text = row["ydy"].ToString();//已打印总量
                txt_kQty.Text = row["kdy"].ToString();//可打印总量
            }
            else
            {
                lbMxGuid.Text = "";
                ucBtnPrint1.guidKey = "";
                txtWlid.Text = "";
                txtWlgg.Text = "";
                txtWlmc.Text = "";
                txtQuantity.Text = "";
                txt_yQty.Text = "";
                txt_kQty.Text = "";
                txt_psnQty_1.Text = "";
                txt_iCount_1.Text = "";
            }
        }
        /// <summary>
@@ -700,7 +734,7 @@
                try
                {
                    var strJson = UtilityHelper.HttpPost("",
                        _webServiceName + "DeleteBarcode",
                        "VArrivalBarcodeManager/DeleteBarcode",
                        JsonConvert.SerializeObject(_obj));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)