From d35bb711f8d3d267b44b4a80c20e31dabf309ae7 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 14 一月 2025 08:17:18 +0800
Subject: [PATCH] 其它入库

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs |  207 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 115 insertions(+), 92 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
index f055670..8cd1442 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraGrid.Views.Base.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -7,10 +8,9 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Drawing;
 using System.Threading.Tasks;
 using System.Windows.Forms;
-using System.Windows.Media.Animation;
+
 
 namespace Gs.DevApp.DevFrm
 {
@@ -30,8 +30,7 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
-            toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -77,15 +76,52 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            gcMx1.MouseClick += GcMx1_MouseClick;
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
+            this.ucBtnPrint1.btnDesignClick += (s, e) =>
+            {
+                ucBtnPrint1.rptParameter = "rpt_Qtrk{}";
+            };
+            this.ucBtnPrint1.btnReportClick += (s, e) =>
+            {
+                ucBtnPrint1.guidKey = "";
+                string rowGuid = lbMxGuid.Text.Trim();
+                ucBtnPrint1.guidKey = rowGuid;
+                if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
+                    txt_iCount_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+                    txt_psnQty_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (lbMxGuid.Text.Trim().Length < 10)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
+                       + "," + ""
+                       + "," + ""
+                       + "," + txt_iCount_1.Text.Trim()
+                       + "," + txt_psnQty_1.Text.Trim()
+                       + "}";
+            };
         }
-        private   void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ 
+        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
-           Task.Delay(100);
+            Task.Delay(100);
             getPageList(1);
         }
-      
+
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -119,57 +155,6 @@
             _filterList = e.FilterList;
             getPageList(1);
         }
-        private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_qtck, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-            toolBarMenu1.rptParameter = "rpt_Qtrk{}";
-        }
-        private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
-        {
-            //toolBarMenu1.guidKey = "";
-            //string rowGuid, rowName;
-            //(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-            //    lbGuid, txt_itemName, gridView1);
-            //toolBarMenu1.guidKey = rowGuid;
-            //if (xtraTabControl1.SelectedTabPageIndex == 0)
-            //{
-            //    getModel(rowGuid, false, 999);
-            //    this.toolBarMenu1.rptParameter = "return false";
-            //    return;
-            //}
-            //if (string.IsNullOrEmpty(txt_suppNo_1.GetCode()))
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨渚涘簲鍟嗭紒");
-            //    txt_suppNo_1.Focus();
-            //    this.toolBarMenu1.rptParameter = "return false";
-            //    return;
-            //}
-            //if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
-            //    txt_iCount_1.Focus();
-            //    this.toolBarMenu1.rptParameter = "return false";
-            //    return;
-            //}
-            //if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
-            //    txt_psnQty_1.Focus();
-            //    this.toolBarMenu1.rptParameter = "return false";
-            //    return;
-            //}
-            //this.toolBarMenu1.rptParameter = "rpt_ItemInv{" + txt_createDate1.Text.Trim()
-            //       + "," + txt_tc_1.Checked.ToString().ToUpper()
-            //       + "," + txt_suppNo_1.GetId()
-            //       + "," + txt_iCount_1.Text.Trim()
-            //       + "," + txt_psnQty_1.Text.Trim()
-            //       + "}";
-        }
-
         /// <summary>
         /// 鍙栨秷浜嬩欢
         /// </summary>
@@ -326,12 +311,12 @@
                 if (row != null)
                 {
                     Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
-                    //string _msl = row["quantity"].ToString();
-                    //if (string.IsNullOrEmpty(_msl))
-                    //{
-                    //    MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
+                    string _msl = row["qd007"].ToString();
+                    if (string.IsNullOrEmpty(_msl))
+                    {
+                        MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
+                        return;
+                    }
                     _obj.list.Add(new
                     {
                         Guid = _guid,
@@ -364,9 +349,9 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private   void getPageList(int curPage)
+        private void getPageList(int curPage)
         {
-            
+
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
@@ -400,7 +385,7 @@
             {
                 ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
-            
+
         }
         private void getModel(string strGuid)
         {
@@ -412,7 +397,6 @@
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
@@ -457,12 +441,12 @@
 
         private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
         {
-
             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("qd009", SelectedDataRow["dwName"]);
         }
 
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -510,7 +494,7 @@
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private   void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
             _toolCk(1);
         }
@@ -521,7 +505,7 @@
         /// <param name="sender"></param>
         /// <param name="e"></param>
         /// <exception cref="NotImplementedException"></exception>
-        private   void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
         {
             _toolCk(0);
         }
@@ -530,7 +514,7 @@
         /// 宸ュ叿鏉′簨浠�
         /// </summary>
         /// <param name="inFieldValue"></param>
-        private   void _toolCk(int _inFieldValue)
+        private void _toolCk(int _inFieldValue)
         {
             string strMsg = "";
             switch (_inFieldValue)
@@ -553,7 +537,7 @@
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
                 return;
-            
+
             var _obj = new
             {
                 guid = rowGuid,
@@ -578,25 +562,64 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
+
+        }
+        
+        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+        {
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+                lbMxGuid.Text = row["guid"].ToString();
+                ucBtnPrint1.guidKey = row["guid"].ToString();
+                txtWlid.Text = row["itemId"].ToString();
+                txtWlgg.Text = row["qd004"].ToString();
+                txtWlmc.Text = row["qd003"].ToString();
+                txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
+                txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺
+                kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺
+            }
+        }
+        /// <summary>
+        /// 绉诲嚭鏉$爜
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gvMx2.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                var dr = gvMx2.GetDataRow(rowhandle);
+                var mxGuid = dr["guid"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                var _obj = new
+                {
+                    mxGuid = mxGuid,
+                    inType = "dhtm"
+                };
+                try
+                {
+                    var strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "DeleteBarcode",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+                    }
+                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
         }
 
-        private void GcMx1_MouseClick(object sender, MouseEventArgs e)
-        {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid");
-            if (string.IsNullOrEmpty(rowGuid))
-                return;
-            lbMxGuid.Text = rowGuid;
-            toolBarMenu1.guidKey = rowGuid;
-            var info = gvMx1.CalcHitInfo(e.Location);
-            var view = info.View;
-            var row = view.GetDataRow(info.RowHandle);
-            txtWlid.Text = row["itemId"].ToString();
-            txtWlgg.Text = row["qd004"].ToString();
-            txtWlmc.Text = row["qd003"].ToString();
-            txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
-            txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺
-            kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺
-        }
+      
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3