Ver código fonte

添加SMT分板绑定功能

callm 5 anos atrás
pai
commit
17625d98f0

+ 2 - 4
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -20,7 +20,7 @@ namespace UAS_MES_NEW.Make
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
-        public BarTender.Application engine;
+        public Seagull.BarTender.Print.Engine engine;
         ApplicationClass lbl;
         Document doc;
         DataHelper dh;
@@ -106,7 +106,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new BarTender.Application();
+                engine = new Seagull.BarTender.Print.Engine();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -286,8 +286,6 @@ namespace UAS_MES_NEW.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
-            if (engine != null)
-                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
             StopWeight.PerformClick();
             InitPrint.Abort();

+ 184 - 297
UAS_MES_NEW/FunctionCode/Make/Make_SMTBind.Designer.cs

@@ -28,7 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_FeedingCollection));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_SMTBind));
             this.mcd_restqty_label = new System.Windows.Forms.Label();
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.ma_qty_label = new System.Windows.Forms.Label();
@@ -39,24 +39,17 @@
             this.UnLoading = new System.Windows.Forms.RadioButton();
             this.sn_code_label = new System.Windows.Forms.Label();
             this.code_label = new System.Windows.Forms.Label();
-            this.iflastsn = new System.Windows.Forms.CheckBox();
-            this.ma_softversion_label = new System.Windows.Forms.CheckBox();
-            this.ma_ecncode_label = new System.Windows.Forms.CheckBox();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.ms_craftcode = new System.Windows.Forms.Label();
-            this.ma_bomversion = new System.Windows.Forms.Label();
-            this.ma_bomversion_label = new System.Windows.Forms.Label();
             this.ma_craftcode = new System.Windows.Forms.Label();
-            this.sir_remark_label = new System.Windows.Forms.CheckBox();
-            this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.label2 = new System.Windows.Forms.Label();
+            this.ProdNum = new System.Windows.Forms.NumericUpDown();
             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.sir_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
@@ -67,28 +60,28 @@
             this.ma_qty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.Clean = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ma_softversion = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ma_ecncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sb_maincode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sb_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sb_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sb_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ProdNum)).BeginInit();
             this.SuspendLayout();
             // 
             // mcd_restqty_label
             // 
             this.mcd_restqty_label.AutoSize = true;
             this.mcd_restqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_restqty_label.Location = new System.Drawing.Point(585, 61);
+            this.mcd_restqty_label.Location = new System.Drawing.Point(1170, 122);
+            this.mcd_restqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_restqty_label.Name = "mcd_restqty_label";
-            this.mcd_restqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_restqty_label.Size = new System.Drawing.Size(146, 41);
             this.mcd_restqty_label.TabIndex = 59;
             this.mcd_restqty_label.Text = "待采集数";
             // 
@@ -96,9 +89,10 @@
             // 
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty_label.Location = new System.Drawing.Point(311, 61);
+            this.mcd_inqty_label.Location = new System.Drawing.Point(622, 122);
+            this.mcd_inqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_inqty_label.Name = "mcd_inqty_label";
-            this.mcd_inqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_inqty_label.Size = new System.Drawing.Size(146, 41);
             this.mcd_inqty_label.TabIndex = 56;
             this.mcd_inqty_label.Text = "已采集数";
             // 
@@ -106,9 +100,10 @@
             // 
             this.ma_qty_label.AutoSize = true;
             this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(9, 61);
+            this.ma_qty_label.Location = new System.Drawing.Point(18, 122);
+            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_qty_label.Size = new System.Drawing.Size(146, 41);
             this.ma_qty_label.TabIndex = 53;
             this.ma_qty_label.Text = "工单数量";
             // 
@@ -116,9 +111,10 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(9, 12);
+            this.ms_makecode_label.Location = new System.Drawing.Point(18, 24);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(146, 41);
             this.ms_makecode_label.TabIndex = 49;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -126,9 +122,10 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(585, 12);
+            this.pr_detail_label.Location = new System.Drawing.Point(1170, 24);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
             this.pr_detail_label.TabIndex = 50;
             this.pr_detail_label.Text = "产品规格";
             // 
@@ -136,9 +133,10 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode_label.Location = new System.Drawing.Point(311, 12);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(622, 24);
+            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(146, 41);
             this.ma_prodcode_label.TabIndex = 51;
             this.ma_prodcode_label.Text = "产品代码";
             // 
@@ -148,12 +146,13 @@
             this.Loading.Checked = true;
             this.Loading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Loading.ForeColor = System.Drawing.Color.Blue;
-            this.Loading.Location = new System.Drawing.Point(18, 360);
+            this.Loading.Location = new System.Drawing.Point(36, 720);
+            this.Loading.Margin = new System.Windows.Forms.Padding(6);
             this.Loading.Name = "Loading";
-            this.Loading.Size = new System.Drawing.Size(60, 25);
+            this.Loading.Size = new System.Drawing.Size(113, 45);
             this.Loading.TabIndex = 62;
             this.Loading.TabStop = true;
-            this.Loading.Text = "上料";
+            this.Loading.Text = "绑定";
             this.Loading.UseVisualStyleBackColor = true;
             // 
             // UnLoading
@@ -161,20 +160,22 @@
             this.UnLoading.AutoSize = true;
             this.UnLoading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.UnLoading.ForeColor = System.Drawing.Color.Blue;
-            this.UnLoading.Location = new System.Drawing.Point(98, 360);
+            this.UnLoading.Location = new System.Drawing.Point(196, 720);
+            this.UnLoading.Margin = new System.Windows.Forms.Padding(6);
             this.UnLoading.Name = "UnLoading";
-            this.UnLoading.Size = new System.Drawing.Size(60, 25);
+            this.UnLoading.Size = new System.Drawing.Size(113, 45);
             this.UnLoading.TabIndex = 63;
-            this.UnLoading.Text = "下料";
+            this.UnLoading.Text = "解绑";
             this.UnLoading.UseVisualStyleBackColor = true;
             // 
             // sn_code_label
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(14, 398);
+            this.sn_code_label.Location = new System.Drawing.Point(28, 796);
+            this.sn_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.Size = new System.Drawing.Size(114, 41);
             this.sn_code_label.TabIndex = 64;
             this.sn_code_label.Text = "序列号";
             // 
@@ -182,57 +183,21 @@
             // 
             this.code_label.AutoSize = true;
             this.code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.code_label.Location = new System.Drawing.Point(14, 442);
+            this.code_label.Location = new System.Drawing.Point(28, 884);
+            this.code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.code_label.Name = "code_label";
-            this.code_label.Size = new System.Drawing.Size(58, 21);
+            this.code_label.Size = new System.Drawing.Size(114, 41);
             this.code_label.TabIndex = 66;
             this.code_label.Text = "录入框";
             // 
-            // iflastsn
-            // 
-            this.iflastsn.AutoSize = true;
-            this.iflastsn.Enabled = false;
-            this.iflastsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.iflastsn.Location = new System.Drawing.Point(289, 398);
-            this.iflastsn.Name = "iflastsn";
-            this.iflastsn.Size = new System.Drawing.Size(115, 25);
-            this.iflastsn.TabIndex = 72;
-            this.iflastsn.Text = "前一工单SN";
-            this.iflastsn.UseVisualStyleBackColor = true;
-            // 
-            // ma_softversion_label
-            // 
-            this.ma_softversion_label.AutoSize = true;
-            this.ma_softversion_label.Checked = true;
-            this.ma_softversion_label.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.ma_softversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_softversion_label.Location = new System.Drawing.Point(680, 151);
-            this.ma_softversion_label.Name = "ma_softversion_label";
-            this.ma_softversion_label.Size = new System.Drawing.Size(93, 25);
-            this.ma_softversion_label.TabIndex = 74;
-            this.ma_softversion_label.Text = "软件版本";
-            this.ma_softversion_label.UseVisualStyleBackColor = true;
-            // 
-            // ma_ecncode_label
-            // 
-            this.ma_ecncode_label.AutoSize = true;
-            this.ma_ecncode_label.Checked = true;
-            this.ma_ecncode_label.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.ma_ecncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_ecncode_label.Location = new System.Drawing.Point(680, 192);
-            this.ma_ecncode_label.Name = "ma_ecncode_label";
-            this.ma_ecncode_label.Size = new System.Drawing.Size(78, 25);
-            this.ma_ecncode_label.TabIndex = 75;
-            this.ma_ecncode_label.Text = "ECN号";
-            this.ma_ecncode_label.UseVisualStyleBackColor = true;
-            // 
             // ClearSn_code
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES_NEW.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.ClearSn_code.Location = new System.Drawing.Point(263, 401);
+            this.ClearSn_code.Location = new System.Drawing.Point(526, 802);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(6);
             this.ClearSn_code.Name = "ClearSn_code";
-            this.ClearSn_code.Size = new System.Drawing.Size(16, 16);
+            this.ClearSn_code.Size = new System.Drawing.Size(32, 32);
             this.ClearSn_code.TabIndex = 138;
             this.ClearSn_code.TabStop = false;
             this.ClearSn_code.Click += new System.EventHandler(this.ClearSn_code_Click);
@@ -241,68 +206,24 @@
             // 
             this.ms_craftcode.AutoSize = true;
             this.ms_craftcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_craftcode.Location = new System.Drawing.Point(768, 15);
+            this.ms_craftcode.Location = new System.Drawing.Point(1536, 30);
+            this.ms_craftcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_craftcode.Name = "ms_craftcode";
-            this.ms_craftcode.Size = new System.Drawing.Size(0, 21);
+            this.ms_craftcode.Size = new System.Drawing.Size(0, 41);
             this.ms_craftcode.TabIndex = 142;
             this.ms_craftcode.Visible = false;
             // 
-            // ma_bomversion
-            // 
-            this.ma_bomversion.AutoSize = true;
-            this.ma_bomversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_bomversion.Location = new System.Drawing.Point(768, 108);
-            this.ma_bomversion.Name = "ma_bomversion";
-            this.ma_bomversion.Size = new System.Drawing.Size(0, 21);
-            this.ma_bomversion.TabIndex = 143;
-            // 
-            // ma_bomversion_label
-            // 
-            this.ma_bomversion_label.AutoSize = true;
-            this.ma_bomversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_bomversion_label.Location = new System.Drawing.Point(682, 108);
-            this.ma_bomversion_label.Name = "ma_bomversion_label";
-            this.ma_bomversion_label.Size = new System.Drawing.Size(77, 21);
-            this.ma_bomversion_label.TabIndex = 144;
-            this.ma_bomversion_label.Text = "Bom版本";
-            // 
             // ma_craftcode
             // 
             this.ma_craftcode.AutoSize = true;
             this.ma_craftcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode.Location = new System.Drawing.Point(754, 61);
+            this.ma_craftcode.Location = new System.Drawing.Point(1508, 122);
+            this.ma_craftcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_craftcode.Name = "ma_craftcode";
-            this.ma_craftcode.Size = new System.Drawing.Size(0, 21);
+            this.ma_craftcode.Size = new System.Drawing.Size(0, 41);
             this.ma_craftcode.TabIndex = 145;
             this.ma_craftcode.Visible = false;
             // 
-            // sir_remark_label
-            // 
-            this.sir_remark_label.AutoSize = true;
-            this.sir_remark_label.Checked = true;
-            this.sir_remark_label.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.sir_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sir_remark_label.Location = new System.Drawing.Point(680, 232);
-            this.sir_remark_label.Name = "sir_remark_label";
-            this.sir_remark_label.Size = new System.Drawing.Size(93, 25);
-            this.sir_remark_label.TabIndex = 190;
-            this.sir_remark_label.Text = "备注信息";
-            this.sir_remark_label.UseVisualStyleBackColor = true;
-            // 
-            // NoteForChange
-            // 
-            this.NoteForChange.AutoSize = true;
-            this.NoteForChange.Checked = true;
-            this.NoteForChange.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.NoteForChange.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.NoteForChange.Location = new System.Drawing.Point(11, 39);
-            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2);
-            this.NoteForChange.Name = "NoteForChange";
-            this.NoteForChange.Size = new System.Drawing.Size(99, 21);
-            this.NoteForChange.TabIndex = 192;
-            this.NoteForChange.Text = "切换工单提示";
-            this.NoteForChange.UseVisualStyleBackColor = true;
-            // 
             // LabelDataGridView
             // 
             this.LabelDataGridView.AllowUserToAddRows = false;
@@ -310,18 +231,36 @@
             this.LabelDataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
             this.LabelDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.序号,
-            this.cm_makecode,
-            this.pr_detail_,
-            this.cm_soncode,
-            this.cm_barcode,
-            this.BarCode});
-            this.LabelDataGridView.Location = new System.Drawing.Point(18, 108);
+            this.sb_maincode,
+            this.sb_barcode,
+            this.sb_prodcode,
+            this.sb_indate});
+            this.LabelDataGridView.Location = new System.Drawing.Point(36, 216);
+            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(6);
             this.LabelDataGridView.Name = "LabelDataGridView";
             this.LabelDataGridView.RowHeadersVisible = false;
             this.LabelDataGridView.RowTemplate.Height = 23;
-            this.LabelDataGridView.Size = new System.Drawing.Size(641, 227);
+            this.LabelDataGridView.Size = new System.Drawing.Size(1750, 454);
             this.LabelDataGridView.TabIndex = 193;
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(558, 722);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(114, 41);
+            this.label2.TabIndex = 200;
+            this.label2.Text = "拼板数";
+            // 
+            // ProdNum
+            // 
+            this.ProdNum.Location = new System.Drawing.Point(695, 728);
+            this.ProdNum.Name = "ProdNum";
+            this.ProdNum.Size = new System.Drawing.Size(120, 35);
+            this.ProdNum.TabIndex = 199;
+            // 
             // dataGridViewTextBoxColumn1
             // 
             this.dataGridViewTextBoxColumn1.DataPropertyName = "cm_makecode";
@@ -333,70 +272,51 @@
             // 
             // dataGridViewTextBoxColumn2
             // 
+            this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.dataGridViewTextBoxColumn2.DataPropertyName = "pr_detail";
             this.dataGridViewTextBoxColumn2.HeaderText = "上料名称";
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.ReadOnly = true;
+            this.dataGridViewTextBoxColumn2.Width = 175;
             // 
             // dataGridViewTextBoxColumn3
             // 
+            this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.dataGridViewTextBoxColumn3.DataPropertyName = "cm_soncode";
             this.dataGridViewTextBoxColumn3.HeaderText = "前缀";
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             this.dataGridViewTextBoxColumn3.ReadOnly = true;
             this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn3.Width = 130;
+            this.dataGridViewTextBoxColumn3.Width = 127;
             // 
             // dataGridViewTextBoxColumn4
             // 
+            this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.dataGridViewTextBoxColumn4.DataPropertyName = "cm_barcode";
             this.dataGridViewTextBoxColumn4.HeaderText = "长度";
             this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
             this.dataGridViewTextBoxColumn4.ReadOnly = true;
             this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn4.Width = 80;
+            this.dataGridViewTextBoxColumn4.Width = 112;
             // 
             // dataGridViewTextBoxColumn5
             // 
+            this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.dataGridViewTextBoxColumn5.DataPropertyName = "sp_length";
             this.dataGridViewTextBoxColumn5.HeaderText = "条码号";
             this.dataGridViewTextBoxColumn5.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
             this.dataGridViewTextBoxColumn5.ReadOnly = true;
             this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn5.Width = 300;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.HeaderText = "条码号";
-            this.dataGridViewTextBoxColumn6.MinimumWidth = 300;
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn6.Width = 300;
-            // 
-            // sir_remark
-            // 
-            this.sir_remark.AllPower = null;
-            this.sir_remark.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.sir_remark.BackColor = System.Drawing.Color.White;
-            this.sir_remark.ID = null;
-            this.sir_remark.Location = new System.Drawing.Point(680, 267);
-            this.sir_remark.Multiline = true;
-            this.sir_remark.Name = "sir_remark";
-            this.sir_remark.Power = null;
-            this.sir_remark.Size = new System.Drawing.Size(198, 68);
-            this.sir_remark.Str = null;
-            this.sir_remark.Str1 = null;
-            this.sir_remark.Str2 = null;
-            this.sir_remark.TabIndex = 191;
+            this.dataGridViewTextBoxColumn5.Width = 112;
             // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(460, 344);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
+            this.StepCount.Location = new System.Drawing.Point(920, 688);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(80, 22);
+            this.StepCount.Size = new System.Drawing.Size(160, 44);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 189;
@@ -408,14 +328,14 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(96, 13);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
+            this.ma_code.Location = new System.Drawing.Point(192, 26);
+            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(148, 21);
+            this.ma_code.Size = new System.Drawing.Size(296, 42);
             this.ma_code.TabIndex = 141;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "ma_code";
@@ -427,10 +347,10 @@
             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(248, 15);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
+            this.LockMakeCode.Location = new System.Drawing.Point(496, 30);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
+            this.LockMakeCode.Size = new System.Drawing.Size(94, 35);
             this.LockMakeCode.TabIndex = 140;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -440,10 +360,11 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(401, 12);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(802, 24);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
             this.ma_prodcode.TabIndex = 99;
             // 
             // pr_detail
@@ -451,10 +372,11 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(675, 12);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_detail.Location = new System.Drawing.Point(1350, 24);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(300, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
             this.pr_detail.TabIndex = 98;
             // 
             // mcd_remainqty
@@ -462,10 +384,11 @@
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.CutLength = null;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(674, 61);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(1348, 122);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(300, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 41);
             this.mcd_remainqty.TabIndex = 97;
             this.mcd_remainqty.Tag = "mcd_remainqty";
             // 
@@ -474,10 +397,11 @@
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.CutLength = null;
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(401, 61);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_inqty.Location = new System.Drawing.Point(802, 122);
+            this.mcd_inqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(300, 0);
             this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 41);
             this.mcd_inqty.TabIndex = 96;
             // 
             // ma_qty
@@ -485,18 +409,20 @@
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(96, 61);
-            this.ma_qty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_qty.Location = new System.Drawing.Point(192, 122);
+            this.ma_qty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty.MaximumSize = new System.Drawing.Size(300, 0);
             this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 21);
+            this.ma_qty.Size = new System.Drawing.Size(0, 41);
             this.ma_qty.TabIndex = 95;
             // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(545, 344);
+            this.OperateResult.Location = new System.Drawing.Point(1090, 688);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(350, 121);
+            this.OperateResult.Size = new System.Drawing.Size(696, 238);
             this.OperateResult.TabIndex = 94;
             this.OperateResult.Text = "";
             // 
@@ -507,49 +433,18 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(460, 439);
+            this.Clean.Location = new System.Drawing.Point(920, 878);
+            this.Clean.Margin = new System.Windows.Forms.Padding(6);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(60, 24);
+            this.Clean.Size = new System.Drawing.Size(120, 48);
             this.Clean.TabIndex = 80;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.Click += new System.EventHandler(this.Clean_Click);
             // 
-            // ma_softversion
-            // 
-            this.ma_softversion.AllPower = null;
-            this.ma_softversion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.ma_softversion.BackColor = System.Drawing.Color.White;
-            this.ma_softversion.ID = null;
-            this.ma_softversion.Location = new System.Drawing.Point(772, 151);
-            this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Power = null;
-            this.ma_softversion.Size = new System.Drawing.Size(106, 21);
-            this.ma_softversion.Str = null;
-            this.ma_softversion.Str1 = null;
-            this.ma_softversion.Str2 = null;
-            this.ma_softversion.TabIndex = 78;
-            // 
-            // ma_ecncode
-            // 
-            this.ma_ecncode.AllPower = null;
-            this.ma_ecncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.ma_ecncode.BackColor = System.Drawing.Color.White;
-            this.ma_ecncode.ID = null;
-            this.ma_ecncode.Location = new System.Drawing.Point(772, 196);
-            this.ma_ecncode.Name = "ma_ecncode";
-            this.ma_ecncode.Power = null;
-            this.ma_ecncode.Size = new System.Drawing.Size(106, 21);
-            this.ma_ecncode.Str = null;
-            this.ma_ecncode.Str1 = null;
-            this.ma_ecncode.Str2 = null;
-            this.ma_ecncode.TabIndex = 77;
-            // 
             // Confirm
             // 
             this.Confirm.AllPower = "ifall";
@@ -557,12 +452,13 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(289, 440);
+            this.Confirm.Location = new System.Drawing.Point(578, 880);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(6);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(60, 24);
+            this.Confirm.Size = new System.Drawing.Size(120, 48);
             this.Confirm.TabIndex = 73;
             this.Confirm.Tag = "IfRead";
             this.Confirm.Text = "确认";
@@ -574,10 +470,11 @@
             this.code.AllPower = "ifall";
             this.code.BackColor = System.Drawing.Color.White;
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(98, 442);
+            this.code.Location = new System.Drawing.Point(196, 884);
+            this.code.Margin = new System.Windows.Forms.Padding(6);
             this.code.Name = "code";
             this.code.Power = null;
-            this.code.Size = new System.Drawing.Size(160, 21);
+            this.code.Size = new System.Drawing.Size(316, 35);
             this.code.Str = null;
             this.code.Str1 = null;
             this.code.Str2 = null;
@@ -591,80 +488,82 @@
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.Enabled = false;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(98, 398);
+            this.sn_code.Location = new System.Drawing.Point(196, 796);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(6);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(160, 21);
+            this.sn_code.Size = new System.Drawing.Size(316, 35);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 65;
             // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.HeaderText = "条码号";
+            this.dataGridViewTextBoxColumn6.MinimumWidth = 300;
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn6.Width = 300;
+            // 
             // 序号
             // 
-            this.序号.DataPropertyName = "sp_detno";
+            this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
+            this.序号.DataPropertyName = "rownum";
             this.序号.HeaderText = "序号";
             this.序号.Name = "序号";
             this.序号.ReadOnly = true;
             this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.序号.Width = 50;
-            // 
-            // cm_makecode
-            // 
-            this.cm_makecode.DataPropertyName = "sp_fsoncode";
-            this.cm_makecode.HeaderText = "上料料号";
-            this.cm_makecode.Name = "cm_makecode";
-            this.cm_makecode.ReadOnly = true;
-            this.cm_makecode.Width = 80;
+            this.序号.Width = 64;
             // 
-            // pr_detail_
+            // sb_maincode
             // 
-            this.pr_detail_.DataPropertyName = "pr_detail";
-            this.pr_detail_.HeaderText = "上料名称";
-            this.pr_detail_.Name = "pr_detail_";
-            this.pr_detail_.ReadOnly = true;
-            this.pr_detail_.Width = 130;
+            this.sb_maincode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.sb_maincode.DataPropertyName = "sb_maincode";
+            this.sb_maincode.HeaderText = "关联条码号";
+            this.sb_maincode.Name = "sb_maincode";
+            this.sb_maincode.ReadOnly = true;
+            this.sb_maincode.Width = 175;
             // 
-            // cm_soncode
+            // sb_barcode
             // 
-            this.cm_soncode.DataPropertyName = "sp_prefix";
-            this.cm_soncode.HeaderText = "前缀";
-            this.cm_soncode.Name = "cm_soncode";
-            this.cm_soncode.ReadOnly = true;
-            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_soncode.Width = 60;
+            this.sb_barcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.sb_barcode.DataPropertyName = "sb_barcode";
+            this.sb_barcode.HeaderText = "条码号";
+            this.sb_barcode.Name = "sb_barcode";
+            this.sb_barcode.ReadOnly = true;
+            this.sb_barcode.Width = 127;
             // 
-            // cm_barcode
+            // sb_prodcode
             // 
-            this.cm_barcode.DataPropertyName = "sp_length";
-            this.cm_barcode.HeaderText = "长度";
-            this.cm_barcode.Name = "cm_barcode";
-            this.cm_barcode.ReadOnly = true;
-            this.cm_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_barcode.Width = 60;
+            this.sb_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.sb_prodcode.DataPropertyName = "sb_prodcode";
+            this.sb_prodcode.HeaderText = "产品编号";
+            this.sb_prodcode.Name = "sb_prodcode";
+            this.sb_prodcode.ReadOnly = true;
+            this.sb_prodcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.sb_prodcode.Width = 112;
             // 
-            // BarCode
+            // sb_indate
             // 
-            this.BarCode.HeaderText = "条码号";
-            this.BarCode.MinimumWidth = 300;
-            this.BarCode.Name = "BarCode";
-            this.BarCode.ReadOnly = true;
-            this.BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BarCode.Width = 300;
+            this.sb_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.sb_indate.DataPropertyName = "sb_indate";
+            this.sb_indate.HeaderText = "录入日期";
+            this.sb_indate.Name = "sb_indate";
+            this.sb_indate.ReadOnly = true;
+            this.sb_indate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.sb_indate.Width = 112;
             // 
-            // Make_FeedingCollection
+            // Make_SMTBind
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(898, 487);
+            this.ClientSize = new System.Drawing.Size(1796, 974);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.ProdNum);
             this.Controls.Add(this.LabelDataGridView);
-            this.Controls.Add(this.NoteForChange);
-            this.Controls.Add(this.sir_remark);
-            this.Controls.Add(this.sir_remark_label);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_craftcode);
-            this.Controls.Add(this.ma_bomversion_label);
-            this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.ms_craftcode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.LockMakeCode);
@@ -676,12 +575,7 @@
             this.Controls.Add(this.ma_qty);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.Clean);
-            this.Controls.Add(this.ma_softversion);
-            this.Controls.Add(this.ma_ecncode);
-            this.Controls.Add(this.ma_ecncode_label);
-            this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.iflastsn);
             this.Controls.Add(this.code);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.sn_code);
@@ -695,13 +589,15 @@
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ma_prodcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Name = "Make_FeedingCollection";
-            this.Tag = "Make!FeedingCollection";
+            this.Margin = new System.Windows.Forms.Padding(6);
+            this.Name = "Make_SMTBind";
+            this.Tag = "Make!SMTBind";
             this.Text = "上料采集";
             this.Load += new System.EventHandler(this.Make_FeedingCollection_Load);
             this.SizeChanged += new System.EventHandler(this.Make_FeedingCollection_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ProdNum)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -720,12 +616,7 @@
         private System.Windows.Forms.Label sn_code_label;
         private System.Windows.Forms.Label code_label;
         private CustomControl.TextBoxWithIcon.SnCollectionBox code;
-        private System.Windows.Forms.CheckBox iflastsn;
         private CustomControl.ButtonUtil.NormalButton Confirm;
-        private System.Windows.Forms.CheckBox ma_softversion_label;
-        private System.Windows.Forms.CheckBox ma_ecncode_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ma_ecncode;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ma_softversion;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.ValueLabel.ValueLabel ma_qty;
@@ -737,13 +628,8 @@
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private System.Windows.Forms.Label ms_craftcode;
-        private System.Windows.Forms.Label ma_bomversion;
-        private System.Windows.Forms.Label ma_bomversion_label;
         private System.Windows.Forms.Label ma_craftcode;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
-        private System.Windows.Forms.CheckBox sir_remark_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox sir_remark;
-        private System.Windows.Forms.CheckBox NoteForChange;
         private System.Windows.Forms.DataGridView LabelDataGridView;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
@@ -751,11 +637,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.NumericUpDown ProdNum;
         private System.Windows.Forms.DataGridViewTextBoxColumn 序号;
-        private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail_;
-        private System.Windows.Forms.DataGridViewTextBoxColumn cm_soncode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn cm_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn BarCode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sb_maincode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sb_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sb_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sb_indate;
     }
 }

+ 78 - 377
UAS_MES_NEW/FunctionCode/Make/Make_SMTBind.cs

@@ -14,39 +14,15 @@ namespace UAS_MES_NEW.Make
 {
     public partial class Make_SMTBind : Form
     {
-        //MakeSerial表主键
-        string ms_id;
-        //制造单号                                                                             
-        string make_code;
-        //产品编号
-        string make_prodcode;
-        //工序编号
-        string nextstepcode;
-        //完工状态
-        string ms_status;
-        //工艺路线编号
-        //Bom版本
-        string mabomversion;
         string ErrorMessage = "";
 
         List<string> TSN = new List<string>();
 
         Dictionary<string, string> CheckBarcode = new Dictionary<string, string>();
 
-        //用于提醒的序列B
-        string[] RemainList = new string[0];
-        //提醒序列的索引
-        int RemainIndex = 0;
-
-        string oMakeCode = "";
-        string oMsid = "";
-
-        string ms_firstsn = "";
-
         DataHelper dh;
         LogStringBuilder sql = new LogStringBuilder();
         DataTable DBFind;
-        DataTable dt;
         //保存ListB中的数据
         DataTable dt1;
 
@@ -89,11 +65,6 @@ namespace UAS_MES_NEW.Make
         {
             DBFind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, DBFind);
-            string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
-            if (ifforsn != "" && ifforsn != "0")
-                iflastsn.Checked = true;
-            else
-                iflastsn.Checked = false;
         }
 
         private void Make_FeedingCollection_SizeChanged(object sender, EventArgs e)
@@ -125,377 +96,102 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText(">>采集数据不可为空\n", Color.Red);
                             return;
                         }
-                        //如果录入框和工单号均有输入
-                        if (code.Text != "" && ma_code.Text != "" && sn_code.Text == "")
-                        {
-                            GetCollectItem();
-                            BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
-                        }
-                        //输入框有值但未选择工单号
-                        else if (code.Text != "" && ma_code.Text == "" && sn_code.Text == "")
-                        {
-                            GetCollectItem();
-                            BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
-                        }
-                        else if (sn_code.Text != "")
+                        else
                         {
-                            //索引超出长度表示内容均已提醒
-                            if (RemainIndex >= RemainList.Length)
+                            if (sn_code.Text == "")
                             {
-                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
-                                sn_code.Text = "";
-                                code.Text = "";
-                                return;
-                            }
-                            string sp_soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
-                            string sp_fsoncode = dt1.Rows[RemainIndex]["sp_fsoncode"].ToString();
-                            string sp_prefix = dt1.Rows[RemainIndex]["sp_prefix"].ToString();
-                            string sp_regex = dt1.Rows[RemainIndex]["sp_regex"].ToString();
-                            string length = dt1.Rows[RemainIndex]["sp_length"].ToString();
-                            string sp_id = dt1.Rows[RemainIndex]["sp_id"].ToString();
-                            string sp_ifrepeat = dt1.Rows[RemainIndex]["sp_ifrepeat"].ToString();
-                            string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
-                            string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                            string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                            string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
-                            {
-                                //判断采集的条码和本次采集的也不能重复
-                                if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
+                                if (ma_code.Text != "" && !LogicHandler.CheckSnRule(ma_code.Text, ma_prodcode.Text, code.Text, out ErrorMessage))
                                 {
-                                    OperateResult.AppendText(">>条码" + code.Text + "已经上料\n", Color.Red, code);
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
                                     return;
                                 }
-                                if (sp_checkbarcode != "")
+                                sql.Clear();
+                                sql.Append("select rownum,sb_maincode,sb_makecode,sb_barcode,sb_prodcode,sb_indate from SMTBIND where sb_maincode=(select sb_maincode from SMTBIND ");
+                                sql.Append("where sb_barcode='" + code.Text + "')");
+                                dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt1.Rows.Count > 0)
                                 {
-                                    if (CheckBarcode.ContainsKey(sp_checkbarcode))
-                                    {
-                                        if (CheckBarcode[sp_checkbarcode] != code.Text)
-                                        {
-                                            OperateResult.AppendText(">>条码" + code.Text + "需要检查物料,未匹配到之前上料数据\n", Color.Red, code);
-                                            return;
-                                        }
-                                    }
-                                    else
+                                    string sb_makecode = dt1.Rows[0]["sb_makecode"].ToString();
+                                    if (ma_code.Text != "" && ma_code.Text != sb_makecode)
                                     {
-                                        OperateResult.AppendText(">>条码" + code.Text + "需要检查物料,未匹配到之前上料数据\n", Color.Red, code);
+                                        OperateResult.AppendText(">>条码已绑定至工单" + sb_makecode + "\n", Color.Red, code);
                                         return;
                                     }
+                                    sn_code.Text = dt1.Rows[0]["sb_maincode"].ToString();
+                                    ma_code.Text = dt1.Rows[0]["sb_makecode"].ToString();
+                                    LockMakeCode.Checked = true;
+                                    ma_code_UserControlTextChanged(sender, e);
+                                    BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
+                                    code.Text = "";
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
-                                if (sp_barcoderule == "BARCODE")
+                                else
                                 {
-                                    sp_soncode = ErrorMessage;
+                                    if (ma_code.Text == "")
+                                    {
+                                        OperateResult.AppendText(">>请先选择工单号\n", Color.Red, code);
+                                        return;
+                                    }
+                                    if (!LogicHandler.CheckSnRule(ma_code.Text, ma_prodcode.Text, code.Text, out ErrorMessage))
+                                    {
+                                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
+                                        return;
+                                    }
+                                    sn_code.Text = code.Text;
+                                    sql.Clear();
+                                    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,'" + sn_code.Text + "','" + code.Text + "','" + ma_code.Text + "','" + ma_prodcode.Text + "',");
+                                    sql.Append("'" + User.UserCode + "',sysdate,0)");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+
+                                    sql.Clear();
+                                    sql.Append("select rownum,sb_maincode,sb_barcode,sb_prodcode,sb_indate from SMTBIND where sb_maincode=(select sb_maincode from SMTBIND ");
+                                    sql.Append("where sb_barcode='" + code.Text + "')");
+                                    dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
+                                    code.Text = "";
                                 }
-                                Save_OtherCode(sp_fsoncode, sp_soncode, make_code, sn_code.Text, sp_id);
                             }
                             else
-                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                        }
-                    }
-                    //勾选了下料的时候
-                    else if (UnLoading.Checked)
-                    {
-                        if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
-                        {
-                            sql.Clear();
-                            sql.Append("select ms_firstsn,cm_makecode,cm_craftcode,nvl(cm_status,0)cm_status,cm_id,cm_stepcode,");
-                            sql.Append("ms_makecode,cm_mccode,cm_materialtype from craftmaterial left join makeserial on cm_makecode");
-                            sql.Append("=ms_makecode and cm_sncode=ms_sncode where cm_sncode='" + code.Text + "' and cm_makecode='" + oMakeCode + "'");
-                            sql.Append("and cm_materialtype=1");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
                             {
-                                string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
-                                string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
-                                string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
-                                string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
-                                string cm_materialtype = dt.Rows[0]["cm_materialtype"].ToString();
-                                string cm_status = dt.Rows[0]["cm_status"].ToString();
-                                string cm_makecode = dt.Rows[0]["cm_makecode"].ToString();
-                                string cm_craftcode = dt.Rows[0]["cm_craftcode"].ToString();
-                                //清除已被使用的序列号
-                                sql.Clear();
-                                sql.Append("update makeserial set ms_nextmacode='' where ms_sncode in(select cm_barcode from craftmaterial where ");
-                                sql.Append("cm_makecode='" + cm_makecode + "' and cm_sncode='" + code.Text + "' and cm_stepcode='" + cm_stepcode + "' and cm_craftcode='" + cm_craftcode + "' ");
-                                sql.Append("and cm_materialtype=1 and nvl(cm_status,0) =0) and ms_nextmacode='" + oMakeCode + "'");
-                                dh.ExecuteSql(sql.GetString(), "update");
-                                //进行下料
-                                sql.Clear();
-                                sql.Append("delete from craftmaterial where (cm_sncode in (select sn from makesnrelation where firstsn");
-                                sql.Append("='" + ms_firstsn + "') or cm_sncode = '" + ms_firstsn + "') and cm_makecode = '" + oMakeCode + "' ");
-                                sql.Append("and cm_status = 0 and cm_stepcode='" + User.CurrentStepCode + "' and cm_materialtype=1");
-                                dh.ExecuteSql(sql.GetString(), "delete");
-                                LogicHandler.InsertMakeProcess(ms_macode, code.Text, User.UserSourceCode, "上料采集操作", "下料成功", User.UserCode);
-                                //刷新界面值
+                                if (ma_code.Text == "")
+                                {
+                                    OperateResult.AppendText(">>请先选择工单号\n", Color.Red, code);
+                                    return;
+                                }
+                                if (!LogicHandler.CheckSnRule(ma_code.Text, ma_prodcode.Text, code.Text, out ErrorMessage))
+                                {
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
+                                    return;
+                                }
+                                if (dh.CheckExist("smtbind", "sb_barcode='" + code.Text + "'"))
+                                {
+                                    OperateResult.AppendText(">>条码" + code.Text + "已绑定\n", Color.Red, code);
+                                    return;
+                                }
                                 sql.Clear();
-                                sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
-                                sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
-                                sql.Append("ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                BaseUtil.SetFormValue(Controls, dt);
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集", "下料成功", code.Text, "");
-                                OperateResult.AppendText(">>序列号" + code.Text + "下料成功\n", Color.Green, code);
-                            }
-                            else OperateResult.AppendText(">>序列号" + code.Text + "未上料,无需下料\n", Color.Red, code);
-                        }
-                        else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                    }
-                }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-            }
-        }
+                                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,'" + sn_code.Text + "','" + code.Text + "','" + ma_code.Text + "','" + ma_prodcode.Text + "',");
+                                sql.Append("'" + User.UserCode + "',sysdate,0)");
+                                dh.ExecuteSql(sql.GetString(), "insert");
 
-        //获取采集的项目
-        private void GetCollectItem()
-        {
-            bool NoteAlready = LogicHandler.CheckDiffMakeCodeBeforeStepCheck(code.Text, ma_code.Text, NoteForChange.Checked, out oMakeCode, out ErrorMessage);
-            if (!NoteAlready)
-            {
-                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                return;
-            }
-            if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
-            {
-                if (!LogicHandler.CheckDiffMakeCodeAfterStepCheck(code.Text, oMakeCode, NoteForChange.Checked, NoteAlready, ma_code, out ErrorMessage))
-                {
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                    return;
-                }
-                //将录入框的值给序列号
-                sn_code.Text = code.Text;
-                sql.Clear();
-                sql.Append("select ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_spec,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
-                sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
-                sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    ms_id = dt.Rows[0]["ms_id"].ToString();
-                    make_code = dt.Rows[0]["ma_code"].ToString();
-                    mabomversion = dt.Rows[0]["ma_bomversion"].ToString();
-                    make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-                    nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                    ms_status = dt.Rows[0]["ms_status"].ToString();
-                    ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_stepcode='" + User.CurrentStepCode + "'  and sp_craftcode='" + ms_craftcode.Text + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
-                    if (ifforsn != "" && ifforsn != "0")
-                        iflastsn.Checked = true;
-                    else
-                        iflastsn.Checked = false;
-                    LockMakeCode.Checked = true;
-                    //勾选了前一工单
-                    if (iflastsn.Checked)
-                    {
-                        dt = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_craftcode,ms_status,ms_nextstepcode,ms_prodcode,ms_code from makeserial where ms_sncode='" + code.Text + "' and ms_makecode<>'" + ma_code.Text + "' order by ms_id desc", "select");
-                        string make_code = "";
-                        string make_prodcode = "";
-                        string nextstepcode = "";
-                        string ms_status = "";
-                        if (dt.Rows.Count > 0)
-                        {
-                            ms_id = dt.Rows[0]["ms_id"].ToString();
-                            make_code = dt.Rows[0]["ms_makecode"].ToString();
-                            make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-                            nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                            ms_status = dt.Rows[0]["ms_status"].ToString();
-                            //判断序列号的前一工单是否已经完工
-                            if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text && dt.Rows[0]["ms_status"].ToString() == "2")
-                            {
                                 sql.Clear();
-                                sql.Append("select sp_id,sp_soncode from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
-                                sql.Append("join stepproduct on sp_sbid=sb_id where ma_code='" + ma_code.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' ");
-                                sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and nvl(sp_ifforsn,0)<>0");
-                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                if (dt.Rows.Count > 0)
+                                sql.Append("select rownum,sb_maincode,sb_barcode,sb_prodcode,sb_indate from SMTBIND where sb_maincode=(select sb_maincode from SMTBIND ");
+                                sql.Append("where sb_barcode='" + code.Text + "')");
+                                dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
+                                if (LabelDataGridView.Rows.Count == ProdNum.Value)
                                 {
-                                    string sp_id = dt.Rows[0]["sp_id"].ToString();
-                                    string sp_soncode = dt.Rows[0]["sp_soncode"].ToString();
-                                    if (!dh.CheckExist("Craftmaterial", "cm_makecode='" + ma_code.Text + "' and cm_soncode='" + make_prodcode + "' and cm_sncode='" + code.Text + "' and cm_status=0"))
-                                    {
-                                        CollectDataSonCode.Add(sp_soncode);
-                                        SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
-                                        sn_code.Text = code.Text;
-                                        OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
-                                        RemainIndex = RemainIndex + 1;
-                                        GetItem();
-                                        return;
-                                    }
-                                    else
-                                    {
-                                        GetItem();
-                                    }
+                                    sn_code.Text = "";
                                 }
-                                else OperateResult.AppendText(">>序列号" + code.Text + "无生产信息\n", Color.Red, code);
+                                code.Text = "";
                             }
-                            else OperateResult.AppendText(">>序列号" + code.Text + "已被工单" + dt.Rows[0]["ms_makecode"].ToString() + "绑定,尚未完工\n", Color.Red, code);
                         }
-                        else OperateResult.AppendText(">>序列号" + code.Text + "无生产信息\n", Color.Red, code);
                     }
-                    else
+                    //勾选了下料的时候
+                    else if (UnLoading.Checked)
                     {
-                        dt = (DataTable)dh.ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_sncode='" + code.Text + "' and ms_makecode='" + ma_code.Text + "' order by ms_id desc", "select");
-                        nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                        ms_status = dt.Rows[0]["ms_status"].ToString();
-                        sn_code.Text = code.Text;
-                        sql.Clear();
-                        sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_spec,ma_qty from makeserial left join product ");
-                        sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
-                        sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "'");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                        BaseUtil.SetFormValue(this.Controls, dt);
-                        OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
-                        GetItem();
-                    }
-                }
-                else
-                {
-                    OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red, code);
-                    code.Text = "";
-                    sn_code.Text = "";
-                }
-            }
-            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-        }
-
-        private void GetItem()
-        {
-            //单独用一个DataTable存储一个
-            dt1 = new DataTable();
-            sql.Clear();
-            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
-            sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
-            sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
-            sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
-            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
-            sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where ");
-            sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_makecode='" + ma_code.Text + "' and cm_fsoncode=");
-            sql.Append("sp_fsoncode and cm_status=0) group by sp_fsoncode order by SP_DETNO asc");
-            dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            code.Clear();
-            //用于记录提醒的数据长度
-            RemainList = new string[dt1.Rows.Count];
-            for (int i = 0; i < dt1.Rows.Count; i++)
-            {
-                string soncode = dt1.Rows[i]["sp_soncode"].ToString();
-                string prdetail = dt1.Rows[i]["pr_detail"].ToString();
-                RemainList[i] = soncode + "(" + prdetail + ")";
-            }
-            if (dt1.Rows.Count > 0)
-            {
-                try
-                {
-                    string soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
-                    string prdetail = dt1.Rows[RemainIndex]["pr_detail"].ToString();
-                    OperateResult.AppendText("<<请采集" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
-                }
-                catch (Exception)
-                {
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green);
-                    code.Text = "";
-                    sn_code.Text = "";
-                }
-            }
-            else
-            {
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
-                if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                else
-                {
-                    //提示正确返回时传递的信息
-                    if (ErrorMessage.Contains("AFTERSUCCESS"))
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                }
-                code.Text = "";
-                sn_code.Text = "";
-            }
-        }
 
-        //此类中通用的保存逻辑
-        private void Save_OtherCode(string sp_fsoncode, string sp_soncode, string ma_code, string ms_sncode, string sp_id)
-        {
-            CollectDataSonCode.Add(sp_soncode);
-            //采集成功提示
-         
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
-            if (!CheckBarcode.ContainsKey(sp_fsoncode))
-            {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
-            }
-            SPID.Add(sp_id);
-            OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
-            LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
-            code.Clear();
-            RemainIndex = RemainIndex + 1;
-            //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
-            if (RemainIndex < RemainList.Length)
-            {
-                OperateResult.AppendText("<<请采集" + RemainList[RemainIndex] + "的物料数据\n", Color.Black);
-            }
-            else
-            {
-                sql.Clear();
-                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
-                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");
-                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,mcd_stepcode,");
-                sql.Append("mcd_stepname,sp_fsoncode,ms_craftcode,ms_craftname,:barcode,1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "',ma_wccode,");
-                sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
-                sql.Append(" and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code and sp_craftcode=ms_craftcode ");
-                sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
-                dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
-                try
-                {
-                    string Log = "";
-                    for (int i = 0; i < CollectDataSonCode.Count; i++)
-                    {
-                        Log += CollectDataSonCode.ToArray()[i] + " " + CollectData.ToArray()[i] + " " + SPID.ToArray()[i];
                     }
-                    LogManager.DoLog(Log);
-                }
-                catch (Exception)
-                {
-
-                }
-                //更新序列号半成品已被使用
-                dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
-                if (ma_ecncode_label.Checked || ma_softversion_label.Checked)
-                {
-                    string ecnText = ma_ecncode_label.Checked ? ma_ecncode.Text : "";
-                    string softversionText = ma_softversion_label.Checked ? ma_softversion.Text : "";
-                    string remark = sir_remark_label.Checked ? sir_remark.Text : "";
-                    sql.Clear();
-                    sql.Append("insert into SNRELATIONINFORECORD(SIR_ID,SIR_SNCODE,SIR_MSCODE,SIR_ECNCODE,SIR_SOFTVER,");
-                    sql.Append("SIR_LINECODE,SIR_SOURCECODE,SIR_STEPCODE,SIR_MACODE,SIR_PRODCODE,SIR_INMAN,SIR_INDATE,sir_firstsn,sir_remark) select ");
-                    sql.Append("SNRELATIONINFORECORD_SEQ.nextval,'" + sn_code.Text + "',ms_code,'" + ecnText + "','" + softversionText + "',");
-                    sql.Append("'" + User.UserLineCode + "','" + User.UserSourceCode + "','" + User.CurrentStepCode + "','" + ma_code + "','" + ma_prodcode.Text + "',");
-                    sql.Append("'" + User.UserCode + "',sysdate,ms_firstsn,'" + remark + "' from makeserial where ms_sncode='" + sn_code.Text + "' and ms_makecode='" + ma_code + "'");
-                    dh.ExecuteSql(sql.GetString(), "insert");
-                }
-                CollectData.Clear();
-                TSN.Clear();
-                SPID.Clear();
-                CheckBarcode.Clear();
-                CollectDataSonCode.Clear();
-                //采集成功,设置序列号栏目为空
-                RemainIndex = 0;
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green);
-                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集", "上料成功", sn_code.Text, "");
-                if (LogicHandler.SetStepResult(ma_code, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
-                {
-                    //提示正确返回时传递的信息
-                    if (ErrorMessage.Contains("AFTERSUCCESS"))
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                    sn_code.Text = "";
-                    //刷新数据
-                    EventArgs e = new EventArgs();
-                    object sender = null;
-                    ma_code_UserControlTextChanged(sender, e);
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
             }
@@ -511,7 +207,6 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Clear();
             if (dt1 != null)
                 BaseUtil.CleanDataTableData(dt1);
-            RemainIndex = 0;
             BaseUtil.CleanDGVData(LabelDataGridView);
             OperateResult.AppendText(">>请采集序列号\n", Color.Black);
         }
@@ -526,12 +221,18 @@ namespace UAS_MES_NEW.Make
                     mcd_inqty.Text = "";
                     mcd_remainqty.Text = "";
                     sql.Clear();
-                    sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
-                    sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
+                    sql.Append("select ma_qty,mcd_inqty,ma_qty-mcd_inqty mcd_remainqty,ma_prodcode,pr_detail ");
+                    sql.Append("from make left join makecraftdetail on mcd_macode=ma_code left join product on ma_prodcode=pr_code where ");
                     sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                     DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                         BaseUtil.SetFormValue(Controls, dt);
+
+                    sql.Clear();
+                    sql.Append("select rownum,sb_maincode,sb_barcode,sb_prodcode,sb_makecode,sb_indate from SMTBIND where sb_maincode=(select sb_maincode from SMTBIND ");
+                    sql.Append("where sb_barcode='" + code.Text + "')");
+                    dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
                 }
             }
         }

+ 4 - 7
UAS_MES_NEW/FunctionCode/Make/Make_SMTBind.resx

@@ -120,19 +120,16 @@
   <metadata name="序号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="cm_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="sb_maincode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_detail_.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="sb_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="cm_soncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="sb_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="cm_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="sb_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

+ 2 - 4
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -15,7 +15,7 @@ namespace UAS_MES_NEW.Packing
 {
     public partial class Packing_PackageCollection : Form
     {
-        public BarTender.Application engine;
+        public Seagull.BarTender.Print.Engine engine;
         DataHelper dh;
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
@@ -46,7 +46,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new BarTender.Application();
+                engine = new Seagull.BarTender.Print.Engine();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -587,8 +587,6 @@ namespace UAS_MES_NEW.Packing
         private void PackCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
               BaseUtil.ClosePrint(lbl);
-            if (engine != null)
-                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();
         }
 

+ 2 - 4
UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -25,7 +25,7 @@ namespace UAS_MES_NEW.Packing
 
         Packing_NewPallet NewPallet;
 
-        public BarTender.Application engine;
+        public Seagull.BarTender.Print.Engine engine;
 
         string pa_nextstep = "";
         //箱类型
@@ -53,7 +53,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new BarTender.Application();
+                engine = new Seagull.BarTender.Print.Engine();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -507,8 +507,6 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PalletCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-            if (engine != null)
-                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
         }
 

+ 68 - 0
UAS_MES_NEW/PublicForm/SetCheck.Designer.cs

@@ -0,0 +1,68 @@
+namespace UAS_MES_NEW.PublicForm
+{
+    partial class SetCheck
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetCheck));
+            this.label1 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("宋体", 257.75F);
+            this.label1.ForeColor = System.Drawing.SystemColors.MenuHighlight;
+            this.label1.Location = new System.Drawing.Point(216, 95);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(488, 344);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "OK";
+            // 
+            // SetCheck
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.HighlightText;
+            this.ClientSize = new System.Drawing.Size(917, 553);
+            this.Controls.Add(this.label1);
+            this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Name = "SetCheck";
+            this.Text = "SetCheck";
+            this.Load += new System.EventHandler(this.SetLoadingWindow_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+    }
+}

+ 43 - 0
UAS_MES_NEW/PublicForm/SetCheck.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Drawing;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace UAS_MES_NEW.PublicForm
+{
+    public partial class SetCheck : Form
+    {
+
+        Color colors;
+
+        string t;
+
+        public SetCheck()
+        {
+            InitializeComponent();
+        }
+
+        public SetCheck(string Title, Color color)
+        {
+            InitializeComponent();
+            CheckForIllegalCrossThreadCalls = false;
+            Text = Title;
+            colors = color;
+        }
+
+        private void SetLoadingWindow_Load(object sender, EventArgs e)
+        {
+            label1.Text = Text;
+            label1.ForeColor = colors;
+            //在本窗体新建一个进程用来判断传递的进程是否执行结束
+            Thread t1 = new Thread(SetLoadFinish);
+            t1.Start();
+        }
+
+        private void SetLoadFinish()
+        {
+            Thread.Sleep(500);
+            Close();
+        }
+    }
+}

+ 43 - 1
UAS_MES_NEW/PublicMethod/LogicHandler.cs

@@ -777,7 +777,7 @@ namespace UAS_MES_NEW.PublicMethod
                 string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" + iSnCode + "'").ToString();
                 if (ifng == "-1")
                 {
-                    dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + iSnCode + "'","select");
+                    dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + iSnCode + "'", "select");
                     dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
                 }
                 dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
@@ -1315,5 +1315,47 @@ namespace UAS_MES_NEW.PublicMethod
             sql.Append(":SourceCode,:stepcode,:ifreprint,sysdate,:inman)");
             dh.ExecuteSql(sql.ToString(), "insert", printValue, printType, MakeCode, prodCode, sourceCode, stepcode, ifRePrint, userCode);
         }
+
+        public static bool CheckSnRule(string iMakeCode, string iProdCode, string iSN, out string oErrMsg)
+        {
+            oErrMsg = "";
+            DataTable dt = (DataTable)dh.ExecuteSql("select max(psr_prefix)psr_prefix,max(psr_length)psr_length from productsnrule where psr_prodcode='" + iProdCode + "'  and psr_type='before' ", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
+                string psr_length = dt.Rows[0]["psr_length"].ToString();
+                if (iSN.Length != int.Parse(psr_length))
+                {
+                    oErrMsg = "序列号:" + iSN + "长度错误,不满足产品防呆规则!";
+                    return false;
+                }
+                if (psr_prefix.Length>iSN.Length|| iSN.Substring(0, psr_prefix.Length) != psr_prefix)
+                {
+                    oErrMsg = "序列号:" + iSN + "前缀错误,不满足产品防呆规则!";
+                    return false;
+                }
+            }
+            //判断维护号段范围
+            dt = (DataTable)dh.ExecuteSql("select 1 from makesnruledetail where msd_makecode='"+iMakeCode+"'", "select");
+            if (dt.Rows.Count > 0) {
+                dt = (DataTable)dh.ExecuteSql("select 1 from makesnruledetail where msd_makecode='" + iMakeCode + "' and msd_sncode='"+iSN+"'", "select");
+                if (dt.Rows.Count == 0) {
+                    oErrMsg = "序列号:" + iSN + "不在工单防呆起始结束范围内!";
+                    return false;
+                }
+            }
+            //判断导入清单范围
+            dt = (DataTable)dh.ExecuteSql("select 1 from makesnlist where msl_makecode='"+iMakeCode+"'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                dt = (DataTable)dh.ExecuteSql("select 1 from makesnlist where msd_makecode='" + iMakeCode + "' and msl_sncode='" + iSN + "'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    oErrMsg = "序列号:" + iSN + "不在工单导入号段范围!";
+                    return false;
+                }
+            }
+            return true;
+        }
     }
 }

+ 22 - 24
UAS_MES_NEW/PublicMethod/Print.cs

@@ -6,6 +6,7 @@ using System.IO;
 using UAS_MES_NEW.Entity;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -14,7 +15,7 @@ namespace UAS_MES_NEW.PublicMethod
         static DataHelper dh = SystemInf.dh;
         //CodeSoft打印的驱动和文件
         static Document doc;
-        static BarTender.Format doc2;
+        static LabelFormatDocument doc2;
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
         static FileInfo info;
@@ -88,7 +89,7 @@ namespace UAS_MES_NEW.PublicMethod
                         }
                     }
                 }
-                catch (System.Exception ex)
+                catch (System.Exception)
                 {
                     MessageBox.Show("SQL维护不正确");
                 }
@@ -183,7 +184,7 @@ namespace UAS_MES_NEW.PublicMethod
                                     doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[0][0].ToString();
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if (j != 0&&doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
+                                if (j != 0 && doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
                                 {
                                     doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[j][0].ToString();
                                 }
@@ -191,7 +192,7 @@ namespace UAS_MES_NEW.PublicMethod
                         }
                     }
                 }
-                catch (System.Exception ex)
+                catch (System.Exception)
                 {
                     MessageBox.Show("SQL维护不正确");
                 }
@@ -211,7 +212,7 @@ namespace UAS_MES_NEW.PublicMethod
 
 
 
-        public static bool SinglePrint(string iCaller,  BarTender.Application lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+        public static bool SinglePrint(string iCaller, Seagull.BarTender.Print.Engine lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
@@ -232,8 +233,8 @@ namespace UAS_MES_NEW.PublicMethod
                 //    return false;
                 //}
             }
-          //  string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
-           // FileInfo PrintFile = new FileInfo(LabelName);
+            //  string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
+            // FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
             dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
@@ -253,7 +254,7 @@ namespace UAS_MES_NEW.PublicMethod
             //    string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
             //    dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
             //}
-            doc2 = lbl.Formats.Open(LabelName);
+            doc2 = lbl.Documents.Open(LabelName);
             if (doc2 == null)
             {
                 MessageBox.Show("标签文件打开失败");
@@ -280,16 +281,16 @@ namespace UAS_MES_NEW.PublicMethod
                         int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
                         for (int j = 0; j < LoopTime; j++)
                         {
-                            for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
+                            for (int k = 0; k < doc2.SubStrings.Count; k++)
                             {
-                                if (j == 0 & doc2.NamedSubStrings.Item(k+1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                if (j == 0 & doc2.SubStrings[k + 1].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
                                 {
-                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[0][0].ToString());
+                                    doc2.SubStrings[k + 1].Value = (Param.Rows[0][0].ToString());
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if ( j!=0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
+                                if (j != 0 & doc2.SubStrings[k + 1].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
                                 {
-                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
+                                    doc2.SubStrings[k + 1].Value = (Param.Rows[j][0].ToString());
                                 }
                             }
                         }
@@ -297,27 +298,24 @@ namespace UAS_MES_NEW.PublicMethod
                 }
                 catch (System.Exception ex)
                 {
-                    MessageBox.Show("SQL维护不正确"+ex.Message);
+                    MessageBox.Show("SQL维护不正确" + ex.Message);
                 }
             }
-          //  LogManager.DoLog(sb.ToString());
+            //  LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
-           // doc2.Printer.SwitchTo(PrinterName);
-           
+            // doc2.Printer.SwitchTo(PrinterName);
+
             // 同样标签的份数 
             doc2.PrintSetup.IdenticalCopiesOfLabel = PrintNum;
             // 序列标签数 
-            doc2.PrintSetup.NumberSerializedLabels = 1;
-            doc2.PrintSetup.Printer = PrinterName;
-            doc2.PrintOut(false, false);
-            doc2.Close(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            doc2.PrintSetup.NumberOfSerializedLabels = 1;
+            doc2.PrintSetup.PrinterName = PrinterName;
+            doc2.Print();
+            doc2.Close(Seagull.BarTender.Print.SaveOptions.DoNotSaveChanges);
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             //打印完毕 
-            lbl.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             return true;
         }
-
-
     }
 }