From c698fcb41fa92d6185f133e65bc16f3467ac9ed3 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 21 十一月 2024 15:37:22 +0800
Subject: [PATCH] 修改iqc基础信息维护的细节

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs |  151 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 129 insertions(+), 22 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
index 70105df..dd56432 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
@@ -4,9 +4,9 @@
 using System.Drawing;
 using System.Text;
 using System.Windows.Forms;
+using DevExpress.RichEdit.Export;
 using DevExpress.XtraEditors;
 using DevExpress.XtraGrid.Views.Grid;
-using Gs.DevApp.DevFrm.QC.Models;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -31,7 +31,14 @@
             toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick;
             gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+            gridView1.FocusedRowChanged += (s, e) =>
+            {
+                UtilityHelper.SetCheckIco(s, picCheckBox, this, "foneChecked", "");
+            };
             getPageList(1, UtilityHelper.GetPageSize());
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -100,7 +107,61 @@
             _filterList = e.FilterList;
             getPageList(1, pageBar1.RowsCount);
         }
+        /// <summary>
+        /// 鎵瑰噯
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnPiZhunClick(object sender, EventArgs e)
+        {
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_itemNo, gridView1);
+            try
+            {
+                string strJson = UtilityHelper.HttpPost("", _webServiceName + "Approval", JsonConvert.SerializeObject(rowGuid));
+                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                if (_rtn.rtnCode > 0)
+                {
+                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
+                    getPageList(1, UtilityHelper.GetPageSize());
+                }
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
 
+        /// <summary>
+        ///     鍙嶅鏍�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_itemNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
+
+        /// <summary>
+        ///     瀹℃牳浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_itemNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
         /// <summary>
         ///     鍙栨秷浜嬩欢
         /// </summary>
@@ -158,8 +219,10 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 0);
-            getPageList(1, UtilityHelper.GetPageSize());
+            if (xtraTabControl1.SelectedTabPageIndex == 1)
+                getModel(lbGuid.Text.Trim(), false, 999);
+            else
+                getPageList(1, UtilityHelper.GetPageSize());
         }
 
         /// <summary>
@@ -204,11 +267,11 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string _ItemId = txt_itemId.GetId()
+            string _ItemId = txt_ItemId.GetId()
 ; if (string.IsNullOrEmpty(_ItemId))
             {
                 MsgHelper.Warning("璇烽�夋嫨鐗╂枡锛�");
-                // txt_account.Focus();
+                txt_ItemId.Focus();
                 return;
             }
             gvMx1.CloseEditor();
@@ -220,7 +283,7 @@
                 if (row != null)
                     lst.Add(new MesQmCheckitemDt
                     {
-                        Guid = null,
+                        Guid = UtilityHelper.ToGuid(row["guid"].ToString()),
                         Forder = 1,
                         FcheckItem = row["FcheckItem"].ToString(),
                         SampleSizeNo = row["SampleSizeNo"].ToString(),
@@ -228,18 +291,24 @@
                         FcheckLevel = row["FcheckLevel"].ToString(),
                         Fstand = row["Fstand"].ToString(),
                         FacLevel = row["FacLevel"].ToString(),
+                        FspecRequ = row["FspecRequ"].ToString(),
+                        Memo = row["memo"].ToString(),
+                        FupAllow = row["FupAllow"].ToString(),
+                        FdownAllow = row["FdownAllow"].ToString(),
                     });
             }
 
             var _obj = new MesQmCheckitem
             {
                 Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()),
+                ItemId = long.Parse(_ItemId),
                 Memo = txt_memo.Text.Trim(),
                 ItemNo = txt_itemNo.Text.Trim(),
-                IsEnabled = txt_isenabled.Checked,
+                Isenabled = txt_isenabled.Checked,
+                Ftype = "1",
+                Fversion = Gs.DevApp.ToolBox.UtilityHelper.ToLong(txt_fversion.Text.Trim()),
                 list = lst
             };
-
             try
             {
                 var strJson = UtilityHelper.HttpPost("",
@@ -277,12 +346,13 @@
                                    itm.fileValue + "'");
 
             var pgq = new PageQueryModel(curPage, pageSize,
-                "create_date", "asc", "", _sbSqlWhere.ToString());
+                "a.create_date", "asc", "", _sbSqlWhere.ToString());
             var json = JsonConvert.SerializeObject(pgq);
             try
             {
                 var strReturn = UtilityHelper.HttpPost("",
-                    _webServiceName + "GetListPageIQC", json);
+                //  _webServiceName + "GetListPageIQC", json);
+                _webServiceName + "GetListPage", json);
                 var dd =
                     UtilityHelper.ReturnToTablePage(strReturn);
                 if (dd.rtnCode > 0)
@@ -325,7 +395,8 @@
             try
             {
                 var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "GetModelIQC",
+                         // _webServiceName + "GetModelIQC",
+                         _webServiceName + "GetModel",
                     JsonConvert.SerializeObject(_obj));
                 var _rtn =
                     UtilityHelper.ReturnToDynamic(strJson);
@@ -423,11 +494,11 @@
 
         private void _setIno()
         {
-            txt_itemId.KeyFile = "id";
-            txt_itemId.EditChanged += (s, e) =>
+            txt_ItemId.KeyFile = "id";
+            txt_ItemId.EditChanged += (s, e) =>
             {
-                txt_itemModel.Text = this.txt_itemId.GetModel();
-                txt_itemNo.Text = this.txt_itemId.GetCode();
+                txt_itemModel.Text = this.txt_ItemId.GetModel();
+                txt_itemNo.Text = this.txt_ItemId.GetCode();
             };
             btnSelect.Click += (s, e) =>
             {
@@ -507,6 +578,7 @@
                 foreach (DataRow dr in dt.Rows)
                 {
                     rptJYBZ.Items.Add((new CboItemEntity(dr["SampleSizeNo"].ToString(), dr["SampleSizeName"].ToString())));
+                    //rptJYBZ.Items.Add((new CboItemEntity(dr["SampleSizeNo"].ToString(), dr["SampleSizeName"].ToString())));
                     //string ddddd = dr["SampleSizeName"].ToString();
                 }
             }
@@ -526,7 +598,7 @@
                 "0.010---(AQL_0_0010)"
                 , "0.015---(AQL_0_0015)"
                 , "0.025---(AQL_0_0025)"
-                ,"0.04---(AQL_0_0040)"
+                ,"0.040---(AQL_0_0040)"
                 ,"0.065---(AQL_0_0065)"
                 ,"0.10---(AQL_0_010)"
                 ,"0.15---(AQL_0_015)"
@@ -565,20 +637,55 @@
             ComboBoxEdit comboBox = sender as ComboBoxEdit;
             if (comboBox != null)
             {
+                GridView myView = (gcMx1.MainView as GridView);
+                int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
                 CboItemEntity _itm = comboBox.EditValue as CboItemEntity;
                 string _val = _itm.Value.ToString();
                 string _txt = _itm.Text.ToString();
                 gvMx1.CloseEditor();
                 gvMx1.UpdateCurrentRow();
-                GridView myView = (gcMx1.MainView as GridView);
-                int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
-                myView.SetRowCellValue(dataIndex, "sampleSizeNo", _val);
-                myView.SetRowCellValue(dataIndex, "sampleSizeName", _txt);
+                gvMx1.SetRowCellValue(dataIndex, "sampleSizeNo", _val);
+                gvMx1.SetRowCellValue(dataIndex, "sampleSizeName", _txt);
+
             }
         }
-
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            gvMx1.CloseEditor();
+            gvMx1.UpdateCurrentRow();
+            var rowhandle = gvMx1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                var dr = gvMx1.GetDataRow(rowhandle);
+                var mxGuid = dr["guid"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                if (string.IsNullOrEmpty(mxGuid))
+                {
+                    gvMx1.DeleteRow(rowhandle);
+                    return;
+                }
+                var strJson = "";
+                var lst = new List<string>();
+                lst.Add(mxGuid);
+                try
+                {
+                    strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "DeleteModelMx",
+                        JsonConvert.SerializeObject(lst));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
+        }
         #endregion
-
 
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3