lu
2024-11-01 c2248f08e9bdc75cac6a329bf37234c7af17f16c
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
@@ -4,8 +4,10 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.DataAccess.DataFederation;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Views.Base.ViewInfo;
using DevExpress.XtraGrid.Views.Grid;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -37,6 +39,7 @@
            toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
            toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
            getPageList(1, UtilityHelper.GetPageSize());
            gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -54,9 +57,15 @@
            };
            this.txt_depotsCode.KeyFile = "depotCode";
            this.txt_suppNo.KeyFile = "suppNo";
            //选择需要入库的明细
            btnSelect.Click += (s, e) =>
            {
                var frm = new SelectCgMx();
                if (string.IsNullOrEmpty(this.txt_suppNo.GetId()))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择供应商,才能选择来料明细!");
                    return;
                }
                var frm = new SelectCgMx(this.txt_suppNo.GetCode());
                frm.UpdateParent += (ss, ee) =>
                {
                    var lst = new List<string>();
@@ -66,17 +75,28 @@
                        "MesInvItemArnDetailManager/GetListPageByCgmxGuid",
                        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 = dt.rtnData;
                    gcMx1.DataSource = _oldTable;
                    gcMx1.ForceInitialize();
                };
                frm.ShowDialog();
            };
        }
        private void ToolBarMenu1_btnFjianYanClick1(object sender, EventArgs e)
        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
        {
            throw new NotImplementedException();
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
@@ -261,13 +281,6 @@
            toolBarMenu1.isSetBtn = false;
            var _ckCode = txt_depotsCode.GetCode(); //仓库编号 depots_code
            var _gysCode = txt_suppNo.GetCode(); //供应商编号
            if (string.IsNullOrEmpty(_ckCode))
            {
                MsgHelper.Warning("请选择仓库!");
                txt_depotsCode.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_gysCode))
            {
                MsgHelper.Warning("请选择供应商!");
@@ -275,24 +288,25 @@
                return;
            }
            if (string.IsNullOrEmpty(txt_paperBillNo.Text.Trim()))
            if (string.IsNullOrEmpty(_ckCode))
            {
                MsgHelper.Warning("请选择送货单号!");
                txt_paperBillNo.Focus();
                MsgHelper.Warning("请选择仓库!");
                txt_depotsCode.Focus();
                return;
            }
            var _obj = new MesInvItemArn();
            _obj.Guid = null; //到货单主键
            _obj.Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()); //到货单主键
            _obj.PaperBillNo = txt_paperBillNo.Text.Trim(); //送货单号;
            _obj.Remark = ""; //备注
            _obj.Remark = txt_remark.Text.Trim(); //备注
            _obj.SuppNo = _gysCode; //供应商编号
            _obj.DepotsCode = _ckCode; //仓库编号 depots_code
            _obj.FType = 1; //0=采购,1=委外
            _obj.FType = txt_fType.Checked; //0=采购,1=委外
            _obj.UrgentFlag = txt_urgentFlag.Checked;//0=不急,1=急
            _obj.list = new List<MesInvItemArnDetail>();
            gvMx1.CloseEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0) {
            if (gvMx1.DataRowCount <= 0)
            {
                MsgHelper.ShowError("明细不能为空,请选择你的收料明细!");
                return;
            }