北京络捷斯特第三方物流信息系统技术解析(九) 作业管理-出库作业
北京络捷斯特第三方物流信息系统技术解析(九) 作业管理-出库作业
北京络捷斯特第三方物流信息系统技术解析(九) 作业管理-出库作业
2.2.2 出库作业
出库作业分为出库预处理和出库反馈2个三级模块,出库预处理是对出库的货品的进行提前的调度处理的模块,他不会涉及真正的实施行为。而出库反馈就是真正的对货品的一个理货反馈的过程。
出库作业单是对前面订单录入中,出库订单进行一个出库作业操作流程。
在出库作业界面选择一行数据,点击出库预处理,进行预处理操作,操作完成后。在出库预处理查询界面能查询出刚才预处理完成的信息,选择该信息,点击作业计划单反馈,对该订单进行反馈操作,当反馈完成后,该作业单操作流程才算完成。
出库作业查询界面截图:2.2.2图(1)
出库预处理查询:
出库反馈查询界面:
出库作业功能实现:
第一步:数据库
1、 出库作业表和关系:
2.2.2图(4)
2、 出库预处理表和关系:
2.2.2图(5)
3、 出库反馈表和关系
2.2.2图(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_WarningOutboundTreatmentTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
WarningOutboundTreatmentID |
int |
主键 |
出库预处理ID |
|
WorkPlanNumber |
nchar(50) |
|
作业计划单号 |
|
OrdersOutboundInformationID |
int |
|
订单信息ID |
表3:出库预拣贷明细表(PW_WarningOutboundChooseGoodsDetailedTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
WarningOutboundChooseGoodsDetailedID |
int |
主键 |
出库预拣贷明细ID |
|
WarningOutboundTreatmentID |
int |
外键 |
出库预处理ID |
|
OrdersOutboundDetailedID |
int |
外键 |
订单出库明细ID |
|
StorageID |
int |
外键 |
储位ID |
|
GoodsID |
int |
外键 |
货品ID |
|
Batch |
nchar(50) |
|
批次 |
|
Quantity |
decimal(18, 2) |
|
数量 |
|
QualityStateID |
int |
|
质量状态ID |
表4:出库预资源调度表(PW_WarningOutboundResourceSchedulingTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
WarningOutboundResourceSchedulingID |
int |
主键 |
出库预资源调度ID |
|
WarningOutboundTreatmentID |
int |
外键 |
出库预处理ID |
|
NeedGrossWeight |
decimal(18, 2) |
|
需要总重量 |
|
NeedGrossBulk |
decimal(18, 2) |
|
需要总体积 |
表5:出库处理表(PW_OutboundTreatmentTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
OutboundTreatmentID |
int |
主键 |
出库处理ID |
|
WorkPlanNumber |
nchar(50) |
|
作业计划单号 |
|
OrdersOutboundInformationID |
int |
|
订单信息ID |
表6:出库拣货明细表(PW_OutboundChooseGoodsDetailedTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
OutboundChooseGoodsDetailedID |
int |
主键 |
出库拣货明细ID |
|
OutboundTreatmentID |
int |
外键 |
出库处理表ID |
|
WarningOutboundChooseGoodsDetailedID |
int |
外键 |
出库预拣贷明细ID |
|
StorageID |
int |
外键 |
储位ID |
|
GoodsID |
int |
外键 |
货品ID |
|
Batch |
nchar(50) |
|
批次 |
|
Quantity |
decimal(18, 2) |
|
数量 |
|
QualityStateID |
int |
|
质量状态ID |
表7:出库资源调度表(PW_OutboundResourceSchedulingTable)
|
列名 |
数据类型 |
主键/外键 |
说明 |
|
OutboundResourceSchedulingID |
int |
主键 |
出库资源调度ID |
|
OutboundTreatmentID |
int |
外键 |
出库处理表ID |
|
NeedGrossWeight |
decimal(18, 2) |
|
需要总重量 |
|
NeedGrossBulk |
decimal(18, 2) |
|
需要总体积 |
第二步:控制器(Controllers)
Contrlles(控制器)代码:
#region 模糊查询基本信息
/// <summary>
/// 接收界面层参数,模糊查询出库订单信息
/// </summary>
/// <param name="NeiRong">内容</param>
/// <returns>Json</returns>
public ActionResult ChaXunJiBenXinXi(string NeiRong)
{
var dtOrdersInformation = from tbOrdersInformation in myCKZY.PW_OrdersInformationTable
join tbOrdersWarehousingInformation in myCKZY.PW_OrdersOutboundInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
join tbWarehousingWay in myCKZY.SYS_AttributeDetailedTable on tbOrdersWarehousingInformation.OutboundWayID equals tbWarehousingWay.AttributeDetailedID
join tbStoreroom in myCKZY.SYS_StoreroomTable on tbOrdersWarehousingInformation.StoreroomID equals tbStoreroom.StoreroomID
join tbClient in myCKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
join tbOrdersType in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
join tbState in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
join tbOrdersSource in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersSourceID equals tbOrdersSource.AttributeDetailedID
join tbPledgeBank in myCKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
select new
{
OrdersInformationID = tbOrdersInformation.OrdersInformationID,
OrdersOutboundInformationID = tbOrdersWarehousingInformation.OrdersOutboundInformationID,
OrdersMark = tbOrdersInformation.OrdersMark,
ClientID = tbOrdersInformation.ClientID,
ClientCode = tbClient.ClientCode,
OutboundWay = 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>
/// 根据出库订单信息ID,查询出库预出理待上架的货品信息
/// </summary>
/// <param name="OrdersOutboundInformationID">出库订单信息ID</param>
/// <returns></returns>
public ActionResult SelectOutboundWaitGroundingGoods(int OrdersOutboundInformationID)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_OrdersOutboundDetailedTable
join tbGoods in myCKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
join tbQuality in myCKZY.SYS_AttributeDetailedTable on tbGoods.QualityID equals tbQuality.AttributeDetailedID
where tbZuoYe.OrdersOutboundInformationID == OrdersOutboundInformationID
select new
{
OrdersOutboundDetailedID = tbZuoYe.OrdersOutboundDetailedID,
OrdersOutboundInformationID = tbZuoYe.OrdersOutboundInformationID,
GoodsID = tbZuoYe.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 = tbZuoYe.Batch,
Quantity = tbZuoYe.Quantity,
Note = tbZuoYe.Note
};
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>
/// 根据库房ID,查询库房、区和储位的信息
/// </summary>
/// <param name="StoreroomID"></param>
/// <returns>Json</returns>
public ActionResult SelectStoreroom(int StoreroomID)
{
var dtZuoYe = from tbZuoYe in myCKZY.SYS_StoreroomTable
join tbDistrict in myCKZY.SYS_DistrictTable on tbZuoYe.StoreroomID equals tbDistrict.StoreroomID
join tbStorage in myCKZY.SYS_StorageTable on tbDistrict.DistrictID equals tbStorage.DistrictID
where tbZuoYe.StoreroomID == StoreroomID
select new
{
StoreroomID = tbZuoYe.StoreroomID,
DistrictID = tbDistrict.DistrictID,
DistrictCoding = tbDistrict.DistrictCoding,
DistrictName = tbDistrict.DistrictName,
Cubage = tbDistrict.Cubage,
BearWeight = tbDistrict.BearWeight,
StorageID = tbStorage.StorageID,
StorageNumber = tbStorage.StorageNumber
};
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);
}
/// <summary>
/// 根据区ID,修改区的体积和数量
/// </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 myCKZY.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 = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 通过ID绑定基本信息
/// <summary>
/// 根据界面层传过来的ID,查询出出库订单的基本信息。
/// </summary>
/// <param name="WarehousingIndentID">订单信息ID</param>
/// <returns></returns>
public ActionResult BangDingDinDanXinXiByID(int WarehousingIndentID)
{
var dtOrdersInformation = from tbOrdersInformation in myCKZY.PW_OrdersInformationTable
join tbOrdersOutboundInformation in myCKZY.PW_OrdersOutboundInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersOutboundInformation.OrdersInformationID
join tbStoreroom in myCKZY.SYS_StoreroomTable on tbOrdersOutboundInformation.StoreroomID equals tbStoreroom.StoreroomID
join tbClient in myCKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
join tbOrdersType in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
join tbState in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
join tbPledgeBank in myCKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
where tbOrdersInformation.OrdersInformationID == WarehousingIndentID
select new
{
OrdersInformationID = tbOrdersInformation.OrdersInformationID,
StoreroomID = tbOrdersOutboundInformation.StoreroomID,
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>
/// <param name="NeiRong">内容</param>
/// <returns></returns>
public ActionResult MoHuSelectWarningOutboundTreatment(string NeiRong)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_WarningOutboundTreatmentTable
join tbOrdersInformation in myCKZY.PW_OrdersInformationTable on tbZuoYe.OrdersOutboundInformationID equals tbOrdersInformation.OrdersInformationID
join tbOrdersWarehousingInformation in myCKZY.PW_OrdersOutboundInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersWarehousingInformation.OrdersInformationID
join tbClient in myCKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
join tbOrdersType in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
join tbState in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
join tbPledgeBank in myCKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
join tbWarningOutboundResourceScheduling in myCKZY.PW_WarningOutboundResourceSchedulingTable on tbZuoYe.WarningOutboundTreatmentID equals tbWarningOutboundResourceScheduling.WarningOutboundTreatmentID
select new
{
WarningOutboundTreatmentID = tbZuoYe.WarningOutboundTreatmentID,
OrdersInformationID = tbZuoYe.OrdersOutboundInformationID,
OrdersOutboundInformationID = tbOrdersWarehousingInformation.OrdersOutboundInformationID,
WorkPlanNumber = tbZuoYe.WorkPlanNumber,
OrdersMark = tbOrdersInformation.OrdersMark,
ClientID = tbOrdersInformation.ClientID,
ClientCode = tbClient.ClientCode,
OrdersType = tbOrdersType.AttributeDetailedName,
State = tbState.AttributeDetailedName,
PledgeBank = tbPledgeBank.BankName,
NeedGrossWeight = tbWarningOutboundResourceScheduling.NeedGrossWeight,
NeedGrossBulk = tbWarningOutboundResourceScheduling.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> 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>
/// 当界面单击预处理表格时,会根据出库预处理ID,查询出库预处理的明细信息
/// </summary>
/// <param name="WarningOutboundTreatmentID">出库预处理ID</param>
/// <returns>Json</returns>
public ActionResult SelectWarningOutboundChooseGoodsDetailed(int WarningOutboundTreatmentID)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_WarningOutboundChooseGoodsDetailedTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
join tbQualityState in myCKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
where tbZuoYe.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select new
{
WarningOutboundChooseGoodsDetailedID = tbZuoYe.WarningOutboundChooseGoodsDetailedID,
WarningOutboundTreatmentID = tbZuoYe.WarningOutboundTreatmentID,
OrdersOutboundDetailedID = tbZuoYe.OrdersOutboundDetailedID,
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> 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="OrdersOutboundInformationID">出库订单信息ID</param>
/// <param name="WorkPlanNumber">作业计划单号</param>
/// <returns>int</returns>
public int InsertWarningOutboundTreatment(int OrdersOutboundInformationID, string WorkPlanNumber)
{
Models.PW_WarningOutboundTreatmentTable myZuoYe = new Models.PW_WarningOutboundTreatmentTable();
myZuoYe.OrdersOutboundInformationID = OrdersOutboundInformationID;
myZuoYe.WorkPlanNumber = WorkPlanNumber;
myCKZY.PW_WarningOutboundTreatmentTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
int WarningOutboundTreatmentID = (from tbID in myCKZY.PW_WarningOutboundTreatmentTable select tbID.WarningOutboundTreatmentID).Max();
return WarningOutboundTreatmentID; //返回新增数据的主键ID值
}
else
{
return 0;
}
}
#endregion
#region 新增出库预拣贷明细表
/// <summary>
/// 接收界面层参数,新增出库预出理的拣货信息
/// </summary>
/// <param name="WarningOutboundTreatmentID">出库预处理ID</param>
/// <param name="OrdersOutboundDetailedID">出库明细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 InsertWarningOutboundChooseGoodsDetailed(int WarningOutboundTreatmentID, int OrdersOutboundDetailedID,
int StorageID, int GoodsID, decimal Batch,
decimal Quantity, int QualityStateID)
{
Models.PW_WarningOutboundChooseGoodsDetailedTable myZuoYe = new Models.PW_WarningOutboundChooseGoodsDetailedTable();
myZuoYe.WarningOutboundTreatmentID = WarningOutboundTreatmentID;
myZuoYe.OrdersOutboundDetailedID = OrdersOutboundDetailedID;
myZuoYe.StorageID = StorageID;
myZuoYe.GoodsID = GoodsID;
myZuoYe.Batch = Batch;
myZuoYe.Quantity = Quantity;
myZuoYe.QualityStateID = QualityStateID;
myCKZY.PW_WarningOutboundChooseGoodsDetailedTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 新增出库预资源调度表
/// <summary>
/// 接收界面层参数,新增出库预处理资源调度信息
/// </summary>
/// <param name="WarningOutboundTreatmentID">出库预处理ID</param>
/// <param name="NeedGrossWeight">需要总重量</param>
/// <param name="NeedGrossBulk">需要总体积</param>
/// <returns></returns>
public int InsertWarningOutboundResourceScheduling(int WarningOutboundTreatmentID, decimal NeedGrossWeight, decimal NeedGrossBulk)
{
Models.PW_WarningOutboundResourceSchedulingTable myZuoYe = new Models.PW_WarningOutboundResourceSchedulingTable();
myZuoYe.WarningOutboundTreatmentID = WarningOutboundTreatmentID;
myZuoYe.NeedGrossWeight = NeedGrossWeight;
myZuoYe.NeedGrossBulk = NeedGrossBulk;
myCKZY.PW_WarningOutboundResourceSchedulingTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
int WarningOutboundResourceSchedulingID = (from tbID in myCKZY.PW_WarningOutboundResourceSchedulingTable select tbID.WarningOutboundResourceSchedulingID).Max();
return WarningOutboundResourceSchedulingID;//返回新增数据的主键ID值
}
else
{
return 0;
}
}
#endregion
#region 查询订单出库明细数量
/// <summary>
/// 根据出库明细ID,将出库明细的货品里的数量查询出来
/// </summary>
/// <param name="OrdersOutboundDetailedID">出库明细ID</param>
/// <returns>Json</returns>
public ActionResult SelectShuLiang(int OrdersOutboundDetailedID)
{
var dtOrdersOutboundDetailed = from tbOrdersOutboundDetailed in myCKZY.PW_OrdersOutboundDetailedTable
where tbOrdersOutboundDetailed.OrdersOutboundDetailedID == OrdersOutboundDetailedID
select new
{
Quantity = tbOrdersOutboundDetailed.Quantity,
};
List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();
foreach (var item in dtOrdersOutboundDetailed)
{
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="OrdersOutboundDetailedID">出库明细ID</param>
/// <returns>Json</returns>
public ActionResult UpdateShuLiang(string ShenYuShuLiang, int OrdersOutboundDetailedID)
{
var myWaitGroundingGoods = (from tbWaitGroundingGoods in myCKZY.PW_OrdersOutboundDetailedTable
where tbWaitGroundingGoods.OrdersOutboundDetailedID == OrdersOutboundDetailedID
select tbWaitGroundingGoods).Single<Models.PW_OrdersOutboundDetailedTable>();
myWaitGroundingGoods.Quantity = ShenYuShuLiang;
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 修改绑定出库预调度
public ActionResult SelectWarningOutboundResourceSchedulingByID(int WarningOutboundTreatmentID)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_WarningOutboundResourceSchedulingTable
where tbZuoYe.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select new
{
WarningOutboundResourceSchedulingID = tbZuoYe.WarningOutboundResourceSchedulingID,
NeedGrossWeight = tbZuoYe.NeedGrossWeight,
NeedGrossBulk = tbZuoYe.NeedGrossBulk,
};
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 修改绑定出库预拣贷明细
public ActionResult SelectWarningOutboundChooseGoodsDetailedByID(int WarningOutboundTreatmentID)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_WarningOutboundChooseGoodsDetailedTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
join tbQualityState in myCKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
where tbZuoYe.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select new
{
WarningOutboundChooseGoodsDetailedID = tbZuoYe.WarningOutboundChooseGoodsDetailedID,
WarningOutboundTreatmentID = tbZuoYe.WarningOutboundTreatmentID,
OrdersOutboundDetailedID = tbZuoYe.OrdersOutboundDetailedID,
StorageID = tbZuoYe.StorageID,
StorageNumber = tbStorage.StorageNumber,
DistrictID = tbDistrict.DistrictID,
DistrictCoding = tbDistrict.DistrictCoding,
Cubage = tbDistrict.Cubage,
BearWeight = tbDistrict.BearWeight,
GoodsID = tbZuoYe.GoodsID,
GoodsCoding = tbGoods.GoodsCoding,
GoodsName = tbGoods.GoodsName,
Standard = tbGoods.Standard,
Model = tbGoods.Model,
UnitID = tbGoods.UnitID,
Unit = tbUnit.AttributeDetailedName,
Quality = tbQualityState.AttributeDetailedName,
Batch = tbZuoYe.Batch,
Quantity = tbZuoYe.Quantity,
QualityID = tbZuoYe.QualityStateID
};
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="WarningOutboundTreatmentID">出库预出库ID</param>
/// <returns></returns>
public ActionResult DelectWarningOutboundTreatment(int WarningOutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_WarningOutboundTreatmentTable
where tbOrders.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select tbOrders).Single<Models.PW_WarningOutboundTreatmentTable>();
myCKZY.DeleteObject(dtOrders);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 删除出库预资源调度表
/// <summary>
/// 根据界面传过来的出库预处理ID,删除出库预资源调度信息
/// </summary>
/// <param name="WarningOutboundTreatmentID">出库预处理ID</param>
/// <returns></returns>
public int DelectWarningOutboundResourceScheduling(int WarningOutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_WarningOutboundResourceSchedulingTable
where tbOrders.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select tbOrders).Single<Models.PW_WarningOutboundResourceSchedulingTable>();
int WarningOutboundResourceSchedulingID = dtOrders.WarningOutboundResourceSchedulingID;
myCKZY.DeleteObject(dtOrders);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return WarningOutboundResourceSchedulingID;
}
else
{
return 0;
}
}
#endregion
#region 删除出库预拣贷明细
/// <summary>
/// 根据出库预出理ID,将出库预处理订单的货品信息删除
/// </summary>
/// <param name="WarningOutboundTreatmentID"></param>
/// <returns></returns>
public ActionResult DelectWarningOutboundChooseGoodsDetailed(int WarningOutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_WarningOutboundChooseGoodsDetailedTable
where tbOrders.WarningOutboundTreatmentID == WarningOutboundTreatmentID
select tbOrders).ToList<Models.PW_WarningOutboundChooseGoodsDetailedTable>();
for (int j = 0; j < dtOrders.Count; j++)//该订单可能有多条货品信息,要循环删除
{
myCKZY.DeleteObject(dtOrders[j]);
}
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
//出库反馈部分//
#region 查询库存
/// <summary>
/// 在反馈界面,要将库存信息查询出来,显示在界面上
/// </summary>
/// <returns>Json</returns>
public ActionResult SelectInventory()
{
var dtZuoYe = from tbZuoYe in myCKZY.SYS_InventoryTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbStorage.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
select new
{
InventoryID = tbZuoYe.InventoryID,
JustGradeMeasure = tbZuoYe.JustGradeMeasure,
InferiorGradeMeasure = tbZuoYe.InferiorGradeMeasure,
StorageID = tbZuoYe.StorageID,
StorageNumber = tbStorage.StorageNumber,
DistrictID = tbStorage.DistrictID,
DistrictCoding = tbDistrict.DistrictCoding,
GoodsID = tbStorage.GoodsID,
GoodsCoding = tbGoods.GoodsCoding,
GoodsName = tbGoods.GoodsName,
Standard = tbGoods.Standard,
Model = tbGoods.Model,
Unit = tbUnit.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="QuBianMa">区编码</param>
/// <param name="ChuWeiBianMa">储位编码</param>
/// <param name="HuoPingBianMa">货品编码</param>
/// <param name="HuoPingMingCheng">货品名称</param>
/// <param name="GuiGe">规格</param>
/// <param name="XingHao">型号</param>
/// <returns>Json</returns>
public ActionResult IndeterminateConditionSelectInventory(string QuBianMa,string ChuWeiBianMa,string HuoPingBianMa,
string HuoPingMingCheng,string GuiGe,string XingHao)
{
var dtZuoYe = from tbZuoYe in myCKZY.SYS_InventoryTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbStorage.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
select new
{
InventoryID = tbZuoYe.InventoryID,
JustGradeMeasure = tbZuoYe.JustGradeMeasure,
InferiorGradeMeasure = tbZuoYe.InferiorGradeMeasure,
StorageID = tbZuoYe.StorageID,
StorageNumber = tbStorage.StorageNumber,
DistrictID = tbStorage.DistrictID,
DistrictCoding = tbDistrict.DistrictCoding,
GoodsID = tbStorage.GoodsID,
GoodsCoding = tbGoods.GoodsCoding,
GoodsName = tbGoods.GoodsName,
Standard = tbGoods.Standard,
Model = tbGoods.Model,
Unit = tbUnit.AttributeDetailedName
};
//下面是不同条件的组合,只要不为空值,系统会自动叠加条件,会根据你想要的条件查询
if (ChuWeiBianMa != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.StorageNumber == ChuWeiBianMa.Trim());
}
if (QuBianMa != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.DistrictCoding == QuBianMa.Trim());
}
if (HuoPingBianMa != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.GoodsCoding == HuoPingBianMa.Trim());
}
if (HuoPingMingCheng != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.GoodsName == HuoPingMingCheng.Trim());
}
if (GuiGe != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.Standard == GuiGe.Trim());
}
if (XingHao != "")
{
dtZuoYe = dtZuoYe.Where(tb => tb.Model == XingHao.Trim());
}
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 SelectOutboundChooseGoodsDetailed() {
var dtZuoYe = from tbZuoYe in myCKZY.PW_OutboundChooseGoodsDetailedTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
join tbQualityState in myCKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
select new
{
OutboundChooseGoodsDetailedID = tbZuoYe.OutboundChooseGoodsDetailedID,
StorageID = tbZuoYe.StorageID,
StorageNumber = tbStorage.StorageNumber,
DistrictID = tbStorage.DistrictID,
DistrictCoding = tbDistrict.DistrictCoding,
GoodsID = tbZuoYe.GoodsID,
GoodsCoding = tbGoods.GoodsCoding,
GoodsName = tbGoods.GoodsName,
Standard = tbGoods.Standard,
Model = tbGoods.Model,
UnitID = tbGoods.UnitID,
Unit = tbUnit.AttributeDetailedName,
Batch = tbZuoYe.Batch,
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="NeiRong">内容</param>
/// <returns>Json</returns>
public ActionResult MoHuSelectOutboundTreatment(string NeiRong)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_OutboundTreatmentTable
join tbOrdersInformation in myCKZY.PW_OrdersInformationTable on tbZuoYe.OrdersInformationID equals tbOrdersInformation.OrdersInformationID
join tbOrdersOutboundInformation in myCKZY.PW_OrdersOutboundInformationTable on tbOrdersInformation.OrdersInformationID equals tbOrdersOutboundInformation.OrdersInformationID
join tbClient in myCKZY.SYS_ClientTable on tbOrdersInformation.ClientID equals tbClient.ClientID
join tbOrdersType in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.OrdersTypeID equals tbOrdersType.AttributeDetailedID
join tbState in myCKZY.SYS_AttributeDetailedTable on tbOrdersInformation.StateID equals tbState.AttributeDetailedID
join tbPledgeBank in myCKZY.SYS_BankTable on tbOrdersInformation.PledgeBankID equals tbPledgeBank.BankID
join tbWarningOutboundResourceScheduling in myCKZY.PW_OutboundResourceSchedulingTable on tbZuoYe.OutboundTreatmentID equals tbWarningOutboundResourceScheduling.OutboundTreatmentID
select new
{
OutboundTreatmentID = tbZuoYe.OutboundTreatmentID,
OrdersOutboundInformationID = tbOrdersOutboundInformation.OrdersOutboundInformationID,
OrdersInformationID = tbOrdersInformation.OrdersInformationID,
WorkPlanNumber = tbZuoYe.WorkPlanNumber,
OrdersMark = tbOrdersInformation.OrdersMark,
ClientID = tbOrdersInformation.ClientID,
ClientCode = tbClient.ClientCode,
OrdersType = tbOrdersType.AttributeDetailedName,
State = tbState.AttributeDetailedName,
PledgeBank = tbPledgeBank.BankName,
NeedGrossWeight = tbWarningOutboundResourceScheduling.NeedGrossWeight,
NeedGrossBulk = tbWarningOutboundResourceScheduling.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> 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>
/// 单击反馈信息里的表格,系统会获取出库反馈ID,根据ID将反馈的货品信息查询出来
/// </summary>
/// <param name="OutboundTreatmentID">出库出库ID</param>
/// <returns>Json</returns>
public ActionResult SelectOutboundChooseGoods(int OutboundTreatmentID)
{
var dtZuoYe = from tbZuoYe in myCKZY.PW_OutboundChooseGoodsDetailedTable
join tbStorage in myCKZY.SYS_StorageTable on tbZuoYe.StorageID equals tbStorage.StorageID
join tbDistrict in myCKZY.SYS_DistrictTable on tbStorage.DistrictID equals tbDistrict.DistrictID
join tbGoods in myCKZY.SYS_GoodsTable on tbZuoYe.GoodsID equals tbGoods.GoodsID
join tbUnit in myCKZY.SYS_AttributeDetailedTable on tbGoods.UnitID equals tbUnit.AttributeDetailedID
join tbQualityState in myCKZY.SYS_AttributeDetailedTable on tbZuoYe.QualityStateID equals tbQualityState.AttributeDetailedID
where tbZuoYe.OutboundTreatmentID == OutboundTreatmentID
select new
{
OutboundChooseGoodsDetailedID = tbZuoYe.OutboundChooseGoodsDetailedID,
OutboundTreatmentID = tbZuoYe.OutboundTreatmentID,
WarningOutboundChooseGoodsDetailedID = tbZuoYe.WarningOutboundChooseGoodsDetailedID,
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> 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="OrdersInformationID">订单信息ID</param>
/// <param name="WorkPlanNumber">计划作业单号</param>
/// <returns>int</returns>
public int InsertOutboundTreatment(int OrdersInformationID, string WorkPlanNumber)
{
Models.PW_OutboundTreatmentTable myZuoYe = new Models.PW_OutboundTreatmentTable();
myZuoYe.OrdersInformationID = OrdersInformationID;
myZuoYe.WorkPlanNumber = WorkPlanNumber;
myCKZY.PW_OutboundTreatmentTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
int OutboundTreatmentID = (from tbID in myCKZY.PW_OutboundTreatmentTable select tbID.OutboundTreatmentID).Max();
return OutboundTreatmentID;//返回新增数据的主键ID值
}
else
{
return 0;
}
}
#endregion
#region 新增出库拣货明细表
/// <summary>
/// 新增预处理信息后,要新增它的拣货明细信息
/// </summary>
/// <param name="OutboundTreatmentID">出库处理ID</param>
/// <param name="StorageID">储位ID</param>
/// <param name="GoodsID">货品ID</param>
/// <param name="Batch">批次</param>
/// <param name="Quantity">数量</param>
/// <param name="QualityStateID">质量状态</param>
/// <returns></returns>
public ActionResult InsertOutboundChooseGoodsDetailed(int OutboundTreatmentID,int StorageID, int GoodsID, decimal Batch,
decimal Quantity, int QualityStateID)
{
Models.PW_OutboundChooseGoodsDetailedTable myZuoYe = new Models.PW_OutboundChooseGoodsDetailedTable();
myZuoYe.OutboundTreatmentID = OutboundTreatmentID;
myZuoYe.StorageID = StorageID;
myZuoYe.GoodsID = GoodsID;
myZuoYe.Batch = Batch;
myZuoYe.Quantity = Quantity;
myZuoYe.QualityStateID = QualityStateID;
myCKZY.PW_OutboundChooseGoodsDetailedTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 新增出库资源调度表
/// <summary>
/// 新增出库处理信息号,新增要调度的总数量和总体积
/// </summary>
/// <param name="OutboundTreatmentID">出库处理ID</param>
/// <param name="NeedGrossWeight">需要总重量</param>
/// <param name="NeedGrossBulk">需要总体积</param>
/// <returns></returns>
public int InsertOutboundResourceScheduling(int OutboundTreatmentID, decimal NeedGrossWeight, decimal NeedGrossBulk)
{
Models.PW_OutboundResourceSchedulingTable myZuoYe = new Models.PW_OutboundResourceSchedulingTable();
myZuoYe.OutboundTreatmentID = OutboundTreatmentID;
myZuoYe.NeedGrossWeight = NeedGrossWeight;
myZuoYe.NeedGrossBulk = NeedGrossBulk;
myCKZY.PW_OutboundResourceSchedulingTable.AddObject(myZuoYe);
int i = myCKZY.SaveChanges();
if (i > 0)
{
int OutboundResourceSchedulingID = (from tbID in myCKZY.PW_OutboundResourceSchedulingTable select tbID.OutboundResourceSchedulingID).Max();
return OutboundResourceSchedulingID;//返回新增数据的主键ID值
}
else
{
return 0;
}
}
#endregion
#region 删除出库处理
/// <summary>
/// 单击界面删除图标,获取出库处理ID,根据ID删除出库处理信息
/// </summary>
/// <param name="OutboundTreatmentID">出库处理ID</param>
/// <returns>Json</returns>
public ActionResult DelectOutboundTreatment(int OutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_OutboundTreatmentTable
where tbOrders.OutboundTreatmentID == OutboundTreatmentID
select tbOrders).Single<Models.PW_OutboundTreatmentTable>();
myCKZY.DeleteObject(dtOrders);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
#region 删除出库资源调度表
/// <summary>
/// 删除出库处理信息后,获取出库处理ID,根据ID,删除出库资源调度信息
/// </summary>
/// <param name="OutboundTreatmentID">出库处理ID</param>
/// <returns>int</returns>
public int DelectOutboundResourceScheduling(int OutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_OutboundResourceSchedulingTable
where tbOrders.OutboundTreatmentID == OutboundTreatmentID
select tbOrders).Single<Models.PW_OutboundResourceSchedulingTable>();
int OutboundResourceSchedulingID = dtOrders.OutboundResourceSchedulingID;//获取将要删除的数据的主键ID值
myCKZY.DeleteObject(dtOrders);
int i = myCKZY.SaveChanges();
if (i > 0)
{
return OutboundResourceSchedulingID;
}
else
{
return 0;
}
}
#endregion
#region 删除出库拣货明细表
/// <summary>
/// 删除出库处理信息时,获取出库处理id,要将拣货信息一起删除
/// </summary>
/// <param name="OutboundTreatmentID">出库处理ID</param>
/// <returns>Json</returns>
public ActionResult DelectOutboundChooseGoodsDetailed(int OutboundTreatmentID)
{
var dtOrders = (from tbOrders in myCKZY.PW_OutboundChooseGoodsDetailedTable
where tbOrders.OutboundTreatmentID == OutboundTreatmentID
select tbOrders).ToList<Models.PW_OutboundChooseGoodsDetailedTable>();
for (int j = 0; j < dtOrders.Count; j++)//拣货信息有多条,要循环删除
{
myCKZY.DeleteObject(dtOrders[j]);
}
int i = myCKZY.SaveChanges();
if (i > 0)
{
return Json("true", JsonRequestBehavior.AllowGet);
}
else
{
return Json("false", JsonRequestBehavior.AllowGet);
}
}
#endregion
第三步:视图层(Views)
出库作业界面效果图:
出库预处理界面效果图:
出库反馈界面效果图:
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="tbChuKuZuoYe" 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" onclick="ChaXun()" value="查 询" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
<td><input type="button" onclick="addChuKuYuChuLi()" 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:'/ChuKuZuoYe/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:'OrdersOutboundInformationID',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:'OutboundWay',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:10px;width:auto; height:auto;border-style: none;">
<table style="margin-left: 5px; margin-top: 10px;">
<tr>
<td align="right"><strong style="font-size: medium">作业计划单号:</strong></td><td>
<input type="text" id="txtZuoYeJiHuaDan" style="border-style: hidden hidden outset hidden; border-width: thin; width:150px; height:30px; " /></td>
<td><input type="button" onclick="YuChuLiChaXun()" value="查 询" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></td>
<td><input type="button" onclick="addChuKuFanKui()" 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,
onClickRow:SelectWarningOutboundChooseGoodsDetailed, //界面代码的双击和单击事件属性,要在jQuery里写方法代码,不然界面会出错
url:'/ChuKuZuoYe/MoHuSelectWarningOutboundTreatment?NeiRong='">
<thead>
<tr>
<th data-options="field:'WarningOutboundTreatmentID',width:50,align:'center',formatter:returnBtnCKXiuGai"><img src="../../Content/图片/修改.png" /></th>//界面formatter属性在jQuery里写方法代码,不同界面会出错
<th data-options="field:'OrdersInformationID',width:100,align:'center',hidden:'true'">订单信息ID</th>
<th data-options="field:'OrdersOutboundInformationID',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:returnBtnCKShanChu"><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:'WarningOutboundChooseGoodsDetailedID',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:10px;width:auto; height:auto;border-style: none;">
<table style="margin-left: 5px; 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" onclick="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,
onClickRow:SelectOutboundChooseGoods,
url:'/ChuKuZuoYe/MoHuSelectOutboundTreatment?NeiRong='">
<thead>
<tr>
<th data-options="field:'OutboundTreatmentID',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:'OrdersOutboundInformationID',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:'OutboundChooseGoodsDetailedID',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="tbChuKuYuChuLi" 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" onclick="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" onclick="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:'OrdersOutboundDetailedID',width:100,align:'center',hidden:'true'">订单出库明细ID</th>
<th data-options="field:'OrdersOutboundInformationID',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:100,align:'center'">规格</th>
<th data-options="field:'Model',width:100,align:'center'">型号</th>
<th data-options="field:'Batch',width:80,align:'center'">批次</th>
<th data-options="field:'QualityID',width:100,align:'center',hidden:'true'">质量状态ID</th>
<th data-options="field:'Quality',width:100,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:'OrdersOutboundDetailedID',width:100,align:'center',hidden:'true'">订单出库明细ID</th>
<th data-options="field:'OrdersOutboundInformationID',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:'QualityID',width:100,align:'center',hidden:'true'">质量状态ID</th>
<th data-options="field:'Quality',width:100,align:'center'">质量状态</th>
<th data-options="field:'Unit',width:100,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" onkeyup="PanDuanChengZhong()" id="HuoPinZongZhongLiang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /><br />
需要进行作业的货品总体积为:<input type="text" onkeyup="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:500px; height:100px;" data-options="singleSelect:true,scrolling:true,
url:'/RuKuZuoYe/SelectWarehousingWarningWork'">
<thead>
<tr>
<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" onclick="ChuKuDiaoDuWanCheng()" value="调度完成" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></div>
</div>
<div id="tbChuKuFanKui" 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>
区编码:<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" onclick="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="txtShuliang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
<input type="button" onclick="JianHuo()" 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:'OrdersOutboundDetailedID',width:100,align:'center',hidden:'true'">订单出库明细ID</th>
<th data-options="field:'OrdersOutboundInformationID',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,editor:'combobox',align:'center'">规格</th>
<th data-options="field:'Model',width:80,editor:'true',align:'center'">型号</th>
<th data-options="field:'Unit',width:80,editor:'true',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,editor:'combobox',align:'center'">质量状态</th>
<th data-options="field:'Quantity',width:80,editor:'true',align:'center'">实出数量</th>
<th data-options="field:'id',width:80,align:'center',formatter:returnBtnShanChu"></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:DblCKFKHuoPinDatagrid,">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'OrdersOutboundDetailedID',width:100,align:'center',hidden:'true'">订单出库明细ID</th>
<th data-options="field:'OrdersOutboundInformationID',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:'QualityID',width:100,align:'center',hidden:'true'">质量状态ID</th>
<th data-options="field:'Quality',width:100,align:'center'">质量状态</th>
<th data-options="field:'Unit',width:100,align:'center'">单位</th>
<th data-options="field:'Quantity',width:100,align:'center'">应出数量</th>
<th data-options="field:'ShiChuShuLiang',width:100,editor:'numberbox',align:'center'">实出数量</th>
<th data-options="field:'Quantity',width:80,align:'center'">可分配数量</th>
</tr>
</thead>
</table>
</div>
<div>
<a style="color: #FF0000;font-size: 16px; font-family: 微软雅黑; font-weight: 200;">查询非订单货品库存:</a><br />
区编码:<input type="text" id="txtQBM" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
储位编码:<input type="text" id="txtCWBM" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
货品编码:<input type="text" id="txtHPBM" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
货品名称:<input type="text" id="txtHPMC" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
规格:<input type="text" id="txtGG" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
型号:<input type="text" id="txtXH" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " />
<input type="button" onclick="IndeterminateConditionSelectInventory()" value="查询库存" style="font-size: 15px; font-family: 微软雅黑; font-weight: 200;" /><br />
<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,
url:'/ChuKuZuoYe/SelectInventory'">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'InventoryID',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:'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:'Batch',width:100,align:'center'">批次</th>
<th data-options="field:'Model',width:100,align:'center'">型号</th>
<th data-options="field:'Unit',width:100,align:'center'">单位</th>
<th data-options="field:'JustGradeMeasure',width:100,align:'center'">正品数</th>
<th data-options="field:'InferiorGradeMeasure',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>
<table id="tb出库理货反馈" class="easyui-datagrid" style="width:auto; height:120px;" data-options="singleSelect:true,scrolling:true,
url:'/ChuKuZuoYe/SelectOutboundChooseGoodsDetailed'">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'OutboundChooseGoodsDetailedID',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,editor:'combobox',align:'center'">规格</th>
<th data-options="field:'Model',width:100,editor:'true',align:'center'">型号</th>
<th data-options="field:'Batch',width:100,editor:'numberbox',align:'center'">批次</th>
<th data-options="field:'QualityState',width:100,editor:'combobox',align:'center'">质量状态</th>
<th data-options="field:'Unit',width:100,editor:'true',align:'center'">单位</th>
<th data-options="field:'Quantity',width:100,editor:'numberbox',align:'center'">应出</th>
<th data-options="field:'Quantity',width:100,editor:'numberbox',align:'center'">可分配数量</th>
<th data-options="field:'Quantity',width:100,editor:'numberbox',align:'center'">实出</th>
</tr>
</thead>
</table>
</div>
</div>
<div title="资源反馈" style="padding:10px;width:auto; height:auto;border-style: none;">
<div>
需要进行作业的货品总重量为:<input type="text" onkeyup="FKPanDuanChengZhong()" id="txtHuoPinZongzhongliang" style="border-style: hidden hidden outset hidden; border-width: thin; width:100px; height:30px; " /><br />
需要进行作业的货品总体积为:<input type="text" onkeyup="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:500px; height:100px;" data-options="singleSelect:true,scrolling:true,
url:'/RuKuZuoYe/SelectWarehousingWarningWork'">
<thead>
<tr>
<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" onclick="ChuKuFanKuiWangCheng()" value="反馈完成" style="font-size: 18px;width:100px; font-family: 楷体; color: #CC33FF" /></div>
</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=47",
function (data) {
$("#cboZhiLiangZhuangtai").combobox({ data: data, valueField: 'AttributeDetailedID',
textField: 'AttributeDetailedName'
});
});
$.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=47",
function (data) {
$("#cboZLZT").combobox({ data: data, valueField: 'AttributeDetailedID',
textField: 'AttributeDetailedName'
});
});
$.getJSON("/DingDanLuRu/cboBinDing?AttributeAssembleID=47",
function (data) {
$("#ZLZT").combobox({ data: data, valueField: 'AttributeDetailedID',
textField: 'AttributeDetailedName'
});
});
}
function ChaXun() { //模糊查询出库作业信息
$.getJSON("/ChuKuZuoYe/ChaXunJiBenXinXi?NeiRong=" + $("#txtdingdanhao").val(), function (data) {
$('#tb出库作业').datagrid('loadData', data);
});
}
var OrdersInformationID = 0;
var KuFangID = 0;
function addChuKuYuChuLi() { //选择一行出库作业数据,点击出库预处理按钮,打开出库预处理操作界面
var row = $("#tb出库作业").datagrid('getSelected');
if (row != null) {
OrdersInformationID = row.OrdersInformationID;
$('#tbChuKuZuoYe').tabs('add', { //添加新的选项卡
title: '出库预处理',
content: $('#tbChuKuYuChuLi').panel('open'),
closable: true
});
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + row.OrdersOutboundInformationID,
function (data) {
$('#tb出库待上架货品').datagrid('loadData', data);//加载待上架货品
});
$.getJSON("/ChuKuZuoYe/BangDingDinDanXinXiByID?WarehousingIndentID=" + row.OrdersInformationID,
function (data) { //绑定基本信息
KuFangID = data[0].StoreroomID;
$('#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 YuChuLiChaXun() { //入库预处理模糊查询
$.getJSON("/ChuKuZuoYe/MoHuSelectWarningOutboundTreatment?NeiRong=" + $("#txtZuoYeJiHuaDan").val(), function (data) {
$('#tb出库预处理').datagrid('loadData', data);
});
}
function SelectWarningOutboundChooseGoodsDetailed() { //点击出库预处理,查询明细
var row = $('#tb出库预处理').datagrid('getSelected');
$.getJSON("/ChuKuZuoYe/SelectWarningOutboundChooseGoodsDetailed?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
function (data) {
$('#tb出库预处理明细').datagrid('loadData', data);
});
}
function XuanZe() { //单击界面选择按钮,打来和加载储位信息
$.getJSON("/ChuKuZuoYe/SelectStoreroom?StoreroomID=" + KuFangID,
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) + "】库存不足");
}
}
//定义一个全局变量,并把它赋值为未定义
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() { //待上架货品datagrid里的双击事件,双击一行数据,将待上架货品赋值给上架区域显示出来,等待上架
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 ShangJia() { //点击上架按钮,将待上架货品更新到已上架货品区域
var rowHuoPinDatagrid = $('#tb出库待上架货品').datagrid('getSelected');
var rowMingXi = $('#tb出库已上架货品').datagrid('getSelected');
$('#tb出库已上架货品').datagrid('appendRow',
{ StorageID: StorageiD,
OrdersOutboundInformationID: rowHuoPinDatagrid.OrdersOutboundInformationID,
OrdersOutboundDetailedID: rowHuoPinDatagrid.OrdersOutboundDetailedID,
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("/ChuKuZuoYe/UpdateShuLiang?OrdersOutboundDetailedID=" + rowHuoPinDatagrid.OrdersOutboundDetailedID +
"&ShenYuShuLiang=" + ShenYuShuLiang, function (data) { //上架完成后,改变库存数量
if (data == "true") {
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + rowHuoPinDatagrid.OrdersOutboundInformationID,
function (data) {
$('#tb出库待上架货品').datagrid('loadData', data);
});
}
});
}
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>";
}
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("/ChuKuZuoYe/SelectShuLiang?OrdersOutboundDetailedID=" + row.OrdersOutboundDetailedID,
function (data) {
var ZuoYeZhongShu = data[0].Quantity;
var ShenYuShuLiang = parseInt(row.Quantity) + parseInt(ZuoYeZhongShu);
$.getJSON("/ChuKuZuoYe/UpdateShuLiang?OrdersOutboundDetailedID=" + row.OrdersOutboundDetailedID +
"&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
if (data == "true") {
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + row.OrdersOutboundInformationID,
function (data) {
$('#tb出库待上架货品').datagrid('loadData', data);
});
}
});
});
$('#tb出库已上架货品').datagrid('cancelEdit', rowIndex)
.datagrid('deleteRow', rowIndex);
}
var WarningOutboundTreatmentID = 0;
function ChuKuDiaoDuWanCheng() { //新增预处理信息,也新增预处理子表以下信息
if (confirm("是否调度?")) {
$.getJSON("/ChuKuZuoYe/InsertWarningOutboundTreatment?OrdersOutboundInformationID=" + OrdersInformationID +
"&WorkPlanNumber=" + $('#txtZuoYeJiHuaDanHao').val(),
function (data) {
WarningOutboundTreatmentID = data;//出库预处理信息新增完成后,返回主键ID值
if (data != 0) {
var rowMingXi = $('#tb出库已上架货品').datagrid('getData');//新增出库预处理货品信息
for (var i = 0; i < rowMingXi.rows.length; i++) {
$.getJSON("/ChuKuZuoYe/InsertWarningOutboundChooseGoodsDetailed?WarningOutboundTreatmentID=" + WarningOutboundTreatmentID +
"&OrdersOutboundDetailedID=" + rowMingXi.rows[i].OrdersOutboundDetailedID +
"&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("/ChuKuZuoYe/InsertWarningOutboundResourceScheduling?WarningOutboundTreatmentID=" + WarningOutboundTreatmentID +
"&NeedGrossWeight=" + $('#HuoPinZongZhongLiang').val() +
"&NeedGrossBulk=" + $('#HuoPinZongTiJi').val(),
function (data) { //新增预处理的体积和需要总数量
if (data != 0) {
alert("调度完成!");
$('#tb出库预处理').datagrid('reload');
var rowData = $('#tb出库已上架货品').datagrid('getData');
for (var i = 0; i < rowData.rows.length + 1; i++) {
$('#tb出库已上架货品').datagrid('cancelEdit', 0).datagrid('deleteRow', 0);
}
} else {
alert("调度失败!");
}
});
}
});
} else {
return null;
}
}
function returnBtnCKShanChu(WarningOutboundTreatmentID, row, rowIndex) {
return "<a href='javascript:CKShanChu(" + WarningOutboundTreatmentID + "," + rowIndex + ")'>" + '<img src="../../Content/图片/删除.jpg" />' + "</a>";
}//在预处理查询界面,某条数据如果不要,可点击删除图片,执行删除方法
function CKShanChu(WarningOutboundTreatmentID, rowIndex) {//删除出库预处理信息以及以下子表信息
if (confirm("是否删除?")) {
var row = $('#tb出库预处理').datagrid('getSelected');
$.getJSON("/ChuKuZuoYe/DelectWarningOutboundTreatment?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
function (data) {
if (data == "true") {
$.getJSON("/ChuKuZuoYe/DelectWarningOutboundResourceScheduling?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
function (data) {
if (data != 0) {
$.getJSON("/ChuKuZuoYe/DelectWarningOutboundChooseGoodsDetailed?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
function (data) {
if (data == "true") {
alert("删除成功!");
$('#tb出库预处理').datagrid('reload');
} else {
alert("删除失败!");
}
});
}
});
}
});
} else {
return null;
}
}
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&出库反馈部分&&&&&&&&&&&&&&&&&&&&&&&&&&//
var OrdersInformationiD = 0;
var OrdersOutboundInformationID = 0;
function addChuKuFanKui() { //在出库预处理查询界面,选择一行数据,对该数据进行反馈操作,
//点击作业计划单反馈按钮,打开出库反馈界面,对该数据进行反馈处理
var row = $("#tb出库预处理").datagrid('getSelected');
if (row != null) {
OrdersInformationiD = row.OrdersInformationID;
OrdersOutboundInformationID = row.OrdersOutboundInformationID;
$('#tbChuKuZuoYe').tabs('add', { //添加新的选项卡
title: '出库反馈',
content: $('#tbChuKuFanKui').panel('open'),
closable: true
});
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + row.OrdersOutboundInformationID,
function (data) {
$('#tb出库反馈待拣货').datagrid('loadData', data);//加载待拣货按钮
});
$.getJSON("/ChuKuZuoYe/SelectWarningOutboundChooseGoodsDetailedByID?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
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("/ChuKuZuoYe/SelectWarningOutboundResourceSchedulingByID?WarningOutboundTreatmentID=" + row.WarningOutboundTreatmentID,
function (data) {
$('#txtHuoPinZongzhongliang').attr('value', data[0].NeedGrossWeight);//绑定需要总数量和需要总体积
$('#txtHuoPinZongtiji').attr('value', data[0].NeedGrossBulk);
});
$.getJSON("/ChuKuZuoYe/BangDingDinDanXinXiByID?WarehousingIndentID=" + row.OrdersInformationID,
function (data) { //绑定基本信息
KuFangID = data[0].StoreroomID;
$('#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 Xuanze() {
$.getJSON("/ChuKuZuoYe/SelectStoreroom?StoreroomID=" + KuFangID,
function (data) {
$('#tb储位').datagrid('loadData', data);
});
$("#ChuWei").window('open');
}
function FanKuiChaXun() { //出库反馈模糊查询
$.getJSON("/ChuKuZuoYe/MoHuSelectOutboundTreatment?NeiRong=" + $("#ZuoYeJiHuaDan").val(), function (data) {
$('#tb出库反馈').datagrid('loadData', data);
});
}
function SelectOutboundChooseGoods() { //单击出库反馈datagrid,查询明细
var row = $('#tb出库反馈').datagrid('getSelected');
$.getJSON("/ChuKuZuoYe/SelectOutboundChooseGoods?OutboundTreatmentID=" + row.OutboundTreatmentID,
function (data) {
$('#tb出库反馈明细').datagrid('loadData', data);
});
}
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) + "】库存不足");
}
}
function DblCKFKHuoPinDatagrid() { //在待拣货datagrid里的双击事件,将货品主要信息绑定在拣货区,等待拣货
var rowHuoPinDatagrid = $('#tb出库反馈待拣货').datagrid('getSelected');
$('#tb出库反馈待拣货').datagrid('endEdit', editIndex);
var ZongShu = parseInt(rowHuoPinDatagrid.Quantity);
var ShangJiaShu = parseInt(rowHuoPinDatagrid.ShiChuShuLiang);
if (ShangJiaShu > ZongShu) {
alert("待上架数【" + ShangJiaShu + "】大于作业总数【" + ZongShu + "】");
} else {
$("#txtHuoPinbianMa").val(rowHuoPinDatagrid.GoodsCoding);
$("#cboZhiLiangZhuangtai").combobox('setValue', rowHuoPinDatagrid.QualityID);
$("#txtShuliang").val(rowHuoPinDatagrid.ShiChuShuLiang);
}
}
function JianHuo() {//点击拣货按钮,将待拣货货品更新到已拣货区
var rowHuoPinDatagrid = $('#tb出库反馈待拣货').datagrid('getSelected');
var rowMingXi = $('#tb出库反馈已拣货').datagrid('getSelected');
$('#tb出库反馈已拣货').datagrid('appendRow',
{ StorageID: StorageID,
OrdersOutboundInformationID: rowHuoPinDatagrid.OrdersOutboundInformationID,
OrdersOutboundDetailedID: rowHuoPinDatagrid.OrdersOutboundDetailedID,
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: $("#txtShuliang").val()
});
var ShenYuShuLiang = parseInt(rowHuoPinDatagrid.Quantity) - parseInt($("#txtShuliang").val());
$.getJSON("/ChuKuZuoYe/UpdateShuLiang?OrdersOutboundDetailedID=" + rowHuoPinDatagrid.OrdersOutboundDetailedID +
"&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {//拣货后,改变库存数量
if (data == "true") {
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + OrdersOutboundInformationID,
function (data) {
$('#tb出库反馈待拣货').datagrid('loadData', data);
});
}
});
}
function returnBtnShanChu(GoodsID, row, rowIndex) {
return "<a href='javascript:ShanChu(" + GoodsID + "," + rowIndex + ")'>" + '<input type="button" value="删除" style="font-size: 15px;width:60px; font-family: 楷体;" />' + "</a>";
}//在已拣货datagrid里,如果不想要其中的数据,可以点击删除按钮
function ShanChu(GoodsID, rowIndex) { //删除一条数据,恢复库存数量
var row = $("#tb出库反馈已拣货").datagrid('getSelected');
$.getJSON("/ChuKuZuoYe/SelectShuLiang?OrdersOutboundDetailedID=" + row.OrdersOutboundDetailedID,
function (data) {
var ZuoYeZhongShu = data[0].Quantity;
var ShenYuShuLiang = parseInt(row.Quantity) + parseInt(ZuoYeZhongShu);
$.getJSON("/ChuKuZuoYe/UpdateShuLiang?OrdersOutboundDetailedID=" + row.OrdersOutboundDetailedID +
"&ShenYuShuLiang=" + ShenYuShuLiang, function (data) {
if (data == "true") {
$.getJSON("/ChuKuZuoYe/SelectOutboundWaitGroundingGoods?OrdersOutboundInformationID=" + OrdersOutboundInformationID,
function (data) {
$('#tb出库反馈待拣货').datagrid('loadData', data);
});
}
});
});
$('#tb出库反馈已拣货').datagrid('cancelEdit', rowIndex)
.datagrid('deleteRow', rowIndex);
}
var OutboundTreatmentID = 0;
function ChuKuFanKuiWangCheng() { //出库反馈完成
if (confirm("是否反馈?")) {
$.getJSON("/ChuKuZuoYe/InsertOutboundTreatment?OrdersInformationID=" + OrdersInformationiD +
"&WorkPlanNumber=" + $('#txtZuoYeJiHuaDanhao').val(),
function (data) {
OutboundTreatmentID = data;//反馈完成后,返回主键ID值
if (data != 0) {
var rowMingXi = $('#tb出库反馈已拣货').datagrid('getData');//反馈的货品信息
for (var i = 0; i < rowMingXi.rows.length; i++) {
$.getJSON("/ChuKuZuoYe/InsertOutboundChooseGoodsDetailed?OutboundTreatmentID=" + OutboundTreatmentID +
"&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("/ChuKuZuoYe/InsertOutboundResourceScheduling?OutboundTreatmentID=" + OutboundTreatmentID +
"&NeedGrossWeight=" + $('#txtHuoPinZongzhongliang').val() +
"&NeedGrossBulk=" + $('#txtHuoPinZongtiji').val(),
function (data) { //反馈需要的数量和体积
if (data != 0) {
$.getJSON("/ChuKuZuoYe/UpdataQuTiJi?DistrictID=" + DistrictID +
"&TiJi=" + $("#txtHuoPinZongtiji").val() +
"&ShuLiang=" + $('#txtHuoPinZongzhongliang').val(), function (data) {
if (data == "true") {
alert("反馈成功!");
$("#tb出库理货反馈").datagrid('reload');
$("#tb出库反馈").datagrid('reload');
var rowData = $('#tb出库反馈已拣货').datagrid('getData');
for (var i = 0; i < rowData.rows.length + 1; i++) {
$('#tb出库反馈已拣货').datagrid('cancelEdit', 0).datagrid('deleteRow', 0);
}
}
});
} else {
alert("反馈失败!");
}
});
}
});
} else {
return null;
}
}
}
更多推荐




所有评论(0)