From cd5483b6c38111f9b45cd39b8201cc1ceb847e48 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 05 三月 2025 09:22:44 +0800
Subject: [PATCH] 委外退料版面

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs |  172 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 116 insertions(+), 56 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
index 96275cb..d19c650 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -9,13 +9,17 @@
 using System.Data;
 using System.Threading.Tasks;
 using System.Windows.Forms;
-
 namespace Gs.DevApp.DevFrm
 {
     public partial class Frm_MesItemQtrk : DevExpress.XtraEditors.XtraForm
     {
         string _webServiceName = "MesItemQtrkManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
+        string _ucGys = "";//渚涘簲鍟�
+        string _ucBm = "";//棰嗘枡閮ㄩ棬
+        string _ucCk = "";//鍙戞枡浠撳簱
+        string _ucHzlx = "";//璐т富绫诲瀷
+        string _ucHz = "";//璐т富
         public Frm_MesItemQtrk()
         {
             InitializeComponent();
@@ -26,8 +30,12 @@
             this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) =>
@@ -43,38 +51,36 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            txt_qt008.getSuppler("");
-            txt_qt018.getSuppler("");
-            //璁剧疆浠撳簱閫夋嫨
-            this.txt_qt008.EditChanged += (s, e) =>
-            {
 
+            //閫夋嫨搴撳瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜屽彉璐т富锛�
+            this.txt_qt022.EditChanged += (s, e) =>
+            {
+                string _orgId = txt_qt022.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);
+                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(), "");
+                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);
+                }
             };
-            //璁剧疆渚涘簲鍟嗛�夋嫨
-            this.txt_qt018.EditChanged += (s, e) =>
-            {
-
-            };
-            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);
-            }
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
             this.ucBtnPrint1.btnDesignClick += (s, e) =>
             {
@@ -118,6 +124,19 @@
             Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
+        }
+        /// <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_qtck, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
         }
 
         /// <summary>
@@ -255,6 +274,7 @@
                 gvList.Add(gvMx1);
                 gvList.Add(gvMx2);
                 UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+                ucLookHuoZhu1.Enabled = true;
             }
         }
         /// <summary>
@@ -272,6 +292,7 @@
             UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+            ucLookHuoZhu1.Enabled = true;
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -281,34 +302,61 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string inGys = txt_qt018.GetId();
-            string inCjId = txt_qt008.GetId();
-            if (string.IsNullOrEmpty(inGys))
+            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();//浠撳簱
+            if (string.IsNullOrEmpty(kcZz))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
-                txt_qt018.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨缁勭粐锛�");
+                txt_qt022.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(inCjId))
+            if (string.IsNullOrEmpty(inHzlx))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
+                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();
+                return;
+            }
+            if (string.IsNullOrEmpty(kcCk))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�");
                 txt_qt008.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                kcZz = txt_qt022.GetId(),//搴撳瓨缁勭粐
-                kcBm = txt_qt009.GetId(),//搴撳瓨閮ㄩ棬
-                kcGys = txt_qt018.GetId(),//搴撳瓨渚涘簲鍟�
-                kcCk = txt_qt008.GetId(),//搴撳瓨渚涘簲鍟�
-                inRkyy = txt_qt010.Text.Trim(),//鍏ュ簱鍘熷洜
-                djLx = txt_qt003.Text.Trim(),//鍗曟嵁绫诲瀷
-                kcfx = txt_qt019.Text.Trim(),//搴撳瓨鏂瑰悜
-                hzlx = txt_qt023.Text.Trim(),//璐т富绫诲瀷
-                hzzz = txt_qt024.GetId(),//璐т富缁勭粐
-                hzkh = txt_qt025.GetId(),//璐т富瀹㈡埛
-                hzbm = txt_qt026.GetId(),//璐т富閮ㄩ棬
+                kcZz = kcZz,//搴撳瓨缁勭粐
+                kcBm = kcBm,//搴撳瓨閮ㄩ棬
+                kcGys = kcGys,//搴撳瓨渚涘簲鍟�
+                kcCk = kcCk,//搴撳瓨浠撳簱
+                inRkyy = inRkyy,//鍏ュ簱鍘熷洜
+                djLx = djLx,//鍗曟嵁绫诲瀷
+                kcfx = kcfx,//搴撳瓨鏂瑰悜
+                hzlx = inHzlx,//璐т富绫诲瀷
+                inHz = inHz,//璐т富
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
@@ -353,6 +401,8 @@
                     gvList.Add(gvMx1);
                     gvList.Add(gvMx2);
                     UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
+                    ucLookHuoZhu1.Enabled = false;
+                    toolBarMenu1.currentAction = "";
                 }
             }
             catch (Exception ex)
@@ -424,11 +474,22 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
+                    _ucGys = dy.qt018;
+                    _ucBm = dy.qt009;
+                    _ucCk = dy.qt008;
+                    _ucHzlx = dy.qt023;
+                    _ucHz = dy.qt024;
                     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.panel1.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"])
@@ -447,7 +508,6 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                     }
-
                     JArray array2 = new JArray();
                     foreach (var a in _job["rtnData"]["list2"])
                     {
@@ -482,7 +542,8 @@
             gvMx1.SetFocusedRowCellValue("qd002", SelectedDataRow["itemNo"]);
             gvMx1.SetFocusedRowCellValue("qd003", SelectedDataRow["itemName"]);
             gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]);
-            gvMx1.SetFocusedRowCellValue("qd009", SelectedDataRow["dwName"]);
+            gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]);
+            gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]);
         }
 
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -593,8 +654,7 @@
                     }
                     int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    Form parentForm = this.FindForm();
-                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, parentForm, _inFieldValue.ToString());
+                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
                 }
             }
             catch (Exception ex)
@@ -612,9 +672,9 @@
                 txtWlid.Text = row["qd002"].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();//鍙墦鍗版�婚噺
+                txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
+                txtYdy.Text = row["ydy"].ToString();//宸叉墦鍗版�婚噺
+                txtKdy.Text = row["kdy"].ToString();//鍙墦鍗版�婚噺
             }
         }
         /// <summary>

--
Gitblit v1.9.3