From 9ce8cb1ee053fb5ad4b51d724a5736e0e27ff0aa Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 23 五月 2025 09:10:52 +0800
Subject: [PATCH] 仓库

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs |  187 +++++++++++++++++++++-------------------------
 1 files changed, 87 insertions(+), 100 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
index 84b807d..531b7e8 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
@@ -14,13 +14,10 @@
 {
     public partial class Frm_MesShouTuo : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "MesItemQtrkManager/";
+        string _webServiceName = "MesShouTuoManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
-        string _ucGys = "";//渚涘簲鍟�
-        string _ucBm = "";//棰嗘枡閮ㄩ棬
-        string _ucCk = "";//鍙戞枡浠撳簱
-        string _ucHzlx = "";//璐т富绫诲瀷
-        string _ucHz = "";//璐т富
+        string _ucCk = "";//浠撳簱
+        string _ucKh = "";//瀹㈡埛
         public Frm_MesShouTuo()
         {
             InitializeComponent();
@@ -37,32 +34,27 @@
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) =>
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isCheck", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+            }, tips);
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
             }, (value) =>
             {
                 getPageList(this.pageBar1.CurrentPage);
-            });
+            }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-
             //閫夋嫨搴撳瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜屽彉璐т富锛�
-            this.txt_qt022.EditChanged += (s, e) =>
+            this.txt_fStockOrgId.EditChanged += (s, e) =>
             {
-                string _orgId = txt_qt022.GetId();
+                string _orgId = txt_fStockOrgId.GetId();
                 if (string.IsNullOrEmpty(_orgId))
                     return;
-                ucLookHuoZhu1.OrgId = _orgId;
-                ucLookHuoZhu1.HzId = _ucHz;
-                ucLookHuoZhu1.SetHzLx(_ucHzlx);
-                txt_qt009.getSuppler(_orgId, _ucBm);
-                txt_qt018.getSuppler(_orgId, _ucGys);
-                txt_qt008.getSuppler(_orgId, _ucCk);
+                txt_fCustId.getSuppler(_orgId, _ucKh);
+                txt_fStockId.getSuppler(_orgId, _ucCk);
                 System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
                 sbWhere.Append(" and a.FSubsidiary ='" + _orgId + "'");
                 var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
@@ -83,21 +75,21 @@
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
             this.ucBtnPrint1.btnDesignClick += (s, e) =>
             {
-                ucBtnPrint1.rptParameter = "rpt_Qtrk{}";
+                ucBtnPrint1.rptParameter = "rpt_Strk{}";
             };
             this.ucBtnPrint1.btnReportClick += (s, e) =>
             {
                 ucBtnPrint1.guidKey = "";
                 string rowGuid = lbMxGuid.Text.Trim();
                 ucBtnPrint1.guidKey = rowGuid;
-                if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim()))
                 {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
                     txt_iCount_1.Focus();
                     this.ucBtnPrint1.rptParameter = "return false";
                     return;
                 }
-                if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
                 {
                     Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
                     txt_psnQty_1.Focus();
@@ -110,17 +102,27 @@
                     this.ucBtnPrint1.rptParameter = "return false";
                     return;
                 }
-                this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
+                this.ucBtnPrint1.rptParameter = "rpt_Strk{" + lbMxGuid.Text.Trim()
                        + "," + ""
-                       + "," + ""
+                       + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
                        + "," + txt_iCount_1.Text.Trim()
                        + "," + txt_psnQty_1.Text.Trim()
                        + "}";
             };
+            //鑷姩璁$畻鎵撳嵃閲�
+            txt_psnQty_1.TextChanged += (s, e) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
+            };
+
+            radOut.SelectedIndexChanged += (s, e) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
+            };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
         }
@@ -134,7 +136,7 @@
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_qtck, gridView1);
+                lbGuid, txt_billNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
         }
 
@@ -157,7 +159,7 @@
             gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
             gridView1.ActiveFilter.Clear();
             gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-            var frm = new ShowFilter(gridView1.Columns, _filterList);
+            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
             frm.UpdateParent += Frm_UpdateParent;
             frm.ShowDialog();
         }
@@ -190,7 +192,7 @@
         {
             string rowGuid = "", rowName = "";
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_qtck, gridView1, "qtck");
+                lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -256,7 +258,7 @@
         {
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_qtck, gridView1);
+                lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -273,7 +275,6 @@
                 gvList.Add(gvMx1);
                 gvList.Add(gvMx2);
                 UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
-                ucLookHuoZhu1.Enabled = true;
             }
         }
         /// <summary>
@@ -291,7 +292,6 @@
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
-            ucLookHuoZhu1.Enabled = true;
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -301,64 +301,39 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            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();//浠撳簱
+            string kcZz = txt_fStockOrgId.GetId();//搴撳瓨缁勭粐
+            string inRkyy = txt_remark.Text.Trim();//鍘熷洜
+            string kcCk = txt_fStockId.GetId();//浠撳簱
+            string kh = txt_fCustId.GetId();//瀹㈡埛
             if (string.IsNullOrEmpty(kcZz))
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨缁勭粐锛�");
-                txt_qt022.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(inHzlx))
-            {
-                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();
+                txt_fStockOrgId.Focus();
                 return;
             }
             if (string.IsNullOrEmpty(kcCk))
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�");
-                txt_qt008.Focus();
+                txt_fStockId.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(kh))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨瀹㈡埛锛�");
+                txt_fCustId.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
                 kcZz = kcZz,//搴撳瓨缁勭粐
-                kcBm = kcBm,//搴撳瓨閮ㄩ棬
-                kcGys = kcGys,//搴撳瓨渚涘簲鍟�
                 kcCk = kcCk,//搴撳瓨浠撳簱
                 inRkyy = inRkyy,//鍏ュ簱鍘熷洜
-                djLx = djLx,//鍗曟嵁绫诲瀷
-                kcfx = kcfx,//搴撳瓨鏂瑰悜
-                hzlx = inHzlx,//璐т富绫诲瀷
-                inHz = inHz,//璐т富
+                kh = kh,
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
+            gvMx1.PostEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
             {
@@ -371,7 +346,7 @@
                 if (row != null)
                 {
                     Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
-                    string _msl = row["qd007"].ToString();
+                    string _msl = row["Sqsl"].ToString();
                     if (string.IsNullOrEmpty(_msl))
                     {
                         MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
@@ -381,8 +356,8 @@
                     {
                         Guid = _guid,
                         ItemId = (row["itemId"].ToString()),
-                        Sqsl = (row["qd007"].ToString()),
-                        Bz = (row["qd010"].ToString()),
+                        Sqsl = (row["Sqsl"].ToString()),
+                        Bz = (row["remark"].ToString()),
                     });
                 }
             }
@@ -394,14 +369,14 @@
                 if (_rtn.rtnCode > 0)
                 {
                     lbGuid.Text = _rtn.rtnData.outGuid;
-                    txt_qtck.Text = _rtn.rtnData.outNo;
+                    txt_billNo.Text = _rtn.rtnData.outNo;
                     toolBarMenu1.isSetBtn = true;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
                     gvList.Add(gvMx2);
                     UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
-                    ucLookHuoZhu1.Enabled = false;
                     toolBarMenu1.currentAction = "";
+                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                 }
             }
             catch (Exception ex)
@@ -417,8 +392,8 @@
         /// <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());
+            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "billNo", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
@@ -433,7 +408,7 @@
                     {
                         gcMain1.DataSource = dt;
                         gcMain1.ForceInitialize();
-                        gridView1.BestFitColumns();
+                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                     }
                     else
                         UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -454,6 +429,7 @@
         }
         private void getModel(string strGuid)
         {
+            gcMx1.DataSource = null;
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -473,22 +449,14 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
-                    _ucGys = dy.qt018;
-                    _ucBm = dy.qt009;
-                    _ucCk = dy.qt008;
-                    _ucHzlx = dy.qt023;
-                    _ucHz = dy.qt024;
+                    _ucCk = dy.fStockId;
+                    _ucKh = dy.fCustId;
                     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.layoutMx1.Controls, dy, isEdit, gvList);
-                    _ucGys = "";
-                    _ucBm = "";
                     _ucCk = "";
-                    _ucHzlx = "";
-                    _ucHz = "";
-                    ucLookHuoZhu1.Enabled = isEdit;
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -502,6 +470,7 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                     }
                     else
                     {
@@ -519,6 +488,7 @@
                         gcMx2.DataSource = dt2;
                         gcMx2.ForceInitialize();
                         gvMx2.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
                     }
                     else
                     {
@@ -538,11 +508,13 @@
         {
             SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
             DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
-            gvMx1.SetFocusedRowCellValue("qd002", SelectedDataRow["itemNo"]);
-            gvMx1.SetFocusedRowCellValue("qd003", SelectedDataRow["itemName"]);
-            gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]);
+            gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"]);
+            gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"]);
+            gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"]);
             gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]);
             gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]);
+            gvMx1.PostEditor();
+            gvMx1.UpdateCurrentRow();
         }
 
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -625,7 +597,7 @@
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-               lbGuid, txt_qtck, gridView1, "qtck");
+               lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -653,7 +625,7 @@
                     }
                     int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
+                    UtilityHelper.SetCheckIco(gridView1, "isCheck", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                 }
             }
             catch (Exception ex)
@@ -668,21 +640,36 @@
                 DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
                 lbMxGuid.Text = row["guid"].ToString();
                 ucBtnPrint1.guidKey = row["guid"].ToString();
-                txtWlid.Text = row["qd002"].ToString();
-                txtWlgg.Text = row["qd004"].ToString();
-                txtWlmc.Text = row["qd003"].ToString();
-                txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
+                txtWlid.Text = row["itemNo"].ToString();
+                txtWlgg.Text = row["itemModel"].ToString();
+                txtWlmc.Text = row["itemName"].ToString();
+                txtQuantity.Text = row["sqsl"].ToString();//鐢宠鎬婚噺
                 txtYdy.Text = row["ydy"].ToString();//宸叉墦鍗版�婚噺
-                txtKdy.Text = row["kdy"].ToString();//鍙墦鍗版�婚噺
+                txt_kQty.Text = row["kdy"].ToString();//鍙墦鍗版�婚噺
+            }
+            else
+            {
+                lbMxGuid.Text = "";
+                ucBtnPrint1.guidKey = "";
+                txtWlid.Text = "";
+                txtWlgg.Text = "";
+                txtWlmc.Text = "";
+                txtQuantity.Text = "";
+                txtYdy.Text = "";
+                txt_kQty.Text = "";
+                txt_psnQty_1.Text = "";
+                txt_iCount_1.Text = "";
             }
         }
         /// <summary>
-        /// 绉诲嚭鏉$爜
+        /// 閲嶆墦鏉$爜
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
         private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
+            MsgHelper.ShowInformation("鍔熻兘寮�鍙戜腑锛�");
+            return;
             var rowhandle = gvMx2.FocusedRowHandle;
             if (rowhandle < 0)
                 return;
@@ -700,7 +687,7 @@
                 try
                 {
                     var strJson = UtilityHelper.HttpPost("",
-                        _webServiceName + "DeleteBarcode",
+                           "VArrivalBarcodeManager/DeleteBarcode",
                         JsonConvert.SerializeObject(_obj));
                     var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                     if (_rtn.rtnCode > 0)

--
Gitblit v1.9.3