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.

216 lines
7.1 KiB

2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months 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 QuotedPriceDetail()
  36. {
  37. return View();
  38. }
  39. public ActionResult GetGridJson(Pagination pagination, String JSON)
  40. {
  41. DataTable table = app.GetGridJson(JSON, ref pagination);
  42. var JsonData = new
  43. {
  44. total = pagination.total,
  45. page = pagination.page,
  46. records = pagination.records,
  47. rows = table
  48. };
  49. return Content(JsonData.ToJson());
  50. }
  51. public ActionResult GetGridJsonByBJ(Pagination pagination, String JSON)
  52. {
  53. DataTable table = app.GetGridJsonByBJ(JSON, ref pagination);
  54. var JsonData = new
  55. {
  56. total = pagination.total,
  57. page = pagination.page,
  58. records = pagination.records,
  59. rows = table
  60. };
  61. return Content(JsonData.ToJson());
  62. }
  63. public ActionResult Publish(string json) {
  64. return Content(app.Publish(json));
  65. }
  66. public ActionResult Close(string json)
  67. {
  68. return Content(app.Close(json));
  69. }
  70. public ActionResult DELETE(string json)
  71. {
  72. return Content(app.delete(json));
  73. }
  74. /// <summary>
  75. /// 获取动态列
  76. /// </summary>
  77. /// <param name="BidCode"></param>
  78. /// <returns></returns>
  79. public ActionResult SelectSORRFQColumnName(string rfqcode, string workpoint)
  80. {
  81. var data = app.SelectSORRFQColumnName(rfqcode, workpoint);
  82. return Content(data.ToJson());
  83. }
  84. /// <summary>
  85. /// 总查询
  86. /// </summary>
  87. /// <param name="pagination"></param>
  88. /// <param name="BidCode"></param>
  89. /// <returns></returns>
  90. [HttpGet]
  91. public ActionResult GetListSORRFQGridJsonTOZSUM(Pagination pagination, string rfqcode, string workpoint)
  92. {
  93. DataTable ListData = app.GetListSORRFQGridJsonTOZSUM(rfqcode, workpoint, ref pagination);
  94. var JsonData = new
  95. {
  96. total = pagination.total,
  97. page = pagination.page,
  98. records = pagination.records,
  99. rows = ListData,
  100. };
  101. return Content(JsonData.ToJson());
  102. }
  103. [HttpGet]
  104. [HandlerAjaxOnly]
  105. public ActionResult GetSubGridJsonCourseInfoSORRFQ(Pagination pagination, string rfqcode, string workpoint, string ITEMCODE)
  106. {
  107. DataTable ListData = app.GetSubGridJsonCourseInfoSORRFQ(rfqcode, workpoint,ITEMCODE ,ref pagination);
  108. var JsonData = new
  109. {
  110. total = pagination.total,
  111. page = pagination.page,
  112. records = pagination.records,
  113. rows = ListData,
  114. };
  115. return Content(JsonData.ToJson());
  116. }
  117. [HttpGet]
  118. [HandlerAjaxOnly]
  119. public ActionResult SORRFQHistoryInfo(Pagination pagination, string rfqcode, string workpoint, string ITEMCODE, string VENDORCODE)
  120. {
  121. DataTable ListData = app.SORRFQHistoryInfo(rfqcode, workpoint, ITEMCODE,VENDORCODE, ref pagination);
  122. var JsonData = new
  123. {
  124. total = pagination.total,
  125. page = pagination.page,
  126. records = pagination.records,
  127. rows = ListData,
  128. };
  129. return Content(JsonData.ToJson());
  130. }
  131. [HttpGet]
  132. [HandlerAjaxOnly]
  133. public ActionResult SORRFQCourseHistoryInfoCahrs(string rfqcode, string workpoint, string ITEMCODE)
  134. {
  135. DataTable ListData = app.SORRFQCourseHistoryInfoCahrs(rfqcode, workpoint, ITEMCODE);
  136. string ss = ListData.ToJson();
  137. return Content(ListData.ToJson());
  138. }
  139. [HttpPost]
  140. public void Export(string rfqcode, string workpoint, Pagination pagination)
  141. {
  142. //var data = maintainApp.GetList2(ids); //preselldetailApp.GetList2(keyValue, keyword);
  143. DataTable dt = app.GetPOListExport(rfqcode, workpoint, ref pagination);
  144. AsposeCell.Export(dt);
  145. //NPOIExcel helper = new NPOIExcel();
  146. //string title= DateTime.Now.ToString("yyyyMMddHHmmss");
  147. //string path= Server.MapPath("/File/");
  148. //helper.ToExcel(dt, title, "sheet1", path);
  149. }
  150. /// <summary>
  151. /// 获取供应商-生效价格
  152. /// </summary>
  153. /// <param name="rfqno"></param>
  154. /// <param name="workpoint"></param>
  155. /// <returns></returns>
  156. [HttpGet]
  157. [HandlerAjaxOnly]
  158. public ActionResult GettPerson(string rfqno, string workpoint)
  159. {
  160. DataTable dt = app.GettPerson(rfqno, workpoint);
  161. return Content(dt.ToJson());
  162. }
  163. [HttpGet]
  164. [HandlerAjaxOnly]
  165. public ActionResult GetSubGridJson(string RFQCODE, Pagination pagination, string WorkPoint)
  166. {
  167. DataTable ListData = app.GetSubGridJson(RFQCODE, ref pagination, WorkPoint);
  168. var JsonData = new
  169. {
  170. total = pagination.total,
  171. page = pagination.page,
  172. records = pagination.records,
  173. rows = ListData,
  174. };
  175. return Content(JsonData.ToJson());
  176. }
  177. [HttpPost]
  178. 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)
  179. {
  180. DataTable dt = app.ExportAll( PruOrganize, PruTeam, RFQCode, RFQName, SupplierCode, SupplierName, InvCode, InvName, InvStd, TimeFrom, TimeTo, ReleaseState);
  181. AsposeCell.Export(dt);
  182. }
  183. [HttpGet]
  184. [HandlerAjaxOnly]
  185. public ActionResult SecondSelectOfferByPN(string RFQCODE, string Json, Pagination pagination)
  186. {
  187. DataTable ListData = app.SecondSelectOfferByPN(RFQCODE, Json,ref pagination);
  188. var JsonData = new
  189. {
  190. total = pagination.total,
  191. page = pagination.page,
  192. records = pagination.records,
  193. rows = ListData,
  194. };
  195. return Content(JsonData.ToJson());
  196. }
  197. }
  198. }