huawei
2025-12-04 ff3f7a81758be6c7df5be8d1b2e10a645c7d4ebd
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
@@ -1,4 +1,5 @@
using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.Native;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -32,6 +33,8 @@
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnShouHouChkClick += ToolBarMenu1_btnShouHouChkClick;
            toolBarMenu1.btnShouHouFchkClick += ToolBarMenu1_btnShouHouFchkClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "chkStatus", "", (value) =>
@@ -47,7 +50,7 @@
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            //设置申请组织
            //设置申请组织
            this.txt_fapporgid.EditChanged += (s, e) =>
            {
                string _sqGuid = txt_fapporgid.GetId();
@@ -68,7 +71,7 @@
                }
                catch (Exception ex)
                {
                    MsgHelper.ShowError("提示:" + ex.Message);
                    MsgHelper.ShowError("提示:" + ex.Message);
                }
            };
@@ -87,20 +90,20 @@
                gvMx1.SetFocusedRowCellValue("dcHzGuid", _orgId);
            };
            #region 2025-08-27 复制beg
            #region 2025-08-27 复制beg
            btnCopyXls.Click += (s, e) =>
            {
                string kcZz = txt_fapporgid.GetId();
                if (string.IsNullOrEmpty(kcZz))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能使用复制功能!");
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能使用复制功能!");
                    txt_fapporgid.Focus();
                    return;
                }
                string filePath = AppContext.BaseDirectory + "xlsCopy.xls";
                if (File.Exists(filePath))
                {
                    var frm = new CopyXls(kcZz, lbGuid.Text.Trim(), OrderType.物料调拨.ToString());
                    var frm = new CopyXls(kcZz, lbGuid.Text.Trim(), OrderType.物料调拨.ToString());
                    frm.UpdateParent += (ss, ee) =>
                    {
                        try
@@ -149,23 +152,50 @@
                }
                else
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("找不到xlsCopy.xls文件,请联系管理员!");
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("找不到xlsCopy.xls文件,请联系管理员!");
                }
            };
            #endregion
            #region 2025-10-17 选择生产/委外订单
            #region 2025-10-17 选择生产/委外订单
            btnSelect.Click += (s, e) =>
            {
                string kcZz = txt_fapporgid.GetId();
                if (string.IsNullOrEmpty(kcZz))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能选择生产订单!");
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能选择生产订单!");
                    txt_fapporgid.Focus();
                    return;
                }
                var frm = new SelectSqmx();
                //赋值给明细表
                // 根据当前申请类型判断应该打开哪个类型的弹窗
                string selectedValue = txt_fBillTypeID.EditValue?.ToString();
                string defaultType = "1"; // 默认生产
                if (!string.IsNullOrEmpty(selectedValue) && selectedValue.Contains("委外"))
                {
                    defaultType = "2"; // 委外
                }
                SetComboBoxValue(txt_fBillTypeID, "生产调拨申请单(DBSQD03_SC)");
                var frm = new SelectSqmx(defaultType);
                 //var frm = new SelectSqmx();
                // 监听选择类型变化事件,同步更新申请类型
                frm.SelectionTypeChanged += (ss, ee) =>
                {
                    string workId = ee.Data; // 1是生产,2是委外
                                             // 生产订单,设置对应的申请类型
                    if (workId == "1")
                    {
                        SetComboBoxValue(txt_fBillTypeID, "生产调拨申请单(DBSQD03_SC)");
                    }
                    else if (workId == "2")
                    {
                        // 委外订单,设置对应的申请类型
                        SetComboBoxValue(txt_fBillTypeID, "委外调拨申请单(DBSQD02_WW)");
                    }
                };
                //赋值给明细表
                frm.UpdateParent += (ss, ee) =>
                {
                    try
@@ -178,6 +208,7 @@
                        {
                            lst = ee.StringList,
                            workId = ee.Data,
                            ftype = txt_fBusinessType.Text
                        };
                        txt_FSourceOrder.Text = "";
                        for (int i=0;i< lst_gd.Count; i++)
@@ -193,6 +224,17 @@
                        };
                        var strReturn = UtilityHelper.HttpPost("", "MesInvItemMovesManager/SelectScddToView", JsonConvert.SerializeObject(_obj));
                        var dt = UtilityHelper.ReturnToList(strReturn);
                        if (dt.rtnCode == -102 && dt.rtnMsg == "委外")
                        {
                            MsgHelper.ShowError("提示:业务类型为委外(WW)时,只能选择委外订单!");
                            return;
                        }
                        else if (dt.rtnCode == -102 && dt.rtnMsg == "生产")
                        {
                            MsgHelper.ShowError("提示:业务类型为标准(NORMAL)时,只能选择生产订单!");
                            return;
                        }
                        ;
                        DataTable _newTable = dt.rtnData;
                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
                        DataRow[] sourceRows = _newTable.Select();
@@ -211,25 +253,25 @@
                    }
                    catch(Exception ex)
                    {
                        MsgHelper.ShowError("提示:" + ex.Message);
                        MsgHelper.ShowError("提示:" + ex.Message);
                    }
                };
                frm.ShowDialog();
            };
            #endregion
            #region 2025-10-17 选择委外订单
            #region 2025-10-17 选择委外订单
            btnScdd.Click += (s, e) =>
            {
                string kcZz = txt_fapporgid.GetId();
                if (string.IsNullOrEmpty(kcZz))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能选择委外订单!");
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择申请组织后才能选择委外订单!");
                    txt_fapporgid.Focus();
                    return;
                }
                var frm = new SelectScdd("1");
                //赋值给明细表
                //赋值给明细表
                frm.UpdateParent += (ss, ee) =>
                {
                    try
@@ -257,7 +299,7 @@
                    }
                    catch (Exception ex)
                    {
                        MsgHelper.ShowError("提示:" + ex.Message);
                        MsgHelper.ShowError("提示:" + ex.Message);
                    }
                };
                frm.ShowDialog();
@@ -265,6 +307,34 @@
            #endregion
        }
        /// <summary>
        /// 这是打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
        {
            //guidKey, rptParameter
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_fBillNo, gridView1, "fBillNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            this.toolBarMenu1.rptParameter = "rpt_sdzjdb{"
                                               + "100"
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "}";
            this.toolBarMenu1.guidKey = rowGuid;
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -272,7 +342,7 @@
            getPageList(1);
        }
        /// <summary>
        /// 分页事件
        /// 分页事件
        /// </summary>
        /// <param name="curPage"></param>
        /// <param name="pageSize"></param>
@@ -281,7 +351,7 @@
            getPageList(curPage);
        }
        /// <summary>
        /// 查询事件
        /// 查询事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -295,7 +365,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 查询回调
        /// 查询回调
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -306,7 +376,7 @@
        }
        /// <summary>
        /// 取消事件
        /// 取消事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -316,7 +386,7 @@
        }
        /// <summary>
        /// 删除事件
        /// 删除事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -327,10 +397,10 @@
                lbGuid, txt_fBillNo, gridView1, "FBillNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?"))
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?"))
                return;
            var _obj = new
            {
@@ -343,7 +413,7 @@
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
@@ -351,16 +421,16 @@
                    getPageList(this.pageBar1.CurrentPage);
                }
                else
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                MsgHelper.ShowError("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 刷新事件
        /// 刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -382,7 +452,7 @@
            }
        }
        /// <summary>
        /// 修改事件
        /// 修改事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -392,7 +462,7 @@
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "FBillNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -406,7 +476,7 @@
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(splitMx1.Panel1.Controls, true, gvList);
            }
            //2025/07/12加上修改状态下不能修改供应商和组织srm,禁用
            //2025/07/12加上修改状态下不能修改供应商和组织srm,禁用
            txt_fapporgid.IsReadly = true;
            txt_ftranstype.ReadOnly = true;
            txt_fOwnerTypeIdHead.ReadOnly = true;
@@ -415,7 +485,7 @@
            txt_djtype.Properties.ReadOnly = true;
        }
        /// <summary>
        /// 新增事件
        /// 新增事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -427,14 +497,14 @@
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_fapporgid);
            txt_fBusinessType.Properties.ReadOnly = true;
            txt_djtype.Properties.ReadOnly = true;
        }
        /// <summary>
        /// 保存事件
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -451,54 +521,54 @@
            string gdbh = txt_FSourceOrder.Text.ToString();
            //if (txt_fBillTypeID.SelectedIndex <= 0)
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!");
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!");
            //    txt_fBillTypeID.Focus();
            //    return;
            //}
            if (string.IsNullOrEmpty(dbfx))
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择调拨方向!");
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择调拨方向!");
                txt_fTransferDirect.Focus();
                return;
            }
            if (string.IsNullOrEmpty(sqOrg))
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择申请组织!");
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择申请组织!");
                txt_fapporgid.Focus();
                return;
            }
            //if (txt_fOwnerTypeIdHead.SelectedIndex <= 0)
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调出货主类型!");
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调出货主类型!");
            //    txt_fOwnerTypeIdHead.Focus();
            //    return;
            //}
            //if (txt_fOwnerTypeInIdHead.SelectedIndex <= 0)
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调入货主类型!");
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调入货主类型!");
            //    txt_fOwnerTypeInIdHead.Focus();
            //    return;
            //}
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                djlx = djlx,//单据类型
                ywlx = ywlx,//业务类型
                dbfx = dbfx,//调拨方向
                sqOrg = sqOrg,//审请组织
                dblx = dblx,//调拨类型
                dchzlx = dchzlx,//调出货主类型
                drhzlx = drhzlx,//调入货主类型
                inRemark = txt_fRemarks.Text.Trim(),//备注
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                djlx = djlx,//单据类型
                ywlx = ywlx,//业务类型
                dbfx = dbfx,//调拨方向
                sqOrg = sqOrg,//审请组织
                dblx = dblx,//调拨类型
                dchzlx = dchzlx,//调出货主类型
                drhzlx = drhzlx,//调入货主类型
                inRemark = txt_fRemarks.Text.Trim(),//备注
                list = new List<dynamic>(),
                gdbh = gdbh //工单单号
                gdbh = gdbh //工单单号
            };
            gvMx1.CloseEditor();
            gvMx1.PostEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0)
            {
                MsgHelper.ShowError("明细不能为空,请选择你的申请明细!");
                MsgHelper.ShowError("明细不能为空,请选择你的申请明细!");
                return;
            }
            for (var i = 0; i < gvMx1.DataRowCount; i++)
@@ -510,37 +580,37 @@
                    string _msl = row["shNum"].ToString();
                    if (string.IsNullOrEmpty(_msl))
                    {
                        MsgHelper.ShowError("数量不能为空!");
                        MsgHelper.ShowError("数量不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["dcOrgGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调出组织不能为空!");
                        MsgHelper.ShowError("调出组织不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["dcCkGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调出仓库不能为空!");
                        MsgHelper.ShowError("调出仓库不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["drOrgGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调入组织不能为空!");
                        MsgHelper.ShowError("调入组织不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["drCkGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调入仓库不能为空!");
                        MsgHelper.ShowError("调入仓库不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["dcHzGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调出货主不能为空!");
                        MsgHelper.ShowError("调出货主不能为空!");
                        return;
                    }
                    if (string.IsNullOrEmpty(row["drHzGuid"].ToString()))
                    {
                        MsgHelper.ShowError("调入货主不能为空!");
                        MsgHelper.ShowError("调入货主不能为空!");
                        return;
                    }
                    _obj.list.Add(new
@@ -555,6 +625,9 @@
                        drck = (row["drCkGuid"].ToString()),
                        dchz = (row["dcHzGuid"].ToString()),
                        drhz = (row["drHzGuid"].ToString()),
                        gd = (row["daa001"].ToString()),
                        gdmx = (row["dabErpId"].ToString()),
                        bgy = (row["depotMan"].ToString()),
                    });
                }
            }
@@ -564,7 +637,7 @@
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    ToolBox.MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    ToolBox.MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    lbGuid.Text = _rtn.rtnData.outGuid;
                    txt_fBillNo.Text = _rtn.rtnData.outNo;
                    toolBarMenu1.isSetBtn = true;
@@ -575,15 +648,15 @@
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
                else
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 日志
        /// 日志
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -598,8 +671,8 @@
        /// <summary>
        /// 
        /// </summary>
        /// <param name="curPage">第几页</param>
        /// <param name="pageSize">每页几条</param>
        /// <param name="curPage">第几页</param>
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            gcMain1.DataSource = null;
@@ -627,18 +700,18 @@
                    else
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
                    pageBar1.RecordCount = dd.rtnData.total;//总记录数
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
                    pageBar1.RecordCount = dd.rtnData.total;//总记录数
                }
                else
                {
                    ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg);
                    ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg);
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -649,12 +722,12 @@
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                ToolBox.MsgHelper.ShowError("请先选择你要操作的行!");
                ToolBox.MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            var _obj = new
            {
                guid = strGuid,//主建
                guid = strGuid,//主建
            };
            try
            {
@@ -688,17 +761,17 @@
                    }
                }
                else
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        ///     审核事件
        ///     审核事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -708,7 +781,7 @@
        }
        /// <summary>
        ///     反审核
        ///     反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -718,7 +791,7 @@
            _toolCk(0);
        }
        /// <summary>
        /// 售后审核
        /// 售后审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -729,7 +802,7 @@
        }
        /// <summary>
        /// 售后反审核
        /// 售后反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -739,7 +812,7 @@
            _toolCk(21);
        }
        /// <summary>
        /// 工具条事件
        /// 工具条事件
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolCk(int _inFieldValue)
@@ -748,16 +821,16 @@
            switch (_inFieldValue)
            {
                case 1:
                    strMsg = "审核";
                    strMsg = "审核";
                    break;
                case 0:
                    strMsg = "反审核";
                    strMsg = "反审核";
                    break;
                case 20:
                    strMsg = "售后审核";
                    strMsg = "售后审核";
                    break;
                case 21:
                    strMsg = "售后反审核";
                    strMsg = "售后反审核";
                    break;
            }
            ;
@@ -766,10 +839,10 @@
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "FBillNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            var _obj = new
            {
@@ -795,7 +868,7 @@
                    }
                    else
                    {
                        //注意,这里和其它页面有点不一样
                        //注意,这里和其它页面有点不一样
                        getPageList(this.pageBar1.CurrentPage);
                        int rowHandle = gridView1.LocateByValue("guid", rowGuid);
                        gridView1.FocusedRowHandle = rowHandle;
@@ -806,13 +879,13 @@
            }
            catch (Exception ex)
            {
                MsgHelper.ShowError("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 选择物料
        /// 选择物料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -831,7 +904,7 @@
        }
        /// <summary>
        /// 删除物料
        /// 删除物料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -844,7 +917,7 @@
            {
                var dr = gvMx1.GetDataRow(rowhandle);
                var mxGuid = dr["id"].ToString();
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                    return;
                if (string.IsNullOrEmpty(mxGuid))
                {
@@ -864,22 +937,22 @@
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                        MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                        getModel(lbGuid.Text);
                    }
                    else
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
                {
                    MsgHelper.ShowError("提示:" + ex.Message);
                    MsgHelper.ShowError("提示:" + ex.Message);
                }
            }
        }
        /// <summary>
        /// 查找调出组织
        /// 查找调出组织
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -899,7 +972,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 查找调出仓库
        /// 查找调出仓库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -912,7 +985,7 @@
            var strOrgGuid = dr["dcOrgGuid"].ToString();
            if (string.IsNullOrEmpty(strOrgGuid))
            {
                MsgHelper.ShowError("提示:请先选择调出组织!");
                MsgHelper.ShowError("提示:请先选择调出组织!");
                return;
            }
            ;
@@ -927,7 +1000,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 查找仓位
        /// 查找仓位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -939,14 +1012,14 @@
            var dr = gvMx1.GetDataRow(rowhandle);
            if (dr["dcCkGuid"] == null)
            {
                MsgHelper.ShowError("提示:请先选择调出仓库!");
                MsgHelper.ShowError("提示:请先选择调出仓库!");
                return;
            }
            ;
            var strCkGuid = dr["dcCkGuid"].ToString();
            if (string.IsNullOrEmpty(strCkGuid))
            {
                MsgHelper.ShowError("提示:请先选择调出仓库!");
                MsgHelper.ShowError("提示:请先选择调出仓库!");
                return;
            }
            ;
@@ -962,7 +1035,7 @@
        }
        /// <summary>
        /// 调入组织
        /// 调入组织
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -982,7 +1055,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 调入仓库
        /// 调入仓库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -995,7 +1068,7 @@
            var strOrgGuid = dr["drOrgGuid"].ToString();
            if (string.IsNullOrEmpty(strOrgGuid))
            {
                MsgHelper.ShowError("提示:请先选择调入组织!");
                MsgHelper.ShowError("提示:请先选择调入组织!");
                return;
            }
            ;
@@ -1010,7 +1083,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 调入仓位
        /// 调入仓位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -1022,14 +1095,14 @@
            var dr = gvMx1.GetDataRow(rowhandle);
            if (dr["drCkGuid"] == null)
            {
                MsgHelper.ShowError("提示:请先选择调入仓库!");
                MsgHelper.ShowError("提示:请先选择调入仓库!");
                return;
            }
            ;
            var strCkGuid = dr["drCkGuid"].ToString();
            if (string.IsNullOrEmpty(strCkGuid))
            {
                MsgHelper.ShowError("提示:请先选择调入仓库!");
                MsgHelper.ShowError("提示:请先选择调入仓库!");
                return;
            }
            ;
@@ -1045,7 +1118,7 @@
        }
        /// <summary>
        /// 调入货主
        /// 调入货主
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -1057,7 +1130,7 @@
            int _drhzlx = txt_fOwnerTypeInIdHead.SelectedIndex;
            //if (_drhzlx <= 0)
            //{
            //    MsgHelper.Warning("提示:请先选择调入货主类型!");
            //    MsgHelper.Warning("提示:请先选择调入货主类型!");
            //    return;
            //}
            SelectHz frm = new SelectHz("", _drhzlx.ToString());
@@ -1072,7 +1145,7 @@
            frm.ShowDialog();
        }
        /// <summary>
        /// 调出货主
        /// 调出货主
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -1085,7 +1158,7 @@
            int _drhzlx = txt_fOwnerTypeIdHead.SelectedIndex;
            //if (_drhzlx <= 0)
            //{
            //    MsgHelper.Warning("提示:请先选择调出货主类型!");
            //    MsgHelper.Warning("提示:请先选择调出货主类型!");
            //    return;
            //}
            SelectHz frm = new SelectHz("", _drhzlx.ToString());
@@ -1100,7 +1173,7 @@
        }
        /// <summary>
        ///  预计开工时间变化事件
        ///  预计开工时间变化事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
@@ -1111,15 +1184,21 @@
            if (string.IsNullOrEmpty(selectedValue))
                return;
            if (selectedValue == "委外调拨申请单(DBSQD02_WW)")
            if (selectedValue == "委外调拨申请单(DBSQD02_WW)")
            {
                SetComboBoxValue(txt_fBusinessType, "委外(WW)");
                SetComboBoxValue(txt_djtype, "委外直接调拨单(WWDB01_SYS)");
                SetComboBoxValue(txt_fBusinessType, "委外(WW)");
                SetComboBoxValue(txt_djtype, "委外直接调拨单(WWDB01_SYS)");
            }
            else if (selectedValue == "生产调拨申请单(DBSQD03_SC)")
            {
                SetComboBoxValue(txt_fBusinessType, "生产(SC)");
                SetComboBoxValue(txt_djtype, "生产直接调拨单(SCDB01_SYS)");
            }
            else
            {
                SetComboBoxValue(txt_fBusinessType, "标准(NORMAL)");
                SetComboBoxValue(txt_djtype, "标准直接调拨单(ZJDB01_SYS)");
                SetComboBoxValue(txt_fBusinessType, "标准(NORMAL)");
                SetComboBoxValue(txt_djtype, "标准直接调拨单(ZJDB01_SYS)");
            }
        }
@@ -1131,7 +1210,7 @@
            }
            else
            {
                // 如果值不存在,设置为第一个选项或空
                // 如果值不存在,设置为第一个选项或空
                if (comboBox.Properties.Items.Count > 0)
                    comboBox.EditValue = comboBox.Properties.Items[0];
                else