瀏覽代碼

拆解处理支持延后进行换料操作

Hcsy 8 年之前
父節點
當前提交
733a7a254d

+ 65 - 11
UAS-MES/FunctionCode/Make/Make_Decompose.Designer.cs

@@ -45,14 +45,17 @@
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
             this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ms_wccode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftname = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -65,6 +68,7 @@
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.cm_craftname = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_craftcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -74,6 +78,7 @@
             this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.New_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_maid = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_materialtype = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_maprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -149,6 +154,7 @@
             this.LabelDataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
             this.LabelDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
+            this.cm_craftname,
             this.cm_craftcode,
             this.cm_id,
             this.pr_detail,
@@ -158,6 +164,7 @@
             this.cm_soncode,
             this.cm_barcode,
             this.New_BarCode,
+            this.cm_status,
             this.cm_maid,
             this.cm_materialtype,
             this.cm_maprodcode,
@@ -234,8 +241,10 @@
             // 
             // dataGridViewTextBoxColumn3
             // 
+            this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.dataGridViewTextBoxColumn3.DataPropertyName = "pr_detail";
             this.dataGridViewTextBoxColumn3.HeaderText = "不良代码组编号";
+            this.dataGridViewTextBoxColumn3.MinimumWidth = 40;
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             this.dataGridViewTextBoxColumn3.ReadOnly = true;
             this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
@@ -244,6 +253,7 @@
             // 
             // dataGridViewTextBoxColumn4
             // 
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "pr_detail";
             this.dataGridViewTextBoxColumn4.HeaderText = "不良代码";
             this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
             this.dataGridViewTextBoxColumn4.ReadOnly = true;
@@ -258,8 +268,18 @@
             this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
             this.dataGridViewTextBoxColumn5.ReadOnly = true;
             this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn5.Visible = false;
             this.dataGridViewTextBoxColumn5.Width = 80;
             // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_barcode";
+            this.dataGridViewTextBoxColumn6.HeaderText = "物料批号";
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn6.Width = 80;
+            // 
             // dataGridViewImageColumn1
             // 
             this.dataGridViewImageColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -270,14 +290,6 @@
             this.dataGridViewImageColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
             this.dataGridViewImageColumn1.Width = 20;
             // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_barcode";
-            this.dataGridViewTextBoxColumn6.HeaderText = "物料批号";
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.ReadOnly = true;
-            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
             // dataGridViewTextBoxColumn7
             // 
             this.dataGridViewTextBoxColumn7.DataPropertyName = "cm_barcode";
@@ -294,6 +306,7 @@
             this.dataGridViewTextBoxColumn8.HeaderText = "";
             this.dataGridViewTextBoxColumn8.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.ReadOnly = true;
             this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn8.Visible = false;
             this.dataGridViewTextBoxColumn8.Width = 300;
@@ -302,8 +315,11 @@
             // 
             this.dataGridViewTextBoxColumn9.DataPropertyName = "cm_maid";
             this.dataGridViewTextBoxColumn9.HeaderText = "";
+            this.dataGridViewTextBoxColumn9.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
+            this.dataGridViewTextBoxColumn9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn9.Visible = false;
+            this.dataGridViewTextBoxColumn9.Width = 300;
             // 
             // dataGridViewTextBoxColumn10
             // 
@@ -326,6 +342,27 @@
             this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
             this.dataGridViewTextBoxColumn12.Visible = false;
             // 
+            // dataGridViewTextBoxColumn13
+            // 
+            this.dataGridViewTextBoxColumn13.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn13.HeaderText = "";
+            this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
+            this.dataGridViewTextBoxColumn13.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn14
+            // 
+            this.dataGridViewTextBoxColumn14.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn14.HeaderText = "";
+            this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
+            this.dataGridViewTextBoxColumn14.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn15
+            // 
+            this.dataGridViewTextBoxColumn15.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn15.HeaderText = "";
+            this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
+            this.dataGridViewTextBoxColumn15.Visible = false;
+            // 
             // ms_wccode
             // 
             this.ms_wccode.AutoSize = true;
@@ -465,6 +502,13 @@
             this.Choose.Name = "Choose";
             this.Choose.Width = 80;
             // 
+            // cm_craftname
+            // 
+            this.cm_craftname.DataPropertyName = "cm_craftname";
+            this.cm_craftname.HeaderText = "";
+            this.cm_craftname.Name = "cm_craftname";
+            this.cm_craftname.Visible = false;
+            // 
             // cm_craftcode
             // 
             this.cm_craftcode.DataPropertyName = "cm_craftcode";
@@ -479,7 +523,6 @@
             this.cm_id.HeaderText = "cm_id";
             this.cm_id.MinimumWidth = 40;
             this.cm_id.Name = "cm_id";
-            this.cm_id.Visible = false;
             this.cm_id.Width = 40;
             // 
             // pr_detail
@@ -541,6 +584,12 @@
             this.New_BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.New_BarCode.Width = 300;
             // 
+            // cm_status
+            // 
+            this.cm_status.DataPropertyName = "cm_status";
+            this.cm_status.HeaderText = "上线状态";
+            this.cm_status.Name = "cm_status";
+            // 
             // cm_maid
             // 
             this.cm_maid.DataPropertyName = "cm_maid";
@@ -649,7 +698,11 @@
         private System.Windows.Forms.Label pr_name;
         private System.Windows.Forms.RadioButton change;
         private System.Windows.Forms.RadioButton nochange;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn cm_craftname;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_craftcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
@@ -659,11 +712,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_soncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn New_BarCode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn cm_status;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_maid;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_materialtype;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_maprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
     }
 }

+ 9 - 3
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -105,12 +105,18 @@ namespace UAS_MES.Make
         {
             sncode_1 = sncode;
             sql.Clear();
-            sql.Append("select cm_craftcode,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_id,cm_soncode,cm_barcode,pr_detail,cm_materialtype from craftmaterial left join product on pr_code=cm_soncode where");
-            sql.Append("(cm_sncode  in (select sn from makesnrelation where firstsn='"+ sncode_1 + "')  or cm_sncode in ( select firstsn from makesnrelation where sn = '"+ sncode_1 + "') or cm_sncode = '"+ sncode_1 + "') and  nvl(cm_status,0)='0'");
+            sql.Append("select cm_craftcode,cm_craftname,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_soncode,pr_detail,cm_materialtype,");
+            sql.Append("max(cm_status) cm_status,max(cm_id) cm_id from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode  in (select sn from makesnrelation ");
+            sql.Append("where firstsn='"+ sncode_1 + "')  or cm_sncode in ( select firstsn from makesnrelation where sn = '" + sncode_1 + "')");
+            sql.Append("or cm_sncode = '" + sncode_1 + "') group by cm_craftcode,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_soncode,pr_detail,cm_materialtype,cm_craftname ORDER BY cm_status DESC");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
                 BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
+                for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
+                {
+                    LabelDataGridView.Rows[i].Cells["cm_barcode"].Value = dh.getFieldDataByCondition("CRAFTMATERIAL", "CM_BARCODE", "cm_id = '"+ LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                }
             }
             else
             {
@@ -309,7 +315,7 @@ namespace UAS_MES.Make
                             sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid, cm_materialtype,cm_status)");
                             sql.Append("values(Craftmaterial_seq.nextval,'" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_maid"].Value + "','" + ms_prodcode.Text + "','" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
                             sql.Append(",'" + LabelDataGridView.Rows[i].Cells["cm_sncode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_sncode"].Value + "','" + User.CurrentStepCode + "','" + User.CurrentStepName + "',");
-                            sql.Append("'" + ms_craftcode.Text + "','" + ms_craftname.Text + "','" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "',1,sysdate,'" + User.UserName + "','" + User.UserLineCode + "','" + ms_wccode.Text + "',");
+                            sql.Append("'" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_craftname"].Value + "','" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "',1,sysdate,'" + User.UserName + "','" + User.UserLineCode + "','" + ms_wccode.Text + "',");
                             sql.Append("'" + User.UserSourceCode + "','" + sp_id + "','" + LabelDataGridView.Rows[i].Cells["cm_materialtype"].Value + "','0')");
                             dh.ExecuteSql(sql.GetString(), "insert");
                             OperateResult.AppendText("物料" + LabelDataGridView.Rows[i].Cells["cm_barcode"].Value + "拆解换料成功\n", Color.Green);

+ 6 - 0
UAS-MES/FunctionCode/Make/Make_Decompose.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="cm_craftname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="cm_craftcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -144,6 +147,9 @@
   <metadata name="New_BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="cm_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="cm_maid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>