浏览代码

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

caosy 5 年之前
父节点
当前提交
12e32f93c0

+ 9 - 2
UAS_MES_MAXMADE/CustomControl/TextBoxWithIcon/BlurSearch.cs

@@ -146,7 +146,7 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
                     }
                     //每次数据查询之后将索引重置
                     ItemSelectIndex = 0;
-                    ListBox.Height = ListBox.ItemHeight  *10;
+                    ListBox.Height = ListBox.ItemHeight * 10;
                     ListBox.Visible = true;
                     Height = ListBox.Height + EnterTextBox.Height;
                 }
@@ -228,11 +228,18 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
                 ListBox.Visible = true;
                 Height = ListBox.Height + EnterTextBox.Height;
             }
+            if (ListBox.Items.Count == 1)
+            {
+                value = dt.Rows[0][1].ToString();
+                EnterTextBox.Text = dt.Rows[0][0].ToString();
+                ListBox.Visible = false;
+                Height = EnterTextBox.Height;
+            }
         }
 
         private void EnterTextBox_Leave(object sender, EventArgs e)
         {
-            //ListBox.Visible = false;
+
         }
 
         private void BlurSearch_Leave(object sender, EventArgs e)

+ 15 - 15
UAS_MES_MAXMADE/FunctionCode/Make/Make_Repair.cs

@@ -80,24 +80,24 @@ namespace UAS_MES_NEW.Make
             bd_soncode.DbChange += Prodcode_DbChange;
 
             //nrg_name.BringToFront();
-            nrg_name.TableName = "(select nrg_name,nrg_code from QUA_NGREASONGROUP left join DATAINPUTRECORD ON NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
+            nrg_name.TableName = "(select nrg_name,nrg_code,nrg_wccode from QUA_NGREASONGROUP left join DATAINPUTRECORD ON NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
             nrg_name.Field = "nrg_name";
             nrg_name.ValueField = "nrg_code";
-            nrg_name.Condition = " 1=1 ORDER BY ROWNUM asc";
+            nrg_name.Condition = " 1=1 and nrg_wccode='" + User.WorkCenter + "' ORDER BY ROWNUM asc";
 
             nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and  DIR_SOURCECODE = '" + User.UserSourceCode + "' ";
             nr_name.Field = "nr_name";
             nr_name.ValueField = "nr_code";
 
-            mbr_dutyname.TableName = "(select nd_name,nd_code from  ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT  AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC) ";
+            mbr_dutyname.TableName = "(select nd_name,nd_code,nd_wccode from  ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT  AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC) ";
             mbr_dutyname.Field = "nd_name";
             mbr_dutyname.ValueField = "nd_code";
-            mbr_dutyname.Condition = " 1=1 ORDER BY ROWNUM asc";
+            mbr_dutyname.Condition = " 1=1 and nd_wccode='" + User.WorkCenter + "' ORDER BY ROWNUM asc";
 
-            so_name.TableName = "(select so_name,so_code from solution left join DATAINPUTRECORD ON so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
+            so_name.TableName = "(select so_name,so_code,so_wccode from solution left join DATAINPUTRECORD ON so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "'  ORDER BY NVL(DIR_NUMBER,0) DESC)";
             so_name.Field = "so_name";
             so_name.ValueField = "so_code";
-            so_name.Condition = " 1=1 ORDER BY ROWNUM asc";
+            so_name.Condition = " 1=1 and so_wccode='" + User.WorkCenter + "' ORDER BY ROWNUM asc";
 
             asc.controllInitializeSize(this);
             mbc_component.SendToBack();
@@ -504,14 +504,14 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             //如果岗位资源对应工序的版面不为空的时候
-           /* if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid + "'").ToString() != "")
-            {
-                if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='" + ms_makecode.Text + "' and mbl_sncode='" + GetSNCode.Text + "' "))
-                {
-                    OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
-                    return;
-                }
-            }*/
+            /* if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid + "'").ToString() != "")
+             {
+                 if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='" + ms_makecode.Text + "' and mbl_sncode='" + GetSNCode.Text + "' "))
+                 {
+                     OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
+                     return;
+                 }
+             }*/
             //查询拆解的物料
             sql.Clear();
             sql.Append("select distinct cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
@@ -715,7 +715,7 @@ namespace UAS_MES_NEW.Make
             dh.ExecuteSql("merge into DATAINPUTRECORD using (select nr_name  from QUA_NGReason left join QUA_NGREASONGROUPDET on nrgd_nrcode=nr_code left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id where nr_name = '" + nr_name.Text + "' and NRG_NAME = '" + nrg_name.Text + "') ON (nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nr_name,1,'" + User.UserSourceCode + "','不良原因')", "select");
             dh.ExecuteSql("merge into DATAINPUTRECORD using (select nd_name  from ngduty where nd_name = '" + mbr_dutyname.Text + "') ON (nd_name = DIR_COMMENT AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nd_name,1,'" + User.UserSourceCode + "','责任别')", "select");
             dh.ExecuteSql("merge into DATAINPUTRECORD using (select so_name  from solution where so_name = '" + so_name.Text + "') ON (so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (so_name,1,'" + User.UserSourceCode + "','解决方案')", "select");
-            
+
             //保存不良原因
             sql.Clear();
             sql.Append("insert into makebadreason (mbr_mbid,mbr_id,mbr_brcode,mbr_solutioncode,");