From 3c6cad1224e7cb985f03d15cc98a4a2074a5af49 Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期一, 22 十二月 2025 22:25:33 +0800
Subject: [PATCH] 增加轮播看板
---
DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs | 127 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 119 insertions(+), 8 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
index 0310c5e..b723762 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
@@ -3,42 +3,152 @@
using Newtonsoft.Json;
using System;
using System.Data;
+using System.IO;
+using System.Windows;
namespace Gs.DevApp.DevFrm.Work
{
public partial class Frm_WorkStart : DevExpress.XtraEditors.XtraForm
{
+ /// <summary>
+ /// pc鍙渶瑕佽繃绔�
+ /// </summary>
+ private string isPc = "鎶曞叆,鐢垫,姘存,缁堟";
+ /// <summary>
+ /// 鐢垫鍙栧�艰矾寰勶紝鐩墠閮芥槸瀛樼‖鐩�
+ /// </summary>
+ string dianJianPath = "";
public Frm_WorkStart()
{
InitializeComponent();
-
_getListJyxm();
btnLogin.Click += BtnLogin_Click;
+ txt_gx.EditValueChanged += (s, e) =>
+ {
+ string fGx = txt_gx.Text.Trim();
+ if (fGx == "G003:姘存")
+ {
+ chkWater.Visible = true;
+ }
+ else
+ chkWater.Visible = false;
+
+
+ if (fGx == "G001:鎶曞叆")
+ {
+ btnFg.Visible = true;
+ }
+ else
+ btnFg.Visible = false;
+
+ };
+
+ btnFg.Click += BtnFg_Click;
}
- private void BtnLogin_Click(object sender, EventArgs e)
+ /// <summary>
+ /// 杩斿伐绫诲瀷杩涘叆
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private void BtnFg_Click(object sender, EventArgs e)
{
if (txt_bc.SelectedIndex <= 0)
{
txt_bc.Focus();
- Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇烽�夋嫨鐝锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鐝锛�");
return;
}
if (txt_gx.SelectedIndex <= 0)
{
txt_gx.Focus();
- Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇烽�夋嫨宸ュ簭锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨宸ュ簭锛�");
return;
}
string fGx = txt_gx.Text.Trim();
string fBc = txt_bc.Text.Trim();
- Frm_Work01 frm = new Frm_Work01(fGx, fBc);
+ if (fGx == "G001:鎶曞叆")
+ {
+ Frm_Work01Fg frm = new Frm_Work01Fg(fGx, fBc);
+ frm.ShowDialog();
+ return;
+ }
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("閫夋嫨閿欒锛岃閲嶈瘯锛�");
+ return;
+ }
+
+ /// <summary>
+ /// 姝e父杩涘叆
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void BtnLogin_Click(object sender, EventArgs e)
+ {
+ if (txt_bc.SelectedIndex <= 0)
+ {
+ txt_bc.Focus();
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鐝锛�");
+ return;
+ }
+ if (txt_gx.SelectedIndex <= 0)
+ {
+ txt_gx.Focus();
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨宸ュ簭锛�");
+ return;
+ }
+ string fGx = txt_gx.Text.Trim();
+ string fBc = txt_bc.Text.Trim();
+ //濡傛灉鏄數妫�
+ if (fGx == "G002:鐢垫")
+ {
+ if (!getConfigDianJian())
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇诲彇銆怗002:鐢垫銆戠疆鏂囦欢澶辫触锛岃鑱旂郴绠$悊鍛橈紒");
+ return;
+ }
+ }
+ Frm_Work01 frm = new Frm_Work01(fGx, fBc, dianJianPath, (chkWater.Checked ? 1 : 0));
frm.ShowDialog();
}
+ /// <summary>
+ /// 鍏堣鍙栫數妫�鐨勫瓨鍌ㄨ矾寰�
+ /// </summary>
+ /// <returns></returns>
+ private bool getConfigDianJian()
+ {
+ string _where = " and 1=1 and defect_code='1008'";
+ var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where);
+ var json = JsonConvert.SerializeObject(pgq);
+ try
+ {
+ var strReturn = UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json);
+ var dd = UtilityHelper.ReturnToTablePage(strReturn);
+ var dt = dd.rtnData.list;
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ dianJianPath = dt.Rows[0]["defectName"].ToString();
+ if (File.Exists(dianJianPath))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return false;
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+ return false;
+ }
+ }
/// <summary>
- /// 璇诲彇宸ュ簭涓嬫媺
+ /// 璇诲彇宸ュ簭涓嬫媺,鍚屾椂閰嶅isPc
/// </summary>
private void _getListJyxm()
{
@@ -52,14 +162,15 @@
txt_gx.Properties.Items.Add("-璇烽�夋嫨-");
foreach (DataRow dr in dt.Rows)
{
- txt_gx.Properties.Items.Add(dr["processNo"].ToString() + ":" + dr["processName"].ToString());
+ if (isPc.Contains(dr["processName"].ToString()))
+ txt_gx.Properties.Items.Add(dr["processNo"].ToString() + ":" + dr["processName"].ToString());
}
txt_gx.Focus();
txt_gx.SelectedIndex = 0;
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
--
Gitblit v1.9.3