From 95e1ab772866afcd2219c1075c621b893a94b596 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 07 四月 2025 15:18:41 +0800
Subject: [PATCH] 卡板

---
 DevApp/Gs.DevApp/DevFrm/BarCode/Frm_BoxCode.cs |  136 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 105 insertions(+), 31 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/BarCode/Frm_BoxCode.cs b/DevApp/Gs.DevApp/DevFrm/BarCode/Frm_BoxCode.cs
index 7b03fbf..aa3aa73 100644
--- a/DevApp/Gs.DevApp/DevFrm/BarCode/Frm_BoxCode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/BarCode/Frm_BoxCode.cs
@@ -1,15 +1,10 @@
-锘縰sing DevExpress.XtraEditors;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 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;
 
@@ -17,7 +12,7 @@
 {
     public partial class Frm_BoxCode : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "MesWorkshopLineManager/";
+        string _webServiceName = "Box/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
         public Frm_BoxCode()
         {
@@ -43,12 +38,57 @@
             }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            this.txt_dptId.getSuppler("");
+            txt_itemId.Click += (s, e) =>
+            {
+                string _orgId = txt_orgId.GetId();
+                var frm = new SelectBoxItem(_orgId);
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    try
+                    {
+                        var lst = new List<dynamic>();
+                        lst = ee.DynamicList;
+                        txt_itemId.Text = lst[0].itemId;
+                        txt_itemModel.Text = lst[0].itemModel;
+                        txt_itemName.Text = lst[0].itemName;
+                        txt_itemNo.Text = lst[0].itemNo;
+                        txt_lotNo.Text = lst[0].gdbh;
+                    }
+                    catch (Exception ex)
+                    {
+                        MessageBox.Show(ex.Message);
+                    }
+                };
+                frm.ShowDialog();
+            };
+            txt_taskNo.Click += (s, e) =>
+            {
+                string _orgId = txt_orgId.GetId();
+                var frm = new SelectBoxDaa(_orgId);
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    try
+                    {
+                        var lst = new List<dynamic>();
+                        lst = ee.DynamicList;
+                        txt_itemId.Text = lst[0].itemId;
+                        txt_itemModel.Text = lst[0].itemModel;
+                        txt_itemName.Text = lst[0].itemName;
+                        txt_itemNo.Text = lst[0].itemNo;
+                        txt_lotNo.Text = lst[0].gdbh;
+                    }
+                    catch (Exception ex)
+                    {
+                        MessageBox.Show(ex.Message);
+                    }
+                };
+                frm.ShowDialog();
+            };
         }
         private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
-            Task.Delay(100);
+            await Task.Delay(100);
             getPageList(1);
         }
 
@@ -104,7 +144,7 @@
         private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_lineNo, gridView1, "lineNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_dwmc, gridView1, "lineNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -166,7 +206,7 @@
         {
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_name, gridView1);
+                lbGuid, txt_lotNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -201,39 +241,73 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            if (string.IsNullOrEmpty(txt_dptId.GetId().Trim()))
+            string _txt_orgId = txt_orgId.GetId();
+            string _txt_taskNo = txt_taskNo.Text.Trim();
+            string _txt_itemId = txt_itemId.Text.Trim();
+            string _txt_lotNo = txt_lotNo.Text.Trim();
+            string _txt_cusId = txt_cusId.GetId();
+            string _txt_cusDh = txt_cusDh.Text.Trim();
+            string _txt_saleDh = txt_saleDh.Text.Trim();
+            string _txt_memo = txt_memo.Text.Trim();
+            string _txt_extDate = txt_extDate.Text;
+            string _txt_quantity = txt_quantity.Text.Trim();
+            string _txt_psnQty_1 = txt_psnQty_1.Text.Trim();
+            string _txt_iCount_1 = txt_iCount_1.Text.Trim();
+            if (string.IsNullOrEmpty(_txt_orgId.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鎵�鍦ㄩ儴闂紒");
-                txt_dptId.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("缁勭粐涓嶈兘涓虹┖锛�");
+                txt_orgId.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(txt_lineNo.Text.Trim()))
+            if (txt_isSource.SelectedIndex == 0)
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜х嚎缂栧彿涓嶈兘涓虹┖锛�");
-                txt_lineNo.Focus();
+                if (_txt_taskNo.Trim().Length <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
+                    txt_taskNo.Focus();
+                    return;
+                }
+            }
+            if (string.IsNullOrEmpty(_txt_itemId.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("浜у搧ID涓嶈兘涓虹┖锛�");
+                txt_itemId.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(txt_name.Text.Trim()))
+            if (string.IsNullOrEmpty(_txt_quantity.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜х嚎鍚嶇О涓嶈兘涓虹┖锛�");
-                txt_name.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鐢熶骇鏁伴噺涓嶈兘涓虹┖锛�");
+                txt_quantity.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(txt_lineType.Text.Trim()))
+            if (string.IsNullOrEmpty(_txt_psnQty_1.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("浜х嚎绫诲埆涓嶈兘涓虹┖锛�");
-                txt_lineType.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鍐呭寘瑁呮暟閲忎笉鑳戒负绌猴紒");
+                txt_psnQty_1.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(_txt_iCount_1.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鎵撳嵃鏁伴噺涓嶈兘涓虹┖锛�");
+                txt_iCount_1.Focus();
                 return;
             }
             var _obj = new
             {
-                Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                DptId = txt_dptId.GetId(),
-                Name = txt_name.Text.Trim(),
-                LineNo = txt_lineNo.Text.Trim(),
-                Remark = txt_remark.Text.Trim(),
-                LineType = txt_lineType.Text.Trim(),
-                isZxbg = txt_isZxbg.Checked
+                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                orgId = _txt_orgId,
+                taskNo = _txt_taskNo,
+                itemId = _txt_itemId,
+                lotNo = _txt_lotNo,
+                cusId = _txt_cusId,
+                cusDh = _txt_cusDh,
+                saleDh = _txt_saleDh,
+                memo = _txt_memo,
+                extDate = _txt_extDate,
+                //
+                quantity = _txt_quantity,
+                psnQty_1 = _txt_psnQty_1,
+                iCount_1 = _txt_iCount_1,
             };
             try
             {
@@ -242,7 +316,7 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 if (_rtn.rtnCode > 0)
                 {
-                    lbGuid.Text = _rtn.rtnData;
+                    lbGuid.Text = _rtn.rtnData.outGuid;
                     toolBarMenu1.isSetBtn = true;
                     UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                     toolBarMenu1.currentAction = "";

--
Gitblit v1.9.3