From 88f69448fd3fb65d437c0b258ea93a3055017abd Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 27 二月 2025 13:39:26 +0800
Subject: [PATCH] 退货申请

---
 DevApp/Gs.DevApp/DevFrm/Sales/Frm_SalesDeliver.cs |  199 +++++++++++++++++++------------------------------
 1 files changed, 78 insertions(+), 121 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Sales/Frm_SalesDeliver.cs b/DevApp/Gs.DevApp/DevFrm/Sales/Frm_SalesDeliver.cs
index 6576f6b..d787e41 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sales/Frm_SalesDeliver.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sales/Frm_SalesDeliver.cs
@@ -1,7 +1,4 @@
-using DevExpress.RichEdit.Export;
 using DevExpress.XtraEditors;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -10,7 +7,6 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Drawing;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -18,7 +14,7 @@
 {
     public partial class Frm_SalesDeliver : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "MesInvItemMovesManager/";
+        string _webServiceName = "SalesDeliverManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
         public Frm_SalesDeliver()
         {
@@ -48,52 +44,38 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //璁剧疆鍙戣揣缁勭粐
-            this.txt_fStockOrgId.EditChanged += (s, e) =>
+            //璁剧疆閿�鍞崟
+            txt_salesId.getSuppler("", "");
+            this.txt_salesId.EditChanged += (s, e) =>
             {
-                string _sqGuid = txt_fStockOrgId.GetId();
+                //鏈夋病鏈夊彂璐х粍缁�
+                string _fhOrg = txt_fStockOrgId.GetId();//鐩墠杩囨护渚涘簲缁勭粐
+                if (string.IsNullOrEmpty(_fhOrg))
+                    return;
+                //鏈夋病鏈夐攢鍞鍗�
+                string _sqGuid = txt_salesId.GetId();
                 if (string.IsNullOrEmpty(_sqGuid))
                     return;
+                txt_fSalesManID.Text = txt_salesId.GetSalesUserName();
+                txt_fCustomerID.Text = txt_salesId.GetSalesCusName();
+                txt_fSaleOrgId.Text = txt_salesId.GetSalesOrgName();
                 System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
-                sbWhere.Append(" and a.FSubsidiary ='" + _sqGuid + "'");
-                var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
+                var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), _fhOrg);
                 var json = JsonConvert.SerializeObject(_obj);
                 try
                 {
                     var strReturn = UtilityHelper.HttpPost("",
-                        "MesItemsManager/GetListSelect", json);
+                        "SalesManager/SelectFormMx", json);
                     var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                     var dt = rtn.rtnData.list;
-                    //this.repositoryItemSearchLookUpEdit1.DataSource = dt;
+                    this.repositoryItemSearchLookUpEdit1.DataSource = dt;
                 }
                 catch (Exception ex)
                 {
                     MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
                 }
             };
-            //璁剧疆閿�鍞粍缁�
-            this.txt_fSaleOrgId.EditChanged += (s, e) =>
-            {
-                string _sqGuid = txt_fStockOrgId.GetId();
-                if (string.IsNullOrEmpty(_sqGuid))
-                    return;
-                System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
-                sbWhere.Append(" and a.FSubsidiary ='" + _sqGuid + "'");
-                var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
-                var json = JsonConvert.SerializeObject(_obj);
-                try
-                {
-                    var strReturn = UtilityHelper.HttpPost("",
-                        "MesItemsManager/GetListSelect", json);
-                    var rtn = UtilityHelper.ReturnToTablePage(strReturn);
-                    var dt = rtn.rtnData.list;
-                    //this.repositoryItemSearchLookUpEdit1.DataSource = dt;
-                }
-                catch (Exception ex)
-                {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-                }
-            };
+
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -154,7 +136,7 @@
         {
             string rowGuid = "", rowName = "";
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1, "fBillNo");
+                lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -262,56 +244,37 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            //string djlx = txt_fBillTypeID.Text.ToString();
-            //string ywlx = txt_fBusinessType.Text.ToString();
-            //string dbfx = txt_fTransferDirect.Text.ToString();
-            //string sqOrg = txt_fapporgid.GetId();
-            //string dblx = txt_ftranstype.Text.ToString();
-            //string dchzlx = txt_fOwnerTypeIdHead.Text.ToString();
-            //string drhzlx = txt_fOwnerTypeInIdHead.Text.ToString();
-            //if (txt_fBillTypeID.SelectedIndex <= 0)
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
-            //    txt_fBillTypeID.Focus();
-            //    return;
-            //}
-            //if (txt_fTransferDirect.SelectedIndex <= 0)
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冩嫧鏂瑰悜锛�");
-            //    txt_fTransferDirect.Focus();
-            //    return;
-            //}
-            //if (string.IsNullOrEmpty(sqOrg))
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鐢宠缁勭粐锛�");
-            //    txt_fapporgid.Focus();
-            //    return;
-            //}
-            //if (txt_fOwnerTypeIdHead.SelectedIndex <= 0)
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨嚭璐т富绫诲瀷锛�");
-            //    txt_fOwnerTypeIdHead.Focus();
-            //    return;
-            //}
-            //if (txt_fOwnerTypeInIdHead.SelectedIndex <= 0)
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨叆璐т富绫诲瀷锛�");
-            //    txt_fOwnerTypeInIdHead.Focus();
-            //    return;
-            //}
-            //var _obj = new
-            //{
-            //    guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-            //    djlx = djlx,//鍗曟嵁绫诲瀷
-            //    ywlx = ywlx,//涓氬姟绫诲瀷
-            //    dbfx = dbfx,//璋冩嫧鏂瑰悜
-            //    sqOrg = sqOrg,//瀹¤缁勭粐
-            //    dblx = dblx,//璋冩嫧绫诲瀷
-            //    dchzlx = dchzlx,//璋冨嚭璐т富绫诲瀷
-            //    drhzlx = drhzlx,//璋冨叆璐т富绫诲瀷
-            //    inRemark = txt_fRemarks.Text.Trim(),//澶囨敞
-            //    list = new List<dynamic>(),
-            //};
+            string djlx = txt_fBillTypeID.Text.ToString();
+            string FNote = txt_fNote.Text.ToString();
+            string _sqGuid = txt_salesId.GetId();
+            string _fhOrg = txt_fStockOrgId.GetId();
+            if (string.IsNullOrEmpty(_fhOrg))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍙戣揣缁勭粐锛�");
+                txt_fStockOrgId.Focus();
+                return;
+            }
+            if (txt_fBillTypeID.SelectedIndex < 0)
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
+                txt_fBillTypeID.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(_sqGuid))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鐢宠缁勭粐锛�");
+                txt_salesId.Focus();
+                return;
+            }
+            var _obj = new
+            {
+                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                djlx = djlx,//鍗曟嵁绫诲瀷
+                salesId = _sqGuid,//閿�鍞崟鍙�
+                inRemark = FNote.Trim(),//澶囨敞
+                fhOrg = _fhOrg,
+                list = new List<dynamic>(),
+            };
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
@@ -325,42 +288,36 @@
                 if (row != null)
                 {
                     Guid? _guid = UtilityHelper.ToGuid(row["id"].ToString());
-                    string _msl = row["shNum"].ToString();
+                    string _msl = row["fMustQty"].ToString();
                     if (string.IsNullOrEmpty(_msl))
                     {
                         MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
                         return;
                     }
-                    //_obj.list.Add(new
-                    //{
-                    //    Guid = _guid,
-                    //    ItemId = (row["itemId"].ToString()),
-                    //    Sqsl = (row["shNum"].ToString()),
-                    //    Bz = (row["remark"].ToString()),
-                    //    dczz = (row["dcOrgGuid"].ToString()),
-                    //    dcck = (row["dcCkGuid"].ToString()),
-                    //    drzz = (row["drOrgGuid"].ToString()),
-                    //    drck = (row["drCkGuid"].ToString()),
-                    //    dchz = (row["dcHzGuid"].ToString()),
-                    //    drhz = (row["drHzGuid"].ToString()),
-                    //});
+                    _obj.list.Add(new
+                    {
+                        Guid = _guid,
+                        SalesDetailId = (row["salesDetailId"].ToString()),
+                        Sqsl = (row["fMustQty"].ToString()),
+                        Bz = (row["fEntrynote"].ToString()),
+                    });
                 }
             }
             try
             {
-                //string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
-                //ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-                //ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-                //if (_rtn.rtnCode > 0)
-                //{
-                //    lbGuid.Text = _rtn.rtnData.outGuid;
-                //    txt_billNo.Text = _rtn.rtnData.outNo;
-                //    toolBarMenu1.isSetBtn = true;
-                //    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-                //    gvList.Add(gvMx1);
-                //    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
-                //    toolBarMenu1.currentAction = "";
-                //}
+                string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
+                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                if (_rtn.rtnCode > 0)
+                {
+                    lbGuid.Text = _rtn.rtnData.outGuid;
+                    txt_billNo.Text = _rtn.rtnData.outNo;
+                    toolBarMenu1.isSetBtn = true;
+                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                    gvList.Add(gvMx1);
+                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
+                    toolBarMenu1.currentAction = "";
+                }
             }
             catch (Exception ex)
             {
@@ -516,7 +473,7 @@
             };
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "fBillNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -544,7 +501,7 @@
                     }
                     int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    UtilityHelper.SetCheckIco(gridView1, "chkStatus", "FAPPROVEBY", "FAPPROVEDATE", picCheckBox, this, _inFieldValue.ToString());
+                    UtilityHelper.SetCheckIco(gridView1, "chkStatus", "fApproverID", "fApproveDate", picCheckBox, this, _inFieldValue.ToString());
                 }
             }
             catch (Exception ex)
@@ -557,11 +514,12 @@
         {
             SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
             DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
-            gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"].ToString());
-            gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"].ToString());
-            gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"].ToString());
-            gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"].ToString());
-            gvMx1.SetFocusedRowCellValue("itemUnit", SelectedDataRow["dwName"].ToString());
+            //gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"].ToString());
+            //gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"].ToString());
+            //gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"].ToString());
+            //gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"].ToString());
+            //gvMx1.SetFocusedRowCellValue("itemUnit", SelectedDataRow["dwName"].ToString());
+            gvMx1.SetFocusedRowCellValue("salesDetailId", SelectedDataRow["id"].ToString());
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
         }
@@ -605,6 +563,5 @@
                 }
             }
         }
-       
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3