Преглед изворни кода

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy пре 8 година
родитељ
комит
1d20824960

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -216,6 +216,7 @@
             this.ma_code.TabIndex = 92;
             this.ma_code.TabIndex = 92;
             this.ma_code.TableName = null;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = false;
             this.ma_code.TextBoxEnable = false;
+            this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox.OnTextChange(this.ms_makecode_UserControlTextChanged);
             // 
             // 
             // changenum
             // changenum
             // 
             // 

+ 142 - 99
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -16,6 +16,11 @@ namespace UAS_MES.OQC
         DataHelper dh;
         DataHelper dh;
         LogStringBuilder sql = new LogStringBuilder();
         LogStringBuilder sql = new LogStringBuilder();
         DataTable dt;
         DataTable dt;
+        string ErrorMessage = "";
+        /// <summary>
+        /// 是否通过资源验证
+        /// </summary>
+        bool PassCheckStep = false;
         public OQC_BatchResultJudge()
         public OQC_BatchResultJudge()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -30,70 +35,84 @@ namespace UAS_MES.OQC
 
 
         private void GetBatch_Click(object sender, EventArgs e)
         private void GetBatch_Click(object sender, EventArgs e)
         {
         {
-            string ErrorMessage = "";
-            DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCResultDetermine", out ErrorMessage);
-            if (ErrorMessage == "")
-            {
-                BaseUtil.SetFormValue(Controls, dt[0]);
-            }
-            else
+            if (CheckStep())
             {
             {
-                BaseUtil.CleanForm(this);
-                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-            }
-            switch (ob_result.Text)
-            {
-                case "OK":
-                    BatchPass.Enabled = false;
-                    BatchRejection.Enabled = false;
-                    ForcePass.Enabled = false;
-                    ForceRejection.Enabled = false;
-                    WithdrawPass.Enabled = true;
-                    WithdrawRejection.Enabled = false;
-                    break;
-                case "FOK":
-                    BatchPass.Enabled = false;
-                    BatchRejection.Enabled = false;
-                    ForcePass.Enabled = false;
-                    ForceRejection.Enabled = false;
-                    WithdrawPass.Enabled = true;
-                    WithdrawRejection.Enabled = false;
-                    break;
-                case "NG":
-                    BatchPass.Enabled = false;
-                    BatchRejection.Enabled = false;
-                    ForcePass.Enabled = false;
-                    ForceRejection.Enabled = false;
-                    WithdrawPass.Enabled = false;
-                    WithdrawRejection.Enabled = true;
-                    break;
-                case "FNG":
+                PassCheckStep = true;
+                string ErrorMessage = "";
+                DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCResultDetermine", out ErrorMessage);
+                if (ErrorMessage == "")
+                {
+                    BaseUtil.SetFormValue(Controls, dt[0]);
+                    switch (ob_result.Text)
+                    {
+                        case "OK":
+                            BatchPass.Enabled = false;
+                            BatchRejection.Enabled = false;
+                            ForcePass.Enabled = false;
+                            ForceRejection.Enabled = false;
+                            WithdrawPass.Enabled = true;
+                            WithdrawRejection.Enabled = false;
+                            break;
+                        case "FOK":
+                            BatchPass.Enabled = false;
+                            BatchRejection.Enabled = false;
+                            ForcePass.Enabled = false;
+                            ForceRejection.Enabled = false;
+                            WithdrawPass.Enabled = true;
+                            WithdrawRejection.Enabled = false;
+                            break;
+                        case "NG":
+                            BatchPass.Enabled = false;
+                            BatchRejection.Enabled = false;
+                            ForcePass.Enabled = false;
+                            ForceRejection.Enabled = false;
+                            WithdrawPass.Enabled = false;
+                            WithdrawRejection.Enabled = true;
+                            break;
+                        case "FNG":
+                            BatchPass.Enabled = false;
+                            BatchRejection.Enabled = false;
+                            ForcePass.Enabled = false;
+                            ForceRejection.Enabled = false;
+                            WithdrawPass.Enabled = false;
+                            WithdrawRejection.Enabled = true;
+                            break;
+                        case "":
+                            if (ob_checkno.Text != "")
+                            {
+                                BatchPass.Enabled = true;
+                                BatchRejection.Enabled = true;
+                                ForcePass.Enabled = true;
+                                ForceRejection.Enabled = true;
+                                WithdrawPass.Enabled = true;
+                                WithdrawRejection.Enabled = true;
+                            }
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                else
+                {
+                    BaseUtil.CleanForm(this);
                     BatchPass.Enabled = false;
                     BatchPass.Enabled = false;
                     BatchRejection.Enabled = false;
                     BatchRejection.Enabled = false;
                     ForcePass.Enabled = false;
                     ForcePass.Enabled = false;
                     ForceRejection.Enabled = false;
                     ForceRejection.Enabled = false;
                     WithdrawPass.Enabled = false;
                     WithdrawPass.Enabled = false;
-                    WithdrawRejection.Enabled = true;
-                    break;
-                case "":
-                    if (ob_checkno.Text != "")
-                    {
-                        BatchPass.Enabled = true;
-                        BatchRejection.Enabled = true;
-                        ForcePass.Enabled = true;
-                        ForceRejection.Enabled = true;
-                        WithdrawPass.Enabled = true;
-                        WithdrawRejection.Enabled = true;
-                    }
-                    break;
-                default:
-                    break;
+                    WithdrawRejection.Enabled = false;
+                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                }
+            }
+            else
+            {
+                PassCheckStep = false;
             }
             }
         }
         }
 
 
         private void BatchPass_Click(object sender, EventArgs e)
         private void BatchPass_Click(object sender, EventArgs e)
         {
         {
-            if (CheckBefore())
+            if (CheckBefore() && PassCheckStep)
             {
             {
                 if (int.Parse(ob_ngqty.Text == "" ? "0" : ob_ngqty.Text) <= int.Parse(ob_maxngacceptqty.Text == "" ? ob_maxngacceptqty.Text : ob_maxngacceptqty.Text))
                 if (int.Parse(ob_ngqty.Text == "" ? "0" : ob_ngqty.Text) <= int.Parse(ob_maxngacceptqty.Text == "" ? ob_maxngacceptqty.Text : ob_maxngacceptqty.Text))
                 {
                 {
@@ -109,7 +128,7 @@ namespace UAS_MES.OQC
 
 
         private void BatchRejection_Click(object sender, EventArgs e)
         private void BatchRejection_Click(object sender, EventArgs e)
         {
         {
-            if (CheckBefore())
+            if (CheckBefore() && PassCheckStep)
             {
             {
                 sql.Clear();
                 sql.Clear();
                 sql.Append("select max(nvl(ad_maxngacceptqty,0)) maxngacceptqty from QUA_Aql,QUA_AqlDetail where al_id=ad_alid ");
                 sql.Append("select max(nvl(ad_maxngacceptqty,0)) maxngacceptqty from QUA_Aql,QUA_AqlDetail where al_id=ad_alid ");
@@ -146,72 +165,85 @@ namespace UAS_MES.OQC
 
 
         private void ForcePass_Click(object sender, EventArgs e)
         private void ForcePass_Click(object sender, EventArgs e)
         {
         {
-            dh.ExecuteSql("update OQCBatch set ob_status='OK' ,ob_result='FOK' where ob_checkno='" + ob_checkno.Text + "'", "select");
-            DoLog("强制通过", "强制通过成功", "通过");
-            GetBatch.PerformClick();
-            OperateResult.AppendText(">>强制通过批" + ob_checkno.Text + "成功\n", Color.Green);
+            if (PassCheckStep)
+            {
+                dh.ExecuteSql("update OQCBatch set ob_status='OK' ,ob_result='FOK' where ob_checkno='" + ob_checkno.Text + "'", "select");
+                DoLog("强制通过", "强制通过成功", "通过");
+                GetBatch.PerformClick();
+                OperateResult.AppendText(">>强制通过批" + ob_checkno.Text + "成功\n", Color.Green);
+            }
         }
         }
 
 
         private void ForceRejection_Click(object sender, EventArgs e)
         private void ForceRejection_Click(object sender, EventArgs e)
         {
         {
-            dh.ExecuteSql("update OQCBatch set ob_status='NG' ,ob_result='FNG' where ob_checkno='" + ob_checkno.Text + "'", "select");
-            DoLog("强制判退通过", "强制判退通过成功", "判退");
-            GetBatch.PerformClick();
-            OperateResult.AppendText(">>强制撤销批" + ob_checkno.Text + "成功\n", Color.Green);
+            if (PassCheckStep)
+            {
+                dh.ExecuteSql("update OQCBatch set ob_status='NG' ,ob_result='FNG' where ob_checkno='" + ob_checkno.Text + "'", "select");
+                DoLog("强制判退通过", "强制判退通过成功", "判退");
+                GetBatch.PerformClick();
+                OperateResult.AppendText(">>强制撤销批" + ob_checkno.Text + "成功\n", Color.Green);
+            }
         }
         }
 
 
         private void WithdrawPass_Click(object sender, EventArgs e)
         private void WithdrawPass_Click(object sender, EventArgs e)
         {
         {
-            if (ob_result.Text == "OK" || ob_result.Text == "FOK")
-            {
-                dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' ,ob_result='' where ob_checkno='" + ob_checkno.Text + "'", "select");
-                ob_result.Text = "";
-                DoLog("撤销通过", "撤销通过成功", "撤销");
-                OperateResult.AppendText(">>撤销通过批" + ob_checkno.Text + "成功\n", Color.Green);
-                GetBatch.PerformClick();
-            }
-            else
+            if (PassCheckStep)
             {
             {
-                OperateResult.AppendText(">>该抽检批次未通过,无需撤销通过\n", Color.Red);
+                if (ob_result.Text == "OK" || ob_result.Text == "FOK")
+                {
+                    dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' ,ob_result='' where ob_checkno='" + ob_checkno.Text + "'", "select");
+                    ob_result.Text = "";
+                    DoLog("撤销通过", "撤销通过成功", "撤销");
+                    OperateResult.AppendText(">>撤销通过批" + ob_checkno.Text + "成功\n", Color.Green);
+                    GetBatch.PerformClick();
+                }
+                else
+                {
+                    OperateResult.AppendText(">>该抽检批次未通过,无需撤销通过\n", Color.Red);
+                }
             }
             }
         }
         }
 
 
         private void WithdrawRejection_Click(object sender, EventArgs e)
         private void WithdrawRejection_Click(object sender, EventArgs e)
         {
         {
-            if (ob_result.Text == "NG" || ob_result.Text == "FNG")
+            if (PassCheckStep)
             {
             {
-                dt = (DataTable)dh.ExecuteSql("select re_statuscode from rework where re_checkno='" + ob_checkno.Text + "'", "select");
-                if (dt.Rows.Count > 0)
+                if (ob_result.Text == "NG" || ob_result.Text == "FNG")
                 {
                 {
-                    if (dt.Rows[0]["re_statuscode"].ToString() == "AUDITED")
-                    {
-                        OperateResult.AppendText(">>该批次存在已审核的返修工单,不允许撤销\n", Color.Red);
-                        return;
-                    }
-                    else
+                    dt = (DataTable)dh.ExecuteSql("select re_statuscode from rework where re_checkno='" + ob_checkno.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
                     {
                     {
-                        string logout_confirm = MessageBox.Show("已存在返修工单,撤销会删除该工单,是否继续", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                        if (logout_confirm == "Yes")
+                        if (dt.Rows[0]["re_statuscode"].ToString() == "AUDITED")
                         {
                         {
-                            dh.ExecuteSql("delete from reworkdetail where rd_checkno='" + ob_checkno.Text + "' ", "delete");
-                            dh.ExecuteSql("delete from rework where re_checkno='" + ob_checkno.Text + "' ", "delete");
+                            OperateResult.AppendText(">>该批次存在已审核的返修工单,不允许撤销\n", Color.Red);
+                            return;
+                        }
+                        else
+                        {
+                            string logout_confirm = MessageBox.Show("已存在返修工单,撤销会删除该工单,是否继续", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                            if (logout_confirm == "Yes")
+                            {
+                                dh.ExecuteSql("delete from reworkdetail where rd_checkno='" + ob_checkno.Text + "' ", "delete");
+                                dh.ExecuteSql("delete from rework where re_checkno='" + ob_checkno.Text + "' ", "delete");
+                            }
+                            else return;
                         }
                         }
-                        else return;
                     }
                     }
+                    dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' ,ob_result='' where ob_checkno='" + ob_checkno.Text + "'", "select");
+                    ob_result.Text = "";
+                    DoLog("撤销判退", "撤销判退成功", "撤销");
+                    OperateResult.AppendText(">>撤销判退成功\n", Color.Green);
+                    GetBatch.PerformClick();
                 }
                 }
-                dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' ,ob_result='' where ob_checkno='" + ob_checkno.Text + "'", "select");
-                ob_result.Text = "";
-                DoLog("撤销判退", "撤销判退成功", "撤销");
-                OperateResult.AppendText(">>撤销判退成功\n", Color.Green);
-                GetBatch.PerformClick();
+                else OperateResult.AppendText(">>该抽检批次未判退,无需撤销判退\n", Color.Red);
             }
             }
-            else OperateResult.AppendText(">>该抽检批次未判退,无需撤销判退\n", Color.Red);
         }
         }
 
 
         private void Clean_Click(object sender, EventArgs e)
         private void Clean_Click(object sender, EventArgs e)
         {
         {
             OperateResult.Clear();
             OperateResult.Clear();
         }
         }
+
         /// <summary>
         /// <summary>
         /// 操作之前通用的验证逻辑
         /// 操作之前通用的验证逻辑
         /// </summary>
         /// </summary>
@@ -261,11 +293,22 @@ namespace UAS_MES.OQC
                     }
                     }
                 }
                 }
             }
             }
+            else OperateResult.AppendText(">>状态未在检验中的批次不允许进行判断\n", Color.Red);
+
+            return false;
+        }
+
+        private bool CheckStep()
+        {
+            if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
+            {
+                return true;
+            }
             else
             else
             {
             {
-                OperateResult.AppendText(">>状态未在检验中的批次不允许进行判断\n", Color.Red);
+                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                return false;
             }
             }
-            return false;
         }
         }
 
 
         //记录操作日志
         //记录操作日志
@@ -296,15 +339,15 @@ namespace UAS_MES.OQC
                 else if (Type == "通过")
                 else if (Type == "通过")
                 {
                 {
                     //更新下一工序
                     //更新下一工序
-                    string ErrorMessage = "";
-                    LogicHandler.UpdateOQCMessage(ms_sncode.Text,ob_checkno.Text, ob_makecode.Text, Kind, User.UserSourceCode, User.UserName, Result, out ErrorMessage);
+
+                    LogicHandler.UpdateOQCMessage(ms_sncode.Text, ob_checkno.Text, ob_makecode.Text, Kind, User.UserSourceCode, User.UserName, Result, out ErrorMessage);
                     sql.Clear();
                     sql.Clear();
                     sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
                     sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
                     sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
                     sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
-                    sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,mcd_stepcode,mcd_stepname,");
+                    sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,st_code,st_name,");
                     sql.Append("ma_craftcode,ma_craftname,'" + Kind + "','" + Result + "',sysdate,'" + User.UserCode + "',ma_wccode,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
                     sql.Append("ma_craftcode,ma_craftname,'" + Kind + "','" + Result + "',sysdate,'" + User.UserCode + "',ma_wccode,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
-                    sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makecraftdetail on mcd_macode=ma_code left join makeserial on ms_makecode=ma_code ");
-                    sql.Append("where  ms_checkno='" + ob_checkno.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                    sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
+                    sql.Append("where  ms_checkno='" + ob_checkno.Text + "' and st_code='" + User.CurrentStepCode + "'");
                     dh.ExecuteSql(sql.GetString(), "insert");
                     dh.ExecuteSql(sql.GetString(), "insert");
                 }
                 }
             }
             }

+ 44 - 22
UAS-MES/FunctionCode/OQC/OQC_Inspection.cs

@@ -19,6 +19,8 @@ namespace UAS_MES.OQC
         DataTable dt;
         DataTable dt;
         //用来存放已打开过的行
         //用来存放已打开过的行
         List<DataGridViewRow> dgvr = new List<DataGridViewRow>();
         List<DataGridViewRow> dgvr = new List<DataGridViewRow>();
+        string ErrorMessage = "";
+
         public OQC_Inspection()
         public OQC_Inspection()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -43,16 +45,19 @@ namespace UAS_MES.OQC
 
 
         private void NewBatch_Click(object sender, EventArgs e)
         private void NewBatch_Click(object sender, EventArgs e)
         {
         {
-            string ob_id = dh.GetSEQ("OQCBatch_SEQ");
-            string checkno = dh.GetSerialNumberByCaller("OQC!Inspection");
-            sql.Append("insert into OQCBatch (ob_id, ob_checkno ,ob_status, ob_source,ob_indate,ob_checkman) ");
-            sql.Append("values( '" + ob_id + "','" + checkno + "', 'ENTERING', '新增', sysdate, '" + User.UserName + "')");
-            dh.ExecuteSql(sql.GetString(), "insert");
-            sql.Clear();
-            //记录操作日志
-            LogicHandler.InsertMessageLog(User.UserName, "生成新批", "成功", "", "");
-            //生成成功,将批次号,以及批次状态写入页面
-            BaseUtil.SetFormValue(Controls, dh.getFieldsDataByCondition("OQCBatch", new string[] { "ob_checkno", "ob_status" }, "ob_id='" + ob_id + "'"));
+            if (CheckStep())
+            {
+                string ob_id = dh.GetSEQ("OQCBatch_SEQ");
+                string checkno = dh.GetSerialNumberByCaller("OQC!Inspection");
+                sql.Append("insert into OQCBatch (ob_id, ob_checkno ,ob_status, ob_source,ob_indate,ob_checkman) ");
+                sql.Append("values( '" + ob_id + "','" + checkno + "', 'ENTERING', '新增', sysdate, '" + User.UserName + "')");
+                dh.ExecuteSql(sql.GetString(), "insert");
+                sql.Clear();
+                //记录操作日志
+                LogicHandler.InsertMessageLog(User.UserName, "生成新批", "成功", "", "");
+                //生成成功,将批次号,以及批次状态写入页面
+                BaseUtil.SetFormValue(Controls, dh.getFieldsDataByCondition("OQCBatch", new string[] { "ob_checkno", "ob_status" }, "ob_id='" + ob_id + "'"));
+            }
         }
         }
 
 
         private void 生成送检批_SizeChanged(object sender, EventArgs e)
         private void 生成送检批_SizeChanged(object sender, EventArgs e)
@@ -140,17 +145,19 @@ namespace UAS_MES.OQC
 
 
         private void GetBatch_Click(object sender, EventArgs e)
         private void GetBatch_Click(object sender, EventArgs e)
         {
         {
-            string ErrorMessage = "";
-            DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCSendCheck", out ErrorMessage);
-            if (ErrorMessage == "")
-            {
-                BaseUtil.SetFormValue(Controls, dt[0]);
-                BaseUtil.FillExpandDgvWithDataTable(CheckBatchDGV, dt[1], true);
-            }
-            else
+            if (CheckStep())
             {
             {
-                 BaseUtil.CleanForm(this);
-                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCSendCheck", out ErrorMessage);
+                if (ErrorMessage == "")
+                {
+                    BaseUtil.SetFormValue(Controls, dt[0]);
+                    BaseUtil.FillExpandDgvWithDataTable(CheckBatchDGV, dt[1], true,true);
+                }
+                else
+                {
+                    BaseUtil.CleanForm(this);
+                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                }
             }
             }
         }
         }
 
 
@@ -159,6 +166,19 @@ namespace UAS_MES.OQC
 
 
         }
         }
 
 
+        private bool CheckStep()
+        {
+            if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
+            {
+                return true;
+            }
+            else
+            {
+                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                return false;
+            }
+        }
+
         private void CheckBatchDGV_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
         private void CheckBatchDGV_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
         {
         {
             if (!dgvr.Contains(CheckBatchDGV.Rows[e.RowIndex]))
             if (!dgvr.Contains(CheckBatchDGV.Rows[e.RowIndex]))
@@ -238,8 +258,10 @@ namespace UAS_MES.OQC
 
 
         private void RemoveAll_Click(object sender, EventArgs e)
         private void RemoveAll_Click(object sender, EventArgs e)
         {
         {
-            if (CheckBatchDGV.Rows.Count > 0) {
-                if (MessageBox.Show(this.ParentForm, "确认移除全部箱号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "Yes") {
+            if (CheckBatchDGV.Rows.Count > 0)
+            {
+                if (MessageBox.Show(this.ParentForm, "确认移除全部箱号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "Yes")
+                {
                     DataTable dt = (DataTable)dh.ExecuteSql("select ob_status,ob_source from OQCBatch where ob_checkno='" + ob_checkno.Text + "'", "select");
                     DataTable dt = (DataTable)dh.ExecuteSql("select ob_status,ob_source from OQCBatch where ob_checkno='" + ob_checkno.Text + "'", "select");
                     if (dt.Rows.Count > 0)
                     if (dt.Rows.Count > 0)
                     {
                     {

+ 17 - 9
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -5,6 +5,7 @@ using System.Drawing;
 using System.Text;
 using System.Text;
 using System.Windows.Forms;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
 using UAS_MES.DataOperate;
+using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 using UAS_MES.PublicMethod;
 
 
 namespace UAS_MES.OQC
 namespace UAS_MES.OQC
@@ -52,26 +53,33 @@ namespace UAS_MES.OQC
         /// <param name="e"></param>
         /// <param name="e"></param>
         private void GetBatch_Click(object sender, EventArgs e)
         private void GetBatch_Click(object sender, EventArgs e)
         {
         {
-            DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCPlanMaintain", out ErrorMessage);
-            if (dt != null)
+            if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
             {
-                if (ErrorMessage == "")
+                DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCPlanMaintain", out ErrorMessage);
+                if (dt != null)
                 {
                 {
-                    BaseUtil.SetFormValue(Controls, dt[0]);
-                    BaseUtil.FillDgvWithDataTable(CheckTypeDGV, dt[1]);
-                    ob_aqlcode.Text = "";
-                    ob_aqlcode.Text = dt[0].Rows[0]["ob_aqlcode"].ToString();
+                    if (ErrorMessage == "")
+                    {
+                        BaseUtil.SetFormValue(Controls, dt[0]);
+                        BaseUtil.FillDgvWithDataTable(CheckTypeDGV, dt[1]);
+                        ob_aqlcode.Text = "";
+                        ob_aqlcode.Text = dt[0].Rows[0]["ob_aqlcode"].ToString();
+                    }
+                    else
+                    {
+                        BaseUtil.CleanForm(this);
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        ErrorMessage = "";
+                    }
                 }
                 }
                 else
                 else
                 {
                 {
                     BaseUtil.CleanForm(this);
                     BaseUtil.CleanForm(this);
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                    ErrorMessage = "";
                 }
                 }
             }
             }
             else
             else
             {
             {
-                BaseUtil.CleanForm(this);
                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
             }
             }
         }
         }

+ 3 - 3
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -216,7 +216,7 @@
             this.panel1.Controls.Add(this.ob_aqlcode);
             this.panel1.Controls.Add(this.ob_aqlcode);
             this.panel1.Controls.Add(this.ob_aqlcode_label);
             this.panel1.Controls.Add(this.ob_aqlcode_label);
             this.panel1.Controls.Add(this.ob_maxacceptqty_label);
             this.panel1.Controls.Add(this.ob_maxacceptqty_label);
-            this.panel1.Location = new System.Drawing.Point(33, 162);
+            this.panel1.Location = new System.Drawing.Point(33, 158);
             this.panel1.Margin = new System.Windows.Forms.Padding(4);
             this.panel1.Margin = new System.Windows.Forms.Padding(4);
             this.panel1.Name = "panel1";
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(993, 120);
             this.panel1.Size = new System.Drawing.Size(993, 120);
@@ -564,9 +564,9 @@
             // 
             // 
             // ChooseAll
             // ChooseAll
             // 
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(33, 289);
+            this.ChooseAll.Location = new System.Drawing.Point(33, 286);
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(75, 23);
+            this.ChooseAll.Size = new System.Drawing.Size(50, 23);
             this.ChooseAll.TabIndex = 194;
             this.ChooseAll.TabIndex = 194;
             this.ChooseAll.Text = "全选";
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.UseVisualStyleBackColor = true;

+ 0 - 15
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.resx

@@ -526,19 +526,4 @@
   <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="Choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ci_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ci_kind.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>
 </root>

+ 64 - 63
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         private void InitializeComponent()
         {
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_label = new System.Windows.Forms.Label();
             this.ms_sncode_label = new System.Windows.Forms.Label();
             this.ms_sncode_label = new System.Windows.Forms.Label();
@@ -65,13 +65,6 @@
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
-            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -90,6 +83,13 @@
             this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -564,61 +564,6 @@
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             // 
             // 
-            // choose
-            // 
-            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.choose.DataPropertyName = "choose";
-            this.choose.HeaderText = "勾选";
-            this.choose.Name = "choose";
-            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.choose.Width = 60;
-            // 
-            // oi_itemcode
-            // 
-            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.oi_itemcode.DataPropertyName = "oi_checkkind";
-            this.oi_itemcode.HeaderText = "检验类型";
-            this.oi_itemcode.Name = "oi_itemcode";
-            this.oi_itemcode.Width = 78;
-            // 
-            // oi_ng
-            // 
-            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.oi_ng.DataPropertyName = "oi_count";
-            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle3;
-            this.oi_ng.HeaderText = "样本数量";
-            this.oi_ng.Name = "oi_ng";
-            this.oi_ng.Width = 96;
-            // 
-            // oi_leveldefect
-            // 
-            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
-            this.oi_leveldefect.HeaderText = "已检数量";
-            this.oi_leveldefect.Name = "oi_leveldefect";
-            this.oi_leveldefect.Width = 75;
-            // 
-            // ois_remark
-            // 
-            this.ois_remark.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ois_remark.HeaderText = "";
-            this.ois_remark.Name = "ois_remark";
-            // 
-            // ois_status
-            // 
-            this.ois_status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ois_status.HeaderText = "";
-            this.ois_status.Name = "ois_status";
-            // 
-            // ois_id
-            // 
-            this.ois_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ois_id.DataPropertyName = "ois_id";
-            this.ois_id.HeaderText = "";
-            this.ois_id.Name = "ois_id";
-            this.ois_id.Visible = false;
-            // 
             // ChooseedReject
             // ChooseedReject
             // 
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
@@ -874,6 +819,62 @@
             this.obd_id.Name = "obd_id";
             this.obd_id.Name = "obd_id";
             this.obd_id.Visible = false;
             this.obd_id.Visible = false;
             // 
             // 
+            // choose
+            // 
+            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose.DataPropertyName = "choose";
+            this.choose.HeaderText = "勾选";
+            this.choose.Name = "choose";
+            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.choose.Width = 60;
+            // 
+            // oi_itemcode
+            // 
+            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_itemcode.DataPropertyName = "oi_checkkind";
+            this.oi_itemcode.HeaderText = "检验类型";
+            this.oi_itemcode.Name = "oi_itemcode";
+            // 
+            // oi_ng
+            // 
+            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_ng.DataPropertyName = "oi_count";
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle1;
+            this.oi_ng.HeaderText = "样本数量";
+            this.oi_ng.Name = "oi_ng";
+            this.oi_ng.Width = 96;
+            // 
+            // oi_leveldefect
+            // 
+            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
+            this.oi_leveldefect.HeaderText = "已检数量";
+            this.oi_leveldefect.Name = "oi_leveldefect";
+            this.oi_leveldefect.Width = 96;
+            // 
+            // ois_remark
+            // 
+            this.ois_remark.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.ois_remark.HeaderText = "";
+            this.ois_remark.Name = "ois_remark";
+            this.ois_remark.Width = 23;
+            // 
+            // ois_status
+            // 
+            this.ois_status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.ois_status.HeaderText = "";
+            this.ois_status.Name = "ois_status";
+            // 
+            // ois_id
+            // 
+            this.ois_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.ois_id.DataPropertyName = "ois_id";
+            this.ois_id.HeaderText = "";
+            this.ois_id.Name = "ois_id";
+            this.ois_id.Visible = false;
+            this.ois_id.Width = 80;
+            // 
             // OQC_SamplingDataCollection
             // OQC_SamplingDataCollection
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);

+ 37 - 21
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -26,6 +26,8 @@ namespace UAS_MES.OQC
 
 
         DataTable TempForBadGroup = new DataTable();
         DataTable TempForBadGroup = new DataTable();
 
 
+        string ErrorMessage = "";
+
         public OQC_SamplingDataCollection()
         public OQC_SamplingDataCollection()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -46,18 +48,24 @@ namespace UAS_MES.OQC
 
 
         private void GetBatch_Click(object sender, EventArgs e)
         private void GetBatch_Click(object sender, EventArgs e)
         {
         {
-            string ErrorMessage = "";
-            DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCDataCollection", out ErrorMessage);
-            if (ErrorMessage == "")
+            if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
             {
-                BaseUtil.SetFormValue(Controls, dt[0]);
-                if (ob_aqlcode.Text == "")
+                DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCDataCollection", out ErrorMessage);
+                if (ErrorMessage == "")
                 {
                 {
+                    BaseUtil.SetFormValue(Controls, dt[0]);
+                    if (ob_aqlcode.Text == "")
+                    {
 
 
+                    }
+                    dgvr.Clear();
                 }
                 }
-                dgvr.Clear();
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+            }
+            else
+            {
+                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
             }
             }
-            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
         }
         }
 
 
         private void Clean_Click(object sender, EventArgs e)
         private void Clean_Click(object sender, EventArgs e)
@@ -131,18 +139,30 @@ namespace UAS_MES.OQC
         private void GetBatchTypeGridData()
         private void GetBatchTypeGridData()
         {
         {
             dt = (DataTable)dh.ExecuteSql("select oi_checkkind,max(oi_sampleqty) oi_count,nvl(max(oi_checkqty),0) oi_checkedcount from OQCBatch  left join OQCItems on ob_checkno=oi_checkno  where oi_checkno='" + ob_checkno.Text + "' group by oi_checkkind ", "select");
             dt = (DataTable)dh.ExecuteSql("select oi_checkkind,max(oi_sampleqty) oi_count,nvl(max(oi_checkqty),0) oi_checkedcount from OQCBatch  left join OQCItems on ob_checkno=oi_checkno  where oi_checkno='" + ob_checkno.Text + "' group by oi_checkkind ", "select");
-            BaseUtil.FillExpandDgvWithDataTable(CheckTypeDGV, dt, true);
+            BaseUtil.FillExpandDgvWithDataTable(CheckTypeDGV, dt, true,true);
             if (CheckTypeDGV.Rows.Count == 0)
             if (CheckTypeDGV.Rows.Count == 0)
             {
             {
                 OperateResult.AppendText(">>请先维护抽样计划\n", Color.Red);
                 OperateResult.AppendText(">>请先维护抽样计划\n", Color.Red);
                 return;
                 return;
             }
             }
+            string checkkind = "";
+            for (int i = 0; i < CheckTypeDGV.Rows.Count; i++)
+            {
+                checkkind +=("'"+ CheckTypeDGV.Rows[i].Cells["oi_itemcode"].Value.ToString() + "',") ;
+            }
+            sql.Clear();
+            sql.Append("select 1 choose,oi_checkkind,ois_sncode,nvl(ois_id,0) ois_id ,oi_itemcode ,nvl(ois_ifng,0) oi_ng,nvl(ois_defectlevel,'-1')");
+            sql.Append("oi_leveldefect,ois_remark,case nvl(ois_id,0) when 0 then '未检验' else '已检验' end ois_status from OQCItems ");
+            sql.Append("left join OQCItemSamples on  ois_sncode='" + sncode.Text + "' and ois_checkno=oi_checkno and ");
+            sql.Append("ois_itemcode=oi_itemcode and ois_projectcode = oi_projectcode where oi_checkno ='" + ob_checkno.Text + "' ");
+            sql.Append("and oi_checkkind in (" + checkkind.Substring(0,checkkind.Length-1) + ")");
+            TempForCheckType = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             sql.Clear();
             sql.Clear();
             sql.Append("select bg_code,bg_name from product left join productkind ");
             sql.Append("select bg_code,bg_name from product left join productkind ");
-            sql.Append("on pr_kind=pk_code left join PRODUCTBADGROUP on pk_code= pb_kindcode ");
+            sql.Append("on pr_kind=pk_name left join PRODUCTBADGROUP on pk_code= pb_kindcode ");
             sql.Append("left join badgroup on  bg_code=pb_badgroup where pr_code='" + ob_prodcode.Text + "'");
             sql.Append("left join badgroup on  bg_code=pb_badgroup where pr_code='" + ob_prodcode.Text + "'");
             BadCode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BadCode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            BaseUtil.FillExpandDgvWithDataTable(WaitChooseDGV, BadCode, true);
+            BaseUtil.FillExpandDgvWithDataTable(WaitChooseDGV, BadCode, true,false);
         }
         }
 
 
         private void Confirm_Click(object sender, EventArgs e)
         private void Confirm_Click(object sender, EventArgs e)
@@ -177,7 +197,7 @@ namespace UAS_MES.OQC
                         //将布尔值转换为0,-1
                         //将布尔值转换为0,-1
                         if (TempForCheckType.Rows[i]["ois_id"].ToString() != "" && TempForCheckType.Rows[i]["ois_id"].ToString() != "0")
                         if (TempForCheckType.Rows[i]["ois_id"].ToString() != "" && TempForCheckType.Rows[i]["ois_id"].ToString() != "0")
                         {
                         {
-                            ois_ifng_update.Add(TempForCheckType.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
+                            ois_ifng_update.Add(TempForCheckType.Rows[i]["oi_ng"].ToString());
                             ois_defectlevel_update.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_defectlevel_update.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_remark_update.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
                             ois_remark_update.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
                             ois_id_update.Add(TempForCheckType.Rows[i]["ois_id"].ToString());
                             ois_id_update.Add(TempForCheckType.Rows[i]["ois_id"].ToString());
@@ -185,7 +205,7 @@ namespace UAS_MES.OQC
                         else
                         else
                         {
                         {
                             oi_itemcode_insert.Add(TempForCheckType.Rows[i]["oi_itemcode"].ToString());
                             oi_itemcode_insert.Add(TempForCheckType.Rows[i]["oi_itemcode"].ToString());
-                            ois_ifng_insert.Add(TempForCheckType.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
+                            ois_ifng_insert.Add(TempForCheckType.Rows[i]["oi_ng"].ToString());
                             ois_defectlevel_insert.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_defectlevel_insert.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_remark_insert.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
                             ois_remark_insert.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
                         }
                         }
@@ -194,12 +214,12 @@ namespace UAS_MES.OQC
                     bool AllPass = true;
                     bool AllPass = true;
                     for (int i = 0; i < ois_ifng_insert.Count; i++)
                     for (int i = 0; i < ois_ifng_insert.Count; i++)
                     {
                     {
-                        if (ois_ifng_insert[i] == "-1")
+                        if (ois_ifng_insert[i] != "0")
                             AllPass = false;
                             AllPass = false;
                     }
                     }
                     for (int i = 0; i < ois_ifng_update.Count; i++)
                     for (int i = 0; i < ois_ifng_update.Count; i++)
                     {
                     {
-                        if (ois_ifng_update[i] == "-1")
+                        if (ois_ifng_update[i] != "0")
                             AllPass = false;
                             AllPass = false;
                     }
                     }
                     if (ChoosedDGV.RowCount > 0 || AllPass)
                     if (ChoosedDGV.RowCount > 0 || AllPass)
@@ -358,13 +378,8 @@ namespace UAS_MES.OQC
             if (!dgvr.Contains(CheckTypeDGV.Rows[e.RowIndex]))
             if (!dgvr.Contains(CheckTypeDGV.Rows[e.RowIndex]))
             {
             {
                 string checkkind = CheckTypeDGV.Rows[e.RowIndex].Cells["oi_itemcode"].Value.ToString();
                 string checkkind = CheckTypeDGV.Rows[e.RowIndex].Cells["oi_itemcode"].Value.ToString();
-                sql.Clear();
-                sql.Append("select oi_checkkind,ois_sncode,nvl(ois_id,0) ois_id ,oi_itemcode ,nvl(ois_ifng,0) oi_ng,nvl(ois_defectlevel,'-1')");
-                sql.Append("oi_leveldefect,ois_remark,case nvl(ois_id,0) when 0 then '未检验' else '已检验' end ois_status from OQCItems ");
-                sql.Append("left join OQCItemSamples on  ois_sncode='" + sncode.Text + "' and ois_checkno=oi_checkno and ");
-                sql.Append("ois_itemcode=oi_itemcode and ois_projectcode = oi_projectcode where oi_checkno ='" + ob_checkno.Text + "' ");
-                sql.Append("and oi_checkkind='" + checkkind + "'");
-                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+
+                DataTable dt = BaseUtil.filterDataTable(TempForCheckType,"oi_checkkind='"+checkkind+"'");
                 DataGridViewRow headerRow = new DataGridViewRow();
                 DataGridViewRow headerRow = new DataGridViewRow();
 
 
                 DataGridViewTextBoxCell textcell = new DataGridViewTextBoxCell();
                 DataGridViewTextBoxCell textcell = new DataGridViewTextBoxCell();
@@ -409,6 +424,7 @@ namespace UAS_MES.OQC
                     dataRow.Tag = "SonRow";
                     dataRow.Tag = "SonRow";
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     checkcell.Tag = "SonRow";
                     checkcell.Tag = "SonRow";
+                    checkcell.Value=true;
                     dataRow.Cells.Add(checkcell);
                     dataRow.Cells.Add(checkcell);
 
 
                     textcell = new DataGridViewTextBoxCell();
                     textcell = new DataGridViewTextBoxCell();

+ 0 - 39
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.resx

@@ -258,24 +258,6 @@
   <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="or_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bc_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bg_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bg_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
@@ -306,27 +288,6 @@
   <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_itemcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_ng.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_leveldefect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <data name="ChooseedReject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="ChooseedReject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
         iVBORw0KGgoAAAANSUhEUgAAACUAAAAXCAYAAACMLIalAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
         iVBORw0KGgoAAAANSUhEUgAAACUAAAAXCAYAAACMLIalAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6

+ 39 - 37
UAS-MES/FunctionCode/Query/Query_ExeProgress.Designer.cs

@@ -57,9 +57,10 @@
             // 
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(10, 11);
+            this.sn_code_label.Location = new System.Drawing.Point(13, 14);
+            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
             this.sn_code_label.TabIndex = 183;
             this.sn_code_label.TabIndex = 183;
             this.sn_code_label.Text = "序列号";
             this.sn_code_label.Text = "序列号";
             // 
             // 
@@ -68,10 +69,10 @@
             this.SerialPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             this.SerialPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             | System.Windows.Forms.AnchorStyles.Right)));
             this.SerialPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.SerialPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.SerialPanel.Location = new System.Drawing.Point(14, 107);
-            this.SerialPanel.Margin = new System.Windows.Forms.Padding(2);
+            this.SerialPanel.Location = new System.Drawing.Point(19, 134);
+            this.SerialPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SerialPanel.Name = "SerialPanel";
             this.SerialPanel.Name = "SerialPanel";
-            this.SerialPanel.Size = new System.Drawing.Size(950, 254);
+            this.SerialPanel.Size = new System.Drawing.Size(1265, 316);
             this.SerialPanel.TabIndex = 194;
             this.SerialPanel.TabIndex = 194;
             this.SerialPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.SerialPanel_Paint);
             this.SerialPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.SerialPanel_Paint);
             // 
             // 
@@ -88,11 +89,11 @@
             this.mp_indate,
             this.mp_indate,
             this.ma_craftcode,
             this.ma_craftcode,
             this.ma_linecode});
             this.ma_linecode});
-            this.CraftInfDgv.Location = new System.Drawing.Point(0, 388);
-            this.CraftInfDgv.Margin = new System.Windows.Forms.Padding(2);
+            this.CraftInfDgv.Location = new System.Drawing.Point(0, 485);
+            this.CraftInfDgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CraftInfDgv.Name = "CraftInfDgv";
             this.CraftInfDgv.Name = "CraftInfDgv";
             this.CraftInfDgv.RowTemplate.Height = 27;
             this.CraftInfDgv.RowTemplate.Height = 27;
-            this.CraftInfDgv.Size = new System.Drawing.Size(975, 190);
+            this.CraftInfDgv.Size = new System.Drawing.Size(1300, 238);
             this.CraftInfDgv.TabIndex = 193;
             this.CraftInfDgv.TabIndex = 193;
             // 
             // 
             // groupBoxWithBorder1
             // groupBoxWithBorder1
@@ -107,9 +108,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.label2);
             this.groupBoxWithBorder1.Controls.Add(this.label2);
             this.groupBoxWithBorder1.Controls.Add(this.label3);
             this.groupBoxWithBorder1.Controls.Add(this.label3);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(12, 40);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(16, 50);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(953, 40);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1271, 50);
             this.groupBoxWithBorder1.TabIndex = 192;
             this.groupBoxWithBorder1.TabIndex = 192;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "颜色说明";
             this.groupBoxWithBorder1.Text = "颜色说明";
@@ -118,9 +121,10 @@
             // pictureBox2
             // pictureBox2
             // 
             // 
             this.pictureBox2.BackColor = System.Drawing.Color.Green;
             this.pictureBox2.BackColor = System.Drawing.Color.Green;
-            this.pictureBox2.Location = new System.Drawing.Point(99, 12);
+            this.pictureBox2.Location = new System.Drawing.Point(132, 15);
+            this.pictureBox2.Margin = new System.Windows.Forms.Padding(4);
             this.pictureBox2.Name = "pictureBox2";
             this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(60, 20);
+            this.pictureBox2.Size = new System.Drawing.Size(80, 25);
             this.pictureBox2.TabIndex = 187;
             this.pictureBox2.TabIndex = 187;
             this.pictureBox2.TabStop = false;
             this.pictureBox2.TabStop = false;
             // 
             // 
@@ -128,27 +132,30 @@
             // 
             // 
             this.label4.AutoSize = true;
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             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(648, 10);
+            this.label4.Location = new System.Drawing.Point(864, 12);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.Size = new System.Drawing.Size(92, 27);
             this.label4.TabIndex = 191;
             this.label4.TabIndex = 191;
             this.label4.Text = "尚未执行";
             this.label4.Text = "尚未执行";
             // 
             // 
             // pictureBox1
             // pictureBox1
             // 
             // 
             this.pictureBox1.BackColor = System.Drawing.Color.Red;
             this.pictureBox1.BackColor = System.Drawing.Color.Red;
-            this.pictureBox1.Location = new System.Drawing.Point(338, 12);
+            this.pictureBox1.Location = new System.Drawing.Point(451, 15);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
             this.pictureBox1.Name = "pictureBox1";
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(60, 20);
+            this.pictureBox1.Size = new System.Drawing.Size(80, 25);
             this.pictureBox1.TabIndex = 186;
             this.pictureBox1.TabIndex = 186;
             this.pictureBox1.TabStop = false;
             this.pictureBox1.TabStop = false;
             // 
             // 
             // pictureBox3
             // pictureBox3
             // 
             // 
             this.pictureBox3.BackColor = System.Drawing.Color.White;
             this.pictureBox3.BackColor = System.Drawing.Color.White;
-            this.pictureBox3.Location = new System.Drawing.Point(581, 12);
+            this.pictureBox3.Location = new System.Drawing.Point(775, 15);
+            this.pictureBox3.Margin = new System.Windows.Forms.Padding(4);
             this.pictureBox3.Name = "pictureBox3";
             this.pictureBox3.Name = "pictureBox3";
-            this.pictureBox3.Size = new System.Drawing.Size(60, 20);
+            this.pictureBox3.Size = new System.Drawing.Size(80, 25);
             this.pictureBox3.TabIndex = 190;
             this.pictureBox3.TabIndex = 190;
             this.pictureBox3.TabStop = false;
             this.pictureBox3.TabStop = false;
             // 
             // 
@@ -156,9 +163,10 @@
             // 
             // 
             this.label2.AutoSize = true;
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(166, 10);
+            this.label2.Location = new System.Drawing.Point(221, 12);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(122, 21);
+            this.label2.Size = new System.Drawing.Size(152, 27);
             this.label2.TabIndex = 188;
             this.label2.TabIndex = 188;
             this.label2.Text = "已执行且为良品";
             this.label2.Text = "已执行且为良品";
             // 
             // 
@@ -166,9 +174,10 @@
             // 
             // 
             this.label3.AutoSize = true;
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(405, 10);
+            this.label3.Location = new System.Drawing.Point(540, 12);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(138, 21);
+            this.label3.Size = new System.Drawing.Size(172, 27);
             this.label3.TabIndex = 189;
             this.label3.TabIndex = 189;
             this.label3.Text = "已执行且为不良品";
             this.label3.Text = "已执行且为不良品";
             // 
             // 
@@ -177,10 +186,11 @@
             this.sn_code.AllPower = null;
             this.sn_code.AllPower = null;
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(92, 13);
+            this.sn_code.Location = new System.Drawing.Point(123, 16);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
             this.sn_code.Name = "sn_code";
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(145, 21);
+            this.sn_code.Size = new System.Drawing.Size(192, 25);
             this.sn_code.Str = null;
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
             this.sn_code.Str2 = null;
@@ -191,19 +201,15 @@
             // mp_sncode
             // mp_sncode
             // 
             // 
             this.mp_sncode.DataPropertyName = "mp_sncode";
             this.mp_sncode.DataPropertyName = "mp_sncode";
-            this.mp_sncode.Frozen = true;
             this.mp_sncode.HeaderText = "序列号";
             this.mp_sncode.HeaderText = "序列号";
             this.mp_sncode.Name = "mp_sncode";
             this.mp_sncode.Name = "mp_sncode";
-            this.mp_sncode.ReadOnly = true;
             this.mp_sncode.Width = 120;
             this.mp_sncode.Width = 120;
             // 
             // 
             // mp_makecode
             // mp_makecode
             // 
             // 
             this.mp_makecode.DataPropertyName = "mp_makecode";
             this.mp_makecode.DataPropertyName = "mp_makecode";
-            this.mp_makecode.Frozen = true;
             this.mp_makecode.HeaderText = "工单代码";
             this.mp_makecode.HeaderText = "工单代码";
             this.mp_makecode.Name = "mp_makecode";
             this.mp_makecode.Name = "mp_makecode";
-            this.mp_makecode.ReadOnly = true;
             this.mp_makecode.Width = 120;
             this.mp_makecode.Width = 120;
             // 
             // 
             // ma_prodcode
             // ma_prodcode
@@ -211,7 +217,6 @@
             this.ma_prodcode.DataPropertyName = "ma_prodcode";
             this.ma_prodcode.DataPropertyName = "ma_prodcode";
             this.ma_prodcode.HeaderText = "产品代码";
             this.ma_prodcode.HeaderText = "产品代码";
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.ReadOnly = true;
             this.ma_prodcode.Width = 120;
             this.ma_prodcode.Width = 120;
             // 
             // 
             // mp_sourcecode
             // mp_sourcecode
@@ -219,7 +224,6 @@
             this.mp_sourcecode.DataPropertyName = "mp_sourcecode";
             this.mp_sourcecode.DataPropertyName = "mp_sourcecode";
             this.mp_sourcecode.HeaderText = "资源编号";
             this.mp_sourcecode.HeaderText = "资源编号";
             this.mp_sourcecode.Name = "mp_sourcecode";
             this.mp_sourcecode.Name = "mp_sourcecode";
-            this.mp_sourcecode.ReadOnly = true;
             this.mp_sourcecode.Width = 120;
             this.mp_sourcecode.Width = 120;
             // 
             // 
             // mp_indate
             // mp_indate
@@ -227,7 +231,6 @@
             this.mp_indate.DataPropertyName = "mp_indate";
             this.mp_indate.DataPropertyName = "mp_indate";
             this.mp_indate.HeaderText = "过站时间";
             this.mp_indate.HeaderText = "过站时间";
             this.mp_indate.Name = "mp_indate";
             this.mp_indate.Name = "mp_indate";
-            this.mp_indate.ReadOnly = true;
             this.mp_indate.Width = 120;
             this.mp_indate.Width = 120;
             // 
             // 
             // ma_craftcode
             // ma_craftcode
@@ -235,7 +238,6 @@
             this.ma_craftcode.DataPropertyName = "ma_craftcode";
             this.ma_craftcode.DataPropertyName = "ma_craftcode";
             this.ma_craftcode.HeaderText = "途程代码";
             this.ma_craftcode.HeaderText = "途程代码";
             this.ma_craftcode.Name = "ma_craftcode";
             this.ma_craftcode.Name = "ma_craftcode";
-            this.ma_craftcode.ReadOnly = true;
             this.ma_craftcode.Width = 120;
             this.ma_craftcode.Width = 120;
             // 
             // 
             // ma_linecode
             // ma_linecode
@@ -243,32 +245,32 @@
             this.ma_linecode.DataPropertyName = "ma_linecode";
             this.ma_linecode.DataPropertyName = "ma_linecode";
             this.ma_linecode.HeaderText = "产线";
             this.ma_linecode.HeaderText = "产线";
             this.ma_linecode.Name = "ma_linecode";
             this.ma_linecode.Name = "ma_linecode";
-            this.ma_linecode.ReadOnly = true;
             this.ma_linecode.Width = 120;
             this.ma_linecode.Width = 120;
             // 
             // 
             // Query_ExeProgress
             // Query_ExeProgress
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(975, 578);
+            this.ClientSize = new System.Drawing.Size(1300, 722);
             this.Controls.Add(this.SerialPanel);
             this.Controls.Add(this.SerialPanel);
             this.Controls.Add(this.CraftInfDgv);
             this.Controls.Add(this.CraftInfDgv);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code_label);
             this.Controls.Add(this.sn_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Query_ExeProgress";
             this.Name = "Query_ExeProgress";
             this.Tag = "Query!ExeProgress";
             this.Tag = "Query!ExeProgress";
             this.Text = "工单执行进度";
             this.Text = "工单执行进度";
             this.Load += new System.EventHandler(this.工单执行进度_Load);
             this.Load += new System.EventHandler(this.工单执行进度_Load);
             this.SizeChanged += new System.EventHandler(this.工单执行进度_SizeChanged);
             this.SizeChanged += new System.EventHandler(this.工单执行进度_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
             this.PerformLayout();
 
 
         }
         }

+ 6 - 3
UAS-MES/FunctionCode/Query/Query_ExeProgress.cs

@@ -28,6 +28,8 @@ namespace UAS_MES.Query
 
 
         DataTable dt;
         DataTable dt;
 
 
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
         public Query_ExeProgress()
         public Query_ExeProgress()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -38,11 +40,12 @@ namespace UAS_MES.Query
             dh = new DataHelper();
             dh = new DataHelper();
             ScreenWidth = this.Width;
             ScreenWidth = this.Width;
             ScreenHeight = this.Height;
             ScreenHeight = this.Height;
+            asc.controllInitializeSize(this);
         }
         }
 
 
         private void 工单执行进度_SizeChanged(object sender, EventArgs e)
         private void 工单执行进度_SizeChanged(object sender, EventArgs e)
         {
         {
-
+            asc.controlAutoSize(this);
         }
         }
 
 
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
@@ -58,8 +61,8 @@ namespace UAS_MES.Query
                 }
                 }
                 //查询执行过的步骤
                 //查询执行过的步骤
                 sql.Clear();
                 sql.Clear();
-                sql.Append("select CD_DETNO, CD_STEPCODE from craft left join craftdetail  on cd_crid = cr_id where ");
-                sql.Append("cr_code=(select ms_craftcode from makeserial where ms_sncode='" + sn_code.Text + "') order by cd_detno");
+                sql.Append("select CD_DETNO,CD_STEPCODE from craft left join craftdetail  on cd_crid = cr_id  left join makeserial ");
+                sql.Append("on ms_craftcode=cr_code and ms_prodcode=cr_prodcode where ms_sncode='"+sn_code.Text+"'");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 Step = new Dictionary<int, string>();
                 Step = new Dictionary<int, string>();
                 PastStep = dh.getFieldDataByCondition("makeserial", "ms_paststep", "ms_sncode='" + sn_code.Text + "'").ToString();
                 PastStep = dh.getFieldDataByCondition("makeserial", "ms_paststep", "ms_sncode='" + sn_code.Text + "'").ToString();

+ 2 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -622,7 +622,7 @@ namespace UAS_MES.PublicMethod
         /// <param name="dgv"></param>
         /// <param name="dgv"></param>
         /// <param name="dt"></param>
         /// <param name="dt"></param>
         /// <param name="CheckBox"></param>
         /// <param name="CheckBox"></param>
-        public static void FillExpandDgvWithDataTable(DataGridViewExpand dgv, DataTable dt, bool CheckBox)
+        public static void FillExpandDgvWithDataTable(DataGridViewExpand dgv, DataTable dt, bool CheckBox,bool CheckBoxTrue)
         {
         {
             CleanDGVData(dgv);
             CleanDGVData(dgv);
             if (CheckBox)
             if (CheckBox)
@@ -633,6 +633,7 @@ namespace UAS_MES.PublicMethod
                     collapseRow.IsCollapse = true;
                     collapseRow.IsCollapse = true;
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     collapseRow.Cells.Add(checkcell);
                     collapseRow.Cells.Add(checkcell);
+                    checkcell.Value = CheckBoxTrue;
                     //因为DGV中可能有空置的列多出,所以需要用DataTable的列进行循环
                     //因为DGV中可能有空置的列多出,所以需要用DataTable的列进行循环
                     for (int j = 0; j < dt.Columns.Count; j++)
                     for (int j = 0; j < dt.Columns.Count; j++)
                     {
                     {