lu
2025-05-15 fa43bc9d26c7b9ec2b07e2d3e1a7f07abe68da5b
DevApp/Gs.DevApp/DevFrm/QC/Jyxm.cs
@@ -18,6 +18,7 @@
    public partial class Jyxm : DevExpress.XtraEditors.XtraUserControl
    {
        private List<FilterEntity> _filterList = new List<FilterEntity>();
        string _ucItem = "";//物料
        private readonly string _webServiceName = "MesQmCheckitemManager/";
        public string strType = "";//iqc type
        public decimal dfValue = 1;  //iqc的样品数量默认5,否则1
@@ -39,15 +40,23 @@
            toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.xlsInService = "XlsInItemJyxm&"+ strType;
            //类型,iqc,ipqc巡检,ipqc首检查,fqc,iqc的样品值默认为5,其它为1
            txt_ftype.Text = strType;
            if (strType == "iqc")
                dfValue = 5;
            this.gvMx1.InitNewRow += (s, e) =>
            //如果是ipqc巡检,显示工位
            if (strType != "ipqc巡检")
            {
                this.gvMx1.SetRowCellValue(e.RowHandle, "ypsl", dfValue);
                int newIndex = gvMx1.DataRowCount + 1;
                this.gvMx1.SetRowCellValue(e.RowHandle, "forder", newIndex);
            };
                gvMx1.Columns["stationName"].Visible = false;
            }
            //新行初始值
            this.gvMx1.InitNewRow += (s, e) =>
        {
            this.gvMx1.SetRowCellValue(e.RowHandle, "ypsl", dfValue);
            int newIndex = gvMx1.DataRowCount + 1;
            this.gvMx1.SetRowCellValue(e.RowHandle, "forder", newIndex);
        };
            this.toolBarMenu1.getXmlConfig();
            Form parentForm = this.FindForm();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
@@ -70,6 +79,11 @@
                if ((lbGuid.Text.Trim().Length < 10))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowInformation("请先保存当前信息!");
                    return;
                }
                if ((txt_foneChecked.Checked == false))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该项目未审核,暂不能复制到其它物料!");
                    return;
                }
                JyxmShow frm = new JyxmShow(lbGuid.Text.Trim(), strType);
@@ -238,6 +252,13 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            string _orgId = txt_fSubsidiary.GetId();
            if (string.IsNullOrEmpty(_orgId))
            {
                MsgHelper.Warning("请选择使用组织!");
                txt_fSubsidiary.Focus();
                return;
            }
            string _ItemId = txt_itemId.GetId();
            if (string.IsNullOrEmpty(_ItemId))
            {
@@ -338,6 +359,7 @@
                            FupAllow = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["FupAllow"].ToString()),
                            FdownAllow = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["FdownAllow"].ToString()),
                            ypsl = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(row["ypsl"].ToString()),
                            stationName = row["stationName"].ToString(),
                        });
                    }
                }
@@ -428,7 +450,10 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取实体
        /// </summary>
        /// <param name="strGuid"></param>
        private void getModel(string strGuid)
        {
            bool isEdit = false;
@@ -453,11 +478,12 @@
                if (_rtn.rtnCode > 0)
                {
                    var dy = _rtn.rtnData;
                    _ucItem = dy.itemId;
                    lbGuid.Text = strGuid;
                    var gvList = new List<GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy,
                        isEdit, gvList);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucItem = "";
                    var _job = JObject.Parse(strJson);
                    var array = new JArray();
                    foreach (var a in _job["rtnData"]["list"]) array.Add(a);
@@ -528,7 +554,7 @@
                    _webServiceName + "EditModelSubmit",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_inFieldValue < 0 && _rtn.rtnCode > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
@@ -565,9 +591,7 @@
                string _orgId = txt_fSubsidiary.GetId();
                if (string.IsNullOrEmpty(_orgId))
                    return;
                txt_itemId.getSuppler(_orgId);
                //txt_gg.Text ="";
                //txt_itemNo.Text = "";
                txt_itemId.getSuppler(_orgId, _ucItem, " ", strType);
            };
            txt_itemId.EditChanged += (s, e) =>
            {
@@ -581,6 +605,7 @@
            _getListJybz();
            _getListJssp();
            _getListJysp();
            _getListStation();
        }
        /// <summary>
        /// 读取检验项目
@@ -603,7 +628,32 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取检验工位
        /// </summary>
        private void _getListStation()
        {
            string _where = " and 1=1 and s_type='工位信息' and  pid<>'00000000-0000-0000-0000-000000000000'";
            var pgq = new PageQueryModel(1, 999999, "a.defect_name", "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)
                {
                    //tlMenu.KeyFieldName = "guid";
                    //tlMenu.ParentFieldName = "pid";
                    rptStation.Items.Add(dr["defectName"].ToString());
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取检验工具
        /// </summary>
@@ -658,8 +708,8 @@
        {
            rptJSSP.Items.AddRange(new string[] {
                "0.010---(AQL_0_0010)"
                , "0.015---(AQL_0_0015)"
                , "0.025---(AQL_0_0025)"
                ,"0.015---(AQL_0_0015)"
                ,"0.025---(AQL_0_0025)"
                ,"0.040---(AQL_0_0040)"
                ,"0.065---(AQL_0_0065)"
                ,"0.10---(AQL_0_010)"
@@ -710,6 +760,11 @@
                gvMx1.SetRowCellValue(dataIndex, "sampleSizeName", _txt);
            }
        }
        /// <summary>
        /// 移出明细
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            gvMx1.CloseEditor();