| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.Utils.MVVM.Services; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | |
| | | string _webServiceName = "WorkCollect/"; |
| | | string fGx = ""; |
| | | string fBc = ""; |
| | | string goodTag = "√"; |
| | | string badTag = "×"; |
| | | public Frm_Work01(string _fGx, string _fBc) |
| | | { |
| | | InitializeComponent(); |
| | | this.Text = "工序采集 - " + _fGx+ " - "+ fBc; |
| | | this.fGx = _fGx; |
| | | this.fBc = _fBc; |
| | | this.Text = "工序采集 - " + fGx + " - " + fBc; |
| | | txt_gx.Text = fGx; |
| | | txt_bc.Text = fBc; |
| | | txt_barCode.KeyDown += (s, e) => |
| | | { |
| | | if (e.KeyCode == Keys.Enter) { getModel("", "√"); }; |
| | | if (e.KeyCode == Keys.Enter) { getModel("", goodTag); }; |
| | | }; |
| | | btnGood.Click += (s, e) => |
| | | { |
| | | getModel("", "√"); |
| | | getModel("", goodTag); |
| | | }; |
| | | btnBad.Click += (s, e) => { |
| | | getModel("", "×"); |
| | | btnBad.Click += (s, e) => |
| | | { |
| | | UcDictionarySelect frm = new UcDictionarySelect("缺陷描述", " s_type='工序采集不良项目'"); |
| | | 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); |
| | | } |
| | | string _txt = stringBuilder.ToString(); |
| | | if (string.IsNullOrEmpty(_txt)) |
| | | { |
| | | Toast vm = new Toast(-1, "~当为不良时,请选择不良项目~"); |
| | | vm.Show(); |
| | | } |
| | | else |
| | | getModel("", badTag, _txt); |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="_checkVal">检测值</param> |
| | | /// <param name="_checkResult">检测结果</param> |
| | | private void getModel(string _checkVal, string _checkResult) |
| | | /// <param name="_badReson">不良原因</param> |
| | | /// <param name="_inBz">备注</param> |
| | | private void getModel(string _checkVal, string _checkResult, string _badReson = "", string _inBz = "") |
| | | { |
| | | string _barCode = txt_barCode.Text.Trim(); |
| | | string _inBz = ""; ; //备注 |
| | | if (string.IsNullOrEmpty(_barCode)) |
| | | { |
| | | ToolBox.MsgHelper.ShowError("请先扫码!"); |
| | | Toast vm = new Toast(-1, "~请先扫追溯码~"); |
| | | vm.Show(); |
| | | return; |
| | | } |
| | | var _obj = new |
| | | { |
| | | barCode = _barCode, |
| | | inBz = _inBz, |
| | | inBz = _inBz.Trim(), |
| | | checkVal = _checkVal, |
| | | checkResult = _checkResult, |
| | | processNo = txt_gx.Text.Trim(),//工序 |
| | | banCi = txt_bc.Text.Trim(),//班次 |
| | | gongWei = txt_gw.Text.Trim(),//工位 |
| | | badReson = _badReson.Trim() |
| | | }; |
| | | try |
| | | { |
| | |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | //头表和汇总 |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, false); |
| | | lbSum1.Text = dy.lbSum1; |
| | | lbSum2.Text = dy.lbSum2; |
| | | lbSum3.Text = dy.lbSum3; |
| | | lbSum4.Text = dy.lbSum4; |
| | | prog1.Position = dy.jd; |
| | | //良品 |
| | | txt_barCode.ReadOnly = false; |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | //不良品 |
| | | JArray array2 = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list2"]) |
| | | { |
| | |
| | | string _msg = _rtn.rtnMsg; |
| | | if (!string.IsNullOrEmpty(_msg)) |
| | | { |
| | | //设置单窗口出现弹出的速度 |
| | | this.alertControl1.FormDisplaySpeed = DevExpress.XtraBars.Alerter.AlertFormDisplaySpeed.Fast; |
| | | //设置显示多少时间窗口会自动关闭 以毫秒为单位 |
| | | this.alertControl1.AutoFormDelay = 3000; |
| | | //设置提出窗口的显示的位置 |
| | | this.alertControl1.FormLocation = DevExpress.XtraBars.Alerter.AlertFormLocation.BottomLeft; |
| | | this.alertControl1.Show(this, "提示!", _msg); |
| | | |
| | | Toast vm = new Toast((goodTag == "√" ? 1 : -1), _msg); |
| | | vm.Show(); |
| | | }; |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | { |
| | | Toast vm = new Toast(-1, _rtn.rtnMsg); |
| | | vm.Show(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | Toast vm = new Toast(-1, ex.Message); |
| | | vm.Show(); |
| | | } |
| | | } |
| | | } |