| | |
| | | |
| | | using Gs.DevApp.DevFrm.Work; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; |
| | | btnIpt.Click += BtnIpt_Click; |
| | | txt_suppId.getSuppler(""); |
| | | txt_lineId.getSuppler(""); |
| | | txt_itemId.Click += (s, e) => |
| | | //选择工单 |
| | | txt_lotNo.Click += (s, e) => |
| | | { |
| | | string _lineId = txt_lineId.GetId(); |
| | | if (string.IsNullOrEmpty(_lineId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("请先选择产线!"); |
| | | return; |
| | | } |
| | | var frm = new SelectFqcItem(_lineId); |
| | | var frm = new SelectFqcDaa(); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | try |
| | |
| | | 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:未知"; |
| | | txt_freceQty.Text = "W:未知"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | }; |
| | | 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> |
| | |
| | | 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); |
| | |
| | | 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)) |
| | | { |
| | |
| | | return; |
| | | if (txt_fcheckResu.Text.Trim() == "不合格") |
| | | { |
| | | if (string.IsNullOrEmpty(txt_remarks.Text.Trim())) |
| | | if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim())) |
| | | { |
| | | MsgHelper.Warning("单据为不合格时,请填写备注说明!"); |
| | | MsgHelper.Warning("单据为不合格时,请填写违规信息!"); |
| | | return; |
| | | } |
| | | }; |
| | |
| | | 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; |
| | | 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(); |
| | | string _txt_lineId = txt_lineId.GetId(); |
| | | string _txt_itemId = txt_itemId.Text.Trim(); |
| | | string _txt_remarks = txt_remarks.Text.Trim(); |
| | | string _txt_workNo = ""; |
| | | string _txt_epTag = txt_epTag.Text.Trim(); |
| | | string _txt_fzrId = ""; |
| | | string _txt_msg = txt_msg.TextTxt; |
| | | string _txt_fmanageNo = txt_fmanageNo.Text.Trim(); |
| | | string _txt_lotNo2 = txt_lotNo2.Text.Trim(); |
| | | string _txt_lotNo1 = txt_lotNo1.Text.Trim(); |
| | | string _txt_lotNo = txt_lotNo.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_fbatchQty.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_lineId.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("产线不能为空!"); |
| | | txt_lineId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_itemId.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("产品不能为空!"); |
| | | txt_itemId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_txt_lotNo.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("工单号不能为空!"); |
| | |
| | | var _obj = new |
| | | { |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | djType = _txt_djType, |
| | | fbatchQty = _txt_fbatchQty, |
| | | lifnr = _txt_lifnr, |
| | | suppId = _txt_suppId, |
| | | lineId = _txt_lineId, |
| | | itemId = _txt_itemId, |
| | | remarks = _txt_remarks, |
| | | workNo = _txt_workNo, |
| | | epTag = _txt_epTag, |
| | | fzrId = _txt_fzrId, |
| | | msg = _txt_msg, |
| | | fmanageNo = _txt_fmanageNo, |
| | | lotNo2 = _txt_lotNo2, |
| | | lotNo1 = _txt_lotNo1, |
| | | lotNo = _txt_lotNo |
| | | 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,//生产工单 |
| | | edtType = 0, |
| | | kbList = _kbList, |
| | | 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 == "不合格") |
| | | { |
| | | 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)); |
| | |
| | | this.setEable(false); |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | getModel(lbGuid.Text, "0"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | ucUpFileList1.pGuid = lbGuid.Text.Trim(); |
| | | ucChouJianList1.pGuid = lbGuid.Text.Trim(); |
| | | if (guid5.Length > 10) |
| | | { |
| | | int rowHandle = 0; |
| | |
| | | private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e) |
| | | { |
| | | if (e.Page.Name == "tabMxPage2") |
| | | { |
| | | ucChouJianList1.getList14(); |
| | | |
| | | } |
| | | if (e.Page.Name == "tabMxPage3") |
| | | { |
| | | ucUpFileList1.getFileList(); |
| | | } |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void setEable(bool bl) |
| | | { |
| | | txtJianYan.ReadOnly = !bl; |
| | | btnLoad.Enabled = 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(); |
| | | } |
| | | } |
| | | } |