bug
lu
8 天以前 d1104a30df234dc5e28703ea2d9ea57717005442
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -56,12 +56,6 @@
                if (string.IsNullOrEmpty(_orgId))
                    return;
                txt_suppId.getSuppler(_orgId, _ucGys);
                txt_depotsId.getSuppler(_orgId, _ucCk);
            };
            //设置仓库选择
            this.txt_depotsId.EditChanged += (s, e) =>
            {
                txtDepotsCode.Text = this.txt_depotsId.GetCode();
            };
            //设置供应商选择
            this.txt_suppId.EditChanged += (s, e) =>
@@ -90,16 +84,52 @@
                    {
                        var lst = new List<string>();
                        lst = ee.StringList;
                        var _obj = lst;
                        var strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj));
                        var dt = UtilityHelper.ReturnToList(strReturn);
                        DataTable _newTable = dt.rtnData;
                        string strReturn = "";
                        ReturnModel<DataTable> dt;
                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
                        DataRow[] sourceRows = _newTable.Select();
                        for (int i = 0; i < sourceRows.Length; i++)
                        #region 这是Srm来的单子
                        if (lst == null)
                        {
                            _oldTable.ImportRow(sourceRows[i]);
                            string strSrmNo = "";
                            List<dynamic> lstSrm = new List<dynamic>();
                            lstSrm = ee.DynamicList;
                            strSrmNo = lstSrm[0].guid;
                            txt_paperBillNo.Text = strSrmNo;
                            var _obj = new
                            {
                                inShdh = strSrmNo,
                                inP1 = "",
                                inP2 = ""
                            };
                            strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj));
                            dt = UtilityHelper.ReturnToList(strReturn);
                            //禁止修改数量
                            gvMx1quantity.OptionsColumn.ReadOnly = true;
                            txt_paperBillNo.ReadOnly = true;
                            txt_isSrm.Checked = true;
                            DataTable _newTable = dt.rtnData;
                            _oldTable = _newTable;
                        }
                        #endregion
                        #region 这是普通的单
                        else
                        {
                            txt_paperBillNo.Text = "";
                            var _obj = lst;
                            strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj));
                            dt = UtilityHelper.ReturnToList(strReturn);
                            //修改数量
                            gvMx1quantity.OptionsColumn.ReadOnly = false;
                            txt_paperBillNo.ReadOnly = false;
                            txt_isSrm.Checked = false;
                            DataTable _newTable = dt.rtnData;
                            DataRow[] sourceRows = _newTable.Select();
                            for (int i = 0; i < sourceRows.Length; i++)
                            {
                                _oldTable.ImportRow(sourceRows[i]);
                            }
                        }
                        #endregion
                        gcMx1.BindingContext = new BindingContext();
                        gcMx1.DataSource = _oldTable;
                        gcMx1.ForceInitialize();
@@ -114,7 +144,6 @@
                frm.ShowDialog();
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -225,12 +254,14 @@
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                }
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                else
                MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -283,6 +314,10 @@
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
            //2025/07/12加上修改状态下不能修改供应商和组织srm,禁用
            setSrm();
            txt_receiveOrgId.IsReadly = true;
            txt_suppId.IsReadly = true;
        }
        /// <summary>
@@ -298,6 +333,10 @@
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId);
            txt_isSrm.Checked = false;
            setSrm();
        }
        /// <summary>
@@ -309,24 +348,17 @@
        {
            toolBarMenu1.isSetBtn = false;
            string _orgId = txt_receiveOrgId.GetId();
            string _ckId = txt_depotsId.GetId(); //仓库编号 depots_code
            string _gysId = txt_suppId.GetId(); //供应商编号
            if (string.IsNullOrEmpty(_orgId))
            {
                MsgHelper.Warning("请选择收料组织!");
                MsgHelper.ShowError("请选择收料组织!");
                txt_receiveOrgId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_gysId))
            {
                MsgHelper.Warning("请选择供应商!");
                MsgHelper.ShowError("请选择供应商!");
                txt_suppId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_ckId))
            {
                MsgHelper.Warning("请选择仓库!");
                txt_depotsId.Focus();
                return;
            }
            var _obj = new
@@ -335,8 +367,8 @@
                PaperBillNo = txt_paperBillNo.Text.Trim(), //送货单号;
                Remark = txt_remark.Text.Trim(), //备注
                SuppId = _gysId, //供应商
                DepotsId = _ckId,//仓库
                OrgId = _orgId,
                IsSrm = (txt_isSrm.Checked ? 1 : 0),
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
@@ -376,9 +408,9 @@
                    _webServiceName + "EditModel",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_billNo.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
@@ -388,10 +420,12 @@
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
                else
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -614,9 +648,9 @@
                    _webServiceName + _meth,
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnData.outMsg);
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnData.outMsg);
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        getModel(lbGuid.Text.Trim());
@@ -626,10 +660,12 @@
                    int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
                    UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                }
                else
                    MsgHelper.ShowError("提示:" + _rtn.rtnData.outMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -648,5 +684,28 @@
            HistoryDhmxcs frm = new HistoryDhmxcs(mxGuid);
            frm.ShowDialog();
        }
        private void setSrm()
        {
            bool isSrm = (txt_isSrm.Checked);
            if (isSrm == true)
            {
                gvMx1quantity.OptionsColumn.ReadOnly = true;
                txt_paperBillNo.ReadOnly = true;
                txt_isSrm.Checked = true;
                txt_receiveOrgId.IsReadly = true;
                txt_suppId.IsReadly = true;
                btnSelect.Enabled = false;
            }
            else
            {
                gvMx1quantity.OptionsColumn.ReadOnly = false;
                txt_paperBillNo.ReadOnly = false;
                txt_isSrm.Checked = false;
                txt_receiveOrgId.IsReadly = false;
                txt_suppId.IsReadly = false;
                btnSelect.Enabled = true;
            }
        }
    }
}