From 31ce91f6ff326063fca78f31ee982001586cc109 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期二, 16 十二月 2025 21:55:34 +0800
Subject: [PATCH] 产能排产功能更新

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs |  196 +++++++++++++++++++++++-------------------------
 1 files changed, 94 insertions(+), 102 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs
index 3215710..2f01e48 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs
@@ -1,4 +1,3 @@
-using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -7,7 +6,6 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Drawing;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -25,18 +23,17 @@
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL1);
-
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-           }, tips, true, (strGuid) => {
+           },  tips, true, (strGuid) =>
+           {
                getModelList(strGuid);
            });
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
@@ -48,49 +45,14 @@
             }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //鎵撳嵃姣斾緥
-            UtilityHelper.SetSimpleGridColor(gridView1, "barcodeProgress", "=100.00%", "Cell", Color.Green);
-            //鍏ュ簱姣斾緥
-            UtilityHelper.SetSimpleGridColor(gridView1, "rkbl", "=100.00%", "Cell", Color.Green);
 
 
+            // 涓轰簡鏂逛究浣跨敤鏁村悎鍒�  UtilityHelper 绫讳腑鐨� SetupGridSummary 鏂规硶
+            UtilityHelper.SetupGridSummary(gvMx1, "quantity");
+            UtilityHelper.SetupGridSummary(gvMxL1, "quantity");
+            UtilityHelper.SetupGridSummary(gvMx2, "quantity");
+            UtilityHelper.SetupGridSummary(gvMxL2, "quantity");
         }
-
-        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
-        {
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎵撳嵃鐨勫崟鎹紒");
-                return;
-            }
-
-            try
-            {
-                string rptParameter = "rpt_Cgrk{"
-                + rowGuid  // @inOrderGuid - 鍗曟嵁guid
-                + "," + "100"  // @isDesign - 閲嶆墦閮芥槸浼�100
-                + "," + ""  // @in1 - 鍏ュ簱鏃堕棿锛堟墿灞曠敤锛�
-                + "," + ""  // @in2 - 鐗归噰锛堟墿灞曠敤锛�
-                + "," + ""  // @in3 - 渚涘簲鍟唅d锛堟墿灞曠敤锛�
-                + "," + ""  // @in4 - 寮犳暟锛堟墿灞曠敤锛�
-                + "," + ""  // @in5 - 鏁伴噺锛堟墿灞曠敤锛�
-                + "," + ""  // @in6 - 鎵╁睍鐢�
-                + "}";
-                using (Form rpt = new RptPreview(rowGuid, rptParameter))
-                {
-                    rpt.ShowDialog();
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.ShowError(ex.Message);
-            }
-        }
-
-
-
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -167,50 +129,6 @@
         }
 
         /// <summary>
-        ///     鍒犻櫎浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
-        {
-            string rowGuid = "", rowName = "";
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
-                return;
-            var _obj = new
-            {
-                guid = rowGuid,
-                mxGuid = Guid.Empty.ToString(),
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "DeleteCgrk",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 0)
-                    { }
-                    else
-                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
-                    getPageList(this.pageBar1.CurrentPage);
-                }
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-
-
-        /// <summary>
         /// 鍒锋柊浜嬩欢
         /// </summary>
         /// <param name="sender"></param>
@@ -239,7 +157,11 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+            gcMain1.DataSource = null;
+            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+            _sbSqlWhere.Append(" and a.receiveOrgId in");
+            _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+            _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -356,11 +278,12 @@
         {
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1, "billNo");
             toolBarMenu1.guidKey = rowGuid;
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎿嶄綔鍚楋紵"))
@@ -374,36 +297,37 @@
             {
                 var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelSubmit", JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                 if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
+                    MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
                     {
                         getModel(lbGuid.Text.Trim());
                     }
                     int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    int _meth = (( _inFieldValue == 1) ? 1 : -1);
                     UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                 }
+                else
+                    MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
-   
-     
+
+
         /// <summary>
         ///  鏂板鏂规硶锛氬垪琛ㄦ樉绀�   
         /// </summary>
         /// <param name="strGuid">涓昏〃id</param>
-         
+
         private void getModelList(string strGuid)
         {
             gcMxL1.DataSource = null;
             gcMxL2.DataSource = null;
-            
+           
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
@@ -434,7 +358,6 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1);
                     }
-
                     JArray array2 = new JArray();
                     foreach (var a in dy["list2"])
                     {
@@ -454,8 +377,7 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL2, gvMxL2);
                     }
-              
-              }
+                }
                 else
                     ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
@@ -466,5 +388,75 @@
         }
 
 
+        /*/// <summary>
+        /// 杩欐槸鎵撳嵃
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
+        {
+            //guidKey, rptParameter
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1, "billNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            this.toolBarMenu1.rptParameter = "rpt_CGRK{"
+                                               + "100"
+                                               + "," + ""
+                                               + "," + ""
+                                               + "," + ""
+                                               + "," + ""
+                                               + "}";
+            this.toolBarMenu1.guidKey = rowGuid;
+
+        }
+*/
+
+        /// <summary>
+        /// 杩欐槸鎵归噺鎵撳嵃
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
+        {
+            System.Text.StringBuilder sb = new System.Text.StringBuilder();
+            gridView1.PostEditor();
+            gridView1.UpdateCurrentRow();
+            DataTable dt = this.gcMain1.DataSource as DataTable;
+            {
+                foreach (DataRow dr in dt.Rows)
+                {
+                    string checkBox = dr["chkInt"].ToString();
+                    string _guid = dr["guid"].ToString();
+                    if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
+                    {
+                        if (sb.Length > 0)
+                            sb.Append("|");
+                        sb.Append(_guid);
+                    }
+                }
+            }
+            if (string.IsNullOrEmpty(sb.ToString()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堥�夋嫨鎵撳嵃鏁版嵁锛�");
+                this.toolBarMenu1.rptParameter = "return false";
+                return;
+            }
+            this.toolBarMenu1.rptParameter = "rpt_CGRK{"
+                                               + "100"
+                                               + "," + ""
+                                               + "," + ""
+                                                + "," + ""
+                                               + "," + ""
+                                               + "," + sb.ToString()
+                                               + "}";
+            this.toolBarMenu1.guidKey = null;
+        }
+
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3