From 906f79ff500541dda3626f12c1a05f2d2e57f7a8 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 23 六月 2025 10:46:30 +0800
Subject: [PATCH] 超期重检

---
 DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 101 insertions(+), 8 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs
index 046441e..68187f0 100644
--- a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs
@@ -1,12 +1,7 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing Gs.DevApp.DevFrm.Rpt;
+using Gs.DevApp.ToolBox;
+using Newtonsoft.Json;
 using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.UserControl
@@ -16,6 +11,104 @@
         public UcBtnPrint()
         {
             InitializeComponent();
+            this.btnPrint.Click += (s, e) =>
+            {
+                if (btnPrintClick != null)
+                    btnPrintClick(this, e);
+                else
+                    return;
+
+                if (rptParameter == "return false")
+                    return;
+                if (string.IsNullOrEmpty(rptParameter))
+                {
+                    MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒");
+                    return;
+                }
+                var _bl = false;
+                _bl = _ckRptService();
+                if (_bl)
+                {
+                    try
+                    {
+                        using (Form frm = new RptPreview(guidKey, rptParameter))
+                        {
+                            frm.ShowDialog();
+                        }
+                    }
+                    catch (Exception)
+                    {
+                    }
+                    return;
+                }
+
+                MsgHelper.ShowError("娌℃湁璁捐妯℃澘锛岃鍏堣璁℃ā鏉匡紒");
+            };
+            this.btnAll.Click += (s, e) =>
+            {
+                if (btnAllClick != null)
+                    btnAllClick(this, e);
+                else
+                    return;
+            };
+        }
+        /// <summary>
+        ///     鍏抽敭瀛楋紝涓�鑸槸涓婚敭
+        /// </summary>
+        public string guidKey { get; set; }
+
+
+        /// <summary>
+        /// 鎵归噺鎿嶄綔鏃剁殑鍏抽敭瀛楋細鎵樻澘鐮�
+        /// </summary>
+        public string allClickKey { get; set; }
+
+
+        /// <summary>
+        ///     鎶ヨ〃锛屽湪鏁版嵁搴撲腑瑕佸敮涓�,濡傦細瀛樺偍杩囩▼鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏
+        /// </summary>
+        public string rptParameter { get; set; }
+
+        /// <summary>
+        /// 鎵撳嵃
+        /// </summary>
+        public event EventHandler btnPrintClick;
+
+        /// <summary>
+        /// 鎵归噺鎿嶄綔
+        /// </summary>
+        public event EventHandler btnAllClick;
+
+        private bool _ckRptService()
+        {
+            try
+            {
+                var _obj = new
+                {
+                    guid = guidKey,
+                    rptParameter,
+                    isDesign = 1
+                };
+                var strJson = UtilityHelper.HttpPost("", "Report/GetRptData",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                if (_rtn.rtnCode > 0) return true;
+                return false;
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                return true;
+            }
+            return false;
+        }
+
+
+        public void SetPlButton( bool blPiLiang) {
+            if (blPiLiang == true)
+                this.layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
+            else
+                this.layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
         }
     }
 }

--
Gitblit v1.9.3