fqc
lu
2025-04-15 435a9b4afbf9c62c308e8163b7438f2c72e72913
DevApp/Gs.DevApp/DevFrm/FQC/UcChouJianList.cs
@@ -22,7 +22,65 @@
        {
            InitializeComponent();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx14);
            txtChouJian.KeyDown += TxtChouJian_KeyDown;
        }
        private void TxtChouJian_KeyDown(object sender, KeyEventArgs e)
        {
            string _strCmd = txtChouJian.Text.Trim();
            if (e.KeyCode == Keys.Enter)
            {
                if (string.IsNullOrEmpty(_strCmd))
                {
                    ToolBox.MsgHelper.Warning("提示:请先录入条码!");
                    return;
                }
                if (string.IsNullOrEmpty(pGuid))
                {
                    ToolBox.MsgHelper.Warning("提示:请先完善检验单!");
                    return;
                }
                if (e.KeyCode == Keys.Enter)
                {
                    var _obj = new
                    {
                        pGuid = pGuid, //这是检验单guid
                        itemBarCode = _strCmd,//或者0k-19,或者ng-19
                    };
                    try
                    {
                        var strJson = UtilityHelper.HttpPost("",
                            _webServiceName + "EdtModel14",
                            JsonConvert.SerializeObject(_obj));
                        var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                        if (_rtn.rtnCode > 0)
                        {
                            JObject _job = JObject.Parse(strJson);
                            JArray array = new JArray();
                            foreach (var a in _job["rtnData"]["list"])
                            {
                                array.Add(a);
                            }
                            DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
                            gcMx14.BindingContext = new BindingContext();
                            gcMx14.DataSource = dt;
                            gcMx14.ForceInitialize();
                            gvMx14.BestFitColumns();
                        }
                        else
                        {
                            Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
                        }
                        txtChouJian.Text = "";
                    }
                    catch (Exception ex)
                    {
                        MsgHelper.Warning("提示:" + ex.Message);
                    }
                }
            }
        }
        private string _val;
        public string pGuid
        {