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.

252 lines
6.2 KiB

  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. namespace NFine.Web.Areas.WMS.Controllers
  6. {
  7. public class PurOrderController : ControllerBase
  8. {
  9. PurOrderApp App = new PurOrderApp();
  10. // GET: WMS/ProductionIssue
  11. public ActionResult ICSPurOrder()
  12. {
  13. return View();
  14. }
  15. public ActionResult ICSPurOrderAdd()
  16. {
  17. return View();
  18. }
  19. public ActionResult SeachICSPurOrder()
  20. {
  21. return View();
  22. }
  23. public ActionResult SeachInventory()
  24. {
  25. return View();
  26. }
  27. public ActionResult ICSPurOrderUpdate()
  28. {
  29. return View();
  30. }
  31. [HttpGet]
  32. public ActionResult GetICSMOApplyNeg(Pagination pagination)
  33. {
  34. DataTable ListData = App.GetICSMOApplyNeg(ref pagination);
  35. var JsonData = new
  36. {
  37. total = pagination.total,
  38. page = pagination.page,
  39. records = pagination.records,
  40. rows = ListData,
  41. };
  42. return Content(JsonData.ToJson());
  43. }
  44. [HttpGet]
  45. [HandlerAjaxOnly]
  46. public ActionResult GetICSMOApplyNegDetail(string POCode, Pagination pagination)
  47. {
  48. DataTable ListData = App.GetICSMOApplyNegDetail(POCode, ref pagination);
  49. var JsonData = new
  50. {
  51. total = pagination.total,
  52. page = pagination.page,
  53. records = pagination.records,
  54. rows = ListData,
  55. };
  56. return Content(JsonData.ToJson());
  57. }
  58. [HttpGet]
  59. public ActionResult GetINV(string invcode, Pagination pagination)
  60. {
  61. DataTable ListData = App.GetINV(invcode, ref pagination);
  62. var JsonData = new
  63. {
  64. total = pagination.total,
  65. page = pagination.page,
  66. records = pagination.records,
  67. rows = ListData,
  68. };
  69. return Content(JsonData.ToJson());
  70. }
  71. [HttpGet]
  72. public ActionResult GetICSMOPickLog(string invcode, Pagination pagination)
  73. {
  74. DataTable ListData = App.GetICSMOPickLog(invcode, ref pagination);
  75. var JsonData = new
  76. {
  77. total = pagination.total,
  78. page = pagination.page,
  79. records = pagination.records,
  80. rows = ListData,
  81. };
  82. return Content(JsonData.ToJson());
  83. }
  84. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  85. {
  86. DataTable table = App.GetICSReturnTemporary(rfqno);
  87. var JsonData = new
  88. {
  89. total = pagination.total,
  90. page = pagination.page,
  91. records = pagination.records,
  92. rows = table
  93. };
  94. return Content(JsonData.ToJson());
  95. }
  96. //[httpget]
  97. //[handlerajaxonly]
  98. //public actionresult getwhcode()
  99. //{
  100. // datatable dt = app.getwhcode();
  101. // return content(dt.tojson());
  102. //}
  103. public void AddPurOrderTemp(string json)
  104. {
  105. App.AddPurOrderTemp(json);
  106. }
  107. public ActionResult DeleteMopick(string json)
  108. {
  109. return Content(App.DeleteMopick(json));
  110. }
  111. public void ClearTemp()
  112. {
  113. App.ClearTemp();
  114. }
  115. //[HttpPost]
  116. //[HandlerAjaxOnly]
  117. public ActionResult SaveICSPurOrder(string ICSASN)
  118. {
  119. string msg = App.SaveICSPurOrder(ICSASN);
  120. if (!string.IsNullOrEmpty(msg))
  121. {
  122. return Error(msg);
  123. }
  124. else
  125. {
  126. return Success("添加成功!");
  127. }
  128. }
  129. [HttpPost]
  130. [HandlerAjaxOnly]
  131. public ActionResult UpdateICSPurOrder(string ICSASN)
  132. {
  133. string msg = App.UpdateICSPurOrder(ICSASN);
  134. if (!string.IsNullOrEmpty(msg))
  135. {
  136. return Error(msg);
  137. }
  138. else
  139. {
  140. return Success("修改成功!");
  141. }
  142. }
  143. /// <summary>
  144. /// 获取文本框值
  145. /// </summary>
  146. /// <param name="POCode"></param>
  147. /// <param name="PORow"></param>
  148. /// <returns></returns>
  149. [HttpPost]
  150. [HandlerAjaxOnly]
  151. public ActionResult GetInputValue(string ID)
  152. {
  153. DataTable ListData = App.GetInputValue(ID);
  154. var JsonData = new
  155. {
  156. rows = ListData,
  157. };
  158. return Content(JsonData.ToJson());
  159. }
  160. public ActionResult GetICSMOApplyNegDetailTemp(string PoCode, Pagination pagination)
  161. {
  162. DataTable table = App.GetICSMOApplyNegDetailTemp(PoCode);
  163. var JsonData = new
  164. {
  165. total = pagination.total,
  166. page = pagination.page,
  167. records = pagination.records,
  168. rows = table
  169. };
  170. return Content(JsonData.ToJson());
  171. }
  172. public void UpdateMOApplyNegTemp(string json)
  173. {
  174. App.UpdateMOApplyNegTemp(json);
  175. }
  176. [HttpPost]
  177. [HandlerAjaxOnly]
  178. public ActionResult AuditICSPurOrder(string ICSASN)
  179. {
  180. string msg = App.AuditICSPurOrder(ICSASN);
  181. if (!string.IsNullOrEmpty(msg))
  182. {
  183. return Error(msg);
  184. }
  185. else
  186. {
  187. return Success("操作成功!");
  188. }
  189. }
  190. [HttpPost]
  191. [HandlerAjaxOnly]
  192. [ValidateAntiForgeryToken]
  193. public ActionResult DeleteICSPurchaseOrder(string keyValue)
  194. {
  195. string msg = App.DeleteICSPurchaseOrder(keyValue);
  196. if (string.IsNullOrEmpty(msg))
  197. {
  198. return Success("删除成功!");
  199. }
  200. else
  201. {
  202. return Error(msg);
  203. }
  204. }
  205. }
  206. }