Browse Source

Merge repos.ubtob.net:usoft/mes-client

callm 1 week ago
parent
commit
8fcf74e9b6

+ 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)
                 {

+ 166 - 29
UAS_MES_YTDZ/FunctionCode/Make/Make_ShipmentVerify.Designer.cs

@@ -37,10 +37,14 @@
             this.claerBtn = new System.Windows.Forms.Button();
             this.Delete = new System.Windows.Forms.Button();
             this.Confirm = new System.Windows.Forms.Button();
+            this.buttonRow = new System.Windows.Forms.FlowLayoutPanel();
             this.BoxQtyVal = new System.Windows.Forms.TextBox();
             this.BoxQtyLab = new System.Windows.Forms.Label();
             this.PanelQtyVal = new System.Windows.Forms.TextBox();
             this.PanelQtyLab = new System.Windows.Forms.Label();
+            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.snLab = new System.Windows.Forms.Label();
             this.snVal = new System.Windows.Forms.TextBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
@@ -59,6 +63,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();
@@ -76,6 +84,7 @@
             this.tableLayoutPanel2.SuspendLayout();
             this.tableLayoutPanel3.SuspendLayout();
             this.panel1.SuspendLayout();
+            this.buttonRow.SuspendLayout();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
             this.SNDetails.SuspendLayout();
@@ -86,7 +95,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;
@@ -117,8 +126,8 @@
             this.tableLayoutPanel3.Location = new System.Drawing.Point(771, 3);
             this.tableLayoutPanel3.Name = "tableLayoutPanel3";
             this.tableLayoutPanel3.RowCount = 2;
-            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
-            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60F));
+            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 210F));
+            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
             this.tableLayoutPanel3.Size = new System.Drawing.Size(506, 591);
             this.tableLayoutPanel3.TabIndex = 2;
             // 
@@ -135,29 +144,46 @@
             // 
             // panel1
             // 
-            this.panel1.Controls.Add(this.boxResetBtn);
-            this.panel1.Controls.Add(this.claerBtn);
-            this.panel1.Controls.Add(this.Delete);
-            this.panel1.Controls.Add(this.Confirm);
+            this.panel1.Controls.Add(this.buttonRow);
+            this.panel1.Controls.Add(this.LockMakeCode);
+            this.panel1.Controls.Add(this.ma_code);
+            this.panel1.Controls.Add(this.makeLab);
             this.panel1.Controls.Add(this.BoxQtyVal);
             this.panel1.Controls.Add(this.BoxQtyLab);
             this.panel1.Controls.Add(this.PanelQtyVal);
             this.panel1.Controls.Add(this.PanelQtyLab);
             this.panel1.Controls.Add(this.snLab);
             this.panel1.Controls.Add(this.snVal);
+            this.panel1.AutoScroll = true;
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Location = new System.Drawing.Point(3, 3);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(500, 230);
             this.panel1.TabIndex = 1;
             // 
+            // buttonRow
+            // 
+            this.buttonRow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.buttonRow.Controls.Add(this.Confirm);
+            this.buttonRow.Controls.Add(this.Delete);
+            this.buttonRow.Controls.Add(this.claerBtn);
+            this.buttonRow.Controls.Add(this.boxResetBtn);
+            this.buttonRow.Location = new System.Drawing.Point(8, 122);
+            this.buttonRow.Margin = new System.Windows.Forms.Padding(0);
+            this.buttonRow.Name = "buttonRow";
+            this.buttonRow.Size = new System.Drawing.Size(484, 76);
+            this.buttonRow.TabIndex = 27;
+            this.buttonRow.WrapContents = true;
+            // 
             // boxResetBtn
             // 
             this.boxResetBtn.Cursor = System.Windows.Forms.Cursors.Hand;
             this.boxResetBtn.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.boxResetBtn.Location = new System.Drawing.Point(364, 182);
+            this.boxResetBtn.Location = new System.Drawing.Point(246, 3);
+            this.boxResetBtn.Margin = new System.Windows.Forms.Padding(3);
             this.boxResetBtn.Name = "boxResetBtn";
-            this.boxResetBtn.Size = new System.Drawing.Size(120, 35);
+            this.boxResetBtn.Size = new System.Drawing.Size(96, 32);
             this.boxResetBtn.TabIndex = 23;
             this.boxResetBtn.Text = "容量归零";
             this.boxResetBtn.UseVisualStyleBackColor = true;
@@ -167,9 +193,10 @@
             // 
             this.claerBtn.Cursor = System.Windows.Forms.Cursors.Hand;
             this.claerBtn.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.claerBtn.Location = new System.Drawing.Point(246, 182);
+            this.claerBtn.Location = new System.Drawing.Point(147, 3);
+            this.claerBtn.Margin = new System.Windows.Forms.Padding(3);
             this.claerBtn.Name = "claerBtn";
-            this.claerBtn.Size = new System.Drawing.Size(110, 35);
+            this.claerBtn.Size = new System.Drawing.Size(96, 32);
             this.claerBtn.TabIndex = 21;
             this.claerBtn.Text = "清除提示";
             this.claerBtn.UseVisualStyleBackColor = true;
@@ -178,9 +205,10 @@
             // Delete
             // 
             this.Delete.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.Delete.Location = new System.Drawing.Point(174, 182);
+            this.Delete.Location = new System.Drawing.Point(77, 3);
+            this.Delete.Margin = new System.Windows.Forms.Padding(3);
             this.Delete.Name = "Delete";
-            this.Delete.Size = new System.Drawing.Size(64, 32);
+            this.Delete.Size = new System.Drawing.Size(68, 32);
             this.Delete.TabIndex = 20;
             this.Delete.Text = "删除";
             this.Delete.UseVisualStyleBackColor = true;
@@ -189,9 +217,10 @@
             // Confirm
             // 
             this.Confirm.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.Confirm.Location = new System.Drawing.Point(90, 182);
+            this.Confirm.Location = new System.Drawing.Point(3, 3);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(3);
             this.Confirm.Name = "Confirm";
-            this.Confirm.Size = new System.Drawing.Size(76, 32);
+            this.Confirm.Size = new System.Drawing.Size(68, 32);
             this.Confirm.TabIndex = 19;
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = true;
@@ -200,16 +229,16 @@
             // PanelQtyVal
             // 
             this.PanelQtyVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PanelQtyVal.Location = new System.Drawing.Point(90, 30);
+            this.PanelQtyVal.Location = new System.Drawing.Point(78, 46);
             this.PanelQtyVal.Name = "PanelQtyVal";
-            this.PanelQtyVal.Size = new System.Drawing.Size(64, 31);
+            this.PanelQtyVal.Size = new System.Drawing.Size(56, 31);
             this.PanelQtyVal.TabIndex = 18;
             // 
             // BoxQtyLab
             // 
             this.BoxQtyLab.AutoSize = true;
             this.BoxQtyLab.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BoxQtyLab.Location = new System.Drawing.Point(168, 30);
+            this.BoxQtyLab.Location = new System.Drawing.Point(146, 48);
             this.BoxQtyLab.Name = "BoxQtyLab";
             this.BoxQtyLab.Size = new System.Drawing.Size(128, 27);
             this.BoxQtyLab.TabIndex = 22;
@@ -218,9 +247,9 @@
             // BoxQtyVal
             // 
             this.BoxQtyVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BoxQtyVal.Location = new System.Drawing.Point(300, 30);
+            this.BoxQtyVal.Location = new System.Drawing.Point(268, 46);
             this.BoxQtyVal.Name = "BoxQtyVal";
-            this.BoxQtyVal.Size = new System.Drawing.Size(64, 31);
+            this.BoxQtyVal.Size = new System.Drawing.Size(56, 31);
             this.BoxQtyVal.TabIndex = 23;
             this.BoxQtyVal.Text = "0";
             // 
@@ -228,17 +257,64 @@
             // 
             this.PanelQtyLab.AutoSize = true;
             this.PanelQtyLab.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PanelQtyLab.Location = new System.Drawing.Point(14, 30);
+            this.PanelQtyLab.Location = new System.Drawing.Point(8, 48);
             this.PanelQtyLab.Name = "PanelQtyLab";
             this.PanelQtyLab.Size = new System.Drawing.Size(92, 27);
             this.PanelQtyLab.TabIndex = 17;
             this.PanelQtyLab.Text = "拼板数:";
             // 
+            // LockMakeCode
+            // 
+            this.LockMakeCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.LockMakeCode.AutoSize = true;
+            this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LockMakeCode.LeaveEvent = false;
+            this.LockMakeCode.Location = new System.Drawing.Point(420, 8);
+            this.LockMakeCode.Name = "LockMakeCode";
+            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
+            this.LockMakeCode.TabIndex = 26;
+            this.LockMakeCode.Text = "锁定";
+            this.LockMakeCode.UseVisualStyleBackColor = true;
+            // 
+            // ma_code
+            // 
+            this.ma_code.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(78, 4);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(330, 36);
+            this.ma_code.TabIndex = 25;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "ma_code";
+            this.ma_code.TextBoxEnable = true;
+            this.ma_code.DbChange += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox.DBSourceChange(this.ma_code_DbChange);
+            // 
+            // makeLab
+            // 
+            this.makeLab.AutoSize = true;
+            this.makeLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.makeLab.Location = new System.Drawing.Point(8, 10);
+            this.makeLab.Name = "makeLab";
+            this.makeLab.Size = new System.Drawing.Size(59, 28);
+            this.makeLab.TabIndex = 24;
+            this.makeLab.Text = "工单:";
+            // 
             // snLab
             // 
             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(14, 97);
+            this.snLab.Location = new System.Drawing.Point(8, 86);
             this.snLab.Name = "snLab";
             this.snLab.Size = new System.Drawing.Size(80, 28);
             this.snLab.TabIndex = 0;
@@ -246,10 +322,12 @@
             // 
             // snVal
             // 
+            this.snVal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
             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(90, 97);
+            this.snVal.Location = new System.Drawing.Point(78, 84);
             this.snVal.Name = "snVal";
-            this.snVal.Size = new System.Drawing.Size(360, 31);
+            this.snVal.Size = new System.Drawing.Size(410, 31);
             this.snVal.TabIndex = 1;
             this.snVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snVal_KeyDown);
             // 
@@ -328,7 +406,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 +431,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 +532,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";
@@ -581,6 +709,7 @@
             this.containerBox.ResumeLayout(false);
             this.tableLayoutPanel2.ResumeLayout(false);
             this.tableLayoutPanel3.ResumeLayout(false);
+            this.buttonRow.ResumeLayout(false);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
             this.groupBox1.ResumeLayout(false);
@@ -604,6 +733,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;
@@ -624,10 +757,14 @@
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
         private System.Windows.Forms.GroupBox groupBox1;
         private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.FlowLayoutPanel buttonRow;
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
         private CustomControl.RichText.RichTextAutoBottom Msg1;
         private System.Windows.Forms.Label PanelQtyLab;
         private System.Windows.Forms.TextBox PanelQtyVal;
+        private System.Windows.Forms.Label makeLab;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private System.Windows.Forms.Label BoxQtyLab;
         private System.Windows.Forms.TextBox BoxQtyVal;
         private System.Windows.Forms.Button Confirm;

+ 64 - 1
UAS_MES_YTDZ/FunctionCode/Make/Make_ShipmentVerify.cs

@@ -46,7 +46,24 @@ namespace UAS_MES_NEW.Make
             snVal.Enabled = false;
             if (string.IsNullOrEmpty(BoxQtyVal.Text))
                 BoxQtyVal.Text = "0";
-            PanelQtyVal.Focus();
+            LockMakeCode.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(LockMakeCode);
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_spec # 产品规格,ma_softversion # 软件版本,ma_salecode # 销售单号,pr_sendchecktype # 产品送检方式,pr_pcbacount # 拼版数";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec", "ma_softversion", "ma_salecode", "nvl(pr_sendchecktype,'LineCode')pr_sendchecktype", "pr_pcbacount" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.Focus();
+        }
+
+        private void ma_code_DbChange(object sender, EventArgs e)
+        {
+            BaseUtil.SetFormValue(this.Controls, ma_code.ReturnData);
+            string makeCode = ma_code.Text.Trim();
+            if (string.IsNullOrEmpty(makeCode))
+                return;
+            workOrder.Text = makeCode;
+            LoadMakeSummary(makeCode);
         }
 
         private void Confirm_Click(object sender, EventArgs e)
@@ -108,6 +125,13 @@ namespace UAS_MES_NEW.Make
             e.Handled = true;
             e.SuppressKeyPress = true;
 
+            if (string.IsNullOrEmpty(ma_code.Text.Trim()))
+            {
+                ShowMsg(Msg1, 0, "请先选择工单");
+                ma_code.Focus();
+                return;
+            }
+
             if (PanelQtyVal.Enabled || panelQty <= 0)
             {
                 ShowMsg(Msg1, 0, "请先确认拼板数量");
@@ -137,6 +161,14 @@ namespace UAS_MES_NEW.Make
             {
                 string snCode = dt.Rows[0]["ms_sncode"].ToString();
                 string makeCode = dt.Rows[0]["ms_makecode"].ToString();
+                string filterMake = ma_code.Text.Trim();
+                if (!string.IsNullOrEmpty(filterMake) && !string.Equals(filterMake, makeCode, StringComparison.OrdinalIgnoreCase))
+                {
+                    ShowMsg(Msg1, 0, "序列号不属于当前工单");
+                    snVal.Focus();
+                    snVal.SelectAll();
+                    return;
+                }
 
                 foreach (DataRow row in data.Rows)
                 {
@@ -216,6 +248,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 +352,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 +508,8 @@ namespace UAS_MES_NEW.Make
                 workOrder.Text = "";
                 productCode.Text = "";
                 productName.Text = "";
+                makeQty.Text = "";
+                stepCollectQty.Text = "";
             }
             else if (type == "L")
             {
@@ -485,6 +522,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 +531,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();

+ 5 - 2
UAS_MES_YTDZ/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -639,14 +639,15 @@
             this.oi_sampleqty,
             this.oi_checkqty,
             this.oi_ng,
-            this.oi_leveldefect,
             this.ois_remark,
+            this.oi_leveldefect,
             this.ois_status});
             this.CheckTypeDGV.Location = new System.Drawing.Point(21, 214);
             this.CheckTypeDGV.Margin = new System.Windows.Forms.Padding(4);
             this.CheckTypeDGV.Name = "CheckTypeDGV";
             this.CheckTypeDGV.RowHeadersWidth = 20;
             this.CheckTypeDGV.RowTemplate.Height = 23;
+            this.CheckTypeDGV.ScrollBars = System.Windows.Forms.ScrollBars.Both;
             this.CheckTypeDGV.Size = new System.Drawing.Size(589, 415);
             this.CheckTypeDGV.TabIndex = 198;
             this.CheckTypeDGV.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellValueChanged);
@@ -675,6 +676,7 @@
             dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
             this.ci_name.DefaultCellStyle = dataGridViewCellStyle1;
             this.ci_name.HeaderText = "项目名称";
+            this.ci_name.MinimumWidth = 132;
             this.ci_name.Name = "ci_name";
             this.ci_name.ReadOnly = true;
             // 
@@ -718,8 +720,9 @@
             // 
             this.ois_remark.DataPropertyName = "ois_remark";
             this.ois_remark.HeaderText = "备注";
+            this.ois_remark.MinimumWidth = 120;
             this.ois_remark.Name = "ois_remark";
-            this.ois_remark.Visible = false;
+            this.ois_remark.Width = 120;
             // 
             // ois_status
             // 

+ 14 - 0
UAS_MES_YTDZ/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -49,6 +49,20 @@ namespace UAS_MES_NEW.OQC
         {
             if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
+                if (!string.IsNullOrEmpty(obd_outboxcode.Text))
+                {
+                    string currentSn = string.IsNullOrEmpty(ms_sncode.Text) ? sncode.Text : ms_sncode.Text;
+                    string boxCode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_sncode = '" + currentSn + "'").ToString();
+                    if (boxCode != obd_outboxcode.Text)
+                    {
+                        DialogResult confirm = MessageBox.Show("当前序列号所属箱号" + boxCode + "与上一序列号箱号" + obd_outboxcode.Text + "不一致,是否生成新的检验批?请注意之前批次产品抽检!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+                        if (confirm != DialogResult.Yes)
+                            return;
+                        ob_checkno.Text = "";
+                        obd_outboxcode.Text = boxCode;
+                    }
+                }
+
                 DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno", "ms_reworkstatus" }, "(ms_sncode)='" + sncode.Text + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {