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.

198 lines
6.5 KiB

4 weeks ago
6 days ago
4 weeks ago
6 days ago
4 weeks ago
  1. using NFine.Application.SRM;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.SRM.Controllers
  10. {
  11. public class SORRFQController : Controller
  12. {
  13. // GET: SRM/SORRFQ
  14. RFQManagerApp app = new RFQManagerApp();
  15. public ActionResult Index()
  16. {
  17. return View();
  18. }
  19. /// <summary>
  20. /// 过程查询
  21. /// </summary>
  22. /// <returns></returns>
  23. public ActionResult RFQProcessSearch()
  24. {
  25. return View();
  26. }
  27. public ActionResult RFQProcessSearchDetail()
  28. {
  29. return View();
  30. }
  31. public ActionResult SORRFQSearchItem()
  32. {
  33. return View();
  34. }
  35. public ActionResult GetGridJson(Pagination pagination, String JSON)
  36. {
  37. DataTable table = app.GetGridJson(JSON, ref pagination);
  38. var JsonData = new
  39. {
  40. total = pagination.total,
  41. page = pagination.page,
  42. records = pagination.records,
  43. rows = table
  44. };
  45. return Content(JsonData.ToJson());
  46. }
  47. public ActionResult GetGridJsonByBJ(Pagination pagination, String JSON)
  48. {
  49. DataTable table = app.GetGridJsonByBJ(JSON, ref pagination);
  50. var JsonData = new
  51. {
  52. total = pagination.total,
  53. page = pagination.page,
  54. records = pagination.records,
  55. rows = table
  56. };
  57. return Content(JsonData.ToJson());
  58. }
  59. public ActionResult Publish(string json) {
  60. return Content(app.Publish(json));
  61. }
  62. public ActionResult Close(string json)
  63. {
  64. return Content(app.Close(json));
  65. }
  66. public ActionResult DELETE(string json)
  67. {
  68. return Content(app.delete(json));
  69. }
  70. /// <summary>
  71. /// 获取动态列
  72. /// </summary>
  73. /// <param name="BidCode"></param>
  74. /// <returns></returns>
  75. public ActionResult SelectSORRFQColumnName(string rfqcode, string workpoint)
  76. {
  77. var data = app.SelectSORRFQColumnName(rfqcode, workpoint);
  78. return Content(data.ToJson());
  79. }
  80. /// <summary>
  81. /// 总查询
  82. /// </summary>
  83. /// <param name="pagination"></param>
  84. /// <param name="BidCode"></param>
  85. /// <returns></returns>
  86. [HttpGet]
  87. public ActionResult GetListSORRFQGridJsonTOZSUM(Pagination pagination, string rfqcode, string workpoint)
  88. {
  89. DataTable ListData = app.GetListSORRFQGridJsonTOZSUM(rfqcode, workpoint, ref pagination);
  90. var JsonData = new
  91. {
  92. total = pagination.total,
  93. page = pagination.page,
  94. records = pagination.records,
  95. rows = ListData,
  96. };
  97. return Content(JsonData.ToJson());
  98. }
  99. [HttpGet]
  100. [HandlerAjaxOnly]
  101. public ActionResult GetSubGridJsonCourseInfoSORRFQ(Pagination pagination, string rfqcode, string workpoint, string ITEMCODE)
  102. {
  103. DataTable ListData = app.GetSubGridJsonCourseInfoSORRFQ(rfqcode, workpoint,ITEMCODE ,ref pagination);
  104. var JsonData = new
  105. {
  106. total = pagination.total,
  107. page = pagination.page,
  108. records = pagination.records,
  109. rows = ListData,
  110. };
  111. return Content(JsonData.ToJson());
  112. }
  113. [HttpGet]
  114. [HandlerAjaxOnly]
  115. public ActionResult SORRFQHistoryInfo(Pagination pagination, string rfqcode, string workpoint, string ITEMCODE, string VENDORCODE)
  116. {
  117. DataTable ListData = app.SORRFQHistoryInfo(rfqcode, workpoint, ITEMCODE,VENDORCODE, ref pagination);
  118. var JsonData = new
  119. {
  120. total = pagination.total,
  121. page = pagination.page,
  122. records = pagination.records,
  123. rows = ListData,
  124. };
  125. return Content(JsonData.ToJson());
  126. }
  127. [HttpGet]
  128. [HandlerAjaxOnly]
  129. public ActionResult SORRFQCourseHistoryInfoCahrs(string rfqcode, string workpoint, string ITEMCODE)
  130. {
  131. DataTable ListData = app.SORRFQCourseHistoryInfoCahrs(rfqcode, workpoint, ITEMCODE);
  132. string ss = ListData.ToJson();
  133. return Content(ListData.ToJson());
  134. }
  135. [HttpPost]
  136. public void Export(string rfqcode, string workpoint, Pagination pagination)
  137. {
  138. //var data = maintainApp.GetList2(ids); //preselldetailApp.GetList2(keyValue, keyword);
  139. DataTable dt = app.GetPOListExport(rfqcode, workpoint, ref pagination);
  140. AsposeCell.Export(dt);
  141. //NPOIExcel helper = new NPOIExcel();
  142. //string title= DateTime.Now.ToString("yyyyMMddHHmmss");
  143. //string path= Server.MapPath("/File/");
  144. //helper.ToExcel(dt, title, "sheet1", path);
  145. }
  146. /// <summary>
  147. /// 获取供应商-生效价格
  148. /// </summary>
  149. /// <param name="rfqno"></param>
  150. /// <param name="workpoint"></param>
  151. /// <returns></returns>
  152. [HttpGet]
  153. [HandlerAjaxOnly]
  154. public ActionResult GettPerson(string rfqno, string workpoint)
  155. {
  156. DataTable dt = app.GettPerson(rfqno, workpoint);
  157. return Content(dt.ToJson());
  158. }
  159. [HttpGet]
  160. [HandlerAjaxOnly]
  161. public ActionResult GetSubGridJson(string RFQCODE, Pagination pagination, string WorkPoint)
  162. {
  163. DataTable ListData = app.GetSubGridJson(RFQCODE, ref pagination, WorkPoint);
  164. var JsonData = new
  165. {
  166. total = pagination.total,
  167. page = pagination.page,
  168. records = pagination.records,
  169. rows = ListData,
  170. };
  171. return Content(JsonData.ToJson());
  172. }
  173. [HttpPost]
  174. public void ExportAll(string PruOrganize, string PruTeam, string RFQCode, string RFQName, string SupplierCode, string SupplierName, string InvCode, string InvName, string InvStd, string TimeFrom, string TimeTo, string ReleaseState)
  175. {
  176. DataTable dt = app.ExportAll( PruOrganize, PruTeam, RFQCode, RFQName, SupplierCode, SupplierName, InvCode, InvName, InvStd, TimeFrom, TimeTo, ReleaseState);
  177. AsposeCell.Export(dt);
  178. }
  179. }
  180. }