|
|
@@ -134,8 +134,6 @@ namespace UAS_LabelMachine
|
|
|
ArrayList<ArrayList<string>> ScanData;
|
|
|
ArrayList<string> GetData;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public UAS_出货标签打印()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
@@ -188,29 +186,34 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
CollectionUnit.Text = "盘";
|
|
|
Point pt = new Point();
|
|
|
- int ScreenWidth = Screen.GetWorkingArea(pt).Width;
|
|
|
- //如果分辨率大的设置的字体对应的变大
|
|
|
- if (ScreenWidth > 1366)
|
|
|
+ //禁止所有列的排序
|
|
|
+ foreach (DataGridViewColumn dgv in LabelInf.Columns)
|
|
|
{
|
|
|
- foreach (Control ctl in Controls)
|
|
|
- {
|
|
|
- if (ctl is CheckBox || ctl is Label || ctl is RadioButton)
|
|
|
- {
|
|
|
- ctl.Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
- }
|
|
|
- if (ctl is GroupBoxWithBorder)
|
|
|
- {
|
|
|
- GroupBoxWithBorder gb = ctl as GroupBoxWithBorder;
|
|
|
- for (int i = 0; i < gb.Controls.Count; i++)
|
|
|
- {
|
|
|
- if (gb.Controls[i] is CheckBox || gb.Controls[i] is Label || gb.Controls[i] is RadioButton)
|
|
|
- {
|
|
|
- gb.Controls[i].Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ dgv.SortMode = DataGridViewColumnSortMode.NotSortable;
|
|
|
}
|
|
|
+ int ScreenWidth = Screen.GetWorkingArea(pt).Width;
|
|
|
+ //如果分辨率大的设置的字体对应的变大
|
|
|
+ //if (ScreenWidth > 1366)
|
|
|
+ //{
|
|
|
+ // foreach (Control ctl in Controls)
|
|
|
+ // {
|
|
|
+ // if (ctl is CheckBox || ctl is Label || ctl is RadioButton)
|
|
|
+ // {
|
|
|
+ // ctl.Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
+ // }
|
|
|
+ // if (ctl is GroupBoxWithBorder)
|
|
|
+ // {
|
|
|
+ // GroupBoxWithBorder gb = ctl as GroupBoxWithBorder;
|
|
|
+ // for (int i = 0; i < gb.Controls.Count; i++)
|
|
|
+ // {
|
|
|
+ // if (gb.Controls[i] is CheckBox || gb.Controls[i] is Label || gb.Controls[i] is RadioButton)
|
|
|
+ // {
|
|
|
+ // gb.Controls[i].Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
//设置获取当前屏幕大小自动全屏但是保留任务栏
|
|
|
Rectangle ScreenArea = Screen.GetWorkingArea(this);
|
|
|
Top = 0;
|
|
|
@@ -1119,6 +1122,25 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void SingleBoxPrint()
|
|
|
{
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (SingleDoc.Variables.FreeVariables.Count == 0) { }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ MessageBox.Show("单盘标签未维护参数");
|
|
|
+ }
|
|
|
+ if (MidLabelAutoPrint.Checked)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (MidDoc.Variables.FreeVariables.Count == 0) { }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ MessageBox.Show("中盘标签未维护参数");
|
|
|
+ }
|
|
|
+ }
|
|
|
string la_id = SingleLabelCombox.SelectedValue.ToString().Split('#')[0];
|
|
|
string cl_labelname = SingleLabelCombox.Text;
|
|
|
string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
|
|
|
@@ -1149,10 +1171,10 @@ namespace UAS_LabelMachine
|
|
|
return;
|
|
|
}
|
|
|
//打印的时候如果不存在数据开始缓存
|
|
|
- if (MidBoxCacheData.Rows.Count == 0)
|
|
|
- GetMidBoxData();
|
|
|
if (SingleBoxCacheData.Rows.Count == 0)
|
|
|
GetSingleBoxData();
|
|
|
+ if (MidBoxCacheData.Rows.Count == 0)
|
|
|
+ GetMidBoxData();
|
|
|
for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
{
|
|
|
if (i + 1 < LabelInf.RowCount)
|
|
|
@@ -1207,13 +1229,14 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (arg.Contains(SingleDoc.Variables.FreeVariables.Item(j + 1).Name))
|
|
|
SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][SingleDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
|
|
|
- ParamLog.AppendLine("打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
|
|
|
+ ParamLog.AppendLine("pib_id:" + LabelInf.Rows[i].Cells["pib_id1"].Value.ToString() + ",SingleDoc打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
|
|
|
}
|
|
|
LogManager.DoLog(ParamLog.ToString());
|
|
|
//保存参数打印
|
|
|
SingleDoc.Save();
|
|
|
SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
SingleDoc.PrintDocument();
|
|
|
+ dh.ExecuteSql("update prodiobarcode set pib_printdate=sysdate where pib_id=:pib_id","select",pib_id);
|
|
|
//勾选为已打印
|
|
|
LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
|
|
|
}
|
|
|
@@ -1304,7 +1327,7 @@ namespace UAS_LabelMachine
|
|
|
string sql = dt.Rows[k]["lp_sql"].ToString();
|
|
|
sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
- DataTable temp = dh.getFieldsDatasByCondition(sql + " in " + pib_id_string.ToString());
|
|
|
+ DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in " + pib_id_string.ToString() + " ORDER by pib_id");
|
|
|
temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
AllSingleBoxCacheData.Add(temp);
|
|
|
}
|
|
|
@@ -1320,7 +1343,7 @@ namespace UAS_LabelMachine
|
|
|
//由于之前加了一个ID列,导致j从1开始
|
|
|
for (int j = 1; j < SingleBoxCacheData.Columns.Count; j++)
|
|
|
{
|
|
|
- dr[Temp[j - 1].Columns[0].ColumnName] = Temp[j - 1].Rows[i][0].ToString();
|
|
|
+ dr[Temp[j - 1].Columns[0].ColumnName] = (Temp[j - 1].Select("PIBID=" + pib_id_arr[i]))[0][0];
|
|
|
}
|
|
|
SingleBoxCacheData.Rows.Add(dr);
|
|
|
}
|
|
|
@@ -1393,13 +1416,13 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
sql = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
|
|
|
sql = sql.Substring(0, sql.LastIndexOf("=")) + " in " + pib_qtycondition_string.ToString() + sql.Substring(sql.LastIndexOf("}") + 1);
|
|
|
- Console.WriteLine(sql);
|
|
|
+ sql = "select * from (" + sql + ") order by instr ('" + pib_qtycondition_string.ToString() + "',pib_outboxcode1)";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
- sql = sql + " in " + pib_condition_string.ToString();
|
|
|
+ sql = sql + " in " + pib_condition_string.ToString() + " order by instr('" + pib_condition_string.ToString() + "',pib_id)";
|
|
|
}
|
|
|
DataTable temp = dh.getFieldsDatasByCondition(sql);
|
|
|
temp.Columns[0].ColumnName = MidDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
@@ -1418,9 +1441,7 @@ namespace UAS_LabelMachine
|
|
|
dr["pib_outboxcode1"] = pib_outbox_arr[i];
|
|
|
//由于之前加了一个ID列和箱号,导致j从2开始
|
|
|
for (int j = 2; j < MidBoxCacheData.Columns.Count; j++)
|
|
|
- {
|
|
|
dr[Temp[j - 2].Columns[0].ColumnName] = Temp[j - 2].Rows[i][0].ToString();
|
|
|
- }
|
|
|
MidBoxCacheData.Rows.Add(dr);
|
|
|
}
|
|
|
}
|
|
|
@@ -1587,7 +1608,6 @@ namespace UAS_LabelMachine
|
|
|
else
|
|
|
{
|
|
|
DataRow[] dr = MidBoxCacheData.Select("pib_outboxcode1='" + pib_outboxcode1 + "'");
|
|
|
- Console.WriteLine(pib_outboxcode1);
|
|
|
if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode1"))
|
|
|
{
|
|
|
if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
|