| | |
| | | using DevExpress.XtraGrid.Columns; |
| | | using DevExpress.XtraLayout.Utils; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | |
| | | public Frm_Work01(string _fGx, string _fBc, string _strinOther) |
| | | { |
| | | InitializeComponent(); |
| | | gvMx1.IndicatorWidth = 60; |
| | | gvMx1.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | | if (e.Info.IsRowIndicator && e.RowHandle >= 0) |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | }; |
| | | txt_gx.Text = _fGx; |
| | | txt_bc.Text = _fBc; |
| | | txt_dianJianPath.Text = _strinOther; |
| | | dianJianPath= _strinOther; |
| | | dianJianPath = _strinOther; |
| | | this.Text = "工序采集【" + _fGx + " - " + _fBc + "】"; |
| | | label8.Text = _fGx + "数量"; |
| | | addColumn(); |
| | | txt_barCode.KeyDown += (s, e) => |
| | | { |
| | | if (e.KeyCode == Keys.Enter) { addModel(goodTag); }; |
| | | if (e.KeyCode == Keys.Enter) { addModel(goodTag); } |
| | | ; |
| | | }; |
| | | btnGood.Click += (s, e) => |
| | | { |
| | |
| | | }; |
| | | btnBad.Click += (s, e) => |
| | | { |
| | | string _barCode = txt_barCode.Text.Trim(); |
| | | if (string.IsNullOrEmpty(_barCode)) |
| | | { |
| | | Toast vm = new Toast(-1, "~请先扫追溯码~"); |
| | | vm.Show(); |
| | | return; |
| | | } |
| | | UcDictionarySelect frm = new UcDictionarySelect("工序不良描述", " a.s_type='工序不良描述' and pid<>'00000000-0000-0000-0000-000000000000'"); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="_barCode">条码</param> |
| | | /// <param name="_checkResult">结果</param> |
| | | /// <param name="_badReson">原因</param> |
| | | /// <param name="_badDescription">不良描述</param> |
| | | /// <returns></returns> |
| | | private dynamic getObj(string _barCode, string _checkResult, string _badReson = "") |
| | | private dynamic getObj(string _barCode, string _checkResult, string _badDescription = "") |
| | | { |
| | | dynamic _obj = new ExpandoObject(); |
| | | _obj.barCode = _barCode; |
| | |
| | | _obj.processNo = txt_gx.Text.Trim();//工序 |
| | | _obj.banCi = txt_bc.Text.Trim();//班次 |
| | | _obj.gongWei = txt_gw.Text.Trim();//工位 |
| | | _obj.badReson = _badReson.Trim();//不良原因 |
| | | _obj.badDescription = _badDescription.Trim();//不良描述 |
| | | if (txt_gx.Text.Trim() == fGxTouRu) |
| | | { |
| | | return _obj; |
| | | } |
| | | //电检 |
| | | if (txt_gx.Text.Trim() == fGxDianJian) |
| | | { |
| | | string TM = ""; |
| | |
| | | string myStr = File.ReadAllText(dianJianPath, Encoding.Default); |
| | | if (myStr == "") |
| | | { |
| | | return null; |
| | | return _obj; |
| | | } |
| | | |
| | | JArray dsTemp = JArray.Parse(myStr); |
| | | foreach (var ss in dsTemp) //查找某个字段与值 |
| | | { |
| | |
| | | _obj.t009 = JNV; |
| | | _obj.t010 = XLV; |
| | | _obj.t011 = GVV; |
| | | // File.WriteAllText(dianJianPath, ""); |
| | | //正式上线要清空文本数据 |
| | | //File.WriteAllText(dianJianPath, ""); |
| | | return _obj; |
| | | } |
| | | |
| | | //水检 |
| | | if (txt_gx.Text.Trim() == fGxShouJian) |
| | | { |
| | | string strCsl1 = "strCsl1"; |
| | |
| | | // _obj.t012 = SJJG;这个待确定 |
| | | return _obj; |
| | | } |
| | | |
| | | if (txt_gx.Text.Trim() == fGxZhongJian) |
| | | { |
| | | return _obj; |
| | |
| | | /// <summary> |
| | | /// 上报实体 |
| | | /// </summary> |
| | | /// <param name="_checkResult">判定结果</param> |
| | | /// <param name="_badReson">不良原因,可空</param> |
| | | private void addModel(string _checkResult, string _badReson = "") |
| | | /// <param name="_checkResult">结果:√</param> |
| | | /// <param name="_badDescription">不良描述</param> |
| | | private void addModel(string _checkResult, string _badDescription = "") |
| | | { |
| | | string _barCode = txt_barCode.Text.Trim(); |
| | | if (string.IsNullOrEmpty(_barCode)) |
| | |
| | | vm.Show(); |
| | | return; |
| | | } |
| | | dynamic _obj = getObj(_barCode, _checkResult, _badReson); |
| | | if (_obj == null) |
| | | { |
| | | Toast vm = new Toast(-1, "~读取数据失败,请检查设备~"); |
| | | vm.Show(); |
| | | return; |
| | | } |
| | | dynamic _obj = getObj(_barCode, _checkResult, _badDescription); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj)); |
| | |
| | | { |
| | | Toast vm = new Toast((goodTag == "√" ? 1 : -1), _msg); |
| | | vm.Show(); |
| | | }; |
| | | } |
| | | ; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 增加电检取数的列 |
| | | /// 增加电检,水检的列 |
| | | /// </summary> |
| | | public void addColumn() |
| | | { |
| | | //只有电检才显示 |
| | | if (txt_gx.Text.Trim() == fGxDianJian) |
| | | layDianJian.Visibility = LayoutVisibility.Always; |
| | | else |
| | | layDianJian.Visibility = LayoutVisibility.Never; |
| | | //只有水检才显示 |
| | | if (txt_gx.Text.Trim() == fGxShouJian) |
| | | layShuiJian.Visibility = LayoutVisibility.Always; |
| | | else |
| | | layShuiJian.Visibility = LayoutVisibility.Never; |
| | | |
| | | List<dynamic> _lst = new List<dynamic>(); |
| | | if (txt_gx.Text.Trim() == fGxDianJian) |
| | | { |
| | |
| | | kejian = true, |
| | | visibleIndex = 1, |
| | | }); |
| | | |
| | | _lst.Add(new |
| | | { |
| | | ziduan = "t011", |
| | |
| | | kejian = true, |
| | | visibleIndex = 1, |
| | | }); |
| | | |
| | | _lst.Add(new |
| | | { |
| | | ziduan = "t010", |