沈泽
2021-08-20 e3ae7f17842fe7de358ced5398ef792a961f80eb
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -156,6 +156,7 @@
        public Int64 HInterID = 0;      //内码
        public Int64 HOrgID = -1;
        public string HOrgNumber = "";
        public string ERPMode = ""; //ERP模式(WISE、CLOUD)
        public string CampanyName = ""; //客户定制化名称
        public string SourceQtyCtl = ""; //超源单数量控制
                                         //-------------------------------------------------------------------------
@@ -373,6 +374,7 @@
            }
            else
            {
                ERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode;
                CampanyName = oSystemParameter.omodel.WMS_CampanyName;
                SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl;
            }
@@ -975,6 +977,7 @@
            grdSub.RowCount = 0;
            grdMain.ColumnCount = 60;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HMainIDCol].HeaderText = "源单主ID";
            grdMain.Columns[HSubIDCol].HeaderText = "源单子ID";
            grdMain.Columns[HBillNoCol].HeaderText = "源单单号";
@@ -1027,7 +1030,6 @@
            grdMain.Columns[HInnerBillNoCol].HeaderText = "内部采购订单号";
            grdMain.Columns[HMakerCol].HeaderText = "制单人";
            ////
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            //格式化 
            grdMain.Columns[HTagCol].Visible = false;                           //隐藏列
            grdMain.Columns[HMainIDCol].Visible = false;
@@ -1037,8 +1039,8 @@
            grdMain.Columns[HModelCol].Visible = false;
            //grdMain.Columns[HBatchNoCol].Visible = false;
            grdMain.Columns[HAuxPropIDCol].Visible = false;
            grdMain.Columns[HAuxPropNumberCol].Visible = false;
            grdMain.Columns[HAuxPropNameCol].Visible = false;
            //grdMain.Columns[HAuxPropNumberCol].Visible = false;
            //grdMain.Columns[HAuxPropNameCol].Visible = false;
            grdMain.Columns[HUnitIDCol].Visible = false;
            grdMain.Columns[HinitQtyCol].Visible = false;
            grdMain.Columns[HSupIDCol].Visible = false;
@@ -1153,8 +1155,8 @@
            grdSub.Columns[HMaterID2Col].Visible = false;
            grdSub.Columns[HModel2Col].Visible = false;
            grdSub.Columns[HAuxPropID2Col].Visible = false;
            grdSub.Columns[HAuxPropNumber2Col].Visible = false;
            grdSub.Columns[HAuxPropName2Col].Visible = false;
            //grdSub.Columns[HAuxPropNumber2Col].Visible = false;
            //grdSub.Columns[HAuxPropName2Col].Visible = false;
            grdSub.Columns[HUnitID2Col].Visible = false;
            grdSub.Columns[HPrintCol].Visible = false;
            grdSub.Columns[HSourceInterID2Col].Visible = false;
@@ -1336,6 +1338,7 @@
            }
            DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View();//物料
            DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View();//计量单位
            DAL.ClsIF_Property_View oProperty = new DAL.ClsIF_Property_View();//辅助属性
            if (!grdStatus)
            {
                return;
@@ -1368,6 +1371,9 @@
                                        grdMain.Rows[sRow].Cells[HMinQtyCol].Value = oMater.omodel.HQtyMin;
                                        grdMain.Rows[sRow].Cells[HDateCol].Value = dtpHDate.Value.ToShortDateString();
                                        grdMain.Rows[sRow].Cells[HShowDateCol].Value = dtpHDate.Value.ToShortDateString();
                                        grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0;
                                        grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = "";
                                        grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = "";
                                        if (oUnit.GetInfoByID(oMater.omodel.HUnitID))
                                        {
                                            grdMain.Rows[sRow].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID.ToString();
@@ -1392,6 +1398,9 @@
                                        grdMain.Rows[sRow].Cells[HUnitIDCol].Value = 0;
                                        grdMain.Rows[sRow].Cells[HUnitNumberCol].Value = "";
                                        grdMain.Rows[sRow].Cells[HUnitNameCol].Value = "";
                                        grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0;
                                        grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = "";
                                        grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = "";
                                    }
                                }
                                else
@@ -1402,6 +1411,11 @@
                                    grdMain.Rows[sRow].Cells[HMaterModelCol].Value = "";
                                    grdMain.Rows[sRow].Cells[HMinQtyCol].Value = 0;
                                    grdMain.Rows[sRow].Cells[HUnitIDCol].Value = 0;
                                    grdMain.Rows[sRow].Cells[HUnitNumberCol].Value = "";
                                    grdMain.Rows[sRow].Cells[HUnitNameCol].Value = "";
                                    grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0;
                                    grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = "";
                                    grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = "";
                                }
                                break;
@@ -1435,6 +1449,31 @@
                            case HDateCol:
                                BLL.ClsPub_BLL.Sub_SelectDate(grdMain, sRow, HDateCol);
                                oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HDateCol].Value);
                                break;
                            case HAuxPropNumberCol:
                                oProperty.WherePart = "";
                                if (ERPMode == "CLOUD")
                                {
                                    sWhere = " and HMaterNumber = '" + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[HMaterNumberCol].Value) + "'";
                                }
                                else
                                {
                                    sWhere = "";
                                }
                                if (oProperty.RefreshView(sWhere))
                                {
                                    grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = oProperty.oModel.HItemID.ToString();
                                    grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = oProperty.oModel.HNumber;
                                    grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = oProperty.oModel.HName;
                                    oEdit.Text = oProperty.oModel.HNumber;
                                }
                                else
                                {
                                    grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0;
                                    grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = "";
                                    grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = "";
                                }
                                break;
@@ -1793,13 +1832,14 @@
            //grdMain.Rows[i].Cells[HSourceNumberCol].Value = oTable.Rows[0]["生产线代码"].ToString();
            grdMain.Rows[i].Cells[HSourceNameCol].Value = oTable.Rows[0]["生产线"].ToString();
            grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["计划完工日期"].ToString();
            grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            //--
            //设置可编辑列
            string sAllowCol = HQtyCol.ToString() +
                                "," + HMinQtyCol.ToString() +
                                "," + HAuxPropNumberCol.ToString() +
                                "," + HBatchNoCol.ToString() +
                                "," + HRemarkCol.ToString() +
                                "," + HMinQtyCol.ToString();
                                "," + HRemarkCol.ToString();
            grdMain.Columns[HBillNoCol].ReadOnly = true;
            //设置合计列
            string sTotalCol = HQtyCol.ToString();
@@ -1870,9 +1910,10 @@
            //--
            //设置可编辑列
            string sAllowCol = HQtyCol.ToString() +
                                "," + HMinQtyCol.ToString() +
                                "," + HAuxPropNumberCol.ToString() +
                                "," + HBatchNoCol.ToString() +
                                "," + HRemarkCol.ToString() +
                                "," + HMinQtyCol.ToString();
                                "," + HRemarkCol.ToString();
            grdMain.Columns[HBillNoCol].ReadOnly = true;
            //设置合计列
            string sTotalCol = HQtyCol.ToString();