cdk
2025-12-02 4b40e0d9657203dd45baa1e6358547f1080491cc
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
@@ -30,6 +30,8 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            toolBarMenu1.btnWjClick += ToolBarMenu1_btnWjClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) =>
@@ -51,6 +53,8 @@
                var orgId = txt_thOrgId.GetId();
                if (string.IsNullOrEmpty(orgId))
                    return;
                txt_fRequireOrgId.SetIdOrCode(orgId);
                txt_fOwnerIdHead.SetIdOrCode(orgId);
                txt_suppId.getSuppler(orgId, _ucGys);
                txt_fPurchaseDeptId.getSuppler(orgId, _ucBm);
            };
@@ -155,7 +159,45 @@
            {
                setSrm();
            };
            #region 2025-10-10 向下复制beg
            btnDown.Click += (s, e) =>
            {
                // 获取当前选中行的行号
                int focusedRowHandle = gvMx1.FocusedRowHandle;
                if (focusedRowHandle < 0) return;
                // 获取当前行的时长
                DataRow currentRow = gvMx1.GetDataRow(focusedRowHandle);
                if (currentRow == null) return;
                var hourValue = currentRow["depotId"];
                var hourValue2 = currentRow["depotName"];
                if (hourValue == null || string.IsNullOrEmpty(hourValue.ToString()))
                {
                    MsgHelper.ShowError("当前选中的行无仓库,复制失败!");
                    return;
                }
                if (hourValue2 == null)
                {
                    MsgHelper.ShowError("当前选中的行无仓库,复制失败!");
                    return;
                }
                // 批量设置下面所有行的时长
                for (int i = focusedRowHandle + 1; i < gvMx1.DataRowCount; i++)
                {
                    var row = gvMx1.GetDataRow(i);
                    if (row != null)
                    {
                        row["depotId"] = hourValue;
                        row["depotName"] = hourValue2;
                    }
                }
                gvMx1.RefreshData();
            };
            #endregion
        }
        private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -174,6 +216,27 @@
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
        }
        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
        {
            //guidKey, rptParameter
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1, "billNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            this.toolBarMenu1.rptParameter = "rpt_CGTH{"
                                               + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "}";
            this.toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
        /// 分页事件
@@ -208,6 +271,11 @@
            _filterList = e.FilterList;
            getPageList(1);
        }
        private void ToolBarMenu1_btnWjClick(object sender, EventArgs e)
        {
            _toolCk(2);
        }
        /// <summary>
        ///     审核事件
        /// </summary>
@@ -277,7 +345,7 @@
                }
                else
                MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
@@ -343,7 +411,7 @@
            txt_fRequireOrgId.IsReadly = true;
            txt_fOwnerIdHead.IsReadly = true;
            txt_fPurchaseDeptId.IsReadly = true;
          //  txt_fPurchaserId.IsReadly = true;
            //  txt_fPurchaserId.IsReadly = true;
        }
        /// <summary>
        /// 新增事件
@@ -634,6 +702,9 @@
                case 0:
                    strMsg = "反审核";
                    break;
                case 2:
                    strMsg = "完结";
                    break;
            }
            ;
            toolBarMenu1.guidKey = "";
@@ -737,6 +808,9 @@
            var rowhandle = gvMx1.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            var dr = gvMx1.GetDataRow(rowhandle);
            var strItemId = dr["itemId"].ToString();
            var strOrgGuid = txt_thOrgId.GetId();
            if (string.IsNullOrEmpty(strOrgGuid))
            {
@@ -744,13 +818,15 @@
                return;
            }
            ;
            SelectCk frm = new SelectCk(strOrgGuid);
            SelectCk frm = new SelectCk(strOrgGuid, strItemId);
            frm.UpdateParent += (ss, ee) =>
            {
                var lst = new List<dynamic>();
                lst = ee.DynamicList;
                gvMx1.SetFocusedRowCellValue("depotName", lst[0].name);
                gvMx1.SetFocusedRowCellValue("depotId", lst[0].guid);
                gvMx1.SetFocusedRowCellValue("kcQty", lst[0].kcQty);
                gvMx1.BestFitColumns();
            };
            frm.ShowDialog();
        }
@@ -763,7 +839,7 @@
            {
                layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
               // layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                // layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
            else