From f924cbebf1695c6323c1ed38f418dccd288fe1b9 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 06 十一月 2024 14:45:27 +0800
Subject: [PATCH] iqc

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs |  189 ++++++++++++++++++++++++++++------------------
 1 files changed, 114 insertions(+), 75 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
index 0d757e2..6e3b0e4 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
@@ -20,10 +20,13 @@
     {
         private List<FilterEntity> _filterList = new List<FilterEntity>();
         private readonly string _webServiceName = "MesInvItemArnManager/";
-
         public Frm_MesInvItemArn()
         {
             InitializeComponent();
+            pageBar1.PagerEvent += PageBar1_PagerEvent;
+            this.gridView1.ColumnPanelRowHeight = 60;
+            this.gridView1.OptionsView.AllowHtmlDrawHeaders = true;
+            this.gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
             toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
             toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
             toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
@@ -33,9 +36,9 @@
             toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
             toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
+            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
             gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
             getPageList(1, UtilityHelper.GetPageSize());
-            pageBar1.PagerEvent += PageBar1_PagerEvent;
             gridView1.CustomDrawRowIndicator += (s, e) =>
             {
                 if (e.Info.IsRowIndicator && e.RowHandle >= 0)
@@ -49,14 +52,28 @@
                     e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
-            ucLookSupplier1.EditChanged += (s, e) =>
+            //璁剧疆浠撳簱閫夋嫨
+            this.txt_depotsId.KeyFile = "depotId";
+            this.txt_depotsId.EditChanged += (s, e) =>
             {
-                var ddd = ucLookSupplier1.GetValue();
-                //  lbSupplierName.Text = ddd[1];
+                txtDepotsId.Text = this.txt_depotsId.GetId();
             };
+            //璁剧疆渚涘簲鍟嗛�夋嫨
+            this.txt_suppId.KeyFile = "id";
+            this.txt_suppId.EditChanged += (s, e) =>
+            {
+                txtSupplierId.Text = this.txt_suppId.GetId();
+            };
+            //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
             btnSelect.Click += (s, e) =>
             {
-                var frm = new SelectCgMx();
+                if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紝鎵嶈兘閫夋嫨鏉ユ枡鏄庣粏锛�");
+                    return;
+                }
+                var frm = new SelectCgMx(this.txt_suppId.GetId());
+                //璧嬪�肩粰鏄庣粏琛�
                 frm.UpdateParent += (ss, ee) =>
                 {
                     var lst = new List<string>();
@@ -66,53 +83,21 @@
                         "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();
             };
-            ucLookCk1.EditChanged += (s, e) =>
-            {
-                var ddd = ucLookCk1.GetValue();
-                //lbCkName.Text = ddd[1];
-            };
         }
-
-        private void ToolBarMenu1_btnFjianYanClick1(object sender, EventArgs e)
-        {
-            throw new NotImplementedException();
-        }
-
-        /// <summary>
-        ///     鍙嶆楠�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-        }
-
-        /// <summary>
-        ///     妫�楠�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-        }
+      
 
         /// <summary>
         ///     鍙屽嚮浜嬩欢
@@ -159,7 +144,49 @@
             _filterList = e.FilterList;
             getPageList(1, pageBar1.RowsCount);
         }
+        /// <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>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
+
+        /// <summary>
+        ///     妫�楠�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
         /// <summary>
         ///     鍙栨秷浜嬩欢
         /// </summary>
@@ -264,49 +291,51 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            var _ckCode = ucLookCk1.GetValue()[2]; //浠撳簱缂栧彿 depots_code
-            var _gysCode = ucLookSupplier1.GetValue()[2]; //渚涘簲鍟嗙紪鍙�
-            if (string.IsNullOrEmpty(_ckCode))
-            {
-                MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
-                ucLookCk1.Focus();
-                return;
-            }
-
-            if (string.IsNullOrEmpty(_gysCode))
+            var _ckId = txt_depotsId.GetId(); //浠撳簱缂栧彿 depots_code
+            var _gysId = txt_suppId.GetId(); //渚涘簲鍟嗙紪鍙�
+            if (string.IsNullOrEmpty(_gysId))
             {
                 MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
-                ucLookSupplier1.Focus();
+                txt_suppId.Focus();
                 return;
             }
 
-            if (string.IsNullOrEmpty(txt_paperBillNo.Text.Trim()))
+            if (string.IsNullOrEmpty(_ckId))
             {
-                MsgHelper.Warning("璇烽�夋嫨閫佽揣鍗曞彿锛�");
-                txt_paperBillNo.Focus();
+                MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
+                txt_depotsId.Focus();
                 return;
             }
-
-            var _obj = new MesInvItemArn();
-            _obj.Guid = null; //鍒拌揣鍗曚富閿�
-            _obj.PaperBillNo = txt_paperBillNo.Text.Trim(); //閫佽揣鍗曞彿;
-            _obj.Remark = ""; //澶囨敞
-            _obj.SuppNo = _gysCode; //渚涘簲鍟嗙紪鍙�
-            _obj.DepotsCode = _ckCode; //浠撳簱缂栧彿 depots_code
-            _obj.FType = 1; //0=閲囪喘锛�1=濮斿
-            _obj.list = new List<MesInvItemArnDetail>();
+            var _obj = new MesInvItemArn()
+            {
+                Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //鍒拌揣鍗曚富閿�
+                PaperBillNo = txt_paperBillNo.Text.Trim(), //閫佽揣鍗曞彿;
+                Remark = txt_remark.Text.Trim(), //澶囨敞
+                SuppId = _gysId, //渚涘簲鍟�
+                DepotsId = _ckId,//浠撳簱
+                FType = txt_fType.Checked,//0=閲囪喘锛�1=濮斿
+                UrgentFlag = txt_urgentFlag.Checked,//0=涓嶆�ワ紝1=鎬�
+                list = new List<MesInvItemArnDetail>(),
+            };
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
+            if (gvMx1.DataRowCount <= 0)
+            {
+                MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨浣犵殑鏀舵枡鏄庣粏锛�");
+                return;
+            }
             for (var i = 0; i < gvMx1.DataRowCount; i++)
             {
                 var row = gvMx1.GetDataRow(i);
                 if (row != null)
                 {
-                    Guid? _guid = null;
-                    if (string.IsNullOrEmpty(row["guid"].ToString()))
-                        _guid = null;
-                    else
-                        _guid = Guid.Parse(row["guid"].ToString());
+                    Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
+                    string _msl = row["quantity"].ToString();
+                    if (string.IsNullOrEmpty(_msl))
+                    {
+                        MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
+                        return;
+                    }
                     _obj.list.Add(new MesInvItemArnDetail
                     {
                         Guid = _guid,
@@ -428,6 +457,11 @@
             }
         }
 
+        /// <summary>
+        /// 鏄庣粏鍒犻櫎
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void repositoryItemButtonEdit1_ButtonClick(object sender,
             ButtonPressedEventArgs e)
         {
@@ -440,6 +474,11 @@
                 var mxGuid = dr["guid"].ToString();
                 if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
                     return;
+                if (string.IsNullOrEmpty(mxGuid))
+                {
+                    gvMx1.DeleteRow(rowhandle);
+                    return;
+                }
                 var strJson = "";
                 var lst = new List<string>();
                 lst.Add(mxGuid);

--
Gitblit v1.9.3