Browse Source

新增维修回流确认和钢网张力限制

yhluo 5 days ago
parent
commit
666ec3e333

+ 55 - 17
UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.cs

@@ -28,6 +28,11 @@ namespace UAS_MES_NEW.Make
         public Make_SMTStencil()
         {
             InitializeComponent();
+            ST_ENSIONA.Validating += ST_ENSION_Validating;
+            ST_ENSIONB.Validating += ST_ENSION_Validating;
+            ST_ENSIONC.Validating += ST_ENSION_Validating;
+            ST_ENSIOND.Validating += ST_ENSION_Validating;
+            ST_ENSIONE.Validating += ST_ENSION_Validating;
             SU_DEVCODE.Enabled = false;
             st_combinenumber.Enabled = false;
             SU_DEVCODE1.Enabled = false;
@@ -203,6 +208,11 @@ namespace UAS_MES_NEW.Make
         {
             if (ST_ENSIONA.Text != "" && ST_ENSIONB.Text != "" && ST_ENSIONC.Text != "" && ST_ENSIOND.Text != "" && ST_ENSIONE.Text != "")
             {
+                if (!TensionValuesInRange())
+                {
+                    MessageBox.Show("张力测试结果只允许输入30~50");
+                    return;
+                }
                 DataTable dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED' and st_kind = '钢网'", "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -408,7 +418,44 @@ namespace UAS_MES_NEW.Make
         }
 
 
-        //默认范围39-55,如不在范围内则可以报废
+        private const double TensionMin = 30;
+        private const double TensionMax = 50;
+        private bool tensionRangeChecking;
+
+        private bool IsTensionValueInRange(string text)
+        {
+            double value;
+            return double.TryParse(text, out value) && value >= TensionMin && value <= TensionMax;
+        }
+
+        private bool TensionValuesInRange()
+        {
+            return IsTensionValueInRange(ST_ENSIONA.Text)
+                && IsTensionValueInRange(ST_ENSIONB.Text)
+                && IsTensionValueInRange(ST_ENSIONC.Text)
+                && IsTensionValueInRange(ST_ENSIOND.Text)
+                && IsTensionValueInRange(ST_ENSIONE.Text);
+        }
+
+        private void ST_ENSION_Validating(object sender, CancelEventArgs e)
+        {
+            TextBox box = sender as TextBox;
+            if (box == null || tensionRangeChecking || string.IsNullOrWhiteSpace(box.Text))
+            {
+                return;
+            }
+            if (!IsTensionValueInRange(box.Text))
+            {
+                tensionRangeChecking = true;
+                e.Cancel = true;
+                string point = box.Name.Substring(box.Name.Length - 1);
+                MessageBox.Show("张力测试结果" + point + "只允许输入30~50");
+                box.SelectAll();
+                tensionRangeChecking = false;
+            }
+        }
+
+        //张力结果只允许30~50,五项都在范围内才允许退回,否则可以报废
         private void ST_ENSION_TextChanged(object sender, EventArgs e)
         {
             double Range = 0;
@@ -425,23 +472,9 @@ namespace UAS_MES_NEW.Make
                 if (item != "")
                 {
                     FillCount = FillCount + 1;
-                    if (double.TryParse(item, out Range))
+                    if (double.TryParse(item, out Range) && Range >= TensionMin && Range <= TensionMax)
                     {
-                        //如果使用过张力范围39-55,使用过30-55
-                        if (ifUsed)
-                        {
-                            if (Range > 30 && Range <= 50)
-                            {
-                                CheckCount = CheckCount + 1;
-                            }
-                        }
-                        else
-                        {
-                            if (Range > 30 && Range <= 50)
-                            {
-                                CheckCount = CheckCount + 1;
-                            }
-                        }
+                        CheckCount = CheckCount + 1;
                     }
                 }
             }
@@ -571,6 +604,11 @@ namespace UAS_MES_NEW.Make
                 MessageBox.Show("请维护张力结果");
                 return;
             }
+            if (!TensionValuesInRange())
+            {
+                MessageBox.Show("张力测试结果只允许输入30~50");
+                return;
+            }
 
             if (string.IsNullOrEmpty(cleanEmpVal.Text))
             {

+ 663 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_RepairQualityConfirm.Designer.cs

@@ -0,0 +1,663 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_RepairQualityConfirm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.containerBox = new System.Windows.Forms.Panel();
+            this.dgv = new System.Windows.Forms.DataGridView();
+            this.executeBox = new System.Windows.Forms.Panel();
+            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.mb_linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.submit = new System.Windows.Forms.Button();
+            this.snVal = new System.Windows.Forms.TextBox();
+            this.snLab = new System.Windows.Forms.Label();
+            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.productName = new System.Windows.Forms.Label();
+            this.productCode = new System.Windows.Forms.Label();
+            this.workOrder = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.serialNumber = new System.Windows.Forms.Label();
+            this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.rn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ps_linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ps_table = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_location = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_devlocation = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            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();
+            this.SNDetails.SuspendLayout();
+            this.tableLayoutPanel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // containerBox
+            // 
+            this.containerBox.Controls.Add(this.dgv);
+            this.containerBox.Controls.Add(this.executeBox);
+            this.containerBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.containerBox.Location = new System.Drawing.Point(0, 123);
+            this.containerBox.Name = "containerBox";
+            this.containerBox.Size = new System.Drawing.Size(1280, 597);
+            this.containerBox.TabIndex = 28;
+            // 
+            // dgv
+            // 
+            this.dgv.AllowUserToAddRows = false;
+            this.dgv.AllowUserToDeleteRows = false;
+            this.dgv.AllowUserToResizeRows = false;
+            this.dgv.BackgroundColor = System.Drawing.SystemColors.Control;
+            this.dgv.ColumnHeadersDefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+            this.dgv.ColumnHeadersHeight = 36;
+            this.dgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.rn,
+            this.ms_sncode,
+            this.mb_linecode,
+            this.psl_location,
+            this.ps_linecode,
+            this.ReelNum,
+            this.psl_devlocation,
+            this.psl_prodcode,
+            this.ps_table,
+            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, 441);
+            this.dgv.TabIndex = 1;
+            // 
+            // executeBox
+            // 
+            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, 441);
+            this.executeBox.Name = "executeBox";
+            this.executeBox.Size = new System.Drawing.Size(1280, 156);
+            this.executeBox.TabIndex = 0;
+            // 
+            // LockMakeCode
+            // 
+            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(404, 18);
+            this.LockMakeCode.Name = "LockMakeCode";
+            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
+            this.LockMakeCode.TabIndex = 8;
+            this.LockMakeCode.Text = "锁定";
+            this.LockMakeCode.UseVisualStyleBackColor = true;
+            // 
+            // ma_code
+            // 
+            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(114, 14);
+            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(280, 36);
+            this.ma_code.TabIndex = 7;
+            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(38, 20);
+            this.makeLab.Name = "makeLab";
+            this.makeLab.Size = new System.Drawing.Size(59, 28);
+            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, 104);
+            this.submit.Name = "submit";
+            this.submit.Size = new System.Drawing.Size(140, 32);
+            this.submit.TabIndex = 5;
+            this.submit.Text = "品质确认";
+            this.submit.UseVisualStyleBackColor = true;
+            this.submit.Click += new System.EventHandler(this.submit_Click);
+            // 
+            // 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, 106);
+            this.snVal.Name = "snVal";
+            this.snVal.Size = new System.Drawing.Size(263, 31);
+            this.snVal.TabIndex = 1;
+            this.snVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snVal_KeyDown);
+            // 
+            // 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(38, 108);
+            this.snLab.Name = "snLab";
+            this.snLab.Size = new System.Drawing.Size(80, 28);
+            this.snLab.TabIndex = 0;
+            this.snLab.Text = "序列号:";
+            // 
+            // dataGridViewTextBoxColumn1
+            // 
+            this.dataGridViewTextBoxColumn1.DataPropertyName = "rn";
+            this.dataGridViewTextBoxColumn1.HeaderText = "序号";
+            this.dataGridViewTextBoxColumn1.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.ReadOnly = true;
+            this.dataGridViewTextBoxColumn1.Width = 60;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.DataPropertyName = "ms_sncode";
+            this.dataGridViewTextBoxColumn2.HeaderText = "序列号";
+            this.dataGridViewTextBoxColumn2.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.ReadOnly = true;
+            this.dataGridViewTextBoxColumn2.Width = 130;
+            // 
+            // dataGridViewTextBoxColumn3
+            // 
+            this.dataGridViewTextBoxColumn3.DataPropertyName = "ps_linecode";
+            this.dataGridViewTextBoxColumn3.HeaderText = "线体";
+            this.dataGridViewTextBoxColumn3.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.ReadOnly = true;
+            this.dataGridViewTextBoxColumn3.Width = 150;
+            // 
+            // dataGridViewTextBoxColumn4
+            // 
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "ps_processcode";
+            this.dataGridViewTextBoxColumn4.HeaderText = "机台名称";
+            this.dataGridViewTextBoxColumn4.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.ReadOnly = true;
+            this.dataGridViewTextBoxColumn4.Visible = false;
+            this.dataGridViewTextBoxColumn4.Width = 190;
+            // 
+            // dataGridViewTextBoxColumn5
+            // 
+            this.dataGridViewTextBoxColumn5.DataPropertyName = "ps_table";
+            this.dataGridViewTextBoxColumn5.HeaderText = "面别";
+            this.dataGridViewTextBoxColumn5.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.ReadOnly = true;
+            this.dataGridViewTextBoxColumn5.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "psl_location";
+            this.dataGridViewTextBoxColumn6.HeaderText = "站位编号";
+            this.dataGridViewTextBoxColumn6.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.Width = 90;
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "psl_bomlocation";
+            this.dataGridViewTextBoxColumn7.HeaderText = "元件位置";
+            this.dataGridViewTextBoxColumn7.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.ReadOnly = true;
+            this.dataGridViewTextBoxColumn7.Width = 210;
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.DataPropertyName = "psl_prodcode";
+            this.dataGridViewTextBoxColumn8.HeaderText = "物料编号";
+            this.dataGridViewTextBoxColumn8.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.ReadOnly = true;
+            this.dataGridViewTextBoxColumn8.Width = 140;
+            // 
+            // dataGridViewTextBoxColumn9
+            // 
+            this.dataGridViewTextBoxColumn9.DataPropertyName = "psl_baseqty";
+            this.dataGridViewTextBoxColumn9.HeaderText = "单位用量";
+            this.dataGridViewTextBoxColumn9.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
+            this.dataGridViewTextBoxColumn9.ReadOnly = true;
+            this.dataGridViewTextBoxColumn9.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn10
+            // 
+            this.dataGridViewTextBoxColumn10.DataPropertyName = "ReelRemark";
+            this.dataGridViewTextBoxColumn10.HeaderText = "元件信息备注";
+            this.dataGridViewTextBoxColumn10.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
+            this.dataGridViewTextBoxColumn10.ReadOnly = true;
+            this.dataGridViewTextBoxColumn10.Width = 150;
+            // 
+            // SNDetails
+            // 
+            this.SNDetails.BorderColor = System.Drawing.Color.Black;
+            this.SNDetails.Controls.Add(this.tableLayoutPanel1);
+            this.SNDetails.Dock = System.Windows.Forms.DockStyle.Top;
+            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.TabIndex = 27;
+            this.SNDetails.TabStop = false;
+            this.SNDetails.Text = "产品序列信息";
+            this.SNDetails.TextColor = System.Drawing.Color.Black;
+            // 
+            // tableLayoutPanel1
+            // 
+            this.tableLayoutPanel1.ColumnCount = 8;
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.09677F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.09677F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 13.19F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 36.81F));
+            this.tableLayoutPanel1.Controls.Add(this.productName, 7, 0);
+            this.tableLayoutPanel1.Controls.Add(this.productCode, 5, 0);
+            this.tableLayoutPanel1.Controls.Add(this.workOrder, 3, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label4, 6, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
+            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.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.TabIndex = 0;
+            // 
+            // productName
+            // 
+            this.productName.AutoSize = true;
+            this.productName.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.productName.Location = new System.Drawing.Point(807, 0);
+            this.productName.Name = "productName";
+            this.productName.Size = new System.Drawing.Size(464, 83);
+            this.productName.TabIndex = 7;
+            this.productName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // productCode
+            // 
+            this.productCode.AutoSize = true;
+            this.productCode.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.productCode.Location = new System.Drawing.Point(557, 0);
+            this.productCode.Name = "productCode";
+            this.productCode.Size = new System.Drawing.Size(162, 83);
+            this.productCode.TabIndex = 6;
+            this.productCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // workOrder
+            // 
+            this.workOrder.AutoSize = true;
+            this.workOrder.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.workOrder.Location = new System.Drawing.Point(321, 0);
+            this.workOrder.Name = "workOrder";
+            this.workOrder.Size = new System.Drawing.Size(148, 83);
+            this.workOrder.TabIndex = 5;
+            this.workOrder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label4.Location = new System.Drawing.Point(725, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(76, 83);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "产品名称: ";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label1.Location = new System.Drawing.Point(3, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(76, 83);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "序列号: ";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label3.Location = new System.Drawing.Point(475, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(76, 83);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "产品编号: ";
+            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label2.Location = new System.Drawing.Point(239, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(76, 83);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "工单: ";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // serialNumber
+            // 
+            this.serialNumber.AutoSize = true;
+            this.serialNumber.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.serialNumber.Location = new System.Drawing.Point(85, 0);
+            this.serialNumber.Name = "serialNumber";
+            this.serialNumber.Size = new System.Drawing.Size(148, 83);
+            this.serialNumber.TabIndex = 4;
+            this.serialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // dataGridViewCheckBoxColumn1
+            // 
+            this.dataGridViewCheckBoxColumn1.HeaderText = "是否手补料";
+            this.dataGridViewCheckBoxColumn1.MinimumWidth = 8;
+            this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
+            this.dataGridViewCheckBoxColumn1.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn11
+            // 
+            this.dataGridViewTextBoxColumn11.DataPropertyName = "ReelNum";
+            this.dataGridViewTextBoxColumn11.HeaderText = "补料数量";
+            this.dataGridViewTextBoxColumn11.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
+            this.dataGridViewTextBoxColumn11.Visible = false;
+            this.dataGridViewTextBoxColumn11.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn12
+            // 
+            this.dataGridViewTextBoxColumn12.DataPropertyName = "ReelNum";
+            this.dataGridViewTextBoxColumn12.HeaderText = "补料数量";
+            this.dataGridViewTextBoxColumn12.MinimumWidth = 8;
+            this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
+            this.dataGridViewTextBoxColumn12.Visible = false;
+            this.dataGridViewTextBoxColumn12.Width = 80;
+            // 
+            // rn
+            // 
+            this.rn.DataPropertyName = "rn";
+            this.rn.HeaderText = "序号";
+            this.rn.MinimumWidth = 8;
+            this.rn.Name = "rn";
+            this.rn.ReadOnly = true;
+            this.rn.Width = 60;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.DataPropertyName = "mb_makecode";
+            this.ms_sncode.HeaderText = "制造单号";
+            this.ms_sncode.MinimumWidth = 8;
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.ReadOnly = true;
+            this.ms_sncode.Width = 155;
+            // 
+            // ps_linecode
+            // 
+            this.ps_linecode.DataPropertyName = "mb_sncode";
+            this.ps_linecode.HeaderText = "序列号";
+            this.ps_linecode.MinimumWidth = 8;
+            this.ps_linecode.Name = "ps_linecode";
+            this.ps_linecode.ReadOnly = true;
+            this.ps_linecode.Width = 210;
+            // 
+            // ps_table
+            // 
+            this.ps_table.DataPropertyName = "mb_indate";
+            this.ps_table.HeaderText = "不良记录时间";
+            this.ps_table.MinimumWidth = 8;
+            this.ps_table.Name = "ps_table";
+            this.ps_table.ReadOnly = true;
+            this.ps_table.Width = 175;
+            // 
+            // psl_location
+            // 
+            this.psl_location.DataPropertyName = "mb_stepcode";
+            this.psl_location.HeaderText = "不良工序";
+            this.psl_location.MinimumWidth = 8;
+            this.psl_location.Name = "psl_location";
+            this.psl_location.ReadOnly = true;
+            this.psl_location.Width = 100;
+            // 
+            // psl_devlocation
+            // 
+            this.psl_devlocation.DataPropertyName = "mb_badcode";
+            this.psl_devlocation.HeaderText = "不良代码";
+            this.psl_devlocation.MinimumWidth = 8;
+            this.psl_devlocation.Name = "psl_devlocation";
+            this.psl_devlocation.ReadOnly = true;
+            this.psl_devlocation.Width = 100;
+            // 
+            // psl_prodcode
+            // 
+            this.psl_prodcode.DataPropertyName = "mb_status";
+            this.psl_prodcode.HeaderText = "维修状态";
+            this.psl_prodcode.MinimumWidth = 8;
+            this.psl_prodcode.Name = "psl_prodcode";
+            this.psl_prodcode.ReadOnly = true;
+            this.psl_prodcode.Width = 100;
+            // 
+            // psl_baseqty
+            // 
+            this.psl_baseqty.DataPropertyName = "mb_bgcode";
+            this.psl_baseqty.HeaderText = "不良代码组代码";
+            this.psl_baseqty.MinimumWidth = 8;
+            this.psl_baseqty.Name = "psl_baseqty";
+            this.psl_baseqty.ReadOnly = true;
+            this.psl_baseqty.Width = 110;
+            // 
+            // ReelRemark
+            // 
+            this.ReelRemark.DataPropertyName = "mb_bgname";
+            this.ReelRemark.HeaderText = "代码组名称";
+            this.ReelRemark.MinimumWidth = 8;
+            this.ReelRemark.Name = "ReelRemark";
+            this.ReelRemark.ReadOnly = true;
+            this.ReelRemark.Width = 140;
+            // 
+            // ReelNum
+            // 
+            this.ReelNum.DataPropertyName = "mb_badname";
+            this.ReelNum.HeaderText = "不良名称";
+            this.ReelNum.MinimumWidth = 8;
+            this.ReelNum.Name = "ReelNum";
+            this.ReelNum.ReadOnly = true;
+            this.ReelNum.Width = 120;
+            // 
+            // mb_linecode
+            // 
+            this.mb_linecode.DataPropertyName = "mb_linecode";
+            this.mb_linecode.HeaderText = "线体";
+            this.mb_linecode.MinimumWidth = 8;
+            this.mb_linecode.Name = "mb_linecode";
+            this.mb_linecode.ReadOnly = true;
+            this.mb_linecode.Width = 90;
+            // 
+            // qa_result
+            // 
+            this.qa_result.DataPropertyName = "mb_qa_confirm";
+            this.qa_result.HeaderText = "维修品质确认";
+            this.qa_result.MinimumWidth = 8;
+            this.qa_result.Name = "qa_result";
+            this.qa_result.ReadOnly = true;
+            this.qa_result.Width = 130;
+            // 
+            // Make_RepairQualityConfirm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1280, 720);
+            this.Controls.Add(this.containerBox);
+            this.Controls.Add(this.SNDetails);
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Make_RepairQualityConfirm";
+            this.Text = "维修后品质确认";
+            this.Load += new System.EventHandler(this.Make_RepairQualityConfirm_Load);
+            this.containerBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
+            this.executeBox.ResumeLayout(false);
+            this.executeBox.PerformLayout();
+            this.SNDetails.ResumeLayout(false);
+            this.tableLayoutPanel1.ResumeLayout(false);
+            this.tableLayoutPanel1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder SNDetails;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+        private System.Windows.Forms.Label productName;
+        private System.Windows.Forms.Label productCode;
+        private System.Windows.Forms.Label workOrder;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label serialNumber;
+        private System.Windows.Forms.Panel containerBox;
+        private System.Windows.Forms.DataGridView dgv;
+        private System.Windows.Forms.Panel executeBox;
+        private System.Windows.Forms.Label snLab;
+        private System.Windows.Forms.TextBox snVal;
+        private System.Windows.Forms.Label makeLab;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
+        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;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ps_table;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_location;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_devlocation;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_baseqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ReelRemark;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ReelNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mb_linecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn qa_result;
+    }
+}

+ 395 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_RepairQualityConfirm.cs

@@ -0,0 +1,395 @@
+using DevComponents.DotNetBar.Controls;
+using NPOI.SS.Formula.Eval;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.SqlClient;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_RepairQualityConfirm : Form
+    {
+        public Make_RepairQualityConfirm()
+        {
+            InitializeComponent();
+        }
+
+        StringBuilder SQL = new StringBuilder();
+        DataTable dt, data;
+        DataHelper dh;
+        bool qaSwitching;
+
+        private void Make_RepairQualityConfirm_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+            dgv.AutoGenerateColumns = false;
+
+            data = new DataTable();
+            data.Columns.Add("isScan", typeof(bool));
+            data.Columns.Add("rn", typeof(int));
+            data.Columns.Add("mb_id", typeof(string));
+            data.Columns.Add("mb_makecode", typeof(string));
+            data.Columns.Add("mb_sncode", typeof(string));
+            data.Columns.Add("mb_indate", typeof(string));
+            data.Columns.Add("mb_stepcode", typeof(string));
+            data.Columns.Add("mb_badcode", typeof(string));
+            data.Columns.Add("mb_status", typeof(string));
+            data.Columns.Add("mb_bgcode", typeof(string));
+            data.Columns.Add("mb_bgname", typeof(string));
+            data.Columns.Add("mb_badname", typeof(string));
+            data.Columns.Add("mb_linecode", typeof(string));
+            data.Columns.Add("qa_type", typeof(string));
+            data.Columns.Add("mb_qa_confirm", typeof(string));
+            dgv.DataSource = data;
+
+            submit.Enabled = false;
+            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);
+            LoadMakeBad();
+        }
+
+        private void LoadMakeBad()
+        {
+            string makeCode = ma_code.Text.Trim();
+            if (string.IsNullOrEmpty(makeCode))
+            {
+                MessageBox.Show("请输入工单", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                ma_code.Focus();
+                return;
+            }
+
+            SQL.Clear();
+            SQL.Append($@"SELECT mb_id, mb_makecode, mb_sncode,
+                to_char(mb_indate, 'yyyy-mm-dd hh24:mi:ss') mb_indate, mb_stepcode, mb_badcode,
+                mb_status, mb_bgcode, mb_bgname, mb_badname, mb_linecode, mb_qa_confirm
+                FROM makebad WHERE mb_makecode = '{makeCode}'
+                ORDER BY mb_sncode, mb_id");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+
+            data.Rows.Clear();
+            if (dt.Rows.Count == 0)
+            {
+                submit.Enabled = false;
+                MessageBox.Show("该工单没有不良记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                ma_code.Focus();
+                return;
+            }
+
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                DataRow src = dt.Rows[i];
+                string qaType = NormalizeQaType(src["mb_qa_confirm"]);
+                DataRow row = data.NewRow();
+                row["isScan"] = false;
+                row["rn"] = i + 1;
+                row["mb_id"] = src["mb_id"].ToString();
+                row["mb_makecode"] = src["mb_makecode"].ToString();
+                row["mb_sncode"] = src["mb_sncode"].ToString();
+                row["mb_indate"] = src["mb_indate"].ToString();
+                row["mb_stepcode"] = src["mb_stepcode"].ToString();
+                row["mb_badcode"] = src["mb_badcode"].ToString();
+                row["mb_status"] = StatusText(src["mb_status"]);
+                row["mb_bgcode"] = src["mb_bgcode"].ToString();
+                row["mb_bgname"] = src["mb_bgname"].ToString();
+                row["mb_badname"] = src["mb_badname"].ToString();
+                row["mb_linecode"] = src["mb_linecode"].ToString();
+                row["qa_type"] = qaType;
+                row["mb_qa_confirm"] = QaTypeText(qaType);
+                data.Rows.Add(row);
+            }
+
+            ApplyLoadedStyle();
+
+            submit.Enabled = true;
+            snVal.Text = "";
+            snVal.Focus();
+        }
+
+        private void snVal_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode != Keys.Enter) return;
+
+            e.Handled = true;
+            e.SuppressKeyPress = true;
+
+            string scanSn = snVal.Text.Replace(";", ";").Trim();
+            snVal.Text = scanSn;
+            if (string.IsNullOrEmpty(scanSn))
+            {
+                MessageBox.Show("请扫描序列号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                snVal.Focus();
+                return;
+            }
+
+            if (data.Rows.Count == 0)
+            {
+                MessageBox.Show("请先输入工单", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                ma_code.Focus();
+                return;
+            }
+
+            string qaType = SelectedQaType();
+            if (qaType == "")
+            {
+                MessageBox.Show("请先选择合格或不合格", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            bool found = false;
+            bool already = true;
+            int firstRow = -1;
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                if (!string.Equals(data.Rows[i]["mb_sncode"].ToString(), scanSn, StringComparison.OrdinalIgnoreCase))
+                    continue;
+
+                found = true;
+                if (firstRow < 0)
+                    firstRow = i;
+                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;
+                MarkScanRow(i, qaType);
+            }
+
+            if (!found)
+            {
+                UpdateSN("C");
+                MessageBox.Show("该序列号不在当前工单不良记录中", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            }
+            else
+            {
+                UpdateSN("L", scanSn);
+                if (already)
+                    MessageBox.Show("序列号已标记", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                else if (firstRow >= 0)
+                    dgv.FirstDisplayedScrollingRowIndex = firstRow;
+            }
+
+            snVal.Focus();
+            snVal.SelectAll();
+        }
+
+        private void submit_Click(object sender, EventArgs e)
+        {
+            if (data.Rows.Count == 0)
+            {
+                MessageBox.Show("请先输入工单", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                ma_code.Focus();
+                return;
+            }
+
+            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["mb_sncode"].ToString();
+                string badCode = row["mb_badcode"].ToString();
+                string qaType = NormalizeQaType(row["qa_type"]);
+                if (qaType == "")
+                {
+                    missing.Add("序列号" + sn + "不良代码" + badCode);
+                    continue;
+                }
+                scanRows.Add(row);
+            }
+
+            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();
+                return;
+            }
+
+            try
+            {
+                foreach (DataRow row in scanRows)
+                {
+                    string idSql = row["mb_id"].ToString();
+                    string qaType = NormalizeQaType(row["qa_type"]);
+                    SQL.Clear();
+                    SQL.Append($@"UPDATE makebad SET mb_qa_confirm = '{qaType}' WHERE mb_id = '{idSql}'");
+                    dh.ExecuteSql(SQL.ToString(), "update");
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("品质确认失败:" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            List<string> snList = new List<string>();
+            foreach (DataRow row in scanRows)
+            {
+                string sn = row["mb_sncode"].ToString();
+                if (!snList.Contains(sn))
+                    snList.Add(sn);
+            }
+
+            MessageBox.Show($"序列号:{string.Join("、", snList)},数量{snList.Count},品质确认完成", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            MessageBox.Show("确认成功", "提示", 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 StatusText(object value)
+        {
+            string text = value == null || value == DBNull.Value ? "" : value.ToString().Trim();
+            decimal number;
+            if (decimal.TryParse(text, out number))
+            {
+                if (number == -1)
+                    return "已维修";
+                if (number == 0)
+                    return "未维修";
+                if (number == -2)
+                    return "报废";
+            }
+            return text;
+        }
+
+        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]["mb_qa_confirm"] = 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")
+            {
+                serialNumber.Text = "";
+                workOrder.Text = "";
+                productCode.Text = "";
+                productName.Text = "";
+            }
+            else if (type == "L")
+            {
+                SQL.Clear();
+                SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
+                        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)
+                {
+                    serialNumber.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    workOrder.Text = dt.Rows[0]["ma_code"].ToString();
+                    productCode.Text = dt.Rows[0]["pr_code"].ToString();
+                    productName.Text = dt.Rows[0]["pr_spec"].ToString();
+                }
+                else
+                {
+                    UpdateSN("C");
+                }
+            }
+        }
+    }
+}

+ 156 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_RepairQualityConfirm.resx

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="rn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_table.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_location.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_devlocation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_baseqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ReelRemark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ReelNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mb_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="qa_result.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 9 - 0
UAS_MES_YTDZ/UAS_MES_YTDZ.csproj

@@ -589,6 +589,12 @@
     <Compile Include="FunctionCode\Make\Make_HandFeedQualityConfirm.Designer.cs">
       <DependentUpon>Make_HandFeedQualityConfirm.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_RepairQualityConfirm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_RepairQualityConfirm.Designer.cs">
+      <DependentUpon>Make_RepairQualityConfirm.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_Humiture.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1412,6 +1418,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_HandFeedQualityConfirm.resx">
       <DependentUpon>Make_HandFeedQualityConfirm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_RepairQualityConfirm.resx">
+      <DependentUpon>Make_RepairQualityConfirm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_Humiture.resx">
       <DependentUpon>Make_Humiture.cs</DependentUpon>
     </EmbeddedResource>