瀏覽代碼

合并冲突

章政 8 年之前
父節點
當前提交
8c8c8e270f

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -257,7 +257,7 @@ namespace UAS_MES.Make
                                         }
                                         else
                                         {
-                                            dh.UpdateByCondition("makesourcestock", "MSS_REMAIN = NVL(MSS_REMAIN, 0) - MSS_BASEQTY,MSS_USEQTY = NVL(MSS_USEQTY, 0) + MSS_BASEQTY,mss_madeqty=NVL(mss_madeqty,0)+ceil(MSS_USEQTY/MSS_BASEQTY)", " mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
+                                            dh.UpdateByCondition("makesourcestock", "MSS_REMAIN = NVL(MSS_REMAIN, 0) - MSS_BASEQTY,MSS_USEQTY = NVL(MSS_USEQTY, 0) + MSS_BASEQTY,mss_madeqty=NVL(mss_madeqty,0)+ceil(MSS_USEQTY/MSS_BASEQTY)", " mss_makecode = '" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
                                         }
                                     }
                                 }

+ 2 - 2
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -168,7 +168,7 @@ namespace UAS_MES.Packing
                                                     sql.Append(",'" + ms_makecode + "','0',sysdate,'" + pa_salecode.Text + "','" + pa_custcode.Text + "','" + pa_type.Text + "','0','" + pa_packtype.Text + "','" + pa_standardqty.Text + "')");
                                                     dh.ExecuteSql(sql.GetString(), "insert");
                                                     //删除原明细
-                                                    dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "'", "delete");
+                                                    dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "' and pd_barcode = '"+sn_code.Text+"'", "delete");
                                                     sql.Clear();
                                                     sql.Append("insert into packagedetail (PD_ID,PD_PAID,PD_OUTBOXCODE,PD_BARCODE,PD_INNERQTY,PD_PRODCODE,PD_MAKECODE,PD_BUILDDATE,PD_YMD)");
                                                     sql.Append("values (packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yyyymmdd'))");
@@ -262,7 +262,7 @@ namespace UAS_MES.Packing
                                         }
 
                                         //删除原明细
-                                        dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "'", "delete");
+                                        dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "' and pd_barcode = '" + sn_code.Text + "'", "delete");
                                         //更新操作
                                         sql.Clear();
                                         sql.Append("insert into packagedetail (PD_ID,PD_PAID,PD_OUTBOXCODE,PD_BARCODE,PD_INNERQTY,PD_PRODCODE,PD_MAKECODE,PD_BUILDDATE,PD_YMD)");

+ 244 - 243
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.Designer.cs

@@ -29,13 +29,9 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Warehouse_FinishedProductOut));
-            this.pi_inoutno = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pi_inoutno_label = new System.Windows.Forms.Label();
             this.pi_titile_label = new System.Windows.Forms.Label();
-            this.pi_titile = new System.Windows.Forms.Label();
-            this.ProdDetail = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.NewProdInOut = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ConfirmOut = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.pi_title = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
             this.boxqty = new System.Windows.Forms.Label();
             this.label10 = new System.Windows.Forms.Label();
@@ -45,51 +41,36 @@
             this.outqty = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
+            this.palletBtn = new System.Windows.Forms.RadioButton();
+            this.serBtn = new System.Windows.Forms.RadioButton();
+            this.bigboxBtn = new System.Windows.Forms.RadioButton();
+            this.input = new System.Windows.Forms.TextBox();
+            this.pi_id = new System.Windows.Forms.Label();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.customCheckBox2 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.cancel = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.InOutDetailDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
             this.pim_outboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pim_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pim_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.radioButton1 = new System.Windows.Forms.RadioButton();
-            this.radioButton2 = new System.Windows.Forms.RadioButton();
-            this.radioButton3 = new System.Windows.Forms.RadioButton();
-            this.textBox1 = new System.Windows.Forms.TextBox();
-            this.customCheckBox1 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.customCheckBox2 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.pi_id = new System.Windows.Forms.Label();
+            this.ConfirmOut = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.NewProdInOut = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ProdDetail = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.pi_inoutno = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.InOutDetailDGV)).BeginInit();
             this.SuspendLayout();
             // 
-            // pi_inoutno
-            // 
-            this.pi_inoutno.AllPower = null;
-            this.pi_inoutno.Caller = null;
-            this.pi_inoutno.Condition = null;
-            this.pi_inoutno.DBTitle = null;
-            this.pi_inoutno.FormName = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(103, 26);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Power = null;
-            this.pi_inoutno.ReturnData = null;
-            this.pi_inoutno.SelectField = null;
-            this.pi_inoutno.SetValueField = null;
-            this.pi_inoutno.Size = new System.Drawing.Size(204, 25);
-            this.pi_inoutno.TabIndex = 0;
-            this.pi_inoutno.TableName = null;
-            this.pi_inoutno.TextBoxEnable = false;
-            // 
             // pi_inoutno_label
             // 
             this.pi_inoutno_label.AutoSize = true;
             this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(7, 25);
-            this.pi_inoutno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pi_inoutno_label.Location = new System.Drawing.Point(5, 20);
             this.pi_inoutno_label.Name = "pi_inoutno_label";
-            this.pi_inoutno_label.Size = new System.Drawing.Size(92, 27);
+            this.pi_inoutno_label.Size = new System.Drawing.Size(74, 21);
             this.pi_inoutno_label.TabIndex = 211;
             this.pi_inoutno_label.Text = "出货单号";
             // 
@@ -97,79 +78,20 @@
             // 
             this.pi_titile_label.AutoSize = true;
             this.pi_titile_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_titile_label.Location = new System.Drawing.Point(336, 25);
-            this.pi_titile_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pi_titile_label.Location = new System.Drawing.Point(252, 20);
             this.pi_titile_label.Name = "pi_titile_label";
-            this.pi_titile_label.Size = new System.Drawing.Size(92, 27);
+            this.pi_titile_label.Size = new System.Drawing.Size(74, 21);
             this.pi_titile_label.TabIndex = 212;
             this.pi_titile_label.Text = "客户名称";
             // 
-            // pi_titile
+            // pi_title
             // 
-            this.pi_titile.AutoSize = true;
-            this.pi_titile.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_titile.Location = new System.Drawing.Point(435, 25);
-            this.pi_titile.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pi_titile.Name = "pi_titile";
-            this.pi_titile.Size = new System.Drawing.Size(0, 27);
-            this.pi_titile.TabIndex = 213;
-            // 
-            // ProdDetail
-            // 
-            this.ProdDetail.AllPower = null;
-            this.ProdDetail.BackColor = System.Drawing.Color.Transparent;
-            this.ProdDetail.DownImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.DownImage")));
-            this.ProdDetail.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ProdDetail.Image = null;
-            this.ProdDetail.IsShowBorder = true;
-            this.ProdDetail.Location = new System.Drawing.Point(637, 20);
-            this.ProdDetail.MoveImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.MoveImage")));
-            this.ProdDetail.Name = "ProdDetail";
-            this.ProdDetail.NormalImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.NormalImage")));
-            this.ProdDetail.Power = null;
-            this.ProdDetail.Size = new System.Drawing.Size(100, 39);
-            this.ProdDetail.TabIndex = 214;
-            this.ProdDetail.Text = "产品明细";
-            this.ProdDetail.UseVisualStyleBackColor = false;
-            this.ProdDetail.Click += new System.EventHandler(this.ProdDetail_Click);
-            // 
-            // NewProdInOut
-            // 
-            this.NewProdInOut.AllPower = null;
-            this.NewProdInOut.BackColor = System.Drawing.Color.Transparent;
-            this.NewProdInOut.DownImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.DownImage")));
-            this.NewProdInOut.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.NewProdInOut.Image = null;
-            this.NewProdInOut.IsShowBorder = true;
-            this.NewProdInOut.Location = new System.Drawing.Point(864, 20);
-            this.NewProdInOut.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.MoveImage")));
-            this.NewProdInOut.Name = "NewProdInOut";
-            this.NewProdInOut.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.NormalImage")));
-            this.NewProdInOut.Power = null;
-            this.NewProdInOut.Size = new System.Drawing.Size(104, 39);
-            this.NewProdInOut.TabIndex = 215;
-            this.NewProdInOut.Text = "新增出货单";
-            this.NewProdInOut.UseVisualStyleBackColor = false;
-            this.NewProdInOut.Click += new System.EventHandler(this.NewProdInOut_Click);
-            // 
-            // ConfirmOut
-            // 
-            this.ConfirmOut.AllPower = null;
-            this.ConfirmOut.BackColor = System.Drawing.Color.Transparent;
-            this.ConfirmOut.DownImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.DownImage")));
-            this.ConfirmOut.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ConfirmOut.Image = null;
-            this.ConfirmOut.IsShowBorder = true;
-            this.ConfirmOut.Location = new System.Drawing.Point(751, 21);
-            this.ConfirmOut.MoveImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.MoveImage")));
-            this.ConfirmOut.Name = "ConfirmOut";
-            this.ConfirmOut.NormalImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.NormalImage")));
-            this.ConfirmOut.Power = null;
-            this.ConfirmOut.Size = new System.Drawing.Size(100, 38);
-            this.ConfirmOut.TabIndex = 216;
-            this.ConfirmOut.Text = "确认出货";
-            this.ConfirmOut.UseVisualStyleBackColor = false;
-            this.ConfirmOut.Click += new System.EventHandler(this.ConfirmOut_Click);
+            this.pi_title.AutoSize = true;
+            this.pi_title.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_title.Location = new System.Drawing.Point(326, 20);
+            this.pi_title.Name = "pi_title";
+            this.pi_title.Size = new System.Drawing.Size(0, 21);
+            this.pi_title.TabIndex = 213;
             // 
             // panel1
             // 
@@ -182,29 +104,28 @@
             this.panel1.Controls.Add(this.outqty);
             this.panel1.Controls.Add(this.label6);
             this.panel1.Controls.Add(this.label4);
-            this.panel1.Location = new System.Drawing.Point(751, 82);
+            this.panel1.Location = new System.Drawing.Point(563, 66);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(225, 243);
+            this.panel1.Size = new System.Drawing.Size(169, 195);
             this.panel1.TabIndex = 217;
             // 
             // boxqty
             // 
             this.boxqty.AutoSize = true;
             this.boxqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.boxqty.Location = new System.Drawing.Point(111, 187);
-            this.boxqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.boxqty.Location = new System.Drawing.Point(83, 150);
             this.boxqty.Name = "boxqty";
-            this.boxqty.Size = new System.Drawing.Size(0, 27);
+            this.boxqty.Size = new System.Drawing.Size(0, 21);
             this.boxqty.TabIndex = 223;
             // 
             // label10
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(12, 187);
-            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label10.Location = new System.Drawing.Point(9, 150);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(72, 27);
+            this.label10.Size = new System.Drawing.Size(58, 21);
             this.label10.TabIndex = 222;
             this.label10.Text = "总箱数";
             // 
@@ -212,20 +133,18 @@
             // 
             this.getqty.AutoSize = true;
             this.getqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.getqty.Location = new System.Drawing.Point(111, 133);
-            this.getqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.getqty.Location = new System.Drawing.Point(83, 106);
             this.getqty.Name = "getqty";
-            this.getqty.Size = new System.Drawing.Size(0, 27);
+            this.getqty.Size = new System.Drawing.Size(0, 21);
             this.getqty.TabIndex = 221;
             // 
             // label8
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label8.Location = new System.Drawing.Point(12, 133);
-            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Location = new System.Drawing.Point(9, 106);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(92, 27);
+            this.label8.Size = new System.Drawing.Size(74, 21);
             this.label8.TabIndex = 220;
             this.label8.Text = "已采集数";
             // 
@@ -233,30 +152,27 @@
             // 
             this.ungetqty.AutoSize = true;
             this.ungetqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ungetqty.Location = new System.Drawing.Point(111, 75);
-            this.ungetqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ungetqty.Location = new System.Drawing.Point(83, 60);
             this.ungetqty.Name = "ungetqty";
-            this.ungetqty.Size = new System.Drawing.Size(0, 27);
+            this.ungetqty.Size = new System.Drawing.Size(0, 21);
             this.ungetqty.TabIndex = 219;
             // 
             // outqty
             // 
             this.outqty.AutoSize = true;
             this.outqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.outqty.Location = new System.Drawing.Point(111, 21);
-            this.outqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.outqty.Location = new System.Drawing.Point(83, 17);
             this.outqty.Name = "outqty";
-            this.outqty.Size = new System.Drawing.Size(0, 27);
+            this.outqty.Size = new System.Drawing.Size(0, 21);
             this.outqty.TabIndex = 219;
             // 
             // label6
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(12, 75);
-            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Location = new System.Drawing.Point(9, 60);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(92, 27);
+            this.label6.Size = new System.Drawing.Size(74, 21);
             this.label6.TabIndex = 218;
             this.label6.Text = "待采集数";
             // 
@@ -264,13 +180,123 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(12, 21);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(9, 17);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 218;
             this.label4.Text = "出货数量";
             // 
+            // palletBtn
+            // 
+            this.palletBtn.AutoSize = true;
+            this.palletBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.palletBtn.Location = new System.Drawing.Point(14, 427);
+            this.palletBtn.Margin = new System.Windows.Forms.Padding(2);
+            this.palletBtn.Name = "palletBtn";
+            this.palletBtn.Size = new System.Drawing.Size(76, 25);
+            this.palletBtn.TabIndex = 219;
+            this.palletBtn.TabStop = true;
+            this.palletBtn.Text = "栈板号";
+            this.palletBtn.UseVisualStyleBackColor = true;
+            // 
+            // serBtn
+            // 
+            this.serBtn.AutoSize = true;
+            this.serBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.serBtn.Location = new System.Drawing.Point(183, 427);
+            this.serBtn.Margin = new System.Windows.Forms.Padding(2);
+            this.serBtn.Name = "serBtn";
+            this.serBtn.Size = new System.Drawing.Size(108, 25);
+            this.serBtn.TabIndex = 220;
+            this.serBtn.TabStop = true;
+            this.serBtn.Text = "单台序列号";
+            this.serBtn.UseVisualStyleBackColor = true;
+            // 
+            // bigboxBtn
+            // 
+            this.bigboxBtn.AutoSize = true;
+            this.bigboxBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bigboxBtn.Location = new System.Drawing.Point(97, 427);
+            this.bigboxBtn.Margin = new System.Windows.Forms.Padding(2);
+            this.bigboxBtn.Name = "bigboxBtn";
+            this.bigboxBtn.Size = new System.Drawing.Size(76, 25);
+            this.bigboxBtn.TabIndex = 221;
+            this.bigboxBtn.TabStop = true;
+            this.bigboxBtn.Text = "大箱号";
+            this.bigboxBtn.UseVisualStyleBackColor = true;
+            // 
+            // input
+            // 
+            this.input.Location = new System.Drawing.Point(9, 475);
+            this.input.Margin = new System.Windows.Forms.Padding(2);
+            this.input.Name = "input";
+            this.input.Size = new System.Drawing.Size(125, 21);
+            this.input.TabIndex = 222;
+            this.input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.input_KeyDown);
+            // 
+            // pi_id
+            // 
+            this.pi_id.AutoSize = true;
+            this.pi_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_id.Location = new System.Drawing.Point(460, 21);
+            this.pi_id.Name = "pi_id";
+            this.pi_id.Size = new System.Drawing.Size(0, 21);
+            this.pi_id.TabIndex = 229;
+            // 
+            // 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(563, 266);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(170, 245);
+            this.OperateResult.TabIndex = 228;
+            this.OperateResult.Text = "";
+            // 
+            // customCheckBox2
+            // 
+            this.customCheckBox2.AutoSize = true;
+            this.customCheckBox2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.customCheckBox2.Location = new System.Drawing.Point(453, 427);
+            this.customCheckBox2.Margin = new System.Windows.Forms.Padding(2);
+            this.customCheckBox2.Name = "customCheckBox2";
+            this.customCheckBox2.Power = null;
+            this.customCheckBox2.Size = new System.Drawing.Size(109, 25);
+            this.customCheckBox2.TabIndex = 225;
+            this.customCheckBox2.Text = "按订单出货";
+            this.customCheckBox2.UseVisualStyleBackColor = true;
+            // 
+            // Clean
+            // 
+            this.Clean.AllPower = null;
+            this.Clean.BackColor = System.Drawing.Color.Transparent;
+            this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
+            this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Clean.Image = null;
+            this.Clean.IsShowBorder = true;
+            this.Clean.Location = new System.Drawing.Point(478, 464);
+            this.Clean.Margin = new System.Windows.Forms.Padding(2);
+            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(75, 31);
+            this.Clean.TabIndex = 224;
+            this.Clean.Text = "清除明细";
+            this.Clean.UseVisualStyleBackColor = false;
+            // 
+            // cancel
+            // 
+            this.cancel.AutoSize = true;
+            this.cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cancel.Location = new System.Drawing.Point(150, 475);
+            this.cancel.Margin = new System.Windows.Forms.Padding(2);
+            this.cancel.Name = "cancel";
+            this.cancel.Power = null;
+            this.cancel.Size = new System.Drawing.Size(61, 25);
+            this.cancel.TabIndex = 223;
+            this.cancel.Text = "取消";
+            this.cancel.UseVisualStyleBackColor = true;
+            // 
             // InOutDetailDGV
             // 
             this.InOutDetailDGV.AllowUserToAddRows = false;
@@ -281,10 +307,11 @@
             this.pim_prodcode,
             this.pr_detail,
             this.pr_spec});
-            this.InOutDetailDGV.Location = new System.Drawing.Point(12, 82);
+            this.InOutDetailDGV.Location = new System.Drawing.Point(9, 66);
+            this.InOutDetailDGV.Margin = new System.Windows.Forms.Padding(2);
             this.InOutDetailDGV.Name = "InOutDetailDGV";
             this.InOutDetailDGV.RowTemplate.Height = 27;
-            this.InOutDetailDGV.Size = new System.Drawing.Size(725, 446);
+            this.InOutDetailDGV.Size = new System.Drawing.Size(544, 357);
             this.InOutDetailDGV.TabIndex = 218;
             // 
             // pim_outboxcode
@@ -314,136 +341,110 @@
             this.pr_spec.HeaderText = "规格";
             this.pr_spec.Name = "pr_spec";
             // 
-            // radioButton1
-            // 
-            this.radioButton1.AutoSize = true;
-            this.radioButton1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.radioButton1.Location = new System.Drawing.Point(18, 534);
-            this.radioButton1.Name = "radioButton1";
-            this.radioButton1.Size = new System.Drawing.Size(93, 31);
-            this.radioButton1.TabIndex = 219;
-            this.radioButton1.TabStop = true;
-            this.radioButton1.Text = "栈板号";
-            this.radioButton1.UseVisualStyleBackColor = true;
-            // 
-            // radioButton2
-            // 
-            this.radioButton2.AutoSize = true;
-            this.radioButton2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.radioButton2.Location = new System.Drawing.Point(244, 534);
-            this.radioButton2.Name = "radioButton2";
-            this.radioButton2.Size = new System.Drawing.Size(133, 31);
-            this.radioButton2.TabIndex = 220;
-            this.radioButton2.TabStop = true;
-            this.radioButton2.Text = "单台序列号";
-            this.radioButton2.UseVisualStyleBackColor = true;
-            // 
-            // radioButton3
-            // 
-            this.radioButton3.AutoSize = true;
-            this.radioButton3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.radioButton3.Location = new System.Drawing.Point(129, 534);
-            this.radioButton3.Name = "radioButton3";
-            this.radioButton3.Size = new System.Drawing.Size(93, 31);
-            this.radioButton3.TabIndex = 221;
-            this.radioButton3.TabStop = true;
-            this.radioButton3.Text = "大箱号";
-            this.radioButton3.UseVisualStyleBackColor = true;
-            // 
-            // textBox1
-            // 
-            this.textBox1.Location = new System.Drawing.Point(12, 594);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(165, 25);
-            this.textBox1.TabIndex = 222;
-            // 
-            // customCheckBox1
-            // 
-            this.customCheckBox1.AutoSize = true;
-            this.customCheckBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.customCheckBox1.Location = new System.Drawing.Point(201, 588);
-            this.customCheckBox1.Name = "customCheckBox1";
-            this.customCheckBox1.Power = null;
-            this.customCheckBox1.Size = new System.Drawing.Size(74, 31);
-            this.customCheckBox1.TabIndex = 223;
-            this.customCheckBox1.Text = "取消";
-            this.customCheckBox1.UseVisualStyleBackColor = true;
-            // 
-            // Clean
+            // ConfirmOut
             // 
-            this.Clean.AllPower = null;
-            this.Clean.BackColor = System.Drawing.Color.Transparent;
-            this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
-            this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.Clean.Image = null;
-            this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(637, 580);
-            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(100, 39);
-            this.Clean.TabIndex = 224;
-            this.Clean.Text = "清除明细";
-            this.Clean.UseVisualStyleBackColor = false;
+            this.ConfirmOut.AllPower = null;
+            this.ConfirmOut.BackColor = System.Drawing.Color.Transparent;
+            this.ConfirmOut.DownImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.DownImage")));
+            this.ConfirmOut.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ConfirmOut.Image = null;
+            this.ConfirmOut.IsShowBorder = true;
+            this.ConfirmOut.Location = new System.Drawing.Point(563, 17);
+            this.ConfirmOut.Margin = new System.Windows.Forms.Padding(2);
+            this.ConfirmOut.MoveImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.MoveImage")));
+            this.ConfirmOut.Name = "ConfirmOut";
+            this.ConfirmOut.NormalImage = ((System.Drawing.Image)(resources.GetObject("ConfirmOut.NormalImage")));
+            this.ConfirmOut.Power = null;
+            this.ConfirmOut.Size = new System.Drawing.Size(75, 30);
+            this.ConfirmOut.TabIndex = 216;
+            this.ConfirmOut.Text = "确认出货";
+            this.ConfirmOut.UseVisualStyleBackColor = false;
+            this.ConfirmOut.Click += new System.EventHandler(this.ConfirmOut_Click);
             // 
-            // customCheckBox2
+            // NewProdInOut
             // 
-            this.customCheckBox2.AutoSize = true;
-            this.customCheckBox2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.customCheckBox2.Location = new System.Drawing.Point(604, 534);
-            this.customCheckBox2.Name = "customCheckBox2";
-            this.customCheckBox2.Power = null;
-            this.customCheckBox2.Size = new System.Drawing.Size(134, 31);
-            this.customCheckBox2.TabIndex = 225;
-            this.customCheckBox2.Text = "按订单出货";
-            this.customCheckBox2.UseVisualStyleBackColor = true;
+            this.NewProdInOut.AllPower = null;
+            this.NewProdInOut.BackColor = System.Drawing.Color.Transparent;
+            this.NewProdInOut.DownImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.DownImage")));
+            this.NewProdInOut.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.NewProdInOut.Image = null;
+            this.NewProdInOut.IsShowBorder = true;
+            this.NewProdInOut.Location = new System.Drawing.Point(648, 16);
+            this.NewProdInOut.Margin = new System.Windows.Forms.Padding(2);
+            this.NewProdInOut.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.MoveImage")));
+            this.NewProdInOut.Name = "NewProdInOut";
+            this.NewProdInOut.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewProdInOut.NormalImage")));
+            this.NewProdInOut.Power = null;
+            this.NewProdInOut.Size = new System.Drawing.Size(78, 31);
+            this.NewProdInOut.TabIndex = 215;
+            this.NewProdInOut.Text = "新增出货单";
+            this.NewProdInOut.UseVisualStyleBackColor = false;
+            this.NewProdInOut.Click += new System.EventHandler(this.NewProdInOut_Click);
             // 
-            // OperateResult
+            // ProdDetail
             // 
-            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(751, 332);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
-            this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(225, 305);
-            this.OperateResult.TabIndex = 228;
-            this.OperateResult.Text = "";
+            this.ProdDetail.AllPower = null;
+            this.ProdDetail.BackColor = System.Drawing.Color.Transparent;
+            this.ProdDetail.DownImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.DownImage")));
+            this.ProdDetail.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ProdDetail.Image = null;
+            this.ProdDetail.IsShowBorder = true;
+            this.ProdDetail.Location = new System.Drawing.Point(478, 16);
+            this.ProdDetail.Margin = new System.Windows.Forms.Padding(2);
+            this.ProdDetail.MoveImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.MoveImage")));
+            this.ProdDetail.Name = "ProdDetail";
+            this.ProdDetail.NormalImage = ((System.Drawing.Image)(resources.GetObject("ProdDetail.NormalImage")));
+            this.ProdDetail.Power = null;
+            this.ProdDetail.Size = new System.Drawing.Size(75, 31);
+            this.ProdDetail.TabIndex = 214;
+            this.ProdDetail.Text = "产品明细";
+            this.ProdDetail.UseVisualStyleBackColor = false;
+            this.ProdDetail.Click += new System.EventHandler(this.ProdDetail_Click);
             // 
-            // pi_id
+            // pi_inoutno
             // 
-            this.pi_id.AutoSize = true;
-            this.pi_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_id.Location = new System.Drawing.Point(613, 26);
-            this.pi_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pi_id.Name = "pi_id";
-            this.pi_id.Size = new System.Drawing.Size(0, 27);
-            this.pi_id.TabIndex = 229;
-            this.pi_id.Visible = false;
+            this.pi_inoutno.AllPower = null;
+            this.pi_inoutno.Caller = null;
+            this.pi_inoutno.Condition = null;
+            this.pi_inoutno.DBTitle = null;
+            this.pi_inoutno.FormName = null;
+            this.pi_inoutno.Location = new System.Drawing.Point(77, 21);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(2);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.Power = null;
+            this.pi_inoutno.ReturnData = null;
+            this.pi_inoutno.SelectField = null;
+            this.pi_inoutno.SetValueField = null;
+            this.pi_inoutno.Size = new System.Drawing.Size(153, 20);
+            this.pi_inoutno.TabIndex = 0;
+            this.pi_inoutno.TableName = null;
+            this.pi_inoutno.TextBoxEnable = false;
             // 
             // Warehouse_FinishedProductOut
             // 
-            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(986, 647);
+            this.ClientSize = new System.Drawing.Size(740, 518);
             this.Controls.Add(this.pi_id);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.customCheckBox2);
             this.Controls.Add(this.Clean);
-            this.Controls.Add(this.customCheckBox1);
-            this.Controls.Add(this.textBox1);
-            this.Controls.Add(this.radioButton3);
-            this.Controls.Add(this.radioButton2);
-            this.Controls.Add(this.radioButton1);
+            this.Controls.Add(this.cancel);
+            this.Controls.Add(this.input);
+            this.Controls.Add(this.bigboxBtn);
+            this.Controls.Add(this.serBtn);
+            this.Controls.Add(this.palletBtn);
             this.Controls.Add(this.InOutDetailDGV);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.ConfirmOut);
             this.Controls.Add(this.NewProdInOut);
             this.Controls.Add(this.ProdDetail);
-            this.Controls.Add(this.pi_titile);
+            this.Controls.Add(this.pi_title);
             this.Controls.Add(this.pi_titile_label);
             this.Controls.Add(this.pi_inoutno_label);
             this.Controls.Add(this.pi_inoutno);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Warehouse_FinishedProductOut";
             this.Tag = "Warehouse!FinishedProductIn";
             this.Text = "成品出货";
@@ -462,7 +463,7 @@
         private CustomControl.TextBoxWithIcon.SearchTextBox pi_inoutno;
         private System.Windows.Forms.Label pi_inoutno_label;
         private System.Windows.Forms.Label pi_titile_label;
-        private System.Windows.Forms.Label pi_titile;
+        private System.Windows.Forms.Label pi_title;
         private CustomControl.ButtonUtil.NormalButton ProdDetail;
         private CustomControl.ButtonUtil.NormalButton NewProdInOut;
         private CustomControl.ButtonUtil.NormalButton ConfirmOut;
@@ -476,11 +477,11 @@
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Label label4;
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum InOutDetailDGV;
-        private System.Windows.Forms.RadioButton radioButton1;
-        private System.Windows.Forms.RadioButton radioButton2;
-        private System.Windows.Forms.RadioButton radioButton3;
-        private System.Windows.Forms.TextBox textBox1;
-        private CustomControl.CustomCheckBox.CustomCheckBox customCheckBox1;
+        private System.Windows.Forms.RadioButton palletBtn;
+        private System.Windows.Forms.RadioButton serBtn;
+        private System.Windows.Forms.RadioButton bigboxBtn;
+        private System.Windows.Forms.TextBox input;
+        private CustomControl.CustomCheckBox.CustomCheckBox cancel;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.CustomCheckBox.CustomCheckBox customCheckBox2;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;

+ 178 - 7
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
+using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Warehouse
@@ -24,6 +25,10 @@ namespace UAS_MES.Warehouse
 
         DataHelper dh;
 
+        DataTable dta;
+
+        Warehouse_NewPiInOut newpi;
+
         public Warehouse_FinishedProductOut()
         {
             InitializeComponent();
@@ -58,17 +63,22 @@ namespace UAS_MES.Warehouse
         private void LoadFormData()
         {
             sql.Clear();
-            sql.Append("select outqty,getqty,boxqty,outqty-getqty ungetqty from (select sum(pd_outqty) ");
-            sql.Append("outqty,nvl((select count(1)cn from prodiomac where pim_inoutno=pd_inoutno),0) ");
-            sql.Append("getqty,nvl(select sum(CASE WHEN pim_type='BOX' then 1 else nvl((select ");
-            sql.Append("pa_packageqty from package where pa_outboxcode=pim_outboxcode),0)end) from prodiomac");
-            sql.Append("where pim_inoutno='233233' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type ");
-            sql.Append("in('BOX','PALLET')),0) boxqty from prodiodetail where pd_piid='" + pi_id.Text + "')");
+            sql.Append("select pi_id,pi_title,pi_inoutno,pi_type from prodinout where pi_inoutno = '" + pi_inoutno.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
                 BaseUtil.SetFormValue(this.Controls, dt);
             }
+            sql.Clear();
+            sql.Append("select nvl((select sum(pd_outqty)  from prodiodetail where pd_piid=''),0)outqty,nvl((select count(1)cn from prodiomac where pim_inoutno=pd_inoutno),0) getqty , ");
+            sql.Append("nvl((select sum(CASE WHEN pim_type='BOX' then 1 else nvl((select pa_packageqty from package where pa_outboxcode=pim_outboxcode),0)end) from prodiomac ");
+            sql.Append("where pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type in('BOX','PALLET')),0) boxqty from  prodiodetail where pd_piid='" + pi_id.Text + "' ");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(this.Controls, dt);
+                ungetqty.Text = (int.Parse(dt.Rows[0]["outqty"].ToString()) - int.Parse(dt.Rows[0]["getqty"].ToString())).ToString();
+            }
         }
 
         /// <summary>
@@ -90,11 +100,20 @@ namespace UAS_MES.Warehouse
 
         private void NewProdInOut_Click(object sender, EventArgs e)
         {
-            Warehouse_NewPiInOut newpi = new Warehouse_NewPiInOut();
+            newpi = new Warehouse_NewPiInOut();
+            newpi.Controls["Confirm"].Click += newpi_clck;
             BaseUtil.SetFormCenter(newpi);
             newpi.ShowDialog();
         }
 
+        private void newpi_clck(object sender, EventArgs e)
+        {
+            pi_inoutno.Text = newpi.pi_inoutno_text;
+            LoadFormData();
+            LoadGridData();
+            newpi.Close();
+        }
+
         private void ProdDetail_Click(object sender, EventArgs e)
         {
             Warehouse_ProdDetail newpd = new Warehouse_ProdDetail();
@@ -106,5 +125,157 @@ namespace UAS_MES.Warehouse
         {
 
         }
+
+        private void input_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (input.Text == "")
+                {
+                    OperateResult.AppendText("录入信息不能为空\n", Color.Red, input);
+                    return;
+                }
+                sql.Clear();
+                sql.Append("select nvl(pi_pdastatus,'未备货')pi_pdastatus,pi_type from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
+                dta = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dta.Rows.Count > 0)
+                {
+                    if (!cancel.Checked)
+                    {
+                        if (palletBtn.Checked)
+                        {
+                            sql.Clear();
+                            sql.Append("select pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                if (!checkinput(dt, "栈板号"))
+                                    return;
+                            }
+                            else
+                            {
+                                OperateResult.AppendText("栈板号" + input.Text + "不存在,请重新输入\n", Color.Red, input);
+                                return;
+                            }
+                            checkinsertprodiomac("栈板号");
+                        }
+                        else if (bigboxBtn.Checked)
+                        {
+                            sql.Clear();
+                            sql.Append("select pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno, pa_mothercode from package where pa_outboxcode='" + input.Text + "' and pa_type=(1,2)");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                if (dt.Rows[0]["pa_mothercode"].ToString() != "")
+                                {
+                                    OperateResult.AppendText("箱号" + input.Text + "已经装大箱或者栈板,不允许单独出货\n", Color.Red, input);
+                                    return;
+                                }
+                                if (!checkinput(dt, "箱号"))
+                                    return;
+                            }
+                            else
+                            {
+                                OperateResult.AppendText("箱号" + input.Text + "不存在,请重新输入\n", Color.Red, input);
+                                return;
+                            }
+                            checkinsertprodiomac("箱号");
+                            //更新箱号对应的出货单号
+                            dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
+                        }
+                        else if (serBtn.Checked) {
+                            if (dh.getFieldDataByCondition("makeserial", "max(ms_id)ms_id", "ms_sncode='" + input.Text + "'").ToString() == "")
+                            {
+                                OperateResult.AppendText("序列号" + input.Text + "不存在,请重新输入\n", Color.Red, input);
+                                return;
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText("出货单" + pi_inoutno.Text + "不存在\n", Color.Red, pi_inoutno);
+                    return;
+                }
+            }
+        }
+
+        //插入prodiomac表
+        private void insertprodiomac(string type)
+        {
+            string pib_type = "";
+            if (type == "栈板号")
+            {
+                pib_type = "PALLET";
+            }
+            else if(type == "箱号")
+            {
+                pib_type = "BOX";
+            }
+            sql.Clear();
+            sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pib_type,pim_outboxcode)");
+            sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',v_prodcode,v_barcode,sysdate,'" + User.UserCode + "','"+ pib_type + "','" + input.Text + "' from mes_package_view where v_outboxcode='" + input.Text + "'");
+            dh.ExecuteSql(sql.GetString(), "insert");
+        }
+
+
+        private void checkinsertprodiomac(string type)
+        {
+            sql.Clear();
+            sql.Append("select wm_concat(v_barcode)data,count(1)cn from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode where v_outboxcode='" + input.Text + "' and nvl(ms_status,0)<>2 and rownum<20");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows[0]["data"].ToString() != "" && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
+            {
+                OperateResult.AppendText(type + input.Text + "内序列号未完工,序列号:" + dt.Rows[0]["data"].ToString() + "\n", Color.Red, input);
+                return;
+            }
+            if (dta.Rows[0]["pi_type"].ToString() == "订单出库")
+            {
+                sql.Clear();
+                sql.Append("select ms_prodcode,ms_salecode,cn  from (select ms_prodcode,ms_salecode,count(1)cn from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode  where v_outboxcode='" + input.Text + "' ");
+                sql.Append(" group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
+                sql.Append("  from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid='" + pi_inoutno.Text + "' group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode and ms_salecode=pd_ordercode where nvl(pd_prodcode,' ')<>' ' or nvl(pd_ordercode,' ')<>' ' or cn>nvl(ungetqty,0)");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
+                {
+                    OperateResult.AppendText(type + input.Text + "内的序列号中的物料+订单不在出货单中或者栈板内中序列号的数量大于剩余出货数,栈板内物料号:" + dt.Rows[0]["ms_prodcode"].ToString() + ",订单号:" + dt.Rows[0]["ms_salecode"].ToString() + ",数量:" + dt.Rows[0]["cn"].ToString() + "\n", Color.Red, input);
+                    return;
+                }
+                else
+                {
+                    //插入prodiomac表
+                    insertprodiomac(type);
+                }
+            }
+            else if (dta.Rows[0]["pi_type"].ToString() == "自由出货")
+            {
+                insertprodiomac(type);
+            }
+        }
+
+        private Boolean checkinput(DataTable dt, string type)
+        {
+            if (dt.Rows[0]["pa_outno"].ToString() != "")
+            {
+                OperateResult.AppendText(type + input.Text + "已经被出货单:" + dt.Rows[0]["pa_outno"].ToString() + "采集,请重新输入\n", Color.Red, input);
+                return false;
+            }
+            if (dt.Rows[0]["pa_status"].ToString() == "0")
+            {
+                OperateResult.AppendText(type + input.Text + "未封装,请重新输入\n", Color.Red, input);
+                return false;
+            }
+            else if (dt.Rows[0]["pa_status"].ToString() == "2")
+            {
+                OperateResult.AppendText(type + input.Text + "已出库,请重新输入\n", Color.Red, input);
+                return false;
+            }
+            if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
+            {
+                OperateResult.AppendText(type + input.Text + "处于下地状态,若需出货,请先取消下地\n", Color.Red, input);
+                return false;
+            }
+            return true;
+        }
     }
 }

+ 27 - 27
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.resx

@@ -118,7 +118,7 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="ProdDetail.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
@@ -130,7 +130,7 @@
         oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="ProdDetail.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Clean.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
@@ -143,7 +143,7 @@
         gg==
 </value>
   </data>
-  <data name="ProdDetail.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Clean.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
@@ -156,7 +156,22 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="NewProdInOut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <metadata name="pim_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pim_mac.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pim_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="ConfirmOut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
@@ -168,7 +183,7 @@
         oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="NewProdInOut.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ConfirmOut.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
@@ -181,7 +196,7 @@
         gg==
 </value>
   </data>
-  <data name="NewProdInOut.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ConfirmOut.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
@@ -194,7 +209,7 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="ConfirmOut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="NewProdInOut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
@@ -206,7 +221,7 @@
         oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="ConfirmOut.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="NewProdInOut.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
@@ -219,7 +234,7 @@
         gg==
 </value>
   </data>
-  <data name="ConfirmOut.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="NewProdInOut.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
@@ -232,22 +247,7 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <metadata name="pim_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pim_mac.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pim_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ProdDetail.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
@@ -259,7 +259,7 @@
         oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="Clean.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ProdDetail.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
@@ -272,7 +272,7 @@
         gg==
 </value>
   </data>
-  <data name="Clean.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ProdDetail.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE

+ 53 - 29
UAS-MES/FunctionCode/Warehouse/Warehouse_NewPiInOut.Designer.cs

@@ -36,8 +36,9 @@
             this.pi_inoutno_label = new System.Windows.Forms.Label();
             this.pi_inoutno = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
-            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.note = new System.Windows.Forms.TextBox();
             this.cu_name = new System.Windows.Forms.TextBox();
+            this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SuspendLayout();
             // 
             // headBar1
@@ -45,9 +46,8 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(405, 40);
+            this.headBar1.Size = new System.Drawing.Size(304, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
             // 
@@ -58,12 +58,13 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = null;
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(166, 214);
+            this.Confirm.Location = new System.Drawing.Point(124, 171);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(2);
             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(75, 28);
+            this.Confirm.Size = new System.Drawing.Size(56, 22);
             this.Confirm.TabIndex = 1;
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = false;
@@ -76,13 +77,14 @@
             this.cu_code.Condition = null;
             this.cu_code.DBTitle = null;
             this.cu_code.FormName = null;
-            this.cu_code.Location = new System.Drawing.Point(111, 110);
+            this.cu_code.Location = new System.Drawing.Point(83, 88);
+            this.cu_code.Margin = new System.Windows.Forms.Padding(2);
             this.cu_code.Name = "cu_code";
             this.cu_code.Power = null;
             this.cu_code.ReturnData = null;
             this.cu_code.SelectField = null;
             this.cu_code.SetValueField = null;
-            this.cu_code.Size = new System.Drawing.Size(130, 25);
+            this.cu_code.Size = new System.Drawing.Size(98, 20);
             this.cu_code.TabIndex = 2;
             this.cu_code.TableName = null;
             this.cu_code.TextBoxEnable = false;
@@ -91,10 +93,9 @@
             // 
             this.pi_titile_label.AutoSize = true;
             this.pi_titile_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_titile_label.Location = new System.Drawing.Point(13, 110);
-            this.pi_titile_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pi_titile_label.Location = new System.Drawing.Point(10, 88);
             this.pi_titile_label.Name = "pi_titile_label";
-            this.pi_titile_label.Size = new System.Drawing.Size(92, 27);
+            this.pi_titile_label.Size = new System.Drawing.Size(74, 21);
             this.pi_titile_label.TabIndex = 213;
             this.pi_titile_label.Text = "客户编号";
             // 
@@ -102,52 +103,73 @@
             // 
             this.pi_inoutno_label.AutoSize = true;
             this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(13, 61);
-            this.pi_inoutno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pi_inoutno_label.Location = new System.Drawing.Point(10, 49);
             this.pi_inoutno_label.Name = "pi_inoutno_label";
-            this.pi_inoutno_label.Size = new System.Drawing.Size(92, 27);
+            this.pi_inoutno_label.Size = new System.Drawing.Size(74, 21);
             this.pi_inoutno_label.TabIndex = 214;
             this.pi_inoutno_label.Text = "出货单号";
             // 
             // pi_inoutno
             // 
-            this.pi_inoutno.Location = new System.Drawing.Point(112, 63);
+            this.pi_inoutno.Location = new System.Drawing.Point(84, 50);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(2);
             this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(265, 25);
+            this.pi_inoutno.Size = new System.Drawing.Size(124, 21);
             this.pi_inoutno.TabIndex = 223;
+            this.pi_inoutno.TextChanged += new System.EventHandler(this.pi_inoutno_TextChanged);
             // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(13, 162);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(10, 130);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 27);
+            this.label1.Size = new System.Drawing.Size(42, 21);
             this.label1.TabIndex = 224;
             this.label1.Text = "备注";
             // 
-            // textBox1
+            // note
             // 
-            this.textBox1.Location = new System.Drawing.Point(111, 162);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(266, 25);
-            this.textBox1.TabIndex = 225;
+            this.note.Location = new System.Drawing.Point(83, 130);
+            this.note.Margin = new System.Windows.Forms.Padding(2);
+            this.note.Name = "note";
+            this.note.Size = new System.Drawing.Size(200, 21);
+            this.note.TabIndex = 225;
             // 
             // cu_name
             // 
-            this.cu_name.Location = new System.Drawing.Point(259, 110);
+            this.cu_name.Location = new System.Drawing.Point(194, 88);
+            this.cu_name.Margin = new System.Windows.Forms.Padding(2);
             this.cu_name.Name = "cu_name";
-            this.cu_name.Size = new System.Drawing.Size(118, 25);
+            this.cu_name.Size = new System.Drawing.Size(90, 21);
             this.cu_name.TabIndex = 226;
             // 
+            // normalButton1
+            // 
+            this.normalButton1.AllPower = null;
+            this.normalButton1.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
+            this.normalButton1.Image = null;
+            this.normalButton1.IsShowBorder = true;
+            this.normalButton1.Location = new System.Drawing.Point(217, 45);
+            this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
+            this.normalButton1.Name = "normalButton1";
+            this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
+            this.normalButton1.Power = null;
+            this.normalButton1.Size = new System.Drawing.Size(75, 28);
+            this.normalButton1.TabIndex = 227;
+            this.normalButton1.Text = "生成出货单";
+            this.normalButton1.UseVisualStyleBackColor = false;
+            this.normalButton1.Click += new System.EventHandler(this.MakeButton_Click);
+            // 
             // Warehouse_NewPiInOut
             // 
-            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(405, 259);
+            this.ClientSize = new System.Drawing.Size(304, 207);
+            this.Controls.Add(this.normalButton1);
             this.Controls.Add(this.cu_name);
-            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.note);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.pi_inoutno);
             this.Controls.Add(this.pi_inoutno_label);
@@ -156,6 +178,7 @@
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.headBar1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Warehouse_NewPiInOut";
             this.Tag = "ShowDialogWindow";
             this.Text = "Warehouse_NewPiInOut";
@@ -174,7 +197,8 @@
         private System.Windows.Forms.Label pi_inoutno_label;
         private System.Windows.Forms.TextBox pi_inoutno;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox note;
         private System.Windows.Forms.TextBox cu_name;
+        private CustomControl.ButtonUtil.NormalButton normalButton1;
     }
 }

+ 59 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_NewPiInOut.cs

@@ -6,6 +6,8 @@ using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Warehouse
@@ -14,6 +16,27 @@ namespace UAS_MES.Warehouse
     {
         DataTable dbfind;
 
+        DataHelper dh;
+        LogStringBuilder sql = new LogStringBuilder();
+
+        //页面Caller
+        string caller;
+
+        string pi_inoutno1;
+
+        public string pi_inoutno_text
+        {
+            get
+            {
+                return pi_inoutno1;
+            }
+
+            set
+            {
+                pi_inoutno1 = value;
+            }
+        }
+
         public Warehouse_NewPiInOut()
         {
             InitializeComponent();
@@ -21,11 +44,34 @@ namespace UAS_MES.Warehouse
 
         private void Confirm_Click(object sender, EventArgs e)
         {
+            if (pi_inoutno.Text == "")
+            {
+                MakeButton_Click(sender, e);
+            }
+            if (int.Parse(dh.getFieldDataByCondition("prodinout", "count(1)cn", "pi_inoutno='" + pi_inoutno.Text + "'").ToString()) > 0)
+            {
+                MessageBox.Show("出货单号" + pi_inoutno.Text + "重复");
+                return;
+            }
+            if (cu_code.Text == "" || cu_name.Text == "")
+            {
+                MessageBox.Show("客户编号未填");
+                return;
+            }
 
+            sql.Clear();
+            sql.Append("insert into prodinout (pi_id,pi_class,pi_inoutno,pi_pdastatus,pi_type,pi_cardcode,pi_title,pi_recordman,");
+            sql.Append("pi_recordcode,pi_recorddate,pi_remark)values(prodinout_seq.nextval,'出货单','" + pi_inoutno.Text + "','未备货',");
+            sql.Append("'自由出货','" + cu_code.Text + "','" + cu_name.Text + "','" + User.UserName + "',");
+            sql.Append("'" + User.UserCode + "',sysdate,'" + note.Text + "')");
+            dh.ExecuteSql(sql.GetString(), "insert");
+            MessageBox.Show("添加出货单成功");
         }
 
         private void Warehouse_NewPiInOut_Load(object sender, EventArgs e)
         {
+            dh = new DataHelper();
+            caller = "ProdInOut";
             cu_code.TableName = "customer";
             cu_code.DBTitle = "出货单查询";
             cu_code.SelectField = "cu_code # 编号,cu_name # 名称";
@@ -39,5 +85,18 @@ namespace UAS_MES.Warehouse
             dbfind = cu_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, dbfind);
         }
+
+        private void MakeButton_Click(object sender, EventArgs e)
+        {
+            string _macode = "";
+            string[] param = new string[] { caller, "2", _macode };
+            dh.CallProcedure("SP_GETMAXNUMBER", ref param);
+            pi_inoutno.Text = param[2];
+        }
+
+        private void pi_inoutno_TextChanged(object sender, EventArgs e)
+        {
+            pi_inoutno1 = pi_inoutno.Text;
+        }
     }
 }

+ 38 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_NewPiInOut.resx

@@ -154,6 +154,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="normalButton1.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="normalButton1.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="normalButton1.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
 </root>

+ 63 - 4
UAS-MES/FunctionCode/Warehouse/Warehouse_ProdDetail.Designer.cs

@@ -29,6 +29,13 @@
         private void InitializeComponent()
         {
             this.headBar1 = new UAS_MES.CustomControl.HeadBar();
+            this.InOutDetailDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.pim_outboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pim_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pim_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.InOutDetailDGV)).BeginInit();
             this.SuspendLayout();
             // 
             // headBar1
@@ -36,22 +43,68 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(404, 40);
+            this.headBar1.Size = new System.Drawing.Size(621, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
             // 
+            // InOutDetailDGV
+            // 
+            this.InOutDetailDGV.AllowUserToAddRows = false;
+            this.InOutDetailDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.InOutDetailDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.pim_outboxcode,
+            this.pim_mac,
+            this.pim_prodcode,
+            this.pr_detail,
+            this.pr_spec});
+            this.InOutDetailDGV.Location = new System.Drawing.Point(32, 37);
+            this.InOutDetailDGV.Margin = new System.Windows.Forms.Padding(2);
+            this.InOutDetailDGV.Name = "InOutDetailDGV";
+            this.InOutDetailDGV.RowTemplate.Height = 27;
+            this.InOutDetailDGV.Size = new System.Drawing.Size(544, 357);
+            this.InOutDetailDGV.TabIndex = 219;
+            // 
+            // pim_outboxcode
+            // 
+            this.pim_outboxcode.HeaderText = "栈板/箱号";
+            this.pim_outboxcode.MinimumWidth = 120;
+            this.pim_outboxcode.Name = "pim_outboxcode";
+            this.pim_outboxcode.Width = 120;
+            // 
+            // pim_mac
+            // 
+            this.pim_mac.HeaderText = "SN号";
+            this.pim_mac.Name = "pim_mac";
+            // 
+            // pim_prodcode
+            // 
+            this.pim_prodcode.HeaderText = "产品代码";
+            this.pim_prodcode.Name = "pim_prodcode";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.HeaderText = "名称";
+            this.pr_detail.Name = "pr_detail";
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            // 
             // Warehouse_ProdDetail
             // 
-            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(404, 253);
+            this.ClientSize = new System.Drawing.Size(621, 420);
+            this.Controls.Add(this.InOutDetailDGV);
             this.Controls.Add(this.headBar1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Warehouse_ProdDetail";
             this.Text = "Warehouse_ProdDetail";
             this.Load += new System.EventHandler(this.Warehouse_ProdDetail_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.InOutDetailDGV)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -59,5 +112,11 @@
         #endregion
 
         private CustomControl.HeadBar headBar1;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum InOutDetailDGV;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_outboxcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_mac;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
     }
 }

+ 15 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_ProdDetail.resx

@@ -117,4 +117,19 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="pim_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pim_mac.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pim_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>