lu
2025-04-14 ecb7a60de1639f520712ce95f99414b0dd2c9713
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -7,8 +7,8 @@
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.QC
@@ -25,42 +25,39 @@
            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            this.toolBarMenu1.btnZhiLiangChkClick += ToolBarMenu1_btnZhiLiangChkClick;
            this.toolBarMenu1.btnZhiLiangFchkClick += ToolBarMenu1_btnZhiLiangFchkClick;
            this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
            this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
            this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnZhiLiangChkClick;
            this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnZhiLiangFchkClick;
            this.toolBarMenu1.btnBoHuiClick += ToolBarMenu1_btnBoHuiClick;
            toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
            toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
            gcMx1.MouseClick += GcMx1_MouseClick;
            getPageList(1, UtilityHelper.GetPageSize());
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx4);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modifyFlagTxt", "", (value) =>
           {
               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
           }, tips);
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            gridView1.CustomDrawRowIndicator += (s, e) =>
            {
                if (e.Info.IsRowIndicator && e.RowHandle >= 0)
                {
                    e.Info.DisplayText = (e.RowHandle + 1).ToString();
                }
            };
            gridView1.CustomDrawEmptyForeground += (s, e) =>
            {
                string str = "暂未查找到匹配的数据!";
                Font f = new Font("微软雅黑", 16);
                Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                e.Graphics.DrawString(str, f, Brushes.Gray, r);
            };
            //初始化物料选择和各种下拉
            gvMx2.OptionsFind.ShowSearchNavButtons = false;
            gvMx2.OptionsView.ShowGroupPanel = false;
            gvMx3.OptionsFind.ShowSearchNavButtons = false;
            gvMx3.OptionsView.ShowGroupPanel = false;
            txt_itemId.EditChanged += (s, e) =>
            {
                txt_itemModel.Text = this.txt_itemId.GetModel();
                txt_itemNo.Text = this.txt_itemId.GetCode();
            };
            ucUpFile1.UpChanged += UcUpFile1_UpChanged;
            xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
        private void GcMx1_MouseClick(object sender, MouseEventArgs e)
        {
@@ -69,16 +66,16 @@
                return;
            getList12(rowGuid);
        }
        /// <summary>
        /// 双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
            if (!string.IsNullOrEmpty(rowGuid))
                getModel(rowGuid, false, 999);
            if (e.FocusedRowHandle >= 0)
            {
                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
                string rowGuid = row["guid"].ToString();
                if (string.IsNullOrEmpty(rowGuid))
                    return;
                getList12(rowGuid);
            }
        }
        /// <summary>
        /// 分页事件
@@ -87,7 +84,7 @@
        /// <param name="pageSize"></param>
        private void PageBar1_PagerEvent(int curPage, int pageSize)
        {
            getPageList(curPage, pageSize);
            getPageList(curPage);
        }
        /// <summary>
        /// 查询事件
@@ -96,7 +93,10 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
        {
            Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList);
            gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
            gridView1.ActiveFilter.Clear();
            gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
            frm.UpdateParent += Frm_UpdateParent;
            frm.ShowDialog();
        }
@@ -108,7 +108,7 @@
        private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
        {
            _filterList = e.FilterList;
            getPageList(1, pageBar1.RowsCount);
            getPageList(1);
        }
        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
        {
@@ -125,7 +125,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 0);
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
        }
        /// <summary>
        /// 保存事件
@@ -134,24 +134,63 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            if (string.IsNullOrEmpty(txt_fngHandle.Text.Trim()))
            if (txt_freceQty.SelectedIndex <= 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择处理方式!");
                txt_fngDesc.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择判定结果!");
                txt_freceQty.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_fmrmode.Text.Trim()))
            if (txt_freceQty.SelectedIndex == 1)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择退料方式!");
                txt_fmrmode.Focus();
                return;
                if ((txt_fmrmode.SelectedIndex > 0) || txt_fngHandle.SelectedIndex > 0)
                {
                    Gs.DevApp.ToolBox.MsgHelper.Warning("你判定了合格,就不能再选择其它处理方式了!");
                    txt_fmrmode.Focus();
                    return;
                }
            }
            else
            {
                //当选择不合格时,要填写原因
                if (txt_freceQty.SelectedIndex == 2)
                {
                    if ((txt_fngHandle.SelectedIndex <= 0))
                    {
                        Gs.DevApp.ToolBox.MsgHelper.Warning("请选择处理结果!");
                        txt_fngHandle.Focus();
                        return;
                    }
                    if (txt_fngHandle.SelectedIndex == 1)
                    {
                        if ((txt_fmrmode.SelectedIndex <= 0))
                        {
                            Gs.DevApp.ToolBox.MsgHelper.Warning("请选择退料方式!");
                            txt_fmrmode.Focus();
                            return;
                        }
                    }
                    else
                    {
                        if ((txt_fmrmode.SelectedIndex > 0))
                        {
                            Gs.DevApp.ToolBox.MsgHelper.Warning("你选择了特采使用,就不能再选择退料方式了!");
                            txt_fmrmode.Focus();
                            return;
                        }
                    }
                }
            }
            string _fmrmode = txt_fmrmode.SelectedIndex > 0 ? txt_fmrmode.Text.Trim() : "";
            string _freceQty = txt_freceQty.SelectedIndex > 0 ? txt_freceQty.Text.Trim() : "";
            string _fngHandle = txt_fngHandle.SelectedIndex > 0 ? txt_fngHandle.Text.Trim() : "";
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                fngHandle = txt_fngHandle.Text.Trim(),
                fmrmode = txt_fmrmode.Text.Trim(),
                freceQty = _freceQty,
                fngHandle = _fngHandle,
                fmrmode = _fmrmode,
            };
            try
            {
@@ -162,7 +201,9 @@
                {
                    lbGuid.Text = _rtn.rtnData;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
            }
            catch (Exception ex)
@@ -178,15 +219,49 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
        {
            toolBarMenu1.currentAction = "edit";
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            getModel(rowGuid, true, 1);
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(rowGuid);
            }
            else
            {
                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                gvList.Add(gvMx1);
                gvList.Add(gvMx2);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
        }
        private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_itemName, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            toolBarMenu1.rptParameter = "rpt_Detect01{}";
        }
        private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_itemName, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            this.toolBarMenu1.rptParameter = "rpt_Detect01{" + "1"
                   + "," + "1"
                   + "," + "1"
                   + "," + "1"
                   + "," + "1"
                   + "}";
        }
        /// <summary>
        /// 驳回
        /// </summary>
@@ -195,102 +270,7 @@
        private void ToolBarMenu1_btnBoHuiClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定要驳回吗?"))
                return;
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit13",
                    JsonConvert.SerializeObject(rowGuid));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 采购反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定要采购反审核吗?"))
                return;
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit12",
                    JsonConvert.SerializeObject(rowGuid));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 采购审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定要采购审核吗?"))
                return;
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcCGAudit",
                    JsonConvert.SerializeObject(rowGuid));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
            _toolCk(-1);
        }
        /// <summary>
        /// 质量反审核
@@ -299,33 +279,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnZhiLiangFchkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量审核吗?"))
                return;
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit11",
                    JsonConvert.SerializeObject(rowGuid));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
            _toolCk(0);
        }
        /// <summary>
        /// 质量审核
@@ -334,33 +288,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量审核吗?"))
                return;
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit",
                    JsonConvert.SerializeObject(rowGuid));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
            _toolCk(1);
        }
        /// <summary>
@@ -371,9 +299,19 @@
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            if (xtraTabControl1.SelectedTabPageIndex == 1)
                getModel(lbGuid.Text.Trim(), false, 999);
                getModel(lbGuid.Text.Trim());
            else
                getPageList(1, UtilityHelper.GetPageSize());
            {
                //_filterList.Clear();
                //if (gridView1.ActiveFilter.Count > 0)
                //{
                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                //    gridView1.ActiveFilter.Clear();
                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                //}
                //getPageList(1);
                getPageList(this.pageBar1.CurrentPage);
            }
        }
        /// <summary>
@@ -381,32 +319,33 @@
        /// </summary>
        /// <param name="curPage">第几页</param>
        /// <param name="pageSize">每页几条</param>
        private async void getPageList(int curPage, int pageSize)
        private void getPageList(int curPage)
        {
            UcLoading _loading = new UcLoading();
            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
            foreach (FilterEntity itm in _filterList)
            {
                _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'");
            }
            PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", "", _sbSqlWhere.ToString());
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            _sbSqlWhere += " and isnull(fsubmit,0)=1";
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
            {
                string strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json);
                string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
                ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMain.BindingContext = new BindingContext();
                    gcMain.DataSource = dt;
                    gcMain.ForceInitialize();
                    int dddd = dd.rtnData.pages;//总页
                    pageBar1.TotalPages = dddd;
                    pageBar1.RecordCount = dd.rtnData.total;//记录总数
                    gcMain1.BindingContext = new BindingContext();
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    if (dt.Rows.Count > 0)
                    {
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
                    pageBar1.RowsCount = pageSize;//每页显示
                    pageBar1.setTxt();
                    pageBar1.RecordCount = dd.rtnData.total;//总记录数
                }
                else
                {
@@ -417,24 +356,25 @@
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
            _loading.Stop();
        }
        private async void getModel(string strGuid, bool isEdit, int tabIdx)
        private void getModel(string strGuid)
        {
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
            UcLoading _loading = new UcLoading();
            var _obj = new
            {
                guid = strGuid,//主建
            };
            try
            {
                string strJson = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
@@ -442,7 +382,7 @@
                    lbGuid.Text = strGuid;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list5"])
@@ -455,6 +395,7 @@
                        gcMx1.BindingContext = new BindingContext();
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                        ucUpFile1.parentGuid = lbGuid.Text.Trim();
                        getList12(dt.Rows[0]["guid"].ToString());
                    }
@@ -470,7 +411,7 @@
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
            _loading.Stop();
        }
        /// <summary>
        /// 选项卡切换
@@ -479,7 +420,7 @@
        /// <param name="e"></param>
        private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
        {
            if (e.Page.Name == "tabMxPage3")
            if (e.Page.Name == "tabMxPage2")
            {
                getFileList();
            }
@@ -506,9 +447,9 @@
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMx3.BindingContext = new BindingContext();
                    gcMx3.DataSource = dt;
                    gcMx3.ForceInitialize();
                    gcMx4.BindingContext = new BindingContext();
                    gcMx4.DataSource = dt;
                    gcMx4.ForceInitialize();
                }
                else
                {
@@ -524,9 +465,8 @@
        /// 根据检验项目读取抽样结果 
        /// </summary>
        /// <param name="guid5"></param>
        private async void getList12(string guid5)
        private void getList12(string guid5)
        {
            UcLoading _loading = new UcLoading();
            var _obj = new
            {
                parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
@@ -534,27 +474,47 @@
            };
            try
            {
                var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
                var dd = UtilityHelper.ReturnToList(strReturn);
                var dt = dd.rtnData;
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
                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());
                gcMx2.BindingContext = new BindingContext();
                gcMx2.DataSource = dt;
                gcMx2.ForceInitialize();
                gvMx2.BestFitColumns();
                JArray array1 = new JArray();
                foreach (var a in _job["rtnData"]["list2"])
                {
                    array1.Add(a);
                }
                DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
                gcMx4.BindingContext = new BindingContext();
                gcMx4.DataSource = dt1;
                gcMx4.ForceInitialize();
                gvMx4.BestFitColumns();
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
            _loading.Stop();
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var rowhandle = gvMx3.FocusedRowHandle;
            var rowhandle = gvMx4.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            {
                var dr = gvMx3.GetDataRow(rowhandle);
                var dr = gvMx4.GetDataRow(rowhandle);
                var mxGuid = dr["guid"].ToString();
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                    return;
@@ -566,7 +526,7 @@
                    strJson = UtilityHelper.HttpPost("", "MesFile/DeleteModel",
                        JsonConvert.SerializeObject(lst));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0) gvMx3.DeleteRow(rowhandle);
                    if (_rtn.rtnCode > 0) gvMx4.DeleteRow(rowhandle);
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
@@ -575,16 +535,21 @@
                }
            }
        }
        /// <summary>
        /// 浏览
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var rowhandle = gvMx3.FocusedRowHandle;
            var rowhandle = gvMx4.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            {
                try
                {
                    var dr = gvMx3.GetDataRow(rowhandle);
                    var dr = gvMx4.GetDataRow(rowhandle);
                    var urlPath = dr["urlPath"].ToString();
                    Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath);
                    frm.ShowDialog();
@@ -593,20 +558,23 @@
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
                }
            }
        }
        /// <summary>
        /// 下载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var rowhandle = gvMx3.FocusedRowHandle;
            var rowhandle = gvMx4.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            {
                try
                {
                    var dr = gvMx3.GetDataRow(rowhandle);
                    var dr = gvMx4.GetDataRow(rowhandle);
                    var urlPath = dr["urlPath"].ToString();
                    using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
                    {
@@ -629,9 +597,88 @@
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
                }
            }
        }
        /// <summary>
        /// 工具条事件
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolCk(int _inFieldValue)
        {
            string strMsg = "";
            switch (_inFieldValue)
            {
                case 1:
                    strMsg = "审核";
                    break;
                case 0:
                    strMsg = "反审核";
                    break;
                case -1:
                    strMsg = "驳回";
                    break;
            };
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            if (_inFieldValue == 1)
            {
                if (txt_fcheckResu.Text == "不合格")
                {
                    if (txt_fngHandle.Text.Trim().Length == 0)
                    {
                        MsgHelper.Warning("单据为不合格时请选择处理方式!");
                        return;
                    }
                }
            }
            var _obj = new
            {
                guid = rowGuid,
                inFieldValue = _inFieldValue,
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("",
                    _webServiceName + "EditModelSubmitZhiLiang",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (_inFieldValue >= 0)
                    {
                        if (xtraTabControl1.SelectedTabPageIndex == 1)
                        {
                            getModel(lbGuid.Text.Trim());
                        }
                        int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                        gridView1.FocusedRowHandle = rowHandle;
                        UtilityHelper.SetCheckIco(gridView1, "modifyFlagTxt", "modify1By", "modify1Date", picCheckBox, this, _inFieldValue.ToString());
                    }
                    else
                    {
                        //if (xtraTabControl1.SelectedTabPageIndex == 1)
                        //    getModel(lbGuid.Text.Trim());
                        //else
                        //    getPageList(this.pageBar1.CurrentPage);
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
                        getPageList(this.pageBar1.CurrentPage);
                    }
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}