其他出
This commit is contained in:
1 parent
f15b26fcc5
commit
e9f154bd06
46 files changed
+3178
No files matched your search
@@ -0,0 +1,276 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using System.Linq;
|
||||
using System.Data;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("xwms")]
|
||||
[ActionDescription("出库单")]
|
||||
public partial class ShipmentHeader2Controller : BaseController
|
||||
{
|
||||
|
||||
public ShipmentHeader2Controller()
|
||||
{
|
||||
}
|
||||
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2ListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public string Search(ShipmentHeader2Searcher searcher)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2ListVM>(passInit: true);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
||||
searcher.WarehouseId = int.Parse(warehouseId);
|
||||
vm.Searcher = searcher;
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm.GetError();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2VM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Create(ShipmentHeader2VM vm)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Edit
|
||||
[ActionDescription("Sys.Edit")]
|
||||
public ActionResult Edit(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Edit")]
|
||||
[HttpPost]
|
||||
[ValidateFormItemOnly]
|
||||
public ActionResult Edit(ShipmentHeader2VM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoEdit();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delete
|
||||
[ActionDescription("Sys.Delete")]
|
||||
public ActionResult Delete(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Delete")]
|
||||
[HttpPost]
|
||||
public ActionResult Delete(string id, IFormCollection nouse)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2VM>(id);
|
||||
vm.DoDelete();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Details
|
||||
[ActionDescription("Sys.Details")]
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchEdit
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult BatchEdit(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult DoBatchEdit(ShipmentHeader2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchDelete
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult BatchDelete(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult DoBatchDelete(ShipmentHeader2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeader2ImportVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import(ShipmentHeader2ImportVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData())
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export
|
||||
[ActionDescription("Sys.Export")]
|
||||
[HttpPost]
|
||||
public IActionResult ExportExcel(ShipmentHeader2ListVM vm)
|
||||
{
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
[ActionDescription("Sys.CreateOut")]
|
||||
public ActionResult CreateOut()
|
||||
{
|
||||
return PartialView("CreateOut");
|
||||
}
|
||||
[ActionDescription("Sys.SearchInv")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult CreateOutBill(string tran, List<Inventory2> data)
|
||||
{
|
||||
return JsonMore(null);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.SearchInv")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult SearchInv(string materialCode, string materialName, string batch, string lot)
|
||||
{
|
||||
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
var list = _unitwork.Find<Inventory2>(x =>
|
||||
x.WarehouseId == int.Parse(warehouseId)
|
||||
&& x.MaterialCode.Contains(materialCode)
|
||||
&& x.MaterialName.Contains(materialName)
|
||||
&& x.Batch.Contains(batch)
|
||||
&& x.Lot.Contains(lot)
|
||||
).Select(x => new
|
||||
{
|
||||
x.LocationCode,
|
||||
x.MaterialCode,
|
||||
x.MaterialName,
|
||||
x.Batch,
|
||||
x.Lot,
|
||||
x.ContainerCode,
|
||||
x.SupplierName,
|
||||
x.Qty,
|
||||
ThisQty = x.Qty
|
||||
}).ToList();
|
||||
return JsonMore(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user