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.
176 lines
5.8 KiB
176 lines
5.8 KiB
using NFine.Code;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using NFine.Application.SRM;
|
|
|
|
namespace NFine.Web.Areas.SRM.Controllers
|
|
{
|
|
public class PriceArticleController : ControllerBase
|
|
{
|
|
PriceArticleApp App = new PriceArticleApp();
|
|
//
|
|
// GET: /SRM/PriceArticle/
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
|
|
}
|
|
public ActionResult PriceArtList()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult PriceArtStage(){
|
|
return View();
|
|
}
|
|
public ActionResult PriceArticComit()
|
|
{
|
|
return View();
|
|
}
|
|
/// <summary>
|
|
/// 获取组名称
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridPurchug(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 获取组名称
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetCompareCodeMaterial(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetCompareCodeMaterial(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 询报价报表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetCompareCodeMateriaList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetCompareCodeMateriaList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 获取组名称
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetCompareCodeMaterials(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetCompareCodeMaterials(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 比价物资设定
|
|
/// </summary>
|
|
/// <param name="queryJson"></param>
|
|
/// <param name="STNO"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult SaveItemCode(string queryJson, string PURCHUG, string PURCHUGName)
|
|
{
|
|
queryJson = queryJson.Substring(1, queryJson.Length - 2);
|
|
string msg = App.CheckSTNO_ItemCode(queryJson, PURCHUG, PURCHUGName);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 取消比价物资设定
|
|
/// </summary>
|
|
/// <param name="queryJson"></param>
|
|
/// <param name="STNO"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult UpdateItemCode(string queryJson, string PURCHUG, string PURCHUGName)
|
|
{
|
|
queryJson = queryJson.Substring(1, queryJson.Length - 2);
|
|
string msg = App.UpdateItemCode(queryJson, PURCHUG, PURCHUGName);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
[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 PURCHUG, string InvType, string PURCHUGCODE, string ITEMCODE, string ITEMName, string INVSTD, string VENCode, string VENName, string CREATETIME)
|
|
{
|
|
DataTable dt = App.GetPOListExport(PURCHUG, InvType, PURCHUGCODE, ITEMCODE, ITEMName, VENCode, VENName, CREATETIME, INVSTD);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
}
|
|
}
|