From 2ffa3cda080d1990775fe42e13ced433d27ca3e8 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 10 十二月 2024 10:36:37 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesInvItemMoves.cs |  135 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 123 insertions(+), 12 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesInvItemMoves.cs b/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesInvItemMoves.cs
index c3b615c..ee0ffef 100644
--- a/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesInvItemMoves.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesInvItemMoves.cs
@@ -1,5 +1,4 @@
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+using DevExpress.XtraEditors;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -16,7 +15,7 @@
 {
     public partial class Frm_MesInvItemMoves : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "User/";
+        string _webServiceName = "MesInvItemMovesManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
         public Frm_MesInvItemMoves()
         {
@@ -46,11 +45,33 @@
                 Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
+            var _obj = new
+            {
+                currentPage = 1,
+                everyPageSize = 999999,
+                sortName = "",
+                keyWhere = "",
+            };
+            var json = JsonConvert.SerializeObject(_obj);
+            try
+            {
+                var strReturn = UtilityHelper.HttpPost("",
+                    "MesItemsManager/GetListSelect", json);
+                var rtn = UtilityHelper.ReturnToTablePage(strReturn);
+                var dt = rtn.rtnData.list;
+                this.repositoryItemSearchLookUpEdit1.DataSource = dt;
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
-        private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+
+
+        private   void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
-            await Task.Delay(100);
+           Task.Delay(100);
             getPageList(1);
         }
         /// <summary>
@@ -204,16 +225,56 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
+            string _fromDepotsId = txt_fromDepotsId.GetId();
+            string _invDepotsId = txt_invDepotsId.GetId();
+            if (string.IsNullOrEmpty(_fromDepotsId))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
-                // txt_account.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鍙戞枡浠撲笉鑳戒负绌猴紒");
+                txt_fromDepotsId.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(_invDepotsId))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鏀舵枡浠撲笉鑳戒负绌猴紒");
+                txt_invDepotsId.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                inFromDepotsId = _fromDepotsId,//鍙戞枡浠�
+                inInvDepotsId = _invDepotsId,//鏀舵枡浠�
+                inBz = txt_remark.Text.Trim(),//澶囨敞
+                list = new List<dynamic>(),
             };
+            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 = UtilityHelper.ToGuid(row["guid"].ToString());
+                    //string _msl = row["quantity"].ToString();
+                    //if (string.IsNullOrEmpty(_msl))
+                    //{
+                    //    MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
+                    //    return;
+                    //}
+                    _obj.list.Add(new
+                    {
+                        Guid = _guid,
+                        ItemId = (row["itemId"].ToString()),
+                        Sqsl = (row["quantity"].ToString()),
+                        Bz = (row["remark"].ToString()),
+                    });
+                }
+            }
             try
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
@@ -237,15 +298,15 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private async void getPageList(int curPage)
+        private   void getPageList(int curPage)
         {
-            UcLoading _loading = new UcLoading();
+            
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
-                var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json);
+                var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
                 ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
                 if (dd.rtnCode > 0)
                 {
@@ -273,7 +334,7 @@
             {
                 ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
-            _loading.Stop();
+            
         }
         private void getModel(string strGuid, bool isEdit, int tabIdx)
         {
@@ -324,5 +385,55 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+        private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
+        {
+            SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
+            DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
+            gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"]);
+            gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"]);
+            gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"]);
+        }
+
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gvMx1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                var dr = gvMx1.GetDataRow(rowhandle);
+                var mxGuid = dr["guid"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                if (string.IsNullOrEmpty(mxGuid))
+                {
+                    gvMx1.DeleteRow(rowhandle);
+                    return;
+                }
+                var _obj = new
+                {
+                    guid = lbGuid.Text.Trim(),
+                    mxGuid = mxGuid,
+                };
+                try
+                {
+                    var strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "DeleteModelOrMx",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+                    }
+                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
+        }
+
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3