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.

189 lines
5.3 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  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.WMS.Controllers
  10. {
  11. /// <summary>
  12. /// 红字采购入库
  13. /// </summary>
  14. public class ICSPurchaseReceiveController : ControllerBase
  15. {
  16. ICSPurchaseReceiveApp App = new ICSPurchaseReceiveApp();
  17. // GET: WMS/ICSPurchaseReceive
  18. public ActionResult ICSPurchaseReceiveApplyNeg()
  19. {
  20. return View();
  21. }
  22. public ActionResult ICSPurchaseReceiveApplyNegAdd()
  23. {
  24. return View();
  25. }
  26. public ActionResult ICSPurchaseReceiveApplyNegUpdate()
  27. {
  28. return View();
  29. }
  30. public ActionResult SeachICSPurchaseReceive()
  31. {
  32. return View();
  33. }
  34. public ActionResult SeachInventory()
  35. {
  36. return View();
  37. }
  38. [HttpGet]
  39. [HandlerAjaxOnly]
  40. public ActionResult GetPurchaseReceiveApplyNegDetail(string ApplyNegCode, Pagination pagination)
  41. {
  42. DataTable ListData = App.GetPurchaseReceiveApplyNegDetail(ApplyNegCode, ref pagination);
  43. var JsonData = new
  44. {
  45. total = pagination.total,
  46. page = pagination.page,
  47. records = pagination.records,
  48. rows = ListData,
  49. };
  50. return Content(JsonData.ToJson());
  51. }
  52. [HttpPost]
  53. [HandlerAjaxOnly]
  54. [ValidateAntiForgeryToken]
  55. public ActionResult DeleteICSPurchaseReceiveApplyNeg(string keyValue)
  56. {
  57. string msg = App.DeleteICSPurchaseReceiveApplyNeg(keyValue);
  58. if (string.IsNullOrEmpty(msg))
  59. {
  60. return Success("删除成功!");
  61. }
  62. else
  63. {
  64. return Error(msg);
  65. }
  66. }
  67. /// <summary>
  68. /// 汇总
  69. /// </summary>
  70. /// <param name="pagination"></param>
  71. /// <returns></returns>
  72. [HttpGet]
  73. public ActionResult GetPurchaseReceiveApplyNeg(Pagination pagination)
  74. {
  75. DataTable ListData = App.GetPurchaseReceiveApplyNeg(ref pagination);
  76. var JsonData = new
  77. {
  78. total = pagination.total,
  79. page = pagination.page,
  80. records = pagination.records,
  81. rows = ListData,
  82. };
  83. return Content(JsonData.ToJson());
  84. }
  85. /// <summary>
  86. /// 修改弹出框的数据来源
  87. /// </summary>
  88. /// <param name="RCVCode"></param>
  89. /// <param name="pagination"></param>
  90. /// <returns></returns>
  91. public ActionResult GetICSPurchaseReceiveReturnTemporary(string RCVCode, Pagination pagination)
  92. {
  93. DataTable table = App.GetICSPurchaseReceiveReturnTemporary(RCVCode);
  94. var JsonData = new
  95. {
  96. total = pagination.total,
  97. page = pagination.page,
  98. records = pagination.records,
  99. rows = table
  100. };
  101. return Content(JsonData.ToJson());
  102. }
  103. public ActionResult GetOOCode(string WorkPoint)
  104. {
  105. try
  106. {
  107. string Code = App.GetCode(WorkPoint);
  108. var JsonData = new
  109. {
  110. Code = Code,
  111. };
  112. return Content(JsonData.ToJson());
  113. }
  114. catch (Exception ex)
  115. {
  116. return Error(ex.Message);
  117. }
  118. }
  119. /// <summary>
  120. /// 新增和修改
  121. /// </summary>
  122. /// <param name="ICSASN"></param>
  123. /// <returns></returns>
  124. [HttpPost]
  125. [HandlerAjaxOnly]
  126. public ActionResult SaveICSPurchaseReceiveApplyNeg(string keyValue, string deleteIDs)
  127. {
  128. string msg = App.SaveICSPurchaseReceiveApplyNeg(keyValue, deleteIDs);
  129. if (!string.IsNullOrEmpty(msg))
  130. {
  131. return Error(msg);
  132. }
  133. else
  134. {
  135. return Success("保存成功!");
  136. }
  137. }
  138. ///// <summary>
  139. ///// 新增
  140. ///// </summary>
  141. ///// <param name="ICSASN"></param>
  142. ///// <returns></returns>
  143. //[HttpPost]
  144. //[HandlerAjaxOnly]
  145. //public ActionResult SaveICSPurchaseReceiveApplyNeg(string ICSASN)
  146. //{
  147. // string msg = App.SaveICSPurchaseReceiveApplyNeg(ICSASN);
  148. // if (!string.IsNullOrEmpty(msg))
  149. // {
  150. // return Error(msg);
  151. // }
  152. // else
  153. // {
  154. // return Success("添加成功!");
  155. // }
  156. //}
  157. ///// <summary>
  158. ///// 修改
  159. ///// </summary>
  160. ///// <param name="ICSASN"></param>
  161. ///// <returns></returns>
  162. //[HttpPost]
  163. //[HandlerAjaxOnly]
  164. //public ActionResult UpdateICSPurchaseReceiveApplyNeg(string ICSASN)
  165. //{
  166. // string msg = App.SaveICSPurchaseReceiveApplyNeg(ICSASN);
  167. // if (!string.IsNullOrEmpty(msg))
  168. // {
  169. // return Error(msg);
  170. // }
  171. // else
  172. // {
  173. // return Success("修改成功!");
  174. // }
  175. //}
  176. }
  177. }