| | |
| | | using DevExpress.XtraEditors; |
| | | using Gs.DevApp.DevFrm.Work; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gridView1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList); |
| | | this.toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; |
| | | this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick; |
| | | this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick; |
| | | this.toolBarMenu1.btnCaiWuChkClick += ToolBarMenu1_btnCaiWuChkClick; |
| | | this.toolBarMenu1.btnCaiWuFchkClick += ToolBarMenu1_btnCaiWuFchkClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | }, tips); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value); |
| | | }, (value) => |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | }); |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | |
| | | //选择库存组织(变明细中的物料和变货主) |
| | | this.txt_qt022.EditChanged += (s, e) => |
| | | { |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | }; |
| | | |
| | | gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; |
| | | this.ucBtnPrint1.btnDesignClick += (s, e) => |
| | | { |
| | | ucBtnPrint1.rptParameter = "rpt_Qtrk{}"; |
| | | }; |
| | | this.ucBtnPrint1.btnReportClick += (s, e) => |
| | | { |
| | | ucBtnPrint1.guidKey = ""; |
| | | string rowGuid = lbMxGuid.Text.Trim(); |
| | | ucBtnPrint1.guidKey = rowGuid; |
| | | if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码张数!"); |
| | | txt_iCount_1.Focus(); |
| | | this.ucBtnPrint1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码数量!"); |
| | | txt_psnQty_1.Focus(); |
| | | this.ucBtnPrint1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (lbMxGuid.Text.Trim().Length < 10) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印的行!"); |
| | | this.ucBtnPrint1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim() |
| | | + "," + "" |
| | | + "," + "" |
| | | + "," + txt_iCount_1.Text.Trim() |
| | | + "," + txt_psnQty_1.Text.Trim() |
| | | + "}"; |
| | | }; |
| | | |
| | | } |
| | | |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | | Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | gridView1.ActiveFilter.Clear(); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList); |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); |
| | | frm.UpdateParent += Frm_UpdateParent; |
| | | frm.ShowDialog(); |
| | | } |
| | |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_qtck, gridView1, "qtck"); |
| | | lbGuid, txt_qtck, gridView1,"qtck"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); |
| | | ucLookHuoZhu1.Enabled = true; |
| | | } |
| | | } |
| | |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); |
| | | ucLookHuoZhu1.Enabled = true; |
| | | //增加时,默认组织 |
| | | string deftOrg = UtilityHelper.GetFirstOrg(txt_qt022); |
| | | } |
| | | /// <summary> |
| | | /// 保存事件 |
| | |
| | | string kcZz = txt_qt022.GetId();//库存组织 |
| | | string kcBm = txt_qt009.GetId();//库存部门 |
| | | string kcGys = txt_qt018.GetId();//库存供应商 |
| | | string djLx = txt_qt003.Text.Trim();//单据类型 |
| | | string djLx = txt_qt003.TextTxt.Trim();//单据类型 |
| | | string kcfx = txt_qt019.Text.Trim();//库存方向 |
| | | string inHzlx = ucLookHuoZhu1.GetHzLx();//货主类型 |
| | | string inHz = ucLookHuoZhu1.GetHzId();//货主 |
| | |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择货主!"); |
| | | return; |
| | | } |
| | | if (txt_qt003.SelectedIndex < 0) |
| | | if (txt_qt003.TextTxt.Length < 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!"); |
| | | txt_qt003.Focus(); |
| | |
| | | txt_qt019.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(kcCk)) |
| | | if (string.IsNullOrEmpty(kcBm) && string.IsNullOrEmpty(kcGys)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!"); |
| | | txt_qt008.Focus(); |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("部门或供应商必须选一个!"); |
| | | txt_qt009.Focus(); |
| | | return; |
| | | } |
| | | //if (string.IsNullOrEmpty(kcCk)) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!"); |
| | | // txt_qt008.Focus(); |
| | | // return; |
| | | //} |
| | | var _obj = new |
| | | { |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | |
| | | kcfx = kcfx,//库存方向 |
| | | hzlx = inHzlx,//货主类型 |
| | | inHz = inHz,//货主 |
| | | inSource = txt_qt035.EditValue,//工单号 |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | |
| | | ItemId = (row["itemId"].ToString()), |
| | | Sqsl = (row["qd007"].ToString()), |
| | | Bz = (row["qd010"].ToString()), |
| | | Bllb = (row["qd012"].ToString()), |
| | | }); |
| | | } |
| | | } |
| | |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); |
| | | ucLookHuoZhu1.Enabled = false; |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <param name="pageSize">每页几条</param> |
| | | private void getPageList(int curPage) |
| | | { |
| | | var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | |
| | | if (dd.rtnCode > 0) |
| | | { |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMain.BindingContext = new BindingContext(); |
| | | gcMain1.BindingContext = new BindingContext(); |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMain.DataSource = dt; |
| | | gcMain.ForceInitialize(); |
| | | gridView1.BestFitColumns(); |
| | | gcMain1.DataSource = dt; |
| | | gcMain1.ForceInitialize(); |
| | | gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); |
| | | } |
| | | else |
| | | UtilityHelper.SetDefaultTable(gcMain, gridView1); |
| | | UtilityHelper.SetDefaultTable(gcMain1, gridView1); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | pageBar1.TotalPages = dd.rtnData.pages;//总页 |
| | | pageBar1.CurrentPage = curPage;//当前页 |
| | |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 读取实体 |
| | | /// </summary> |
| | | /// <param name="strGuid"></param> |
| | | private void getModel(string strGuid) |
| | | { |
| | | gcMx1.DataSource = null; |
| | | bool isEdit = false; |
| | | if (toolBarMenu1.currentAction == "add") return; |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); |
| | | _ucGys = ""; |
| | | _ucBm = ""; |
| | | _ucCk = ""; |
| | |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); |
| | | } |
| | | else |
| | | { |
| | |
| | | gcMx2.DataSource = dt2; |
| | | gcMx2.ForceInitialize(); |
| | | gvMx2.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2); |
| | | } |
| | | else |
| | | { |
| | |
| | | gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]); |
| | | gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移出明细 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | |
| | | { |
| | | _toolCk(0); |
| | | } |
| | | /// <summary> |
| | | /// 财务审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnCaiWuChkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(30); |
| | | } |
| | | /// <summary> |
| | | /// 财务反审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnCaiWuFchkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(31); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 采购审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(40); |
| | | } |
| | | /// <summary> |
| | | /// 采购反审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | |
| | | private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(41); |
| | | } |
| | | /// <summary> |
| | | /// 工具条事件 |
| | | /// </summary> |
| | |
| | | break; |
| | | case 0: |
| | | strMsg = "反审核"; |
| | | break; |
| | | case 30: |
| | | strMsg = "财务审核"; |
| | | break; |
| | | case 31: |
| | | strMsg = "财务反审核"; |
| | | break; |
| | | case 40: |
| | | strMsg = "采购审核"; |
| | | break; |
| | | case 41: |
| | | strMsg = "采购反审核"; |
| | | break; |
| | | }; |
| | | toolBarMenu1.guidKey = ""; |
| | |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | | } |
| | | int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | //int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | //gridView1.FocusedRowHandle = rowHandle; |
| | | //UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString()); |
| | | |
| | | //注意,这里和其它页面有点不一样 |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | int rowHandle = gridView1.LocateByValue("guid", rowGuid); |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
| | | private void rptBl_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | if (e.FocusedRowHandle >= 0) |
| | | { |
| | | DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); |
| | | lbMxGuid.Text = row["guid"].ToString(); |
| | | ucBtnPrint1.guidKey = row["guid"].ToString(); |
| | | txtWlid.Text = row["qd002"].ToString(); |
| | | txtWlgg.Text = row["qd004"].ToString(); |
| | | txtWlmc.Text = row["qd003"].ToString(); |
| | | txtQuantity.Text = row["qd007"].ToString();//申请总量 |
| | | txtYdy.Text = row["ydy"].ToString();//已打印总量 |
| | | txtKdy.Text = row["kdy"].ToString();//可打印总量 |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 移出条码 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx2.FocusedRowHandle; |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | UcDictionarySelect frm = new UcDictionarySelect("异常描述", " a.s_type='QC异常描述' and a.pid<>'00000000-0000-0000-0000-000000000000'"); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | var dr = gvMx2.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) |
| | | return; |
| | | var _obj = new |
| | | System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); |
| | | var lst = ee.DynamicList; |
| | | foreach (dynamic dym in lst) |
| | | { |
| | | mxGuid = mxGuid, |
| | | inType = "dhtm" |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "DeleteBarcode", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text); |
| | | } |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (stringBuilder.Length > 0) |
| | | stringBuilder.Append("|"); |
| | | stringBuilder.Append(dym.dicTxt); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | gvMx1.SetFocusedRowCellValue("qd012", stringBuilder.ToString()); |
| | | // this.TextTxt = ; |
| | | }; |
| | | frm.ShowDialog(); |
| | | } |
| | | |
| | | } |
| | | } |