北京络捷斯特第三方物流信息系统技术解析(八) 作业管理-入库作业

北京络捷斯特第三方物流信息系统技术解析(八) 作业管理-入库作业

2.2.1 入库作业

      入库作业分为入库预处理和入库反馈2个三级模块,入库预处理是对入库的货品的进行提前的调度处理的模块,他不会涉及真正的实施行为。而入库反馈就是真正的对货品的一个理货反馈的过程。

      入库作业单是对前面订单录入中,入库订单进行一个入库作业操作流程。

      在入库作业界面选择一行数据,点击入库预处理,进行预处理操作,操作完成后。在入库预处理查询界面能查询出刚才预处理完成的信息,选择该信息,点击作业计划单反馈,对该订单进行反馈操作,当反馈完成后,该作业单操作流程才算完成。

入库作业查询界面截图:


2.2.1图(1)

入库预处理查询界面截图:


2.2.1图(2)

入库反馈查询界面截图:


2.2.1图(3)

入库作业功能实现:

第一步:数据库

1、入库作业表关系:


2.2.1图(4)

2、入库预处理表和关系:


2.2.1图(5)

3、入库反馈表和关系:


2.2.1图(6)

表1:订单信息表(PW_OrdersInformationTable)

列名

数据类型

主键/外键

说明

OrdersInformationID

int

主键

订单信息ID

OrdersMark

nchar(50)

 

订单号

ClientID

int

外键

客户ID

ClientInstructMark

nchar(50)

 

客户指令号

PurchaseOrdersNumber

nchar(50)

 

采购订单号

OrdersTypeID

int

外键

订单类型ID

UrgencyDegreeID

int

外键

紧急程度ID

OrdersSourceID

int

外键

订单来源ID

PledgeBankID

int

外键

质押银行ID

Note

nchar(50)

 

备注

EntryTime

date

 

录入时间

RepairNo

Bit

 

补录否

表2:入库预处理表(PW_WarehousingPretreatmentTable)

列名

数据类型

主键/外键

说明

WarehousingPretreatmentID

int

主键

入库预处理ID

WarehousingIndentID

int

外键

入库订单ID

WorkPlanNumber

nchar(50)

 

作业计划单号

表3:入库预上架表(PW_WarehousingWarningGroundingTable)

列名

数据类型

主键/外键

说明

WarehousingWarningGroundingID

int

主键

入库预上架ID

WarehousingPretreatmentID

int

外键

入库预处理ID

OrdersWarehousingDetailedID

int

外键

订单入库明细ID

StorageID

int

外键

储位ID

GoodsID

int

外键

货品ID

Batch

nchar(50)

 

批次

Quantity

decimal(18, 2)

 

数量

QualityStateID

int

外键

质量状态ID

表4:入库预资源调度表(PW_WarehousingWarningResourceSchedulingTable)

列名

数据类型

主键/外键

说明

WarehousingWarningResourceSchedulingID

int

主键

入库预资源调度ID

WarehousingPretreatmentID

int

外键

入库预处理ID

NeedGrossWeight

decimal(18, 2)

 

需要总重量

NeedGrossBulk

decimal(18, 2)

 

需要总体积

表5:入库预作业表(PW_WarehousingWarningWorkTable)

列名

数据类型

主键/外键

说明

WarehousingWarningWorkID

int

主键

入库预作业ID

ResourceSchedulingID

int

外键

资源调度ID

WorkNumber

nchar(50)

 

作业单号

OperateTypeID

int

外键

操作类型ID

表6:入库理货反馈表(PW_WarehousingManageGoodsFeedbackTable)

列名

数据类型

主键/外键

说明

WarehousingManageGoodsFeedbackID

int

主键

理货反馈ID

WarehousingWarningGroundingID

int

外键

入库预上架ID

Batch

nchar(50)

 

批次

TrueCollect

decimal(18, 2)

 

实收

表6:入库反馈表(PW_WarehousingFeedbackTable)

列名

数据类型

主键/外键

说明

WarehousingFeedbackID

int

主键

入库反馈ID

OrdersWarehousingInformationID

int

外键

订单入库信息ID

WorkPlanNumber

nchar(50)

 

作业计划单号

表7:入库上架明细表(PW_WarehousingGroundingDetailedTable)

列名

数据类型

主键/外键

说明

WarehousingGroundingDetailedID

int

主键

入库上架明细ID

WarehousingFeedbackID

int

外键

入库反馈ID

WarehousingManageGoodsFeedbackID

int

外键

理货反馈ID

StorageID

int

外键

储位ID

GoodsID

int

外键

货品ID

Batch

nchar(50)

 

批次

Quantity

decimal(18, 2)

 

数量

QualityStateID

int

外键

质量状态ID

表8:入库资源调度表(PW_WarehousingResourceSchedulingTable)

列名

数据类型

主键/外键

说明

WarehousingResourceSchedulingID

int

主键

入库资源调度ID

WarehousingFeedbackID

int

外键

入库反馈ID

NeedGrossWeight

decimal(18, 2)

 

需要总重量

NeedGrossBulk

decimal(18, 2)

 

需要总体积

表9:入库作业表(PW_WarehousingWorkTable)

列名

数据类型

主键/外键

说明

WarehousingWorkID

int

主键

入库作业ID

WarehousingResourceSchedulingID

int

外键

入库资源调度ID

WorkNumber

nchar(50)

 

作业单号

OperateTypeID

int

外键

操作类型ID

第二步:控制器(Controllers


2.2.1图(7)


2.2.1图(8)

Contrlles(控制器)代码:

       #region 模糊查询基本信息
        /// <summary>
        /// 接收界面层参数,当参数有内容时,会根据传过来的参数查询想要的数据,当参数为空值时,查询全部数据
        /// </summary>
        /// <param name="NeiRong">内容</param>
        /// <returns>Json</returns>
        public ActionResult ChaXunJiBenXinXi(string NeiRong)
        {
            var dtOrdersInformation = from tbOrdersInformation in myRKZY.PW_OrdersInformationTable  //linq语法建立多表之间的连接,主键与外键间的连接
                                      join tbOrdersWarehousingInformation in myRKZY.PW_OrdersWarehousingInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
                                      join tbWarehousingWay in myRKZY.SYS_AttributeDetailedTable on tbOrdersWarehousingInformation.WarehousingWayID equals tbWarehousingWay.AttributeDetailedID
                                      join tbStoreroom in myRKZY.SYS_StoreroomTable on tbOrdersWarehousingInformation.StoreroomID equals tbStoreroom.StoreroomID
                                      join tbClient in myRKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
                                      join tbOrdersType in myRKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
                                      join tbState in myRKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
                                      join tbOrdersSource in myRKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersSourceID equals tbOrdersSource.AttributeDetailedID
                                      join tbPledgeBank in myRKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
                                      select new
                                      {  //下面是要你需要的数据字段名称
                                          OrdersInformationID = tbOrdersInformation.OrdersInformationID,
                                          OrdersWarehousingInformationID = tbOrdersWarehousingInformation.OrdersWarehousingInformationID,
                                          OrdersMark = tbOrdersInformation.OrdersMark,
                                          ClientID = tbOrdersInformation.ClientID,
                                          ClientCode = tbClient.ClientCode,
                                          WarehousingWay = tbWarehousingWay.AttributeDetailedName,
                                          OrdersType = tbOrdersType.AttributeDetailedName,
                                          State = tbState.AttributeDetailedName,
                                          OrdersSource = tbOrdersSource.AttributeDetailedName,
                                          StoreroomCoding = tbStoreroom.StoreroomCoding,
                                          PledgeBank = tbPledgeBank.BankName,
                                          Note = tbOrdersInformation.Note
                                      };
            if (NeiRong != "")//当满足条件时,会根据条件查询,不满足条件时,会查询全部
            {
                dtOrdersInformation = dtOrdersInformation.Where(tbOrders => tbOrders.OrdersMark.Contains(NeiRong.Trim()));
            }
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtOrdersInformation)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
#region 查询储位
        /// <summary>
        /// 查询全部储位信息,在界面选择按钮,会弹出储位信息窗体
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult SelectStorage() 
        {
            var dtStorage = from tbDistrict in myRKZY.SYS_DistrictTable
                            join tbStorage in myRKZY.SYS_StorageTable on tbDistrict.DistrictID equals tbStorage.DistrictID
                            select new 
                            {
                                StorageID = tbStorage.StorageID,
                                DistrictID = tbStorage.DistrictID,
                                StorageNumber = tbStorage.StorageNumber,
                                DistrictCoding = tbDistrict.DistrictCoding,
                                DistrictName = tbDistrict.DistrictName,
                                Length = tbDistrict.Length,
                                Width = tbDistrict.Width,
                                Height = tbDistrict.Height,
                                BearWeight = tbDistrict.BearWeight,
                                Cubage = tbDistrict.Cubage
                            };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtStorage)
            {
                Dictionary<string, object> itemStorage = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemStorage.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemStorage);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// 接收界面参数,入库后,改变区的体积和承重量
        /// </summary>
        /// <param name="TiJi">体积</param>
        /// <param name="ShuLiang">数量</param>
        /// <param name="DistrictID">区ID</param>
        /// <returns>Json</returns>
        public ActionResult UpdataQuTiJi(decimal TiJi,decimal ShuLiang, int DistrictID)
        {
            var myZuoYe = (from tbZuoYe in myRKZY.SYS_DistrictTable
                                        where tbZuoYe.DistrictID == DistrictID
                           select tbZuoYe).Single<Models.SYS_DistrictTable>();

            Decimal Cubage = Convert.ToDecimal(myZuoYe.Cubage);
            Decimal BearWeight = Convert.ToDecimal(myZuoYe.BearWeight);
            myZuoYe.Cubage = Cubage - TiJi;//入库时,库存的体积会减少
            myZuoYe.BearWeight = (BearWeight - ShuLiang).ToString();//入库时,库存的承重量会减少

            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion

        #region 入库预处理_上架调度待上架货品
        /// <summary>
        /// 入库预处理操作,查询预处理所需的待上架货品
        /// </summary>
        /// <param name="OrdersWarehousingInformationID">入库订单信息ID</param>
        /// <returns>Json</returns>
        public ActionResult SelectWaitGroundingGoods(int OrdersWarehousingInformationID)
        {
            var dtWaitGroundingGoods = from tbWaitGroundingGoods in myRKZY.PW_OrdersWarehousingDetailedTable //linq语法,建立多表间的联系
                                       join tbGoods in myRKZY.SYS_GoodsTable on tbWaitGroundingGoods.GoodsID equals tbGoods.GoodsID
                                       join tbUnit in myRKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
                                       join tbQuality in myRKZY.SYS_AttributeDetailedTable on tbGoods.QualityID equals tbQuality.AttributeDetailedID
                                       where tbWaitGroundingGoods.OrdersWarehousingInformationID == OrdersWarehousingInformationID
                                       select new
                                       {
                                           OrdersWarehousingDetailedID = tbWaitGroundingGoods.OrdersWarehousingDetailedID,
                                           OrdersWarehousingInformationID = tbWaitGroundingGoods.OrdersWarehousingInformationID,
                                           GoodsID = tbWaitGroundingGoods.GoodsID,
                                           GoodsCoding = tbGoods.GoodsCoding,
                                           GoodsName = tbGoods.GoodsName,
                                           Standard = tbGoods.Standard,
                                           Weight = tbGoods.Weight,
                                           Model = tbGoods.Model,
                                           UnitID = tbGoods.UnitID,
                                           Unit = tbUnit.AttributeDetailedName,
                                           QualityID = tbGoods.QualityID,
                                           Quality = tbQuality.AttributeDetailedName,
                                           BarCode = tbGoods.BarCode,
                                           SpellCode = tbGoods.SpellCode,
                                           Batch = tbWaitGroundingGoods.Batch,
                                           Quantity = tbWaitGroundingGoods.Quantity,
                                           Note = tbWaitGroundingGoods.Note
                                       };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtWaitGroundingGoods)
            {
                Dictionary<string, object> itemWaitGroundingGoods = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemWaitGroundingGoods.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemWaitGroundingGoods);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion 

        #region 通过ID绑定基本信息
        /// <summary>
        /// 进行预处理操作时,打开预处理操作界面,把基本信息绑定在界面
        /// </summary>
        /// <param name="WarehousingIndentID">订单信息ID</param>
        /// <returns>Json</returns>
        public ActionResult BangDingDinDanXinXiByID(int WarehousingIndentID) 
        {
            var dtOrdersInformation = from tbOrdersInformation in myRKZY.PW_OrdersInformationTable
                                      join tbOrdersWarehousingInformation in myRKZY.PW_OrdersWarehousingInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
                                      join tbStoreroom in myRKZY.SYS_StoreroomTable on tbOrdersWarehousingInformation.StoreroomID equals tbStoreroom.StoreroomID
                                      join tbClient in myRKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
                                      join tbOrdersType in myRKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
                                      join tbState in myRKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
                                      join tbPledgeBank in myRKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
                                      where tbOrdersInformation.OrdersInformationID == WarehousingIndentID
                                      select new 
                                      {
                                          OrdersInformationID = tbOrdersInformation.OrdersInformationID,
                                          OrdersMark = tbOrdersInformation.OrdersMark,
                                          ClientID = tbOrdersInformation.ClientID,
                                          ClientCode = tbClient.ClientCode,
                                          OrdersType = tbOrdersType.AttributeDetailedName,
                                          State = tbState.AttributeDetailedName,
                                          StoreroomCoding = tbStoreroom.StoreroomCoding,
                                          PledgeBank = tbPledgeBank.BankName
                                      };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtOrdersInformation)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 查询入库预作业
        /// <summary>
        /// 在入库预处理操作,要将入库预作业的数据查询出来
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult SelectWarehousingWarningWork() 
        {
            var dtWarehousingWarningWork = from tbWarehousingWarningWork in myRKZY.PW_WarehousingWorkTable
                                           join tbResourceScheduling in myRKZY.PW_WarehousingWarningResourceSchedulingTable on tbWarehousingWarningWork.WarehousingResourceSchedulingID equals tbResourceScheduling.WarehousingWarningResourceSchedulingID
                                           join tbOperateType in myRKZY.SYS_AttributeDetailedTable on tbWarehousingWarningWork.OperateTypeID equals tbOperateType.AttributeDetailedID
                                           select new 
                                           {
                                               WarehousingWarningWorkID = tbWarehousingWarningWork.WarehousingWorkID,
                                               ResourceSchedulingID = tbWarehousingWarningWork.WarehousingResourceSchedulingID,
                                               WorkNumber = tbWarehousingWarningWork.WorkNumber,
                                               OperateTypeID = tbWarehousingWarningWork.OperateTypeID,
                                               OperateType = tbOperateType.AttributeDetailedName
                                           };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtWarehousingWarningWork)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
#region 模糊查询
        /// <summary>
        /// 接收界面层参数,查询入库预处理的信息,当传过来的参数不为空值,按参数条件查询,当条件为空值时,查询全部数据
        /// </summary>
        /// <param name="NeiRong">内容</param>
        /// <returns>Json</returns>
        public ActionResult MoHuSelectWarehousingPretreatment(string NeiRong) 
        {
            var dtWarehousingPretreatment = from tbWarehousingPretreatment in myRKZY.PW_WarehousingPretreatmentTable
                                            join tbWarehousingIndent in myRKZY.PW_OrdersInformationTable on tbWarehousingPretreatment.WarehousingIndentID equals tbWarehousingIndent.OrdersInformationID
                                            join tbOrdersWarehousingInformation in myRKZY.PW_OrdersWarehousingInformationTable on tbWarehousingIndent.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
                                            join tbClient in myRKZY.SYS_ClientTable on tbWarehousingIndent.ClientID equals tbClient.ClientID
                                            join tbOrdersType in myRKZY.SYS_AttributeDetailedTable on tbWarehousingIndent.OrdersTypeID equals tbOrdersType.AttributeDetailedID
                                            join tbState in myRKZY.SYS_AttributeDetailedTable on tbWarehousingIndent.StateID equals tbState.AttributeDetailedID
                                            join tbPledgeBank in myRKZY.SYS_BankTable on tbWarehousingIndent.PledgeBankID equals tbPledgeBank.BankID
                                            join tbWarehousingWarningResourceScheduling in myRKZY.PW_WarehousingWarningResourceSchedulingTable on tbWarehousingPretreatment.WarehousingPretreatmentID equals tbWarehousingWarningResourceScheduling.WarehousingPretreatmentID
                                            select new
                                            {
                                                WarehousingPretreatmentID = tbWarehousingPretreatment.WarehousingPretreatmentID,
                                                WarehousingIndentID = tbWarehousingPretreatment.WarehousingIndentID,
                                                OrdersWarehousingInformationID = tbOrdersWarehousingInformation.OrdersWarehousingInformationID,
                                                WorkPlanNumber = tbWarehousingPretreatment.WorkPlanNumber,
                                                OrdersMark = tbWarehousingIndent.OrdersMark,
                                                ClientID = tbWarehousingIndent.ClientID,
                                                ClientCode = tbClient.ClientCode,
                                                OrdersType = tbOrdersType.AttributeDetailedName,
                                                State = tbState.AttributeDetailedName,
                                                PledgeBank = tbPledgeBank.BankName,
                                                NeedGrossWeight = tbWarehousingWarningResourceScheduling.NeedGrossWeight,
                                                NeedGrossBulk = tbWarehousingWarningResourceScheduling.NeedGrossBulk
                                            };
            if (NeiRong != "")//当参数不为空值,根据参数条件查询,当参数为空值,查询全部数据
            {
                dtWarehousingPretreatment = dtWarehousingPretreatment.Where(tbOrders => tbOrders.WorkPlanNumber.Contains(NeiRong.Trim()));
            }
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtWarehousingPretreatment)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 查询入库预作业明细
        /// <summary>
        /// 入库预处理界面,当点击入库预处理界面的表格,会获取入库预处理ID,根据ID,查询入库预处理的货品明细
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <returns>Json</returns>
        public ActionResult SelectWarehousingWarningGrounding(int WarehousingPretreatmentID) 
        {
            var dtWarehousingWarningGrounding = from tbWarehousingWarningGrounding in myRKZY.PW_WarehousingWarningGroundingTable
                                                join tbStorage in myRKZY.SYS_StorageTable on tbWarehousingWarningGrounding.StorageID equals tbStorage.StorageID
                                                join tbDistrict in myRKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
                                                join tbGoods in myRKZY.SYS_GoodsTable on tbWarehousingWarningGrounding.GoodsID equals tbGoods.GoodsID
                                                join tbUnit in myRKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
                                                join tbQualityState in myRKZY.SYS_AttributeDetailedTable on tbWarehousingWarningGrounding.QualityStateID equals tbQualityState.AttributeDetailedID
                                                where tbWarehousingWarningGrounding.WarehousingPretreatmentID == WarehousingPretreatmentID
                                                select new 
                                                {
                                                    WarehousingWarningGroundingID = tbWarehousingWarningGrounding.WarehousingWarningGroundingID,
                                                    WarehousingPretreatmentID = tbWarehousingWarningGrounding.WarehousingPretreatmentID,
                                                    OrdersWarehousingDetailedID = tbWarehousingWarningGrounding.OrdersWarehousingDetailedID,
                                                    StorageID = tbWarehousingWarningGrounding.StorageID,
                                                    GoodsID = tbWarehousingWarningGrounding.GoodsID,
                                                    QualityStateID = tbWarehousingWarningGrounding.QualityStateID,
                                                    Batch = tbWarehousingWarningGrounding.Batch,
                                                    Quantity = tbWarehousingWarningGrounding.Quantity,
                                                    StorageNumber = tbStorage.StorageNumber,
                                                    DistrictCoding = tbDistrict.DistrictCoding,
                                                    GoodsCoding = tbGoods.GoodsCoding,
                                                    GoodsName = tbGoods.GoodsName,
                                                    Standard = tbGoods.Standard,
                                                    Model = tbGoods.Model,
                                                    UnitID = tbGoods.UnitID,
                                                    Unit = tbUnit.AttributeDetailedName,
                                                    QualityState = tbQualityState.AttributeDetailedName
                                                };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtWarehousingWarningGrounding)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 新增入库预处理表
        /// <summary>
        /// 对入库订单进行预处理操作,接收界面参数,新增入库预处理的信息
        /// </summary>
        /// <param name="WarehousingIndentID">订单信息ID</param>
        /// <param name="WorkPlanNumber">计划作业单号</param>
        /// <returns>int</returns>
        public int InsertWarehousingPretreatment(int WarehousingIndentID, string WorkPlanNumber) 
        {   //实例化入库预处理表
            Models.PW_WarehousingPretreatmentTable myWarehousingPretreatment = new Models.PW_WarehousingPretreatmentTable();
            myWarehousingPretreatment.WarehousingIndentID = WarehousingIndentID;
            myWarehousingPretreatment.WorkPlanNumber = WorkPlanNumber;

            myRKZY.PW_WarehousingPretreatmentTable.AddObject(myWarehousingPretreatment);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                int WarehousingPretreatmentID = (from tbID in myRKZY.PW_WarehousingPretreatmentTable select tbID.WarehousingPretreatmentID).Max();
                return WarehousingPretreatmentID;//返回新增数据的主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 新增入库预上架表
        /// <summary>
        /// 入库预处理信息添加后,要添加入库预处理的上架信息,接收界面层参数,添加上架货品信息
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <param name="OrdersWarehousingDetailedID">入库明细ID</param>
        /// <param name="StorageID">储位ID</param>
        /// <param name="GoodsID">货品ID</param>
        /// <param name="Batch">批次</param>
        /// <param name="Quantity">数量</param>
        /// <param name="QualityStateID">质量状态ID</param>
        /// <returns>Json</returns>
        public ActionResult InsertWarehousingWarningGrounding(int WarehousingPretreatmentID, int OrdersWarehousingDetailedID,
                                                              int StorageID, int GoodsID, decimal Batch,
                                                              decimal Quantity, int QualityStateID)
        {
            Models.PW_WarehousingWarningGroundingTable myWarehousingWarningGrounding = new Models.PW_WarehousingWarningGroundingTable();

            myWarehousingWarningGrounding.WarehousingPretreatmentID = WarehousingPretreatmentID;
            myWarehousingWarningGrounding.OrdersWarehousingDetailedID = OrdersWarehousingDetailedID;
            myWarehousingWarningGrounding.StorageID = StorageID;
            myWarehousingWarningGrounding.GoodsID = GoodsID;
            myWarehousingWarningGrounding.Batch = Batch;
            myWarehousingWarningGrounding.Quantity = Quantity;
            myWarehousingWarningGrounding.QualityStateID = QualityStateID;

            myRKZY.PW_WarehousingWarningGroundingTable.AddObject(myWarehousingWarningGrounding);//新增上面参数到数据库表
            int i = myRKZY.SaveChanges();//新增完成返回值i大于0
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 新增入库预资源调度表
        /// <summary>
        /// 入库预处理新增完成后,要新增入库预资源调度,接收界面参数,新增入库预资源调度
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <param name="NeedGrossWeight">需要总重量</param>
        /// <param name="NeedGrossBulk">需要总体积</param>
        /// <returns>int</returns>
        public int InsertWarehousingWarningResourceScheduling(int WarehousingPretreatmentID, decimal NeedGrossWeight, decimal NeedGrossBulk)
        {
            Models.PW_WarehousingWarningResourceSchedulingTable myWarehousingWarningResourceScheduling = new Models.PW_WarehousingWarningResourceSchedulingTable();

            myWarehousingWarningResourceScheduling.WarehousingPretreatmentID = WarehousingPretreatmentID;
            myWarehousingWarningResourceScheduling.NeedGrossWeight = NeedGrossWeight;
            myWarehousingWarningResourceScheduling.NeedGrossBulk = NeedGrossBulk;

            myRKZY.PW_WarehousingWarningResourceSchedulingTable.AddObject(myWarehousingWarningResourceScheduling);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                int WarehousingWarningResourceSchedulingID = (from tbID in myRKZY.PW_WarehousingWarningResourceSchedulingTable select tbID.WarehousingWarningResourceSchedulingID).Max();
                return WarehousingWarningResourceSchedulingID;//返回新增数据主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 新增入库预作业表
        /// <summary>
        /// 入库预处理新增完成后,接收界面参数,新增入库预作业
        /// </summary>
        /// <param name="ResourceSchedulingID">入库预资源调度ID</param>
        /// <param name="WorkNumber">作业单号</param>
        /// <param name="OperateTypeID">作业类型ID</param>
        /// <returns></returns>
        public ActionResult InsertWarehousingWarningWork(int ResourceSchedulingID, string WorkNumber, int OperateTypeID) 
        {
            Models.PW_WarehousingWarningWorkTable myWarehousingWarningWork = new Models.PW_WarehousingWarningWorkTable();

            myWarehousingWarningWork.ResourceSchedulingID = ResourceSchedulingID;
            myWarehousingWarningWork.WorkNumber = WorkNumber;
            myWarehousingWarningWork.OperateTypeID = OperateTypeID;

            myRKZY.PW_WarehousingWarningWorkTable.AddObject(myWarehousingWarningWork);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 查询明细预作业数量
        /// <summary>
        /// 根据入库订单明细ID,查询该货品的数量
        /// </summary>
        /// <param name="OrdersWarehousingDetailedID">入库订单明细ID</param>
        /// <returns>Json</returns>
        public ActionResult SelectShuLiang(int OrdersWarehousingDetailedID) {
            var dtWaitGroundingGoods = from tbWaitGroundingGoods in myRKZY.PW_OrdersWarehousingDetailedTable
                                       where tbWaitGroundingGoods.OrdersWarehousingDetailedID == OrdersWarehousingDetailedID
                                       select new 
                                       {
                                           Quantity = tbWaitGroundingGoods.Quantity,
                                       };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtWaitGroundingGoods)
            {
                Dictionary<string, object> itemWaitGroundingGoods = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemWaitGroundingGoods.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemWaitGroundingGoods);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 修改明细预作业数量
        /// <summary>
        /// 入库作业时,当货品上架后,该变库存数量
        /// </summary>
        /// <param name="ShenYuShuLiang">剩余数量</param>
        /// <param name="OrdersWarehousingDetailedID">入库订单明细ID</param>
        /// <returns>Json</returns>
        public ActionResult UpdateShuLiang(decimal ShenYuShuLiang, int OrdersWarehousingDetailedID) 
        {
            var myWaitGroundingGoods = (from tbWaitGroundingGoods in myRKZY.PW_OrdersWarehousingDetailedTable
                                        where tbWaitGroundingGoods.OrdersWarehousingDetailedID == OrdersWarehousingDetailedID
                                        select tbWaitGroundingGoods).Single<Models.PW_OrdersWarehousingDetailedTable>();
            
            myWaitGroundingGoods.Quantity = ShenYuShuLiang;

            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
       #region 删除入库预处理表
        /// <summary>
        ///单击入库预处理表格里的删除图标,获取入库预处理ID,根据ID删除入库预处理信息
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <returns>Json</returns>
        public ActionResult DelectWarehousingPretreatment(int WarehousingPretreatmentID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingPretreatmentTable
                            where tbOrders.WarehousingPretreatmentID == WarehousingPretreatmentID
                            select tbOrders).Single<Models.PW_WarehousingPretreatmentTable>();

            myRKZY.DeleteObject(dtOrders);//在数据库删除这条信息
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库预资源调度表
        /// <summary>
        /// 入库预处理信息数据删除后,要删除入库预处理下的子表信息,也是根据入库预处理ID删除入库预资源调度信息
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <returns></returns>
        public int DelectWarehousingWarningResourceScheduling(int WarehousingPretreatmentID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingWarningResourceSchedulingTable
                            where tbOrders.WarehousingPretreatmentID == WarehousingPretreatmentID
                            select tbOrders).Single<Models.PW_WarehousingWarningResourceSchedulingTable>();

            int WarehousingResourceSchedulingID = dtOrders.WarehousingWarningResourceSchedulingID;//获取要删除的数据的主键ID值
            myRKZY.DeleteObject(dtOrders);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return WarehousingResourceSchedulingID;//返回主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 删除入库预作业表
        /// <summary>
        /// 上面返回的主键ID值,在这里作为删除条件,删除入库预作业信息
        /// </summary>
        /// <param name="ResourceSchedulingID">入库预资源调度ID</param>
        /// <returns>Json</returns>
        public ActionResult DelectWarehousingWarningWork(int ResourceSchedulingID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingWarningWorkTable
                            where tbOrders.ResourceSchedulingID == ResourceSchedulingID
                            select tbOrders).Single<Models.PW_WarehousingWarningWorkTable>();

            myRKZY.DeleteObject(dtOrders);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库预上架表
        /// <summary>
        /// 删除入库预处理信息的上架货品信息,根据入库预处理ID删除
        /// </summary>
        /// <param name="WarehousingPretreatmentID">入库预处理ID</param>
        /// <returns>Json</returns>
        public ActionResult  DelectWarehousingWarningGrounding(int WarehousingPretreatmentID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingWarningGroundingTable
                            where tbOrders.WarehousingPretreatmentID == WarehousingPretreatmentID
                            select tbOrders).ToList<Models.PW_WarehousingWarningGroundingTable>();

            for (int j = 0; j < dtOrders.Count; j++)//有多条货品信息,要循环删除
            {
                myRKZY.DeleteObject(dtOrders[j]);
            }

            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 查询入库理货反馈
        /// <summary>
        /// 在入库反馈界面,要将已反馈的货品信息全部查询出来
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult SelectWarehousingManageGoodsFeedback() 
        {
            var dtZuoYe = from tbZuoYe in myRKZY.PW_WarehousingManageGoodsFeedbackTable
                          join tbWarehousingWarningGrounding in myRKZY.PW_WarehousingWarningGroundingTable on tbZuoYe.WarehousingWarningGroundingID equals tbWarehousingWarningGrounding.WarehousingWarningGroundingID
                          join tbStorage in myRKZY.SYS_StorageTable on tbWarehousingWarningGrounding.StorageID equals tbStorage.StorageID
                          join tbDistrict in myRKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
                          join tbGoods in myRKZY.SYS_GoodsTable on tbWarehousingWarningGrounding.GoodsID equals tbGoods.GoodsID
                          join tbUnit in myRKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
                          join tbQualityState in myRKZY.SYS_AttributeDetailedTable on tbWarehousingWarningGrounding.QualityStateID equals tbQualityState.AttributeDetailedID
                          select new 
                          {
                              WarehousingManageGoodsFeedbackID = tbZuoYe.WarehousingManageGoodsFeedbackID,
                              WarehousingWarningGroundingID = tbZuoYe.WarehousingWarningGroundingID,
                              Batch = tbZuoYe.Batch,
                              TrueCollect = tbZuoYe.TrueCollect,
                              StorageID = tbWarehousingWarningGrounding.StorageID,
                              StorageNumber = tbStorage.StorageNumber,
                              DistrictCoding = tbDistrict.DistrictCoding,
                              GoodsID = tbWarehousingWarningGrounding.GoodsID,
                              GoodsCoding = tbGoods.GoodsCoding,
                              GoodsName = tbGoods.GoodsName,
                              Standard = tbGoods.Standard,
                              Model = tbGoods.Model,
                              UnitID = tbGoods.UnitID,
                              Unit = tbUnit.AttributeDetailedName,
                              Quantity = tbWarehousingWarningGrounding.Quantity,
                              QualityStateID = tbWarehousingWarningGrounding.QualityStateID,
                              QualityState = tbQualityState.AttributeDetailedName,
                          };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtZuoYe)
            {
                Dictionary<string, object> itemZuoYe = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemZuoYe.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemZuoYe);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 查询额外增加货品
        /// <summary>
        /// 在理货界面,将额外货品信息全部查询出来,可以将额外货品信息添加到理货反馈区域
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult SelectEWaiHuoPin() 
        {
            var dtZuoYe = from tbZuoYe in myRKZY.PW_WarehousingWarningGroundingTable
                          join tbGoods in myRKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
                          join tbUnit in myRKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
                          join tbQualityState in myRKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
                          select new 
                          {
                              WarehousingWarningGroundingID = tbZuoYe.WarehousingWarningGroundingID,
                              GoodsID = tbZuoYe.GoodsID,
                              GoodsCoding = tbGoods.GoodsCoding,
                              GoodsName = tbGoods.GoodsName,
                              Standard = tbGoods.Standard,
                              Model = tbGoods.Model,
                              UnitID = tbGoods.UnitID,
                              Unit = tbUnit.AttributeDetailedName,
                              Quantity = tbZuoYe.Quantity,
                              QualityStateID = tbZuoYe.QualityStateID,
                              QualityState = tbQualityState.AttributeDetailedName
                          };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtZuoYe)
            {
                Dictionary<string, object> itemZuoYe = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemZuoYe.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemZuoYe);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 保存修改
        /// <summary>
        /// 接收界面参数,将理货反馈里的全部货品进行保存
        /// </summary>
        /// <param name="WarehousingManageGoodsFeedbackID">理货反馈ID</param>
        /// <param name="Batch">批次</param>
        /// <param name="TrueCollect">实收</param>
        /// <returns></returns>
        public ActionResult UpdateWarehousingManageGoodsFeedback(int WarehousingManageGoodsFeedbackID, decimal Batch, decimal TrueCollect) 
        {
            var myZuoYe = (from tbZuoYe in myRKZY.PW_WarehousingManageGoodsFeedbackTable
                           where tbZuoYe.WarehousingManageGoodsFeedbackID == WarehousingManageGoodsFeedbackID
                           select tbZuoYe).Single<Models.PW_WarehousingManageGoodsFeedbackTable>();

            myZuoYe.Batch = Batch;
            myZuoYe.TrueCollect = TrueCollect;

            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        /// <summary>
        /// 如果是额外货品,会新增一条理货反馈信息
        /// </summary>
        /// <param name="WarehousingWarningGroundingID">入库预上架ID</param>
        /// <param name="Batch">批次</param>
        /// <param name="TrueCollect">实收</param>
        /// <returns>Json</returns>
        public ActionResult InsertWarehousingManageGoodsFeedback(int WarehousingWarningGroundingID,decimal Batch, decimal TrueCollect) 
        {
            Models.PW_WarehousingManageGoodsFeedbackTable myZuoYe = new Models.PW_WarehousingManageGoodsFeedbackTable();

            myZuoYe.WarehousingWarningGroundingID = WarehousingWarningGroundingID;
            myZuoYe.Batch = Batch;
            myZuoYe.TrueCollect = TrueCollect;

            myRKZY.PW_WarehousingManageGoodsFeedbackTable.AddObject(myZuoYe);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库理货反馈
        /// <summary>
        /// 可以将理货反馈里的货品进行删除,单击表格里删除图标,可以删除一条信息
        /// </summary>
        /// <param name="WarehousingManageGoodsFeedbackID">理货反馈ID</param>
        /// <returns>Json</returns>
        public ActionResult DelectWarehousingManageGoodsFeedback(int WarehousingManageGoodsFeedbackID) 
        {
            var myZuoYe = (from tbZuoYe in myRKZY.PW_WarehousingManageGoodsFeedbackTable
                           where tbZuoYe.WarehousingManageGoodsFeedbackID == WarehousingManageGoodsFeedbackID
                           select tbZuoYe).Single<Models.PW_WarehousingManageGoodsFeedbackTable>();

            myRKZY.DeleteObject(myZuoYe);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
       #region 查询入库作业
        /// <summary>
        /// 入库反馈界面,要将入库作业的信息全部查询出来
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult SelectWarehousingWork()
        {
            var dtZuoYe = from tbZuoYe in myRKZY.PW_WarehousingWorkTable
                          join tbResourceScheduling in myRKZY.PW_WarehousingResourceSchedulingTable on tbZuoYe.WarehousingResourceSchedulingID equals tbResourceScheduling.WarehousingResourceSchedulingID
                          join tbOperateType in myRKZY.SYS_AttributeDetailedTable on tbZuoYe.OperateTypeID equals tbOperateType.AttributeDetailedID
                                           select new
                                           {
                                               WarehousingWorkID = tbZuoYe.WarehousingWorkID,
                                               WarehousingResourceSchedulingID = tbZuoYe.WarehousingResourceSchedulingID,
                                               WorkNumber = tbZuoYe.WorkNumber,
                                               OperateTypeID = tbZuoYe.OperateTypeID,
                                               OperateType = tbOperateType.AttributeDetailedName
                                           };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtZuoYe)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 查询入库上架明细表
        /// <summary>
        /// 单击入库反馈查询界面的表格,获取入库反馈ID,根据ID,将入库反馈的货品上架明细信息    
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈ID</param>
        /// <returns>Json</returns>
        public ActionResult SelectWarehousingGroundingDetailed(int WarehousingFeedbackID)
        {
            var dtZuoYe = from tbZuoYe in myRKZY.PW_WarehousingGroundingDetailedTable
                          join tbStorage in myRKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
                          join tbDistrict in myRKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
                          join tbGoods in myRKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
                          join tbUnit in myRKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
                          join tbQualityState in myRKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
                          where tbZuoYe.WarehousingFeedbackID == WarehousingFeedbackID
                            select new
                            {
                                WarehousingGroundingDetailedID = tbZuoYe.WarehousingGroundingDetailedID,
                                WarehousingFeedbackID = tbZuoYe.WarehousingFeedbackID,
                                WarehousingManageGoodsFeedbackID = tbZuoYe.WarehousingManageGoodsFeedbackID,
                                StorageID = tbZuoYe.StorageID,
                                GoodsID = tbZuoYe.GoodsID,
                                QualityStateID = tbZuoYe.QualityStateID,
                                Batch = tbZuoYe.Batch,
                                Quantity = tbZuoYe.Quantity,
                                StorageNumber = tbStorage.StorageNumber,
                                DistrictCoding = tbDistrict.DistrictCoding,
                                GoodsCoding = tbGoods.GoodsCoding,
                                GoodsName = tbGoods.GoodsName,
                                Standard = tbGoods.Standard,
                                Model = tbGoods.Model,
                                UnitID = tbGoods.UnitID,
                                Unit = tbUnit.AttributeDetailedName,
                                QualityState = tbQualityState.AttributeDetailedName
                            };
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtZuoYe)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 模糊查询入库反馈表
        /// <summary>
        /// 入库反馈查询界面,当界面传过来的参数不为空值,则根据传过来的参数查询信息,若为空值,则查询全部信息
        /// </summary>
        /// <param name="NeiRong">内容</param>
        /// <returns>Json</returns>
        public ActionResult MoHuSelectWarehousingFeedback(string NeiRong)
        {
            var dtZuoYe = from tbZuoYe in myRKZY.PW_WarehousingFeedbackTable
                          join tbWarehousingIndent in myRKZY.PW_OrdersInformationTable on tbZuoYe.OrdersWarehousingInformationID equals tbWarehousingIndent.OrdersInformationID
                          join tbOrdersWarehousingInformation in myRKZY.PW_OrdersWarehousingInformationTable on tbWarehousingIndent.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
                          join tbClient in myRKZY.SYS_ClientTable on tbWarehousingIndent.ClientID equals tbClient.ClientID
                          join tbOrdersType in myRKZY.SYS_AttributeDetailedTable on tbWarehousingIndent.OrdersTypeID equals tbOrdersType.AttributeDetailedID
                          join tbState in myRKZY.SYS_AttributeDetailedTable on tbWarehousingIndent.StateID equals tbState.AttributeDetailedID
                          join tbPledgeBank in myRKZY.SYS_BankTable on tbWarehousingIndent.PledgeBankID equals tbPledgeBank.BankID
                          join tbWarehousingWarningResourceScheduling in myRKZY.PW_WarehousingResourceSchedulingTable on tbZuoYe.WarehousingFeedbackID equals tbWarehousingWarningResourceScheduling.WarehousingFeedbackID
                          select new
                          {
                              WarehousingFeedbackID = tbZuoYe.WarehousingFeedbackID,
                              OrdersInformationID = tbZuoYe.OrdersWarehousingInformationID,
                              OrdersWarehousingInformationID = tbOrdersWarehousingInformation.OrdersWarehousingInformationID,
                              WorkPlanNumber = tbZuoYe.WorkPlanNumber,
                              OrdersMark = tbWarehousingIndent.OrdersMark,
                              ClientID = tbWarehousingIndent.ClientID,
                              ClientCode = tbClient.ClientCode,
                              OrdersType = tbOrdersType.AttributeDetailedName,
                              State = tbState.AttributeDetailedName,
                              PledgeBank = tbPledgeBank.BankName,
                              NeedGrossWeight = tbWarehousingWarningResourceScheduling.NeedGrossWeight,
                              NeedGrossBulk = tbWarehousingWarningResourceScheduling.NeedGrossBulk
                          };
            if (NeiRong != "")//满足条件,根据条件查询,不满足条件,查询全部数据
            {
                dtZuoYe = dtZuoYe.Where(tbOrders => tbOrders.WorkPlanNumber.Contains(NeiRong.Trim()));
            }
            List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
            foreach (var item in dtZuoYe)
            {
                Dictionary<string, object> itemOrdersInformation = new Dictionary<string, object>();
                foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
                {
                    itemOrdersInformation.Add(p.Name, p.GetValue(item, null));
                }
                ListReturn.Add(itemOrdersInformation);
            }
            return Json(ListReturn, JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region 新增入库反馈表
        /// <summary>
        /// 预处理完成后,要对预处理订单进行反馈,接收界面参数,新增入库反馈信息
        /// </summary>
        /// <param name="OrdersWarehousingInformationID">订单入库信息ID</param>
        /// <param name="WorkPlanNumber">作业计划单号</param>
        /// <returns>int</returns>
        public int InsertWarehousingFeedback(int OrdersWarehousingInformationID, string WorkPlanNumber)
        {
            Models.PW_WarehousingFeedbackTable myZuoYe = new Models.PW_WarehousingFeedbackTable();
            myZuoYe.OrdersWarehousingInformationID = OrdersWarehousingInformationID;
            myZuoYe.WorkPlanNumber = WorkPlanNumber;

            myRKZY.PW_WarehousingFeedbackTable.AddObject(myZuoYe);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                int WarehousingFeedbackID = (from tbID in myRKZY.PW_WarehousingFeedbackTable select tbID.WarehousingFeedbackID).Max();
                return WarehousingFeedbackID;//反馈新增数据的主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 新增入库上架明细表
        /// <summary>
        /// 入库反馈信息新增后,要新增入库货品上架信息,根据界面层传过来的参数,进行新增上架信息
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈ID</param>
        /// <param name="StorageID">储位ID</param>
        /// <param name="GoodsID">货品ID</param>
        /// <param name="Batch">批次</param>
        /// <param name="Quantity">数量</param>
        /// <param name="QualityStateID">质量状态ID</param>
        /// <returns>Json</returns>
        public ActionResult InsertWarehousingGroundingDetailed(int WarehousingFeedbackID, int StorageID, int GoodsID, decimal Batch,
                                                              decimal Quantity, int QualityStateID)
        {
            Models.PW_WarehousingGroundingDetailedTable myZuoYe = new Models.PW_WarehousingGroundingDetailedTable();

            myZuoYe.WarehousingFeedbackID = WarehousingFeedbackID;
            myZuoYe.StorageID = StorageID;
            myZuoYe.GoodsID = GoodsID;
            myZuoYe.Batch = Batch;
            myZuoYe.Quantity = Quantity;
            myZuoYe.QualityStateID = QualityStateID;

            myRKZY.PW_WarehousingGroundingDetailedTable.AddObject(myZuoYe);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 新增入库资源调度表
        /// <summary>
        /// 新增入库资源调度,接收界面参数
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈IID</param>
        /// <param name="NeedGrossWeight">需要总数量</param>
        /// <param name="NeedGrossBulk">需要总体积</param>
        /// <returns></returns>
        public int InsertWarehousingResourceScheduling(int WarehousingFeedbackID, decimal NeedGrossWeight, decimal NeedGrossBulk)
        {
            Models.PW_WarehousingResourceSchedulingTable myZuoYe = new Models.PW_WarehousingResourceSchedulingTable();

            myZuoYe.WarehousingFeedbackID = WarehousingFeedbackID;
            myZuoYe.NeedGrossWeight = NeedGrossWeight;
            myZuoYe.NeedGrossBulk = NeedGrossBulk;

            myRKZY.PW_WarehousingResourceSchedulingTable.AddObject(myZuoYe);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                int WarehousingResourceSchedulingID = (from tbID in myRKZY.PW_WarehousingResourceSchedulingTable select tbID.WarehousingResourceSchedulingID).Max();
                return WarehousingResourceSchedulingID;//反馈新增数据主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 新增入库作业表
        /// <summary>
        /// 上面反回的入库资源调度ID,在入库作业做外键,新增入库作业信息
        /// </summary>
        /// <param name="WarehousingResourceSchedulingID">入库资源调度ID</param>
        /// <param name="WorkNumber">作业单号</param>
        /// <param name="OperateTypeID">作业类型ID</param>
        /// <returns></returns>
        public ActionResult InsertWarehousingWork(int WarehousingResourceSchedulingID, string WorkNumber, int OperateTypeID)
        {
            Models.PW_WarehousingWorkTable myZuoYe = new Models.PW_WarehousingWorkTable();

            myZuoYe.WarehousingResourceSchedulingID = WarehousingResourceSchedulingID;
            myZuoYe.WorkNumber = WorkNumber;
            myZuoYe.OperateTypeID = OperateTypeID;

            myRKZY.PW_WarehousingWorkTable.AddObject(myZuoYe);
            int i = myRKZY.SaveChanges();
            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库反馈表
        /// <summary>
        /// 点击入库反馈查询界面表格里的删除图标,获取入库反馈ID,根据ID,删除入库反馈信息
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈ID</param>
        /// <returns>Json</returns>
        public ActionResult DelectWarehousingFeedback(int WarehousingFeedbackID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingFeedbackTable
                            where tbOrders.WarehousingFeedbackID == WarehousingFeedbackID
                            select tbOrders).Single<Models.PW_WarehousingFeedbackTable>();

            myRKZY.DeleteObject(dtOrders);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库资源调度表
        /// <summary>
        /// 入库资源调度是入库反馈的子表,当入库反馈信息删除后,要根据入库反馈ID,删除入库资源调度信息
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈ID</param>
        /// <returns>int</returns>
        public int DelectWarehousingResourceScheduling(int WarehousingFeedbackID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingResourceSchedulingTable
                            where tbOrders.WarehousingFeedbackID == WarehousingFeedbackID
                            select tbOrders).Single<Models.PW_WarehousingResourceSchedulingTable>();

            int WarehousingResourceSchedulingID = dtOrders.WarehousingResourceSchedulingID;//获取将要删除的数据的主键ID
            myRKZY.DeleteObject(dtOrders);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return WarehousingResourceSchedulingID;//返回主键ID值
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region 删除入库作业表
        /// <summary>
        /// 根据入库资源调度ID,删除入库作业
        /// </summary>
        /// <param name="WarehousingResourceSchedulingID">入库资源调度ID</param>
        /// <returns>Json</returns>
        public ActionResult DelectWarehousingWork(int WarehousingResourceSchedulingID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingWorkTable
                            where tbOrders.WarehousingResourceSchedulingID == WarehousingResourceSchedulingID
                            select tbOrders).Single<Models.PW_WarehousingWorkTable>();

            myRKZY.DeleteObject(dtOrders);
            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion
        #region 删除入库上架明细表
        /// <summary>
        /// 入库反馈信息删除后,要入库反馈ID删除入库反馈信息的货品信息
        /// </summary>
        /// <param name="WarehousingFeedbackID">入库反馈ID</param>
        /// <returns></returns>
        public ActionResult DelectWarehousingGroundingDetailed(int WarehousingFeedbackID)
        {
            var dtOrders = (from tbOrders in myRKZY.PW_WarehousingGroundingDetailedTable
                            where tbOrders.WarehousingFeedbackID == WarehousingFeedbackID
                            select tbOrders).ToList<Models.PW_WarehousingGroundingDetailedTable>();

            for (int j = 0; j < dtOrders.Count; j++)//多条货品信息,要循环删除
            {
                myRKZY.DeleteObject(dtOrders[j]);
            }

            int i = myRKZY.SaveChanges();

            if (i > 0)
            {
                return Json("true", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("false", JsonRequestBehavior.AllowGet);
            }
        }
        #endregion

第三步:视图层(Views)


2.2.1图(9)

入库作业界面效果图:


2.2.1图(10)

入库预处理效果截图:


2.2.1图(11)

入库反馈效果截图:


2.2.1图(12)

HTML代码:

<!DOCTYPE html>
<html>
<head>
   <meta content="text/javascript;charset=utf-8"/>  //<head>标签里的是jQuery包的引用
      <link rel="stylesheet" type="text/css" href="../../Content/themes/jquery-easyui-1.3.3/themes/default/easyui.css"/>
	  <link rel="stylesheet" type="text/css" href="../../Content/themes/jquery-easyui-1.3.3/themes/icon.css"/>
	  <link rel="stylesheet" type="text/css" href="../../Content/themes/jquery-easyui-1.3.3/demo/demo.css"/>
	  <script type="text/javascript" src="../../Content/themes/jquery-easyui-1.3.3/jquery.min.js"></script>
 <script type="text/javascript" src="../../Content/themes/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
</head>
<body>
   <div id="tbRuKuZuoYe" class="easyui-tabs" style="border-style: none; margin-top: -18px; margin-left: -17px; margin-right: -18px;">
     <div title="入库作业" style="padding:10px;width:auto; height:auto;border-style: none;">
      <table style="margin-left: 20px; margin-top: 5px;">
          <tr>
            <td align="right"><strong style="font-size: medium">订单号:</strong></td><td>
                <input type="text" id="txtdingdanhao" style="border-style: hidden hidden outset hidden; border-width: thin; width:150px; height:30px; " /></td>
            <td><input type="button" οnclick="ChaXun()" value="查 询" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
            <td><input type="button" οnclick="addRuKuYuChuLi()" value="入库预处理" style="font-size: 18px;width:auto; font-family: 楷体; color: #CC33FF" /></td>
           </tr>
        </table>
        <table id="tb入库作业" class="easyui-datagrid" style="width:auto; height:400px;" data-options="singleSelect:true,scrolling:true,
        url:'/RuKuZuoYe/ChaXunJiBenXinXi?NeiRong='">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'OrdersInformationID',width:50,hidden:true,align:'center'">订单信息ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:50,hidden:true,align:'center'">订单入库信息ID</th>
                <th data-options="field:'OrdersMark',width:120,editor:'true',align:'center'">订单号</th>
                <th data-options="field:'ClientCode',width:100,editor:'true',align:'center'">客户码</th>
                <th data-options="field:'OrdersSource',width:100,editor:'true',align:'center'">订单来源</th>
                <th data-options="field:'StoreroomCoding',width:100,editor:'true',align:'center'">库房编码</th>
                <th data-options="field:'WarehousingWay',width:100,editor:'true',align:'center'">入库方式</th>
                <th data-options="field:'State',width:100,editor:'true',align:'center'">状态</th>
                <th data-options="field:'PledgeBank',width:120,editor:'true',align:'center'">质押银行</th>
                <th data-options="field:'Note',width:120,editor:'true',align:'center'">备注</th>
               </tr>
             </thead>
           </table>
     </div>
     <div title="入库预处理查询" style="padding:5px;width:auto; height:auto;border-style: none;">
        <table style="margin-left: 20px; margin-top: 10px;">
          <tr>
            <td align="right"><strong style="font-size: medium">作业计划单号:</strong></td><td>
                <input type="text" id="ZuoYeJiHuaDan" style="border-style: hidden hidden outset hidden; border-width: thin; width:150px; height:30px; " /></td>
            <td><input type="button" οnclick="YuChuLiChaXun()" value="查 询" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
            <td><input type="button" οnclick="addRuKuFanKui()" value="作业计划单反馈" style="font-size: 18px;width:auto; font-family: 楷体; color: #CC33FF" /></td>
           </tr>
        </table>
        <table id="tb入库预处理" class="easyui-datagrid" style="width:auto; height:200px;" data-options="singleSelect:true,scrolling:true,
        url:'/RuKuZuoYe/MoHuSelectWarehousingPretreatment?NeiRong=',
        onClickRow:SelectWarehousingWarningGrounding">
             <thead>
               <tr>
                <th data-options="field:'WarehousingPretreatmentID',width:50,align:'center',formatter:returnBtnXiuGai"><img src="../../Content/图片/修改.png" /></th>
                <th data-options="field:'WarehousingIndentID',width:100,align:'center',hidden:'true'">入库订单ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">订单入库信息ID</th>
                <th data-options="field:'WorkPlanNumber',width:100,align:'center'">作业计划单号</th>
                <th data-options="field:'OrdersMark',width:100,editor:'true',align:'center'">订单号</th>
                <th data-options="field:'ClientCode',width:100,editor:'true',align:'center'">客户码</th>
                <th data-options="field:'State',width:100,editor:'true',align:'center'">状态</th>
                <th data-options="field:'PledgeBank',width:100,editor:'true',align:'center'">质押银行</th>           
                <th data-options="field:'NeedGrossWeight',width:80,align:'center'">需要总重量</th>
                <th data-options="field:'NeedGrossBulk',width:80,align:'center'">需要总体积</th>
                <th data-options="field:'ID',width:50,align:'center',formatter:returnBtnShanChu"><img src="../../Content/图片/删除.jpg" /></th>
               </tr>
             </thead>
           </table>
        <table id="tb入库预处理明细" title="入库预处理明细" class="easyui-datagrid" style="width:auto; height:150px;" data-options="singleSelect:true,scrolling:true">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'WarehousingWarningGroundingID',width:100,align:'center',hidden:'true'">入库预处理ID</th>
                <th data-options="field:'StorageNumber',width:100,align:'center'">储位编码</th>
                <th data-options="field:'DistrictCoding',width:100,editor:'true',align:'center'">区编码</th>
                <th data-options="field:'GoodsName',width:100,editor:'true',align:'center'">货品名称</th>
                <th data-options="field:'GoodsCoding',width:100,editor:'true',align:'center'">货品编码</th>
                <th data-options="field:'Standard',width:100,align:'center'">规格</th>
                <th data-options="field:'Model',width:100,editor:'true',align:'center'">型号</th>           
                <th data-options="field:'Unit',width:80,align:'center'">单位</th>
                <th data-options="field:'QualityState',width:80,align:'center'">质量</th>  
               </tr>
             </thead>
           </table>
      </div>
     <div title="入库反馈查询" style="padding:5px;width:auto; height:auto;border-style: none;">
       <table style="margin-left: 20px; margin-top: 10px;">
          <tr>
            <td align="right"><strong style="font-size: medium">作业计划单号:</strong></td><td>
                <input type="text" id="ZuoYeJiHuadan" style="border-style: hidden hidden outset hidden; border-width: thin; width:150px; height:30px; " /></td>
            <td><input type="button" οnclick="FanKuiChaXun()" value="查 询" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
           </tr>
        </table>
        <table id="tb入库反馈" class="easyui-datagrid" style="width:auto; height:200px;" data-options="singleSelect:true,scrolling:true,
        url:'/RuKuZuoYe/MoHuSelectWarehousingFeedback?NeiRong=',
        onClickRow:SelectWarehousingGroundingDetailed">
             <thead>
               <tr>
                <th data-options="field:'WarehousingFeedbackID',width:50,align:'center',formatter:returnBtnFKXiuGai"><img src="../../Content/图片/修改.png" /></th>
                <th data-options="field:'OrdersInformationID',width:100,align:'center',hidden:'true'">入库订单ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">订单入库信息ID</th>
                <th data-options="field:'WorkPlanNumber',width:100,align:'center'">作业计划单号</th>
                <th data-options="field:'OrdersMark',width:100,editor:'true',align:'center'">订单号</th>
                <th data-options="field:'ClientCode',width:100,editor:'true',align:'center'">客户码</th>
                <th data-options="field:'State',width:100,editor:'true',align:'center'">状态</th>
                <th data-options="field:'PledgeBank',width:100,editor:'true',align:'center'">质押银行</th>           
                <th data-options="field:'NeedGrossWeight',width:80,align:'center'">需要总重量</th>
                <th data-options="field:'NeedGrossBulk',width:80,align:'center'">需要总体积</th>
                <th data-options="field:'ID',width:50,align:'center',formatter:returnBtnFKShanChu"><img src="../../Content/图片/删除.jpg" /></th>
               </tr>
             </thead>
           </table>
        <table id="tb入库反馈明细" title="入库反馈明细" class="easyui-datagrid" style="width:auto; height:150px;" data-options="singleSelect:true,scrolling:true">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'WarehousingWarningGroundingID',width:100,align:'center',hidden:'true'">入库预处理ID</th>
                <th data-options="field:'StorageNumber',width:100,align:'center'">储位编码</th>
                <th data-options="field:'DistrictCoding',width:100,editor:'true',align:'center'">区编码</th>
                <th data-options="field:'GoodsName',width:100,editor:'true',align:'center'">货品名称</th>
                <th data-options="field:'GoodsCoding',width:100,editor:'true',align:'center'">货品编码</th>
                <th data-options="field:'Standard',width:100,align:'center'">规格</th>
                <th data-options="field:'Model',width:100,editor:'true',align:'center'">型号</th>           
                <th data-options="field:'Unit',width:80,align:'center'">单位</th>
                <th data-options="field:'QualityState',width:80,align:'center'">质量</th>  
               </tr>
             </thead>
           </table>
      </div>
  </div>
  <div id="tbRuKuYuChuLi" class="easyui-panel" data-options="closed:true" style="border-style: none ;width:auto; height:auto;">
      <div class="easyui-tabs" style="border-width: thick; border-style: none;">
        <div title="上架调度" style="padding:10px;width:auto; height:auto;border-style: none;">
         <div>
          区编码:<input type="text" id="txtQuBianMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          储位编码:<input type="text" id="txtChuWeiBianMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          <input type="button" οnclick="XuanZe()" value="[选择]" style="color: #FF0000; border-style: none;" />
          货品编码:<input type="text" id="txtHuoPinBianMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          批次:<input type="text" id="txtPiCi" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          质量状态:<input class="easyui-combobox" id="cboZhiLiangZhuangTai" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          数量:<input type="text" id="txtShuLiangs" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          <input type="button" οnclick="ShangJia()" value="上架" style="font-size: 18px; font-family: 微软雅黑; font-weight: 200;" />
         </div>
         <div>
           <a style="color: #FF0000;font-size: 18px; font-family: 微软雅黑; font-weight: 200;">已上架货品:</a>
           <table id="tb已上架货品" class="easyui-datagrid" style="width:auto; height:120px;" data-options="singleSelect:true,scrolling:true">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'OrdersInformationID',width:100,align:'center',hidden:'true'">订单信息ID</th>
                <th data-options="field:'OrdersWarehousingDetailedID',width:100,align:'center',hidden:'true'">入库明细ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">入库订单信息ID</th>
                <th data-options="field:'StorageID',width:100,align:'center',hidden:'true'">储位ID</th>
                <th data-options="field:'DistrictCoding',width:100,align:'center'">区编码</th>
                <th data-options="field:'StorageNumber',width:100,editor:'true',align:'center'">储位编码</th>
                <th data-options="field:'GoodsID',width:100,align:'center',hidden:'true'">货品ID</th>
                <th data-options="field:'GoodsCoding',width:100,editor:'true',align:'center'">货品编码</th>
                <th data-options="field:'GoodsName',width:100,editor:'true',align:'center'">货品名称</th>
                <th data-options="field:'Standard',width:100,align:'center'">规格</th>
                <th data-options="field:'Model',width:100,editor:'true',align:'center'">型号</th>           
                <th data-options="field:'Batch',width:80,align:'center'">批次</th>
                <th data-options="field:'QualityID',width:80,align:'center',hidden:'true'">质量状态ID</th>
                <th data-options="field:'Quality',width:80,align:'center'">质量状态</th>           
                <th data-options="field:'Unit',width:80,align:'center'">单位</th>
                <th data-options="field:'Quantity',width:80,align:'center'">数量</th>
                <th data-options="field:'id',width:80,align:'center',formatter:returnBtnQuXiao"></th>
               </tr>
             </thead>
           </table>
         </div>
         <div>
           <a style="color: #FF0000;font-size: 18px; font-family: 微软雅黑; font-weight: 200;">待上架货品:</a>
           <table id="tb待上架货品" class="easyui-datagrid" style="width:auto; height:130px;" data-options="singleSelect:true,scrolling:true,
                                                                                            onClickRow:onClickRowQiYongEdit,onDblClickRow:DblHuoPinDatagrid">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'OrdersWarehousingDetailedID',width:100,align:'center',hidden:'true'">入库明细ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">入库订单信息ID</th>
                <th data-options="field:'GoodsID',width:100,align:'center',hidden:'true'">货品ID</th>
                <th data-options="field:'GoodsCoding',width:100,align:'center'">货品编码</th>
                <th data-options="field:'GoodsName',width:100,align:'center'">货品名称</th>
                <th data-options="field:'Standard',width:100,align:'center'">规格</th>
                <th data-options="field:'Model',width:100,align:'center'">型号</th>
                <th data-options="field:'Batch',width:100,align:'center'">批次</th>
                <th data-options="field:'Quality',width:100,align:'center'">质量状态</th>
                <th data-options="field:'QualityID',width:100,align:'center',hidden:'true'">质量状态ID</th>           
                <th data-options="field:'Unit',width:100,editor:'true',align:'center'">单位</th>
                <th data-options="field:'Quantity',width:100,align:'center'">作业总数</th>
                <th data-options="field:'ShuLiang',width:100,editor:'numberbox',align:'center'">待上架数量</th>
               </tr>
             </thead>
           </table>
         </div>
         <div>
         <input type="button" value="打印储位分配单" style="font-size: 10px; font-family: 微软雅黑; font-weight: 200;" />
         <input type="button" value="打印入库单" style="font-size: 10px; font-family: 微软雅黑; font-weight: 200;" />
         </div>
        </div>
        <div title="资源调度" style="padding:10px;width:auto; height:auto;border-style: none;">
         <div>
          需要进行作业的货品总重量为:<input type="text" οnkeyup="PanDuanChengZhong()"  id="HuoPinZongZhongLiang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /><br />
          需要进行作业的货品总体积为:<input type="text" οnkeyup="PanDuanTiJi()" id="HuoPinZongTiJi" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
         </div>
         <div>
           <table class="easyui-datagrid" style="width:450px; height:150px;" data-options="singleSelect:true,scrolling:true,
                                                                             url:'/RuKuZuoYe/SelectWarehousingWarningWork'">
              <thead>
               <tr>
                <th data-options="field:'ID',width:50,align:'center'"><img src="../../Content/图片/修改.png" /></th>
                <th data-options="field:'WorkNumber',width:100,align:'center'">作业单号</th>
                <th data-options="field:'OperateType',width:100,editor:'true',align:'center'">操作类型</th>
                <th data-options="field:'WarehousingWarningWorkID',width:90,align:'center',formatter:returnBtnZuoYeZiYuan"></th>
               </tr>
             </thead>
           </table>
         </div>
        </div>
        <div title="基本信息" style="padding:10px;width:auto; height:auto;border-style: none;">
          <table style="margin-left: 30px;">
            <tr>
             <td align="right"><strong style="font-size: medium">作业计划单号:</strong></td><td>
             <input type="text" id="txtZuoYeJiHuaDanHao" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td>
             <td align="right"><strong style="font-size: medium">订单号:</strong></td><td>
             <input type="text" id="txtDingDanHao" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">客户码:</strong></td><td>
             <input type="text" id="txtKuHuMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td>
             <td align="right"><strong style="font-size: medium">类型:</strong></td><td>
             <input type="text" id="txtLeiXing" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">库房编码:</strong></td><td>
             <input type="text" id="txtKuFangBianMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td> 
             <td align="right"><strong style="font-size: medium">状态:</strong></td><td>
             <input type="text" id="txtZhuangTai" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">质押银行:</strong></td><td>
             <input type="text" id="txtZhiYaYinHang" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
          </table>
        </div>
      </div>
      <div style="margin-left: 400px;"><input type="button" οnclick="InsertWarehousingPretreatment()" value="调度完成" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></div>
  </div>
  <div id="tbRuKuFanKui" class="easyui-panel" data-options="closed:true" style="border-style: none ;width:auto; height:auto;">
      <div class="easyui-tabs" style="border-style: none;">
        <div title="理货反馈" style="padding:10px;width:auto; height:auto;border-style: none;">
          <div>
           <table id="tb理货反馈" class="easyui-datagrid" style="width:auto; height:120px;" data-options="singleSelect:true,scrolling:true,
           onClickRow:onClickRowQiYongEdit,
           url:'/RuKuZuoYe/SelectWarehousingManageGoodsFeedback'">
             <thead>
               <tr>
                <th data-options="field:'WarehousingWarningGroundingID',width:100,align:'center',hidden:'true'">入库预上架ID</th>
                <th data-options="field:'GoodsCoding',width:80,align:'center'">货品编码</th>
                <th data-options="field:'GoodsName',width:80,align:'center'">货品名称</th>
                <th data-options="field:'Standard',width:80,align:'center'">规格</th>
                <th data-options="field:'Model',width:80,align:'center'">型号</th>           
                <th data-options="field:'Batch',width:80,align:'center'">批次</th>
                <th data-options="field:'QualityState',width:80,align:'center'">质量状态</th>           
                <th data-options="field:'Unit',width:80,align:'center'">单位</th>
                <th data-options="field:'Quantity',width:80,align:'center'">应收</th>
                <th data-options="field:'Quantity',width:80,align:'center'">未上架数量</th>
                <th data-options="field:'TrueCollect',width:80,editor:'numberbox',align:'center'">实收</th>
                <th data-options="field:'ID',width:50,align:'center',formatter:returnBtnShanchu"><img src="../../Content/图片/删除.jpg" /></th>
               </tr>
             </thead>
           </table>
           <table style="margin-left: 400px;">
             <tr>
                <td><input type="button" οnclick="BaoCunXiuGai()" value="保存修改" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
             </tr>
           </table>
          </div>
          <div>
            <a style="color: #FF0000;font-size: 18px; font-family: 微软雅黑; font-weight: 200;">增加计划外货品</a><br />
            <br />
            <table>
              <tr>
              <td>货品编码   <input type="text" id="txtHuoPinBianma" οnclick="SelectEWaiHuoPin()" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /></td>
              <td>货品名称   <input type="text" id="txtHuoPinMingcheng" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /></td>
              <td>规格    <input type="text" id="txtGuige" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /></td>
              <td>批次   <input type="text" id="txtPici" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /></td>
              </tr>
              <tr>
              <td>单位    <input class="easyui-combobox" id="cboDanWei" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /></td>
              <td>质量    <input class="easyui-combobox" id="cboZhiLiang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px;" /></td>
              <td>数量   <input class="easyui-numberbox" id="txtShuLiang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; "/></td>
              <td><input type="button" οnclick="QueDing()" value="确 定" style="font-size: 18px;width:100px; font-family: 楷体; color: #000000;" /></td>
              </tr>
            </table>
          </div>
        </div>
        <div title="上架反馈" style="padding:10px;width:auto; height:auto;border-style: none;">
         <div>
          区编码:<input type="text" id="txtQuBianma" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          储位编码:<input type="text" id="txtChuWeiBianma" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          <input type="button" οnclick="Xuanze()" value="[选择]" style="color: #FF0000; border-style: none;" />
          货品编码:<input type="text" id="txtHuoPinbianMa" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          批次:<input type="text" id="txtpiCi" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          质量状态:<input class="easyui-combobox" id="cboZhiLiangZhuangtai" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          数量:<input type="text" id="txtShuliangs" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
          <input type="button" οnclick="Shangjia()" value="上架" style="font-size: 18px; font-family: 微软雅黑; font-weight: 200;" />
         </div>
         <div>
           <a style="color: #FF0000;font-size: 18px; font-family: 微软雅黑; font-weight: 200;">已上架货品:</a>
           <table id="tb反馈已上架货品" class="easyui-datagrid" style="width:auto; height:120px;" data-options="singleSelect:true,scrolling:true">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'OrdersWarehousingDetailedID',width:100,align:'center',hidden:'true'">入库明细ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">入库订单信息ID</th>
                <th data-options="field:'WarehousingWarningGroundingID',width:100,align:'center',hidden:'true'">入库预上架ID</th>
                <th data-options="field:'StorageID',width:100,align:'center',hidden:'true'">储位ID</th>
                <th data-options="field:'DistrictCoding',width:100,align:'center'">区编码</th>
                <th data-options="field:'StorageNumber',width:100,align:'center'">储位编码</th>
                <th data-options="field:'GoodsID',width:100,align:'center',hidden:'true'">货品ID</th>
                <th data-options="field:'GoodsCoding',width:100,align:'center'">货品编码</th>
                <th data-options="field:'GoodsName',width:100,align:'center'">货品名称</th>
                <th data-options="field:'Standard',width:80,align:'center'">规格</th>
                <th data-options="field:'Model',width:80,align:'center'">型号</th>           
                <th data-options="field:'Batch',width:80,align:'center'">批次</th>
                <th data-options="field:'QualityID',width:50,align:'center',hidden:'true'">质量状态ID</th>
                <th data-options="field:'Quality',width:80,align:'center'">质量状态</th>           
                <th data-options="field:'Unit',width:80,align:'center'">单位</th>
                <th data-options="field:'Quantity',width:80,align:'center'">数量</th>
                <th data-options="field:'id',width:80,align:'center',formatter:returnBtnquXiao"></th>
               </tr>
             </thead>
           </table>
         </div>
         <div>
           <a style="color: #FF0000;font-size: 18px; font-family: 微软雅黑; font-weight: 200;">待上架货品:</a>
           <table id="tb反馈待上架货品" class="easyui-datagrid" style="width:auto; height:130px;" data-options="singleSelect:true,scrolling:true,
            onDblClickRow:DblFKHuoPinDatagrid,">
             <thead>
               <tr>
                <th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'OrdersWarehousingDetailedID',width:100,align:'center',hidden:'true'">入库明细ID</th>
                <th data-options="field:'OrdersWarehousingInformationID',width:100,align:'center',hidden:'true'">入库订单信息ID</th>
                <th data-options="field:'GoodsID',width:100,align:'center',hidden:'true'">货品ID</th>
                <th data-options="field:'GoodsCoding',width:100,align:'center'">货品编码</th>
                <th data-options="field:'GoodsName',width:100,align:'center'">货品名称</th>
                <th data-options="field:'Standard',width:100,align:'center'">规格</th>
                <th data-options="field:'Model',width:100,align:'center'">型号</th>
                <th data-options="field:'Batch',width:100,align:'center'">批次</th>
                <th data-options="field:'Quality',width:100,align:'center'">质量状态</th>
                <th data-options="field:'QualityID',width:100,align:'center',hidden:'true'">质量状态ID</th>           
                <th data-options="field:'Unit',width:100,editor:'true',align:'center'">单位</th>
                <th data-options="field:'Quantity',width:100,align:'center'">应收</th>
                <th data-options="field:'Quantity',width:100,align:'center'">未上架数量</th>
               </tr>
             </thead>
           </table>
         </div>
         <div>
         <input type="button" value="打印储位分配单" style="font-size: 10px; font-family: 微软雅黑; font-weight: 200;" />
         <input type="button" value="打印入库单" style="font-size: 10px; font-family: 微软雅黑; font-weight: 200;" />
         </div>
        </div>
        <div title="资源反馈" style="padding:10px;width:auto; height:auto;border-style: none;">
         <div>
          需要进行作业的货品总重量为:<input type="text" οnkeyup="FKPanDuanChengZhong()" id="txtHuoPinZongZhongLiang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /><br />
          需要进行作业的货品总体积为:<input type="text" οnkeyup="FKPanDuanTiJi()" id="txtHuoPinZongTiJi" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
         </div>
         <div>
           <table class="easyui-datagrid" style="width:450px; height:150px;" data-options="singleSelect:true,scrolling:true,url:'/RuKuZuoYe/SelectWarehousingWork'">
              <thead>
               <tr>
                <th data-options="field:'ID',width:50,align:'center'"><img src="../../Content/图片/修改.png" /></th>
                <th data-options="field:'WorkNumber',width:100,align:'center'">作业单号</th>
                <th data-options="field:'OperateType',width:100,editor:'true',align:'center'">操作类型</th>
                <th data-options="field:'WarehousingWorkID',width:90,align:'center',formatter:returnBtnZuoYeZiyuan"></th>
               </tr>
             </thead>
           </table>
         </div>
        </div>
        <div title="基本信息" style="padding:10px;width:auto; height:auto;border-style: none;">
          <table style="margin-left: 30px;">
            <tr>
             <td align="right"><strong style="font-size: medium">作业计划单号:</strong></td><td>
             <input type="text" id="txtZuoYeJiHuaDanhao" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td>
             <td align="right"><strong style="font-size: medium">订单号:</strong></td><td>
             <input type="text" id="txtDingDanhao" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">客户码:</strong></td><td>
             <input type="text" id="txtKuHuma" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td>
             <td align="right"><strong style="font-size: medium">类型:</strong></td><td>
             <input type="text" id="txtLeixing" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">库房编码:</strong></td><td>
             <input type="text" id="txtKuFangBianma" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
             <td>           </td> 
             <td align="right"><strong style="font-size: medium">状态:</strong></td><td>
             <input type="text" id="txtZhuangtai" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
            <tr>
             <td align="right"><strong style="font-size: medium">质押银行:</strong></td><td>
             <input type="text" id="txtZhiYaYinhang" style="border-style: hidden hidden outset hidden; border-width: thin; width:200px; height:30px; " /></td>
            </tr>
          </table>
        </div>
      </div>
      <div style="margin-left: 400px;"><input type="button" οnclick="FanKuiWangCheng()" value="反馈完成" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></div>
  </div>
  <div class="easyui-window" id="EWaiXinZenHuoPin" title="额外新增货品" style="border-style: none; width:550px; height:250px; border-radius:15px 15px 0px 0px;"
       data-options="draggable:false,resizable:false,collapsible:false,minimizable:false,maximizable:false,closed:true">
      <table id="tb额外新增货品" class="easyui-datagrid" style="width:auto; height:auto;" 
             data-options="scrolling:true,singleSelect:true,onDblClickRow:DblEWaiHuoPin">
        <thead>
           <tr>
             <th data-options="field:'WarehousingWarningGroundingID',width:50,hidden:true,align:'center'">入库预上架ID</th>
             <th data-options="field:'GoodsID',width:50,hidden:true,align:'center'">货品ID</th>
             <th data-options="field:'GoodsCoding',width:80,align:'center'">货品编码</th>
             <th data-options="field:'GoodsName',width:80,align:'center'">货品名称</th>
             <th data-options="field:'Standard',width:80,align:'center'">规格</th>
             <th data-options="field:'Model',width:80,align:'center'">型号</th>
             <th data-options="field:'UnitID',width:50,hidden:true,align:'center'">单位ID</th>
             <th data-options="field:'Unit',width:60,align:'center'">单位</th>
             <th data-options="field:'QualityStateID',width:50,hidden:true,align:'center'">质量状态ID</th>
             <th data-options="field:'QualityState',width:60,align:'center'">质量</th>
             <th data-options="field:'Quantity',width:60,align:'center'">数量</th>
           </tr>
        </thead>
      </table>
  </div>
  <div class="easyui-window" id="ChuWeiXinXi" title="储位信息" style="border-style: none; width:450px; height:250px; border-radius:15px 15px 0px 0px;"
       data-options="draggable:false,resizable:false,collapsible:false,minimizable:false,maximizable:false,closed:true">
      <table id="tb储位信息" class="easyui-datagrid" style="width:auto; height:auto;" 
             data-options="scrolling:true,singleSelect:true,onDblClickRow:DblChuWei">
        <thead>
           <tr>
             <th data-options="field:'StorageID',width:80,hidden:true,align:'center'">储位ID</th>
             <th data-options="field:'DistrictID',width:80,hidden:true,align:'center'">区ID</th>
             <th data-options="field:'StorageNumber',width:80,align:'center'">储位编码</th>
             <th data-options="field:'DistrictCoding',width:80,align:'center'">区编码</th>
             <th data-options="field:'DistrictName',width:60,align:'center'">区名称</th>
             <th data-options="field:'Cubage',width:80,align:'center'">体积</th>
             <th data-options="field:'BearWeight',width:80,align:'center'">承重</th>
           </tr>
        </thead>
      </table>
  </div>
  <div class="easyui-window" id="ChuWei" title="储位信息" style="border-style: none; width:450px; height:250px; border-radius:15px 15px 0px 0px;"
       data-options="draggable:false,resizable:false,collapsible:false,minimizable:false,maximizable:false,closed:true">
      <table id="tb储位" class="easyui-datagrid" style="width:auto; height:auto;" 
             data-options="scrolling:true,singleSelect:true,onDblClickRow:DblChuWeiXinXi">
        <thead>
           <tr>
             <th data-options="field:'StorageID',width:80,hidden:true,align:'center'">储位ID</th>
             <th data-options="field:'DistrictID',width:80,hidden:true,align:'center'">区ID</th>
             <th data-options="field:'StorageNumber',width:80,align:'center'">储位编码</th>
             <th data-options="field:'DistrictCoding',width:80,align:'center'">区编码</th>
             <th data-options="field:'DistrictName',width:60,align:'center'">区名称</th>
             <th data-options="field:'Cubage',width:80,align:'center'">体积</th>
             <th data-options="field:'BearWeight',width:80,align:'center'">承重</th>
           </tr>
        </thead>
      </table>
  </div>
</body>
</html>

jQuery代码:

<script type="text/javascript">
    $(document).ready(function () {
        XiaLaBangDing();//HTML加载时,预先执行下拉框绑定方法
    });
    function XiaLaBangDing() {
        $.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=47",
           function (data) {
               $("#cboZhiLiangZhuangTai").combobox({ data: data, valueField: 'AttributeDetailedID',
                   textField: 'AttributeDetailedName'
               });
           });
        $.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=37",
           function (data) {
               $("#cboDanWei").combobox({ data: data, valueField: 'AttributeDetailedID',
                   textField: 'AttributeDetailedName'
               });
           });
        $.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=47",
           function (data) {
               $("#cboZhiLiang").combobox({ data: data, valueField: 'AttributeDetailedID',
                   textField: 'AttributeDetailedName'
               });
           });
        $.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=47",
           function (data) {
               $("#cboZhiLiangZhuangtai").combobox({ data: data, valueField: 'AttributeDetailedID',
                   textField: 'AttributeDetailedName'
               });
           });
       }
       var OrdersInformationID = 0;
       function addRuKuYuChuLi() {//入库作业界面,点击入库预处理,执行该方法
           var row = $("#tb入库作业").datagrid('getSelected');
           if (row != null) {
               OrdersInformationID = row.OrdersInformationID;
               $('#tbRuKuZuoYe').tabs('add', {   //添加新的选项卡
                   title: '入库预处理',
                   content: $('#tbRuKuYuChuLi').panel('open'),
                   closable: true
               });
               $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + row.OrdersWarehousingInformationID,
                function (data) {
                 $('#tb待上架货品').datagrid('loadData', data);
             });
              $.getJSON("/RuKuZuoYe/BangDingDinDanXinXiByID?WarehousingIndentID=" + row.OrdersInformationID,
                function (data) {
                    $('#txtDingDanHao').attr('value', data[0].OrdersMark);
                    $('#txtKuHuMa').attr('value', data[0].ClientCode);
                    $('#txtLeiXing').attr('value', data[0].OrdersType);
                    $('#txtKuFangBianMa').attr('value', data[0].State);
                    $('#txtZhuangTai').attr('value', data[0].StoreroomCoding);
                    $('#txtZhiYaYinHang').attr('value', data[0].PledgeBank);
                });
           } else {
               alert("请先选择一行数据!!!");
           }
       }

       function ChaXun() {  //模糊查询入库作业信息
           $.getJSON("/RuKuZuoYe/ChaXunJiBenXinXi?NeiRong=" + $("#txtdingdanhao").val(), function (data) {
                   $('#tb入库作业').datagrid('loadData', data);
               });
       }
//定义一个全局变量,并把它赋值为未定义
   var editIndex = undefined;
   //启用单元格编辑状态
   function onClickRowQiYongEdit(index) {
       if (editIndex != index) {
           $('#tb待上架货品').datagrid('beginEdit', index);
           $('#tb待上架货品').datagrid('endEdit', editIndex);
           $('#tb理货反馈').datagrid('beginEdit', index);
           $('#tb理货反馈').datagrid('endEdit', editIndex);
           editIndex = index;
       }
   }
   function DblHuoPinDatagrid() { //在待上架货品中双击表格,执行双击单元格事件。
       var rowHuoPinDatagrid = $('#tb待上架货品').datagrid('getSelected');
       $('#tb待上架货品').datagrid('endEdit', editIndex);
       var ZongShu = parseInt(rowHuoPinDatagrid.Quantity);
       var ShangJiaShu = parseInt(rowHuoPinDatagrid.ShuLiang);
       if (ShangJiaShu > ZongShu) { //判断待上架数与实际要上架数的大小
           alert("待上架数【" + ShangJiaShu + "】大于作业总数【" + ZongShu + "】");
       } else {
           $("#txtHuoPinBianMa").val(rowHuoPinDatagrid.GoodsCoding);
           $("#cboZhiLiangZhuangTai").combobox('setValue', rowHuoPinDatagrid.QualityID);
           $("#txtShuLiangs").val(rowHuoPinDatagrid.ShuLiang);
       }
   }
   function XuanZe() { //点击选择按钮,打开储位信息界面
       $.getJSON("/RuKuZuoYe/SelectStorage",
                                function (data) {
                                    $('#tb储位信息').datagrid('loadData', data);
                                });
       $("#ChuWeiXinXi").window('open');

   }

   var StorageiD = 0;
   var Cubage = 0;
   var BearWeight = 0;
   function DblChuWei() {//储位信息界面的双击事件
       var row = $("#tb储位信息").datagrid('getSelected');
       if (row) {
           StorageiD = row.StorageID;
           Cubage = row.Cubage;
           BearWeight = row.BearWeight;
           $('#txtChuWeiBianMa').val(row.StorageNumber);
           $('#txtQuBianMa').val(row.DistrictCoding);
           $("#ChuWeiXinXi").window('close');
       }
   }
   function PanDuanTiJi() {    //入库预处理判断入库总体积与库存总体积
       if (parseInt($("#HuoPinZongTiJi").val()) > parseInt(Cubage)) {
           alert("货品总体积【" + parseInt($("#HuoPinZongTiJi").val()) + "】大于"
           + "库存总体积【" + parseInt(Cubage) + "】不允许入库");
       }
   }
   function PanDuanChengZhong() {    //入库预处理判断入库总重量与库存总承重
       if (parseInt($("#HuoPinZongZhongLiang").val()) > parseInt(BearWeight)) {
           alert("货品总重量【" + parseInt($("#HuoPinZongZhongLiang").val()) + "】大于"
           + "库存总承重【" + parseInt(BearWeight) + "】不允许入库");
       }
   }

   function ShangJia() {     //单击上架按钮,将待上架货品更新到已上架datagrid中。
       var rowHuoPinDatagrid = $('#tb待上架货品').datagrid('getSelected');
       var rowMingXi = $('#tb已上架货品').datagrid('getSelected');
       $('#tb已上架货品').datagrid('appendRow',
                                        { StorageID: StorageiD,
                                            OrdersInformationID: rowHuoPinDatagrid.OrdersInformationID,
                                            OrdersWarehousingDetailedID: rowHuoPinDatagrid.OrdersWarehousingDetailedID,
                                            OrdersWarehousingInformationID: rowHuoPinDatagrid.OrdersWarehousingInformationID,
                                            StorageNumber: $('#txtChuWeiBianMa').val(),
                                            DistrictCoding: $('#txtQuBianMa').val(),
                                            GoodsID: rowHuoPinDatagrid.GoodsID,
                                            GoodsCoding: $("#txtHuoPinBianMa").val(),
                                            GoodsName: rowHuoPinDatagrid.GoodsName,
                                            Standard: rowHuoPinDatagrid.Standard,
                                            Model: rowHuoPinDatagrid.Model,
                                            Batch: $("#txtPiCi").val(),
                                            UnitID: rowHuoPinDatagrid.UnitID,
                                            Unit: rowHuoPinDatagrid.Unit,
                                            QualityID: $("#cboZhiLiangZhuangTai").combobox('getValue'),
                                            Quality: $("#cboZhiLiangZhuangTai").combobox('getText'),
                                            Quantity: $("#txtShuLiangs").val()
                                        });
       var ShenYuShuLiang = parseInt(rowHuoPinDatagrid.Quantity) - parseInt($("#txtShuLiangs").val());   //上架后,改变该货品的库存数量
       $.getJSON("/RuKuZuoYe/UpdateShuLiang?OrdersWarehousingDetailedID=" + rowHuoPinDatagrid.OrdersWarehousingDetailedID +
                                                                             "&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
                                                                                 if (data == "true") {
                                                                                    $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + rowHuoPinDatagrid.OrdersWarehousingInformationID,
                                                                                    function (data) {
                                                                                        $('#tb待上架货品').datagrid('loadData', data);
                                                                                    });
                                                                                 }
                                                                             });
                                                                         }
    function returnBtnQuXiao(GoodsID, row, rowIndex) {
       return "<a href='javascript:QuXiao(" + GoodsID + "," + rowIndex + ")'>" + '<input type="button" value="取消" style="font-size: 15px;width:60px; font-family: 楷体;" />' + "</a>";
   } //单击datagrid里的取消按钮,执行下面取消方法。
   function QuXiao(GoodsID, rowIndex) {//取消后,恢复库存数量
       var row = $("#tb已上架货品").datagrid('getSelected');
       $.getJSON("/RuKuZuoYe/SelectShuLiang?OrdersWarehousingDetailedID=" + row.OrdersWarehousingDetailedID,
           function (data) {
               var ZuoYeZhongShu = data[0].Quantity;
               var ShenYuShuLiang = parseInt(row.Quantity) + parseInt(ZuoYeZhongShu);
               $.getJSON("/RuKuZuoYe/UpdateShuLiang?OrdersWarehousingDetailedID=" + row.OrdersWarehousingDetailedID +
                                                                             "&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
                                                                                 if (data == "true") {
                                                                                     $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + row.OrdersWarehousingInformationID,
                                                                                        function (data) {
                                                                                            $('#tb待上架货品').datagrid('loadData', data);
                                                                                        });
                                                                                 }
                                                                             });
           });
       $('#tb已上架货品').datagrid('cancelEdit', editIndex)
					.datagrid('deleteRow', editIndex);
   }


    function returnBtnZuoYeZiYuan(WarehousingWarningWorkID, row, rowIndex) {
       return "<a href='javascript:ZuoYeZiYuan(" + WarehousingWarningWorkID + "," + rowIndex + ")'>" + '<input type="button" value="作业资源" style="font-size: 15px;width:80px; font-family: 楷体;" />' + "</a>";
   }
   var WarehousingPretreatmentID = 0;//声明全局变量
   function InsertWarehousingPretreatment() {   //新增预处理
       if (confirm("是否添加?")) {
           $.getJSON("/RuKuZuoYe/InsertWarehousingPretreatment?WarehousingIndentID=" + OrdersInformationID +
                        "&WorkPlanNumber=" + $('#txtZuoYeJiHuaDanHao').val(),
                        function (data) {
                            WarehousingPretreatmentID = data;//反回新增预处理的最大主键ID值。
                            if (data != null) {
                                var rowMingXi = $("#tb已上架货品").datagrid('getData');//获取已上架区的全部货品,新增已上架货品信息
                                for (var i = 0; i < rowMingXi.rows.length; i++) {
                                    $.getJSON("/RuKuZuoYe/InsertWarehousingWarningGrounding?WarehousingPretreatmentID=" + WarehousingPretreatmentID +
                                                                        "&OrdersWarehousingDetailedID=" + rowMingXi.rows[i].OrdersWarehousingDetailedID +
                                                                        "&StorageID=" + rowMingXi.rows[i].StorageID +
                                                                        "&GoodsID=" + rowMingXi.rows[i].GoodsID +
                                                                        "&Batch=" + rowMingXi.rows[i].Batch +
                                                                        "&Quantity=" + rowMingXi.rows[i].Quantity +
                                                                        "&QualityStateID=" + rowMingXi.rows[i].QualityID,
                                                                        function (data) {
                                                                            if (data == "false") {
                                                                                alert("新增失败!");
                                                                            }
                                                                        });
                                }
                                $.getJSON("/RuKuZuoYe/InsertWarehousingWarningResourceScheduling?WarehousingPretreatmentID=" + WarehousingPretreatmentID +
                                "&NeedGrossWeight=" + $('#HuoPinZongZhongLiang').val() +
                                "&NeedGrossBulk=" + $("#HuoPinZongTiJi").val(), function (data) {
                                    if (data != null) {
                                        $.getJSON("/RuKuZuoYe/InsertWarehousingWarningWork?ResourceSchedulingID=" + data +
                                                    "&WorkNumber=" + $('#txtZuoYeJiHuaDanHao').val() +
                                                    "&OperateTypeID=154", function (data) {
                                                        if (data == "true") {
                                                            alert("新增成功!");
                                                            $("#tb入库预处理").datagrid('reload');
                                                        } else {
                                                            alert("新增失败!");
                                                        }
                                                    });
                                    }
                                });
                            }
                        });
       } else {
           return null;
       }
   }
    function YuChuLiChaXun() {   //入库预处理模糊查询
        $.getJSON("/RuKuZuoYe/MoHuSelectWarehousingPretreatment?NeiRong=" + $("#ZuoYeJiHuaDan").val(), function (data) {
            $('#tb入库预处理').datagrid('loadData', data);
        });
    }
    function SelectWarehousingWarningGrounding() {  //单击入库预处理,查询明细
        var row = $('#tb入库预处理').datagrid('getSelected');
        $.getJSON("/RuKuZuoYe/SelectWarehousingWarningGrounding?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
        function (data) {
            $('#tb入库预处理明细').datagrid('loadData', data);
        });
    }
    function returnBtnShanChu(WarehousingPretreatmentID, row, rowIndex) {
        return "<a href='javascript:ShanChu(" + WarehousingPretreatmentID + "," + rowIndex + ")'>" + '<img src="../../Content/图片/删除.jpg" />' + "</a>";
    }//点击入库预处理表格里的删除图标,执行删除方法
    function ShanChu() {//删除预处理数据,包括主表以下的子表
        if (confirm("是否删除?")) {
            var row = $("#tb入库预处理").datagrid('getSelected');
            $.getJSON("/RuKuZuoYe/DelectWarehousingPretreatment?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
                function (data) {
                    if (data == "true") {
                        $.getJSON("/RuKuZuoYe/DelectWarehousingWarningResourceScheduling?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
                         function (data) {
                             if (data != null) {
                                 $.getJSON("/RuKuZuoYe/DelectWarehousingWarningWork?ResourceSchedulingID=" + data,
                                 function (data) {
                                     if (data == "true") {
                                         $.getJSON("/RuKuZuoYe/DelectWarehousingWarningGrounding?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
                                         function (data) {
                                             if (data == "true") {
                                                 alert("删除成功!");
                                                 $("#tb入库预处理").datagrid('reload');
                                             }
                                         });
                                     }
                                 });
                             }
                         });
                    }
                });
        } else {
            return null;
        }
    }
}

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&入库反馈部分&&&&&&&&&&&&&&&&&&&&&&&&&&&&&//
    function returnBtnShanchu(WarehousingManageGoodsFeedbackID, row, rowIndex) {
        return "<a href='javascript:Shanchu(" + WarehousingManageGoodsFeedbackID + "," + rowIndex + ")'>" + '<img src="../../Content/图片/删除.jpg" />' + "</a>";
    }//理货反馈区,删除理货反馈货品,点击删除图标执行删除方法
    function Shanchu(WarehousingManageGoodsFeedbackID, rowIndex) {
        var row = $('#tb理货反馈').datagrid('getSelected');
        if (row.WarehousingManageGoodsFeedbackID) {
            $.getJSON("/RuKuZuoYe/DelectWarehousingManageGoodsFeedback?WarehousingManageGoodsFeedbackID=" + row.WarehousingManageGoodsFeedbackID,
            function (data) {
                if (data == "true") {
                    $("#tb理货反馈").datagrid('reload');
                }
            });
        } else {
            $('#tb理货反馈').datagrid('cancelEdit', rowIndex)
                                  .datagrid('deleteRow', rowIndex);
        }
    }

    function SelectEWaiHuoPin() {//查询额外货品
        $.getJSON("/RuKuZuoYe/SelectEWaiHuoPin",
                                function (data) {
                                    $('#tb额外新增货品').datagrid('loadData', data);
                                });
        $("#EWaiXinZenHuoPin").window('open');
    }
    var WarehousingWarningGroundingID = 0;
    function DblEWaiHuoPin() {  //双击事件
        var row = $("#tb额外新增货品").datagrid('getSelected');
        if (row) {
            WarehousingWarningGroundingID = row.WarehousingWarningGroundingID;
            $('#txtHuoPinBianma').val(row.GoodsCoding);
            $('#txtHuoPinMingcheng').val(row.GoodsName);
            $('#txtGuige').val(row.Standard);
            $('#cboDanWei').combobox('setValue', row.UnitID);
            $('#cboZhiLiang').combobox('setValue', row.QualityStateID);
            $('#txtShuLiang').numberbox('setValue', row.Quantity);
            $("#EWaiXinZenHuoPin").window('close');
        }
    }
    function QueDing() {//点击确认按钮,添加货品到理货反馈区
        var rowHuoPinDatagrid = $('#tb额外新增货品').datagrid('getSelected');
        var rowMingXi = $('#tb理货反馈').datagrid('getSelected');
        $('#tb理货反馈').datagrid('appendRow',
                                        { WarehousingWarningGroundingID: rowHuoPinDatagrid.WarehousingWarningGroundingID,
                                            GoodsCoding: $('#txtHuoPinBianma').val(),
                                            GoodsName: $("#txtHuoPinMingcheng").val(),
                                            Standard: $("#txtGuige").val(),
                                            Model: rowHuoPinDatagrid.Model,
                                            Batch: $("#txtPici").val(),
                                            Unit: $("#cboDanWei").combobox('getText'),
                                            QualityState: $("#cboZhiLiang").combobox('getText'),
                                            Quantity: $("#txtShuLiang").numberbox('getValue')
                                        });

    }
    function BaoCunXiuGai() { //保存修改,将理货反馈新添加的货品进行添加保存
        if (confirm("是否修改?")) {
            var rowMingXi = $("#tb理货反馈").datagrid('getData');
            for (var i = 0; i < rowMingXi.rows.length; i++) {
                if (rowMingXi.rows[i].WarehousingManageGoodsFeedbackID) {
                    $.getJSON("/RuKuZuoYe/UpdateWarehousingManageGoodsFeedback?WarehousingManageGoodsFeedbackID=" + rowMingXi.rows[i].WarehousingManageGoodsFeedbackID +
                "&Batch=" + rowMingXi.rows[i].Batch +
                "&TrueCollect=" + rowMingXi.rows[i].TrueCollect, function (data) { });
                } else {
                    $.getJSON("/RuKuZuoYe/InsertWarehousingManageGoodsFeedback?WarehousingWarningGroundingID=" + rowMingXi.rows[i].WarehousingWarningGroundingID +
                "&Batch=" + rowMingXi.rows[i].Batch +
                "&TrueCollect=" + rowMingXi.rows[i].TrueCollect, function (data) { });
                }
            }
            alert("修改成功!");
            $("#tb理货反馈").datagrid('reload');
        } else {
            return null;
        }
    }

   function Xuanze() {
       $.getJSON("/RuKuZuoYe/SelectStorage",
                                function (data) {
                                    $('#tb储位').datagrid('loadData', data);
                                });
                                $("#ChuWei").window('open');
   }

   var StorageID = 0;
   var TiJi = 0;
   var ChengZhong = 0;
   var DistrictID = 0;
   function DblChuWeiXinXi() {
       var row = $("#tb储位").datagrid('getSelected');
       if (row) {
           StorageID = row.StorageID;
           TiJi = row.Cubage;
           ChengZhong = row.BearWeight;
           DistrictID = row.DistrictID;
           $('#txtChuWeiBianma').val(row.StorageNumber);
           $('#txtQuBianma').val(row.DistrictCoding);
           $("#ChuWei").window('close');
       }
   }
   function FKPanDuanTiJi() {    //入库反馈判断入库总体积与库存总体积
       if (parseInt($("#txtHuoPinZongTiJi").val()) > parseInt(TiJi)) {
           alert("货品总体积【" + parseInt($("#txtHuoPinZongTiJi").val()) + "】大于"
           + "库存总体积【" + parseInt(TiJi) + "】不允许入库");
       }
   }
   function FKPanDuanChengZhong() {    //入库反馈判断入库总重量与库存总承重
       if (parseInt($("#txtHuoPinZongZhongLiang").val()) > parseInt(ChengZhong)) {
           alert("货品总重量【" + parseInt($("#txtHuoPinZongZhongLiang").val()) + "】大于"
           + "库存总承重【" + parseInt(ChengZhong) + "】不允许入库");
       }
   }
   var OrdersInformationiD = 0;
   var OrdersWarehousingInformationID = 0;
    function addRuKuFanKui() {  //点击入库反馈按钮,打开反馈界面
        var row = $("#tb入库预处理").datagrid('getSelected');
        if (row != null) {
            OrdersInformationiD = row.WarehousingIndentID;
            OrdersWarehousingInformationID = row.OrdersWarehousingInformationID;
            $('#tbRuKuZuoYe').tabs('add', {   //添加新的选项卡
                title: '入库反馈',
                content: $('#tbRuKuFanKui').panel('open'),
                closable: true
            });
            $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + row.OrdersWarehousingInformationID,
            function (data) {//查询待上架货品
                $('#tb反馈待上架货品').datagrid('loadData', data);
            });
            $.getJSON("/RuKuZuoYe/SelectWarehousingWarningGroundingByID?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
           function (data) {
               DistrictID = data[0].DistrictID;
               StorageID = data[0].StorageID;
               TiJi = data[0].Cubage;
               ChengZhong = data[0].BearWeight;
               $('#txtChuWeiBianma').attr('value', data[0].StorageNumber);
               $('#txtQuBianma').attr('value', data[0].DistrictCoding);
               $('#tb反馈已上架货品').datagrid('loadData', data);
           });
           $.getJSON("/RuKuZuoYe/SelectWarehousingWarningResourceSchedulingByID?WarehousingPretreatmentID=" + row.WarehousingPretreatmentID,
           function (data) {
               $('#txtHuoPinZongZhongLiang').attr('value', data[0].NeedGrossWeight);
               $('#txtHuoPinZongTiJi').attr('value', data[0].NeedGrossBulk);
           });
            $.getJSON("/RuKuZuoYe/BangDingDinDanXinXiByID?WarehousingIndentID=" + row.WarehousingIndentID,
            function (data) {//绑定该订单的基本信息
                $('#txtZuoYeJiHuaDanhao').attr('value', row.WorkPlanNumber);
                $('#txtDingDanhao').attr('value', data[0].OrdersMark);
                $('#txtKuHuma').attr('value', data[0].ClientCode);
                $('#txtLeixing').attr('value', data[0].OrdersType);
                $('#txtKuFangBianma').attr('value', data[0].State);
                $('#txtZhuangtai').attr('value', data[0].StoreroomCoding);
                $('#txtZhiYaYinhang').attr('value', data[0].PledgeBank);
            });
        } else {
            alert("请先选择一行数据!!!");
        }
    }

    function DblFKHuoPinDatagrid() {  //双击反馈待上架货品,将待上架货品添加到上架区
        var rowHuoPinDatagrid = $('#tb反馈待上架货品').datagrid('getSelected');
        $("#txtHuoPinbianMa").val(rowHuoPinDatagrid.GoodsCoding);
        $("#cboZhiLiangZhuangtai").combobox('setValue', rowHuoPinDatagrid.QualityID);
    }
    function Shangjia() { //点击上架按钮,将货品上架到已上架区
        var rowHuoPinDatagrid = $('#tb反馈待上架货品').datagrid('getSelected');
        $('#tb反馈已上架货品').datagrid('appendRow',
                                        { StorageID: StorageID,
                                            OrdersWarehousingInformationID: rowHuoPinDatagrid.OrdersWarehousingInformationID,
                                            OrdersWarehousingDetailedID: rowHuoPinDatagrid.OrdersWarehousingDetailedID,
                                            StorageNumber: $('#txtChuWeiBianma').val(),
                                            DistrictCoding: $('#txtQuBianma').val(),
                                            GoodsID: rowHuoPinDatagrid.GoodsID,
                                            GoodsCoding: $("#txtHuoPinbianMa").val(),
                                            GoodsName: rowHuoPinDatagrid.GoodsName,
                                            Standard: rowHuoPinDatagrid.Standard,
                                            Model: rowHuoPinDatagrid.Model,
                                            Batch: $("#txtpiCi").val(),
                                            UnitID: rowHuoPinDatagrid.UnitID,
                                            Unit: rowHuoPinDatagrid.Unit,
                                            QualityID: $("#cboZhiLiangZhuangtai").combobox('getValue'),
                                            Quality: $("#cboZhiLiangZhuangtai").combobox('getText'),
                                            Quantity: $("#txtShuliangs").val()
                                        });
   var ShenYuShuLiang = parseInt(rowHuoPinDatagrid.Quantity) - parseInt($("#txtShuliangs").val());//上架后改变库存数量
    $.getJSON("/RuKuZuoYe/UpdateShuLiang?OrdersWarehousingDetailedID=" + rowHuoPinDatagrid.OrdersWarehousingDetailedID +
                                                                            "&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
                                                                                if (data == "true") {
                                                                                    $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + OrdersWarehousingInformationID,
                                                                                        function (data) {
                                                                                            $('#tb反馈待上架货品').datagrid('loadData', data);
                                                                                        });
                                                                                }
                                                                            });
    }


    var WarehousingFeedbackID = 0;
    function FanKuiWangCheng() {//新增一条反馈信息
        if (confirm("是否反馈?")) {
            $.getJSON("/RuKuZuoYe/InsertWarehousingFeedback?OrdersWarehousingInformationID=" + OrdersInformationiD +
                                      "&WorkPlanNumber=" + $('#txtZuoYeJiHuaDanhao').val(),
                                       function (data) {
                                           WarehousingFeedbackID = data;//返回新增最大的主键ID值
                                           if (data != 0) {
                                               var rowMingXi = $('#tb反馈已上架货品').datagrid('getData');//新增反馈货品信息
                                               for (var i = 0; i < rowMingXi.rows.length; i++) {
                                                   $.getJSON("/RuKuZuoYe/InsertWarehousingGroundingDetailed?WarehousingFeedbackID=" + WarehousingFeedbackID +
                                                   "&StorageID=" + rowMingXi.rows[i].StorageID +
                                                   "&GoodsID=" + rowMingXi.rows[i].GoodsID +
                                                   "&Batch=" + rowMingXi.rows[i].Batch +
                                                   "&Quantity=" + rowMingXi.rows[i].Quantity +
                                                   "&QualityStateID=" + rowMingXi.rows[i].QualityID,
                                                   function (data) {
                                                       if (data == "false") {
                                                           alert("反馈失败!");
                                                       }
                                                   });
                                               }
                                           }
                                           $.getJSON("/RuKuZuoYe/InsertWarehousingResourceScheduling?WarehousingFeedbackID=" + WarehousingFeedbackID +
                                         "&NeedGrossWeight=" + $('#txtHuoPinZongZhongLiang').val() +
                                         "&NeedGrossBulk=" + $('#txtHuoPinZongTiJi').val(), function (data) {
                                               if (data != 0) {
                                                   $.getJSON("/RuKuZuoYe/InsertWarehousingWork?WarehousingResourceSchedulingID=" + data +
                                                   "&WorkNumber=" + +$('#txtZuoYeJiHuaDanhao').val() +
                                                   "&OperateTypeID=154", function (data) {
                                                       if (data == "true") {//改变库存体积和数量
                                                           $.getJSON("/RuKuZuoYe/UpdataQuTiJi?DistrictID=" + DistrictID +
                                                            "&TiJi=" + $("#txtHuoPinZongTiJi").val() +
                                                            "&ShuLiang=" + $('#txtHuoPinZongZhongLiang').val(), function (data) {
                                                                alert("反馈成功!");
                                                                $("#tb入库反馈").datagrid('reload');
                                                            });
                                                       } else {
                                                           alert("反馈失败!");
                                                       }
                                                   });
                                               }
                                           });
                                       });
        } else {
            return null;
        }
    }
function returnBtnquXiao(GoodsID, row, rowIndex) {
        return "<a href='javascript:quXiao(" + GoodsID + "," + rowIndex + ")'>" + '<input type="button" value="取消" style="font-size: 15px;width:60px; font-family: 楷体;" />' + "</a>";
    }//点击反馈已上架的货品里的取消按钮,执行取消方法
    function quXiao(GoodsID, rowIndex) {//取消后的货品,恢复库存数量
    var row = $("#tb反馈已上架货品").datagrid('getSelected');
    $.getJSON("/RuKuZuoYe/SelectShuLiang?OrdersWarehousingDetailedID=" + row.OrdersWarehousingDetailedID,
        function (data) {
            var ZuoYeZhongShu = data[0].Quantity;
            var ShenYuShuLiang = parseInt(row.Quantity) + parseInt(ZuoYeZhongShu);
            $.getJSON("/RuKuZuoYe/UpdateShuLiang?OrdersWarehousingDetailedID=" + row.OrdersWarehousingDetailedID +
                                                                            "&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
                                                                                if (data == "true") {
                                                                                    $.getJSON("/RuKuZuoYe/SelectWaitGroundingGoods?OrdersWarehousingInformationID=" + OrdersWarehousingInformationID,
                                                                                        function (data) {
                                                                                            $('#tb反馈待上架货品').datagrid('loadData', data);
                                                                                        });
                                                                                }
                                                                            });
        });
        $('#tb反馈已上架货品').datagrid('cancelEdit', rowIndex)
					.datagrid('deleteRow', rowIndex);
    }

    function returnBtnZuoYeZiyuan(WarehousingWarningWorkID, row, rowIndex) {
        return "<a href='javascript:ZuoYeZiYuan(" + WarehousingWarningWorkID + "," + rowIndex + ")'>" + '<input type="button" value="作业资源" style="font-size: 15px;width:80px; font-family: 楷体;" />' + "</a>";
    }
</script>
仅供学习,禁止用于商业用途





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值