纽威
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.

183 lines
4.8 KiB

3 years ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. namespace NFine.Web.Areas.WMS.Controllers
  16. {
  17. public class ICSRCVIQCsController : ControllerBase
  18. {
  19. ICSRCVIQCsApp App = new ICSRCVIQCsApp();
  20. // GET: WMS/ICSRCVIQCs
  21. public ActionResult ICSRCVIQCs()
  22. {
  23. return View();
  24. }
  25. public ActionResult Rejection()
  26. {
  27. return View();
  28. }
  29. public ActionResult WWRejection()
  30. {
  31. return View();
  32. }
  33. //采购
  34. [HttpGet]
  35. public ActionResult GetICSInspection(Pagination pagination, string queryJson)
  36. {
  37. DataTable ListData = App.GetICSInspection(ref pagination, queryJson);
  38. var JsonData = new
  39. {
  40. total = pagination.total,
  41. page = pagination.page,
  42. records = pagination.records,
  43. rows = ListData,
  44. };
  45. return Content(JsonData.ToJson());
  46. }
  47. //委外
  48. [HttpGet]
  49. public ActionResult GetICSInspection2(Pagination pagination, string queryJson)
  50. {
  51. DataTable ListData = App.GetICSInspection2(ref pagination, queryJson);
  52. var JsonData = new
  53. {
  54. total = pagination.total,
  55. page = pagination.page,
  56. records = pagination.records,
  57. rows = ListData,
  58. };
  59. return Content(JsonData.ToJson());
  60. }
  61. //工单
  62. [HttpGet]
  63. public ActionResult GetICSInspection3(Pagination pagination, string queryJson)
  64. {
  65. DataTable ListData = App.GetICSInspection3(ref pagination, queryJson);
  66. var JsonData = new
  67. {
  68. total = pagination.total,
  69. page = pagination.page,
  70. records = pagination.records,
  71. rows = ListData,
  72. };
  73. return Content(JsonData.ToJson());
  74. }
  75. //不良原因
  76. [HttpGet]
  77. public ActionResult Select_ICSBadReason(string InvCode)
  78. {
  79. var data = App.Select_ICSBadReason(InvCode);
  80. return Content(data.ToJson());
  81. }
  82. //不良代码
  83. [HttpGet]
  84. public ActionResult GetSelectICSBadCode(string InvCode)
  85. {
  86. var data = App.GetSelectICSBadCode(InvCode);
  87. return Content(data.ToJson());
  88. }
  89. /// <summary>
  90. /// 创建检验表
  91. /// </summary>
  92. /// <param name="keyValue"></param>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [HandlerAjaxOnly]
  96. public ActionResult CreateICSInspection(string keyValue, string ICSInspections)
  97. {
  98. string msg = App.CreateICSInspection(keyValue, ICSInspections);
  99. if (!string.IsNullOrEmpty(msg))
  100. {
  101. return Error(msg);
  102. }
  103. else
  104. {
  105. return Success("添加成功!");
  106. }
  107. }
  108. //生成拒收单
  109. [HttpPost]
  110. [HandlerAjaxOnly]
  111. [ValidateAntiForgeryToken]
  112. public ActionResult CreateRejection(string keyValue,string Type)
  113. {
  114. string msg = "";
  115. if (Type=="1")
  116. {
  117. msg = App.CreateRejection(keyValue);
  118. }
  119. else
  120. {
  121. msg = App.CreateWWRejection(keyValue);
  122. }
  123. if (string.IsNullOrEmpty(msg))
  124. {
  125. return Success("操作成功!");
  126. }
  127. else
  128. {
  129. return Error("" + msg + "");
  130. }
  131. }
  132. /// <summary>
  133. /// 删除拒收单
  134. /// </summary>
  135. /// <returns></returns>
  136. [HttpPost]
  137. [HandlerAjaxOnly]
  138. [ValidateAntiForgeryToken]
  139. public ActionResult DelectRejection(string keyValue)
  140. {
  141. string msg = App.DelectRejection(keyValue);
  142. if (string.IsNullOrEmpty(msg))
  143. {
  144. return Success("删除成功!");
  145. }
  146. else
  147. {
  148. return Error(msg);
  149. }
  150. }
  151. [HttpPost]
  152. [HandlerAjaxOnly]
  153. [ValidateAntiForgeryToken]
  154. public ActionResult DelectWWRejection(string keyValue)
  155. {
  156. string msg = App.DelectWWRejection(keyValue);
  157. if (string.IsNullOrEmpty(msg))
  158. {
  159. return Success("删除成功!");
  160. }
  161. else
  162. {
  163. return Error(msg);
  164. }
  165. }
  166. }
  167. }