Browse Source

显示索引BUG调整

callm 5 years ago
parent
commit
8a3544f4ab
1 changed files with 5 additions and 7 deletions
  1. 5 7
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

+ 5 - 7
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -965,7 +965,7 @@ namespace UAS_LabelMachine
             {
                 CurrentPage = 1;
                 sql.Clear();
-                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_pdastatus='已捡料'");
+                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_pdastatus in('已捡料','已复核')");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -2297,12 +2297,10 @@ namespace UAS_LabelMachine
             if (datecode != "")
             {
                 sql += " and (pib_datecode='' or pib_datecode is null) ";
-                PrintSQL += " and (pib_datecode='' or pib_datecode is null) ";
             }
             if (lotno != "")
             {
                 sql += " and (pib_lotno='' or pib_lotno is null) ";
-                PrintSQL += " and (pib_lotno='' or pib_lotno is null) ";
             }
             if (nums == "")
             {
@@ -2369,10 +2367,10 @@ namespace UAS_LabelMachine
                 //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
                 //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
             }
-            else if (CurrentRowNum - 1 > 0)
+            else if (CurrentRowNum - 1 >= 0)
             {
                 //获取上一行的数据
-                DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
+                DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum == 1 ? 1 : CurrentRowNum - 1), "select");
                 //string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
                 //if (custmidboxcode == "")
                 //{
@@ -2453,10 +2451,10 @@ namespace UAS_LabelMachine
                 //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
                 //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
             }
-            else if (CurrentRowNum - 1 > 0)
+            else if (CurrentRowNum - 1 >= 0)
             {
                 //获取上一行数据
-                DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
+                DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum == 1 ? 1 : CurrentRowNum - 1), "select");
                 //string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
                 //if (custoutboxcode == "")
                 //{