From bf55ffb1b04c3b0589f49e524a9c1e163595b5e4 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期一, 25 十一月 2024 14:15:07 +0800 Subject: [PATCH] bug --- DevApp/Gs.DevApp/UserControl/UcLookItems.cs | 41 ++++++++++++++++++++++++++++++++--------- 1 files changed, 32 insertions(+), 9 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs index 8b66746..8cac2ee 100644 --- a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs +++ b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs @@ -19,11 +19,12 @@ public UcLookItems() { InitializeComponent(); + lookSearchSupplier.Properties.NullText = "璇烽�夋嫨"; lookSearchSupplier.EditValueChanged += LookSearchSupplier_EditValueChanged; } - + public bool IsReadly { get; set; } private string _KeyFile = ""; public string KeyFile { @@ -31,7 +32,8 @@ set { _KeyFile = value; - getSuppler(); + if (!string.IsNullOrEmpty(_KeyFile)) + getSuppler(); } } /// <summary> @@ -45,15 +47,20 @@ if (EditChanged != null) EditChanged(this, e); } - private void getSuppler() + private async void getSuppler() { - var pgq = new PageQueryModel(1, 999999, "item_name", "asc", "", - " and fforbidstatus='A'"); - var json = JsonConvert.SerializeObject(pgq); + var _obj = new + { + currentPage = 1, + everyPageSize = 999999, + sortName = "", + keyWhere = "", + }; + var json = JsonConvert.SerializeObject(_obj); try { - var strReturn = UtilityHelper.HttpPost("", - "MesItemsManager/GetListPage", json); + var strReturn = UtilityHelper.HttpPost("", + "MesItemsManager/GetListSelect", json); var rtn = UtilityHelper.ReturnToTablePage(strReturn); var dt = rtn.rtnData.list; lookSearchSupplier.Properties.DataSource = dt; @@ -92,11 +99,27 @@ var name = lookSearchSupplier.Text.Trim(); return name; } + public string GetModel() + { + var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView; + if (row != null) { + string id = row["itemModel"].ToString(); + return id; + } + return ""; + } public void SetIdOrCode(string Code) { + if (Code == "-1") + { + lookSearchSupplier.EditValue = null; + return; + } if (KeyFile == "id") - lookSearchSupplier.EditValue = Int64.Parse((Code.ToString().Trim())); + { + lookSearchSupplier.EditValue =((Code.ToString().Trim())); + } else lookSearchSupplier.EditValue = ((Code.ToString().Trim())); } -- Gitblit v1.9.3