|
|
@@ -54,7 +54,6 @@ namespace UAS_LabelMachine
|
|
|
object[] ItemData;
|
|
|
|
|
|
Dictionary<string, string> CollectData;
|
|
|
- Dictionary<string, string> MidIDAndOutboxcode = new Dictionary<string, string>();
|
|
|
/// <summary>
|
|
|
/// 全部采集
|
|
|
/// </summary>
|
|
|
@@ -70,14 +69,6 @@ namespace UAS_LabelMachine
|
|
|
ArrayList<ArrayList<string>> ScanData;
|
|
|
ArrayList<string> GetData;
|
|
|
|
|
|
- List<string> SingleParam = new List<string>();
|
|
|
-
|
|
|
- List<string> MidParam = new List<string>();
|
|
|
-
|
|
|
- List<string> OutParam = new List<string>();
|
|
|
-
|
|
|
- DataTable Attach;
|
|
|
-
|
|
|
public UAS_出货标签打印(string Master)
|
|
|
{
|
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
@@ -178,6 +169,7 @@ namespace UAS_LabelMachine
|
|
|
private void CollectionSetting_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
采集策略 form = new 采集策略(sg_code.Text);
|
|
|
+ form.WindowState = FormWindowState.Maximized;
|
|
|
form.FormClosed += sg_code_UserControlTextChanged;
|
|
|
BaseUtil.SetFormCenter(form);
|
|
|
form.ShowDialog();
|
|
|
@@ -465,7 +457,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
//提醒用户需要采集的数据
|
|
|
RemindUser();
|
|
|
- RefreshProcessData();
|
|
|
MessageLog.AppendText(">>扫描到数据" + Input.Text + "\n", Color.Blue);
|
|
|
//如果所采集的行的物料不一样的话,重新计算箱内容量
|
|
|
if (CurrentRowIndex - 1 > 0)
|
|
|
@@ -787,10 +778,6 @@ namespace UAS_LabelMachine
|
|
|
dh.CallProcedure("GetCustBarcode", param);
|
|
|
}
|
|
|
LoadGridData(sender, e);
|
|
|
- //重新输入单号后清除缓存
|
|
|
- MidIDAndOutboxcode.Clear();
|
|
|
- //刷新采集进度
|
|
|
- RefreshProcessData();
|
|
|
//设置当前的最大箱号
|
|
|
CurrentItemIndex = 0;
|
|
|
LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
|
|
|
@@ -817,48 +804,12 @@ namespace UAS_LabelMachine
|
|
|
dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
|
|
|
MessageBox.Show("删除成功");
|
|
|
LoadGridData(sender, e);
|
|
|
- RefreshProcessData();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
MessageBox.Show("尚未勾选需要删除的明细");
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 刷新采集进度
|
|
|
- /// </summary>
|
|
|
- private void RefreshProcessData()
|
|
|
- {
|
|
|
- if (LabelInf.Rows.Count > 0)
|
|
|
- {
|
|
|
- //设置初始化的采集进度
|
|
|
- int Count = 0;
|
|
|
- int CurrentMidBoxCollectedCount = 0;
|
|
|
- //当前盒号的总盘数
|
|
|
- int CurrentMidBoxTotalCount = 0;
|
|
|
- //未超出当前范围的时候
|
|
|
- for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
|
|
|
- Count++;
|
|
|
- //和当前编辑箱号相等行
|
|
|
- if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True" && LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
- CurrentMidBoxCollectedCount++;
|
|
|
- //当前盒号一共有几盘
|
|
|
- if (LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
- CurrentMidBoxTotalCount++;
|
|
|
- }
|
|
|
- Capacity.Text = "可装" + CurrentMidBoxTotalCount + "盘";
|
|
|
- Installed.Text = "已装" + CurrentMidBoxCollectedCount + "盘";
|
|
|
- //设置当前的箱号和盒号
|
|
|
- Process_outboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value.ToString();
|
|
|
- Process_midboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
- //设置当前总数和已采集数量
|
|
|
- TotalCount.Text = LabelInf.RowCount.ToString();
|
|
|
- CollectedCount.Text = Count.ToString();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void LoadGridData()
|
|
|
{
|
|
|
LoadGridData(new object(), new EventArgs());
|
|
|
@@ -877,7 +828,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Append("pib_lotno,pib_datecode,pib_qty,pr_spec,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint");
|
|
|
sql.Append(" from prodiobarcode left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
|
|
|
sql.Append(" pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode ");
|
|
|
- sql.Append("where pib_piid='" + PI_ID + "' order by to_number(pib_outboxcode1),pib_id,pd_prodcode");
|
|
|
+ sql.Append("where pib_piid='" + PI_ID + "' order by pd_detno");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
MidSource.DataSource = dt;
|
|
|
BaseUtil.FillDgvWithDataTable(LabelInf, (DataTable)MidSource.DataSource);
|
|
|
@@ -997,36 +948,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 勾选的时候自动打印
|
|
|
- /// </summary>
|
|
|
- /// <param name="sender"></param>
|
|
|
- /// <param name="e"></param>
|
|
|
- private void LabelInf_CellValueChanged(object sender, DataGridViewCellEventArgs e)
|
|
|
- {
|
|
|
- if (e.RowIndex >= 0)
|
|
|
- {
|
|
|
- if (!(DataHelper.DBConnectionString.Contains("richwell") || DataHelper.DBConnectionString.Contains("192.168.0.88")))
|
|
|
- {
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
|
|
|
- {
|
|
|
- string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
|
|
|
- GregorianCalendar gc = new GregorianCalendar();
|
|
|
- int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
|
|
|
- if (weekOfYear < 10)
|
|
|
- LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
|
|
|
- else
|
|
|
- LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
|
|
|
- }
|
|
|
- catch (Exception) { }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void AllCollected_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
if (AllCollect == false)
|
|
|
@@ -1076,28 +997,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void LabelInf_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
|
|
- {
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "盒")
|
|
|
- {
|
|
|
- string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
|
|
|
- string midbox = LabelInf.Rows[e.RowIndex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
- {
|
|
|
- if (midbox == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
- LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
- }
|
|
|
- }
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "全部")
|
|
|
- {
|
|
|
- string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
- {
|
|
|
- LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void ExportData_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
ExportFileDialog.Description = "选择导出的路径";
|
|
|
@@ -1144,34 +1043,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void AttachInfo_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- if (cu_code.Text != "")
|
|
|
- {
|
|
|
- 附件内容打印 att = new 附件内容打印(cu_code.Text);
|
|
|
- att.ShowDialog();
|
|
|
- }
|
|
|
- else MessageBox.Show("请先获取出库单信息");
|
|
|
- }
|
|
|
-
|
|
|
- private void MidBoxCapacity_Leave(object sender, EventArgs e)
|
|
|
- {
|
|
|
- NumericUpDown nup = (NumericUpDown)sender;
|
|
|
- switch (nup.Name)
|
|
|
- {
|
|
|
- case "MidBoxCapacity":
|
|
|
- Properties.Settings.Default.MidBoxCapacity = nup.Value;
|
|
|
- Properties.Settings.Default.Save();
|
|
|
- break;
|
|
|
- case "OutboxCapacity":
|
|
|
- Properties.Settings.Default.OutboxCapacity = nup.Value;
|
|
|
- Properties.Settings.Default.Save();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void RefreshDBConnect_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
dh.ExecuteSql("select sysdate from dual", "select");
|