From 85170f9ab975d8e2dccbbf97f8f4dc7bbf4fafaa Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 24 五月 2024 15:50:34 +0800
Subject: [PATCH] 2.自动组托界面: (已完成)初始化页面时,若当前托条码存在组托记录,则取第一个子条码中的物料获取组托数量。 同时记录条码中的源单主ID、子ID (已完成)扫描子条码时,判断当前子条码是否是第一个,如果是的话,根据条码中的物料获取组托数量。 同时记录条码中的源单主ID、子ID (已完成)自动组托时,组托完成后,将组托数量清空。 同时清空记录的源单主ID、子ID
---
WarM/条码打印/Gy_PackBarCodeBill_automaticallyByPLC.cs | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 110 insertions(+), 6 deletions(-)
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_PackBarCodeBill_automaticallyByPLC.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_PackBarCodeBill_automaticallyByPLC.cs"
index a53a36e..6628701 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_PackBarCodeBill_automaticallyByPLC.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_PackBarCodeBill_automaticallyByPLC.cs"
@@ -72,6 +72,10 @@
public bool grdStatus;
public int selectRow = 0;
+ //璁板綍褰撳墠缁勬墭鐨勬潯鐮佺殑婧愬崟ID銆佸瓙ID锛岀敤浜庝繚璇佸綋鍓嶆墭涓墍鏈夊瓙鏉$爜涓哄悓涓�涓伐鍗曠敓鎴�
+ public int HSourceInterID_ICMO = 0;
+ public int HSourceEntryID_ICMO = 0;
+
private void Gy_PackBarCodeBill_automaticallyByPLC_Load(object sender, EventArgs e)
{
//鍔犺浇缁勭粐淇℃伅
@@ -181,6 +185,11 @@
DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
getDisplay_GrdMain();
+
+ if (grdMain.Rows.Count > 0 && grdMain.Rows[0].Cells[4].Value!=null)
+ {
+ getPackQty(grdMain.Rows[0].Cells[4].Value.ToString());
+ }
}
@@ -355,7 +364,11 @@
return;
}
this.Sub_SaveBill();
- }catch(Exception ex)
+
+ //缁勬墭鎴愬姛鍚庯紝娓呯┖缁勬墭鏁伴噺涓庢簮鍗曚俊鎭�
+ set_clearPackQtyAndSourceInfo();
+ }
+ catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
@@ -364,11 +377,11 @@
//鑷姩缁勬墭
private void button_startListen_Click(object sender, EventArgs e)
{
- if (DBUtility.ClsPub.isLong(textBox_PackQty.Text) == 0)
- {
- MessageBox.Show("璇疯缃墭鏉$爜鐨勬渶灏忓寘瑁呮暟锛�");
- return;
- }
+ //if (DBUtility.ClsPub.isLong(textBox_PackQty.Text) == 0)
+ //{
+ // MessageBox.Show("璇疯缃墭鏉$爜鐨勬渶灏忓寘瑁呮暟锛�");
+ // return;
+ //}
isStartListen = 1;
@@ -432,6 +445,9 @@
Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
}
Report.Print(false);
+
+ //缁勬墭鎴愬姛鍚庯紝娓呯┖缁勬墭鏁伴噺涓庢簮鍗曚俊鎭�
+ set_clearPackQtyAndSourceInfo();
}
}catch(Exception ex)
{
@@ -746,11 +762,22 @@
{
if (e.KeyChar == (char)Keys.Return)
{
+ //闃查敊鍒ゆ柇
+ if(!judgeIsSameSourceBill(textBox_HBarCode.Text.Trim()))
+ {
+ return;
+ }
+
SetBarCode_Webs();
textBox_HBarCode.Text = "";
textBox_HBarCode.Focus();
autoProducePackBarCode();
+
+ if (grdMain.Rows.Count ==1 )
+ {
+ getPackQty(grdMain.Rows[0].Cells[4].Value.ToString());
+ }
}
}
catch (Exception e2)
@@ -1135,6 +1162,11 @@
private void toolStripButton_Delete_Click(object sender, EventArgs e)
{
deleteGrdMainNote();
+
+ if (grdMain.Rows.Count== 0)
+ {
+ set_clearPackQtyAndSourceInfo();
+ }
}
#endregion
@@ -1228,6 +1260,9 @@
Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
}
Report.Print(false);
+
+ //缁勬墭鎴愬姛鍚庯紝娓呯┖缁勬墭鏁伴噺涓庢簮鍗曚俊鎭�
+ set_clearPackQtyAndSourceInfo();
}
#endregion
@@ -1384,13 +1419,82 @@
textBox_sBillNo.Text = HBillNo;
getDisplay_GrdMain();
+
+ if (grdMain.Rows.Count > 0 && grdMain.Rows[0].Cells[4].Value != null)
+ {
+ getPackQty(grdMain.Rows[0].Cells[4].Value.ToString());
+ }
}
+
+
}
}
#endregion
#endregion
+ #region 鏍规嵁鏉$爜缂栧彿锛岃幏鍙栨潯鐮佷腑鐗╂枡鎵�瀵瑰簲鐨勭粍鎵樻暟閲忥紝鍚屾椂璁板綍婧愬崟涓籌D銆佸瓙ID
+ private void getPackQty(string HBarCode)
+ {
+ string sql = "select * from h_v_IF_BarCodeBillList_getPackQty where 鏉$爜缂栧彿 = '" + HBarCode + "'";
+ DataSet ds_getPackQty = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList_getPackQty");
+ if (ds_getPackQty == null || ds_getPackQty.Tables[0].Rows.Count <= 0)
+ {
+ HSourceInterID_ICMO = 0;
+ HSourceEntryID_ICMO = 0;
+
+ textBox_PackQty.Text = "";
+ }
+
+ HSourceInterID_ICMO = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceInterID"].ToString());
+ HSourceEntryID_ICMO = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceEntryID"].ToString());
+ textBox_PackQty.Text = ds_getPackQty.Tables[0].Rows[0]["缁勬墭鏁伴噺"].ToString();
+ }
+ #endregion
+
+ #region 鍒ゆ柇褰撳墠鎵弿鐨勬潯鐮佹槸鍚︿笌宸茬粡鎵弿杩囩殑鏉$爜涓哄悓涓�宸ュ崟鐢熸垚鐨�
+ private bool judgeIsSameSourceBill(string HBarCode)
+ {
+ if (grdMain.Rows.Count == 0)
+ {
+ return true;
+ }
+ else
+ {
+ string sql = "select * from h_v_IF_BarCodeBillList_getPackQty where 鏉$爜缂栧彿 = '" + HBarCode + "'";
+ DataSet ds_getPackQty = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList_getPackQty");
+ if (ds_getPackQty == null || ds_getPackQty.Tables[0].Rows.Count <= 0)
+ {
+ MessageBox.Show("褰撳墠鏉$爜涓嶅瓨鍦紒");
+ return false;
+ }
+ else
+ {
+ int HSourceInterID_ICMO_Bak = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceInterID"].ToString());
+ int HSourceEntryID_ICMO_Bak = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceEntryID"].ToString());
+ if (HSourceInterID_ICMO != HSourceInterID_ICMO_Bak || HSourceEntryID_ICMO != HSourceEntryID_ICMO_Bak)
+ {
+ MessageBox.Show("褰撳墠鎵弿鐨勬潯鐮佷笌涔嬪墠鎵�鎵弿鐨勬潯鐮佸伐鍗曚笉涓�鑷达紒");
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region 娓呯┖ 缁勬墭鏁伴噺 涓庤褰曠殑婧愬崟涓籌D銆佸瓙ID
+ private void set_clearPackQtyAndSourceInfo()
+ {
+ textBox_PackQty.Text = "";
+ HSourceInterID_ICMO = 0;
+ HSourceEntryID_ICMO = 0;
+ }
+ #endregion
+
}
}
--
Gitblit v1.9.1