From 98267f9dfb90aa98eb55e7abeabc52d3f8a5b694 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期三, 27 八月 2025 15:25:10 +0800 Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient --- DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs | 99 ++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 89 insertions(+), 10 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs index 1e71466..97211ad 100644 --- a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs +++ b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs @@ -28,6 +28,7 @@ public Frm_MESJJERRORJS() { InitializeComponent(); + gridView2.CellValueChanged += gridView2_CellValueChanged; this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; @@ -38,7 +39,9 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; + btnFZ.Click += btnFZ_Click; this.toolBarMenu1.getXmlConfig(); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView2); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); @@ -52,11 +55,13 @@ }, lbGuid); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; + txt_DAA001.EditValueChanged += txt_DAA001_EditValueChanged; //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏 btnSelect.Click += (s, e) => { - var frm = new SelectSTAFF(); + var orgId = txt_OrgId.GetId(); + var frm = new SelectSTAFF(orgId); //璧嬪�肩粰鏄庣粏琛� frm.UpdateParent += (ss, ee) => { @@ -79,7 +84,11 @@ } DataTable _newTable = JsonConvert.DeserializeObject<DataTable>(array.ToString()); - DataTable _oldTable = _newTable.Clone(); + DataTable _oldTable = gridControl1.DataSource as DataTable; + if (_oldTable == null) + { + _oldTable = _newTable.Clone(); + } DataRow[] sourceRows = _newTable.Select(); for (int i = 0; i < sourceRows.Length; i++) { @@ -285,7 +294,7 @@ private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { string rowGuid = "", rowName = ""; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "errorNo"); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_ErrorNo, gridView1, "errorNo"); if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -361,6 +370,7 @@ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMain1, gridView1); Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gridControl1, gridView2); txt_ErrorType.EditValue = "璁℃椂宸ユ椂"; + string deftOrg = UtilityHelper.GetFirstOrg(txt_OrgId); GetTimeType(); GetWOMDAAInfo(); } @@ -379,6 +389,7 @@ getModel(rowGuid); GetTimeType(); GetWOMDAAInfo(); + txt_OrgId.IsReadly = true; } /// <summary> @@ -413,6 +424,7 @@ remark = txt_Remark.Text.Trim(),//璇存槑 DAA001 = txt_DAA001.Text.Trim(),//宸ュ崟鍙� DAAType = txt_DAAType.Text.Trim(),//宸ュ崟绫诲瀷 + OrgId = txt_OrgId.GetId().Trim(),//宸ュ崟绫诲瀷 list = new List<dynamic>(), }; gridView2.CloseEditor(); @@ -428,7 +440,6 @@ var row = gridView2.GetDataRow(i); if (row != null) { - Guid? _guid = UtilityHelper.ToGuid(row["id"].ToString()); if (string.IsNullOrEmpty(row["staffId"].ToString())) { MsgHelper.ShowError("鍛樺伐涓嶈兘涓虹┖锛�"); @@ -452,8 +463,8 @@ _obj.list.Add(new { - Guid = _guid, - ID = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["id"].ToString()), + Guid = "", + ID = "", Staff_Id = row["staffId"].ToString(), Staff_No = row["staffNo"].ToString(), Staff_Name = row["staffName"].ToString(), @@ -498,8 +509,12 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); - var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "", "", "", _sbSqlWhere.ToString()); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.OrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); + var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "desc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); try { @@ -618,7 +633,7 @@ ; toolBarMenu1.guidKey = ""; string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "errorNo"); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_ErrorNo, gridView1, "errorNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -665,8 +680,20 @@ { txt_HourlyType.EditValue = SelectedDataRow["璁℃椂绫诲瀷"].ToString(); txt_HourlySalary.EditValue = SelectedDataRow["璁℃椂鍗曚环"]; + + var hourlySalary = decimal.Parse(txt_HourlySalary.EditValue.ToString()); + for (int i = 0; i < gridView2.DataRowCount; i++) + { + DataRow row = gridView2.GetDataRow(i); + decimal hour = 0; + decimal.TryParse(row["hour"]?.ToString(), out hour); + if (row != null) + { + row["salary"] = hourlySalary * hour; + } + } + gridView2.RefreshData(); } - } private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e) @@ -713,5 +740,57 @@ } } } + + private void btnFZ_Click(object sender, EventArgs e) + { + // 鑾峰彇褰撳墠閫変腑琛岀殑琛屽彿 + int focusedRowHandle = gridView2.FocusedRowHandle; + if (focusedRowHandle < 0) return; + + // 鑾峰彇褰撳墠琛岀殑鏃堕暱 + DataRow currentRow = gridView2.GetDataRow(focusedRowHandle); + if (currentRow == null) return; + + var hourValue = currentRow["hour"]; + if (hourValue == null) return; + + decimal hourlySalary = 0; + decimal hour = 0; + decimal.TryParse(txt_HourlySalary.Text, out hourlySalary); + // 鑾峰彇鏃堕暱 + decimal.TryParse(currentRow["hour"]?.ToString(), out hour); + + // 鎵归噺璁剧疆涓嬮潰鎵�鏈夎鐨勬椂闀� + for (int i = focusedRowHandle + 1; i < gridView2.DataRowCount; i++) + { + var row = gridView2.GetDataRow(i); + if (row != null) + { + row["hour"] = hourValue; + // 璁$畻璁℃椂宸ヨ祫 + row["salary"] = hourlySalary * hour; + } + } + gridView2.RefreshData(); + } + + /// <summary> + /// 宸ュ崟涓嬫媺妗嗛�夋嫨浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void txt_DAA001_EditValueChanged(object sender, EventArgs e) + { + SearchLookUpEdit lookupEdit = sender as SearchLookUpEdit; + DataRowView selectedDataRow = (DataRowView)lookupEdit.GetSelectedDataRow(); + if (selectedDataRow != null) + { + txt_DAAType.Text = selectedDataRow["宸ュ崟绫诲瀷"].ToString(); + } + else + { + txt_DAAType.Text = ""; + } + } } } \ No newline at end of file -- Gitblit v1.9.3