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.

188 lines
5.6 KiB

4 days 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 ComparisonController : ControllerBase
  12. {
  13. private ComparisonApp App = new ComparisonApp();
  14. //
  15. // GET: /SRM/Comparison/
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult ComPricelist()
  21. {
  22. return View();
  23. }
  24. public ActionResult CompPrice()
  25. {
  26. return View();
  27. }
  28. public ActionResult SelectPrice()
  29. {
  30. return View();
  31. }
  32. public ActionResult AuditComPrice()
  33. {
  34. return View();
  35. }
  36. /// <summary>
  37. /// 获取比价管理信息
  38. /// </summary>
  39. /// <param name="pagination">分页</param>
  40. /// <param name="queryJson">传入过滤参数</param>
  41. /// <returns></returns>
  42. [HttpGet]
  43. [HandlerAjaxOnly]
  44. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  45. {
  46. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  47. var JsonData = new
  48. {
  49. total = pagination.total,
  50. page = pagination.page,
  51. records = pagination.records,
  52. rows = ListData,
  53. };
  54. return Content(JsonData.ToJson());
  55. }
  56. /// <summary>
  57. /// 获取生效价格查询
  58. /// </summary>
  59. /// <param name="pagination">分页</param>
  60. /// <param name="queryJson">传入过滤参数</param>
  61. /// <returns></returns>
  62. [HttpGet]
  63. [HandlerAjaxOnly]
  64. public ActionResult GetGridPrice(Pagination pagination, string queryJson)
  65. {
  66. DataTable ListData = App.GetGridPrice(queryJson, ref pagination);
  67. var JsonData = new
  68. {
  69. total = pagination.total,
  70. page = pagination.page,
  71. records = pagination.records,
  72. rows = ListData,
  73. };
  74. return Content(JsonData.ToJson());
  75. }
  76. /// <summary>
  77. /// 获取询价物资比价价格查询
  78. /// </summary>
  79. /// <param name="pagination">分页</param>
  80. /// <param name="queryJson">传入过滤参数</param>
  81. /// <returns></returns>
  82. [HttpGet]
  83. [HandlerAjaxOnly]
  84. public ActionResult GetGridMaterial(Pagination pagination, string ITEMCODE, string VenCode,string RFQCODE)
  85. {
  86. DataTable ListData = App.GetGridMaterial( ref pagination, ITEMCODE, VenCode, RFQCODE);
  87. var JsonData = new
  88. {
  89. total = pagination.total,
  90. page = pagination.page,
  91. records = pagination.records,
  92. rows = ListData,
  93. };
  94. return Content(JsonData.ToJson());
  95. }
  96. /// <summary>
  97. /// 获取税率
  98. /// </summary>
  99. /// <param name="pagination">分页</param>
  100. /// <param name="queryJson">传入过滤参数</param>
  101. /// <returns></returns>
  102. //[HttpGet]
  103. //[HandlerAjaxOnly]
  104. //public ActionResult GetGridVendorTaxrate(Pagination pagination, string queryJson)
  105. //{
  106. // DataTable ListData = App.GetGridVendorTaxrate(queryJson, ref pagination);
  107. // var JsonData = new
  108. // {
  109. // total = pagination.total,
  110. // page = pagination.page,
  111. // records = pagination.records,
  112. // rows = ListData,
  113. // };
  114. // return Content(JsonData.ToJson());
  115. //}
  116. //送钱
  117. [HttpPost]
  118. [HandlerAjaxOnly]
  119. [ValidateAntiForgeryToken]
  120. public ActionResult UpdateCompareCode(string keyValue, string DeleteFlag)
  121. {
  122. string msg = App.UpdateCompareCode(keyValue);
  123. if (string.IsNullOrWhiteSpace(msg))
  124. {
  125. return Success("送签成功!");
  126. }
  127. else
  128. {
  129. return Success("送签成功!");
  130. }
  131. }
  132. [HttpGet]
  133. [HandlerAjaxOnly]
  134. public ActionResult GetSelectPrice(Pagination pagination, string COMPARECODE)
  135. {
  136. DataTable ListData = App.GetSelectPrice(COMPARECODE, ref pagination);
  137. var JsonData = new
  138. {
  139. total = pagination.total,
  140. page = pagination.page,
  141. records = pagination.records,
  142. rows = ListData,
  143. };
  144. return Content(JsonData.ToJson());
  145. }
  146. [HttpPost]
  147. [HandlerAjaxOnly]
  148. [ValidateAntiForgeryToken]
  149. public ActionResult DeleteCOMPARECODE(string keyValue)
  150. {
  151. string msg = App.DeleteCOMPARECODE(keyValue);
  152. if (string.IsNullOrEmpty(msg))
  153. {
  154. return Success("删除成功!");
  155. }
  156. else
  157. {
  158. return Error(msg);
  159. }
  160. }
  161. //审核
  162. [HttpPost]
  163. [HandlerAjaxOnly]
  164. [ValidateAntiForgeryToken]
  165. public ActionResult AuditCompareCode(string COMPARECODE, string VENDORCODE)
  166. {
  167. string msg = App.AuditCompareCode(COMPARECODE, VENDORCODE);
  168. if (string.IsNullOrWhiteSpace(msg))
  169. {
  170. return Success("审核成功!");
  171. }
  172. else
  173. {
  174. return Success("审核成功!");
  175. }
  176. }
  177. }
  178. }