bug
lu
22 小时以前 3c84755b07eabfb5e87ade9d020a4d3399ab2a53
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs
@@ -35,14 +35,14 @@
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isCheck", "", (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;
            //选择库存组织(仓库和供应商)
@@ -52,7 +52,8 @@
                if (string.IsNullOrEmpty(orgId))
                    return;
                txt_fCustId.getSuppler(orgId, _ucKh);
                txt_fStockId.getSuppler(orgId, _ucCk);
                //2025-08-11加上只能是代管仓
                txt_fStockId.getSuppler(orgId, _ucCk, " and a.depot_id in(select [仓库Id] from [dbo].[仓库属性] where [是否Dgc]=1 )");
            };
            //选择需要的明细
            btnSelect.Click += (s, e) =>
@@ -69,7 +70,13 @@
                    this.txt_fCustId.Focus();
                    return;
                }
                var frm = new SelectShuoTuiSq(this.txt_fCustId.GetId(), txt_fStockOrgId.GetId(), txt_fIsLink.SelectedIndex.ToString());
                if (string.IsNullOrEmpty(this.txt_fStockId.GetId()))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择仓库!");
                    this.txt_fStockId.Focus();
                    return;
                }
                var frm = new SelectShuoTuiSq(this.txt_fCustId.GetId(), txt_fStockOrgId.GetId(), txt_fStockId.GetId(), txt_fHasLinkRad.SelectedIndex.ToString());
                //赋值给明细表
                frm.UpdateParent += (ss, ee) =>
                {
@@ -100,7 +107,7 @@
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
                    }
                };
                frm.ShowDialog();
@@ -144,7 +151,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();
        }
@@ -200,7 +207,7 @@
                lbGuid, txt_billNo, gridView1, "billNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?"))
@@ -218,20 +225,20 @@
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                else
                MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
@@ -269,7 +276,7 @@
                lbGuid, txt_billNo, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -283,6 +290,10 @@
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
            //2025/07/12加上修改状态下不能修改
            txt_fStockOrgId.IsReadly = true;
            txt_fCustId.IsReadly = true;
            txt_fHasLinkRad.ReadOnly = true;
        }
        /// <summary>
        /// 新增事件
@@ -297,6 +308,9 @@
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_fStockOrgId);
        }
        /// <summary>
        /// 保存事件
@@ -309,28 +323,27 @@
            var _ckId = txt_fStockId.GetId();
            var _khId = txt_fCustId.GetId();
            string _orgId = txt_fStockOrgId.GetId();
            int _fIsLink= txt_fIsLink.SelectedIndex==0?1:0;
            if (string.IsNullOrEmpty(_orgId))
            {
                MsgHelper.Warning("请选择组织!");
                MsgHelper.ShowError("请选择组织!");
                txt_fStockOrgId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_ckId))
            {
                MsgHelper.Warning("请选择仓库!");
                MsgHelper.ShowError("请选择仓库!");
                txt_fStockId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_khId))
            {
                MsgHelper.Warning("请选择客户!");
                MsgHelper.ShowError("请选择客户!");
                txt_fCustId.Focus();
                return;
            }
            if (txt_fReturnStyle.SelectedIndex <= 0)
            {
                MsgHelper.Warning("请选择退料方式!");
                MsgHelper.ShowError("请选择退料方式!");
                txt_fReturnStyle.Focus();
                return;
            }
@@ -341,14 +354,13 @@
                Remark = txt_remark.Text.Trim(), //备注
                CusId = int.Parse(_khId),
                DepotId = int.Parse(_ckId),
                FIsLink = _fIsLink,//有无源单
                FIsLink = txt_fHasLinkRad.SelectedIndex,//有无源单
                FReturnStyle = txt_fReturnStyle.Text,//退料方式
                list = new List<dynamic>(),
            }; gvMx1.PostEditor();
            };
            gvMx1.PostEditor();
            gvMx1.CloseEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0)
            {
                MsgHelper.ShowError("明细不能为空,请选择你的收料明细!");
@@ -366,7 +378,7 @@
                        MsgHelper.ShowError("申请数量不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["fStockStatusId"].ToString()) || row["fStockStatusId"].ToString()=="请选择")
                    if (string.IsNullOrEmpty(row["fStockStatusId"].ToString()) || row["fStockStatusId"].ToString() == "请选择")
                    {
                        MsgHelper.ShowError("请选择库存状态!");
                        return;
@@ -388,9 +400,9 @@
                    _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;
@@ -398,11 +410,14 @@
                    gvList.Add(gvMx1);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                    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);
            }
        }
@@ -413,7 +428,7 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "BILL_NO", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
@@ -429,7 +444,7 @@
                    {
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -455,7 +470,7 @@
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                ToolBox.MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            var _obj = new
@@ -497,11 +512,11 @@
                    }
                }
                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>
@@ -525,7 +540,7 @@
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
@@ -541,9 +556,10 @@
                    _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());
@@ -552,10 +568,12 @@
                    gridView1.FocusedRowHandle = rowHandle;
                    UtilityHelper.SetCheckIco(gridView1, "isCheck", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                }
                else
                    MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -590,13 +608,15 @@
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                        MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                        getModel(lbGuid.Text);
                    }
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                    else
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                    MsgHelper.ShowError("提示:" + ex.Message);
                }
            }
        }