Просмотр исходного кода

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

callm 1 неделя назад
Родитель
Сommit
3b7aa9c1ea

+ 2 - 2
UAS_MES_HYSX/FunctionCode/Make/Make_Repair.cs

@@ -743,11 +743,11 @@ namespace UAS_MES_NEW.Make
             }
             string mbr_id = dh.GetSEQ("makebadreason_seq");
             //存在不良组件进行提示
-            if (dh.CheckExist("makebadreason left join makebad on mbr_mbid=mb_id and mbr_sncode=mb_sncode", "mbr_badcode='" + bc_code.Text + "' and mbr_sncode='" + ms_sncode.Text + "' and mbr_brcode='" + nr_code.Text + "' and mb_status=0"))
+            /*if (dh.CheckExist("makebadreason left join makebad on mbr_mbid=mb_id and mbr_sncode=mb_sncode", "mbr_badcode='" + bc_code.Text + "' and mbr_sncode='" + ms_sncode.Text + "' and mbr_brcode='" + nr_code.Text + "' and mb_status=0"))
             {
                 OperatResult.AppendText(">>不良代码【" + bc_name.Text + "】已存在不良原因【" + nr_name.Text + "】\n", Color.Red);
                 return;
-            }
+            }*/
             if (!dh.CheckExist("QUA_NGREASONGROUP", "nrg_name='" + nrg_name.Text + "'"))
             {
                 OperatResult.AppendText(">>不良原因组不存在\n", Color.Red);

+ 649 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_PanelSmallBoard.Designer.cs

@@ -0,0 +1,649 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_PanelSmallBoard
+    {
+        /// <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.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+            this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+            this.Msg1 = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.buttonRow = new System.Windows.Forms.FlowLayoutPanel();
+            this.Confirm = new System.Windows.Forms.Button();
+            this.Delete = new System.Windows.Forms.Button();
+            this.claerBtn = new System.Windows.Forms.Button();
+            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.RecordStepChk = new System.Windows.Forms.CheckBox();
+            this.PanelQtyVal = new System.Windows.Forms.TextBox();
+            this.PanelQtyLab = 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();
+            this.dgv = new System.Windows.Forms.DataGridView();
+            this.rn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mainSnCol = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.scanTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.isDel = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.label2 = new System.Windows.Forms.Label();
+            this.workOrder = new System.Windows.Forms.Label();
+            this.makeQtyLab = new System.Windows.Forms.Label();
+            this.ma_qty = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.ma_prodcode = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.pr_spec = new System.Windows.Forms.Label();
+            this.mainSnLab = new System.Windows.Forms.Label();
+            this.mainSn = new System.Windows.Forms.Label();
+            this.stepCollectLab = new System.Windows.Forms.Label();
+            this.stepCollectQty = new System.Windows.Forms.Label();
+            this.collectLab = new System.Windows.Forms.Label();
+            this.collectQty = new System.Windows.Forms.Label();
+            this.containerBox.SuspendLayout();
+            this.tableLayoutPanel2.SuspendLayout();
+            this.tableLayoutPanel3.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.buttonRow.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
+            this.SNDetails.SuspendLayout();
+            this.tableLayoutPanel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // containerBox
+            // 
+            this.containerBox.Controls.Add(this.tableLayoutPanel2);
+            this.containerBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.containerBox.Location = new System.Drawing.Point(0, 168);
+            this.containerBox.Name = "containerBox";
+            this.containerBox.Size = new System.Drawing.Size(1280, 552);
+            this.containerBox.TabIndex = 28;
+            // 
+            // tableLayoutPanel2
+            // 
+            this.tableLayoutPanel2.ColumnCount = 2;
+            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
+            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
+            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+            this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 0);
+            this.tableLayoutPanel2.Controls.Add(this.groupBox1, 0, 0);
+            this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+            this.tableLayoutPanel2.RowCount = 1;
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel2.Size = new System.Drawing.Size(1280, 552);
+            this.tableLayoutPanel2.TabIndex = 2;
+            // 
+            // tableLayoutPanel3
+            // 
+            this.tableLayoutPanel3.ColumnCount = 1;
+            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel3.Controls.Add(this.Msg1, 0, 1);
+            this.tableLayoutPanel3.Controls.Add(this.panel1, 0, 0);
+            this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+            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.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, 546);
+            this.tableLayoutPanel3.TabIndex = 2;
+            // 
+            // Msg1
+            // 
+            this.Msg1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.Msg1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Msg1.Location = new System.Drawing.Point(4, 214);
+            this.Msg1.Margin = new System.Windows.Forms.Padding(4);
+            this.Msg1.Name = "Msg1";
+            this.Msg1.Size = new System.Drawing.Size(498, 328);
+            this.Msg1.TabIndex = 54;
+            this.Msg1.Text = "";
+            // 
+            // panel1
+            // 
+            this.panel1.AutoScroll = true;
+            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.RecordStepChk);
+            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.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, 204);
+            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.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;
+            // 
+            // Confirm
+            // 
+            this.Confirm.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Confirm.Location = new System.Drawing.Point(3, 3);
+            this.Confirm.Name = "Confirm";
+            this.Confirm.Size = new System.Drawing.Size(68, 32);
+            this.Confirm.TabIndex = 19;
+            this.Confirm.Text = "确认";
+            this.Confirm.UseVisualStyleBackColor = true;
+            this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
+            // 
+            // Delete
+            // 
+            this.Delete.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Delete.Location = new System.Drawing.Point(77, 3);
+            this.Delete.Name = "Delete";
+            this.Delete.Size = new System.Drawing.Size(68, 32);
+            this.Delete.TabIndex = 20;
+            this.Delete.Text = "删除";
+            this.Delete.UseVisualStyleBackColor = true;
+            this.Delete.Click += new System.EventHandler(this.Delete_Click);
+            // 
+            // claerBtn
+            // 
+            this.claerBtn.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.claerBtn.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.claerBtn.Location = new System.Drawing.Point(151, 3);
+            this.claerBtn.Name = "claerBtn";
+            this.claerBtn.Size = new System.Drawing.Size(96, 32);
+            this.claerBtn.TabIndex = 21;
+            this.claerBtn.Text = "清除提示";
+            this.claerBtn.UseVisualStyleBackColor = true;
+            this.claerBtn.Click += new System.EventHandler(this.claerBtn_Click);
+            // 
+            // 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.AllPower = null;
+            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.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 = "工单:";
+            // 
+            // RecordStepChk
+            // 
+            this.RecordStepChk.AutoSize = true;
+            this.RecordStepChk.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.RecordStepChk.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.RecordStepChk.Location = new System.Drawing.Point(160, 48);
+            this.RecordStepChk.Name = "RecordStepChk";
+            this.RecordStepChk.Size = new System.Drawing.Size(158, 31);
+            this.RecordStepChk.TabIndex = 22;
+            this.RecordStepChk.Text = "是否记录过站";
+            this.RecordStepChk.UseVisualStyleBackColor = true;
+            this.RecordStepChk.Visible = false;
+            // 
+            // 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(78, 46);
+            this.PanelQtyVal.Name = "PanelQtyVal";
+            this.PanelQtyVal.Size = new System.Drawing.Size(56, 31);
+            this.PanelQtyVal.TabIndex = 18;
+            // 
+            // PanelQtyLab
+            // 
+            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(8, 48);
+            this.PanelQtyLab.Name = "PanelQtyLab";
+            this.PanelQtyLab.Size = new System.Drawing.Size(92, 27);
+            this.PanelQtyLab.TabIndex = 17;
+            this.PanelQtyLab.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(8, 86);
+            this.snLab.Name = "snLab";
+            this.snLab.Size = new System.Drawing.Size(80, 28);
+            this.snLab.TabIndex = 0;
+            this.snLab.Text = "序列号:";
+            // 
+            // 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(78, 84);
+            this.snVal.Name = "snVal";
+            this.snVal.Size = new System.Drawing.Size(410, 31);
+            this.snVal.TabIndex = 1;
+            this.snVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snVal_KeyDown);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.dgv);
+            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.groupBox1.Location = new System.Drawing.Point(3, 3);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(762, 546);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "拼板所属小板信息";
+            // 
+            // dgv
+            // 
+            this.dgv.AllowUserToAddRows = false;
+            this.dgv.AllowUserToDeleteRows = false;
+            this.dgv.AllowUserToResizeRows = false;
+            this.dgv.BackgroundColor = System.Drawing.SystemColors.Control;
+            this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.rn,
+            this.ms_makecode,
+            this.mainSnCol,
+            this.ms_sncode,
+            this.scanTime,
+            this.isDel});
+            this.dgv.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dgv.Location = new System.Drawing.Point(3, 27);
+            this.dgv.Name = "dgv";
+            this.dgv.RowHeadersVisible = false;
+            this.dgv.RowHeadersWidth = 62;
+            this.dgv.RowTemplate.Height = 30;
+            this.dgv.Size = new System.Drawing.Size(756, 516);
+            this.dgv.TabIndex = 1;
+            this.dgv.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_CellClick);
+            // 
+            // rn
+            // 
+            this.rn.DataPropertyName = "rn";
+            this.rn.HeaderText = "序号";
+            this.rn.MinimumWidth = 8;
+            this.rn.Name = "rn";
+            this.rn.ReadOnly = true;
+            this.rn.Width = 80;
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.DataPropertyName = "ms_makecode";
+            this.ms_makecode.HeaderText = "工单";
+            this.ms_makecode.MinimumWidth = 8;
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.ReadOnly = true;
+            this.ms_makecode.Width = 140;
+            // 
+            // mainSnCol
+            // 
+            this.mainSnCol.DataPropertyName = "main_sn";
+            this.mainSnCol.HeaderText = "主板序列号";
+            this.mainSnCol.MinimumWidth = 8;
+            this.mainSnCol.Name = "mainSnCol";
+            this.mainSnCol.ReadOnly = true;
+            this.mainSnCol.Width = 180;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.DataPropertyName = "ms_sncode";
+            this.ms_sncode.HeaderText = "小板序列号";
+            this.ms_sncode.MinimumWidth = 8;
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.ReadOnly = true;
+            this.ms_sncode.Width = 180;
+            // 
+            // scanTime
+            // 
+            this.scanTime.DataPropertyName = "scan_time";
+            this.scanTime.HeaderText = "扫描时间";
+            this.scanTime.MinimumWidth = 8;
+            this.scanTime.Name = "scanTime";
+            this.scanTime.ReadOnly = true;
+            this.scanTime.Width = 170;
+            // 
+            // isDel
+            // 
+            this.isDel.DataPropertyName = "isDel";
+            this.isDel.FalseValue = false;
+            this.isDel.HeaderText = "勾选";
+            this.isDel.MinimumWidth = 8;
+            this.isDel.Name = "isDel";
+            this.isDel.ReadOnly = true;
+            this.isDel.TrueValue = true;
+            this.isDel.Width = 80;
+            // 
+            // 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, 168);
+            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.Absolute, 120F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
+            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0);
+            this.tableLayoutPanel1.Controls.Add(this.workOrder, 1, 0);
+            this.tableLayoutPanel1.Controls.Add(this.makeQtyLab, 2, 0);
+            this.tableLayoutPanel1.Controls.Add(this.ma_qty, 3, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label3, 4, 0);
+            this.tableLayoutPanel1.Controls.Add(this.ma_prodcode, 5, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label4, 6, 0);
+            this.tableLayoutPanel1.Controls.Add(this.pr_spec, 7, 0);
+            this.tableLayoutPanel1.Controls.Add(this.mainSnLab, 0, 1);
+            this.tableLayoutPanel1.Controls.Add(this.mainSn, 1, 1);
+            this.tableLayoutPanel1.Controls.Add(this.stepCollectLab, 2, 1);
+            this.tableLayoutPanel1.Controls.Add(this.stepCollectQty, 3, 1);
+            this.tableLayoutPanel1.Controls.Add(this.collectLab, 4, 1);
+            this.tableLayoutPanel1.Controls.Add(this.collectQty, 5, 1);
+            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 37);
+            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+            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;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label2.Location = new System.Drawing.Point(3, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(114, 64);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "工单: ";
+            this.label2.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(123, 0);
+            this.workOrder.Name = "workOrder";
+            this.workOrder.Size = new System.Drawing.Size(177, 64);
+            this.workOrder.TabIndex = 5;
+            this.workOrder.Tag = "ma_code";
+            this.workOrder.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(306, 0);
+            this.makeQtyLab.Name = "makeQtyLab";
+            this.makeQtyLab.Size = new System.Drawing.Size(114, 64);
+            this.makeQtyLab.TabIndex = 8;
+            this.makeQtyLab.Text = "工单数量: ";
+            this.makeQtyLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // ma_qty
+            // 
+            this.ma_qty.AutoSize = true;
+            this.ma_qty.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.ma_qty.Location = new System.Drawing.Point(426, 0);
+            this.ma_qty.Name = "ma_qty";
+            this.ma_qty.Size = new System.Drawing.Size(177, 64);
+            this.ma_qty.TabIndex = 9;
+            this.ma_qty.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(609, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(94, 64);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "产品编号: ";
+            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.ma_prodcode.Location = new System.Drawing.Point(709, 0);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(127, 64);
+            this.ma_prodcode.TabIndex = 6;
+            this.ma_prodcode.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(842, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(94, 64);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "产品名称: ";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pr_spec.Location = new System.Drawing.Point(942, 0);
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Size = new System.Drawing.Size(329, 64);
+            this.pr_spec.TabIndex = 7;
+            this.pr_spec.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // mainSnLab
+            // 
+            this.mainSnLab.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.mainSnLab.Location = new System.Drawing.Point(3, 64);
+            this.mainSnLab.Name = "mainSnLab";
+            this.mainSnLab.Size = new System.Drawing.Size(114, 64);
+            this.mainSnLab.TabIndex = 10;
+            this.mainSnLab.Text = "主板序列号: ";
+            this.mainSnLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // mainSn
+            // 
+            this.mainSn.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.mainSn.Location = new System.Drawing.Point(123, 64);
+            this.mainSn.Name = "mainSn";
+            this.mainSn.Size = new System.Drawing.Size(177, 64);
+            this.mainSn.TabIndex = 11;
+            this.mainSn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // stepCollectLab
+            // 
+            this.stepCollectLab.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.stepCollectLab.Location = new System.Drawing.Point(306, 64);
+            this.stepCollectLab.Name = "stepCollectLab";
+            this.stepCollectLab.Size = new System.Drawing.Size(114, 64);
+            this.stepCollectLab.TabIndex = 10;
+            this.stepCollectLab.Text = "小板序列号: ";
+            this.stepCollectLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // stepCollectQty
+            // 
+            this.stepCollectQty.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.stepCollectQty.Location = new System.Drawing.Point(426, 64);
+            this.stepCollectQty.Name = "stepCollectQty";
+            this.stepCollectQty.Size = new System.Drawing.Size(177, 64);
+            this.stepCollectQty.TabIndex = 11;
+            this.stepCollectQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // collectLab
+            // 
+            this.collectLab.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.collectLab.Location = new System.Drawing.Point(609, 64);
+            this.collectLab.Name = "collectLab";
+            this.collectLab.Size = new System.Drawing.Size(94, 64);
+            this.collectLab.TabIndex = 12;
+            this.collectLab.Text = "采集数: ";
+            this.collectLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // collectQty
+            // 
+            this.collectQty.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.collectQty.Location = new System.Drawing.Point(709, 64);
+            this.collectQty.Name = "collectQty";
+            this.collectQty.Size = new System.Drawing.Size(127, 64);
+            this.collectQty.TabIndex = 13;
+            this.collectQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // Make_PanelSmallBoard
+            // 
+            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_PanelSmallBoard";
+            this.Text = "拼板小板采集";
+            this.Load += new System.EventHandler(this.Make_HandFeedRegistration_Load);
+            this.containerBox.ResumeLayout(false);
+            this.tableLayoutPanel2.ResumeLayout(false);
+            this.tableLayoutPanel3.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.buttonRow.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
+            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 pr_spec;
+        private System.Windows.Forms.Label ma_prodcode;
+        private System.Windows.Forms.Label workOrder;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label makeQtyLab;
+        private System.Windows.Forms.Label ma_qty;
+        private System.Windows.Forms.Label mainSnLab;
+        private System.Windows.Forms.Label mainSn;
+        private System.Windows.Forms.Label stepCollectLab;
+        private System.Windows.Forms.Label stepCollectQty;
+        private System.Windows.Forms.Label collectLab;
+        private System.Windows.Forms.Label collectQty;
+        private System.Windows.Forms.Panel containerBox;
+        private System.Windows.Forms.DataGridView dgv;
+        private System.Windows.Forms.Label snLab;
+        private System.Windows.Forms.TextBox snVal;
+        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.CheckBox RecordStepChk;
+        private System.Windows.Forms.Button Confirm;
+        private System.Windows.Forms.Button Delete;
+        private System.Windows.Forms.Button claerBtn;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn isDel;
+        private System.Windows.Forms.DataGridViewTextBoxColumn rn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_makecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mainSnCol;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_sncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn scanTime;
+    }
+}

+ 583 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_PanelSmallBoard.cs

@@ -0,0 +1,583 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.CustomControl.RichText;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_PanelSmallBoard : Form
+    {
+        public Make_PanelSmallBoard()
+        {
+            InitializeComponent();
+        }
+
+        DataTable data;
+        DataHelper dh;
+        int panelQty;
+
+        private void Make_HandFeedRegistration_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+            data = CreateScanTable();
+            dgv.AutoGenerateColumns = false;
+            dgv.DataSource = data;
+
+            snVal.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_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.Focus();
+        }
+
+        private static DataTable CreateScanTable()
+        {
+            DataTable table = new DataTable();
+            table.Columns.Add("isDel", typeof(bool));
+            table.Columns.Add("rn", typeof(int));
+            table.Columns.Add("ms_makecode", typeof(string));
+            table.Columns.Add("main_sn", typeof(string));
+            table.Columns.Add("ms_sncode", typeof(string));
+            table.Columns.Add("scan_time", typeof(string));
+            table.Columns.Add("bound", typeof(bool));
+            return table;
+        }
+
+        private void ma_code_DbChange(object sender, EventArgs e)
+        {
+            ApplyMakeFields(ma_code.ReturnData);
+            mainSn.Text = "";
+            stepCollectQty.Text = "";
+            string makeCode = ma_code.Text.Trim();
+            if (string.IsNullOrEmpty(makeCode))
+                return;
+            LoadMakeSummary(makeCode);
+        }
+
+        /// <summary>
+        /// 按列名写入。工单筛选的列标题和控件名不一致时,产品编号、产品名称不会自动显示。
+        /// </summary>
+        private void ApplyMakeFields(DataTable source)
+        {
+            if (source == null || source.Rows.Count == 0)
+                return;
+            workOrder.Text = FieldText(source, "ma_code");
+            ma_qty.Text = FieldText(source, "ma_qty");
+            ma_prodcode.Text = FieldText(source, "ma_prodcode");
+            pr_spec.Text = FieldText(source, "pr_spec");
+        }
+
+        private static string FieldText(DataTable source, string field)
+        {
+            foreach (DataColumn column in source.Columns)
+            {
+                string name = column.ColumnName ?? "";
+                string caption = column.Caption ?? "";
+                bool match = name.Equals(field, StringComparison.OrdinalIgnoreCase)
+                    || caption.Equals(field, StringComparison.OrdinalIgnoreCase)
+                    || name.EndsWith(field, StringComparison.OrdinalIgnoreCase)
+                    || caption.EndsWith(field, StringComparison.OrdinalIgnoreCase);
+                if (!match)
+                    continue;
+                return source.Rows[0][column] == DBNull.Value ? "" : source.Rows[0][column].ToString();
+            }
+            return "";
+        }
+
+        private void LoadMakeSummary(string makeCode)
+        {
+            ma_qty.Text = "";
+            collectQty.Text = "";
+            if (string.IsNullOrEmpty(makeCode))
+                return;
+
+            string makeSql = SqlText(makeCode);
+            DataTable qtyDt = (DataTable)dh.ExecuteSql("select ma_qty from make where ma_code='" + makeSql + "'", "select");
+            if (qtyDt.Rows.Count > 0)
+                ma_qty.Text = CellText(qtyDt.Rows[0], "ma_qty");
+
+            string stepCode = User.CurrentStepCode ?? "";
+            if (string.IsNullOrEmpty(stepCode))
+                return;
+
+            /*DataTable countDt = (DataTable)dh.ExecuteSql($@"SELECT COUNT(*) collect_qty FROM (
+                    SELECT mp_sncode FROM makeprocess
+                    WHERE mp_makecode = '{makeSql}' AND mp_stepcode = '{SqlText(stepCode)}'
+                    GROUP BY mp_sncode)", "select");*/
+            DataTable countDt = (DataTable)dh.ExecuteSql($@"SELECT COUNT(*) collect_qty FROM smtbind WHERE sb_makecode = '{makeSql}'", "select");
+            if (countDt.Rows.Count > 0)
+                collectQty.Text = CellText(countDt.Rows[0], "collect_qty");
+        }
+
+        private void Confirm_Click(object sender, EventArgs e)
+        {
+            if (Confirm.Text == "确认")
+                BeginScan();
+            else
+                CancelScan();
+        }
+
+        private void BeginScan()
+        {
+            string makeCode = ma_code.Text.Trim();
+            if (string.IsNullOrEmpty(makeCode))
+            {
+                ShowMsg(Msg1, 0, "请先选择工单");
+                ma_code.Focus();
+                return;
+            }
+
+            if (!int.TryParse(PanelQtyVal.Text, out int qty) || qty <= 0)
+            {
+                ShowMsg(Msg1, 0, string.IsNullOrEmpty(PanelQtyVal.Text) ? "请输入拼板数" : "拼板数请输入正整数");
+                PanelQtyVal.Text = "";
+                PanelQtyVal.Focus();
+                return;
+            }
+
+            if (!LockMakeCode.Checked)
+                LockMakeCode.Checked = true;
+            if (!LockMakeCode.Checked)
+                return;
+
+            panelQty = qty;
+            if (string.IsNullOrEmpty(workOrder.Text))
+                workOrder.Text = makeCode;
+            LoadMakeSummary(makeCode);
+            Confirm.Text = "取消";
+            PanelQtyVal.Enabled = false;
+            RecordStepChk.Enabled = false;
+            snVal.Enabled = true;
+            FocusScan();
+        }
+
+        private void CancelScan()
+        {
+            Confirm.Text = "确认";
+            panelQty = 0;
+            if (LockMakeCode.Checked)
+                LockMakeCode.Checked = false;
+            PanelQtyVal.Enabled = true;
+            RecordStepChk.Enabled = true;
+            snVal.Enabled = false;
+            snVal.Text = "";
+            data.Rows.Clear();
+            mainSn.Text = "";
+            stepCollectQty.Text = "";
+            PanelQtyVal.Focus();
+            PanelQtyVal.SelectAll();
+        }
+
+        private void snVal_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode != Keys.Enter)
+                return;
+
+            e.Handled = true;
+            e.SuppressKeyPress = true;
+            if (!ScanReady(out string makeCode) || !TryTakeScan(out string scanSn))
+                return;
+
+            data.Rows.Add(false, 0, makeCode, "", scanSn, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), false);
+            RefreshGridOrder();
+            ShowLastScan();
+            snVal.Text = "";
+
+            if (OpenRows().Count >= panelQty)
+                FinishLatestBatch();
+            else
+                FocusScan();
+        }
+
+        private bool ScanReady(out string makeCode)
+        {
+            makeCode = ma_code.Text.Trim();
+            if (string.IsNullOrEmpty(makeCode))
+            {
+                ShowMsg(Msg1, 0, "请先选择工单");
+                ma_code.Focus();
+                return false;
+            }
+
+            if (PanelQtyVal.Enabled || panelQty <= 0)
+            {
+                ShowMsg(Msg1, 0, "请先确认拼板数量");
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// 空号、表格重复、本批未写入、smtbind 已绑定,都不进入表格。
+        /// </summary>
+        private bool TryTakeScan(out string scanSn)
+        {
+            scanSn = snVal.Text.Trim();
+            if (string.IsNullOrEmpty(scanSn))
+            {
+                ShowMsg(Msg1, 0, "请扫描序列号");
+                FocusScan();
+                return false;
+            }
+
+            if (AlreadyScanned(scanSn))
+            {
+                ShowMsg(Msg1, 0, "序列号已扫描");
+                FocusScan();
+                return false;
+            }
+
+            if (OpenRows().Count >= panelQty)
+            {
+                ShowMsg(Msg1, 0, "本批已扫满,请先处理拼板写入结果");
+                FocusScan();
+                return false;
+            }
+
+            if (BindExists(scanSn, out string boundMake))
+            {
+                ShowMsg(Msg1, 0, $"序列号{scanSn}已绑定工单{boundMake}拼板关系,请更换其他序列号");
+                FocusScan();
+                return false;
+            }
+
+            return true;
+        }
+
+        private bool AlreadyScanned(string scanSn)
+        {
+            foreach (DataRow row in data.Rows)
+            {
+                if (string.Equals(CellText(row, "ms_sncode"), scanSn, StringComparison.OrdinalIgnoreCase))
+                    return true;
+            }
+            return false;
+        }
+
+        private bool BindExists(string scanSn, out string makeCode)
+        {
+            makeCode = "";
+            DataTable bindDt = (DataTable)dh.ExecuteSql("select sb_makecode from smtbind where sb_barcode='" + SqlText(scanSn) + "'", "select");
+            if (bindDt.Rows.Count == 0)
+                return false;
+            makeCode = CellText(bindDt.Rows[0], "sb_makecode");
+            return true;
+        }
+
+        private List<DataRow> OpenRows()
+        {
+            List<DataRow> rows = new List<DataRow>();
+            foreach (DataRow row in data.Rows)
+            {
+                if (!RowFlag(row, "bound"))
+                    rows.Add(row);
+            }
+            return rows;
+        }
+
+        /// <summary>
+        /// 未写入的每一批里,第一笔序列号作为主板序列号。已写入的行不再改主板号。
+        /// </summary>
+        private void RefreshGridOrder()
+        {
+            data.DefaultView.Sort = "";
+            string batchMain = "";
+            int openIndex = 0;
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                DataRow row = data.Rows[i];
+                row["rn"] = i + 1;
+                if (RowFlag(row, "bound") || panelQty <= 0)
+                    continue;
+                if (openIndex % panelQty == 0)
+                    batchMain = CellText(row, "ms_sncode");
+                row["main_sn"] = batchMain;
+                openIndex++;
+            }
+            data.DefaultView.Sort = "rn ASC";
+        }
+
+        private void ShowLastScan()
+        {
+            if (data.Rows.Count == 0)
+            {
+                mainSn.Text = "";
+                stepCollectQty.Text = "";
+                return;
+            }
+
+            DataRow last = data.Rows[data.Rows.Count - 1];
+            mainSn.Text = CellText(last, "main_sn");
+            stepCollectQty.Text = CellText(last, "ms_sncode");
+        }
+
+        /// <summary>
+        /// 扫满拼板数后一次写入 smtbind。勾选记录过站时再过站。
+        /// </summary>
+        private void FinishLatestBatch()
+        {
+            dgv.EndEdit();
+            List<DataRow> rows = OpenRows();
+            if (panelQty <= 0 || rows.Count < panelQty)
+            {
+                FocusScan();
+                return;
+            }
+
+            if (!SaveBatch(rows, out string saveError))
+            {
+                ShowMsg(Msg1, 0, "写入拼板关系失败:" + saveError);
+                FocusScan();
+                return;
+            }
+
+            foreach (DataRow row in rows)
+                row["bound"] = true;
+
+            if (RecordStepChk.Checked)
+                PassBatch(rows);
+            else
+                ShowMsg(Msg1, 1, $"本批{rows.Count}块已写入拼板关系,未记录过站");
+
+            FocusScan();
+        }
+
+        private bool SaveBatch(List<DataRow> rows, out string error)
+        {
+            error = "";
+            StringBuilder sql = new StringBuilder("begin ");
+            string prodCode = SqlText(ma_prodcode.Text.Trim());
+            string userCode = SqlText(User.UserCode);
+            foreach (DataRow row in rows)
+            {
+                sql.Append("insert into smtbind(sb_id,sb_maincode,sb_barcode,sb_makecode,sb_prodcode,sb_inman,sb_indate,sb_status)");
+                sql.Append(" values(smtbind_seq.nextval,'");
+                sql.Append(SqlText(CellText(row, "main_sn")));
+                sql.Append("','");
+                sql.Append(SqlText(CellText(row, "ms_sncode")));
+                sql.Append("','");
+                sql.Append(SqlText(CellText(row, "ms_makecode")));
+                sql.Append("','");
+                sql.Append(prodCode);
+                sql.Append("','");
+                sql.Append(userCode);
+                sql.Append("',sysdate,0);");
+            }
+            sql.Append(" end;");
+
+            try
+            {
+                dh.ExecuteSql(sql.ToString(), "insert");
+                return true;
+            }
+            catch (Exception ex)
+            {
+                error = ex.Message;
+                return false;
+            }
+        }
+
+        private void PassBatch(List<DataRow> rows)
+        {
+            List<string> successList = new List<string>();
+            List<string> afterList = new List<string>();
+            List<string> failList = new List<string>();
+            foreach (DataRow row in rows)
+            {
+                string snCode = CellText(row, "ms_sncode");
+                string makeCode = CellText(row, "ms_makecode");
+                if (!PassOneSN(snCode, makeCode, out string stepError))
+                {
+                    failList.Add(string.IsNullOrEmpty(stepError) ? snCode : snCode + "(" + stepError + ")");
+                    continue;
+                }
+
+                successList.Add(snCode);
+                if (!string.IsNullOrEmpty(stepError) && stepError.IndexOf("AFTERSUCCESS", StringComparison.OrdinalIgnoreCase) >= 0)
+                    afterList.Add(snCode + " " + stepError);
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, makeCode, User.UserLineCode, User.UserSourceCode, "拼板小板采集", "过站成功", snCode, "");
+            }
+
+            if (successList.Count > 0)
+            {
+                ShowMsg(Msg1, 1, $"过站成功{successList.Count}块,小板:{string.Join("、", successList)}");
+                LoadMakeSummary(workOrder.Text);
+            }
+            foreach (string afterMsg in afterList)
+                ShowMsg(Msg1, 2, afterMsg);
+            if (failList.Count > 0)
+                ShowMsg(Msg1, 0, $"过站失败{failList.Count}块,小板:{string.Join("、", failList)}");
+        }
+
+        /// <summary>
+        /// 单条过站。失败原因写入 stepError,成功且带 AFTERSUCCESS 时 stepError 为附加信息。
+        /// </summary>
+        private bool PassOneSN(string snCode, string makeCode, out string stepError)
+        {
+            stepError = "";
+            try
+            {
+                string snSql = SqlText(snCode);
+                string makeSql = SqlText(makeCode);
+                DataTable reworkDt = (DataTable)dh.ExecuteSql($@"SELECT nvl(ms_ifrework,0) ms_ifrework, ms_reworkstatus FROM makeserial WHERE ms_sncode='{snSql}' AND ms_makecode='{makeSql}'", "select");
+                if (reworkDt.Rows.Count == 0)
+                {
+                    stepError = "未查询到序列号";
+                    return false;
+                }
+
+                string rowIfRework = CellText(reworkDt.Rows[0], "ms_ifrework");
+                string rowReworkStatus = CellText(reworkDt.Rows[0], "ms_reworkstatus");
+                if (rowIfRework != "0" && rowReworkStatus == "3")
+                {
+                    stepError = "返修不良必须先维修";
+                    return false;
+                }
+
+                if (rowIfRework == "0" && HasOpenBad(snSql, makeSql, out stepError))
+                    return false;
+
+                if (!LogicHandler.SetStepResult(makeCode, User.UserSourceCode, snCode, "出货核对", "检测合格", User.UserCode, out stepError))
+                {
+                    if (string.IsNullOrEmpty(stepError) || stepError == "null")
+                        stepError = "过站失败";
+                    return false;
+                }
+
+                if (stepError == "null")
+                    stepError = "";
+                return true;
+            }
+            catch (Exception ex)
+            {
+                stepError = ex.Message;
+                return false;
+            }
+        }
+
+        private bool HasOpenBad(string snSql, string makeSql, out string stepError)
+        {
+            stepError = "";
+            DataTable badDt = (DataTable)dh.ExecuteSql($@"SELECT mb_id,bc_name,mbr_mbid FROM makebad LEFT JOIN makebadreason ON mbr_mbid=mb_id LEFT JOIN badcode ON mb_badcode=bc_code WHERE mb_sncode='{snSql}' AND mb_makecode='{makeSql}' AND mb_status=0", "select");
+            List<string> badNames = new List<string>();
+            for (int i = 0; i < badDt.Rows.Count; i++)
+            {
+                if (CellText(badDt.Rows[i], "mb_id") != CellText(badDt.Rows[i], "mbr_mbid"))
+                    badNames.Add("【" + CellText(badDt.Rows[i], "bc_name") + "】");
+            }
+            if (badNames.Count == 0)
+                return false;
+
+            stepError = "已判为不良品" + string.Join("", badNames);
+            return true;
+        }
+
+        private void Delete_Click(object sender, EventArgs e)
+        {
+            dgv.EndEdit();
+            List<DataRow> removeRows = new List<DataRow>();
+            foreach (DataRow row in data.Rows)
+            {
+                if (RowFlag(row, "isDel"))
+                    removeRows.Add(row);
+            }
+
+            if (removeRows.Count == 0)
+            {
+                ShowMsg(Msg1, 0, "请勾选要删除的小板");
+                return;
+            }
+
+            List<string> snList = new List<string>();
+            foreach (DataRow row in removeRows)
+            {
+                snList.Add(CellText(row, "ms_sncode"));
+                data.Rows.Remove(row);
+            }
+
+            RefreshGridOrder();
+            ShowLastScan();
+            ShowMsg(Msg1, 1, $"已删除{removeRows.Count}块小板:{string.Join("、", snList)}");
+            FocusScan();
+        }
+
+        private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex < 0 || e.ColumnIndex < 0)
+                return;
+
+            DataRowView view = dgv.Rows[e.RowIndex].DataBoundItem as DataRowView;
+            if (view == null)
+                return;
+
+            bool currentValue = view["isDel"] != DBNull.Value && Convert.ToBoolean(view["isDel"]);
+            view["isDel"] = !currentValue;
+            dgv.InvalidateRow(e.RowIndex);
+
+            DataGridViewRow row = dgv.Rows[e.RowIndex];
+            if (currentValue)
+            {
+                row.DefaultCellStyle.BackColor = dgv.DefaultCellStyle.BackColor;
+                row.DefaultCellStyle.ForeColor = dgv.DefaultCellStyle.ForeColor;
+            }
+            else
+            {
+                row.DefaultCellStyle.BackColor = Color.LightSkyBlue;
+                row.DefaultCellStyle.ForeColor = Color.Black;
+            }
+        }
+
+        private void claerBtn_Click(object sender, EventArgs e)
+        {
+            Msg1.Clear();
+        }
+
+        private void FocusScan()
+        {
+            if (!snVal.Enabled)
+                return;
+            snVal.Focus();
+            snVal.SelectAll();
+        }
+
+        private void ShowMsg(RichTextAutoBottom msgBox, int type, string msg)
+        {
+            Color color = Color.Green;
+            if (type == 0)
+                color = Color.Red;
+            else if (type == 2)
+                color = Color.YellowGreen;
+
+            msg = (msg ?? "").Replace("\r", "").Replace("\n", "");
+            msgBox.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ": " + msg + "\n", color);
+            msgBox.SelectionStart = msgBox.Text.Length;
+            msgBox.ScrollToCaret();
+        }
+
+        private static string CellText(DataRow row, string column)
+        {
+            return row[column] == DBNull.Value ? "" : row[column].ToString();
+        }
+
+        private static bool RowFlag(DataRow row, string column)
+        {
+            return row[column] != DBNull.Value && Convert.ToBoolean(row[column]);
+        }
+
+        private static string SqlText(string value)
+        {
+            return (value ?? "").Replace("'", "''");
+        }
+    }
+}

+ 138 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_PanelSmallBoard.resx

@@ -0,0 +1,138 @@
+<?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_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mainSnCol.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="scanTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="isDel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 2 - 2
UAS_MES_YTDZ/FunctionCode/Make/Make_ShipmentVerify.cs

@@ -49,9 +49,9 @@ namespace UAS_MES_NEW.Make
             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.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_spec # 产品规格";
             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.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.Focus();
         }

+ 9 - 0
UAS_MES_YTDZ/UAS_MES_YTDZ.csproj

@@ -577,6 +577,12 @@
     <Compile Include="FunctionCode\Make\Make_ShipmentVerify.Designer.cs">
       <DependentUpon>Make_ShipmentVerify.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_PanelSmallBoard.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_PanelSmallBoard.Designer.cs">
+      <DependentUpon>Make_PanelSmallBoard.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_HandFeedRegistration.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1412,6 +1418,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ShipmentVerify.resx">
       <DependentUpon>Make_ShipmentVerify.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_PanelSmallBoard.resx">
+      <DependentUpon>Make_PanelSmallBoard.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_HandFeedRegistration.resx">
       <DependentUpon>Make_HandFeedRegistration.cs</DependentUpon>
     </EmbeddedResource>