fqc
lu
2025-04-09 e06c6fad5e892a4ea2a15d1181c5705c6dc560f7
DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
@@ -1,4 +1,5 @@
using Gs.DevApp.Entity;
using Gs.DevApp.DevFrm.Work;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
@@ -79,8 +80,10 @@
                };
                frm.ShowDialog();
            };
            // 读取缺陷等级
            getRptDefectLevel();
        }
        /// <summary>
        /// 批量录入
        /// </summary>
@@ -500,8 +503,38 @@
                fmanageNo = _txt_fmanageNo,//流程编号
                lotNo1 = _txt_lotNo1,//送检批号
                lotNo = _txt_lotNo,//生产工单
                edtType = 0
                edtType = 0,
                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();
                    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));
@@ -516,7 +549,7 @@
                    this.setEable(false);
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                    getModel(lbGuid.Text,"0");
                    getModel(lbGuid.Text, "0");
                }
            }
            catch (Exception ex)
@@ -685,12 +718,66 @@
                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();
        }
    }
}