From fdebc0e6cb9c3ef1dbf33933cdc77e5b90032b5a Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 29 十月 2024 16:51:52 +0800 Subject: [PATCH] 整体细微优化 --- DevApp/Gs.DevApp/UserControl/UcLookItems.cs | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs index 8b66746..8bc9d49 100644 --- a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs +++ b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs @@ -19,6 +19,7 @@ public UcLookItems() { InitializeComponent(); + lookSearchSupplier.Properties.NullText = "璇烽�夋嫨"; lookSearchSupplier.EditValueChanged += LookSearchSupplier_EditValueChanged; @@ -31,7 +32,8 @@ set { _KeyFile = value; - getSuppler(); + if (!string.IsNullOrEmpty(_KeyFile)) + getSuppler(); } } /// <summary> @@ -45,17 +47,18 @@ if (EditChanged != null) EditChanged(this, e); } - private void getSuppler() + private async void getSuppler() { + UcLoading _loading = new UcLoading(); var pgq = new PageQueryModel(1, 999999, "item_name", "asc", "", " and fforbidstatus='A'"); var json = JsonConvert.SerializeObject(pgq); try { - var strReturn = UtilityHelper.HttpPost("", - "MesItemsManager/GetListPage", json); - var rtn = UtilityHelper.ReturnToTablePage(strReturn); - var dt = rtn.rtnData.list; + var strReturn = await UtilityHelper.HttpPostAsync("", + "MesItemsManager/GetListPageByLook", json); + var rtn = UtilityHelper.ReturnToList(strReturn); + var dt = rtn.rtnData; lookSearchSupplier.Properties.DataSource = dt; lookSearchSupplier.Properties.DisplayMember = "itemName"; // lookSearchSupplier.Properties.ValueMember = "depotId"; @@ -65,6 +68,7 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } + _loading.Close(); } public string GetId() @@ -92,9 +96,20 @@ var name = lookSearchSupplier.Text.Trim(); return name; } + public string GetModel() + { + var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView; + string id = row["itemModel"].ToString(); + return id; + } public void SetIdOrCode(string Code) { + if (Code == "-1") + { + lookSearchSupplier.EditValue = null; + return; + } if (KeyFile == "id") lookSearchSupplier.EditValue = Int64.Parse((Code.ToString().Trim())); else -- Gitblit v1.9.3