From fbe33a615f1c4e798a0f8e58163e68c3ce789614 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期四, 20 十一月 2025 10:17:49 +0800
Subject: [PATCH] 初始化标准版
---
DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs | 190 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 187 insertions(+), 3 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs b/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
index ad1a9d5..9ac53b6 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
@@ -1,10 +1,13 @@
+using Gs.DevApp.DevFrm.BasicData;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Data;
+using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -19,19 +22,42 @@
InitializeComponent();
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+ toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
+ toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", (value) =>
{
-
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
});
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
+ getModel(value);
}, (value) =>
{
getPageList(this.pageBar1.CurrentPage);
- });
+ },lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
+
+
+ //杩欐槸浠撳簱鏍囪瘑鍗★紝浠呬粎鎵撳嵃
+ this.ucBtnPrint101.SetPlButton(false);
+ this.ucBtnPrint101.btnPrintClick += (s, e) =>
+ {
+ _print101();
+ };
+ this.ucBtnPrint101.btnZhiJieClick += (s, e) => {
+ _print101();
+ };
+
+ //鍔犲叆checkbox begin
+ this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); };
+ this.gridView1.MouseUp += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain1, gridView1); };
+ this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
+ this.colChkInt.OptionsFilter.AllowAutoFilter = false;
+ this.colChkInt.OptionsFilter.AllowFilter = false;
+ this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
+ //鍔犲叆checkbox end
}
private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
@@ -108,7 +134,6 @@
gcMain1.DataSource = dt;
gcMain1.ForceInitialize();
gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
-
}
else
UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -127,5 +152,164 @@
ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+
+ private void getModel(string strGuid)
+ {
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
+ if (string.IsNullOrEmpty(strGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ var _obj = new
+ {
+ guid = strGuid //涓诲缓
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "GetModel",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ var dy = _rtn.rtnData;
+ lbGuid.Text = strGuid;
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
+ }
+ else
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+
+ /// <summary>
+ /// 杩欐槸鍗曚釜鎵撳嵃
+ /// </summary>
+ private void _print101()
+ {
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_itemBarcode, gridView1);
+ ucBtnPrint101.guidKey = rowGuid;
+ if (rowGuid.Length < 36)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浣犺鎵撳嵃鐨勮锛�");
+ this.ucBtnPrint101.rptParameter = "return false";
+ return;
+ }
+ this.ucBtnPrint101.rptParameter = "rpt_cktm{"
+ + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "}";
+ }
+
+
+ /// <summary>
+ /// 杩欐槸鎵归噺鎵撳嵃
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
+ {
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ gridView1.PostEditor();
+ gridView1.UpdateCurrentRow();
+ DataTable dt = this.gcMain1.DataSource as DataTable;
+ {
+ foreach (DataRow dr in dt.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);
+ }
+ }
+ }
+ if (string.IsNullOrEmpty(sb.ToString()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堥�夋嫨鐗╂枡锛�");
+ this.toolBarMenu1.rptParameter = "return false";
+ return;
+ }
+ this.toolBarMenu1.rptParameter = "rpt_cktm{"
+ + "100"
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + sb.ToString()
+ + "}";
+ this.toolBarMenu1.guidKey = null;
+ }
+
+ /// <summary>
+ /// 瀵煎嚭
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+ {
+ using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+ {
+ folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+ DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+ if (dialogResult == DialogResult.OK)
+ {
+ string _folder = folderBrowserDialog.SelectedPath;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and wl.FSubsidiary in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
+ var _params = new
+ {
+ inQueryWhere = _sbSqlWhere.ToString(),//涓诲缓
+ inFid = "",
+ inP1 = "",
+ inP2 = "",
+ inP3 = "",
+ inP4 = ""
+ };
+ var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_cktm", "", "", "", _params);
+ try
+ {
+ string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", JsonConvert.SerializeObject(_obj));
+ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ string _file = _rtn.rtnData.fileUrl.ToString();
+ string _folderName = _folder + "\\" + _file.Replace("down/", "");
+ string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
+ using (WebClient client = new WebClient())
+ {
+ client.DownloadFile(_url, _folderName);
+ }
+ ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+ }
+ else
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3