shim před 8 roky
rodič
revize
067e450ab2

+ 234 - 208
UAS-MES/FunctionCode/Make/Make_PositionStock.Designer.cs

@@ -31,36 +31,39 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_PositionStock));
             this.panel2 = new System.Windows.Forms.Panel();
             this.label1 = new System.Windows.Forms.Label();
-            this.sc_stepcode_label = new System.Windows.Forms.Label();
-            this.ma_craftcode_label = new System.Windows.Forms.Label();
-            this.sc_linecode_label = new System.Windows.Forms.Label();
             this.ma_code_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_prodcode_label = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
-            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.sc_stepcode_label = new System.Windows.Forms.Label();
+            this.ma_craftcode_label = new System.Windows.Forms.Label();
+            this.ma_craftcode = new System.Windows.Forms.ComboBox();
+            this.Lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.pr_batchnum = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.BatchProduct = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
-            this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BatchProductDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
             this.sc_stepcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ma_craftcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.sc_linecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Screen = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.sp_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sp_oneuseqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mm_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_remain = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_useqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DeleteRow = new System.Windows.Forms.DataGridViewImageColumn();
             this.panel2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.BatchProduct)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).BeginInit();
             this.SuspendLayout();
             // 
             // panel2
@@ -69,9 +72,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, 4, 4, 4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1230, 36);
+            this.panel2.Size = new System.Drawing.Size(922, 29);
             this.panel2.TabIndex = 31;
             // 
             // label1
@@ -79,54 +81,19 @@
             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 = "工单信息";
             // 
-            // sc_stepcode_label
-            // 
-            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(804, 99);
-            this.sc_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sc_stepcode_label.Name = "sc_stepcode_label";
-            this.sc_stepcode_label.Size = new System.Drawing.Size(52, 27);
-            this.sc_stepcode_label.TabIndex = 165;
-            this.sc_stepcode_label.Text = "工序";
-            // 
-            // ma_craftcode_label
-            // 
-            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, 99);
-            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_craftcode_label.Name = "ma_craftcode_label";
-            this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
-            this.ma_craftcode_label.TabIndex = 162;
-            this.ma_craftcode_label.Text = "工艺路线";
-            // 
-            // sc_linecode_label
-            // 
-            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(406, 99);
-            this.sc_linecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sc_linecode_label.Name = "sc_linecode_label";
-            this.sc_linecode_label.Size = new System.Drawing.Size(52, 27);
-            this.sc_linecode_label.TabIndex = 159;
-            this.sc_linecode_label.Text = "线别";
-            // 
             // ma_code_label
             // 
             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, 53);
-            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Location = new System.Drawing.Point(10, 42);
             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 +101,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(804, 53);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(316, 82);
             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 +111,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(406, 53);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(12, 82);
             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 +123,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(13, 637);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(10, 510);
             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,13 +134,53 @@
             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, 146);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(12, 117);
             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 = "采集信息";
             // 
+            // sc_stepcode_label
+            // 
+            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(617, 42);
+            this.sc_stepcode_label.Name = "sc_stepcode_label";
+            this.sc_stepcode_label.Size = new System.Drawing.Size(42, 21);
+            this.sc_stepcode_label.TabIndex = 165;
+            this.sc_stepcode_label.Text = "工序";
+            // 
+            // ma_craftcode_label
+            // 
+            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(316, 42);
+            this.ma_craftcode_label.Name = "ma_craftcode_label";
+            this.ma_craftcode_label.Size = new System.Drawing.Size(42, 21);
+            this.ma_craftcode_label.TabIndex = 184;
+            this.ma_craftcode_label.Text = "途程";
+            // 
+            // ma_craftcode
+            // 
+            this.ma_craftcode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.ma_craftcode.FormattingEnabled = true;
+            this.ma_craftcode.Location = new System.Drawing.Point(415, 42);
+            this.ma_craftcode.Name = "ma_craftcode";
+            this.ma_craftcode.Size = new System.Drawing.Size(150, 20);
+            this.ma_craftcode.TabIndex = 185;
+            // 
+            // 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(254, 43);
+            this.Lock.Name = "Lock";
+            this.Lock.Size = new System.Drawing.Size(51, 21);
+            this.Lock.TabIndex = 182;
+            this.Lock.Text = "锁定";
+            this.Lock.UseVisualStyleBackColor = true;
+            // 
             // ma_code
             // 
             this.ma_code.AllPower = null;
@@ -184,17 +188,19 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(136, 53);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ma_code.Location = new System.Drawing.Point(102, 42);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
             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(231, 26);
+            this.ma_code.Size = new System.Drawing.Size(139, 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.MaCodeSearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
             // Clean
             // 
@@ -203,13 +209,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(1045, 634);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Location = new System.Drawing.Point(781, 507);
             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 = "清除";
@@ -219,10 +224,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(952, 180);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(708, 143);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(271, 440);
+            this.OperateResult.Size = new System.Drawing.Size(204, 353);
             this.OperateResult.TabIndex = 178;
             this.OperateResult.Text = "";
             // 
@@ -233,13 +237,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(458, 634);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Confirm.Location = new System.Drawing.Point(344, 509);
             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 = "确认";
@@ -253,134 +256,72 @@
             | 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(114, 637);
-            this.pr_batchnum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pr_batchnum.Location = new System.Drawing.Point(86, 510);
             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;
             this.pr_batchnum.TabIndex = 176;
             this.pr_batchnum.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_batchnum_KeyDown);
             // 
-            // BatchProduct
-            // 
-            this.BatchProduct.AllowUserToAddRows = false;
-            this.BatchProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.BatchProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.Column1,
-            this.Column2,
-            this.Column3,
-            this.Column4,
-            this.Column5,
-            this.Column6,
-            this.Column7,
-            this.Column8});
-            this.BatchProduct.Location = new System.Drawing.Point(0, 179);
-            this.BatchProduct.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.BatchProduct.Name = "BatchProduct";
-            this.BatchProduct.RowTemplate.Height = 23;
-            this.BatchProduct.Size = new System.Drawing.Size(936, 441);
-            this.BatchProduct.TabIndex = 174;
-            // 
-            // Column1
-            // 
-            this.Column1.DataPropertyName = "mm_prodcode";
-            this.Column1.HeaderText = "首选料号";
-            this.Column1.Name = "Column1";
-            // 
-            // Column2
-            // 
-            this.Column2.DataPropertyName = "mss_prodcode";
-            this.Column2.HeaderText = "备选料号";
-            this.Column2.Name = "Column2";
-            // 
-            // Column3
-            // 
-            this.Column3.DataPropertyName = "mss_barcode";
-            this.Column3.HeaderText = "条码号";
-            this.Column3.Name = "Column3";
-            // 
-            // Column4
-            // 
-            this.Column4.DataPropertyName = "mss_baseqty";
-            this.Column4.HeaderText = "备料数量";
-            this.Column4.Name = "Column4";
-            // 
-            // Column5
-            // 
-            this.Column5.DataPropertyName = "mm_qty";
-            this.Column5.HeaderText = "需求数";
-            this.Column5.Name = "Column5";
-            // 
-            // Column6
-            // 
-            this.Column6.DataPropertyName = "mss_remain";
-            this.Column6.HeaderText = "剩余数";
-            this.Column6.Name = "Column6";
-            // 
-            // Column7
-            // 
-            this.Column7.DataPropertyName = "pr_detail";
-            this.Column7.HeaderText = "物料名称";
-            this.Column7.Name = "Column7";
-            // 
-            // Column8
-            // 
-            this.Column8.DataPropertyName = "pr_spec";
-            this.Column8.HeaderText = "物料规格";
-            this.Column8.Name = "Column8";
+            // BatchProductDGV
+            // 
+            this.BatchProductDGV.AllowUserToAddRows = false;
+            this.BatchProductDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.BatchProductDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.sp_soncode,
+            this.mss_id,
+            this.mss_prodcode,
+            this.mss_barcode,
+            this.sp_oneuseqty,
+            this.mss_qty,
+            this.mm_qty,
+            this.mss_remain,
+            this.mss_useqty,
+            this.pr_detail1,
+            this.pr_spec,
+            this.DeleteRow});
+            this.BatchProductDGV.Location = new System.Drawing.Point(0, 143);
+            this.BatchProductDGV.Name = "BatchProductDGV";
+            this.BatchProductDGV.RowTemplate.Height = 23;
+            this.BatchProductDGV.Size = new System.Drawing.Size(702, 353);
+            this.BatchProductDGV.TabIndex = 174;
+            this.BatchProductDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.BatchProduct_CellContentClick);
             // 
             // sc_stepcode
             // 
             this.sc_stepcode.AutoSize = true;
+            this.sc_stepcode.CutLength = null;
             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(936, 99);
-            this.sc_stepcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sc_stepcode.Location = new System.Drawing.Point(688, 42);
+            this.sc_stepcode.MaximumSize = new System.Drawing.Size(150, 0);
             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.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(936, 53);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(415, 82);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             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";
             // 
-            // 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(136, 99);
-            this.ma_craftcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_craftcode.Name = "ma_craftcode";
-            this.ma_craftcode.Size = new System.Drawing.Size(0, 27);
-            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(535, 99);
-            this.sc_linecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sc_linecode.Name = "sc_linecode";
-            this.sc_linecode.Size = new System.Drawing.Size(0, 27);
-            this.sc_linecode.TabIndex = 168;
-            // 
             // ma_prodcode
             // 
             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(535, 53);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(102, 82);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
             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);
@@ -392,24 +333,111 @@
             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(1143, 99);
-            this.Screen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Screen.Location = new System.Drawing.Point(621, 83);
             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 = "刷新";
             this.Screen.UseVisualStyleBackColor = true;
             this.Screen.Click += new System.EventHandler(this.Screen_Click);
             // 
+            // sp_soncode
+            // 
+            this.sp_soncode.DataPropertyName = "sp_soncode";
+            this.sp_soncode.HeaderText = "首选料号";
+            this.sp_soncode.Name = "sp_soncode";
+            this.sp_soncode.ReadOnly = true;
+            // 
+            // mss_id
+            // 
+            this.mss_id.DataPropertyName = "mss_id";
+            this.mss_id.HeaderText = "ID";
+            this.mss_id.Name = "mss_id";
+            this.mss_id.Visible = false;
+            // 
+            // mss_prodcode
+            // 
+            this.mss_prodcode.DataPropertyName = "mss_prodcode";
+            this.mss_prodcode.HeaderText = "备选料号";
+            this.mss_prodcode.Name = "mss_prodcode";
+            this.mss_prodcode.ReadOnly = true;
+            // 
+            // mss_barcode
+            // 
+            this.mss_barcode.DataPropertyName = "mss_barcode";
+            this.mss_barcode.HeaderText = "条码号";
+            this.mss_barcode.Name = "mss_barcode";
+            this.mss_barcode.ReadOnly = true;
+            // 
+            // sp_oneuseqty
+            // 
+            this.sp_oneuseqty.DataPropertyName = "sp_oneuseqty";
+            this.sp_oneuseqty.HeaderText = "单位用量";
+            this.sp_oneuseqty.Name = "sp_oneuseqty";
+            this.sp_oneuseqty.ReadOnly = true;
+            // 
+            // mss_qty
+            // 
+            this.mss_qty.DataPropertyName = "mss_qty";
+            this.mss_qty.HeaderText = "备料数量";
+            this.mss_qty.Name = "mss_qty";
+            // 
+            // mm_qty
+            // 
+            this.mm_qty.DataPropertyName = "mm_qty";
+            this.mm_qty.HeaderText = "需求数";
+            this.mm_qty.Name = "mm_qty";
+            this.mm_qty.ReadOnly = true;
+            this.mm_qty.Visible = false;
+            // 
+            // mss_remain
+            // 
+            this.mss_remain.DataPropertyName = "mss_remain";
+            this.mss_remain.HeaderText = "剩余数";
+            this.mss_remain.Name = "mss_remain";
+            this.mss_remain.ReadOnly = true;
+            // 
+            // mss_useqty
+            // 
+            this.mss_useqty.DataPropertyName = "mss_useqty";
+            this.mss_useqty.HeaderText = "已用数量";
+            this.mss_useqty.Name = "mss_useqty";
+            this.mss_useqty.ReadOnly = true;
+            // 
+            // pr_detail1
+            // 
+            this.pr_detail1.DataPropertyName = "pr_detail";
+            this.pr_detail1.HeaderText = "物料名称";
+            this.pr_detail1.Name = "pr_detail1";
+            this.pr_detail1.ReadOnly = true;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "物料规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.ReadOnly = true;
+            this.pr_spec.Visible = false;
+            // 
+            // DeleteRow
+            // 
+            this.DeleteRow.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.DeleteRow.HeaderText = "删除";
+            this.DeleteRow.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.DeleteRow.Name = "DeleteRow";
+            // 
             // 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(1230, 675);
+            this.ClientSize = new System.Drawing.Size(922, 540);
+            this.Controls.Add(this.ma_craftcode);
+            this.Controls.Add(this.ma_craftcode_label);
+            this.Controls.Add(this.Lock);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.Clean);
@@ -417,22 +445,17 @@
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.pr_batchnum);
             this.Controls.Add(this.label3);
-            this.Controls.Add(this.BatchProduct);
+            this.Controls.Add(this.BatchProductDGV);
             this.Controls.Add(this.sc_stepcode);
             this.Controls.Add(this.pr_detail);
-            this.Controls.Add(this.ma_craftcode);
-            this.Controls.Add(this.sc_linecode);
             this.Controls.Add(this.ma_prodcode);
             this.Controls.Add(this.sc_stepcode_label);
-            this.Controls.Add(this.ma_craftcode_label);
-            this.Controls.Add(this.sc_linecode_label);
             this.Controls.Add(this.ma_code_label);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ma_prodcode_label);
             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, 4, 4, 4);
             this.Name = "Make_PositionStock";
             this.Tag = "Make!PositionStock";
             this.Text = "岗位备料";
@@ -440,7 +463,7 @@
             this.SizeChanged += new System.EventHandler(this.岗位备料_SizeChanged);
             this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.BatchProduct)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -451,32 +474,35 @@
         private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Label label1;
         private CustomControl.ButtonUtil.NormalButton Screen;
-        private System.Windows.Forms.Label sc_stepcode_label;
-        private System.Windows.Forms.Label ma_craftcode_label;
-        private System.Windows.Forms.Label sc_linecode_label;
         private System.Windows.Forms.Label ma_code_label;
         private System.Windows.Forms.Label pr_detail_label;
         private System.Windows.Forms.Label ma_prodcode_label;
         private CustomControl.ValueLabel.ValueLabel ma_prodcode;
-        private CustomControl.ValueLabel.ValueLabel sc_linecode;
-        private CustomControl.ValueLabel.ValueLabel ma_craftcode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
-        private CustomControl.ValueLabel.ValueLabel sc_stepcode;
-        private CustomControl.DataGrid_View.DataGridViewWithSerialNum BatchProduct;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum BatchProductDGV;
         private CustomControl.TextBoxWithIcon.EnterTextBox pr_batchnum;
         private System.Windows.Forms.Label label3;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.ButtonUtil.NormalButton Clean;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
-        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private System.Windows.Forms.Label label2;
+        private CustomControl.ValueLabel.ValueLabel sc_stepcode;
+        private System.Windows.Forms.Label sc_stepcode_label;
+        private CustomControl.CustomCheckBox.LockCheckBox Lock;
+        private System.Windows.Forms.Label ma_craftcode_label;
+        private System.Windows.Forms.ComboBox ma_craftcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_soncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_id;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_oneuseqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_qty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mm_qty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_remain;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_useqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
+        private System.Windows.Forms.DataGridViewImageColumn DeleteRow;
     }
 }

+ 99 - 51
UAS-MES/FunctionCode/Make/Make_PositionStock.cs

@@ -23,6 +23,8 @@ namespace UAS_MES.Make
 
         string ma_id;
 
+        string craftcode_condition = "";
+
         public Make_PositionStock()
         {
             InitializeComponent();
@@ -30,9 +32,7 @@ namespace UAS_MES.Make
 
         private void 岗位备料_Load(object sender, EventArgs e)
         {
-            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;
@@ -40,9 +40,10 @@ namespace UAS_MES.Make
             ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail", "ma_craftcode" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
-
-            sc_linecode.Text = User.UserLineCode;
             sc_stepcode.Text = User.CurrentStepCode;
+            ma_code.SetLockCheckBox(Lock);
+            Lock.GetMakeCodeCtl(ma_code);
+            dh = new DataHelper();
         }
 
         private void Ma_code_DbChange(object sender, EventArgs e)
@@ -70,38 +71,46 @@ namespace UAS_MES.Make
                 {
                     if (ma_code.Text != "")
                     {
-                        dt = (DataTable)dh.ExecuteSql("select bar_remain,bar_prodcode from barcode inner join product on pr_code=bar_prodcode where bar_code ='" + pr_batchnum.Text + "' and bar_status = 1 ", "select");
+                        sql.Clear();
+                        sql.Append("select cr_code from craft left join craftdetail on cd_crid=cr_id where cr_code in (" + craftcode_condition + ") ");
+                        sql.Append("and cr_prodcode='" + ma_prodcode.Text + "'  and  cr_statuscode='AUDITED'  and  cd_stepcode='" + User.CurrentStepCode + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
-                            string bar_remain = dt.Rows[0]["bar_remain"].ToString();
-                            string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
-                            sql.Clear();
-                            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");
+                            dt = (DataTable)dh.ExecuteSql("select bar_remain,bar_prodcode from barcode inner join product on pr_code=bar_prodcode where bar_code ='" + pr_batchnum.Text + "' and bar_status = 1 ", "select");
                             if (dt.Rows.Count > 0)
                             {
-                                string mm_oneuseqty = dt.Rows[0]["mm_oneuseqty"].ToString();
-                                string mm_prodcode = dt.Rows[0]["mm_prodcode"].ToString();
-                                if (dh.getRowCount("makesourcestock", "mss_makecode='" + ma_code.Text + "' and mss_prodcode='" + mm_prodcode + "' and mss_barcode='" + pr_batchnum.Text + "'") == 0)
+                                string bar_remain = dt.Rows[0]["bar_remain"].ToString();
+                                string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
+                                sql.Clear();
+                                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)
                                 {
-                                    sql.Clear();
-                                    sql.Append("insert into makesourcestock (mss_id,mss_makecode,mss_linecode ,mss_craftcode,");
-                                    sql.Append("mss_stepcode,mss_barcode,mss_fprodcode,mss_indate,mss_inman,mss_qty,");
-                                    sql.Append("mss_remain ,mss_baseqty ,mss_prodcode,mss_maid) values(makesourcestock_seq.nextval,'" + ma_code.Text + "','" + sc_linecode.Text + "',");
-                                    sql.Append("'" + ma_craftcode.Text + "','" + sc_stepcode.Text + "','" + pr_batchnum.Text + "','" + mm_prodcode + "',");
-                                    sql.Append("sysdate,'" + User.UserName + "'," + bar_remain + "," + bar_remain + ",'" + mm_oneuseqty + "','" + bar_prodcode + "'," + ma_id + ")");
-                                    dh.ExecuteSql(sql.GetString(), "insert");
-                                    dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
-                                    //数据插入成功后加载Grid的数据
-                                    FillDataGridView();
-                                    OperateResult.AppendText(">>批次号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
+                                    string mm_oneuseqty = dt.Rows[0]["mm_oneuseqty"].ToString();
+                                    string mm_prodcode = dt.Rows[0]["mm_prodcode"].ToString();
+                                    if (dh.getRowCount("makesourcestock", "mss_makecode='" + ma_code.Text + "' and mss_prodcode='" + mm_prodcode + "' and mss_barcode='" + pr_batchnum.Text + "'") == 0)
+                                    {
+                                        sql.Clear();
+                                        sql.Append("insert into makesourcestock (mss_id,mss_makecode,mss_linecode ,mss_craftcode,");
+                                        sql.Append("mss_stepcode,mss_barcode,mss_fprodcode,mss_indate,mss_inman,mss_qty,");
+                                        sql.Append("mss_remain ,mss_baseqty ,mss_prodcode,mss_maid) values(makesourcestock_seq.nextval,'" + ma_code.Text + "','" + User.UserLineCode + "',");
+                                        sql.Append("'','" + sc_stepcode.Text + "','" + pr_batchnum.Text + "','" + mm_prodcode + "',");
+                                        sql.Append("sysdate,'" + User.UserCode + "','" + bar_remain + "','" + bar_remain + "','" + mm_oneuseqty + "','" + bar_prodcode + "','" + ma_id + "')");
+                                        dh.ExecuteSql(sql.GetString(), "insert");
+                                        dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
+                                        //数据插入成功后加载Grid的数据
+                                        FillDataGridView();
+                                        OperateResult.AppendText(">>批次号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
+                                    }
+                                    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);
                             }
-                            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);
+                        else OperateResult.AppendText(">>当前岗位资源工序不在工单对应的途程中\n", Color.Red);
                     }
                     else OperateResult.AppendText(">>工单号不能为空\n", Color.Red, pr_batchnum);
                 }
@@ -113,12 +122,13 @@ namespace UAS_MES.Make
         private void FillDataGridView()
         {
             sql.Clear();
-            sql.Append("select mm_prodcode,mss_baseqty,mss_prodcode,mss_barcode,nvl(mss_qty,0) mss_qty,mss_remain");
-            sql.Append(",mm_qty,pr_detail,pr_spec from makematerial left join product on pr_code=mm_prodcode left join makesourcestock on ");
-            sql.Append("mss_maid=mm_maid and mss_stepcode = mm_stepcode and mm_prodcode=mss_fprodcode ");
-            sql.Append("where mm_maid='" + ma_id + "' and mm_stepcode='" + sc_stepcode.Text + "' and pr_tracekind=2");
+            sql.Append("select nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,mss_remain,");
+            sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
+            sql.Append("pr_code=sp_mothercode left join makesourcestock on mss_makecode='" + ma_code.Text + "' and  mss_craftcode=sb_craftcode ");
+            sql.Append("and mss_stepcode=sp_stepcode where sb_prodcode='" + ma_prodcode.Text + "' and sb_craftcode='" + ma_craftcode.Text + "' ");
+            sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            BaseUtil.FillDgvWithDataTable(BatchProduct, dt);
+            BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
         }
 
         private void Confirm_Click(object sender, EventArgs e)
@@ -137,33 +147,71 @@ namespace UAS_MES.Make
             if (ma_code.Text != "")
             {
                 dt = (DataTable)dh.ExecuteSql("select ma_id,ma_craftcode,ma_statuscode,ma_code,ma_prodcode,pr_spec,pr_detail from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
-                //查询工单号是否存在
                 if (dt.Rows.Count > 0)
                 {
                     ma_id = dt.Rows[0]["ma_id"].ToString();
                     string craftcode = dt.Rows[0]["ma_craftcode"].ToString();
                     BaseUtil.SetFormValue(this.Controls, dt);
-                    //必须是已下放的工单才允许进行岗位备料
-                    if (dt.Rows[0]["ma_statuscode"].ToString() == "STARTED")
-                    {
-                        //判断当前用户的执行工序和岗位资源是否对应
-                        sql.Clear();
-                        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 OperateResult.AppendText(">>当前工单物料无需备料\n", Color.Red);
-                    }
-                    else OperateResult.AppendText(">>必须状态为已下放的工单才允许进行岗位备料\n", Color.Red);
+                    //if (dt.Rows[0]["ma_statuscode"].ToString() == "STARTED")
+                    //{
+                    //    //判断当前用户的执行工序和岗位资源是否对应
+                    //    sql.Clear();
+                    //    sql.Append("select mss_id,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='" + craftcode + "' and sp_stepcode='" + User.CurrentStepCode + "' and pr_tracekind=2");
+                    //    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    //    //查询到有记录的话表示对应
+                    //    if (dt.Rows.Count > 0)
+                    //        FillDataGridView();
+                    //    //查询到没有结果表示不对应
+                    //    else OperateResult.AppendText(">>当前工单[" + ma_code.Text + "]途程[" + ma_craftcode.Text + "]工序[" + User.CurrentStepCode + "]无需要岗位备料数据\n", Color.Red);
+                    //}
+                    //else OperateResult.AppendText(">>必须状态为已下放的工单才允许进行岗位备料\n", Color.Red);
                 }
                 else OperateResult.AppendText(">>工单号不存在\n", Color.Red);
             }
             else OperateResult.AppendText(">>工单号不允许为空\n", Color.Red);
         }
+
+        private void BatchProduct_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (BatchProductDGV.Columns[e.ColumnIndex].Name == "DeleteRow")
+            {
+                string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
+                if (id != "0")
+                {
+                    dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
+                }
+            }
+        }
+
+        private void ma_code_UserControlTextChanged(object sender, EventArgs e)
+        {
+            if (ma_code.Text.Length > 4)
+            {
+                craftcode_condition = "";
+                DataTable dt = (DataTable)dh.ExecuteSql("select ma_craftcode from make where ma_code='" + ma_code.Text + "'", "select");
+                string craftcode = "";
+                if (dt.Rows.Count > 0)
+                {
+                    craftcode = dt.Rows[0]["ma_craftcode"].ToString();
+                }
+                sql.Clear();
+                sql.Append("select distinct ms_craftcode ma_craftcode from makeserial left join craft on cr_code=ms_craftcode ");
+                sql.Append("where ms_makecode='" + ma_code.Text + "'  and ms_craftcode<>'" + craftcode + "'");
+                dt.Merge((DataTable)dh.ExecuteSql(sql.GetString(), "select"));
+                ma_craftcode.DisplayMember = "ma_craftcode";
+                ma_craftcode.ValueMember = "ma_craftcode";
+                ma_craftcode.DataSource = dt;
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    if (dt.Rows.Count - 1 == i)
+                        craftcode_condition += "'" + dt.Rows[i]["ma_craftcode"].ToString() + "'";
+                    else
+                        craftcode_condition += "'" + dt.Rows[i]["ma_craftcode"].ToString() + "',";
+                }
+            }
+        }
     }
 }

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

@@ -380,52 +380,40 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="sp_soncode.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">
+  <metadata name="mss_id.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">
+  <metadata name="mss_prodcode.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">
+  <metadata name="mss_barcode.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">
+  <metadata name="sp_oneuseqty.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">
+  <metadata name="mss_qty.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">
+  <metadata name="mm_qty.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">
+  <metadata name="mss_remain.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">
+  <metadata name="mss_useqty.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">
+  <metadata name="pr_detail1.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">
+  <metadata name="pr_spec.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">
+  <metadata name="DeleteRow.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">