From 07524287033977cdb0cf45c66f2c3b5d8cc44fb7 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期四, 30 十月 2025 08:41:49 +0800
Subject: [PATCH] 委外加上完结
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs | 183 +++++++++++++++++++++++++++------------------
1 files changed, 111 insertions(+), 72 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
index de25f00..2556e59 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
@@ -2,13 +2,12 @@
using Gs.DevApp.DevFrm.QC.Models;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
-using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
-using System.Threading.Tasks;
+using System.Linq;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.QC
@@ -56,10 +55,10 @@
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
- toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick;
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, "foneChecked", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -74,41 +73,7 @@
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
}
-
- /// <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_sampleSizeNo, gridView1, "sampleSizeNo");
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "Approval", JsonConvert.SerializeObject(rowGuid));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- if (_rtn.rtnCode > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- {
- getModel(lbGuid.Text.Trim());
- }
- int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
- gridView1.FocusedRowHandle = rowHandle;
- gridView1.SetFocusedRowCellValue("ftwoChecked", true);
- gridView1.SetFocusedRowCellValue("isenabled", true);
- gridView1.SetFocusedRowCellValue("ftwoCheckor", "宸叉壒鍑�");
- gridView1.SetFocusedRowCellValue("ftwoCheckdate", DateTime.Now.ToString());
- }
- }
- catch (Exception ex)
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
- }
+
/// <summary>
/// 鍙嶅鏍�
@@ -140,7 +105,7 @@
{
getPageList(curPage);
}
-
+
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -162,7 +127,7 @@
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo");
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -176,17 +141,20 @@
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
+ ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
if (xtraTabControl1.SelectedTabPageIndex == 0)
- { }
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ }
else
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
- getPageList(this.pageBar1.CurrentPage);
}
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -223,7 +191,7 @@
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -236,6 +204,7 @@
List<GridView> gridViews = new List<GridView>();
gridViews.Add(gvMx1);
gridViews.Add(gvMx2);
+ gridViews.Add(gvMx3);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gridViews);
}
}
@@ -251,9 +220,11 @@
List<GridView> gridViews = new List<GridView>();
gridViews.Add(gvMx1);
gridViews.Add(gvMx2);
+ gridViews.Add(gvMx3);
UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+ UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
txt_createDate.Text = DateTime.Now.ToString("G");
txt_fversion.Text = "1";
}
@@ -267,14 +238,14 @@
toolBarMenu1.isSetBtn = false;
if (string.IsNullOrEmpty(txt_sampleSizeNo.Text.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鏍囧噯缂栫爜涓嶈兘涓虹┖锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍囧噯缂栫爜涓嶈兘涓虹┖锛�");
txt_sampleSizeNo.Focus();
return;
}
if (string.IsNullOrEmpty(txt_sampleSizeName.Text.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鏍囧噯鍚嶇О涓嶈兘涓虹┖锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍囧噯鍚嶇О涓嶈兘涓虹┖锛�");
txt_sampleSizeName.Focus();
return;
}
@@ -284,6 +255,9 @@
gvMx2.CloseEditor();
gvMx2.PostEditor();
gvMx2.UpdateCurrentRow();
+ gvMx3.CloseEditor();
+ gvMx3.PostEditor();
+ gvMx3.UpdateCurrentRow();
try
{
var qmaql2 = new List<MesQmAql2>();
@@ -359,14 +333,40 @@
});
}
}
+ var qmaql4 = new List<MesQmAql4>();
+ for (var i = 0; i < gvMx3.DataRowCount; i++)
+ {
+ var row = gvMx3.GetDataRow(i);
+ if (row != null)
+ {
+ if (string.IsNullOrEmpty(row["aqlType"].ToString()))
+ {
+ MsgHelper.ShowError("鎷掓敹璐ㄩ噺姘村钩涓嶈兘涓虹┖锛�");
+ return;
+ }
+ qmaql4.Add(new MesQmAql4
+ {
+ Guid = UtilityHelper.ToGuid(row["Guid"].ToString()),
+ AqlType = Convert.ToDecimal(row["AqlType"].ToString()),
+ AqlTypeCr = row["AqlTypeCr"].ToString(),
+ AqlTypeMa = row["AqlTypeMa"].ToString(),
+ AqlTypeMi = row["AqlTypeMi"].ToString(),
+ });
+ }
+ }
if (qmaql2.Count <= 0)
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鏍锋湰閲忓瓙鐮佷笉鑳戒负绌猴紒");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍锋湰閲忓瓙鐮佷笉鑳戒负绌猴紒");
return;
}
if (qmaql3.Count <= 0)
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥牱鏂规涓嶈兘涓虹┖锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎶芥牱鏂规涓嶈兘涓虹┖锛�");
+ return;
+ }
+ if (qmaql4.Count <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("AQL鎶芥牱鍩哄噯涓嶈兘涓虹┖锛�");
return;
}
var _obj = new MesQmAql1
@@ -381,28 +381,33 @@
FoneChecked = false,
Fversion = Convert.ToInt32(txt_fversion.Text.Trim()),
MesQmAql2s = qmaql2,
- MesQmAql3s = qmaql3
+ MesQmAql3s = qmaql3,
+ MesQmAql4s = qmaql4
};
try
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+
if (_rtn.rtnCode > 0)
{
+ ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
lbGuid.Text = _rtn.rtnData;
toolBarMenu1.isSetBtn = true;
List<GridView> gridViews = new List<GridView>();
gridViews.Add(gvMx1);
gridViews.Add(gvMx2);
+ gridViews.Add(gvMx3);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews);
toolBarMenu1.currentAction = "";
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
+ else
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
catch (Exception ex)
@@ -420,7 +425,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -450,9 +455,14 @@
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="strGuid"></param>
private void getModel(string strGuid)
{
bool isEdit = false;
@@ -460,7 +470,7 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -478,10 +488,12 @@
List<GridView> gvList = new List<GridView>();
gvList.Add(gvMx1);
gvList.Add(gvMx2);
+ gvList.Add(gvMx3);
UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
JArray mesQmAql3s = new JArray();
+ JArray mesQmAql4s = new JArray();
foreach (var a in _job["rtnData"]["mesQmAql2s"])
{
array.Add(a);
@@ -492,7 +504,7 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
- //gvMx1.BestFitColumns();
+ //gvMx1.BestFitColumns();
}
else
{
@@ -508,19 +520,36 @@
gcMx2.BindingContext = new BindingContext();
gcMx2.DataSource = dt1;
gcMx2.ForceInitialize();
- // gvMx2.BestFitColumns();
+ // gvMx2.BestFitColumns();
}
else
{
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
+ }
+
+ foreach (var a in _job["rtnData"]["mesQmAql4s"])
+ {
+ mesQmAql4s.Add(a);
+ }
+ DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(mesQmAql4s.ToString());
+ if (dt2.Rows.Count > 0)
+ {
+ gcMx3.BindingContext = new BindingContext();
+ gcMx3.DataSource = dt2;
+ gcMx3.ForceInitialize();
+ // gvMx3.BestFitColumns();
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
}
}
else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -558,13 +587,17 @@
JsonConvert.SerializeObject(lst));
var _rtn =
UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
-
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ if (_rtn.rtnCode > 0)
+ {
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+ getModel(lbGuid.Text);
+ }
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
@@ -601,13 +634,16 @@
JsonConvert.SerializeObject(lst));
var _rtn =
UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
-
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ if (_rtn.rtnCode > 0)
+ {
+ getModel(lbGuid.Text); MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
@@ -627,13 +663,14 @@
case 0:
strMsg = "鍙嶅鏍�";
break;
- };
+ }
+ ;
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -650,9 +687,9 @@
var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
if (_rtn.rtnCode > 0)
{
+ MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(lbGuid.Text.Trim());
@@ -661,10 +698,12 @@
gridView1.FocusedRowHandle = rowHandle;
UtilityHelper.SetCheckIco(gridView1, "foneChecked", "foneCheckor", "foneCheckdate", picCheckBox, this, _inFieldValue.ToString());
}
+ else
+ MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
--
Gitblit v1.9.3