bug
lu
4 天以前 8a7bc73b5ac40d26ec72a5df94ca15c5a2976af0
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
@@ -30,6 +30,7 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) =>
@@ -53,7 +54,6 @@
                    return;
                txt_suppId.getSuppler(orgId, _ucGys);
                txt_fPurchaseDeptId.getSuppler(orgId, _ucBm);
                // txt_fPurchaserId.getSuppler();
            };
            //选择需要的明细
            btnSelect.Click += (s, e) =>
@@ -128,6 +128,8 @@
                                _row["remark"] = dym.remark;
                                _row["orderNo"] = dym.orderNo; //序号
                                _row["kcQty"] = dym.kcQty; //库存数量
                                _row["depotId"] = dym.depotId; //库存数量
                                _row["depotName"] = dym.depotName; //库存数量
                                _Table.Rows.Add(_row);
                            }
                            gcMx1.BindingContext = new BindingContext();
@@ -149,10 +151,7 @@
            };
            //源单事件
            txt_fHasLinkRad.SelectedIndex = 0;
            layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            setSrm();
            txt_fHasLinkRad.SelectedIndexChanged += (s, e) =>
            {
                setSrm();
@@ -176,6 +175,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>
        /// 分页事件
@@ -252,7 +272,7 @@
                lbGuid, txt_billNo, gridView1, "billNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?"))
@@ -270,18 +290,20 @@
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                else
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -321,7 +343,7 @@
                lbGuid, txt_billNo, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -343,7 +365,7 @@
            txt_fRequireOrgId.IsReadly = true;
            txt_fOwnerIdHead.IsReadly = true;
            txt_fPurchaseDeptId.IsReadly = true;
            txt_fPurchaserId.IsReadly = true;
            //  txt_fPurchaserId.IsReadly = true;
        }
        /// <summary>
        /// 新增事件
@@ -377,7 +399,8 @@
            string _xqzz = txt_fRequireOrgId.GetId();//需求组织
            string _hz = txt_fOwnerIdHead.GetId();//货主
            string _bm = txt_fPurchaseDeptId.GetId();//部门
            string _ygbh = txt_fPurchaserId.GetId();//员工
            //string _ygbh = txt_fPurchaserId.GetId();//员工
            string _ygbh = "";
            if (string.IsNullOrEmpty(_orgId))
            {
                MsgHelper.ShowError("请选择组织!");
@@ -423,12 +446,12 @@
                    txt_fPurchaseDeptId.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(_ygbh))
                {
                    MsgHelper.ShowError("请选择员工!");
                    txt_fPurchaserId.Focus();
                    return;
                }
                //if (string.IsNullOrEmpty(_ygbh))
                //{
                //    MsgHelper.ShowError("请选择员工!");
                //    txt_fPurchaserId.Focus();
                //    return;
                //}
            }
            var _obj = new
            {
@@ -517,7 +540,11 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            gcMain1.DataSource = null;
            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
            _sbSqlWhere.Append(" and a.TH_ORG_ID in");
            _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
            _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "BILL_NO", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
@@ -732,6 +759,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))
            {
@@ -739,13 +769,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();
        }
@@ -758,14 +790,14 @@
            {
                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
            {
                layItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                layItem2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                //layItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                layItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
            }
        }