bug
lu
7 天以前 ccbe3fad6c7ebb9c1e936163c7f04cb469ff32fc
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -1,4 +1,5 @@
using DevExpress.XtraEditors;
using Gs.DevApp.DevFrm.Work;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -30,9 +31,13 @@
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            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.SetGridViewParameterMx(gvMx2);
@@ -49,7 +54,6 @@
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            //选择库存组织(变明细中的物料和变货主)
            this.txt_qt022.EditChanged += (s, e) =>
            {
@@ -79,55 +83,22 @@
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            };
            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
            this.ucBtnPrint1.btnDesignClick += (s, e) =>
            //选择srm明细
            txt_qt035.ButtonClick += (s, e) =>
            {
                ucBtnPrint1.rptParameter = "rpt_Qtrk{}";
            };
            this.ucBtnPrint1.btnReportClick += (s, e) =>
            {
                ucBtnPrint1.guidKey = "";
                string rowGuid = lbMxGuid.Text.Trim();
                ucBtnPrint1.guidKey = rowGuid;
                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim()))
                string strSrmNo = "";
                SelectDaa frm = new SelectDaa();
                frm.UpdateParent += (ss, ee) =>
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码张数!");
                    txt_iCount_1.Focus();
                    this.ucBtnPrint1.rptParameter = "return false";
                    return;
                }
                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码数量!");
                    txt_psnQty_1.Focus();
                    this.ucBtnPrint1.rptParameter = "return false";
                    return;
                }
                if (lbMxGuid.Text.Trim().Length < 10)
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印的行!");
                    this.ucBtnPrint1.rptParameter = "return false";
                    return;
                }
                this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
                       + "," + ""
                       + "," + Gs.DevApp.ToolBox.UtilityHelper.PrintYuLiang(radOut).ToString()
                       + "," + 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);
            };
            radOut.SelectedIndexChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut);
                    var lst = new List<dynamic>();
                    lst = ee.DynamicList;
                    strSrmNo = lst[0].guid;
                    txt_qt035.Text = strSrmNo;
                };
                frm.ShowDialog();
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -200,7 +171,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("请先选择你要操作的行!");
@@ -302,6 +273,8 @@
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
            ucLookHuoZhu1.Enabled = true;
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_qt022);
        }
        /// <summary>
        /// 保存事件
@@ -354,12 +327,12 @@
                txt_qt009.Focus();
                return;
            }
            if (string.IsNullOrEmpty(kcCk))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!");
                txt_qt008.Focus();
                return;
            }
            //if (string.IsNullOrEmpty(kcCk))
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择收料仓库!");
            //    txt_qt008.Focus();
            //    return;
            //}
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
@@ -372,6 +345,7 @@
                kcfx = kcfx,//库存方向
                hzlx = inHzlx,//货主类型
                inHz = inHz,//货主
                inSource = txt_qt035.EditValue,//工单号
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
@@ -399,6 +373,7 @@
                        ItemId = (row["itemId"].ToString()),
                        Sqsl = (row["qd007"].ToString()),
                        Bz = (row["qd010"].ToString()),
                        Bllb = (row["qd012"].ToString()),
                    });
                }
            }
@@ -469,6 +444,10 @@
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取实体
        /// </summary>
        /// <param name="strGuid"></param>
        private void getModel(string strGuid)
        {
            gcMx1.DataSource = null;
@@ -564,7 +543,11 @@
            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;
@@ -625,7 +608,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>
@@ -640,6 +662,18 @@
                    break;
                case 0:
                    strMsg = "反审核";
                    break;
                      case 30:
                    strMsg = "财务审核";
                    break;
                case 31:
                    strMsg = "财务反审核";
                    break;
                case 40:
                    strMsg = "采购审核";
                    break;
                case 41:
                    strMsg = "采购反审核";
                    break;
            };
            toolBarMenu1.guidKey = "";
@@ -671,9 +705,14 @@
                    {
                        getModel(lbGuid.Text.Trim());
                    }
                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                    //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;
                    UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
                }
            }
            catch (Exception ex)
@@ -681,73 +720,27 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        private void rptBl_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.FocusedRowHandle >= 0)
            {
                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
                lbMxGuid.Text = row["guid"].ToString();
                ucBtnPrint1.guidKey = row["guid"].ToString();
                txtWlid.Text = row["qd002"].ToString();
                txtWlgg.Text = row["qd004"].ToString();
                txtWlmc.Text = row["qd003"].ToString();
                txtQuantity.Text = row["qd007"].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)
        {
            var rowhandle = gvMx2.FocusedRowHandle;
            var rowhandle = gvMx1.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            UcDictionarySelect frm = new UcDictionarySelect("异常描述", "  a.s_type='QC异常描述' and a.pid<>'00000000-0000-0000-0000-000000000000'");
            frm.UpdateParent += (ss, ee) =>
            {
                var dr = gvMx2.GetDataRow(rowhandle);
                var mxGuid = dr["guid"].ToString();
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                    return;
                var _obj = new
                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                var lst = ee.DynamicList;
                foreach (dynamic dym in lst)
                {
                    mxGuid = mxGuid,
                    inType = "dhtm"
                };
                try
                {
                    var strJson = UtilityHelper.HttpPost("",
                        "VArrivalBarcodeManager/DeleteBarcode",
                        JsonConvert.SerializeObject(_obj));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                    }
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                    if (stringBuilder.Length > 0)
                        stringBuilder.Append("|");
                    stringBuilder.Append(dym.dicTxt);
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            }
                gvMx1.SetFocusedRowCellValue("qd012", stringBuilder.ToString());
                // this.TextTxt = ;
            };
            frm.ShowDialog();
        }
    }
}