From 72ff599e2cacd5c232df18bf75304b0fa0a2d65b Mon Sep 17 00:00:00 2001 From: kyy <3283105747@qq.com> Date: 星期一, 11 八月 2025 16:04:24 +0800 Subject: [PATCH] 1、采购合并提交按钮优化 :保存后按钮不可编辑、点击合并后已审核样式没有更新 --- DevApp/Gs.DevApp/UserControl/SelectCgMx.cs | 75 +++++++++++++++++++++++++++++-------- 1 files changed, 58 insertions(+), 17 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs index 72d4ae2..31aed7b 100644 --- a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs +++ b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs @@ -8,36 +8,58 @@ namespace Gs.DevApp.UserControl { + // 缁ф壙鑷猉traForm锛岃繖鏄疍evExpress鎻愪緵鐨勫寮哄瀷琛ㄥ崟鎺т欢 public partial class SelectCgMx : XtraForm { - + // Web鏈嶅姟鍚嶇О甯搁噺锛岀敤浜庤皟鐢ㄥ悗绔帴鍙� private readonly string _webServiceName = "MesInvItemArnManager/"; + // 渚涘簲鍟咺D鍜屾敹鏂欑粍缁嘔D鐨勭鏈夊彉閲� private string suppId = ""; private string receiveOrgId = ""; + /// <summary> - /// + /// 鏋勯�犲嚱鏁� /// </summary> - /// <param name="_suppId">渚涘簲鍟�</param> - /// <param name="_receiveOrgId">鏀舵枡缁勭粐</param> - /// <param name="_isWw">鏄惁濮斿</param> + /// <param name="_suppId">渚涘簲鍟咺D鍙傛暟</param> + /// <param name="_receiveOrgId">鏀舵枡缁勭粐ID鍙傛暟</param> public SelectCgMx(string _suppId, string _receiveOrgId) { + // 鍒濆鍖栬〃鍗曟帶浠� InitializeComponent(); + + // 涓篏ridView鐨勫垪鏍囬缁樺埗浜嬩欢娣诲姞澶勭悊鏂规硶锛屼娇鐢ㄨ嚜瀹氫箟缁樺埗 this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); }; + + // 涓篏ridView鐨勯紶鏍囨姮璧蜂簨浠舵坊鍔犲鐞嗘柟娉曪紝瀹炵幇鑷畾涔変氦浜� this.gridView1.MouseUp += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain, gridView1); }; + + // 閰嶇疆澶嶉�夊垪鐨勬帓搴忓拰绛涢�夐�夐」锛岀鐢ㄦ帓搴忓拰绛涢�夊姛鑳� this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; this.colChkInt.OptionsFilter.AllowAutoFilter = false; this.colChkInt.OptionsFilter.AllowFilter = false; this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False; + + // 璁剧疆鍗曢�夋寜閽粍榛樿閫変腑绗竴椤癸紙閲囪喘绫诲瀷锛� radioGroup1.SelectedIndex = 0; + + // 淇濆瓨浼犲叆鐨勪緵搴斿晢ID鍜屾敹鏂欑粍缁嘔D this.suppId = _suppId; this.receiveOrgId = _receiveOrgId; + + // 璁剧疆GridView鐨勫弬鏁伴厤缃� Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", null, null, false); + + // 鍔犺浇绗竴椤垫暟鎹� getPageList(1); + + // 涓�"纭畾"鎸夐挳娣诲姞鐐瑰嚮浜嬩欢澶勭悊 btnIn.Click += (s, e) => { + // 鎻愪氦缂栬緫骞舵洿鏂板綋鍓嶈鏁版嵁 gridView1.PostEditor(); gridView1.UpdateCurrentRow(); + + // 鏀堕泦閫変腑琛岀殑GUID var list = new List<string>(); DataTable dt = this.gcMain.DataSource as DataTable; { @@ -45,14 +67,20 @@ { string checkBox = dr["chkInt"].ToString(); string _guid = dr["guid"].ToString(); + // 妫�鏌ユ槸鍚﹂�変腑 if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox)) { list.Add(_guid); } } } - UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close(); + + // 瑙﹀彂鍥炶皟浜嬩欢锛屼紶閫掗�変腑鐨凣UID鍒楄〃锛岀劧鍚庡叧闂〃鍗� + UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); + Close(); }; + + // 涓哄崟閫夋寜閽粍娣诲姞閫変腑椤瑰彉鍖栦簨浠讹紝鍒囨崲鏃堕噸鏂板姞杞芥暟鎹� radioGroup1.SelectedIndexChanged += (s, e) => { getPageList(1); @@ -60,40 +88,53 @@ } /// <summary> - /// 閫夋嫨鍚庣殑鍥炶皟浜嬩欢 + /// 閫夋嫨鍚庣殑鍥炶皟浜嬩欢锛岀敤浜庡悜鐖剁獥浣撲紶閫掗�変腑鐨勬暟鎹� /// </summary> public event EventHandler<UpdateParentEventArgs> UpdateParent; /// <summary> + /// 浠庢湇鍔″櫒鑾峰彇鍒嗛〉鏁版嵁骞剁粦瀹氬埌GridView /// </summary> - /// <param name="curPage">绗嚑椤�</param> - /// <param name="pageSize">姣忛〉鍑犳潯</param> + /// <param name="curPage">褰撳墠椤电爜</param> private void getPageList(int curPage) { + // 鍒涘缓璇锋眰鍙傛暟瀵硅薄 var _obj = new { - currentPage = curPage, - everyPageSize = 999999, - sortName = "", - keyWhere = "", - inBusType = (radioGroup1.SelectedIndex + 1),//1鏄噰璐紝2鏄澶� - inSupId = this.suppId, - inReceiveOrgId = this.receiveOrgId, + currentPage = curPage, // 褰撳墠椤电爜 + everyPageSize = 999999, // 姣忛〉璁板綍鏁�(杩欓噷璁剧疆浜嗕竴涓緢澶х殑鍊硷紝鍙兘鏄负浜嗚幏鍙栨墍鏈夋暟鎹�) + sortName = "", // 鎺掑簭瀛楁 + keyWhere = "", // 鏌ヨ鏉′欢 + inBusType = (radioGroup1.SelectedIndex + 1), // 涓氬姟绫诲瀷锛�1鏄噰璐紝2鏄澶� + inSupId = this.suppId, // 渚涘簲鍟咺D + inReceiveOrgId = this.receiveOrgId, // 鏀舵枡缁勭粐ID }; + + // 灏嗗弬鏁板璞″簭鍒楀寲涓篔SON瀛楃涓� var json = JsonConvert.SerializeObject(_obj); + try { + // 璋冪敤Web鏈嶅姟鑾峰彇鏁版嵁 var strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectForm", json); + + // 瑙f瀽杩斿洖缁撴灉涓篋ataTable var dd = UtilityHelper.ReturnToTablePage(strReturn); var dt = dd.rtnData.list; + + // 缁戝畾鏁版嵁鍒癎ridControl gcMain.BindingContext = new BindingContext(); gcMain.DataSource = dt; gcMain.ForceInitialize(); - gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); + + // 鑷姩璋冩暣鍒楀骞跺簲鐢ㄧ綉鏍煎竷灞� + gridView1.BestFitColumns(); + Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); } catch (Exception ex) { + // 鏄剧ず閿欒淇℃伅 MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } -- Gitblit v1.9.3