From efd177828ad3b7bbf04b2d48a118f2056abf0926 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期二, 03 九月 2024 13:14:40 +0800
Subject: [PATCH] Merge branch 'master' into liudl

---
 Admin.NET/WCS.Application/Service/WcsPosition/WcsPositionService.cs      |    1 
 Admin.NET/WCS.Application/Service/WcsTask/WcsTaskService.cs              |    5 
 Admin.NET/WCS.Application/PLC/PLCUtil.cs                                 |  174 ++++++------
 Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs       |   16 +
 Web/src/views/wcs/wcsAlarmInfo/index.vue                                 |    2 
 Admin.NET/WCS.Application/Hub/PlcHub.cs                                  |    6 
 Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs          |   54 ++++
 Web/src/views/device/deviceMonitor/index.vue                             |  106 ++++---
 Web/src/views/wcs/wcsTask/component/editDialog.vue                       |   56 ----
 Web/src/views/device/alarmManage/index.vue                               |  194 ++++++++------
 Admin.NET/WCS.Application/PLC/PLCTaskAction.cs                           |  145 ++++++++--
 Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs |    2 
 Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs    |    3 
 13 files changed, 442 insertions(+), 322 deletions(-)

diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs
index ba57a75..f85da61 100644
--- a/Admin.NET/WCS.Application/Hub/PlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -42,7 +42,13 @@
     {
         //杩愯鐘舵��
         if (context.BoRunningState.HasValue)
+        {
             PLCTaskAction.boRunningState = context.BoRunningState.Value;
+            if (context.BoRunningState.Value)
+                PLCTaskAction.Init();
+            else
+                PLCTaskAction.Stop();
+        }
         //鑴辨満妯″紡
         if (context.BoOffline.HasValue)
             PLCTaskAction.boOffline = context.BoOffline.Value;
diff --git a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
index 78a963c..9576ac4 100644
--- a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
@@ -1,4 +1,5 @@
 锘縰sing Admin.NET.Core.Service;
+using DocumentFormat.OpenXml.Drawing;
 using Furion.Logging;
 using Microsoft.AspNetCore.SignalR;
 
@@ -16,12 +17,13 @@
     private static readonly SysCacheService sysCacheService = App.GetRequiredService<SysCacheService>();
     private static readonly IHubContext<PlcHub, IPlcHub> _plcHubContext = App.GetService<IHubContext<PlcHub, IPlcHub>>();
 
-    private static List<WcsPlc> listPlc;
-    private static List<WcsDevice> listPlcDevice;
-    private static List<WcsPosition> listPlcStation;
+    private static List<WcsPlc> listPlc = new List<WcsPlc>();
+    private static List<WcsDevice> listPlcDevice = new List<WcsDevice>();
+    private static List<WcsPosition> listPlcStation = new List<WcsPosition>();
+    private static List<WcsAlarmInfo> listAlarmInfo = new List<WcsAlarmInfo>();
 
     private static List<PLCUtil> listPlcUtil = new List<PLCUtil>();
-    private static CancellationTokenSource cts;//鍙栨秷绾跨▼鏍囪瘑
+    private static CancellationTokenSource cts = new CancellationTokenSource();//鍙栨秷绾跨▼鏍囪瘑
     //瀵瑰鍏竷杩炴帴鐘舵��
     public static List<PLCUtil> listPlcConn
     {
@@ -32,10 +34,6 @@
     {
         //璁㈤槄浜嬩欢
         DeviceValueChangeEvent += PLCService.OnChangeEvent;
-
-        listPlc = _db.Queryable<WcsPlc>().ToList();
-        listPlcDevice = _db.Queryable<WcsDevice>().ToList();
-        listPlcStation = _db.Queryable<WcsPosition>().ToList();
     }
     /// <summary>
     /// 鍒濆鍖朠LC杩炴帴
@@ -48,6 +46,7 @@
             listPlc = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine || s.Type == PLCTypeEnum.BoxConveyorLine).ToList();
             listPlcDevice = _db.Queryable<WcsDevice>().ToList();
             listPlcStation = _db.Queryable<WcsPosition>().ToList();
+            listAlarmInfo = _db.Queryable<WcsAlarmInfo>().ToList();
             //绛夊緟鍑犵閽燂紝鎶婂凡鏈夌嚎绋嬪彇娑堟帀鍐嶈繛鎺�
             Thread.Sleep(5000);
             foreach (var modPlcUtil in listPlcUtil)
@@ -64,6 +63,8 @@
         cts = new CancellationTokenSource();
         boRunningState = true;
         StartRead();
+        ConnectionStatus();
+        StartWatchAlarm();
     }
     /// <summary>
     /// 寮�鍚鍙杙lc绾跨▼
@@ -82,9 +83,11 @@
                     {
                         foreach (var modPlcUtil in listPlcUtil)
                         {
-                            modPlcUtil.Close();
+                            if (modPlcUtil != null && modPlcUtil.Connected)
+                                modPlcUtil.Close();
                         }
-                        throw new OperationCanceledException();
+                        break;
+                        //throw new OperationCanceledException();
                     }
                     try
                     {
@@ -94,7 +97,7 @@
                             modPlcUtil = new PLCUtil(modPlc);
                             listPlcUtil.Add(modPlcUtil);
                         }
-                        var listDevice = listPlcDevice.Where(s => s.PlcId == _modplc.Id).ToList();
+                        var listDevice = listPlcDevice.Where(s => s.PlcId == _modplc.Id && s.DeviceType == DeviceTypeEnum.Business).ToList();
                         //寰幆璇昏澶�
                         foreach (var modDevice in listDevice.Where(s => s.Level == DeviceLevelEnum.DB))
                         {
@@ -109,9 +112,9 @@
                                 dto.Type = _modplc.Type;
                                 dto.PLCUtil = modPlcUtil;
                                 dto.listStation = listPlcStation.Where(s => s.DeviceId == modDevice.Id).ToList();
-                                dto.listDevice = listDevice.Where(s => s.StationNum == modDevice.StationNum).ToList();
+                                dto.listDevice = listDevice.Where(s => s.StationNum == modDevice.StationNum && s.Level == DeviceLevelEnum.Station).ToList();
                                 //杩欓噷瑙﹀彂鍊煎彉鏇翠簨浠�
-                                DeviceValueChangeEvent?.Invoke(dto, EventArgs.Empty);
+                                //DeviceValueChangeEvent?.Invoke(dto, EventArgs.Empty);
                             }
                             else
                             {
@@ -146,35 +149,41 @@
         {
             try
             {
-                //鍙栨秷绾跨▼ 鍏抽棴PLC杩炴帴
-                if (cts.Token.IsCancellationRequested)
+                while (true)
                 {
-                    foreach (var modPlcUtil in listPlcUtil)
+
+                    //鍙栨秷绾跨▼ 鍏抽棴PLC杩炴帴
+                    if (cts.Token.IsCancellationRequested)
                     {
-                        modPlcUtil.Close();
-                    }
-                    throw new OperationCanceledException();
-                }
-                //鑾峰彇姣忎釜PLC杩炴帴鐘舵��
-                foreach (var modPlc in listPlc)
-                {
-                    var modPlcUtil = listPlcUtil.FirstOrDefault(s => s.PlcId == modPlc.Id);
-                    if (modPlcUtil == null)
-                        modPlc.IsConn = false;
-                    else
-                        modPlc.IsConn = modPlcUtil.Connected;
-                    if (sysCacheService.ExistKey("PLCCONN" + modPlc.Id))
-                    {
-                        var cachePlc = sysCacheService.Get<WcsPlc>("PLCCONN" + modPlc.Id);
-                        if (cachePlc.IsConn != modPlc.IsConn)
+                        foreach (var modPlcUtil in listPlcUtil)
                         {
-                            //杩炴帴鐘舵�佸彉鏇� 閫氱煡鍓嶇
-                            _plcHubContext.Clients.All.PublicPlcConn(modPlc);
+                            if (modPlcUtil != null && modPlcUtil.Connected)
+                                modPlcUtil.Close();
                         }
+                        break;
+                        //throw new OperationCanceledException();
                     }
-                    sysCacheService.Set("PLCCONN" + modPlc.Id, modPlc);
+                    //鑾峰彇姣忎釜PLC杩炴帴鐘舵��
+                    foreach (var modPlc in listPlc)
+                    {
+                        var modPlcUtil = listPlcUtil.FirstOrDefault(s => s.PlcId == modPlc.Id);
+                        if (modPlcUtil == null)
+                            modPlc.IsConn = false;
+                        else
+                            modPlc.IsConn = modPlcUtil.Connected;
+                        if (sysCacheService.ExistKey("PLCCONN" + modPlc.Id))
+                        {
+                            var cachePlc = sysCacheService.Get<WcsPlc>("PLCCONN" + modPlc.Id);
+                            if (cachePlc.IsConn != modPlc.IsConn)
+                            {
+                                //杩炴帴鐘舵�佸彉鏇� 閫氱煡鍓嶇
+                                _plcHubContext.Clients.All.PublicPlcConn(modPlc);
+                            }
+                        }
+                        sysCacheService.Set("PLCCONN" + modPlc.Id, modPlc);
+                    }
+                    Thread.Sleep(1000);
                 }
-                Thread.Sleep(3000);
             }
             catch (OperationCanceledException)
             {
@@ -189,6 +198,70 @@
         });
 
     }
+
+    /// <summary>
+    /// 寮�鍚姤璀︾洃鎺�
+    /// </summary>
+    public static void StartWatchAlarm()
+    {
+        Task.Run(() =>
+        {
+            var listPlc = listAlarmInfo.GroupBy(s => new { s.PlcIP, s.PlcPort }).ToList();
+            List<PLCUtil> listPlcUtil = new List<PLCUtil>();
+            int i = 0;
+            foreach (var modPlc in listPlc)
+            {
+                listPlcUtil.Add(new PLCUtil(new WcsPlc() { Id = i++, IP = modPlc.Key.PlcIP, Port = modPlc.Key.PlcPort, PLCType = PLCEnum.S7_1500 }));
+            }
+            while (true)
+            {
+                //鍙栨秷绾跨▼ 鍏抽棴PLC杩炴帴
+                if (cts.Token.IsCancellationRequested)
+                {
+                    foreach (var modPlcUtil in listPlcUtil)
+                    {
+                        if (modPlcUtil != null && modPlcUtil.Connected)
+                            modPlcUtil.Close();
+                    }
+                    break;
+                    //throw new OperationCanceledException();
+                }
+                foreach (var modUtil in listPlcUtil)
+                {
+                    //鎶ヨ鐐逛綅
+                    var listAlarm = listAlarmInfo.Where(s => s.PlcIP == modUtil.PlcId.ToString());
+                    foreach (var modAlarm in listAlarm)
+                    {
+                        (var result, var value) = modUtil.GetPlcDBValue(PLCDataTypeEnum.Short, modAlarm.AlarmCode, "");
+                        if (result.IsSucceed)
+                        {
+                            //鍋囪涓嶄负0灏辩畻鎶ヨ
+                            if (value != 0)
+                            {
+                                //淇敼鎶ヨ鐘舵�佸悓鏃惰褰曟姤璀︽棩蹇�
+                                modAlarm.AlarmTime = DateTime.Now;
+                                modAlarm.Status = YesNoEnum.Y;
+                                _db.Updateable(modAlarm).ExecuteCommand();
+                                WcsAlarmLog modLog = modAlarm.Adapt<WcsAlarmLog>();
+                                _db.Insertable(modLog).ExecuteCommand();
+                                //涓嬪彂鎶ヨ鐘舵��
+                                _plcHubContext.Clients.All.PublicAlarm(modAlarm.Adapt<WcsAlarmInfoOutput>());
+                            }
+                            //鍙栨秷鎶ヨ
+                            else if (modAlarm.Status == YesNoEnum.Y)
+                            {
+                                modAlarm.AlarmTime = null;
+                                modAlarm.Status = YesNoEnum.N;
+                                _db.Updateable(modAlarm).ExecuteCommand();
+                            }
+                        }
+                    }
+
+                }
+                Thread.Sleep(1000);
+            }
+        }, cts.Token);
+    }
     /// <summary>
     /// 鍋滄鏈嶅姟
     /// </summary>
diff --git a/Admin.NET/WCS.Application/PLC/PLCUtil.cs b/Admin.NET/WCS.Application/PLC/PLCUtil.cs
index c0b0612..90d6cbc 100644
--- a/Admin.NET/WCS.Application/PLC/PLCUtil.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCUtil.cs
@@ -13,7 +13,7 @@
     public readonly long PlcId;
     private SiemensClient _client;
     private WcsPlc _modPlc;
-
+    private readonly object OLock = new object();
     public PLCUtil(WcsPlc modPlc)
     {
         PlcId = modPlc.Id;
@@ -42,52 +42,55 @@
     /// <returns></returns>
     public (IoTClient.Result, dynamic value) GetPlcDBValue(PLCDataTypeEnum PosType, string DbNumber, string Pos)
     {
-        string address;
-        if (DbNumber.StartsWith("DB"))
-            address = DbNumber + "." + Pos;
-        else
-            address = DbNumber + Pos;
-        dynamic result = null;
-        switch (PosType)
+        lock (OLock)
         {
-            case PLCDataTypeEnum.Bit:
-                result = _client.ReadBoolean(address);
-                break;
-            case PLCDataTypeEnum.Byte:
-                result = _client.ReadByte(address);
-                break;
-            case PLCDataTypeEnum.Short:
-                result = _client.ReadInt16(address);
-                break;
-            case PLCDataTypeEnum.UShort:
-                result = _client.ReadUInt16(address);
-                break;
-            case PLCDataTypeEnum.Int:
-                result = _client.ReadInt32(address);
-                break;
-            case PLCDataTypeEnum.UInt:
-                result = _client.ReadUInt32(address);
-                break;
-            case PLCDataTypeEnum.Long:
-                result = _client.ReadInt64(address);
-                break;
-            case PLCDataTypeEnum.ULong:
-                result = _client.ReadUInt64(address);
-                break;
-            case PLCDataTypeEnum.Float:
-                result = _client.ReadFloat(address);
-                break;
-            case PLCDataTypeEnum.Double:
-                result = _client.ReadDouble(address);
-                break;
-            case PLCDataTypeEnum.String:
-                result = _client.ReadString(address);
-                break;
-            default:
-                result = new IoTClient.Result<object>();
-                break;
+            string address;
+            if (DbNumber.StartsWith("DB"))
+                address = DbNumber + "." + Pos;
+            else
+                address = DbNumber + Pos;
+            dynamic result = null;
+            switch (PosType)
+            {
+                case PLCDataTypeEnum.Bit:
+                    result = _client.ReadBoolean(address);
+                    break;
+                case PLCDataTypeEnum.Byte:
+                    result = _client.ReadByte(address);
+                    break;
+                case PLCDataTypeEnum.Short:
+                    result = _client.ReadInt16(address);
+                    break;
+                case PLCDataTypeEnum.UShort:
+                    result = _client.ReadUInt16(address);
+                    break;
+                case PLCDataTypeEnum.Int:
+                    result = _client.ReadInt32(address);
+                    break;
+                case PLCDataTypeEnum.UInt:
+                    result = _client.ReadUInt32(address);
+                    break;
+                case PLCDataTypeEnum.Long:
+                    result = _client.ReadInt64(address);
+                    break;
+                case PLCDataTypeEnum.ULong:
+                    result = _client.ReadUInt64(address);
+                    break;
+                case PLCDataTypeEnum.Float:
+                    result = _client.ReadFloat(address);
+                    break;
+                case PLCDataTypeEnum.Double:
+                    result = _client.ReadDouble(address);
+                    break;
+                case PLCDataTypeEnum.String:
+                    result = _client.ReadString(address);
+                    break;
+                default:
+                    result = new IoTClient.Result<object>();
+                    break;
+            }
+            return (result, result.Value);
         }
-        return (result, result.Value);
     }
     /// <summary>
     /// 鎵归噺璇诲彇PLC鍊�
@@ -95,49 +98,52 @@
     /// <returns></returns>
     public Result<Dictionary<string, object>> GetPlcBatchDBValue(Dictionary<string, PLCDataTypeEnum> listaddress)
     {
-        Dictionary<string, DataTypeEnum> addresses = new Dictionary<string, DataTypeEnum>();
-        foreach (var address in listaddress)
+        lock (OLock)
         {
-            switch (address.Value)
+            Dictionary<string, DataTypeEnum> addresses = new Dictionary<string, DataTypeEnum>();
+            foreach (var address in listaddress)
             {
-                case PLCDataTypeEnum.Bit:
-                    addresses.Add(address.Key, DataTypeEnum.Bool);
-                    break;
-                case PLCDataTypeEnum.Byte:
-                    addresses.Add(address.Key, DataTypeEnum.Byte);
-                    break;
-                case PLCDataTypeEnum.Short:
-                    addresses.Add(address.Key, DataTypeEnum.Int16);
-                    break;
-                case PLCDataTypeEnum.UShort:
-                    addresses.Add(address.Key, DataTypeEnum.UInt16);
-                    break;
-                case PLCDataTypeEnum.Int:
-                    addresses.Add(address.Key, DataTypeEnum.Int32);
-                    break;
-                case PLCDataTypeEnum.UInt:
-                    addresses.Add(address.Key, DataTypeEnum.UInt32);
-                    break;
-                case PLCDataTypeEnum.Long:
-                    addresses.Add(address.Key, DataTypeEnum.Int64);
-                    break;
-                case PLCDataTypeEnum.ULong:
-                    addresses.Add(address.Key, DataTypeEnum.UInt64);
-                    break;
-                case PLCDataTypeEnum.Float:
-                    addresses.Add(address.Key, DataTypeEnum.Float);
-                    break;
-                case PLCDataTypeEnum.Double:
-                    addresses.Add(address.Key, DataTypeEnum.Double);
-                    break;
-                case PLCDataTypeEnum.String:
-                    addresses.Add(address.Key, DataTypeEnum.String);
-                    break;
-                default:
-                    break;
+                switch (address.Value)
+                {
+                    case PLCDataTypeEnum.Bit:
+                        addresses.Add(address.Key, DataTypeEnum.Bool);
+                        break;
+                    case PLCDataTypeEnum.Byte:
+                        addresses.Add(address.Key, DataTypeEnum.Byte);
+                        break;
+                    case PLCDataTypeEnum.Short:
+                        addresses.Add(address.Key, DataTypeEnum.Int16);
+                        break;
+                    case PLCDataTypeEnum.UShort:
+                        addresses.Add(address.Key, DataTypeEnum.UInt16);
+                        break;
+                    case PLCDataTypeEnum.Int:
+                        addresses.Add(address.Key, DataTypeEnum.Int32);
+                        break;
+                    case PLCDataTypeEnum.UInt:
+                        addresses.Add(address.Key, DataTypeEnum.UInt32);
+                        break;
+                    case PLCDataTypeEnum.Long:
+                        addresses.Add(address.Key, DataTypeEnum.Int64);
+                        break;
+                    case PLCDataTypeEnum.ULong:
+                        addresses.Add(address.Key, DataTypeEnum.UInt64);
+                        break;
+                    case PLCDataTypeEnum.Float:
+                        addresses.Add(address.Key, DataTypeEnum.Float);
+                        break;
+                    case PLCDataTypeEnum.Double:
+                        addresses.Add(address.Key, DataTypeEnum.Double);
+                        break;
+                    case PLCDataTypeEnum.String:
+                        addresses.Add(address.Key, DataTypeEnum.String);
+                        break;
+                    default:
+                        break;
+                }
             }
+            return _client.BatchRead(addresses);
         }
-        return _client.BatchRead(addresses);
     }
     /// <summary>
     /// 鍐欏叆PLC鍊�
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs
index d68c3b6..396fd7a 100644
--- a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs
@@ -43,7 +43,7 @@
     /// <summary>
     /// 鐘舵��
     /// </summary>
-    public int? Status { get; set; }
+    public YesNoEnum? Status { get; set; }
 
     /// <summary>
     /// 璁惧绫诲瀷
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
index 09b5112..a5eda3e 100644
--- a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
@@ -46,6 +46,7 @@
     public async Task<long> Add(AddWcsAlarmInfoInput input)
     {
         var entity = input.Adapt<WcsAlarmInfo>();
+        entity.Status = YesNoEnum.N;
         await _wcsAlarmInfoRep.InsertAsync(entity);
         return entity.Id;
     }
@@ -103,7 +104,7 @@
     public async Task<List<WcsAlarmInfoOutput>> List([FromQuery] PageWcsAlarmInfoInput input)
     {
         return await _wcsAlarmInfoRep.AsQueryable()
-            //.WhereIF(!input.Status.IsNullOrEmpty(), s => s.Status == input.Status)
+            .WhereIF(!input.Status.IsNullOrEmpty(), s => s.Status == input.Status)
             .Select<WcsAlarmInfoOutput>().ToListAsync();
     }
 
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
index 21fbc14..e7d24d7 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
@@ -124,12 +124,26 @@
     /// 浠诲姟绫诲瀷
     /// </summary>
     public TaskTypeEnum? TaskType { get; set; }
+    /// <summary>
+    /// 璧峰宸ヤ綅
+    /// </summary>
+    public string StartLocatNo { get; set; }
+    /// <summary>
+    /// 缁撴潫宸ヤ綅
+    /// </summary>
+    public string EndLocatNo { get; set; }
+    /// <summary>
+    /// 鎵樼洏鐮�
+    /// </summary>
+    public string PalletNo { get; set; }
     public string Plc { get; set; }
     public string Wcs { get; set; }
     /// <summary>
     /// 杩炴帴鐘舵��
     /// </summary>
-    public bool Status { get; set; }
+    public bool Status { get; set; } = false;
+
+
 }
 
 
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
index 6dd80ee..8a5e853 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -1,5 +1,6 @@
 锘�
 using Admin.NET.Core.Service;
+using Elastic.Clients.Elasticsearch;
 
 namespace WCS.Application;
 
@@ -203,20 +204,69 @@
     {
         var list = await _wcsDeviceRep.AsQueryable()
                                     .LeftJoin<WcsPlc>((a, b) => a.PlcId == b.Id)
+                                    .Where((a, b) => a.DeviceType == DeviceTypeEnum.Business)
                                     .Select<WcsDeviceOutput>((a, b) => new WcsDeviceOutput() { Type = b.Type }, true)
                                     .ToListAsync();
         //鑾峰彇璺烘満鐨勭姸鎬�
         foreach (var modDevice in list)
         {
-            if (_sysCacheService.ExistKey("PlcConn" + modDevice.PlcId))
+            if (_sysCacheService.ExistKey("PLCCONN" + modDevice.PlcId))
             {
-                var cachePlc = _sysCacheService.Get<WcsPlc>("PlcConn" + modDevice.PlcId);
+                var cachePlc = _sysCacheService.Get<WcsPlc>("PLCCONN" + modDevice.PlcId);
                 modDevice.Status = cachePlc.IsConn;
+                if (modDevice.Status)
+                {
+                    //璇诲彇plc鐨勫��
+                    var modConn = PLCTaskAction.listPlcConn.FirstOrDefault(s => s != null && s.PlcId == modDevice.PlcId);
+                    if (modConn == null)
+                        break;
+                    try
+                    {
+                        var listPosition = await _wcsDeviceRep.Context.Queryable<WcsPosition>().Where(s => s.DeviceId == modDevice.Id).ToListAsync();
+                        (var result, var plc) = modConn.GetPlcDBValue(modDevice.PosType, modDevice.DbNumber, modDevice.PlcPos);
+                        modDevice.Plc = Convert.ToString(plc);
+                        (result, var wcs) = modConn.GetPlcDBValue(modDevice.PosType, modDevice.DbNumber, modDevice.WcsPos);
+                        modDevice.Wcs = Convert.ToString(wcs);
+                        //浠诲姟鍙�
+                        var modPositionTask = listPosition.FirstOrDefault(s => s.Text == "浠诲姟鍙�");
+                        (result, var taskNo) = modConn.GetPlcDBValue(modPositionTask.PosType, modDevice.DbNumber, modPositionTask.PlcPos);
+                        modDevice.TaskNo = Convert.ToString(taskNo);
+                        //浠诲姟绫诲瀷
+                        var modPositionTaskType = listPosition.FirstOrDefault(s => s.Text == "浠诲姟绫诲瀷");
+                        (result, var taskType) = modConn.GetPlcDBValue(modPositionTaskType.PosType, modDevice.DbNumber, modPositionTaskType.PlcPos);
+                        modDevice.TaskType = (TaskTypeEnum)Convert.ToInt32(taskType);
+                        //璧峰宸ヤ綅
+                        var modPositionStartLocatNo = listPosition.FirstOrDefault(s => s.Text == "璧峰宸ヤ綅");
+                        (result, var startLocatNo) = modConn.GetPlcDBValue(modPositionStartLocatNo.PosType, modDevice.DbNumber, modPositionStartLocatNo.PlcPos);
+                        modDevice.StartLocatNo = Convert.ToString(startLocatNo);
+                        //鐩殑宸ヤ綅
+                        var modPositionEndLocatNo = listPosition.FirstOrDefault(s => s.Text == "鐩殑宸ヤ綅");
+                        (result, var endLocatNo) = modConn.GetPlcDBValue(modPositionEndLocatNo.PosType, modDevice.DbNumber, modPositionEndLocatNo.PlcPos);
+                        modDevice.EndLocatNo = Convert.ToString(endLocatNo);
+                        //鎵樼洏鐮�
+                        var modPositionPalletNo = listPosition.FirstOrDefault(s => s.Text == "鎵樼洏鐮�");
+                        (result, var palletNo) = modConn.GetPlcDBValue(modPositionPalletNo.PosType, modDevice.DbNumber, modPositionPalletNo.PlcPos);
+                        modDevice.PalletNo = Convert.ToString(palletNo);
+                    }
+                    catch (Exception)
+                    {
+
+                    }
+                }
             }
             else
             {
                 modDevice.Status = false;
             }
+
+            //modDevice.TaskNo = "TK00001";
+            //modDevice.TaskType = TaskTypeEnum.In;
+            //modDevice.PalletNo = "2024209032";
+            //modDevice.StartLocatNo = "010101";
+            //modDevice.EndLocatNo = "020202";
+            //modDevice.Wcs = new Random().Next(100).ToString();
+            //modDevice.Plc = new Random().Next(100).ToString();
+            //modDevice.Status = true;
         }
 
         return list;
diff --git a/Admin.NET/WCS.Application/Service/WcsPosition/WcsPositionService.cs b/Admin.NET/WCS.Application/Service/WcsPosition/WcsPositionService.cs
index bd4ff21..0491508 100644
--- a/Admin.NET/WCS.Application/Service/WcsPosition/WcsPositionService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPosition/WcsPositionService.cs
@@ -45,6 +45,7 @@
                 StationNum = u.StationNum,
                 PlcPos = u.PlcPos,
                 PosType = u.PosType,
+                StringLength = u.StringLength,
                 LedIP = u.LedIP,
                 Text = u.Text,
                 CreateUserId = u.CreateUserId,
diff --git a/Admin.NET/WCS.Application/Service/WcsTask/WcsTaskService.cs b/Admin.NET/WCS.Application/Service/WcsTask/WcsTaskService.cs
index 6bd9227..d3408f7 100644
--- a/Admin.NET/WCS.Application/Service/WcsTask/WcsTaskService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsTask/WcsTaskService.cs
@@ -52,7 +52,12 @@
     [DisplayName("澧炲姞浠诲姟琛�")]
     public async Task<long> Add(AddWcsTaskInput input)
     {
+        if(await _wcsTaskRep.AsQueryable().AnyAsync(s => s.TaskNo == input.TaskNo))
+        {
+            throw Oops.Bah("浠诲姟鍙烽噸澶�");
+        }
         var entity = input.Adapt<WcsTask>();
+        entity.Origin = "WCS";
         await _wcsTaskRep.InsertAsync(entity);
         return entity.Id;
     }
diff --git a/Web/src/views/device/alarmManage/index.vue b/Web/src/views/device/alarmManage/index.vue
index 6235e26..4f54ba3 100644
--- a/Web/src/views/device/alarmManage/index.vue
+++ b/Web/src/views/device/alarmManage/index.vue
@@ -36,7 +36,7 @@
 					<div class="grid-container">
 						<div v-for="cell in cellsData" :key="cell.Id">
 							<!-- IsUse鐘舵�� 0:姝e父 1锛氭湁鐗╁搧 2锛氶潪宸ヤ綅 3锛氬皬杞﹁矾绾� 4锛氭晠闅� -->
-							<div v-if="cell.IsShow === 0"  
+							<div v-if="cell.IsShow === 0"
 								:class="['grid-item', { 'active': cell.IsUse === 1 }, { 'active2': cell.IsUse === 2 }, { 'active3': cell.IsUse === 3 }, { 'active3': cell.IsUse === 3 }, { 'active4': cell.IsUse === 4 }]">
 								<div>{{ cell.Code }}</div>
 							</div>
@@ -49,7 +49,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, reactive,onMounted } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
 import { Splitpanes, Pane } from 'splitpanes';
 import 'splitpanes/dist/splitpanes.css';
 import { Vue2 } from 'vue-demi';
@@ -59,19 +59,44 @@
 onMounted(async () => {
 	signalR.off('PublicAlarm');
 	signalR.on('PublicAlarm', (data: any) => {
-		console.log(data)
-		var listAlarm = tableData.value.filter(t => t.id == data.id);
-		if (listAlarm.length == 0) {
-			tableData.value.unshift(data)
+		console.log(data);
+
+		// 鏇存柊 tableData
+		const index = tableData.value.findIndex(t => t.id == data.id);
+
+		if (index === -1) {
+			// 濡傛灉涓嶅瓨鍦紝娣诲姞鏂版暟鎹�
+			tableData.value.unshift(data);
 			tableParams.value.total = tableData.value.length;
+		} else {
+			if (data.status == 1) {
+				// 濡傛灉鐘舵�佷负 1锛屾洿鏂版暟鎹�
+				tableData.value.splice(index, 1, data);
+			} else {
+				// 濡傛灉鐘舵�佷笉鏄� 1锛屾姤璀︽秷闄�
+				tableData.value.splice(index, 1);
+			}
 		}
-		else {
-			//濡傛灉宸茬粡瀛樺湪灏辨洿鏂版暟鎹�
-			const index = tableData.value.findIndex(t => t.id == data.id);
-			tableData.value.splice(index, 1, data);
-		}
+
+		// 鏇存柊杈撻�佺嚎鏁版嵁
+		updateCellData(cellsDataOne, data);
+		updateCellData(cellsDataTwo, data);
+		updateCellData(cellsDataThree, data);
 	});
 });
+// 鏇存柊杈撻�佺嚎鏁版嵁鐨勯�氱敤鍑芥暟
+function updateCellData(cellsData: any[], data: any) {
+	const foundCell = cellsData.find(cell => cell.Code === data.stationNum);
+	if (foundCell) {
+		if (data.status == 1) {
+			foundCell.IsUse = 4;
+		}
+		else{
+			foundCell.IsUse = 0;
+		}
+	}
+}
+
 //鍫嗗灈鏈烘暟鎹�
 const cellsDataLine = [
 	{ Id: 1, Code: '001', LineCode: '', EndLocat: '', IsShow: 1, IsUse: 0, BoxHeight: 10 },
@@ -1562,56 +1587,56 @@
 	{ Id: 202, Code: '', IsShow: 0, IsUse: 2 },
 	{ Id: 203, Code: '', IsShow: 1, IsUse: 0 },
 	{ Id: 204, Code: '', IsShow: 0, IsUse: 2 },
-	{ Id:205 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:206 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:207 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:208 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:209 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:210 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:211 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:212 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:213 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:214 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:215 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:216 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:217 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:218 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:219 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:220 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:221 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:222 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:223 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:224 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:225 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:226 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:227 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:228 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:229 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:230 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:231 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:232 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:233 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:234 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:235 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:236 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:237 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:238 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:239 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:240 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:241 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:242 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:243 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:244 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:245 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:246 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:247 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:248 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:249 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:250 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:251 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:252 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:253 , Code: '', IsShow: 0, IsUse: 3 },
-	{ Id:254 , Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 205, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 206, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 207, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 208, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 209, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 210, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 211, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 212, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 213, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 214, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 215, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 216, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 217, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 218, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 219, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 220, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 221, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 222, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 223, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 224, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 225, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 226, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 227, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 228, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 229, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 230, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 231, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 232, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 233, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 234, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 235, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 236, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 237, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 238, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 239, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 240, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 241, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 242, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 243, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 244, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 245, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 246, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 247, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 248, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 249, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 250, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 251, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 252, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 253, Code: '', IsShow: 0, IsUse: 3 },
+	{ Id: 254, Code: '', IsShow: 0, IsUse: 3 },
 	{ Id: 255, Code: '', IsShow: 0, IsUse: 3 },
 	{ Id: 256, Code: '', IsShow: 1, IsUse: 0 },
 	{ Id: 257, Code: '', IsShow: 1, IsUse: 0 },
@@ -1870,7 +1895,7 @@
 	{ Id: 510, Code: '', IsShow: 1, IsUse: 0 },
 ];
 //鍔犺浇杈撻�佺嚎鏁版嵁
-let cellsData=ref<any>([]);
+let cellsData = ref<any>([]);
 
 const tableParams = ref({
 	page: 1,
@@ -1885,36 +1910,23 @@
 	tableData.value = res.data.result;
 	tableParams.value.total = tableData.value.length;
 
-	//澶勭悊涓�妤艰緭閫佺嚎鏁版嵁
-	tableData.value.forEach((item) => {
-		const foundCell = cellsDataOne.find(cell => cell.Code === item.stationNum);
-		if (foundCell) {
-			foundCell.IsUse = 4; 
-		}
-	});
 	//鍔犺浇杈撻�佺嚎鏁版嵁
-	cellsData.value =cellsDataOne;
+	cellsData.value = cellsDataOne;
 
-	//澶勭悊浜屾ゼ杈撻�佺嚎鏁版嵁
-	tableData.value.forEach((item) => {
-		const foundCell = cellsDataTwo.find(cell => cell.Code === item.stationNum);
-		if (foundCell) {
-			foundCell.IsUse = 4; 
-		}
-	});
-
-	//澶勭悊涓夋ゼ杈撻�佺嚎鏁版嵁
-	tableData.value.forEach((item) => {
-		const foundCell = cellsDataThree.find(cell => cell.Code === item.stationNum);
-		if (foundCell) {
-			foundCell.IsUse = 4; 
-		}
-	});
+	// 鏇存柊杈撻�佺嚎鏁版嵁
+	updateCells(cellsDataOne);
+	updateCells(cellsDataTwo);
+	updateCells(cellsDataThree);
 
 	console.log(tableParams.value.total);
 	loading.value = false;
 };
-
+// 鏇存柊杈撻�佺嚎鏁版嵁鐨勯�氱敤鍑芥暟
+function updateCells(cellsData: any[]) {
+	tableData.value.forEach((item) => {
+		updateCellData(cellsData, item);
+	});
+}
 handleQuery();
 
 //澶嶄綅鎶ヨ
@@ -2062,8 +2074,9 @@
 	/* 姣忚楂樺害 */
 	gap: 0px;
 	/* Gap between cells */
-	
-	margin-top: -20px;;
+
+	margin-top: -20px;
+	;
 }
 
 .grid-item {
@@ -2097,13 +2110,16 @@
 .active2>div {
 	display: none;
 }
+
 .active3 {
 	background-color: #fff;
-	border:1px solid red;
+	border: 1px solid red;
 }
+
 .active3>div {
 	display: none;
 }
+
 .active4 {
 	background-color: red;
 }
diff --git a/Web/src/views/device/deviceMonitor/index.vue b/Web/src/views/device/deviceMonitor/index.vue
index 6f2883e..66a81a1 100644
--- a/Web/src/views/device/deviceMonitor/index.vue
+++ b/Web/src/views/device/deviceMonitor/index.vue
@@ -4,43 +4,49 @@
             <el-card class="box-card">
                 <div slot="header" class="linefix">
                     <span>杈撻�佺嚎</span>
-                    <div class="lineStatus"></div>
+                    <div
+                        :class="['lineStatus', { 'device-status-0': stationValue.status === true }, { 'device-status-1': stationValue.status === false }]">
+                    </div>
                 </div>
                 <div class="choosefix">
-                    <el-select v-model="lineValue" placeholder="璇烽�夋嫨">
+                    <el-select v-model="lineValue" placeholder="璇烽�夋嫨" @change="handleLineChange('item', $event)">
                         <el-option v-for="item in lineOptions" :key="item.value" :label="item.label"
                             :value="item.value"></el-option>
                     </el-select>
-                    <el-select v-model="stationValue" placeholder="璇烽�夋嫨" style="margin-top: 10px;">
-                        <el-option v-for="item in stations" :key="item.id" :label="item.stationNum"
-                            :value="item.id"></el-option>
+                    <el-select v-model="stationValue" placeholder="璇烽�夋嫨" style="margin-top: 10px;"
+                        value-key="stationNum">
+                        <el-option v-for="item in listStationsData" :key="item.id" :label="item.stationNum"
+                            :value="item">
+                        </el-option>
                     </el-select>
                 </div>
                 <div class="lineValuefix">
                     <el-form label-position="left" label-width="80px">
                         <el-form-item label="浠诲姟鍙�">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.taskNo"></el-input>
                         </el-form-item>
                         <el-form-item label="浠诲姟绫诲瀷">
-                            <el-input></el-input>
+                            <el-select clearable v-model="stationValue.taskType" placeholder="璇烽�夋嫨浠诲姟绫诲瀷">
+								<el-option v-for="(item,index) in dl('TaskTypeEnum')" :key="index" :value="Number(item.value)" :label="`${item.name} [${item.value}]`"></el-option>
+							</el-select>
                         </el-form-item>
                         <el-form-item label="璧峰宸ヤ綅">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.startLocatNo"></el-input>
                         </el-form-item>
                         <el-form-item label="鐩殑宸ヤ綅">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.endLocatNo"></el-input>
                         </el-form-item>
                         <el-form-item label="鎵樼洏鐮�">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.palletNo"></el-input>
                         </el-form-item>
                         <el-form-item label="PLC">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.plc"></el-input>
                         </el-form-item>
                         <el-form-item label="WCS">
-                            <el-input></el-input>
+                            <el-input v-model="stationValue.wcs"></el-input>
                         </el-form-item>
                         <el-form-item label="鐘舵��">
-                            <el-input></el-input>
+                            <el-input :value="stationValue.status ? '鍦ㄧ嚎' : '绂荤嚎'" readonly></el-input>
                         </el-form-item>
                     </el-form>
                 </div>
@@ -71,8 +77,15 @@
                             <el-form-item label="浠诲姟绫诲瀷">
                                 <el-select clearable="" v-model="deviceInfo.taskType" placeholder="璇烽�夋嫨鐘舵��">
                                     <el-option v-for="(item, index) in dl('TaskTypeEnum')" :key="index"
-                                        :value="Number(item.value)" :label="`${item.name} (${item.code}) [${item.value}] `" />
+                                        :value="Number(item.value)"
+                                        :label="`${item.name} [${item.value}] `" />
                                 </el-select>
+                            </el-form-item>
+                            <el-form-item label="璧峰宸ヤ綅">
+                                <el-input v-model="deviceInfo.startLocatNo"></el-input>
+                            </el-form-item>
+                            <el-form-item label="鐩殑宸ヤ綅">
+                                <el-input v-model="deviceInfo.endLocatNo"></el-input>
                             </el-form-item>
                             <el-form-item label="PLC">
                                 <el-input v-model="deviceInfo.plc"></el-input>
@@ -106,10 +119,19 @@
 import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
 
 const stations = ref<any>([]);
+const listStationsData = ref<any>([]);
 const listStackingMachineData = ref<any>([]);
 
-const lineValue = ref('1');
-const stationValue = ref();
+const lineValue = ref(1);
+const stationValue = ref<any>({
+    taskNo: '',
+    taskType: '',
+    startLocatNo:'',
+    endLocatNo: '',
+    plc: '',
+    wcs: '',
+    status: false
+});
 
 // 鏌ヨ鎿嶄綔
 const handleQuery = async () => {
@@ -117,47 +139,29 @@
     listStackingMachineData.value = res.data.result.filter(s => s.type == 0);
     const listConveyorLineData = res.data.result.filter(s => s.type == 1 || s.type == 4);
     stations.value = {
-        '1': listConveyorLineData.filter(s => s.text = '1灞傛墭鐩樿緭閫佺嚎'),
-        '2': listConveyorLineData.filter(s => s.text = '2灞傛墭鐩樿緭閫佺嚎'),
-        '3': listConveyorLineData.filter(s => s.text = '3灞傛墭鐩樿緭閫佺嚎')
+        1: listConveyorLineData.filter(s => s.text == '1灞傛墭鐩樿緭閫佺嚎'),
+        2: listConveyorLineData.filter(s => s.text == '2灞傛墭鐩樿緭閫佺嚎'),
+        3: listConveyorLineData.filter(s => s.text == '3灞傛墭鐩樿緭閫佺嚎')
     }
-    if (stations.value.length > 0)
-        stationValue.value = stations.value[0][0].id;
-    debugger;
+    if (stations.value[1].length > 0) {
+        listStationsData.value = stations.value[1];
+        stationValue.value = listStationsData.value[0];
+    }
 };
 handleQuery();
 
+const handleLineChange = (field: string, value: number) => {
+    listStationsData.value = stations.value[value];
+    stationValue.value = {};
+};
+
 
 const lineOptions = [
-    { value: '1', label: '涓�妤艰緭閫佺嚎' },
-    { value: '2', label: '浜屾ゼ杈撻�佺嚎' },
-    { value: '3', label: '涓夋ゼ杈撻�佺嚎' }
+    { value: 1, label: '涓�妤艰緭閫佺嚎' },
+    { value: 2, label: '浜屾ゼ杈撻�佺嚎' },
+    { value: 3, label: '涓夋ゼ杈撻�佺嚎' }
 ];
 
-const deviceList = reactive([
-    { id: 1, name: '1鍙风爜鍨涙満鍣ㄤ汉', taskNumber: 'T000001', taskType: '', plc: '', wcs: '', status: 0 },
-    { id: 2, name: '2鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 1 },
-    { id: 3, name: '3鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
-    { id: 4, name: '4鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 1 },
-    { id: 5, name: '5鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
-    { id: 6, name: '6鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
-    { id: 7, name: '7鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: '' },
-    { id: 8, name: '8鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 }
-]);
-
-const deviceTypeText = (taskType: number) => {
-    switch (taskType) {
-        case 0:
-            return '鍏ュ簱浠诲姟'
-        case 1:
-            return '鍑哄簱浠诲姟'
-        case 2:
-            return '绉诲簱浠诲姟'
-        case 3:
-            return 'PLC鐢宠鍏ュ簱'
-    }
-    return ''
-};
 </script>
 
 <style scoped>
@@ -165,8 +169,8 @@
     font-size: 14px;
 }
 
-.item {
-    margin-bottom: 18px;
+.el-form-item--small {
+    margin-bottom: 10px;
 }
 
 .linefix {
diff --git a/Web/src/views/wcs/wcsAlarmInfo/index.vue b/Web/src/views/wcs/wcsAlarmInfo/index.vue
index 0eac6fd..f01cb0e 100644
--- a/Web/src/views/wcs/wcsAlarmInfo/index.vue
+++ b/Web/src/views/wcs/wcsAlarmInfo/index.vue
@@ -59,7 +59,7 @@
         <el-table-column prop="alarmCode" label="鎶ヨ缂栧彿" show-overflow-tooltip="" />
         <el-table-column prop="alarmName" label="鎶ヨ鎻忚堪" show-overflow-tooltip="" />
         <el-table-column prop="ledIP" label="鏄剧ず灞廼p鍦板潃" show-overflow-tooltip="" />
-        <el-table-column prop="status" label="鐘舵��" show-overflow-tooltip="">
+        <el-table-column prop="status" label="鏄惁鎶ヨ" show-overflow-tooltip="">
           <template #default="scope">
             <el-tag :type="dv('YesNoEnum', scope.row.status)?.tagType"> {{ dv('YesNoEnum',
               scope.row.status)?.name}}</el-tag>
diff --git a/Web/src/views/wcs/wcsTask/component/editDialog.vue b/Web/src/views/wcs/wcsTask/component/editDialog.vue
index ff70f63..12cb215 100644
--- a/Web/src/views/wcs/wcsTask/component/editDialog.vue
+++ b/Web/src/views/wcs/wcsTask/component/editDialog.vue
@@ -30,13 +30,6 @@
 						
 					</el-col>
 					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鏉ユ簮" prop="origin">
-							<el-input v-model="ruleForm.origin" placeholder="璇疯緭鍏ユ潵婧�" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
 						<el-form-item label="璧峰浣嶇疆" prop="startLocate">
 							<el-input v-model="ruleForm.startLocate" placeholder="璇疯緭鍏ヨ捣濮嬩綅缃�" maxlength="20" show-word-limit clearable />
 							
@@ -67,55 +60,6 @@
 					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
 						<el-form-item label="鎵樼洏鍙�" prop="palletNo">
 							<el-input v-model="ruleForm.palletNo" placeholder="璇疯緭鍏ユ墭鐩樺彿" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鎵规鍙�" prop="lotNo">
-							<el-input v-model="ruleForm.lotNo" placeholder="璇疯緭鍏ユ壒娆″彿" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="渚涜揣鎵规" prop="supplierLot">
-							<el-input v-model="ruleForm.supplierLot" placeholder="璇疯緭鍏ヤ緵璐ф壒娆�" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鐗╂枡缂栫爜" prop="skuNo">
-							<el-input v-model="ruleForm.skuNo" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鐗╂枡鍚嶇О" prop="skuName">
-							<el-input v-model="ruleForm.skuName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" maxlength="20" show-word-limit clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鏁伴噺" prop="qty">
-							<el-input-number v-model="ruleForm.qty" placeholder="璇疯緭鍏ユ暟閲�" clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鎷嗗灈鏁伴噺" prop="completeQty">
-							<el-input-number v-model="ruleForm.completeQty" placeholder="璇疯緭鍏ユ媶鍨涙暟閲�" clearable />
-							
-						</el-form-item>
-						
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="鎷h揣鏂瑰紡" prop="unstackingMode">
-							<el-input v-model="ruleForm.unstackingMode" placeholder="璇疯緭鍏ユ嫞璐ф柟寮�" maxlength="10" show-word-limit clearable />
 							
 						</el-form-item>
 						

--
Gitblit v1.8.0