From d35bb711f8d3d267b44b4a80c20e31dabf309ae7 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 14 一月 2025 08:17:18 +0800 Subject: [PATCH] 其它入库 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs | 160 ++++++++++++++++++++++++++++++----------------------- 1 files changed, 90 insertions(+), 70 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs index 2b46c9a..535bc2f 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs @@ -28,59 +28,37 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; - gridView1.FocusedRowChanged += (s, e) => + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) => { - UtilityHelper.SetCheckIco(s, picCheckBox, this, "status", ""); - }; + 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); - Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1); pageBar1.PagerEvent += PageBar1_PagerEvent; - gridView1.CustomDrawRowIndicator += (s, e) => - { - if (e.Info.IsRowIndicator && e.RowHandle >= 0) - { - e.Info.DisplayText = (e.RowHandle + 1).ToString(); - } - }; - gridView1.CustomDrawEmptyForeground += (s, e) => - { - string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; - Font f = new Font("寰蒋闆呴粦", 16); - Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); - e.Graphics.DrawString(str, f, Brushes.Gray, r); - }; - _setIno(); - } - private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) - { - _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); - await Task.Delay(100); - getPageList(1); - } - private void _setIno() - { - this.txt_itemId.KeyFile = "id"; - this.txt_suppId.KeyFile = "id"; txt_itemId.EditChanged += (s, e) => { txt_itemNo.Text = this.txt_itemId.GetCode(); - //var ItemId = this.txt_itemId.GetId(); - //var ItemName = this.txt_itemId.GetName(); - //GetCount(ItemId, ItemName); + }; + txt_suppId.getSuppler(""); + txt_suppId.EditChanged += (s, e) => + { + txtGysNo.Text = this.txt_suppId.GetCode(); }; } - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) + private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); + _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); + Task.Delay(100); + getPageList(1); } + + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -122,7 +100,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> @@ -168,9 +146,8 @@ /// <param name="e"></param> 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(); @@ -197,7 +174,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -206,16 +184,9 @@ /// <param name="e"></param> private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 1); lbGuid.Text = ""; - UtilityHelper.CleanValueByControl(this.panel1.Controls, true); - txt_createBy.Enabled = false; - txt_createDate.Enabled = false; - txt_lastupdateBy.Enabled = false; - txt_lastupdateDate.Enabled = false; - txt_checkUser.Enabled = false; - txt_checkDate.Enabled = false; - txt_status.Enabled = false; + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); + UtilityHelper.CleanValueByControl(panel1.Controls, true); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -269,15 +240,15 @@ /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private async void getPageList(int curPage) + private void getPageList(int curPage) { - UcLoading _loading = new UcLoading(); var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + _sbSqlWhere += " and b.guid is not null"; PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try { - var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json); + var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); if (dd.rtnCode > 0) { @@ -305,7 +276,7 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - _loading.Stop(); + } /// <summary> /// @@ -313,14 +284,16 @@ /// <param name="strGuid">涓婚敭</param> /// <param name="isEdit">鏄惁鍙紪杈�</param> /// <param name="tabIdx">閫夐」鍗″簭鍙�</param> - private void getModel(string strGuid, bool isEdit, int tabIdx) + private void getModel(string strGuid) { + bool isEdit = false; + if (toolBarMenu1.currentAction == "add") return; + if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -354,11 +327,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_itemNo, gridView1); - toolBarMenu1.guidKey = rowGuid; + _toolCk(0); } /// <summary> @@ -368,11 +337,62 @@ /// <param name="e"></param> private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) { + _toolCk(1); + } + + /// <summary> + /// 宸ュ叿鏉′簨浠� + /// </summary> + /// <param name="inFieldValue"></param> + private void _toolCk(int _inFieldValue) + { + string strMsg = ""; + switch (_inFieldValue) + { + case 1: + strMsg = "瀹℃牳"; + break; + case 0: + strMsg = "鍙嶅鏍�"; + break; + }; toolBarMenu1.guidKey = ""; string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_itemNo, gridView1); - toolBarMenu1.guidKey = rowGuid; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1, "itemName"); + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + return; + + var _obj = new + { + guid = rowGuid, + ckValue = _inFieldValue, + parameter = "MES_QA_MJ,CHECK_DATE,STATUS,CHECK_USER" + }; + try + { + var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck", + 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