cdk
2025-08-17 bfd078c1d269d6fb837d9c0af9cffdb8481c39c7
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;
@@ -39,8 +40,8 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            btnFZ.Click += btnFZ_Click;
            gridView2.CustomUnboundColumnData += gridView2_CustomUnboundColumnData;
            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);
@@ -54,6 +55,7 @@
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            txt_DAA001.EditValueChanged += txt_DAA001_EditValueChanged;
            //选择需要入库的明细
            btnSelect.Click += (s, e) =>
@@ -291,7 +293,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("请先选择你要操作的行!");
@@ -434,7 +436,6 @@
                var row = gridView2.GetDataRow(i);
                if (row != null)
                {
                    Guid? _guid = UtilityHelper.ToGuid(row["id"].ToString());
                    if (string.IsNullOrEmpty(row["staffId"].ToString()))
                    {
                        MsgHelper.ShowError("员工不能为空!");
@@ -458,8 +459,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(),
@@ -624,7 +625,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("请先选择你要操作的行!");
@@ -671,8 +672,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)
@@ -720,14 +733,6 @@
            }
        }
        private void gridView2_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
        {
            if (e.Column.FieldName == "rowNo" && e.IsGetData)
            {
                e.Value = e.ListSourceRowIndex + 1;
            }
        }
        private void btnFZ_Click(object sender, EventArgs e)
        {
            // 获取当前选中行的行号
@@ -760,5 +765,24 @@
            }
            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 = "";
            }
        }
    }
}