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

4 days ago
  1. using NFine.Application;
  2. using NFine.Application.ProductManage;
  3. using NFine.Code;
  4. using NFine.Code.Excel;
  5. using NFine.Domain.Entity.ProductManage;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data;
  9. using System.Linq;
  10. using System.Web.Mvc;
  11. namespace NFine.Web.Areas.SRM.Controllers
  12. {
  13. public class POListController : ControllerBase
  14. {
  15. private POReleaseApp App = new POReleaseApp();
  16. [HttpGet]
  17. [HandlerAjaxOnly]
  18. public ActionResult GetPOListGridJson(Pagination pagination, string queryJson)
  19. {
  20. DataTable ListData = App.GetPOListGridJson(queryJson, ref pagination);
  21. var JsonData = new
  22. {
  23. total = pagination.total,
  24. page = pagination.page,
  25. records = pagination.records,
  26. rows = ListData,
  27. };
  28. return Content(JsonData.ToJson());
  29. }
  30. [HttpGet]
  31. [HandlerAjaxOnly]
  32. public ActionResult GetPOlistbyYLGridJson(Pagination pagination, string queryJson)
  33. {
  34. DataTable ListData = App.GetPOlistbyYLGridJson(queryJson, ref pagination);
  35. var JsonData = new
  36. {
  37. total = pagination.total,
  38. page = pagination.page,
  39. records = pagination.records,
  40. rows = ListData,
  41. };
  42. return Content(JsonData.ToJson());
  43. }
  44. [HttpGet]
  45. [HandlerAjaxOnly]
  46. public ActionResult GetSubGridJson(string queryJson,Pagination pagination,string WorkPoint)
  47. {
  48. DataTable ListData = App.GetSubGridJson(queryJson, ref pagination, WorkPoint);
  49. var JsonData = new
  50. {
  51. total = pagination.total,
  52. page = pagination.page,
  53. records = pagination.records,
  54. rows = ListData,
  55. };
  56. //获取当前登录人信息;
  57. return Content(JsonData.ToJson());
  58. }
  59. public ActionResult Index()
  60. {
  61. return View();
  62. }
  63. public ActionResult POlistbyYL()
  64. {
  65. return View();
  66. }
  67. //[HttpGet]
  68. //[HandlerAjaxOnly]
  69. //public ActionResult GetFormJson(string keyValue)
  70. //{
  71. // //var data = maintainAppApp.GetForm(keyValue);
  72. // //return Content(data.ToJson());
  73. //}
  74. [HttpPost]
  75. [HandlerAjaxOnly]
  76. [ValidateAntiForgeryToken]
  77. public ActionResult SubmitForm(string keyValue, string WorkPoint)
  78. {
  79. int i = App.SubmitPoRelease(keyValue, WorkPoint);
  80. if (i > 0)
  81. {
  82. return Success("发布成功!");
  83. }
  84. else
  85. {
  86. return Error("发布失败!");
  87. }
  88. }
  89. [HttpPost]
  90. public void Export(string keyValue)
  91. {
  92. keyValue = keyValue.TrimEnd(',');
  93. //var data = maintainApp.GetList2(ids); //preselldetailApp.GetList2(keyValue, keyword);
  94. DataTable dt = App.GetPOListExport(keyValue);
  95. AsposeCell.Export(dt);
  96. //NPOIExcel helper = new NPOIExcel();
  97. //string title= DateTime.Now.ToString("yyyyMMddHHmmss");
  98. //string path= Server.MapPath("/File/");
  99. //helper.ToExcel(dt, title, "sheet1", path);
  100. }
  101. [HttpPost]
  102. 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)
  103. {
  104. DataTable dt = App.GetPOListExport(ORDERNO, STNO, BeginDate, EndDate, VenCode, VenName, InvCode, PersonName,POStatus, IsAll);
  105. AsposeCell.Export(dt);
  106. }
  107. [HttpGet]
  108. [HandlerAjaxOnly]
  109. public ActionResult GetUserAuth()
  110. {
  111. string VenCode = NFine.Code.OperatorProvider.Provider.GetCurrent().VenCode;
  112. string flag = "";
  113. if (string.IsNullOrEmpty(VenCode))
  114. {
  115. flag = "0";
  116. }
  117. else
  118. {
  119. flag = "1";
  120. }
  121. var JsonData = new
  122. {
  123. IsVendor= flag
  124. };
  125. //获取当前登录人信息;
  126. return Content(JsonData.ToJson());
  127. }
  128. }
  129. }