| | |
| | | using Gs.DevApp.DevFrm.QC; |
| | | using Gs.DevApp.DevFrm.Work; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | { |
| | | public partial class Frm_FqcDetect01 : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | string _webServiceName = "MesQaItemsDetect01Manager/"; |
| | | string _strTag= "N:不合格"; |
| | | string _webServiceName = "FqcManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | public Frm_FqcDetect01() |
| | | { |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx4); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fsubmitTxt", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | }, tips); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value, "0"); |
| | | }, (value) => |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | }); |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | txtJianYan.KeyDown += TxtJianYan_KeyDown; |
| | | this.btnLoad.Click += BtnLoad_Click; |
| | | ucUpFile1.UpChanged += UcUpFile1_UpChanged; |
| | | xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; |
| | | gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; |
| | | btnIpt.Click += BtnIpt_Click; |
| | | txt_suppId.getSuppler(""); |
| | | //选择工单 |
| | | txt_lotNo.Click += (s, e) => |
| | | { |
| | | var frm = new SelectFqcDaa(); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | try |
| | | { |
| | | var lst = new List<dynamic>(); |
| | | lst = ee.DynamicList; |
| | | txt_itemId.Text = lst[0].itemId; |
| | | txt_itemModel.Text = lst[0].itemModel; |
| | | txt_itemName.Text = lst[0].itemName; |
| | | txt_itemNo.Text = lst[0].itemNo; |
| | | txt_lotNo.Text = lst[0].gdbh; |
| | | txt_lineName.Text = lst[0].lineName; |
| | | txt_lineId.Text = lst[0].lineId; |
| | | txt_checkStates.Text = "W:未知"; |
| | | txt_fcheckResu.Text = "W:未知"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | //选择箱码 |
| | | txt_kbList.Click += (s, e) => |
| | | { |
| | | string _lotNo = txt_lotNo.Text.Trim(); |
| | | if (string.IsNullOrEmpty(_lotNo)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("请先选择工单!"); |
| | | return; |
| | | } |
| | | var frm = new SelectFqcBox(_lotNo); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | try |
| | | { |
| | | var lst = new List<dynamic>(); |
| | | lst = ee.DynamicList; |
| | | System.Text.StringBuilder sb = new System.Text.StringBuilder(); |
| | | decimal kbSl = 0; |
| | | foreach (var item in lst) |
| | | { |
| | | if (sb.Length > 0) |
| | | sb.Append(","); |
| | | sb.Append(item.itemBarcode); |
| | | kbSl += decimal.Parse(item.sl.ToString()); |
| | | }; |
| | | txt_kbList.Text = sb.ToString(); |
| | | txt_kbSl.Text = kbSl.ToString(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | // 读取缺陷等级 |
| | | getRptDefectLevel(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 批量录入 |
| | | /// </summary> |
| | |
| | | private void BtnIpt_Click(object sender, EventArgs e) |
| | | { |
| | | bool bl = btnLoad.Enabled; |
| | | Frm_MesQaItemsDetect01Input frm = new Frm_MesQaItemsDetect01Input(this.lbGuid.Text.Trim(), bl); |
| | | Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input frm = new Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input(this.lbGuid.Text.Trim(), bl); |
| | | frm.ShowDialog(); |
| | | } |
| | | |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "ReloadModel5", JsonConvert.SerializeObject(_obj)); |
| | | string strJson = UtilityHelper.HttpPost("", "MesQaItemsDetect01Manager/ReloadModel5", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "EdtModel12", |
| | | "MesQaItemsDetect01Manager/EdtModel12", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_releaseNo, gridView1, "lotNo"); |
| | | lbGuid, txt_releaseNo, gridView1, "releaseNo"); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定提交检验吗?")) |
| | | return; |
| | | if (txt_fcheckResu.Text.Trim() == "不合格") |
| | | if (txt_fcheckResu.Text.Trim() == _strTag) |
| | | { |
| | | if (string.IsNullOrEmpty(txt_remarks.Text.Trim())) |
| | | if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim())) |
| | | { |
| | | MsgHelper.Warning("单据为不合格时,请填写备注说明!"); |
| | | MsgHelper.Warning("单据为不合格时,请填写违规信息!"); |
| | | return; |
| | | } |
| | | string _txt_fngHandle = txt_fngHandle.Text.Trim(); |
| | | string _txt_fmrmode = txt_fmrmode.GetCode(); |
| | | string _txt_fzrId = txt_fzrId.GetId(); |
| | | string _txt_workNo = txt_workNo.Text.Trim(); |
| | | string _txt_msg = txt_msg.TextTxt; |
| | | string _txt_zrType = txt_zrType.Text.Trim(); |
| | | if (txt_fngHandle.SelectedIndex <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择处置结果!"); |
| | | txt_fngHandle.Focus(); |
| | | return; |
| | | } |
| | | if (txt_zrType.SelectedIndex <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择责任判定!"); |
| | | txt_zrType.Focus(); |
| | | return; |
| | | } |
| | | if (_txt_fzrId.Length <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择责任人!"); |
| | | txt_fzrId.Focus(); |
| | | return; |
| | | } |
| | | //当处置结果为反工时,要选择工序和反工编号 |
| | | if (txt_fngHandle.SelectedIndex == 1) |
| | | { |
| | | if (string.IsNullOrEmpty(_txt_workNo)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请填写反工单号!"); |
| | | txt_workNo.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_fmrmode)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请填选择反工工序!"); |
| | | txt_fmrmode.Focus(); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (!string.IsNullOrEmpty(_txt_workNo)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("不需要填写反工单号!"); |
| | | txt_workNo.Focus(); |
| | | return; |
| | | } |
| | | if (!string.IsNullOrEmpty(_txt_fmrmode)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("不需要选择反工工序!"); |
| | | txt_fmrmode.Focus(); |
| | | return; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_releaseNo, gridView1, "releaseNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) |
| | | return; |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "DeleteModelOrMx", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 0) |
| | | { } |
| | | else |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 刷新事件 |
| | | /// </summary> |
| | |
| | | //getPageList(1); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 新增事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) |
| | | { |
| | | lbGuid.Text = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | this.ucUpFileList1.pGuid = ""; |
| | | this.ucChouJianList1.pGuid = ""; |
| | | } |
| | | /// <summary> |
| | | /// 修改事件 |
| | |
| | | private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | if (string.IsNullOrEmpty(txt_remarks.Text.Trim())) |
| | | string _txt_djType = txt_djType.Text.Trim();//单据类型 |
| | | string _txt_fbatchQty = txt_fbatchQty.Text.Trim();//抽检数量 |
| | | string _txt_lifnr = txt_lifnr.Text.Trim();//客户订单 |
| | | string _txt_suppId = txt_suppId.GetId();//客户id |
| | | string _txt_lineId = "";//产线 |
| | | string _txt_itemId = "";//产品 |
| | | string _txt_remarks = txt_remarks.Text.Trim();//备注 |
| | | string _txt_epTag = txt_epTag.Text.Trim();//环保 |
| | | string _txt_msg = txt_msg.TextTxt;//异常 |
| | | string _txt_fmanageNo = txt_fmanageNo.Text.Trim();//流程编号 |
| | | string _txt_lotNo1 = txt_lotNo1.Text.Trim();//送检批号 |
| | | string _txt_lotNo = txt_lotNo.Text.Trim();//生产工单 |
| | | string _kbList = txt_kbList.Text.Trim(); |
| | | if (txt_djType.SelectedIndex <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("备注能为空!"); |
| | | txt_remarks.Focus(); |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("单据类型不能为空!"); |
| | | txt_djType.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_lotNo.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("工单号不能为空!"); |
| | | txt_lotNo.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_kbList.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("送检箱码不能为空!"); |
| | | txt_kbList.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_kbSl.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("送检数量不能为空!"); |
| | | txt_kbList.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_fbatchQty.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("抽检数量不能为空!"); |
| | | txt_fbatchQty.Focus(); |
| | | return; |
| | | } |
| | | if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(_txt_fbatchQty)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请输入正确的抽检数量!"); |
| | | txt_fbatchQty.Focus(); |
| | | return; |
| | | } |
| | | if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(txt_kbSl.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请输入正确的送检数量!"); |
| | | txt_kbList.Focus(); |
| | | return; |
| | | } |
| | | if (Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_txt_fbatchQty) > Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_kbSl.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("抽检数量不能大于送检数量!"); |
| | | txt_fbatchQty.Focus(); |
| | | return; |
| | | } |
| | | //当不合格时的检查 |
| | | string _txt_fngHandle = txt_fngHandle.Text.Trim(); |
| | | string _txt_fmrmode = txt_fmrmode.GetCode(); |
| | | string _txt_fzrId = txt_fzrId.GetId(); |
| | | string _txt_workNo = txt_workNo.Text.Trim(); |
| | | string _txt_zrType = txt_zrType.Text.Trim(); |
| | | if (txt_fcheckResu.Text.Trim() == _strTag) |
| | | { |
| | | if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim())) |
| | | { |
| | | MsgHelper.Warning("当不合格时,请填写违规信息!"); |
| | | txt_msg.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (txt_fngHandle.SelectedIndex <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("当不合格时,请选择处置结果!"); |
| | | txt_fngHandle.Focus(); |
| | | return; |
| | | } |
| | | if (txt_zrType.SelectedIndex <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("当不合格时,请选择责任判定!"); |
| | | txt_zrType.Focus(); |
| | | return; |
| | | } |
| | | if (_txt_fzrId.Length <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("当不合格时,请选择责任人!"); |
| | | txt_fzrId.Focus(); |
| | | return; |
| | | } |
| | | //当处置结果为反工时,要选择工序和反工编号 |
| | | if (txt_fngHandle.SelectedIndex == 1) |
| | | { |
| | | if (string.IsNullOrEmpty(_txt_workNo)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("当不合格时,请填写反工单号!"); |
| | | txt_workNo.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_fmrmode)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("当不合格时,请填选择反工工序!"); |
| | | txt_fmrmode.Focus(); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (!string.IsNullOrEmpty(_txt_workNo)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("不需要填写反工单号!"); |
| | | txt_workNo.Focus(); |
| | | return; |
| | | } |
| | | if (!string.IsNullOrEmpty(_txt_fmrmode)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("不需要选择反工工序!"); |
| | | txt_fmrmode.Focus(); |
| | | return; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | fngDesc = "", |
| | | remarks = txt_remarks.Text.Trim(), |
| | | djType = _txt_djType,//单据类型 |
| | | fbatchQty = _txt_fbatchQty,//抽检数量 |
| | | lifnr = _txt_lifnr,//客户订单 |
| | | suppId = _txt_suppId,//客户id |
| | | lineId = _txt_lineId,//产线 |
| | | itemId = _txt_itemId,//产品 |
| | | remarks = _txt_remarks,//备注 |
| | | epTag = _txt_epTag,//环保 |
| | | msg = _txt_msg,//异常 |
| | | fmanageNo = _txt_fmanageNo,//流程编号 |
| | | lotNo1 = _txt_lotNo1,//送检批号 |
| | | lotNo = _txt_lotNo,//生产工单 |
| | | kbList = _kbList, |
| | | fngHandle = _txt_fngHandle, |
| | | fzrId = _txt_fzrId, |
| | | workNo = _txt_workNo, |
| | | fmrmode = _txt_fmrmode, |
| | | zrType = _txt_zrType, |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | for (var i = 0; i < gvMx1.DataRowCount; i++) |
| | | { |
| | | var row = gvMx1.GetDataRow(i); |
| | | if (row != null) |
| | | { |
| | | Guid _guid = UtilityHelper.ToGuid(row["guid"].ToString()); |
| | | string _defectLevel = row["defectLevel"].ToString(); |
| | | string _defectDetails = row["defectDetails"].ToString(); |
| | | string _fcheckResu = row["fcheckResu"].ToString(); |
| | | if (_fcheckResu == _strTag) |
| | | { |
| | | if (string.IsNullOrEmpty(_defectLevel)) |
| | | { |
| | | MsgHelper.ShowError("请选择缺陷等级!"); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_defectDetails)) |
| | | { |
| | | MsgHelper.ShowError("请填写缺陷描述!"); |
| | | return; |
| | | } |
| | | _obj.list.Add(new |
| | | { |
| | | guid5 = _guid, |
| | | defectLevel = _defectLevel, |
| | | defectDetails = _defectDetails, |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_releaseNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false); |
| | | this.setEable(false); |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | getModel(lbGuid.Text, "0"); |
| | | } |
| | | } |
| | | 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); |
| | | // _sbSqlWhere += " and isnull(fsubmit,0)=0"; |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | private void getModel(string strGuid, string guid5) |
| | | { |
| | |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | ucUpFile1.parentGuid = lbGuid.Text.Trim(); |
| | | ucUpFileList1.pGuid = lbGuid.Text.Trim(); |
| | | ucChouJianList1.pGuid = lbGuid.Text.Trim(); |
| | | if (guid5.Length > 10) |
| | | { |
| | | int rowHandle = 0; |
| | |
| | | rowHandle = 0; |
| | | gvMx1.FocusedRowHandle = rowHandle + 1; |
| | | } |
| | | // MessageBox.Show(rowHandle.ToString() + "**" + guid5); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (e.Page.Name == "tabMxPage2") |
| | | { |
| | | getFileList(); |
| | | ucChouJianList1.getList14(); |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 上传后刷新文件列表 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void UcUpFile1_UpChanged(object sender, EventArgs e) |
| | | { |
| | | getFileList(); |
| | | } |
| | | private void getFileList() |
| | | { |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and parent_Guid='" + lbGuid.Text.Trim() + "'"); |
| | | PageQueryModel pgq = new PageQueryModel(1, 100, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | | if (e.Page.Name == "tabMxPage3") |
| | | { |
| | | string strReturn = UtilityHelper.HttpPost("", "MesFile/GetListPage", json); |
| | | ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); |
| | | if (dd.rtnCode > 0) |
| | | { |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMx4.BindingContext = new BindingContext(); |
| | | gcMx4.DataSource = dt; |
| | | gcMx4.ForceInitialize(); |
| | | gvMx4.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | ucUpFileList1.getFileList(); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除附件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx4.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gvMx4.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) |
| | | return; |
| | | var strJson = ""; |
| | | var lst = new List<string>(); |
| | | lst.Add(mxGuid); |
| | | try |
| | | { |
| | | strJson = UtilityHelper.HttpPost("", "MesFile/DeleteModel", |
| | | JsonConvert.SerializeObject(lst)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) gvMx4.DeleteRow(rowhandle); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 浏览附件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx4.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | try |
| | | { |
| | | var dr = gvMx4.GetDataRow(rowhandle); |
| | | var urlPath = dr["urlPath"].ToString(); |
| | | Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath); |
| | | frm.ShowDialog(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 下载附件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx4.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | try |
| | | { |
| | | var dr = gvMx4.GetDataRow(rowhandle); |
| | | var urlPath = dr["urlPath"].ToString(); |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | string _folderName = _folder + "\\" + urlPath; |
| | | string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath; |
| | | using (WebClient client = new WebClient()) |
| | | { |
| | | client.DownloadFile(_url, _folderName); |
| | | } |
| | | ToolBox.MsgHelper.ShowInformation("下载成功!"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void setEable(bool bl) |
| | | { |
| | | |
| | | txtJianYan.ReadOnly = !bl; |
| | | btnLoad.Enabled = bl; |
| | | ucChouJianList1.IsReadOnly(!bl); |
| | | btnIpt.Text = (bl == true ? "录入样本" : "查看样本"); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读取缺陷等级 |
| | | /// </summary> |
| | | /// <param name="curPage"></param> |
| | | private void getRptDefectLevel() |
| | | { |
| | | string _where = " and 1=1 and s_type='缺陷等级'"; |
| | | var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where); |
| | | var json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | | { |
| | | var strReturn = UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json); |
| | | var dd = UtilityHelper.ReturnToTablePage(strReturn); |
| | | var dt = dd.rtnData.list; |
| | | foreach (DataRow dr in dt.Rows) |
| | | { |
| | | rptDefectLevel.Items.Add(dr["defectName"].ToString()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 选择缺陷描述 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void rptDefectDetails_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | UcDictionarySelect frm = new UcDictionarySelect("缺陷描述", " s_type='FQC缺陷描述'"); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); |
| | | var lst = ee.DynamicList; |
| | | foreach (dynamic dym in lst) |
| | | { |
| | | if (stringBuilder.Length > 0) |
| | | stringBuilder.Append("|"); |
| | | stringBuilder.Append(dym.dicTxt); |
| | | } |
| | | gvMx1.SetFocusedRowCellValue("defectDetails", stringBuilder.ToString()); |
| | | // this.TextTxt = ; |
| | | }; |
| | | frm.ShowDialog(); |
| | | } |
| | | } |
| | | } |