瀏覽代碼

维修界面途程放大镜加特殊权限,彩盒上料打印加归属工单

章政 7 年之前
父節點
當前提交
9d1b449629

+ 51 - 30
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -51,9 +51,10 @@
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ma_craftcode = new System.Windows.Forms.Label();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.Lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
             // 
@@ -64,15 +65,15 @@
             this.ms_makecode_label.Location = new System.Drawing.Point(25, 20);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_makecode_label.TabIndex = 125;
-            this.ms_makecode_label.Text = "归属工单";
+            this.ms_makecode_label.Text = "工单";
             // 
             // pr_code_label
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(317, 20);
+            this.pr_code_label.Location = new System.Drawing.Point(330, 20);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -83,7 +84,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(317, 78);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(330, 78);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -94,7 +95,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(609, 78);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(622, 78);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -129,7 +130,7 @@
             // 
             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(609, 20);
+            this.pr_detail_label.Location = new System.Drawing.Point(622, 20);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -172,7 +173,7 @@
             // 
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_sncode.Location = new System.Drawing.Point(149, 78);
+            this.ms_sncode.Location = new System.Drawing.Point(108, 78);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Size = new System.Drawing.Size(0, 27);
             this.ms_sncode.TabIndex = 163;
@@ -182,7 +183,7 @@
             this.load.AutoSize = true;
             this.load.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.load.ForeColor = System.Drawing.Color.Blue;
-            this.load.Location = new System.Drawing.Point(29, 528);
+            this.load.Location = new System.Drawing.Point(29, 526);
             this.load.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.load.Name = "load";
             this.load.Size = new System.Drawing.Size(73, 31);
@@ -196,7 +197,7 @@
             this.unload.AutoSize = true;
             this.unload.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.unload.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            this.unload.Location = new System.Drawing.Point(168, 528);
+            this.unload.Location = new System.Drawing.Point(168, 526);
             this.unload.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.unload.Name = "unload";
             this.unload.Size = new System.Drawing.Size(73, 31);
@@ -209,7 +210,7 @@
             // 
             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(339, 529);
+            this.code_label.Location = new System.Drawing.Point(307, 529);
             this.code_label.Name = "code_label";
             this.code_label.Size = new System.Drawing.Size(72, 27);
             this.code_label.TabIndex = 167;
@@ -246,7 +247,7 @@
             this.code.AllPower = null;
             this.code.BackColor = System.Drawing.Color.White;
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(433, 531);
+            this.code.Location = new System.Drawing.Point(401, 531);
             this.code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.code.Name = "code";
             this.code.Power = null;
@@ -269,7 +270,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             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(733, 78);
+            this.mcd_remainqty.Location = new System.Drawing.Point(746, 78);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -280,7 +281,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(441, 78);
+            this.mcd_okqty.Location = new System.Drawing.Point(454, 78);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -292,7 +293,7 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(441, 20);
+            this.pr_code.Location = new System.Drawing.Point(454, 20);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_code.Name = "pr_code";
@@ -305,25 +306,13 @@
             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(733, 20);
+            this.pr_detail.Location = new System.Drawing.Point(746, 20);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 154;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.CutLength = null;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(149, 20);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 152;
-            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -345,11 +334,43 @@
             this.ma_craftcode.TabIndex = 170;
             this.ma_craftcode.Visible = false;
             // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(113, 22);
+            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(153, 25);
+            this.ma_code.TabIndex = 171;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = true;
+            // 
+            // Lock
+            // 
+            this.Lock.AutoSize = true;
+            this.Lock.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Lock.LeaveEvent = false;
+            this.Lock.Location = new System.Drawing.Point(270, 23);
+            this.Lock.Name = "Lock";
+            this.Lock.Size = new System.Drawing.Size(61, 24);
+            this.Lock.TabIndex = 172;
+            this.Lock.Text = "锁定";
+            this.Lock.UseVisualStyleBackColor = true;
+            // 
             // Make_ColorBoxLoadPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1292, 565);
+            this.Controls.Add(this.Lock);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_craftcode);
             this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.PrintNum);
@@ -366,7 +387,6 @@
             this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.pr_detail);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ms_sncode_label);
             this.Controls.Add(this.OperateResult);
@@ -398,7 +418,6 @@
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private System.Windows.Forms.Label ms_sncode_label;
         private System.Windows.Forms.Label pr_detail_label;
-        private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
@@ -415,5 +434,7 @@
         private System.Windows.Forms.NumericUpDown PrintNum;
         private CustomControl.ValueLabel.ValueLabel ma_bomversion;
         private System.Windows.Forms.Label ma_craftcode;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox Lock;
     }
 }

+ 31 - 13
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -22,7 +22,7 @@ namespace UAS_MES.Make
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //制造单号
-        string ma_code;
+        string macode;
         //当前工单的序列号
         //string sn_code;
         //当前提示的索引
@@ -55,6 +55,24 @@ namespace UAS_MES.Make
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+
+            //工单号放大镜配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本";
+            ma_code.FormName = Name;
+            ma_code.DBTitle = "工单查询";
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ms_makecode_DbChange;
+
+            Lock.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(Lock);
+        }
+
+        private void Ms_makecode_DbChange(object sender, EventArgs e)
+        {
+            dt = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, dt);
         }
 
         private void InPrint()
@@ -82,20 +100,20 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     string Msid;
-                    if (ms_makecode.Text == "")
+                    if (ma_code.Text == "")
                     {
-                        if (!LogicHandler.GetMakeInfo(code.Text, out ma_code, out ErrorMessage))
+                        if (!LogicHandler.GetMakeInfo(code.Text, out macode, out ErrorMessage))
                         {
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             return;
                         }
                     }
-                    if (ms_makecode.Text != ma_code || ListA.Rows.Count == 0)
+                    if (ma_code.Text != macode || ListA.Rows.Count == 0)
                     {
-                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
+                        if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
                         {
                             sql.Clear();
-                            sql.Append("select ms_makecode,ma_craftcode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
+                            sql.Append("select ma_code,ma_craftcode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
                             sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_id='" + Msid + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
@@ -129,15 +147,15 @@ namespace UAS_MES.Make
                             }
                             else if (unload.Checked == true)
                             {
-                                if (LogicHandler.CheckStepSNAndMacode(ma_code, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage))
+                                if (LogicHandler.CheckStepSNAndMacode(macode, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage))
                                 {
-                                    dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + ma_code + "'", "select");
+                                    dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + macode + "'", "select");
                                     if (dt.Rows.Count > 0)
                                     {
                                         string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
                                         string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
                                         string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
-                                        dh.ExecuteSql("delete from craftmaterial where cm_sncode='" + code.Text + "' and cm_makecode='" + ma_code + "'", "delete");
+                                        dh.ExecuteSql("delete from craftmaterial where cm_sncode='" + code.Text + "' and cm_makecode='" + macode + "'", "delete");
                                         LogicHandler.InsertMakeProcess(ms_macode, code.Text, User.UserSourceCode, "上料采集操作", "下料成功", User.UserCode);
                                         int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + code.Text + "'");
                                         if (count == 0)
@@ -162,7 +180,7 @@ namespace UAS_MES.Make
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
                         string sp_tracekind = ListA.Rows[RemainIndex]["sp_tracekind"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                        if (LogicHandler.CheckSNBeforeLoad(ma_code, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                        if (LogicHandler.CheckSNBeforeLoad(macode, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                         {
                             CollectData.Add(code.Text);
                             CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());
@@ -186,14 +204,14 @@ namespace UAS_MES.Make
                             sql.Append("mcd_stepname,ma_craftcode,ma_craftname,:barcode,1,sysdate,'" + User.UserCode + "',ma_linecode,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_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
-                            sql.Append("where ma_code='" + ma_code + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
+                            sql.Append("where ma_code='" + macode + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的工单已经采集完成\n", Color.Green);
                             Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                             RemainIndex = 0;
                             CollectData.Clear();
                             CollectDataSonCode.Clear();
-                            if (LogicHandler.SetTestResult(ms_makecode.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
+                            if (LogicHandler.SetTestResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
                             {
                                 mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
                                 code.Clear();
@@ -231,7 +249,7 @@ namespace UAS_MES.Make
 
         private void LoadCollectNum()
         {
-            dt = (DataTable)dh.ExecuteSql("select ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
 

+ 4 - 15
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -106,7 +106,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     if (Loading.Checked)
@@ -137,29 +136,19 @@ namespace UAS_MES.Make
                                         if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
                                         {
                                             sql.Clear();
-                                            sql.Append("select sp_id from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
+                                            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='" + ma_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)
                                             {
                                                 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_sncode='" + code.Text + "'"))
                                                 {
-                                                    sql.Clear();
-                                                    sql.Append("insert into Craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,cm_soncode,cm_mscode,");
-                                                    sql.Append("cm_sncode,cm_stepcode,cm_stepname,cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate");
-                                                    sql.Append(",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, sp_soncode,'" + code.Text + "'");
-                                                    sql.Append(",'" + code.Text + "',mcd_stepcode,mcd_stepname,ma_craftcode,ma_craftname,'" + code.Text + "'");
-                                                    sql.Append(",1,sysdate,'" + User.UserName + "',ma_linecode,ma_wccode,'" + User.UserSourceCode + "',");
-                                                    sql.Append("'" + sp_id + "',0,1,ms_firstsn from make left join makeserial on ms_makecode=ma_code left ");
-                                                    sql.Append("join makecraftdetail on mcd_macode=ma_code left join stepproduct on sp_stepcode=mcd_stepcode ");
-                                                    sql.Append("where ma_code = '" + ma_code.Text + "'and sp_id = " + sp_id + " and mcd_stepcode=");
-                                                    sql.Append("'" + User.CurrentStepCode + "' and ms_sncode='" + code.Text + "'");
-                                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                                    CollectDataSonCode.Add(sp_soncode);
+                                                    CollectData.Add(code.Text);
                                                     sn_code.Text = code.Text;
-                                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "上料采集成功", sn_code.Text, "");
                                                     OperateResult.AppendText(">>序列号" + code.Text + "上料成功\n", Color.Green);
                                                     RemainIndex = RemainIndex + 1;
                                                     GetCollectItem();

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -853,7 +853,7 @@
             this.cd_stepcode.Location = new System.Drawing.Point(464, 104);
             this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4);
             this.cd_stepcode.Name = "cd_stepcode";
-            this.cd_stepcode.Power = null;
+            this.cd_stepcode.Power = "ifspecial";
             this.cd_stepcode.ReturnData = null;
             this.cd_stepcode.SelectField = null;
             this.cd_stepcode.SetValueField = null;
@@ -861,7 +861,7 @@
             this.cd_stepcode.TabIndex = 68;
             this.cd_stepcode.TableName = null;
             this.cd_stepcode.Tag = "ms_stepcode";
-            this.cd_stepcode.TextBoxEnable = true;
+            this.cd_stepcode.TextBoxEnable = false;
             // 
             // cr_code
             // 
@@ -875,7 +875,7 @@
             this.cr_code.Location = new System.Drawing.Point(121, 103);
             this.cr_code.Margin = new System.Windows.Forms.Padding(4);
             this.cr_code.Name = "cr_code";
-            this.cr_code.Power = null;
+            this.cr_code.Power = "ifspecial";
             this.cr_code.ReturnData = null;
             this.cr_code.SelectField = null;
             this.cr_code.SetValueField = null;
@@ -883,7 +883,7 @@
             this.cr_code.TabIndex = 67;
             this.cr_code.TableName = null;
             this.cr_code.Tag = "ms_craftcode";
-            this.cr_code.TextBoxEnable = true;
+            this.cr_code.TextBoxEnable = false;
             this.cr_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.cr_code_UserControlTextChanged);
             // 
             // NewBadCode

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -649,6 +649,7 @@ namespace UAS_MES.Make
 
         private void ms_prodcode_TextChanged(object sender, EventArgs e)
         {
+            cr_code.Condition = "cr_prodcode='" + ms_prodcode.Text + "'";
             bd_soncode.Condition = "bd_mothercode='" + ms_prodcode.Text + "' and NVL(bd_usestatus,' ')<>'DISABLE'";
         }
     }

+ 12 - 0
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -129,6 +129,18 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>