From 8a7bc73b5ac40d26ec72a5df94ca15c5a2976af0 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期一, 15 九月 2025 10:20:07 +0800
Subject: [PATCH] bug

---
 DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs |   69 ++++++++++++++++++++++++++++++++--
 1 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
index 26d3554..6843b0f 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkStart.cs
@@ -3,6 +3,8 @@
 using Newtonsoft.Json;
 using System;
 using System.Data;
+using System.IO;
+using System.Windows;
 
 namespace Gs.DevApp.DevFrm.Work
 {
@@ -12,11 +14,25 @@
         /// 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;
+            };
         }
 
         private void BtnLogin_Click(object sender, EventArgs e)
@@ -24,24 +40,67 @@
             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 == "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()
         {
@@ -63,7 +122,7 @@
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
     }

--
Gitblit v1.9.3