From 1b799e1d64e6a2e151f52092542c6892ea858f0c Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 09 五月 2025 13:13:56 +0800 Subject: [PATCH] 工序采集 --- DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs | 352 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 314 insertions(+), 38 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs index 012eac3..cd41086 100644 --- a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs +++ b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs @@ -1,4 +1,5 @@ -锘縰sing Gs.DevApp.Entity; +锘縰sing Gs.DevApp.DevFrm.Work; +using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; using Newtonsoft.Json; @@ -13,6 +14,7 @@ { public partial class Frm_FqcDetect01 : DevExpress.XtraEditors.XtraForm { + string _strTag= "N:涓嶅悎鏍�"; string _webServiceName = "FqcManager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); public Frm_FqcDetect01() @@ -50,16 +52,10 @@ gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; btnIpt.Click += BtnIpt_Click; txt_suppId.getSuppler(""); - txt_lineId.getSuppler(""); - txt_itemId.Click += (s, e) => + //閫夋嫨宸ュ崟 + txt_lotNo.Click += (s, e) => { - string _lineId = txt_lineId.GetId(); - if (string.IsNullOrEmpty(_lineId)) - { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇峰厛閫夋嫨浜х嚎锛�"); - return; - } - var frm = new SelectFqcItem(_lineId); + var frm = new SelectFqcDaa(); frm.UpdateParent += (ss, ee) => { try @@ -71,6 +67,10 @@ txt_itemName.Text = lst[0].itemName; txt_itemNo.Text = lst[0].itemNo; txt_lotNo.Text = lst[0].gdbh; + txt_lineName.Text = lst[0].lineName; + txt_lineId.Text = lst[0].lineId; + txt_checkStates.Text = "W:鏈煡"; + txt_fcheckResu.Text = "W:鏈煡"; } catch (Exception ex) { @@ -79,8 +79,45 @@ }; frm.ShowDialog(); }; + //閫夋嫨绠辩爜 + txt_kbList.Click += (s, e) => + { + string _lotNo = txt_lotNo.Text.Trim(); + if (string.IsNullOrEmpty(_lotNo)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇峰厛閫夋嫨宸ュ崟锛�"); + return; + } + var frm = new SelectFqcBox(_lotNo); + frm.UpdateParent += (ss, ee) => + { + try + { + var lst = new List<dynamic>(); + lst = ee.DynamicList; + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + decimal kbSl = 0; + foreach (var item in lst) + { + if (sb.Length > 0) + sb.Append(","); + sb.Append(item.itemBarcode); + kbSl += decimal.Parse(item.sl.ToString()); + }; + txt_kbList.Text = sb.ToString(); + txt_kbSl.Text = kbSl.ToString(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + }; + frm.ShowDialog(); + }; + // 璇诲彇缂洪櫡绛夌骇 + getRptDefectLevel(); } - + /// <summary> /// 鎵归噺褰曞叆 /// </summary> @@ -277,14 +314,70 @@ } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�")) return; - if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�") + if (txt_fcheckResu.Text.Trim() == _strTag) { if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim())) { MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒"); return; } + 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_zrType = txt_zrType.Text.Trim(); + if (txt_fngHandle.SelectedIndex <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭疆缁撴灉锛�"); + txt_fngHandle.Focus(); + return; + } + if (txt_zrType.SelectedIndex <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换鍒ゅ畾锛�"); + txt_zrType.Focus(); + return; + } + if (_txt_fzrId.Length <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换浜猴紒"); + txt_fzrId.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; + } + } }; + var _obj = new { guid = rowGuid, @@ -312,7 +405,6 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - } /// <summary> @@ -345,7 +437,6 @@ var _obj = new { guid = rowGuid, - mxGuid = Guid.Empty.ToString(), }; try { @@ -404,6 +495,8 @@ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); this.ucUpFileList1.pGuid = ""; + this.ucChouJianList1.pGuid = ""; + this.setEable(false); } /// <summary> /// 淇敼浜嬩欢 @@ -447,36 +540,19 @@ string _txt_fbatchQty = txt_fbatchQty.Text.Trim();//鎶芥鏁伴噺 string _txt_lifnr = txt_lifnr.Text.Trim();//瀹㈡埛璁㈠崟 string _txt_suppId = txt_suppId.GetId();//瀹㈡埛id - string _txt_lineId = txt_lineId.GetId();//浜х嚎 - string _txt_itemId = txt_itemId.Text.Trim();//浜у搧 + string _txt_lineId = "";//浜х嚎 + string _txt_itemId = "";//浜у搧 string _txt_remarks = txt_remarks.Text.Trim();//澶囨敞 string _txt_epTag = txt_epTag.Text.Trim();//鐜繚 string _txt_msg = txt_msg.TextTxt;//寮傚父 string _txt_fmanageNo = txt_fmanageNo.Text.Trim();//娴佺▼缂栧彿 string _txt_lotNo1 = txt_lotNo1.Text.Trim();//閫佹鎵瑰彿 string _txt_lotNo = txt_lotNo.Text.Trim();//鐢熶骇宸ュ崟 + string _kbList = txt_kbList.Text.Trim(); if (txt_djType.SelectedIndex <= 0) { Gs.DevApp.ToolBox.MsgHelper.Warning("鍗曟嵁绫诲瀷涓嶈兘涓虹┖锛�"); txt_djType.Focus(); - return; - } - if (string.IsNullOrEmpty(_txt_fbatchQty.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘涓虹┖锛�"); - txt_fbatchQty.Focus(); - return; - } - if (string.IsNullOrEmpty(_txt_lineId.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("浜х嚎涓嶈兘涓虹┖锛�"); - txt_lineId.Focus(); - return; - } - if (string.IsNullOrEmpty(_txt_itemId.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("浜у搧涓嶈兘涓虹┖锛�"); - txt_itemId.Focus(); return; } if (string.IsNullOrEmpty(_txt_lotNo.Trim())) @@ -485,6 +561,108 @@ txt_lotNo.Focus(); return; } + if (string.IsNullOrEmpty(_kbList.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("閫佹绠辩爜涓嶈兘涓虹┖锛�"); + txt_kbList.Focus(); + return; + } + if (string.IsNullOrEmpty(txt_kbSl.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("閫佹鏁伴噺涓嶈兘涓虹┖锛�"); + txt_kbList.Focus(); + return; + } + if (string.IsNullOrEmpty(_txt_fbatchQty.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘涓虹┖锛�"); + txt_fbatchQty.Focus(); + return; + } + if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(_txt_fbatchQty)) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇疯緭鍏ユ纭殑鎶芥鏁伴噺锛�"); + txt_fbatchQty.Focus(); + return; + } + if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(txt_kbSl.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇疯緭鍏ユ纭殑閫佹鏁伴噺锛�"); + txt_kbList.Focus(); + return; + } + if (Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_txt_fbatchQty) > Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_kbSl.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘澶т簬閫佹鏁伴噺锛�"); + txt_fbatchQty.Focus(); + return; + } + //褰撲笉鍚堟牸鏃剁殑妫�鏌� + 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_zrType = txt_zrType.Text.Trim(); + if (txt_fcheckResu.Text.Trim() == _strTag) + { + if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim())) + { + MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒"); + txt_msg.Focus(); + return; + } + + if (txt_fngHandle.SelectedIndex <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨澶勭疆缁撴灉锛�"); + txt_fngHandle.Focus(); + return; + } + if (txt_zrType.SelectedIndex <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨璐d换鍒ゅ畾锛�"); + txt_zrType.Focus(); + return; + } + if (_txt_fzrId.Length <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨璐d换浜猴紒"); + txt_fzrId.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; + } + } + }; + var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 @@ -500,8 +678,47 @@ fmanageNo = _txt_fmanageNo,//娴佺▼缂栧彿 lotNo1 = _txt_lotNo1,//閫佹鎵瑰彿 lotNo = _txt_lotNo,//鐢熶骇宸ュ崟 - edtType = 0 + kbList = _kbList, + fngHandle = _txt_fngHandle, + fzrId = _txt_fzrId, + workNo = _txt_workNo, + fmrmode = _txt_fmrmode, + zrType = _txt_zrType, + list = new List<dynamic>(), }; + gvMx1.CloseEditor(); + gvMx1.PostEditor(); + gvMx1.UpdateCurrentRow(); + for (var i = 0; i < gvMx1.DataRowCount; i++) + { + var row = gvMx1.GetDataRow(i); + if (row != null) + { + Guid _guid = UtilityHelper.ToGuid(row["guid"].ToString()); + string _defectLevel = row["defectLevel"].ToString(); + string _defectDetails = row["defectDetails"].ToString(); + string _fcheckResu = row["fcheckResu"].ToString(); + if (_fcheckResu == _strTag) + { + if (string.IsNullOrEmpty(_defectLevel)) + { + MsgHelper.ShowError("璇烽�夋嫨缂洪櫡绛夌骇锛�"); + return; + } + if (string.IsNullOrEmpty(_defectDetails)) + { + MsgHelper.ShowError("璇峰~鍐欑己闄锋弿杩帮紒"); + return; + } + _obj.list.Add(new + { + guid5 = _guid, + defectLevel = _defectLevel, + defectDetails = _defectDetails, + }); + } + } + } try { string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); @@ -516,7 +733,7 @@ this.setEable(false); toolBarMenu1.currentAction = ""; Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); - getModel(lbGuid.Text,"0"); + getModel(lbGuid.Text, "0"); } } catch (Exception ex) @@ -532,7 +749,7 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); // _sbSqlWhere += " and isnull(fsubmit,0)=0"; PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); @@ -609,6 +826,7 @@ gcMx1.ForceInitialize(); gvMx1.BestFitColumns(); ucUpFileList1.pGuid = lbGuid.Text.Trim(); + ucChouJianList1.pGuid = lbGuid.Text.Trim(); if (guid5.Length > 10) { int rowHandle = 0; @@ -640,6 +858,11 @@ private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e) { if (e.Page.Name == "tabMxPage2") + { + ucChouJianList1.getList14(); + + } + if (e.Page.Name == "tabMxPage3") { ucUpFileList1.getFileList(); } @@ -685,12 +908,65 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - + private void setEable(bool bl) { txtJianYan.ReadOnly = !bl; btnLoad.Enabled = bl; + ucChouJianList1.IsReadOnly(!bl); btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰"); + + } + + /// <summary> + /// 璇诲彇缂洪櫡绛夌骇 + /// </summary> + /// <param name="curPage"></param> + private void getRptDefectLevel() + { + string _where = " and 1=1 and s_type='缂洪櫡绛夌骇'"; + var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where); + var json = JsonConvert.SerializeObject(pgq); + try + { + var strReturn = UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json); + var dd = UtilityHelper.ReturnToTablePage(strReturn); + var dt = dd.rtnData.list; + foreach (DataRow dr in dt.Rows) + { + rptDefectLevel.Items.Add(dr["defectName"].ToString()); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + /// <summary> + /// 閫夋嫨缂洪櫡鎻忚堪 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void rptDefectDetails_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx1.FocusedRowHandle; + if (rowhandle < 0) + return; + UcDictionarySelect frm = new UcDictionarySelect("缂洪櫡鎻忚堪", " s_type='FQC缂洪櫡鎻忚堪'"); + frm.UpdateParent += (ss, ee) => + { + System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); + var lst = ee.DynamicList; + foreach (dynamic dym in lst) + { + if (stringBuilder.Length > 0) + stringBuilder.Append("|"); + stringBuilder.Append(dym.dicTxt); + } + gvMx1.SetFocusedRowCellValue("defectDetails", stringBuilder.ToString()); + // this.TextTxt = ; + }; + frm.ShowDialog(); } } } \ No newline at end of file -- Gitblit v1.9.3