lu
2025-02-12 f13592561fedab01d5d447a3f8db9026ce51b7c8
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -9,8 +9,6 @@
using System.Data;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
{
    public partial class Frm_MesItemQtrk : DevExpress.XtraEditors.XtraForm
@@ -31,7 +29,7 @@
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) =>
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
@@ -114,7 +112,6 @@
                       + "}";
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -201,7 +198,6 @@
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
@@ -271,8 +267,10 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
            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);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
        }
        /// <summary>
        /// 保存事件
@@ -282,34 +280,61 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            string inGys = txt_qt018.GetId();
            string inCjId = txt_qt008.GetId();
            if (string.IsNullOrEmpty(inGys))
            string kcZz = txt_qt022.GetId();//库存组织
            string kcBm = txt_qt009.GetId();//库存部门
            string kcGys = txt_qt018.GetId();//库存供应商
            string djLx = txt_qt003.Text.Trim();//单据类型
            string kcfx = txt_qt019.Text.Trim();//库存方向
            string inHzlx = ucLookHuoZhu1.GetHzLx();//货主类型
            string inHz = ucLookHuoZhu1.GetHzId();//货主
            string inRkyy = txt_qt010.Text.Trim();//入库原因
            string kcCk = txt_qt008.GetId();//仓库
            if (string.IsNullOrEmpty(kcZz))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择供应商!");
                txt_qt018.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择库存组织!");
                txt_qt022.Focus();
                return;
            }
            if (string.IsNullOrEmpty(inCjId))
            if (string.IsNullOrEmpty(inHzlx))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择仓库!");
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择货主类型!");
                return;
            }
            if (string.IsNullOrEmpty(inHz))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择货主!");
                return;
            }
            if (txt_qt003.SelectedIndex < 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!");
                txt_qt003.Focus();
                return;
            }
            if (txt_qt019.SelectedIndex <= 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择库存方向!");
                txt_qt019.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcCk))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择发料仓库!");
                txt_qt008.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                kcZz = txt_qt022.GetId(),//库存组织
                kcBm = txt_qt009.GetId(),//库存部门
                kcGys = txt_qt018.GetId(),//库存供应商
                kcCk = txt_qt008.GetId(),//库存供应商
                inRkyy = txt_qt010.Text.Trim(),//入库原因
                djLx = txt_qt003.Text.Trim(),//单据类型
                kcfx = txt_qt019.Text.Trim(),//库存方向
                hzlx = txt_qt023.Text.Trim(),//货主类型
                hzzz = txt_qt024.GetId(),//货主组织
                hzkh = txt_qt025.GetId(),//货主客户
                hzbm = txt_qt026.GetId(),//货主部门
                kcZz = kcZz,//库存组织
                kcBm = kcBm,//库存部门
                kcGys = kcGys,//库存供应商
                kcCk = kcCk,//库存仓库
                inRkyy = inRkyy,//入库原因
                djLx = djLx,//单据类型
                kcfx = kcfx,//库存方向
                hzlx = inHzlx,//货主类型
                inHz = inHz,//货主
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
@@ -347,9 +372,13 @@
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
                    lbGuid.Text = _rtn.rtnData;
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_qtck.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
                    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);
                }
            }
            catch (Exception ex)
@@ -365,7 +394,6 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
@@ -400,7 +428,6 @@
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        private void getModel(string strGuid)
        {
@@ -426,6 +453,7 @@
                    lbGuid.Text = strGuid;
                    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);
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
@@ -571,7 +599,6 @@
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            var _obj = new
            {
                guid = rowGuid,
@@ -584,21 +611,23 @@
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0)
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        getModel(lbGuid.Text.Trim());
                    else
                        getPageList(1);
                    }
                    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());
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle >= 0)
@@ -653,7 +682,5 @@
                }
            }
        }
    }
}