lu
2025-06-06 33e40a739ef06ee82f6c1869ce4f5088b57ed769
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -1,5 +1,4 @@
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Base.ViewInfo;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -10,14 +9,17 @@
using System.Data;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
{
    public partial class Frm_MesItemQtrk : DevExpress.XtraEditors.XtraForm
    {
        string _webServiceName = "MesItemQtrkManager/";
        List<FilterEntity> _filterList = new List<FilterEntity>();
        string _ucGys = "";//供应商
        string _ucBm = "";//领料部门
        string _ucCk = "";//发料仓库
        string _ucHzlx = "";//货主类型
        string _ucHz = "";//货主
        public Frm_MesItemQtrk()
        {
            InitializeComponent();
@@ -28,54 +30,59 @@
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            this.toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
            this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
            this.toolBarMenu1.btnCaiWuChkClick += ToolBarMenu1_btnCaiWuChkClick;
            this.toolBarMenu1.btnCaiWuFchkClick += ToolBarMenu1_btnCaiWuFchkClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) =>
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (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;
            txt_qt011.getSuppler("");
            txt_qt018.getSuppler("");
            //设置仓库选择
            this.txt_qt011.EditChanged += (s, e) =>
            {
            //选择库存组织(变明细中的物料和变货主)
            this.txt_qt022.EditChanged += (s, e) =>
            {
                string _orgId = txt_qt022.GetId();
                if (string.IsNullOrEmpty(_orgId))
                    return;
                ucLookHuoZhu1.OrgId = _orgId;
                ucLookHuoZhu1.HzId = _ucHz;
                ucLookHuoZhu1.SetHzLx(_ucHzlx);
                txt_qt009.getSuppler(_orgId, _ucBm);
                txt_qt018.getSuppler(_orgId, _ucGys);
                txt_qt008.getSuppler(_orgId, _ucCk);
                System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
                sbWhere.Append(" and a.FSubsidiary ='" + _orgId + "'");
                var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
                var json = JsonConvert.SerializeObject(_obj);
                try
                {
                    var strReturn = UtilityHelper.HttpPost("",
                        "MesItemsManager/GetListSelect", json);
                    var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                    var dt = rtn.rtnData.list;
                    this.repositoryItemSearchLookUpEdit1.DataSource = dt;
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            };
            //设置供应商选择
            this.txt_qt018.EditChanged += (s, e) =>
            {
            };
            var _obj = new
            {
                currentPage = 1,
                everyPageSize = 999999,
                sortName = "",
                keyWhere = "",
            };
            var json = JsonConvert.SerializeObject(_obj);
            try
            {
                var strReturn = UtilityHelper.HttpPost("",
                    "MesItemsManager/GetListSelect", json);
                var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                var dt = rtn.rtnData.list;
                this.repositoryItemSearchLookUpEdit1.DataSource = dt;
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
            this.ucBtnPrint1.btnDesignClick += (s, e) =>
            {
@@ -86,14 +93,14 @@
                ucBtnPrint1.guidKey = "";
                string rowGuid = lbMxGuid.Text.Trim();
                ucBtnPrint1.guidKey = rowGuid;
                if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim()))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码张数!");
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请输入正确的条码数量!");
                    txt_iCount_1.Focus();
                    this.ucBtnPrint1.rptParameter = "return false";
                    return;
                }
                if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码数量!");
                    txt_psnQty_1.Focus();
@@ -108,18 +115,42 @@
                }
                this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
                       + "," + ""
                       + "," + ""
                       + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
                       + "," + txt_iCount_1.Text.Trim()
                       + "," + txt_psnQty_1.Text.Trim()
                       + "}";
            };
            //自动计算打印量
            txt_psnQty_1.TextChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
            };
            radOut.SelectedIndexChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
        /// <summary>
        /// 日志
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_qtck, gridView1);
            toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
@@ -141,7 +172,7 @@
            gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
            gridView1.ActiveFilter.Clear();
            gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
            var frm = new ShowFilter(gridView1.Columns, _filterList);
            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
            frm.UpdateParent += Frm_UpdateParent;
            frm.ShowDialog();
        }
@@ -174,7 +205,7 @@
        {
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_qtck, gridView1, "qtck");
                lbGuid, txt_qtck, gridView1,"qtck");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
@@ -196,11 +227,11 @@
                if (_rtn.rtnCode > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                        getPageList(this.pageBar1.CurrentPage);
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
@@ -220,14 +251,15 @@
                getModel(lbGuid.Text.Trim());
            else
            {
                _filterList.Clear();
                if (gridView1.ActiveFilter.Count > 0)
                {
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    gridView1.ActiveFilter.Clear();
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                }
                getPageList(1);
                //_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>
@@ -246,7 +278,18 @@
                return;
            }
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
            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);
                ucLookHuoZhu1.Enabled = true;
            }
        }
        /// <summary>
        /// 新增事件
@@ -259,8 +302,11 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
            gridViews.Add(gvMx2);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
            ucLookHuoZhu1.Enabled = true;
        }
        /// <summary>
        /// 保存事件
@@ -270,32 +316,67 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            string inGys = txt_qt018.GetId();
            string inCjId = txt_qt011.GetId();
            if (string.IsNullOrEmpty(inGys))
            string kcZz = txt_qt022.GetId();//库存组织
            string kcBm = txt_qt009.GetId();//库存部门
            string kcGys = txt_qt018.GetId();//库存供应商
            string djLx = txt_qt003.TextTxt.Trim();//单据类型
            string kcfx = txt_qt019.Text.Trim();//库存方向
            string inHzlx = ucLookHuoZhu1.GetHzLx();//货主类型
            string inHz = ucLookHuoZhu1.GetHzId();//货主
            string inRkyy = txt_qt010.Text.Trim();//入库原因
            string kcCk = txt_qt008.GetId();//仓库
            if (string.IsNullOrEmpty(kcZz))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择供应商!");
                txt_qt018.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择库存组织!");
                txt_qt022.Focus();
                return;
            }
            if (string.IsNullOrEmpty(inCjId))
            if (string.IsNullOrEmpty(inHzlx))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择仓库!");
                txt_qt011.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择货主类型!");
                return;
            }
            if (string.IsNullOrEmpty(inHz))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择货主!");
                return;
            }
            if (txt_qt003.TextTxt.Length < 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!");
                txt_qt003.Focus();
                return;
            }
            if (txt_qt019.SelectedIndex <= 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择库存方向!");
                txt_qt019.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcBm) && string.IsNullOrEmpty(kcGys))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("部门或供应商必须选一个!");
                txt_qt009.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcCk))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!");
                txt_qt008.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                inRklb = txt_qt003.Text.Trim(),//备注
                inYwlx = txt_qt004.Text.Trim(),//业务类型
                inRkfs = txt_qt019.Text.Trim(),//入库方式
                inRklx = txt_qt020.Text.Trim(),//入库类型
                inGys = inGys,//供应商
                inCjId = inCjId,//入库仓库
                inDepart = txt_qt009.GetId(),//申请部门
                inXsdh = txt_qt021.Text.Trim(),//销售单号
                inRkyy = txt_qt010.Text.Trim(),//入库原因
                kcZz = kcZz,//库存组织
                kcBm = kcBm,//库存部门
                kcGys = kcGys,//库存供应商
                kcCk = kcCk,//库存仓库
                inRkyy = inRkyy,//入库原因
                djLx = djLx,//单据类型
                kcfx = kcfx,//库存方向
                hzlx = inHzlx,//货主类型
                inHz = inHz,//货主
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
@@ -333,9 +414,16 @@
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
                    lbGuid.Text = _rtn.rtnData;
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_qtck.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
                    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, false, gvList);
                    ucLookHuoZhu1.Enabled = false;
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
            }
            catch (Exception ex)
@@ -351,8 +439,7 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
@@ -362,15 +449,16 @@
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMain.BindingContext = new BindingContext();
                    gcMain1.BindingContext = new BindingContext();
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    if (dt.Rows.Count > 0)
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
@@ -385,10 +473,14 @@
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取实体
        /// </summary>
        /// <param name="strGuid"></param>
        private void getModel(string strGuid)
        {
            gcMx1.DataSource = null;
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -408,10 +500,22 @@
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    _ucGys = dy.qt018;
                    _ucBm = dy.qt009;
                    _ucCk = dy.qt008;
                    _ucHzlx = dy.qt023;
                    _ucHz = dy.qt024;
                    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);
                    gvList.Add(gvMx2);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucGys = "";
                    _ucBm = "";
                    _ucCk = "";
                    _ucHzlx = "";
                    _ucHz = "";
                    ucLookHuoZhu1.Enabled = isEdit;
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list"])
@@ -424,10 +528,30 @@
                        gcMx1.BindingContext = new BindingContext();
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                    }
                    JArray array2 = new JArray();
                    foreach (var a in _job["rtnData"]["list2"])
                    {
                        array2.Add(a);
                    }
                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
                    if (dt2.Rows.Count > 0)
                    {
                        gcMx2.BindingContext = new BindingContext();
                        gcMx2.DataSource = dt2;
                        gcMx2.ForceInitialize();
                        gvMx2.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
                    }
                }
                else
@@ -446,9 +570,14 @@
            gvMx1.SetFocusedRowCellValue("qd002", SelectedDataRow["itemNo"]);
            gvMx1.SetFocusedRowCellValue("qd003", SelectedDataRow["itemName"]);
            gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]);
            gvMx1.SetFocusedRowCellValue("qd009", SelectedDataRow["dwName"]);
            gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]);
            gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]);
        }
        /// <summary>
        /// 移出明细
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var rowhandle = gvMx1.FocusedRowHandle;
@@ -509,7 +638,46 @@
        {
            _toolCk(0);
        }
        /// <summary>
        /// 财务审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnCaiWuChkClick(object sender, EventArgs e)
        {
            _toolCk(30);
        }
        /// <summary>
        /// 财务反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnCaiWuFchkClick(object sender, EventArgs e)
        {
            _toolCk(31);
        }
        /// <summary>
        /// 采购审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
        {
            _toolCk(40);
        }
        /// <summary>
        /// 采购反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
        {
            _toolCk(41);
        }
        /// <summary>
        /// 工具条事件
        /// </summary>
@@ -525,6 +693,18 @@
                case 0:
                    strMsg = "反审核";
                    break;
                      case 30:
                    strMsg = "财务审核";
                    break;
                case 31:
                    strMsg = "财务反审核";
                    break;
                case 40:
                    strMsg = "采购审核";
                    break;
                case 41:
                    strMsg = "采购反审核";
                    break;
            };
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
@@ -537,7 +717,6 @@
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            var _obj = new
            {
                guid = rowGuid,
@@ -550,43 +729,65 @@
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0)
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        getModel(lbGuid.Text.Trim());
                    else
                        getPageList(1);
                    }
                    //int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                    //gridView1.FocusedRowHandle = rowHandle;
                    //UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
                    //注意,这里和其它页面有点不一样
                    getPageList(this.pageBar1.CurrentPage);
                    int rowHandle = gridView1.LocateByValue("guid", rowGuid);
                    gridView1.FocusedRowHandle = rowHandle;
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle >= 0)
            {
                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
                lbMxGuid.Text = row["guid"].ToString();
                ucBtnPrint1.guidKey = row["guid"].ToString();
                txtWlid.Text = row["itemId"].ToString();
                txtWlid.Text = row["qd002"].ToString();
                txtWlgg.Text = row["qd004"].ToString();
                txtWlmc.Text = row["qd003"].ToString();
                txtQuantity.Text = row["qd007"].ToString();//申请总量
                txtYdy.Text = row["YDYNUM"].ToString();//已打印总量
                kyPrtQty.Text = row["KDYNUM"].ToString();//可打印总量
                txt_yQty.Text = row["ydy"].ToString();//已打印总量
                txt_kQty.Text = row["kdy"].ToString();//可打印总量
            }
            else
            {
                lbMxGuid.Text = "";
                ucBtnPrint1.guidKey = "";
                txtWlid.Text = "";
                txtWlgg.Text = "";
                txtWlmc.Text = "";
                txtQuantity.Text = "";
                txt_yQty.Text = "";
                txt_kQty.Text = "";
                txt_psnQty_1.Text = "";
                txt_iCount_1.Text = "";
            }
        }
        /// <summary>
        /// 移出条码
        /// 重打条码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            MsgHelper.ShowInformation("功能开发中!");
            return;
            var rowhandle = gvMx2.FocusedRowHandle;
            if (rowhandle < 0)
                return;
@@ -604,7 +805,7 @@
                try
                {
                    var strJson = UtilityHelper.HttpPost("",
                        _webServiceName + "DeleteBarcode",
                        "VArrivalBarcodeManager/DeleteBarcode",
                        JsonConvert.SerializeObject(_obj));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
@@ -619,7 +820,5 @@
                }
            }
        }
    }
}