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.

168 lines
4.8 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 ICSOutsourcingReceiveController : ControllerBase
  15. {
  16. ICSOutsourcingReceiveApp App = new ICSOutsourcingReceiveApp();
  17. // GET: WMS/ICSOutsourcingReceive
  18. public ActionResult ICSOutsourcingReceiveApplyNeg()
  19. {
  20. return View();
  21. }
  22. public ActionResult ICSOutsourcingReceiveApplyNegAdd()
  23. {
  24. return View();
  25. }
  26. public ActionResult ICSOutsourcingReceiveApplyNegUpdate()
  27. {
  28. return View();
  29. }
  30. public ActionResult SeachICSOutsourcingReceive()
  31. {
  32. return View();
  33. }
  34. public ActionResult SeachInventory()
  35. {
  36. return View();
  37. }
  38. [HttpGet]
  39. [HandlerAjaxOnly]
  40. public ActionResult GetOutsourcingReceiveApplyNegDetail(string ApplyNegCode, Pagination pagination)
  41. {
  42. DataTable ListData = App.GetOutsourcingReceiveApplyNegDetail(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 DeleteICSOutsourcingReceiveApplyNeg(string keyValue)
  56. {
  57. string msg = App.DeleteICSOutsourcingReceiveApplyNeg(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 GetOutsourcingReceiveApplyNeg(Pagination pagination)
  74. {
  75. DataTable ListData = App.GetOutsourcingReceiveApplyNeg(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 GetICSOutsourcingReceiveReturnTemporary(string RCVCode, Pagination pagination)
  92. {
  93. DataTable table = App.GetICSOutsourcingReceiveReturnTemporary(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 SaveICSOutsourcingReceiveApplyNeg(string ICSASN)
  127. {
  128. string msg = App.SaveICSOutsourcingReceiveApplyNeg(ICSASN);
  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 UpdateICSOutsourcingReceiveApplyNeg(string ICSASN)
  146. {
  147. string msg = App.UpdateICSOutsourcingReceiveApplyNeg(ICSASN);
  148. if (!string.IsNullOrEmpty(msg))
  149. {
  150. return Error(msg);
  151. }
  152. else
  153. {
  154. return Success("修改成功!");
  155. }
  156. }
  157. }
  158. }