cdk
2025-10-30 d594a46c8212fc022c5f1dea7c9994d8b4a0d100
DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
@@ -15,6 +15,7 @@
        string _webServiceName = "WWBlManager/";
        List<FilterEntity> _filterList = new List<FilterEntity>();
        public string strType = "";
        string _ucGys = "";//供应商
        public WwBlcl(string _strType)
        {
            InitializeComponent();
@@ -36,6 +37,7 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            this.toolBarMenu1.getXmlConfig();
            Form parentForm = this.FindForm();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
@@ -52,10 +54,23 @@
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            txt_orgId.EditChanged += (s, e) =>
            {
                var orgId = txt_orgId.GetId();
                if (string.IsNullOrEmpty(orgId))
                    return;
                txt_wwGys.getSuppler(orgId, _ucGys);
            };
            //选择需要入库的明细
            btnSelect.Click += (s, e) =>
            {
                var frm = new UcWwBlclSelectAll();
                if (string.IsNullOrEmpty(txt_wwGys.GetId()))
                {
                    MsgHelper.ShowError("请选择供应商!");
                    txt_wwGys.Focus();
                    return;
                }
                var frm = new UcWwBlclSelectAll(txt_orgId.GetId(), txt_wwGys.GetId());
                //赋值给明细表
                frm.UpdateParent += (ss, ee) =>
                {
@@ -71,8 +86,9 @@
                            _row["bld003"] = dym.itemName;//物料名称
                            _row["bld004"] = dym.itemModel;//规格型号
                            _row["dabGuid"] = dym.dabGuid;
                            _row["xlsl"] = dym.dab006;
                            _row["bld008"] = dym.dab007;//已领用量
                            _row["bld009"] = dym.dwName;
                            _row["bld009"] = dym.dwName;//单位
                            _row["bld001"] = dym.bld001;//工单号
                            _Table.Rows.Add(_row);
                            idx++;
@@ -255,6 +271,9 @@
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
            //2025/07/12加上修改状态下不能修改
            txt_orgId.IsReadly = true;
            txt_wwGys.IsReadly = true;
        }
        /// <summary>
        /// 新增事件
@@ -269,6 +288,8 @@
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_orgId);
        }
        /// <summary>
        /// 保存事件
@@ -284,11 +305,25 @@
                txt_bl017.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_orgId.GetId()))
            {
                MsgHelper.ShowError("请选择组织!");
                txt_orgId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_wwGys.GetId()))
            {
                MsgHelper.ShowError("请选择供应商!");
                txt_wwGys.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                inYy = txt_bl007.Text.Trim(),//原因
                inType = txt_bl017.Text.Trim(),//出库类别
                inOrgId = txt_orgId.GetId(),
                inWwGys = txt_wwGys.GetId(),
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
@@ -415,10 +450,12 @@
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    _ucGys = dy.wwGys;
                    lbGuid.Text = strGuid;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucGys = "";
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list"])
@@ -570,5 +607,27 @@
                }
            }
        }
        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
        {
            //guidKey, rptParameter
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_blNo, gridView1, "blNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            this.toolBarMenu1.rptParameter = "rpt_WWBL{"
                                               + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "}";
            this.toolBarMenu1.guidKey = rowGuid;
        }
    }
}