yhluo 1 týždeň pred
rodič
commit
164885b9d7

+ 51 - 9
UAS_MES_YTDZ/FunctionCode/Make/Make_HandFeedQualityConfirm.Designer.cs

@@ -34,6 +34,8 @@
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.makeLab = new System.Windows.Forms.Label();
+            this.qaPass = new System.Windows.Forms.CheckBox();
+            this.qaFail = new System.Windows.Forms.CheckBox();
             this.submit = new System.Windows.Forms.Button();
             this.snVal = new System.Windows.Forms.TextBox();
             this.snLab = new System.Windows.Forms.Label();
@@ -70,6 +72,7 @@
             this.psl_baseqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ReelRemark = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ReelNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.qa_result = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.containerBox.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
             this.executeBox.SuspendLayout();
@@ -104,14 +107,15 @@
             this.psl_prodcode,
             this.psl_baseqty,
             this.ReelRemark,
-            this.ReelNum});
+            this.ReelNum,
+            this.qa_result});
             this.dgv.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dgv.Location = new System.Drawing.Point(0, 0);
             this.dgv.Name = "dgv";
             this.dgv.RowHeadersVisible = false;
             this.dgv.RowHeadersWidth = 62;
             this.dgv.RowTemplate.Height = 30;
-            this.dgv.Size = new System.Drawing.Size(1280, 467);
+            this.dgv.Size = new System.Drawing.Size(1280, 441);
             this.dgv.TabIndex = 1;
             // 
             // executeBox
@@ -119,14 +123,16 @@
             this.executeBox.Controls.Add(this.LockMakeCode);
             this.executeBox.Controls.Add(this.ma_code);
             this.executeBox.Controls.Add(this.makeLab);
+            this.executeBox.Controls.Add(this.qaPass);
+            this.executeBox.Controls.Add(this.qaFail);
             this.executeBox.Controls.Add(this.submit);
             this.executeBox.Controls.Add(this.snVal);
             this.executeBox.Controls.Add(this.snLab);
             this.executeBox.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.executeBox.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.executeBox.Location = new System.Drawing.Point(0, 467);
+            this.executeBox.Location = new System.Drawing.Point(0, 441);
             this.executeBox.Name = "executeBox";
-            this.executeBox.Size = new System.Drawing.Size(1280, 130);
+            this.executeBox.Size = new System.Drawing.Size(1280, 156);
             this.executeBox.TabIndex = 0;
             // 
             // LockMakeCode
@@ -136,7 +142,7 @@
             this.LockMakeCode.LeaveEvent = false;
             this.LockMakeCode.Location = new System.Drawing.Point(404, 18);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(72, 31);
+            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
             this.LockMakeCode.TabIndex = 8;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -173,10 +179,34 @@
             this.makeLab.TabIndex = 6;
             this.makeLab.Text = "工单:";
             // 
+            // qaPass
+            // 
+            this.qaPass.AutoSize = true;
+            this.qaPass.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.qaPass.Location = new System.Drawing.Point(114, 56);
+            this.qaPass.Name = "qaPass";
+            this.qaPass.Size = new System.Drawing.Size(80, 32);
+            this.qaPass.TabIndex = 9;
+            this.qaPass.Text = "合格";
+            this.qaPass.UseVisualStyleBackColor = true;
+            this.qaPass.CheckedChanged += new System.EventHandler(this.qaPass_CheckedChanged);
+            // 
+            // qaFail
+            // 
+            this.qaFail.AutoSize = true;
+            this.qaFail.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.qaFail.Location = new System.Drawing.Point(210, 56);
+            this.qaFail.Name = "qaFail";
+            this.qaFail.Size = new System.Drawing.Size(101, 32);
+            this.qaFail.TabIndex = 10;
+            this.qaFail.Text = "不合格";
+            this.qaFail.UseVisualStyleBackColor = true;
+            this.qaFail.CheckedChanged += new System.EventHandler(this.qaFail_CheckedChanged);
+            // 
             // submit
             // 
             this.submit.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.submit.Location = new System.Drawing.Point(414, 70);
+            this.submit.Location = new System.Drawing.Point(414, 104);
             this.submit.Name = "submit";
             this.submit.Size = new System.Drawing.Size(140, 32);
             this.submit.TabIndex = 5;
@@ -187,7 +217,7 @@
             // snVal
             // 
             this.snVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.snVal.Location = new System.Drawing.Point(114, 72);
+            this.snVal.Location = new System.Drawing.Point(114, 106);
             this.snVal.Name = "snVal";
             this.snVal.Size = new System.Drawing.Size(263, 31);
             this.snVal.TabIndex = 1;
@@ -197,7 +227,7 @@
             // 
             this.snLab.AutoSize = true;
             this.snLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.snLab.Location = new System.Drawing.Point(38, 74);
+            this.snLab.Location = new System.Drawing.Point(38, 108);
             this.snLab.Name = "snLab";
             this.snLab.Size = new System.Drawing.Size(80, 28);
             this.snLab.TabIndex = 0;
@@ -520,7 +550,7 @@
             // ReelRemark
             // 
             this.ReelRemark.DataPropertyName = "reelremark";
-            this.ReelRemark.HeaderText = "元件信息备注";
+            this.ReelRemark.HeaderText = "元件位置备注";
             this.ReelRemark.MinimumWidth = 8;
             this.ReelRemark.Name = "ReelRemark";
             this.ReelRemark.ReadOnly = true;
@@ -535,6 +565,15 @@
             this.ReelNum.ReadOnly = true;
             this.ReelNum.Width = 70;
             // 
+            // qa_result
+            // 
+            this.qa_result.DataPropertyName = "qa_result";
+            this.qa_result.HeaderText = "判定";
+            this.qa_result.MinimumWidth = 8;
+            this.qa_result.Name = "qa_result";
+            this.qa_result.ReadOnly = true;
+            this.qa_result.Width = 80;
+            // 
             // Make_HandFeedQualityConfirm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
@@ -595,6 +634,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn qa_emp;
         private System.Windows.Forms.DataGridViewTextBoxColumn qa_date;
         private System.Windows.Forms.Button submit;
+        private System.Windows.Forms.CheckBox qaPass;
+        private System.Windows.Forms.CheckBox qaFail;
         private System.Windows.Forms.DataGridViewTextBoxColumn rn;
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn ps_linecode;
@@ -605,5 +646,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn psl_baseqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn ReelRemark;
         private System.Windows.Forms.DataGridViewTextBoxColumn ReelNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn qa_result;
     }
 }

+ 153 - 29
UAS_MES_YTDZ/FunctionCode/Make/Make_HandFeedQualityConfirm.cs

@@ -27,6 +27,7 @@ namespace UAS_MES_NEW.Make
         StringBuilder SQL = new StringBuilder();
         DataTable dt, data;
         DataHelper dh;
+        bool qaSwitching;
 
         private void Make_HandFeedQualityConfirm_Load(object sender, EventArgs e)
         {
@@ -47,6 +48,10 @@ namespace UAS_MES_NEW.Make
             data.Columns.Add("reelnum", typeof(string));
             data.Columns.Add("qa_emp", typeof(string));
             data.Columns.Add("qa_date", typeof(string));
+            data.Columns.Add("qa_type", typeof(string));
+            data.Columns.Add("qa_result", typeof(string));
+            data.Columns.Add("update_time", typeof(string));
+            data.Columns.Add("handreel_id", typeof(string));
             dgv.DataSource = data;
 
             submit.Enabled = false;
@@ -76,14 +81,24 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            string makeSql = makeCode.Replace("'", "''");
             SQL.Clear();
-            SQL.Append($@"SELECT m.ms_sncode, h.line_name, h.side,
+            /*SQL.Append($@"SELECT m.ms_sncode, h.line_name, h.side,
                     h.position, h.reel_position, h.part_no, h.reel_qty, h.reelremark, h.reelnum,
-                    h.qa_emp, to_char(h.qa_date,'yyyy-mm-dd hh24:mi:ss') qa_date
+                    h.qa_emp, to_char(h.qa_date,'yyyy-mm-dd hh24:mi:ss') qa_date, h.qa_type,
+                    to_char(h.update_time,'yyyy-mm-dd hh24:mi:ss') update_time, h.handreel_id
                     FROM makeserial m, smt_handreel_log h
-                    WHERE h.serial_number = m.ms_sncode AND m.ms_makecode = '{makeSql}'
-                    ORDER BY m.ms_sncode, h.handreel_id");
+                    WHERE h.serial_number = m.ms_sncode AND m.ms_makecode = '{makeCode}'
+                    ORDER BY m.ms_sncode, h.handreel_id");*/
+
+            SQL.Append($@"SELECT m.ms_sncode, h.line_name, h.side, h.position, 
+                h.reel_position, h.part_no, h.reel_qty, h.reelremark, h.reelnum, 
+                h.qa_emp, to_char(h.qa_date, 'yyyy-mm-dd hh24:mi:ss') qa_date, 
+                h.qa_type, to_char(h.update_time, 'yyyy-mm-dd hh24:mi:ss') update_time, h.handreel_id 
+                FROM makeserial m, smt_handreel_log h WHERE h.serial_number = m.ms_sncode 
+                AND m.ms_makecode = '{makeCode}' AND h.update_time IN(SELECT MAX(t2.update_time) update_time 
+                    FROM makeserial t1, smt_handreel_log t2 WHERE t2.serial_number = t1.ms_sncode 
+                    AND t1.ms_makecode = '{makeCode}' GROUP BY t2.serial_number) 
+                ORDER BY m.ms_sncode, h.handreel_id");
             dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
 
             data.Rows.Clear();
@@ -98,6 +113,7 @@ namespace UAS_MES_NEW.Make
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 DataRow src = dt.Rows[i];
+                string qaType = NormalizeQaType(src["qa_type"]);
                 data.Rows.Add(false, i + 1,
                     src["ms_sncode"].ToString(),
                     src["line_name"].ToString(),
@@ -109,9 +125,15 @@ namespace UAS_MES_NEW.Make
                     src["reelremark"].ToString(),
                     src["reelnum"].ToString(),
                     src["qa_emp"].ToString(),
-                    src["qa_date"].ToString());
+                    src["qa_date"].ToString(),
+                    qaType,
+                    QaTypeText(qaType),
+                    src["update_time"].ToString(),
+                    src["handreel_id"].ToString());
             }
 
+            ApplyLoadedStyle();
+
             submit.Enabled = true;
             snVal.Text = "";
             snVal.Focus();
@@ -140,6 +162,13 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
+            string qaType = SelectedQaType();
+            if (qaType == "")
+            {
+                MessageBox.Show("请先选择合格或不合格", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
             bool found = false;
             bool already = true;
             int firstRow = -1;
@@ -151,13 +180,10 @@ namespace UAS_MES_NEW.Make
                 found = true;
                 if (firstRow < 0)
                     firstRow = i;
-                if (data.Rows[i]["isScan"] == DBNull.Value || !Convert.ToBoolean(data.Rows[i]["isScan"]))
-                {
-                    data.Rows[i]["isScan"] = true;
+                bool scanned = data.Rows[i]["isScan"] != DBNull.Value && Convert.ToBoolean(data.Rows[i]["isScan"]);
+                if (!scanned || data.Rows[i]["qa_type"].ToString() != qaType)
                     already = false;
-                }
-                dgv.Rows[i].DefaultCellStyle.BackColor = Color.Green;
-                dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Black;
+                MarkScanRow(i, qaType);
             }
 
             if (!found)
@@ -187,16 +213,31 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            List<string> snList = new List<string>();
+            List<DataRow> scanRows = new List<DataRow>();
+            List<string> missing = new List<string>();
             foreach (DataRow row in data.Rows)
             {
                 bool scanned = row["isScan"] != DBNull.Value && Convert.ToBoolean(row["isScan"]);
+                if (!scanned)
+                    continue;
                 string sn = row["ms_sncode"].ToString();
-                if (scanned && !snList.Contains(sn))
-                    snList.Add(sn);
+                string position = row["position"].ToString();
+                string qaType = NormalizeQaType(row["qa_type"]);
+                if (qaType == "")
+                {
+                    missing.Add("序列号" + sn + "当前站位" + position);
+                    continue;
+                }
+                scanRows.Add(row);
             }
 
-            if (snList.Count == 0)
+            if (missing.Count > 0)
+            {
+                MessageBox.Show(string.Join("、", missing) + "未选择合格或不合格", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            if (scanRows.Count == 0)
             {
                 MessageBox.Show("请先扫描序列号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 snVal.Focus();
@@ -206,19 +247,17 @@ namespace UAS_MES_NEW.Make
             string emp = User.UserName ?? "";
             if (emp.Length > 20)
                 emp = emp.Substring(0, 20);
-            string empSql = emp.Replace("'", "''");
-            string makeSql = ma_code.Text.Trim().Replace("'", "''");
             string confirmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
             try
             {
-                foreach (string sn in snList)
+                foreach (DataRow row in scanRows)
                 {
-                    string snSql = sn.Replace("'", "''");
+                    string idSql = row["handreel_id"].ToString();
+                    string qaType = NormalizeQaType(row["qa_type"]);
                     SQL.Clear();
-                    SQL.Append($@"UPDATE smt_handreel_log SET qa_emp = '{empSql}', qa_date = sysdate
-                        WHERE serial_number = '{snSql}'
-                        AND serial_number IN (SELECT ms_sncode FROM makeserial WHERE ms_makecode = '{makeSql}' AND ms_sncode = '{snSql}')");
+                    SQL.Append($@"UPDATE smt_handreel_log SET qa_emp = '{emp}', qa_date = sysdate, qa_type = '{qaType}'
+                        WHERE handreel_id = '{idSql}'");
                     dh.ExecuteSql(SQL.ToString(), "update");
                 }
             }
@@ -228,20 +267,106 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            foreach (DataRow row in data.Rows)
+            List<string> snList = new List<string>();
+            foreach (DataRow row in scanRows)
             {
-                if (row["isScan"] == DBNull.Value || !Convert.ToBoolean(row["isScan"]))
-                    continue;
                 row["qa_emp"] = emp;
                 row["qa_date"] = confirmTime;
+                string sn = row["ms_sncode"].ToString();
+                if (!snList.Contains(sn))
+                    snList.Add(sn);
             }
 
-            MessageBox.Show($"已确认{snList.Count}个序列号:{string.Join("、", snList)}", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            MessageBox.Show($"序列号:{string.Join("、", snList)},数量{snList.Count},品质确认完成", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             snVal.Focus();
             snVal.SelectAll();
             snVal.Text = "";
         }
 
+        private void qaPass_CheckedChanged(object sender, EventArgs e)
+        {
+            if (qaSwitching || !qaPass.Checked)
+                return;
+            qaSwitching = true;
+            qaFail.Checked = false;
+            qaSwitching = false;
+        }
+
+        private void qaFail_CheckedChanged(object sender, EventArgs e)
+        {
+            if (qaSwitching || !qaFail.Checked)
+                return;
+            qaSwitching = true;
+            qaPass.Checked = false;
+            qaSwitching = false;
+        }
+
+        private string SelectedQaType()
+        {
+            if (qaPass.Checked)
+                return "1";
+            if (qaFail.Checked)
+                return "0";
+            return "";
+        }
+
+        private string NormalizeQaType(object value)
+        {
+            string text = value == null || value == DBNull.Value ? "" : value.ToString().Trim();
+            decimal number;
+            if (decimal.TryParse(text, out number))
+            {
+                if (number == 1)
+                    return "1";
+                if (number == 0 && text != "")
+                    return "0";
+            }
+            return "";
+        }
+
+        private string QaTypeText(string qaType)
+        {
+            if (qaType == "1")
+                return "合格";
+            if (qaType == "0")
+                return "不合格";
+            return "";
+        }
+
+        private void MarkScanRow(int rowIndex, string qaType)
+        {
+            data.Rows[rowIndex]["isScan"] = true;
+            data.Rows[rowIndex]["qa_type"] = qaType;
+            data.Rows[rowIndex]["qa_result"] = QaTypeText(qaType);
+            PaintRow(rowIndex, qaType);
+        }
+
+        private void ApplyLoadedStyle()
+        {
+            int count = Math.Min(data.Rows.Count, dgv.Rows.Count);
+            for (int i = 0; i < count; i++)
+                PaintRow(i, NormalizeQaType(data.Rows[i]["qa_type"]));
+        }
+
+        private void PaintRow(int rowIndex, string qaType)
+        {
+            if (qaType == "1")
+            {
+                dgv.Rows[rowIndex].DefaultCellStyle.BackColor = Color.Green;
+                dgv.Rows[rowIndex].DefaultCellStyle.ForeColor = Color.Black;
+            }
+            else if (qaType == "0")
+            {
+                dgv.Rows[rowIndex].DefaultCellStyle.BackColor = Color.DarkRed;
+                dgv.Rows[rowIndex].DefaultCellStyle.ForeColor = Color.White;
+            }
+            else
+            {
+                dgv.Rows[rowIndex].DefaultCellStyle.BackColor = dgv.DefaultCellStyle.BackColor;
+                dgv.Rows[rowIndex].DefaultCellStyle.ForeColor = dgv.DefaultCellStyle.ForeColor;
+            }
+        }
+
         private void UpdateSN(string type, string sn = "")
         {
             if (type == "C")
@@ -253,10 +378,9 @@ namespace UAS_MES_NEW.Make
             }
             else if (type == "L")
             {
-                string snSql = sn.Replace("'", "''");
                 SQL.Clear();
                 SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
-                        WHERE ms_sncode = '{snSql}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
+                        WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
                 dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {

+ 64 - 6
UAS_MES_YTDZ/FunctionCode/Make/Make_ShipmentVerify.Designer.cs

@@ -59,6 +59,10 @@
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.serialNumber = new System.Windows.Forms.Label();
+            this.makeQtyLab = new System.Windows.Forms.Label();
+            this.makeQty = new System.Windows.Forms.Label();
+            this.stepCollectLab = new System.Windows.Forms.Label();
+            this.stepCollectQty = new System.Windows.Forms.Label();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -86,7 +90,7 @@
             // 
             this.containerBox.Controls.Add(this.tableLayoutPanel2);
             this.containerBox.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.containerBox.Location = new System.Drawing.Point(0, 123);
+            this.containerBox.Location = new System.Drawing.Point(0, 168);
             this.containerBox.Name = "containerBox";
             this.containerBox.Size = new System.Drawing.Size(1280, 597);
             this.containerBox.TabIndex = 28;
@@ -328,7 +332,7 @@
             this.SNDetails.Font = new System.Drawing.Font("微软雅黑", 12F);
             this.SNDetails.Location = new System.Drawing.Point(0, 0);
             this.SNDetails.Name = "SNDetails";
-            this.SNDetails.Size = new System.Drawing.Size(1280, 123);
+            this.SNDetails.Size = new System.Drawing.Size(1280, 168);
             this.SNDetails.TabIndex = 27;
             this.SNDetails.TabStop = false;
             this.SNDetails.Text = "产品序列信息";
@@ -353,13 +357,21 @@
             this.tableLayoutPanel1.Controls.Add(this.label3, 4, 0);
             this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0);
             this.tableLayoutPanel1.Controls.Add(this.serialNumber, 1, 0);
+            this.tableLayoutPanel1.Controls.Add(this.makeQtyLab, 0, 1);
+            this.tableLayoutPanel1.Controls.Add(this.makeQty, 2, 1);
+            this.tableLayoutPanel1.Controls.Add(this.stepCollectLab, 4, 1);
+            this.tableLayoutPanel1.Controls.Add(this.stepCollectQty, 6, 1);
+            this.tableLayoutPanel1.SetColumnSpan(this.makeQtyLab, 2);
+            this.tableLayoutPanel1.SetColumnSpan(this.makeQty, 2);
+            this.tableLayoutPanel1.SetColumnSpan(this.stepCollectLab, 2);
+            this.tableLayoutPanel1.SetColumnSpan(this.stepCollectQty, 2);
             this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 37);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 1;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 83F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(1274, 83);
+            this.tableLayoutPanel1.RowCount = 2;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(1274, 128);
             this.tableLayoutPanel1.TabIndex = 0;
             // 
             // productName
@@ -446,6 +458,48 @@
             this.serialNumber.TabIndex = 4;
             this.serialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
+            // makeQtyLab
+            // 
+            this.makeQtyLab.AutoSize = true;
+            this.makeQtyLab.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.makeQtyLab.Location = new System.Drawing.Point(3, 64);
+            this.makeQtyLab.Name = "makeQtyLab";
+            this.makeQtyLab.Size = new System.Drawing.Size(230, 64);
+            this.makeQtyLab.TabIndex = 8;
+            this.makeQtyLab.Text = "工单数量: ";
+            this.makeQtyLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // makeQty
+            // 
+            this.makeQty.AutoSize = true;
+            this.makeQty.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.makeQty.Location = new System.Drawing.Point(239, 64);
+            this.makeQty.Name = "makeQty";
+            this.makeQty.Size = new System.Drawing.Size(230, 64);
+            this.makeQty.TabIndex = 9;
+            this.makeQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // stepCollectLab
+            // 
+            this.stepCollectLab.AutoSize = true;
+            this.stepCollectLab.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.stepCollectLab.Location = new System.Drawing.Point(475, 64);
+            this.stepCollectLab.Name = "stepCollectLab";
+            this.stepCollectLab.Size = new System.Drawing.Size(244, 64);
+            this.stepCollectLab.TabIndex = 10;
+            this.stepCollectLab.Text = "工序已采集数: ";
+            this.stepCollectLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // stepCollectQty
+            // 
+            this.stepCollectQty.AutoSize = true;
+            this.stepCollectQty.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.stepCollectQty.Location = new System.Drawing.Point(725, 64);
+            this.stepCollectQty.Name = "stepCollectQty";
+            this.stepCollectQty.Size = new System.Drawing.Size(546, 64);
+            this.stepCollectQty.TabIndex = 11;
+            this.stepCollectQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
             // dataGridViewTextBoxColumn4
             // 
             this.dataGridViewTextBoxColumn4.DataPropertyName = "ps_processcode";
@@ -604,6 +658,10 @@
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label serialNumber;
+        private System.Windows.Forms.Label makeQtyLab;
+        private System.Windows.Forms.Label makeQty;
+        private System.Windows.Forms.Label stepCollectLab;
+        private System.Windows.Forms.Label stepCollectQty;
         private System.Windows.Forms.Panel containerBox;
         private System.Windows.Forms.DataGridView dgv;
         private System.Windows.Forms.Label snLab;

+ 31 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_ShipmentVerify.cs

@@ -216,6 +216,7 @@ namespace UAS_MES_NEW.Make
                     workOrder.Text = dt.Rows[0]["ma_code"].ToString();
                     productCode.Text = dt.Rows[0]["ma_prodcode"].ToString();
                     productName.Text = dt.Rows[0]["pr_spec"].ToString();
+                    LoadMakeSummary(workOrder.Text);
                 }
             }
 
@@ -319,6 +320,8 @@ namespace UAS_MES_NEW.Make
                 ShowMsg(Msg1, 2, afterMsg);
             if (failList.Count > 0)
                 ShowMsg(Msg1, 0, $"过站失败{failList.Count}条,序列号:{string.Join("、", failList)}");
+            if (successList.Count > 0)
+                LoadMakeSummary(workOrder.Text);
 
             if (snVal.Enabled)
             {
@@ -473,6 +476,8 @@ namespace UAS_MES_NEW.Make
                 workOrder.Text = "";
                 productCode.Text = "";
                 productName.Text = "";
+                makeQty.Text = "";
+                stepCollectQty.Text = "";
             }
             else if (type == "L")
             {
@@ -485,6 +490,7 @@ namespace UAS_MES_NEW.Make
                     workOrder.Text = dt.Rows[0]["ma_code"].ToString();
                     productCode.Text = dt.Rows[0]["pr_code"].ToString();
                     productName.Text = dt.Rows[0]["pr_spec"].ToString();
+                    LoadMakeSummary(workOrder.Text);
                 }
                 else
                 {
@@ -493,6 +499,31 @@ namespace UAS_MES_NEW.Make
             }
         }
 
+        private void LoadMakeSummary(string makeCode)
+        {
+            makeQty.Text = "";
+            stepCollectQty.Text = "";
+            if (string.IsNullOrEmpty(makeCode))
+                return;
+
+            string makeSql = makeCode.Replace("'", "''");
+            DataTable qtyDt = (DataTable)dh.ExecuteSql("select ma_qty from make where ma_code='" + makeSql + "'", "select");
+            if (qtyDt.Rows.Count > 0)
+                makeQty.Text = qtyDt.Rows[0]["ma_qty"].ToString();
+
+            string stepCode = User.CurrentStepCode ?? "";
+            if (string.IsNullOrEmpty(stepCode))
+                return;
+
+            string stepSql = stepCode.Replace("'", "''");
+            DataTable countDt = (DataTable)dh.ExecuteSql($@"SELECT COUNT(*) collect_qty FROM (
+                    SELECT mp_sncode FROM makeprocess
+                    WHERE mp_makecode = '{makeSql}' AND mp_stepcode = '{stepSql}'
+                    GROUP BY mp_sncode)", "select");
+            if (countDt.Rows.Count > 0)
+                stepCollectQty.Text = countDt.Rows[0]["collect_qty"].ToString();
+        }
+
         private void claerBtn_Click(object sender, EventArgs e)
         {
             Msg1.Clear();