You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.3 KiB
143 lines
4.3 KiB
using NFine.Application;
|
|
using NFine.Application.ProductManage;
|
|
using NFine.Code;
|
|
using NFine.Code.Excel;
|
|
using NFine.Domain.Entity.ProductManage;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
|
|
namespace NFine.Web.Areas.SRM.Controllers
|
|
{
|
|
public class POListController : ControllerBase
|
|
{
|
|
private POReleaseApp App = new POReleaseApp();
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetPOListGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetPOListGridJson(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetPOlistbyYLGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetPOlistbyYLGridJson(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetSubGridJson(string queryJson,Pagination pagination,string WorkPoint)
|
|
{
|
|
DataTable ListData = App.GetSubGridJson(queryJson, ref pagination, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
|
|
};
|
|
//获取当前登录人信息;
|
|
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult POlistbyYL()
|
|
{
|
|
return View();
|
|
}
|
|
//[HttpGet]
|
|
//[HandlerAjaxOnly]
|
|
//public ActionResult GetFormJson(string keyValue)
|
|
//{
|
|
// //var data = maintainAppApp.GetForm(keyValue);
|
|
// //return Content(data.ToJson());
|
|
//}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult SubmitForm(string keyValue, string WorkPoint)
|
|
{
|
|
int i = App.SubmitPoRelease(keyValue, WorkPoint);
|
|
if (i > 0)
|
|
{
|
|
return Success("发布成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error("发布失败!");
|
|
}
|
|
|
|
}
|
|
|
|
[HttpPost]
|
|
public void Export(string keyValue)
|
|
{
|
|
keyValue = keyValue.TrimEnd(',');
|
|
//var data = maintainApp.GetList2(ids); //preselldetailApp.GetList2(keyValue, keyword);
|
|
DataTable dt = App.GetPOListExport(keyValue);
|
|
AsposeCell.Export(dt);
|
|
//NPOIExcel helper = new NPOIExcel();
|
|
//string title= DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
//string path= Server.MapPath("/File/");
|
|
//helper.ToExcel(dt, title, "sheet1", path);
|
|
}
|
|
|
|
[HttpPost]
|
|
public void ExportAll(string keyValue, string ORDERNO, string STNO, string BeginDate, string EndDate, string VenCode, string VenName, string InvCode, string PersonName, string POStatus,string IsAll)
|
|
{
|
|
DataTable dt = App.GetPOListExport(ORDERNO, STNO, BeginDate, EndDate, VenCode, VenName, InvCode, PersonName,POStatus, IsAll);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetUserAuth()
|
|
{
|
|
string VenCode = NFine.Code.OperatorProvider.Provider.GetCurrent().VenCode;
|
|
string flag = "";
|
|
if (string.IsNullOrEmpty(VenCode))
|
|
{
|
|
flag = "0";
|
|
}
|
|
else
|
|
{
|
|
flag = "1";
|
|
}
|
|
var JsonData = new
|
|
{
|
|
IsVendor= flag
|
|
};
|
|
//获取当前登录人信息;
|
|
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
}
|
|
}
|