From 3cf7cd4d37f38a60a65f2a066f6403db9d24e6e0 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 24 十二月 2024 08:50:41 +0800
Subject: [PATCH] 细节

---
 DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs |  269 +++++++++++++++++++++++++++--------------------------
 1 files changed, 136 insertions(+), 133 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
index 6b97c13..6da5873 100644
--- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
@@ -3,14 +3,11 @@
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
-using MES.Service.Modes;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Drawing;
-using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -32,15 +29,23 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+            });
+            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+            {
+                getModel(value);
+            }, (value) =>
+            {
+                getPageList(this.pageBar1.CurrentPage);
+            });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             txt_pba013.EditChanged += (s, e) =>
             {
                 string workGuid = this.txt_pba013.GetGuid();
-                txt_pba016.getSuppler(workGuid);
                 _getListJybz(workGuid);
             };
             //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
@@ -89,17 +94,7 @@
            Task.Delay(100);
             getPageList(1);
         }
-        /// <summary>
-        /// 鍙屽嚮浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
-            if (!string.IsNullOrEmpty(rowGuid))
-                getModel(rowGuid, false, 999);
-        }
+      
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -141,43 +136,7 @@
         /// <param name="e"></param>
         private   void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_hNo, gridView1, "hNo");
-            //toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀹℃牳鍚楋紵"))
-                return;
-            
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmit",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                        getModel(lbGuid.Text.Trim(), false, 999);
-                    else
-                        getPageList(1);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-            
+            _toolCk(1, "EditModelSubmit");
         }
 
         /// <summary>
@@ -188,45 +147,7 @@
         /// <exception cref="NotImplementedException"></exception>
         private   void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_hNo, gridView1);
-            // toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            //MsgHelper.Warning(rowGuid);
-            
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "DeApprove",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                        getModel(lbGuid.Text.Trim(), false, 999);
-                    else
-                        getPageList(1);
-                }
-                else
-                {
-                    MsgHelper.Warning(_rtn.rtnMsg);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-            
+            _toolCk(0, "EditModelSubmitFSH");
         }
 
         /// <summary>
@@ -236,7 +157,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 0);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
         }
 
         /// <summary>
@@ -269,10 +190,11 @@
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
-                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
-                    getPageList(1);
+                    if (xtraTabControl1.SelectedTabPageIndex == 0)
+                        getPageList(this.pageBar1.CurrentPage);
+                    else
+                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                 }
-
                 MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
@@ -289,7 +211,7 @@
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
             if (xtraTabControl1.SelectedTabPageIndex == 1)
-                getModel(lbGuid.Text.Trim(), false, 999);
+                getModel(lbGuid.Text.Trim());
             else
             {
                 _filterList.Clear();
@@ -316,7 +238,10 @@
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            getModel(rowGuid, true, 1);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gvMx1);
+            UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -325,11 +250,9 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 1);
             lbGuid.Text = "";
-            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-            gridViews.Add(gvMx1);
-            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
+            UtilityHelper.CleanValueByControl(panel1.Controls, true);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
         }
         /// <summary>
@@ -347,26 +270,11 @@
                 txt_pba013.Focus();
                 return;
             }
-            string lineId = txt_pba016.GetId();
-            if (string.IsNullOrEmpty(lineId.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浜х嚎锛�");
-                txt_pba016.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(txt_pba015.Text.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璁″垝浜烘暟涓嶈兘涓虹┖锛�");
-                txt_pba015.Focus();
-                return;
-            }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
                 bz = txt_pba009.Text.Trim(),
                 cjId = workId,
-                cxId = lineId,
-                jhrs = txt_pba015.Text.Trim(),
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
@@ -382,35 +290,66 @@
                 if (row != null)
                 {
                     Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
-                    string _LineId = row["daa015"].ToString();
-                    if (string.IsNullOrEmpty(_LineId))
-                    {
-                        MsgHelper.ShowError("浜х嚎涓嶈兘涓虹┖锛�");
-                        return;
-                    }
+                    //string _LineId = row["daa015"].ToString();
+                    //if (string.IsNullOrEmpty(_LineId))
+                    //{
+                    //    MsgHelper.ShowError("浜х嚎缂栫爜涓嶈兘涓虹┖锛�");
+                    //    return;
+                    //}
                     string _Pcsl = row["daa008"].ToString();
-                    if (string.IsNullOrEmpty(_LineId))
+                    if (string.IsNullOrEmpty(_Pcsl))
                     {
                         MsgHelper.ShowError("鎺掍骇鏁伴噺涓嶈兘涓虹┖锛�");
                         return;
                     }
                     string _Yjkgsj = row["mesStartProd"].ToString();
-                    if (string.IsNullOrEmpty(_LineId))
+                    if (string.IsNullOrEmpty(_Yjkgsj))
                     {
                         MsgHelper.ShowError("棰勮寮�宸ユ椂闂翠笉鑳戒负绌猴紒");
                         return;
                     }
+                    //string _prepareTime = row["prepareTime"].ToString();
+                    //if (string.IsNullOrEmpty(_prepareTime))
+                    //{
+                    //    MsgHelper.ShowError("棰勮澶囨枡鏃堕棿涓嶈兘涓虹┖锛�");
+                    //    return;
+                    //}
+                    //string _planPersonnel = row["planPersonnel"].ToString();
+                    //if (string.IsNullOrEmpty(_planPersonnel))
+                    //{
+                    //    MsgHelper.ShowError("璁″垝浜烘暟锛�");
+                    //    return;
+                    //}
+                    //string _changeLinetime = row["changeLinetime"].ToString();
+                    //if (string.IsNullOrEmpty(_changeLinetime))
+                    //{
+                    //    MsgHelper.ShowError("鎹㈢嚎鏃堕棿涓嶈兘涓虹┖锛�");
+                    //    return;
+                    //}
+                    string _mesEndProd = row["mesEndProd"].ToString();
+                    if (string.IsNullOrEmpty(_mesEndProd))
+                    {
+                        MsgHelper.ShowError("棰勮瀹屽伐鏃堕棿涓嶈兘涓虹┖锛�");
+                        return;
+                    }
+                    //string _restTime = row["restTime"].ToString();
+                    //if (string.IsNullOrEmpty(_prepareTime))
+                    //{
+                    //    MsgHelper.ShowError("浼戞伅鏃堕棿涓嶈兘涓虹┖锛�");
+                    //    return;
+                    //}
                     _obj.list.Add(new
                     {
                         Guid = _guid,
                         AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["caaGuid"].ToString()),
-                        LineId = int.Parse(row["daa015"].ToString()),//浜х嚎id
+                        LineId = row["daa015"].ToString(),//浜х嚎id
                         Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
                         Jhrs = row["planPersonnel"].ToString(),//璁″垝浜烘暟
                         Hxsj = row["changeLinetime"].ToString(),//鎹㈢嚎鏃堕棿
                         Bz = row["daa009"].ToString(),//澶囨敞
                         Blsj = row["prepareTime"].ToString(),//棰勮澶囨枡鏃堕棿
-                        Pcsl = row["daa008"].ToString()//鎺掍骇鏁伴噺
+                        Pcsl = row["daa008"].ToString(),//鎺掍骇鏁伴噺
+                        Yjwgsj = row["mesEndProd"].ToString()//棰勮瀹屽伐鏃堕棿
                     });
                 }
             }
@@ -423,7 +362,9 @@
                 {
                     lbGuid.Text = _rtn.rtnData;
                     toolBarMenu1.isSetBtn = true;
-                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                    gvList.Add(gvMx1);
+                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
                 }
             }
             catch (Exception ex)
@@ -439,7 +380,6 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private   void getPageList(int curPage)
         {
-            
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
@@ -476,14 +416,19 @@
             }
             
         }
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private void getModel(string strGuid)
         {
+            bool isEdit = false;
+            if (toolBarMenu1.currentAction == "add") {
+                Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+                return;
+            };
+            if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
@@ -555,7 +500,7 @@
                     var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                     if (_rtn.rtnCode > 0)
                     {
-                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                     }
                     MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
@@ -566,6 +511,10 @@
             }
         }
 
+        /// <summary>
+        /// 鏍规嵁杞﹂棿璇讳骇绾�
+        /// </summary>
+        /// <param name="workGuid"></param>
         private void _getListJybz(string workGuid)
         {
             if (string.IsNullOrEmpty(workGuid))
@@ -611,5 +560,59 @@
                 gvMx1.SetRowCellValue(dataIndex, "daa015", _val);
             }
         }
+
+
+        /// <summary>
+        /// 宸ュ叿鏉′簨浠�
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(int _inFieldValue,string _mth)
+        {
+            string strMsg = "";
+            switch (_inFieldValue)
+            {
+                case 1:
+                    strMsg = "瀹℃牳";
+                    break;
+                case 0:
+                    strMsg = "鍙嶅鏍�";
+                    break;
+            };
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1, "hNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+                return;
+            var _obj = new
+            {
+                guid = rowGuid,
+                inFieldValue = _inFieldValue,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + _mth,
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim());
+                    else
+                        getPageList(this.pageBar1.CurrentPage);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3