From ecb7a60de1639f520712ce95f99414b0dd2c9713 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 14 四月 2025 08:30:40 +0800
Subject: [PATCH] 自动打印

---
 DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01Check.cs |  303 ++++++++++++++++++++++++++------------------------
 1 files changed, 159 insertions(+), 144 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01Check.cs
index bcc5677..a445b32 100644
--- a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01Check.cs
+++ b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01Check.cs
@@ -24,12 +24,12 @@
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
+            this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnZhiLiangChkClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fsubmitTxt", "", (value) =>
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modifyFlagTxt", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
             }, tips);
@@ -44,36 +44,6 @@
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
-            txt_suppId.getSuppler("");
-            txt_lineId.getSuppler("");
-            txt_itemId.Click += (s, e) =>
-            {
-                string _lineId = txt_lineId.GetId();
-                if (string.IsNullOrEmpty(_lineId))
-                {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇峰厛閫夋嫨浜х嚎锛�");
-                    return;
-                }
-                var frm = new SelectFqcItem(_lineId);
-                frm.UpdateParent += (ss, ee) =>
-                {
-                    try
-                    {
-                        var lst = new List<dynamic>();
-                        lst = ee.DynamicList;
-                        txt_itemId.Text = lst[0].itemId;
-                        txt_itemModel.Text = lst[0].itemModel;
-                        txt_itemName.Text = lst[0].itemName;
-                        txt_itemNo.Text = lst[0].itemNo;
-                        txt_lotNo.Text = lst[0].gdbh;
-                    }
-                    catch (Exception ex)
-                    {
-                        MessageBox.Show(ex.Message);
-                    }
-                };
-                frm.ShowDialog();
-            };
         }
 
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -130,7 +100,7 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-       
+
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -178,63 +148,14 @@
             toolBarMenu1.guidKey = rowGuid;
         }
         /// <summary>
-        ///鎻愪氦妫�楠屼簨浠�
+        /// 璐ㄩ噺瀹℃牳
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+        private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1, "lotNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
-                return;
-            if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
-            {
-                if (string.IsNullOrEmpty(txt_remarks.Text.Trim()))
-                {
-                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
-                    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);
-                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                    {
-                        getModel(lbGuid.Text.Trim(), "0");
-                    }
-                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
-                    gridView1.FocusedRowHandle = rowHandle;
-                    int _inFieldValue = 1;
-                    UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-
+            _toolCk(1);
         }
-
         /// <summary>
         /// 鍙栨秷浜嬩欢
         /// </summary>
@@ -245,7 +166,6 @@
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
         }
 
-      
         /// <summary>
         /// 鍒锋柊浜嬩欢
         /// </summary>
@@ -268,7 +188,7 @@
                 getPageList(this.pageBar1.CurrentPage);
             }
         }
-     
+
         /// <summary>
         /// 淇敼浜嬩欢
         /// </summary>
@@ -307,75 +227,96 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string _txt_djType = txt_djType.Text.Trim();
-            string _txt_fbatchQty = txt_fbatchQty.Text.Trim();
-            string _txt_lifnr = txt_lifnr.Text.Trim();
-            string _txt_suppId = txt_suppId.GetId();
-            string _txt_lineId = txt_lineId.GetId();
-            string _txt_itemId = txt_itemId.Text.Trim();
-            string _txt_remarks = txt_remarks.Text.Trim();
-            string _txt_workNo = txt_workNo.GetCode();
-            string _txt_epTag = txt_epTag.Text.Trim();
+            string _freceQty = txt_freceQty.Text.Trim();
+            string _txt_fngHandle = txt_fngHandle.Text.Trim();
+            string _txt_fmrmode = txt_fmrmode.GetCode();
             string _txt_fzrId = txt_fzrId.GetId();
+            string _txt_workNo = txt_workNo.Text.Trim();
             string _txt_msg = txt_msg.TextTxt;
-            string _txt_fmanageNo = txt_fmanageNo.Text.Trim();
-            string _txt_lotNo2 = txt_lotNo2.Text.Trim();
-            string _txt_lotNo1 = txt_lotNo1.Text.Trim();
-            string _txt_lotNo = txt_lotNo.Text.Trim();
-            if (txt_djType.SelectedIndex <= 0)
+            string _txt_zrType = txt_zrType.Text.Trim();
+            if (txt_freceQty.SelectedIndex <= 0)
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鍗曟嵁绫诲瀷涓嶈兘涓虹┖锛�");
-                txt_djType.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍒ゅ畾缁撴灉锛�");
+                txt_freceQty.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(_txt_fbatchQty.Trim()))
+            //褰撲负涓嶅悎鏍兼椂锛岃閫夋嫨澶勭疆缁撴灉
+            if (txt_freceQty.SelectedIndex != 1)
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘涓虹┖锛�");
-                txt_fbatchQty.Focus();
-                return;
+                if (txt_fngHandle.SelectedIndex <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭疆缁撴灉锛�");
+                    txt_fngHandle.Focus();
+                    return;
+                }
+                if (_txt_fzrId.Length <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换浜猴紒");
+                    txt_fzrId.Focus();
+                    return;
+                }
+
+                if (txt_zrType.SelectedIndex <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换鍒ゅ畾锛�");
+                    txt_zrType.Focus();
+                    return;
+                }
+
+                //褰撳缃粨鏋滀负鍙嶅伐鏃讹紝瑕侀�夋嫨宸ュ簭鍜屽弽宸ョ紪鍙�
+                if (txt_fngHandle.SelectedIndex == 1)
+                {
+                    if (string.IsNullOrEmpty(_txt_workNo))
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.Warning("璇峰~鍐欏弽宸ュ崟鍙凤紒");
+                        txt_workNo.Focus();
+                        return;
+                    }
+                    if (string.IsNullOrEmpty(_txt_fmrmode))
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.Warning("璇峰~閫夋嫨鍙嶅伐宸ュ簭锛�");
+                        txt_fmrmode.Focus();
+                        return;
+                    }
+                }
+                else
+                {
+                    if (!string.IsNullOrEmpty(_txt_workNo))
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕佸~鍐欏弽宸ュ崟鍙凤紒");
+                        txt_workNo.Focus();
+                        return;
+                    }
+                    if (!string.IsNullOrEmpty(_txt_fmrmode))
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕侀�夋嫨鍙嶅伐宸ュ簭锛�");
+                        txt_fmrmode.Focus();
+                        return;
+                    }
+                }
             }
-            if (string.IsNullOrEmpty(_txt_lineId.Trim()))
+            //褰撲负鍚堟牸鏃讹紝灏变笉搴旇閫夋嫨鍏跺畠椤圭洰浜�
+            else
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜х嚎涓嶈兘涓虹┖锛�");
-                txt_lineId.Focus();
-                return;
+                if ((_txt_fmrmode.Length + _txt_fzrId.Length + _txt_workNo.Length) > 0 || txt_zrType.SelectedIndex > 0 || txt_fngHandle.SelectedIndex > 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.Warning("褰撳垽瀹氱粨鏋滀负鍚堟牸鏃讹紝灏变笉搴旇閫夋嫨鍏跺畠椤圭洰浜嗭紒");
+                    txt_freceQty.Focus();
+                    return;
+                }
             }
-            if (string.IsNullOrEmpty(_txt_itemId.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜у搧涓嶈兘涓虹┖锛�");
-                txt_itemId.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(_txt_itemId.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜у搧涓嶈兘涓虹┖锛�");
-                txt_itemId.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(_txt_lotNo.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("宸ュ崟鍙蜂笉鑳戒负绌猴紒");
-                txt_lotNo.Focus();
-                return;
-            }
+
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                djType = _txt_djType,
-                fbatchQty = _txt_fbatchQty,
-                lifnr = _txt_lifnr,
-                suppId = _txt_suppId,
-                lineId = _txt_lineId,
-                itemId = _txt_itemId,
-                remarks = _txt_remarks,
-                workNo = _txt_workNo,
-                epTag = _txt_epTag,
+                freceQty = _freceQty,
+                fngHandle = _txt_fngHandle,
                 fzrId = _txt_fzrId,
+                workNo = _txt_workNo,
+                fmrmode = _txt_fmrmode,
                 msg = _txt_msg,
-                fmanageNo = _txt_fmanageNo,
-                lotNo2 = _txt_lotNo2,
-                lotNo1 = _txt_lotNo1,
-                lotNo = _txt_lotNo
+                zrType = _txt_zrType,
+                edtType = 1
             };
             try
             {
@@ -385,7 +326,6 @@
                 if (_rtn.rtnCode > 0)
                 {
                     lbGuid.Text = _rtn.rtnData.outGuid;
-                    txt_releaseNo.Text = _rtn.rtnData.outNo;
                     toolBarMenu1.isSetBtn = true;
                     UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                     this.setEable(false);
@@ -407,7 +347,7 @@
         private void getPageList(int curPage)
         {
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
-            // _sbSqlWhere += " and isnull(fsubmit,0)=0";
+            _sbSqlWhere += " and isnull(fsubmit,0)=1";
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -566,5 +506,80 @@
             //btnLoad.Enabled = bl;
             //btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
         }
+
+        /// <summary>
+        /// 宸ュ叿鏉′簨浠�
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(int _inFieldValue)
+        {
+            string strMsg = "";
+            switch (_inFieldValue)
+            {
+                case 1:
+                    strMsg = "瀹℃牳";
+                    break;
+            };
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+                return;
+            if (_inFieldValue == 1)
+            {
+                if (txt_fcheckResu.Text == "涓嶅悎鏍�")
+                {
+                    //if (txt_fngHandle.Text.Trim().Length == 0)
+                    //{
+                    //    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃惰閫夋嫨澶勭悊鏂瑰紡锛�");
+                    //    return;
+                    //}
+                }
+            }
+            var _obj = new
+            {
+                guid = rowGuid,
+                inFieldValue = _inFieldValue,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + "EditModelSubmitZhiLiang",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+                {
+                    if (_inFieldValue >= 0)
+                    {
+                        if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        {
+                            getModel(lbGuid.Text.Trim(), "0");
+                        }
+                        int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+                        gridView1.FocusedRowHandle = rowHandle;
+                        UtilityHelper.SetCheckIco(gridView1, "modifyFlagTxt", "modify1By", "modify1Date", picCheckBox, this, _inFieldValue.ToString());
+                    }
+                    else
+                    {
+                        //if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        //    getModel(lbGuid.Text.Trim());
+                        //else
+                        //    getPageList(this.pageBar1.CurrentPage);
+                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
+                        getPageList(this.pageBar1.CurrentPage);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3