Эх сурвалжийг харах

修改岗位备料的取值SQL

章政 8 жил өмнө
parent
commit
34681a9cc6

+ 47 - 69
UAS-MES/FunctionCode/Make/Make_PositionStock.Designer.cs

@@ -69,9 +69,8 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1439, 36);
+            this.panel2.Size = new System.Drawing.Size(1079, 29);
             this.panel2.TabIndex = 31;
             // 
             // label1
@@ -79,10 +78,9 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(16, 5);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(12, 4);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 0;
             this.label1.Text = "工单信息";
             // 
@@ -90,10 +88,9 @@
             // 
             this.sc_stepcode_label.AutoSize = true;
             this.sc_stepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sc_stepcode_label.Location = new System.Drawing.Point(857, 118);
-            this.sc_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sc_stepcode_label.Location = new System.Drawing.Point(643, 94);
             this.sc_stepcode_label.Name = "sc_stepcode_label";
-            this.sc_stepcode_label.Size = new System.Drawing.Size(52, 27);
+            this.sc_stepcode_label.Size = new System.Drawing.Size(42, 21);
             this.sc_stepcode_label.TabIndex = 165;
             this.sc_stepcode_label.Text = "工序";
             // 
@@ -101,10 +98,9 @@
             // 
             this.ma_craftcode_label.AutoSize = true;
             this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode_label.Location = new System.Drawing.Point(13, 118);
-            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(10, 94);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
-            this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_craftcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_craftcode_label.TabIndex = 162;
             this.ma_craftcode_label.Text = "工艺路线";
             // 
@@ -112,10 +108,9 @@
             // 
             this.sc_linecode_label.AutoSize = true;
             this.sc_linecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sc_linecode_label.Location = new System.Drawing.Point(432, 118);
-            this.sc_linecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sc_linecode_label.Location = new System.Drawing.Point(324, 94);
             this.sc_linecode_label.Name = "sc_linecode_label";
-            this.sc_linecode_label.Size = new System.Drawing.Size(52, 27);
+            this.sc_linecode_label.Size = new System.Drawing.Size(42, 21);
             this.sc_linecode_label.TabIndex = 159;
             this.sc_linecode_label.Text = "线别";
             // 
@@ -123,10 +118,9 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(13, 72);
-            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Location = new System.Drawing.Point(10, 58);
             this.ma_code_label.Name = "ma_code_label";
-            this.ma_code_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_code_label.Size = new System.Drawing.Size(74, 21);
             this.ma_code_label.TabIndex = 155;
             this.ma_code_label.Text = "归属工单";
             // 
@@ -134,10 +128,9 @@
             // 
             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(857, 72);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(643, 58);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 156;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -145,10 +138,9 @@
             // 
             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(432, 72);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(324, 58);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_prodcode_label.TabIndex = 157;
             this.ma_prodcode_label.Text = "产品代码";
             // 
@@ -158,10 +150,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(16, 659);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(12, 527);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(92, 27);
+            this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 175;
             this.label3.Text = "物料批号";
             // 
@@ -170,10 +161,9 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(16, 165);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(12, 132);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 22);
             this.label2.TabIndex = 181;
             this.label2.Text = "采集信息";
             // 
@@ -184,18 +174,17 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(149, 72);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ma_code.Location = new System.Drawing.Point(112, 58);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(228, 25);
+            this.ma_code.Size = new System.Drawing.Size(171, 21);
             this.ma_code.TabIndex = 180;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "ma_code";
             this.ma_code.TextBoxEnable = true;
-            this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
             // Clean
             // 
@@ -204,13 +193,12 @@
             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(1237, 654);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.Location = new System.Drawing.Point(928, 523);
             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(80, 30);
+            this.Clean.Size = new System.Drawing.Size(60, 24);
             this.Clean.TabIndex = 179;
             this.Clean.Tag = "IfRead";
             this.Clean.Text = "清除";
@@ -220,10 +208,9 @@
             // 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(1120, 198);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(840, 158);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(311, 440);
+            this.OperateResult.Size = new System.Drawing.Size(234, 353);
             this.OperateResult.TabIndex = 178;
             this.OperateResult.Text = "";
             // 
@@ -234,13 +221,12 @@
             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(461, 655);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
+            this.Confirm.Location = new System.Drawing.Point(346, 525);
             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(80, 30);
+            this.Confirm.Size = new System.Drawing.Size(60, 24);
             this.Confirm.TabIndex = 177;
             this.Confirm.Tag = "IfRead";
             this.Confirm.Text = "确认";
@@ -254,11 +240,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_batchnum.BackColor = System.Drawing.Color.White;
             this.pr_batchnum.ID = null;
-            this.pr_batchnum.Location = new System.Drawing.Point(117, 659);
-            this.pr_batchnum.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_batchnum.Location = new System.Drawing.Point(88, 527);
             this.pr_batchnum.Name = "pr_batchnum";
             this.pr_batchnum.Power = null;
-            this.pr_batchnum.Size = new System.Drawing.Size(320, 25);
+            this.pr_batchnum.Size = new System.Drawing.Size(241, 21);
             this.pr_batchnum.Str = null;
             this.pr_batchnum.Str1 = null;
             this.pr_batchnum.Str2 = null;
@@ -278,11 +263,10 @@
             this.Column6,
             this.Column7,
             this.Column8});
-            this.BatchProduct.Location = new System.Drawing.Point(0, 198);
-            this.BatchProduct.Margin = new System.Windows.Forms.Padding(4);
+            this.BatchProduct.Location = new System.Drawing.Point(0, 158);
             this.BatchProduct.Name = "BatchProduct";
             this.BatchProduct.RowTemplate.Height = 23;
-            this.BatchProduct.Size = new System.Drawing.Size(1101, 441);
+            this.BatchProduct.Size = new System.Drawing.Size(826, 353);
             this.BatchProduct.TabIndex = 174;
             // 
             // Column1
@@ -337,20 +321,18 @@
             // 
             this.sc_stepcode.AutoSize = true;
             this.sc_stepcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sc_stepcode.Location = new System.Drawing.Point(989, 118);
-            this.sc_stepcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sc_stepcode.Location = new System.Drawing.Point(742, 94);
             this.sc_stepcode.Name = "sc_stepcode";
-            this.sc_stepcode.Size = new System.Drawing.Size(0, 27);
+            this.sc_stepcode.Size = new System.Drawing.Size(0, 21);
             this.sc_stepcode.TabIndex = 171;
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             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(989, 72);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(742, 58);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 170;
             this.pr_detail.Tag = "pr_detail";
             // 
@@ -358,32 +340,30 @@
             // 
             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(149, 118);
-            this.ma_craftcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_craftcode.Location = new System.Drawing.Point(112, 94);
             this.ma_craftcode.Name = "ma_craftcode";
-            this.ma_craftcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_craftcode.Size = new System.Drawing.Size(0, 21);
             this.ma_craftcode.TabIndex = 169;
             // 
             // sc_linecode
             // 
             this.sc_linecode.AutoSize = true;
             this.sc_linecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sc_linecode.Location = new System.Drawing.Point(561, 118);
-            this.sc_linecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sc_linecode.Location = new System.Drawing.Point(421, 94);
             this.sc_linecode.Name = "sc_linecode";
-            this.sc_linecode.Size = new System.Drawing.Size(0, 27);
+            this.sc_linecode.Size = new System.Drawing.Size(0, 21);
             this.sc_linecode.TabIndex = 168;
             // 
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
             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(561, 72);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(421, 58);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 167;
             this.ma_prodcode.Tag = "ma_prodcode";
+            this.ma_prodcode.TextChanged += new System.EventHandler(this.ma_prodcode_TextChanged);
             // 
             // Screen
             // 
@@ -392,13 +372,12 @@
             this.Screen.DownImage = ((System.Drawing.Image)(resources.GetObject("Screen.DownImage")));
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
             this.Screen.IsShowBorder = true;
-            this.Screen.Location = new System.Drawing.Point(1351, 118);
-            this.Screen.Margin = new System.Windows.Forms.Padding(4);
+            this.Screen.Location = new System.Drawing.Point(1013, 94);
             this.Screen.MoveImage = ((System.Drawing.Image)(resources.GetObject("Screen.MoveImage")));
             this.Screen.Name = "Screen";
             this.Screen.NormalImage = ((System.Drawing.Image)(resources.GetObject("Screen.NormalImage")));
             this.Screen.Power = null;
-            this.Screen.Size = new System.Drawing.Size(80, 30);
+            this.Screen.Size = new System.Drawing.Size(60, 24);
             this.Screen.TabIndex = 154;
             this.Screen.Tag = "IfRead";
             this.Screen.Text = "刷新";
@@ -407,9 +386,9 @@
             // 
             // Make_PositionStock
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1439, 700);
+            this.ClientSize = new System.Drawing.Size(1079, 560);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.Clean);
@@ -432,7 +411,6 @@
             this.Controls.Add(this.Screen);
             this.Controls.Add(this.panel2);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_PositionStock";
             this.Tag = "Make!PositionStock";
             this.Text = "岗位备料";

+ 20 - 43
UAS-MES/FunctionCode/Make/Make_PositionStock.cs

@@ -30,12 +30,14 @@ namespace UAS_MES.Make
         {
             dh = new DataHelper();
             asc.controllInitializeSize(this);
+
             ma_code.TableName = "make left join product on ma_prodcode=pr_code ";
             ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_craftcode # 工艺路线,pr_detail # 产品名称";
             ma_code.FormName = Name;
             ma_code.DBTitle = "工单查询";
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail", "ma_craftcode" };
             ma_code.Condition = "ma_statuscode='STARTED'";
+
             sc_linecode.Text = User.UserLineCode;
             sc_stepcode.Text = User.CurrentStepCode;
         }
@@ -65,8 +67,8 @@ namespace UAS_MES.Make
                             string bar_remain = dt.Rows[0]["bar_remain"].ToString();
                             string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
                             sql.Clear();
-                            sql.Append("select * from make left join makematerial on mm_maid=ma_id left join makematerialreplace on mp_mmid=mm_id ");
-                            sql.Append("where ma_code='" + ma_code.Text + "' and (mm_prodcode='" + bar_prodcode + "' or mp_prodcode ='" + bar_prodcode + "') and mm_stepcode='" + sc_stepcode.Text + "'");
+                            sql.Append("select * from stepproduct inner join product on pr_code=sp_soncode left join makematerial on mm_prodcode=sp_soncode where ");
+                            sql.Append("sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode+"' and sp_mothercode='"+ bar_prodcode + "' and pr_tracekind=2 ");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -84,34 +86,17 @@ namespace UAS_MES.Make
                                     dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
                                     //数据插入成功后加载Grid的数据
                                     FillDataGridView();
-                                    OperateResult.AppendText(">>备料成功\n", Color.Green);
-                                }
-                                else
-                                {
-                                    OperateResult.AppendText(">>该批次号的物料已分配\n", Color.Red);
+                                    OperateResult.AppendText(">>批次号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
                                 }
-                                pr_batchnum.Text = "";
-                            }
-                            else
-                            {
-                                OperateResult.AppendText(">>批次对应的物料不是当前工单当前工序需要备的物料\n", Color.Red);
-                                pr_batchnum.Text = "";
+                                else OperateResult.AppendText(">>批次号" + pr_batchnum.Text + "的物料已分配\n", Color.Red, pr_batchnum);
                             }
+                            else OperateResult.AppendText(">>批次" + pr_batchnum.Text + "对应的物料不是当前工单当前工序需要备的物料\n", Color.Red, pr_batchnum);
                         }
-                        else
-                        {
-                            OperateResult.AppendText(">>批号:" + pr_batchnum.Text + "不存在,或者状态无效\n", Color.Red);
-                            pr_batchnum.Text = "";
-                        }
-                    }
-                    else
-                    {
-                        OperateResult.AppendText(">>工单号不能为空\n", Color.Red);
-                        pr_batchnum.Text = "";
+                        else OperateResult.AppendText(">>批号:" + pr_batchnum.Text + "不存在,或者状态无效\n", Color.Red, pr_batchnum);
                     }
+                    else OperateResult.AppendText(">>工单号不能为空\n", Color.Red, pr_batchnum);
                 }
-                else
-                    MessageBox.Show("物料批号不允许为空");
+                else OperateResult.AppendText(">>物料批号不允许为空\n", Color.Red);
             }
         }
 
@@ -138,7 +123,7 @@ namespace UAS_MES.Make
             FillDataGridView();
         }
 
-        private void ma_code_UserControlTextChanged(object sender, EventArgs e)
+        private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
             if (ma_code.Text != "")
             {
@@ -154,30 +139,22 @@ namespace UAS_MES.Make
                     {
                         //判断当前用户的执行工序和岗位资源是否对应
                         sql.Clear();
-                        sql.Append("select sc_linecode,sc_stepcode from craft left join craftdetail on cd_crid=cr_id ");
-                        sql.Append(" left join source  on sc_stepcode=cd_stepcode where cr_code='" + ma_craftcode.Text + "' and sc_code='" + User.UserSourceCode + "' ");
-                        sql.Append("and  sc_statuscode='AUDITED' and cr_statuscode='AUDITED'");
+                        sql.Append("select sp_soncode,mm_oneuseqty,mss_prodcode,mss_barcode,nvl(mss_qty,0)mss_qty,mss_remain,mm_qty,pr_detail,pr_spec ");
+                        sql.Append("from stepproduct inner join makematerial on sp_soncode=mm_Prodcode left join product on pr_code=mm_prodcode left join ");
+                        sql.Append("makesourcestock on mss_maid=mm_maid and mss_stepcode=mm_stepcode and mm_prodcode=mss_fprodcode where ");
+                        sql.Append("mm_maid='" + ma_id + "' and sp_mothercode='" + ma_prodcode.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' and pr_tracekind=2");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         //查询到有记录的话表示对应
                         if (dt.Rows.Count > 0)
                             FillDataGridView();
                         //查询到没有结果表示不对应
-                        else
-                        {
-                            if (craftcode == "")
-                                OperateResult.AppendText(">>工单无可执行工序(已完工或者序列号不存在)\n", Color.Red);
-                            else
-                                OperateResult.AppendText(">>工单:" + ma_code.Text + "当前的工序是" + craftcode + "\n", Color.Red);
-                        }
+                        else OperateResult.AppendText(">>当前工单物料无需备料\n", Color.Red);
                     }
-                    else
-                        OperateResult.AppendText(">>必须状态为已下放的工单才允许进行岗位备料\n", Color.Red);
+                    else OperateResult.AppendText(">>必须状态为已下放的工单才允许进行岗位备料\n", Color.Red);
                 }
-                else
-                    OperateResult.AppendText(">>工单号不存在\n", Color.Red);
+                else OperateResult.AppendText(">>工单号不存在\n", Color.Red);
             }
-            else
-                MessageBox.Show("工单号不允许为空");
+            else OperateResult.AppendText(">>工单号不允许为空\n", Color.Red);
         }
     }
 }

+ 0 - 24
UAS-MES/FunctionCode/Make/Make_PositionStock.resx

@@ -404,30 +404,6 @@
   <metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <data name="Screen.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m