From 4bc7030c4cea5b3deed0c938ec388ae94e33c51c Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 25 十月 2024 09:42:36 +0800
Subject: [PATCH] 修改会页

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs |  143 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 130 insertions(+), 13 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
index 530db9e..5f935af 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
@@ -1,7 +1,9 @@
+using DevExpress.XtraGrid.Views.Base.ViewInfo;
 using DevExpress.XtraGrid.Views.Grid;
 using DevExpress.XtraGrid.Views.Grid.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
+using MES.Service.Modes;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
@@ -26,6 +28,8 @@
             this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            this.toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
+            this.toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
             gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
             getPageList(1, UtilityHelper.GetPageSize());
             pageBar1.PagerEvent += PageBar1_PagerEvent;
@@ -46,19 +50,62 @@
             ucLookSupplier1.EditChanged += (s, e) =>
             {
                 var ddd = this.ucLookSupplier1.GetValue();
-                lbSupplierName.Text = ddd[1];
+              //  lbSupplierName.Text = ddd[1];
             };
             btnSelect.Click += (s, e) =>
             {
                 Gs.DevApp.UserControl.SelectCgMx frm = new UserControl.SelectCgMx();
                 frm.UpdateParent += (ss, ee) =>
                 {
-                    List<string> _StringList = new List<string>();
-                    _StringList = ee.StringList;
-                    MessageBox.Show(_StringList.Count.ToString());
+                    List<string> lst = new List<string>();
+                    lst = ee.StringList;
+                    var _obj = lst;
+                    string strReturn = UtilityHelper.HttpPost("", "MesInvItemArnDetailManager/GetListPageByCgmxGuid", JsonConvert.SerializeObject(_obj));
+                    ReturnModel<DataTable> dt = UtilityHelper.ReturnToList(strReturn);
+                    gcMx1.BindingContext = new BindingContext();
+                    gcMx1.DataSource = dt.rtnData;
+                    gcMx1.ForceInitialize();
                 };
                 frm.ShowDialog();
             };
+            ucLookCk1.EditChanged += (s, e) =>
+            {
+                var ddd = this.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)
+        {
+            this.toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+            this.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)
+        {
+            this.toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+            this.toolBarMenu1.guidKey = rowGuid;
         }
 
         /// <summary>
@@ -121,7 +168,7 @@
         private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -167,7 +214,7 @@
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -197,17 +244,56 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
+            string _ckCode = ucLookCk1.GetValue()[2];//浠撳簱缂栧彿 depots_code
+            string _gysCode = ucLookSupplier1.GetValue()[2];//渚涘簲鍟嗙紪鍙�
+            if (string.IsNullOrEmpty(_ckCode))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
-                // txt_account.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
+                ucLookCk1.Focus();
                 return;
             }
-            var _obj = new
+            if (string.IsNullOrEmpty(_gysCode))
             {
-                guid = lbGuid.Text.Trim(),//涓诲缓
-
-            };
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
+                ucLookSupplier1.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(txt_paperBillNo.Text.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨閫佽揣鍗曞彿锛�");
+                txt_paperBillNo.Focus();
+                return;
+            }
+            MesInvItemArn _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>();
+            gvMx1.CloseEditor();
+            gvMx1.UpdateCurrentRow();
+            for (int i = 0; i < gvMx1.DataRowCount; i++)
+            {
+                DataRow 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());
+                    _obj.list.Add(new MesInvItemArnDetail
+                    {
+                        Guid = _guid,
+                        AboutGuid = Guid.Parse(row["aboutGuid"].ToString()),
+                        ItemNo = row["itemNo"].ToString(),
+                        //ItemId= int.Parse( row["itemId"].ToString()),
+                        Quantity = decimal.Parse(row["quantity"].ToString()),
+                    });
+                }
+            }
             try
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
@@ -309,5 +395,36 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            int rowhandle = gvMx1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                DataRow dr = gvMx1.GetDataRow(rowhandle);
+                string mxGuid = dr["guid"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                string strJson = "";
+                List<string> lst = new List<string>();
+                lst.Add(mxGuid);
+                try
+                {
+                    strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModelMx", JsonConvert.SerializeObject(lst));
+                    ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        getModel(lbGuid.Text, true, 1);
+                    }
+                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3