到货条码一键打、采购入库单、到货条码打印、IQC检验列表页面加字段加需求跟踪号、
已修改3个文件
233 ■■■■■ 文件已修改
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.resx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs
@@ -188,6 +188,7 @@
            this.xtraTabPage3 = new DevExpress.XtraTab.XtraTabPage();
            this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
            this.lay99 = new DevExpress.XtraLayout.LayoutControl();
            this.ucBtnPrintOne1 = new Gs.DevApp.UserControl.UcBtnPrintOne();
            this.layoutControl2 = new DevExpress.XtraLayout.LayoutControl();
            this.txt_iCount_2 = new DevExpress.XtraEditors.TextEdit();
            this.txt_yuliang_2 = new DevExpress.XtraEditors.TextEdit();
@@ -217,6 +218,7 @@
            this.layoutControlItem39 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem35 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem40 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem41 = new DevExpress.XtraLayout.LayoutControlItem();
            this.gcMx3 = new DevExpress.XtraGrid.GridControl();
            this.gvMx3 = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn33 = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -319,8 +321,8 @@
            this.gv_hbdy = new DevExpress.XtraGrid.Columns.GridColumn();
            this.tips = new DevExpress.Utils.ToolTipController(this.components);
            this.behaviorManager1 = new DevExpress.Utils.Behaviors.BehaviorManager(this.components);
            this.ucBtnPrintOne1 = new Gs.DevApp.UserControl.UcBtnPrintOne();
            this.layoutControlItem41 = new DevExpress.XtraLayout.LayoutControlItem();
            this.gridColumn109 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn110 = new DevExpress.XtraGrid.Columns.GridColumn();
            ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.xtraTabPage1.SuspendLayout();
@@ -424,6 +426,7 @@
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem39)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem35)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem40)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem41)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gcMx3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvMx3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit3)).BeginInit();
@@ -474,7 +477,6 @@
            ((System.ComponentModel.ISupportInitialize)(this.gcMx2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvMx2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem41)).BeginInit();
            this.SuspendLayout();
            // 
            // toolBarMenu1
@@ -858,7 +860,8 @@
            this.gridColumn102,
            this.gridColumn103,
            this.gridColumn104,
            this.gridColumn105});
            this.gridColumn105,
            this.gridColumn110});
            this.gvMxL2.DetailHeight = 272;
            this.gvMxL2.GridControl = this.gcMxL2;
            this.gvMxL2.Name = "gvMxL2";
@@ -2038,6 +2041,17 @@
            this.lay99.TabIndex = 0;
            this.lay99.Text = "layoutControl2";
            // 
            // ucBtnPrintOne1
            //
            this.ucBtnPrintOne1.allClickKey = null;
            this.ucBtnPrintOne1.guidKey = null;
            this.ucBtnPrintOne1.Location = new System.Drawing.Point(1011, 12);
            this.ucBtnPrintOne1.Margin = new System.Windows.Forms.Padding(0);
            this.ucBtnPrintOne1.Name = "ucBtnPrintOne1";
            this.ucBtnPrintOne1.rptParameter = null;
            this.ucBtnPrintOne1.Size = new System.Drawing.Size(330, 52);
            this.ucBtnPrintOne1.TabIndex = 485;
            //
            // layoutControl2
            // 
            this.layoutControl2.Controls.Add(this.txt_iCount_2);
@@ -2390,6 +2404,16 @@
            this.layoutControlItem40.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem40.TextVisible = false;
            // 
            // layoutControlItem41
            //
            this.layoutControlItem41.Control = this.ucBtnPrintOne1;
            this.layoutControlItem41.Location = new System.Drawing.Point(999, 0);
            this.layoutControlItem41.Name = "layoutControlItem41";
            this.layoutControlItem41.OptionsTableLayoutItem.ColumnIndex = 3;
            this.layoutControlItem41.Size = new System.Drawing.Size(334, 56);
            this.layoutControlItem41.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem41.TextVisible = false;
            //
            // gcMx3
            // 
            this.gcMx3.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -2428,7 +2452,8 @@
            this.gridColumn50,
            this.gridColumn52,
            this.gridColumn53,
            this.gridColumn54});
            this.gridColumn54,
            this.gridColumn109});
            this.gvMx3.DetailHeight = 272;
            this.gvMx3.GridControl = this.gcMx3;
            this.gvMx3.Name = "gvMx3";
@@ -2567,7 +2592,7 @@
            this.gridColumn47.MinWidth = 44;
            this.gridColumn47.Name = "gridColumn47";
            this.gridColumn47.Visible = true;
            this.gridColumn47.VisibleIndex = 8;
            this.gridColumn47.VisibleIndex = 9;
            this.gridColumn47.Width = 73;
            // 
            // gridColumn48
@@ -2577,7 +2602,7 @@
            this.gridColumn48.MinWidth = 44;
            this.gridColumn48.Name = "gridColumn48";
            this.gridColumn48.Visible = true;
            this.gridColumn48.VisibleIndex = 9;
            this.gridColumn48.VisibleIndex = 10;
            this.gridColumn48.Width = 80;
            // 
            // gridColumn49
@@ -2587,7 +2612,7 @@
            this.gridColumn49.MinWidth = 22;
            this.gridColumn49.Name = "gridColumn49";
            this.gridColumn49.Visible = true;
            this.gridColumn49.VisibleIndex = 10;
            this.gridColumn49.VisibleIndex = 11;
            this.gridColumn49.Width = 82;
            // 
            // gridColumn50
@@ -2604,7 +2629,7 @@
            this.gridColumn52.FieldName = "depotCode";
            this.gridColumn52.Name = "gridColumn52";
            this.gridColumn52.Visible = true;
            this.gridColumn52.VisibleIndex = 11;
            this.gridColumn52.VisibleIndex = 12;
            // 
            // gridColumn53
            // 
@@ -2612,7 +2637,7 @@
            this.gridColumn53.FieldName = "depotName";
            this.gridColumn53.Name = "gridColumn53";
            this.gridColumn53.Visible = true;
            this.gridColumn53.VisibleIndex = 12;
            this.gridColumn53.VisibleIndex = 13;
            // 
            // gridColumn54
            // 
@@ -2620,7 +2645,7 @@
            this.gridColumn54.FieldName = "staffName";
            this.gridColumn54.Name = "gridColumn54";
            this.gridColumn54.Visible = true;
            this.gridColumn54.VisibleIndex = 13;
            this.gridColumn54.VisibleIndex = 14;
            // 
            // repositoryItemButtonEdit3
            // 
@@ -3285,7 +3310,7 @@
            this.gridColumn15.MinWidth = 44;
            this.gridColumn15.Name = "gridColumn15";
            this.gridColumn15.Visible = true;
            this.gridColumn15.VisibleIndex = 10;
            this.gridColumn15.VisibleIndex = 11;
            this.gridColumn15.Width = 60;
            // 
            // gridColumn19
@@ -3295,7 +3320,7 @@
            this.gridColumn19.MinWidth = 44;
            this.gridColumn19.Name = "gridColumn19";
            this.gridColumn19.Visible = true;
            this.gridColumn19.VisibleIndex = 11;
            this.gridColumn19.VisibleIndex = 12;
            this.gridColumn19.Width = 66;
            // 
            // gridColumn12
@@ -3305,7 +3330,7 @@
            this.gridColumn12.MinWidth = 22;
            this.gridColumn12.Name = "gridColumn12";
            this.gridColumn12.Visible = true;
            this.gridColumn12.VisibleIndex = 12;
            this.gridColumn12.VisibleIndex = 13;
            this.gridColumn12.Width = 68;
            // 
            // gridColumn27
@@ -3341,7 +3366,7 @@
            this.gridColumn29.FieldName = "depotCode";
            this.gridColumn29.Name = "gridColumn29";
            this.gridColumn29.Visible = true;
            this.gridColumn29.VisibleIndex = 13;
            this.gridColumn29.VisibleIndex = 14;
            this.gridColumn29.Width = 62;
            // 
            // gridColumn30
@@ -3350,7 +3375,7 @@
            this.gridColumn30.FieldName = "depotName";
            this.gridColumn30.Name = "gridColumn30";
            this.gridColumn30.Visible = true;
            this.gridColumn30.VisibleIndex = 14;
            this.gridColumn30.VisibleIndex = 15;
            this.gridColumn30.Width = 62;
            // 
            // gridColumn31
@@ -3359,7 +3384,7 @@
            this.gridColumn31.FieldName = "staffName";
            this.gridColumn31.Name = "gridColumn31";
            this.gridColumn31.Visible = true;
            this.gridColumn31.VisibleIndex = 15;
            this.gridColumn31.VisibleIndex = 16;
            this.gridColumn31.Width = 82;
            // 
            // gridColumn107
@@ -3369,7 +3394,7 @@
            this.gridColumn107.MinWidth = 21;
            this.gridColumn107.Name = "gridColumn107";
            this.gridColumn107.Visible = true;
            this.gridColumn107.VisibleIndex = 16;
            this.gridColumn107.VisibleIndex = 10;
            this.gridColumn107.Width = 78;
            // 
            // repositoryItemButtonEdit1
@@ -3589,26 +3614,21 @@
            this.gv_hbdy.Visible = true;
            this.gv_hbdy.VisibleIndex = 13;
            // 
            // ucBtnPrintOne1
            // gridColumn109
            // 
            this.ucBtnPrintOne1.allClickKey = null;
            this.ucBtnPrintOne1.guidKey = null;
            this.ucBtnPrintOne1.Location = new System.Drawing.Point(1011, 12);
            this.ucBtnPrintOne1.Margin = new System.Windows.Forms.Padding(0);
            this.ucBtnPrintOne1.Name = "ucBtnPrintOne1";
            this.ucBtnPrintOne1.rptParameter = null;
            this.ucBtnPrintOne1.Size = new System.Drawing.Size(330, 52);
            this.ucBtnPrintOne1.TabIndex = 485;
            this.gridColumn109.Caption = "需求跟踪号";
            this.gridColumn109.FieldName = "xqgz";
            this.gridColumn109.Name = "gridColumn109";
            this.gridColumn109.Visible = true;
            this.gridColumn109.VisibleIndex = 8;
            // 
            // layoutControlItem41
            // gridColumn110
            // 
            this.layoutControlItem41.Control = this.ucBtnPrintOne1;
            this.layoutControlItem41.Location = new System.Drawing.Point(999, 0);
            this.layoutControlItem41.Name = "layoutControlItem41";
            this.layoutControlItem41.OptionsTableLayoutItem.ColumnIndex = 3;
            this.layoutControlItem41.Size = new System.Drawing.Size(334, 56);
            this.layoutControlItem41.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem41.TextVisible = false;
            this.gridColumn110.Caption = "需求跟踪号";
            this.gridColumn110.FieldName = "xqgz";
            this.gridColumn110.Name = "gridColumn110";
            this.gridColumn110.Visible = true;
            this.gridColumn110.VisibleIndex = 14;
            // 
            // Frm_ArrivalBarcode
            // 
@@ -3723,6 +3743,7 @@
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem39)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem35)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem40)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem41)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gcMx3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvMx3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit3)).EndInit();
@@ -3773,7 +3794,6 @@
            ((System.ComponentModel.ISupportInitialize)(this.gcMx2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvMx2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem41)).EndInit();
            this.ResumeLayout(false);
        }
@@ -4042,5 +4062,7 @@
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn108;
        private UserControl.UcBtnPrintOne ucBtnPrintOne1;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem41;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn110;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn109;
    }
}
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -163,135 +163,25 @@
            };
            // --------------------gvMx3 ucBtnPrintOne1 批量打印事件(优化版)--------------------
            //一键打印事件
            this.ucBtnPrintOne1.btnPrintClick += (s, e) =>
            {
                // 1. 基础验证:主表行选择
                string mainGuid = lbGuid.Text.Trim();
                if (string.IsNullOrEmpty(mainGuid) || mainGuid.Length < 10)
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("请先在主表中选择数据行!");
                    this.ucBtnPrintOne1.rptParameter = "return false";
                    return;
                }
                // 2. 获取明细数据源
                DataTable dtDetails = gcMx3.DataSource as DataTable;
                if (dtDetails == null || dtDetails.Rows.Count == 0)
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("当前主表无关联的明细数据,请先加载明细!");
                    this.ucBtnPrintOne1.rptParameter = "return false";
                    return;
                }
                // 3. 筛选可打印明细(逻辑不变)
                List<string> validReleaseNos = new List<string>();
                List<string> validPrintQtys = new List<string>();
                string releaseNoField = "releaseNo";
                if (!dtDetails.Columns.Contains(releaseNoField))
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError($"明细数据源缺少必要字段:{releaseNoField}");
                    this.ucBtnPrintOne1.rptParameter = "return false";
                    return;
                }
                foreach (DataRow row in dtDetails.Rows)
                {
                    string rowReleaseNo = row[releaseNoField]?.ToString()?.Trim() ?? "";
                    if (string.IsNullOrEmpty(rowReleaseNo) || rowReleaseNo.Length < 5)
                    {
                        Gs.DevApp.ToolBox.MsgHelper.ShowError($"跳过无效明细行:缺少或无效的releaseNo");
                        continue;
                    }
                    string kQtyStr = row["kQty"]?.ToString()?.Trim() ?? "0";
                    if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(kQtyStr)
                        || !decimal.TryParse(kQtyStr, out decimal kQty)
                        || kQty <= 0)
                    {
                        Gs.DevApp.ToolBox.MsgHelper.ShowError($"跳过明细行(releaseNo:{rowReleaseNo}):可打印数量无效或<=0");
                        continue;
                    }
                    if (!validReleaseNos.Contains(rowReleaseNo))
                    {
                        validReleaseNos.Add(rowReleaseNo);
                        validPrintQtys.Add(kQty.ToString("F2"));
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.MsgHelper.ShowError($"跳过重复明细行(releaseNo:{rowReleaseNo}):已包含该releaseNo");
                    }
                }
                if (validReleaseNos.Count == 0)
                {
                    Gs.DevApp.ToolBox.MsgHelper.ShowError("没有可批量打印的明细行(所有行均为无效数据或可打印数量<=0)");
                    this.ucBtnPrintOne1.rptParameter = "return false";
                    return;
                }
                // 4. 组装参数(适配_rptGetParameterP解析逻辑)
                string releaseNosStr = string.Join("|", validReleaseNos);
                string printQtysStr = string.Join("|", validPrintQtys);
                // 仅传6个关键参数,对应解析方法的s0-s5
                string[] reportParams = new string[]
                {
        "batch",       // s0 → @in1:批量标识
        "0",           // s1 → @in2:占位
        "0",           // s2 → @in3:余量
        "1",           // s3 → @in4:张数
        printQtysStr,  // s4 → @in5:数量列表
        releaseNosStr  // s5 → @in6:releaseNo列表
                };
                /*string paramContent = string.Join(",", reportParams);
                string rptParam = $"rpt_Arrival_One{{{paramContent}}}";
                this.ucBtnPrintOne1.guidKey = mainGuid;
                this.ucBtnPrintOne1.rptParameter = rptParam;
                // 5. 调用预览(逻辑不变)
                try
                {
                    using (Form rptPreviewForm = new RptPreview(mainGuid, rptParam))
                    {
                        DialogResult previewResult = rptPreviewForm.ShowDialog();
                        if (previewResult == DialogResult.OK)
                        {
                            getModel(mainGuid);
                            Gs.DevApp.ToolBox.MsgHelper.ShowError($"批量打印完成!共打印 {validReleaseNos.Count} 条有效明细");
                        }
                        else if (previewResult == DialogResult.Cancel)
                        {
                            Gs.DevApp.ToolBox.MsgHelper.ShowError("用户取消批量打印操作");
                        }
                    }
                }
                catch (Exception ex)
                {
                    string errorMsg = $"批量打印异常:{ex.Message}";
                    if (ex.InnerException != null)
                    {
                        errorMsg += $"\n内部错误:{ex.InnerException.Message}";
                    }
                    Gs.DevApp.ToolBox.MsgHelper.ShowError(errorMsg);
                    this.ucBtnPrintOne1.rptParameter = "return false";
                }
*/
                this.ucBtnPrintOne1.guidKey = mainGuid;
                ucBtnPrintOne1.guidKey = mainGuid;
                this.ucBtnPrintOne1.rptParameter = "rpt_Arrival{"
                    + string.Join(",", reportParams)  // 拼接reportParams数组元素
                    + "}";
                // 6. 清空控件
                txt_iCount_2.Text = "";
                txt_psnQty_2.Text = "";
                txt_releaseNo.Text = "";
                     + "101"//一键打印101
                     + "," + ""
                     + "," + ""
                     + "," + ""
                     + "," + ""
                     + "}";
                txt_iCount_1.Text = "";
                txt_psnQty_1.Text = "";
            };
            this.ucBtnPrintOne1.btnAllClick += (s, e) =>
            {
                string mainGuid = lbGuid.Text.Trim();
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.resx
@@ -123,4 +123,7 @@
  <metadata name="behaviorManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>93, 17</value>
  </metadata>
  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>25</value>
  </metadata>
</root>