From 641e86dfaeb2eed992a717beb297c0ba84869f6b Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 15 四月 2025 18:08:38 +0800
Subject: [PATCH] checkbox
---
DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs | 60 ++++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 40 insertions(+), 20 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
index 2d3ecbc..2d1a967 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
@@ -1,9 +1,4 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Data;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using DevExpress.XtraEditors;
+锘縰sing DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Grid;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -11,6 +6,11 @@
using MES.Service.Modes;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Threading.Tasks;
+using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.QC
@@ -19,12 +19,12 @@
{
private List<FilterEntity> _filterList = new List<FilterEntity>();
private readonly string _webServiceName = "MesQmCheckitemManager/";
- public string strType = "";
+ public string strType = "";//iqc type
+ public decimal dfValue = 1; //iqc鐨勬牱鍝佹暟閲忛粯璁�5锛屽惁鍒�1
public Jyxm(string _strType)
{
InitializeComponent();
strType = _strType;
-
}
protected override void OnCreateControl()
{
@@ -39,20 +39,28 @@
toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick;
+ if (strType == "iqc")
+ dfValue = 5;
+ this.gvMx1.InitNewRow += (s, e) =>
+ {
+ this.gvMx1.SetRowCellValue(e.RowHandle, "ypsl", dfValue);
+ int newIndex = gvMx1.DataRowCount + 1;
+ this.gvMx1.SetRowCellValue(e.RowHandle, "forder", newIndex);
+ };
this.toolBarMenu1.getXmlConfig();
Form parentForm = this.FindForm();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, parentForm, "foneChecked", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ }, tips);
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
getModel(value);
}, (value) =>
{
getPageList(this.pageBar1.CurrentPage);
- });
+ }, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
_setIno();
@@ -77,14 +85,12 @@
frm.ShowDialog();
};
btnSave.Click += BtnSave_Click;
-
}
-
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
@@ -106,10 +112,15 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
{
+ Form parentForm;
+ if (this.Parent is Form)
+ parentForm = this.Parent as Form;
+ else
+ parentForm = this.Parent.Parent as Form;
gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
gridView1.ActiveFilter.Clear();
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- var frm = new ShowFilter(gridView1.Columns, _filterList);
+ var frm = new ShowFilter(gridView1.Columns, _filterList, parentForm.GetType().FullName);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -292,13 +303,17 @@
MsgHelper.ShowError("鎺ュ彈姘村钩涓嶈兘涓虹┖锛�");
return;
}
+ if (string.IsNullOrEmpty(row["ypsl"].ToString()))
+ {
+ MsgHelper.ShowError("鏍峰搧鏁伴噺骞充笉鑳戒负绌猴紒");
+ return;
+ }
string _Fstand = row["Fstand"].ToString();
string _FupAllow = row["FupAllow"].ToString();
string _FdownAllow = row["FdownAllow"].ToString();
//鍋囧涓変釜閮戒负绌洪�氳繃
if (string.IsNullOrEmpty(_Fstand) && string.IsNullOrEmpty(_FupAllow) && string.IsNullOrEmpty(_FdownAllow))
{
-
}
else
{
@@ -334,7 +349,7 @@
Memo = row["memo"].ToString(),
FupAllow = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["FupAllow"].ToString()),
FdownAllow = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["FdownAllow"].ToString()),
- FqaType = this.strType,
+ ypsl = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["ypsl"].ToString()),
});
}
}
@@ -344,7 +359,7 @@
ItemId = long.Parse(_ItemId),
Memo = txt_memo.Text.Trim(),
ItemNo = txt_itemNo.Text.Trim(),
- Ftype = "1",
+ Ftype = this.strType,
Fversion = Gs.DevApp.ToolBox.UtilityHelper.ToLong(txt_fversion.Text.Trim()),
list = lst
};
@@ -364,6 +379,8 @@
gridViews.Add(gvMx1);
gridViews.Add(gridView2);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews);
+ toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
}
catch (Exception ex)
@@ -375,7 +392,6 @@
{
MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
-
}
/// <summary>
@@ -386,6 +402,7 @@
{
var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
_sbSqlWhere += " and b.guid is not null";
+ _sbSqlWhere += " and a.FTYPE='" + this.strType + "'";
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount,
"org.FNumber asc ,b.item_no asc,a.FVERSION desc", "", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -405,7 +422,8 @@
{
gcMain1.DataSource = dt;
gcMain1.ForceInitialize();
- gridView1.BestFitColumns();
+ gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
+
}
else
UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -787,7 +805,9 @@
var _obj = new
{
sourceGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()),
- itemGuids = _sbGuids.ToString()
+ itemGuids = _sbGuids.ToString(),
+ iqcType = this.strType,
+ ypsl = this.dfValue
};
try
{
--
Gitblit v1.9.3