fqc
lu
2025-04-05 096d3847e5a4cdd0cbc0abee366b3a3470b92e61
DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
@@ -1,5 +1,4 @@
using Gs.DevApp.DevFrm.QC;
using Gs.DevApp.Entity;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
@@ -16,7 +15,7 @@
{
    public partial class Frm_FqcDetect01 : DevExpress.XtraEditors.XtraForm
    {
        string _webServiceName = "MesQaItemsDetect01Manager/";
        string _webServiceName = "FqcManager/";
        List<FilterEntity> _filterList = new List<FilterEntity>();
        public Frm_FqcDetect01()
        {
@@ -24,6 +23,7 @@
            this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
            this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
@@ -44,7 +44,7 @@
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            },lbGuid);
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            txtJianYan.KeyDown += TxtJianYan_KeyDown;
@@ -55,17 +55,26 @@
            btnIpt.Click += BtnIpt_Click;
            txt_suppId.getSuppler("");
            txt_lineId.getSuppler("");
            txt_itemId.Click += (s, e) => {
                var frm = new SelectItem("1");
            txt_itemId.Click += (s, e) =>
            {
                string _lineId = txt_lineId.GetId();
                if (string.IsNullOrEmpty(_lineId))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowInformation("请先选择产线!");
                    return;
                }
                var frm = new SelectFqcItem(_lineId);
                frm.UpdateParent += (ss, ee) =>
                {
                    try
                    {
                        var lst = ee.DynamicList;
                        foreach (dynamic dym in lst)
                        {
                            MessageBox.Show("d");
                        }
                        var lst = new List<dynamic>();
                        lst = ee.DynamicList;
                        txt_itemId.Text = lst[0].itemId;
                        txt_itemModel.Text = lst[0].itemModel;
                        txt_itemName.Text = lst[0].itemName;
                        txt_itemNo.Text = lst[0].itemNo;
                        txt_lotNo.Text = lst[0].gdbh;
                    }
                    catch (Exception ex)
                    {
@@ -74,11 +83,6 @@
                };
                frm.ShowDialog();
            };
        }
        private void Txt_itemId_EditChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }
        /// <summary>
@@ -90,7 +94,7 @@
        private void BtnIpt_Click(object sender, EventArgs e)
        {
            bool bl = btnLoad.Enabled;
            Frm_MesQaItemsDetect01Input frm = new Frm_MesQaItemsDetect01Input(this.lbGuid.Text.Trim(), bl);
            Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input frm = new Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input(this.lbGuid.Text.Trim(), bl);
            frm.ShowDialog();
        }
@@ -326,7 +330,49 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
        }
        /// <summary>
        /// 删除事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
        {
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1, "releaseNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?"))
                return;
            var _obj = new
            {
                guid = rowGuid,
                mxGuid = Guid.Empty.ToString(),
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("",
                    _webServiceName + "DeleteModelOrMx",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 刷新事件
        /// </summary>
@@ -401,27 +447,85 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            if (string.IsNullOrEmpty(txt_remarks.Text.Trim()))
            string _txt_djType = txt_djType.Text.Trim();
            string _txt_checkQty = txt_checkQty.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 = txt_workNo.Text.Trim();
            string _txt_epTag = txt_epTag.Text.Trim();
            string _txt_fzrId = txt_fzrId.GetId();
            string _txt_msg = txt_msg.Text.Trim();
            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();
            if (txt_djType.SelectedIndex<=0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("备注能为空!");
                txt_remarks.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("单据类型不能为空!");
                txt_djType.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_txt_checkQty.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("抽检数量不能为空!");
                txt_checkQty.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_itemId.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("产品不能为空!");
                txt_itemId.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_txt_lotNo.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("工单号不能为空!");
                txt_lotNo.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                fngDesc = "",
                remarks = txt_remarks.Text.Trim(),
                djType = _txt_djType,
                checkQty = _txt_checkQty,
                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
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
                    lbGuid.Text = _rtn.rtnData;
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_releaseNo.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                    this.setEable(false);
@@ -477,7 +581,6 @@
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void getModel(string strGuid, string guid5)
        {
@@ -744,6 +847,6 @@
            btnLoad.Enabled = bl;
            btnIpt.Text = (bl == true ? "录入样本" : "查看样本");
        }
    }
}