|
@@ -472,6 +472,23 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ if (OutBoxNum.Text == "新增")
|
|
|
+ {
|
|
|
+ string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
+ //如果没有则从开始插入
|
|
|
+ if (maxoutbox == "")
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = OutBoxNum.Text;
|
|
|
+ }
|
|
|
if (BoxNum + CodeCount > OutboxCapacity.Value)
|
|
|
{
|
|
|
string close = MessageBox.Show(this.ParentForm, "箱号【" + OutBoxNum.Text + "】后超数量为" + (BoxNum + CodeCount) + ",超出容量" + OutboxCapacity.Value + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
@@ -552,6 +569,26 @@ namespace UAS_LabelMachine
|
|
|
MessageBox.Show("未成功插入数据,请核对出货单当前明细", "提示");
|
|
|
}
|
|
|
//更新流水号
|
|
|
+ if (!ConnectToMachine)
|
|
|
+ {
|
|
|
+ if (OutBoxNum.Text == "新增")
|
|
|
+ {
|
|
|
+ OutBoxNum.Items.Clear();
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
|
|
|
+ ItemObject io = new ItemObject("新增", "新增");
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ io = new ItemObject("全部", "全部");
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
|
|
|
+ io = new ItemObject(piboutboxcode2, piboutboxcode2);
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ }
|
|
|
+ if (OutBoxNum.Items.Count > 2)
|
|
|
+ OutBoxNum.SelectedIndex = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
LoadGridData(new object(), new EventArgs());
|
|
|
if (LabelInf.Rows.Count > 0)
|
|
|
{
|
|
@@ -631,24 +668,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
GridPrcode.Refresh();
|
|
|
- Input.Clear();
|
|
|
- //if (OutBoxNum.Text == "新增")
|
|
|
- //{
|
|
|
- // OutBoxNum.Items.Clear();
|
|
|
- // DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
|
|
|
- // ItemObject io = new ItemObject("新增", "新增");
|
|
|
- // OutBoxNum.Items.Add(io);
|
|
|
- // io = new ItemObject("全部", "全部");
|
|
|
- // OutBoxNum.Items.Add(io);
|
|
|
- // for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
- // {
|
|
|
- // string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
|
|
|
- // io = new ItemObject(piboutboxcode2, piboutboxcode2);
|
|
|
- // OutBoxNum.Items.Add(io);
|
|
|
- // }
|
|
|
- // if (OutBoxNum.Items.Count > 2)
|
|
|
- // OutBoxNum.SelectedIndex = 2;
|
|
|
- //}
|
|
|
+ if (!IsSum)
|
|
|
+ Input.Clear();
|
|
|
}
|
|
|
|
|
|
private void AutoPrintSingleLabel()
|
|
@@ -678,7 +699,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
sql.Clear();
|
|
|
sql.Append("select * from (select to_char(pi_date,'yyiw')出库年周,to_char(sysdate,'yyiw')当前DateCode,pi_remark 单据备注,pi_date-1 出库前一天,pib_outboxcode2 外箱号,pd_orderdetno 订单序号,pib_totalweight 总重,pr_ywmc_user 英文名称,pib_boxweight 箱重,nvl(pib_totalweight,0)-nvl(pib_boxweight,0) 净重,pib_id 主键ID,pd_pdno 出货序号,pib_prodcode 物料编号,pr_detail 物料名称,to_char(pi_date,'yyyy-mm-dd') 送达日期,pd_custprodspec 客户型号,pd_custproddetail 客户物料名称,pi_title 客户全称,cu_shortname 客户简称,pr_spec 物料规格,pib_custbarcode 客户条码,pib_custmidboxcode 中盒条码,pib_custoutboxcode 外箱条码,pib_inoutno 出货单号,");
|
|
@@ -701,7 +721,6 @@ namespace UAS_LabelMachine
|
|
|
sql.Append("and pc_custprodcode=pd_custprodcode left join WareHouse on wh_code=pd_whcode left join employee on em_code=pib_inman where pib_id='" + pibid + "' order by pib_custbarcode)prodiosingleinfo_view");
|
|
|
}
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
-
|
|
|
SingleReport.RegisterData(dt, "prodiosingleinfo_view");
|
|
|
SingleReport.GetDataSource("prodiosingleinfo_view").Enabled = true;
|
|
|
SingleReport.PrintSettings.ShowDialog = false;
|
|
@@ -2624,6 +2643,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ bool IsSum = false;
|
|
|
+
|
|
|
private void receive_message()
|
|
|
{
|
|
|
while (IsOnline(receiveClient))
|
|
@@ -2639,10 +2660,18 @@ namespace UAS_LabelMachine
|
|
|
if (getMsg.Contains("ReadId"))
|
|
|
{
|
|
|
string msgStr = getMsg.Trim('\0').Replace("ReadId1|,|", "");
|
|
|
- msgStr = Regex.Match(msgStr, @"[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+").Value;
|
|
|
- //设置索引和内容
|
|
|
- // msgStr = msgStr.Split(ps_split.ToCharArray()[0])[dataindex];
|
|
|
- Input.Text = msgStr;
|
|
|
+ if (!msgStr.Contains("三星"))
|
|
|
+ {
|
|
|
+ msgStr = Regex.Match(msgStr, @"[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+").Value;
|
|
|
+ //设置索引和内容
|
|
|
+ // msgStr = msgStr.Split(ps_split.ToCharArray()[0])[dataindex];
|
|
|
+ Input.Text = msgStr;
|
|
|
+ IsSum = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ IsSum = true;
|
|
|
+ }
|
|
|
Input_KeyDown(Input, new KeyEventArgs(Keys.Enter));
|
|
|
}
|
|
|
//}
|