2.自动组托界面:
(已完成)初始化页面时,若当前托条码存在组托记录,则取第一个子条码中的物料获取组托数量。 同时记录条码中的源单主ID、子ID
(已完成)扫描子条码时,判断当前子条码是否是第一个,如果是的话,根据条码中的物料获取组托数量。 同时记录条码中的源单主ID、子ID
(已完成)自动组托时,组托完成后,将组托数量清空。 同时清空记录的源单主ID、子ID

(已完成)点击临时组托后,将组托数量清空。 同时清空记录的源单主ID、子ID
(已完成)点击未满托组托后, 将组托数量清空 同时清空记录的源单主ID、子ID

(已完成)扫描托条码后,判断当前托条码的组托记录,若存在,则取第一个子条码中的物料获取组托数量。 同时记录条码中的源单主ID、子ID

(已完成)扫描子条码时,若条码不是扫码记录中的第一个,则将条码中的源单主ID、子ID和记录的源单主ID、子ID对比,相同才可以进行扫码。

(已完成)点击删除后,若组托记录中数量为0,将组托数量清空。 同时清空记录的源单主ID、子ID
1个文件已修改
116 ■■■■■ 已修改文件
WarM/条码打印/Gy_PackBarCodeBill_automaticallyByPLC.cs 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/ÌõÂë´òÓ¡/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 æ ¹æ®æ¡ç ç¼–号,获取条码中物料所对应的组托数量,同时记录源单主ID、子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 æ¸…空 ç»„托数量 ä¸Žè®°å½•的源单主ID、子ID
        private void set_clearPackQtyAndSourceInfo()
        {
            textBox_PackQty.Text = "";
            HSourceInterID_ICMO = 0;
            HSourceEntryID_ICMO = 0;
        }
        #endregion
    }
}