From 0182a12e08e1253e9fb2d1b4dabb353babf1feea Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期六, 25 十月 2025 09:01:49 +0800
Subject: [PATCH] 更新操作人
---
DevApp/Gs.DevApp/UserControl/SelectDeleteBar.cs | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 105 insertions(+), 10 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/SelectDeleteBar.cs b/DevApp/Gs.DevApp/UserControl/SelectDeleteBar.cs
index 968353d..894572d 100644
--- a/DevApp/Gs.DevApp/UserControl/SelectDeleteBar.cs
+++ b/DevApp/Gs.DevApp/UserControl/SelectDeleteBar.cs
@@ -1,10 +1,16 @@
-锘縰sing DevExpress.Utils.DirectXPaint;
+锘縰sing DevExpress.Charts.Native;
+using DevExpress.Utils.DirectXPaint;
+using DevExpress.Utils.Text.Internal;
+using DevExpress.Utils.VisualEffects;
using DevExpress.XtraGrid.Views.Base.ViewInfo;
+using Gs.DevApp.DevFrm.Rpt;
+using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
+using System.Drawing;
using System.Windows.Forms;
namespace Gs.DevApp.UserControl
@@ -14,11 +20,15 @@
private readonly string _webServiceName = "VArrivalBarcodeManager/";
private string aboutGuid = "";
private string aboutType = "";//鍚庣洊鐮�
+ private string qcGuid = "";//fqc guid锛岀敤浜庨噸鎵撶殑鏃跺��
+
/// <summary>
- /// 鐖朵翰guid
+ ///
/// </summary>
- /// <param name="_aboutGuid"></param>
- public SelectDeleteBar(string _aboutGuid, string _aboutType)
+ /// <param name="_aboutGuid">鐖朵翰guid</param>
+ /// <param name="_aboutType">绫诲埆锛堝悗鐩栫爜锛岃拷婧爜锛屽彈鎵樺叆搴撶瓑锛�</param>
+ /// <param name="_qcGuid">qcGuid锛屽湪杩斿伐閲嶆潯鐨勬椂鍊�</param>
+ public SelectDeleteBar(string _aboutGuid, string _aboutType, string _qcGuid = "")
{
InitializeComponent();
this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); };
@@ -29,6 +39,27 @@
this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
this.aboutGuid = _aboutGuid;
this.aboutType = _aboutType;
+ this.qcGuid = _qcGuid;
+ this.Text = "鎵归噺鎿嶄綔銆�" + this.aboutType + "銆�,銆�" + this.aboutGuid + "銆�";
+ switch (aboutType)
+ {
+ case "鎵樻澘鐮�":
+ btnDelete.Visible = false;
+ break;
+ case "杩芥函鐮�":
+ btnDelete.Visible = false;
+ colT1.Caption = "绾夸綋缂栧彿";
+ colT2.Caption = "绾夸綋鍚嶇О";
+ break;
+ case "鍚庣洊鐮�":
+ colT1.Caption = "缁戝畾鎵樻澘鐮�";
+ colT2.Caption = "缁戝畾杩芥函鐮�";
+ break;
+ default:
+ colT1.Caption = "鍏ュ簱浜�";
+ colT2.Caption = "鍏ュ簱鏃ユ湡";
+ break;
+ }
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", null, null, false);
getPageList(1);
btnDelete.Click += (s, e) =>
@@ -53,7 +84,7 @@
}
if (sb.Length <= 0)
{
- MsgHelper.Warning("璇峰嬀閫変綘瑕佸垹闄ょ殑鏉$爜锛�");
+ MsgHelper.ShowError("璇峰嬀閫変綘瑕佸垹闄ょ殑鏉$爜锛�");
return;
}
var _obj = new
@@ -73,7 +104,8 @@
strMsg = "1";
MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
}
- else {
+ else
+ {
MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
return;
}
@@ -83,7 +115,70 @@
MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
return;
}
- UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = strMsg }); Close();
+ UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = strMsg, Data = "delete" }); Close();
+ };
+ btnPrint.Click += (s, e) =>
+ {
+ gridView1.PostEditor();
+ gridView1.UpdateCurrentRow();
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ DataTable dtSelect = this.gcMain.DataSource as DataTable;
+ {
+ foreach (DataRow dr in dtSelect.Rows)
+ {
+ string checkBox = dr["chkInt"].ToString();
+ string _guid = dr["guid"].ToString();
+ if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
+ {
+ if (sb.Length > 0)
+ sb.Append("|");
+ sb.Append(_guid.ToString());
+ }
+ }
+ }
+ if (sb.Length <= 0)
+ {
+ MsgHelper.ShowError("璇峰嬀閫変綘瑕佹墦鍗扮殑鏉$爜锛�");
+ return;
+ }
+ if (aboutType == "鍚庣洊鐮�")
+ {
+ var _obj = new
+ {
+ keyType = "瀹㈡埛妯℃澘"
+ };
+ var json = JsonConvert.SerializeObject(_obj);
+ try
+ {
+ var strReturn =
+ UtilityHelper.HttpPost("", "Report/GetTemplateList", json);
+ ReturnModel<DataTable> dd = UtilityHelper.ReturnToList(strReturn);
+ DataTable dt = dd.rtnData;
+ if (dd.rtnCode > 0)
+ {
+ // 鍒涘缓鎴栬幏鍙栦竴涓狢ontextMenu瀵硅薄锛堜緥濡備娇鐢–ontextMenuStrip锛�
+ ContextMenu contextMenu = new ContextMenu();
+ foreach (DataRow dr in dt.Rows)
+ {
+ MenuItem menuItem1 = new MenuItem(dr["reportType"].ToString() + "銆�" + dr["reportName"].ToString() + "銆�");
+ menuItem1.Click += (ss, ee) =>
+ {
+ string rptParameter = dr["reportType"].ToString();
+ UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = sb.ToString(), Data = "print" + rptParameter }); Close();
+ };
+ contextMenu.MenuItems.Add(menuItem1);
+ }
+ // 鏄剧ず鑿滃崟鍦ㄦ寜閽殑浣嶇疆
+ contextMenu.Show(btnPrint, new Point(0, btnPrint.Height)); // 璋冩暣绗簩涓弬鏁颁互璋冩暣鑿滃崟鐨勬樉绀轰綅缃�
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = sb.ToString(), Data = "print" }); Close();
};
}
@@ -106,12 +201,12 @@
keyWhere = "",
aboutGuid = this.aboutGuid,
aboutType = this.aboutType,
+ qcGuid=this.qcGuid,
};
var json = JsonConvert.SerializeObject(_obj);
try
{
- var strReturn = UtilityHelper.HttpPost("",
- _webServiceName + "SelectBarcode", json);
+ var strReturn = UtilityHelper.HttpPost("",_webServiceName + "SelectBarcode", json);
var dd = UtilityHelper.ReturnToTablePage(strReturn);
var dt = dd.rtnData.list;
gcMain.BindingContext = new BindingContext();
@@ -121,7 +216,7 @@
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
--
Gitblit v1.9.3