11
pzy
2024-08-26 dbbcd506929afda0a85ae23bcb5f88c1dccef387
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -155,6 +155,8 @@
        //
        public  string ModName = "85";
        public  string ModCaption = "条码生成";
        public const string ModRightName = "Gy_BarCodeBill";
        public const string ModRightNameSourceQty = ModRightName + "_SourceQty"; //超源单数量控制
        public bool BillChange;   //
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -436,6 +438,16 @@
                PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl;
                UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl;
            }
            //系统参数,有源单生成条码,生成条码数量可否超源单数量控制(N为不可超源单数量)
            if (SourceQtyCtl == "N")
            {
                //系统参数为不可超源单数量时,再次判断用户权限是否可超源单数量
                //判断权限
                if (ClsPub.Security_Log(ModRightNameSourceQty, 3, false, ClsPub.CurUserName))
                {
                    SourceQtyCtl = "Y";
                }
            }
            cmbHWorksNumber.Items.Clear();
            if (CampanyName == "飞龙") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
@@ -589,23 +601,6 @@
        //单据完整性判断          æœªå®Œæˆ
        private bool Sub_AllowSave()
        {
            ////必输项目是否为空
            //if (txtHDeptID.Tag.ToString().Trim() == "0")
            //{
            //    MessageBox.Show("生产车间没有选择!", "提示");
            //    return false;
            //}
            //if (txtHGroupID.Tag.ToString().Trim() == "0")
            //{
            //    MessageBox.Show("班组没有选择!", "提示");
            //    return false;
            //}
            //单据号是否重复
            //if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, txtHBillNo.Text.Trim(), BillStatus, BillOld.omodel.HInterID))
            //{
            //    MessageBox.Show("单据号重复!", "提示");
            //    return false;
            //}
            //明细表是否为零行
            bool b = false;
            for (int i = 0; i < grdMain.RowCount; i++)
@@ -2249,7 +2244,17 @@
            if (cmbSourceBillType.Text.Trim() == "生产订单")
            {
                string sWhere = " and HOrgID =" + HOrgID.ToString();
                string sWhere = "";
                //系统参数,生成条码数量可否超源单数量控制(N为不可超源单数量)
                if (SourceQtyCtl == "N")
                {
                    sWhere = " and HOrgID =" + HOrgID.ToString() + " and ä»»åŠ¡æ•°é‡>0";
                }
                else
                {
                    sWhere = " and HOrgID =" + HOrgID.ToString();
                }
                DAL.Cls_S_IFCLD_ICMOList oIFCLD_ICMOList = new DAL.Cls_S_IFCLD_ICMOList();
                if (oIFCLD_ICMOList.Refresh(sWhere))  //选择原单
                {
@@ -2403,7 +2408,8 @@
                    grdMain.Rows.Add();
                    grdMain.Rows[i].Cells[HTagCol].Value = "*";
                    //得到信息
                    Ds = oCn.RunProcReturn("select * from h_v_IFCLD_ICMOList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IFCLD_ICMOList");
                    Ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_ICMOBillList " + oSelectRow.BillMainID.ToString() + "," + oSelectRow.BillSubID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_ICMOBillList");
                    //Ds = oCn.RunProcReturn("select * from h_v_IFCLD_ICMOList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IFCLD_ICMOList");
                    //写入信息
                    Sub_WriteInForm(Ds.Tables[0], i);
                }
@@ -3486,15 +3492,32 @@
                if (cmbSourceBillType.Text.Trim() == "生产订单")
                {
                    DAL.Cls_S_IFCLD_ICMOList oIFCLD_ICMOList = new DAL.Cls_S_IFCLD_ICMOList();
                    if (oIFCLD_ICMOList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + sHOrgID.ToString()))  //选择原单
                    //系统参数,生成条码数量可否超源单数量控制(N为不可超源单数量)
                    if (SourceQtyCtl == "N")
                    {
                        FillSelectData(oIFCLD_ICMOList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                        if (oIFCLD_ICMOList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + sHOrgID.ToString() + " and ä»»åŠ¡æ•°é‡>0"))  //选择原单
                        {
                            FillSelectData(oIFCLD_ICMOList.oBillSelectColl);
                            txtHSourceBillNo.Text = "";
                        }
                        else
                        {
                            MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                        if (oIFCLD_ICMOList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + sHOrgID.ToString()))  //选择原单
                        {
                            FillSelectData(oIFCLD_ICMOList.oBillSelectColl);
                            txtHSourceBillNo.Text = "";
                        }
                        else
                        {
                            MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                            return;
                        }
                    }
                }
                else if (cmbSourceBillType.Text.Trim() == "生产汇报单")
@@ -3694,7 +3717,24 @@
            }
            else
            {
                if (CampanyName == "中控")
                if (CampanyName == "夏宝电器")
                {
                    cmbHBarCodeType.Items.Clear();
                    cmbHBarCodeType.Items.Add("内销机条码");
                    cmbHBarCodeType.Items.Add("外销机条码");
                    cmbHBarCodeType.Items.Add("半成品条码");
                    this.cmbHBarCodeType.SelectedIndex = 0;
                }
                else if (CampanyName == "博日科技")
                {
                    cmbHBarCodeType.Items.Clear();
                    cmbHBarCodeType.Items.Add("仪器外购件条码普通规则");
                    cmbHBarCodeType.Items.Add("仪器外购件条码容器规则");
                    cmbHBarCodeType.Items.Add("仪器成品条码规则");
                    cmbHBarCodeType.Items.Add("试剂成品条码规则");
                    this.cmbHBarCodeType.SelectedIndex = 0;
                }
                else if (CampanyName == "中控")
                {
                    cmbHBarCodeType.Items.Clear();
                    cmbHBarCodeType.Items.Add("唯一条码");