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.

266 lines
6.6 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. using System.Reflection.Emit;
  6. namespace NFine.Web.Areas.WMS.Controllers
  7. {
  8. public class ICSMOController : ControllerBase
  9. {
  10. ICSMOApp App = new ICSMOApp();
  11. // GET: WMS/ProductionIssue
  12. public ActionResult ICSMOApplyNeg()
  13. {
  14. return View();
  15. }
  16. public ActionResult ICSMOApplyNegAdd()
  17. {
  18. return View();
  19. }
  20. public ActionResult SeachICSMO()
  21. {
  22. return View();
  23. }
  24. public ActionResult SeachInventory()
  25. {
  26. return View();
  27. }
  28. public ActionResult ICSMOApplyNegUpdate()
  29. {
  30. return View();
  31. }
  32. [HttpGet]
  33. public ActionResult GetICSMOApplyNeg(Pagination pagination)
  34. {
  35. DataTable ListData = App.GetICSMOApplyNeg(ref pagination);
  36. var JsonData = new
  37. {
  38. total = pagination.total,
  39. page = pagination.page,
  40. records = pagination.records,
  41. rows = ListData,
  42. };
  43. return Content(JsonData.ToJson());
  44. }
  45. [HttpGet]
  46. [HandlerAjaxOnly]
  47. public ActionResult GetICSMOApplyNegDetail(string ApplyNegCode, Pagination pagination)
  48. {
  49. DataTable ListData = App.GetICSMOApplyNegDetail(ApplyNegCode, ref pagination);
  50. var JsonData = new
  51. {
  52. total = pagination.total,
  53. page = pagination.page,
  54. records = pagination.records,
  55. rows = ListData,
  56. };
  57. return Content(JsonData.ToJson());
  58. }
  59. [HttpGet]
  60. public ActionResult GetINV(string invcode, Pagination pagination)
  61. {
  62. DataTable ListData = App.GetINV(invcode, ref pagination);
  63. var JsonData = new
  64. {
  65. total = pagination.total,
  66. page = pagination.page,
  67. records = pagination.records,
  68. rows = ListData,
  69. };
  70. return Content(JsonData.ToJson());
  71. }
  72. [HttpGet]
  73. public ActionResult GetMO(string MOCode, Pagination pagination)
  74. {
  75. DataTable ListData = App.GetMO(MOCode, 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. [HttpGet]
  86. public ActionResult GetICSMOPickLog(string invcode, Pagination pagination)
  87. {
  88. DataTable ListData = App.GetICSMOPickLog(invcode, ref pagination);
  89. var JsonData = new
  90. {
  91. total = pagination.total,
  92. page = pagination.page,
  93. records = pagination.records,
  94. rows = ListData,
  95. };
  96. return Content(JsonData.ToJson());
  97. }
  98. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  99. {
  100. DataTable table = App.GetICSReturnTemporary(rfqno);
  101. var JsonData = new
  102. {
  103. total = pagination.total,
  104. page = pagination.page,
  105. records = pagination.records,
  106. rows = table
  107. };
  108. return Content(JsonData.ToJson());
  109. }
  110. [HttpGet]
  111. [HandlerAjaxOnly]
  112. public ActionResult GetWHCode()
  113. {
  114. DataTable dt = App.GetWHCode();
  115. return Content(dt.ToJson());
  116. }
  117. public void AddMOApplyNegTemp(string json)
  118. {
  119. App.AddMOApplyNegTemp(json);
  120. }
  121. public ActionResult DeleteMopick(string json)
  122. {
  123. return Content(App.DeleteMopick(json));
  124. }
  125. public void ClearTemp()
  126. {
  127. App.ClearTemp();
  128. }
  129. [HttpPost]
  130. [HandlerAjaxOnly]
  131. public ActionResult SaveICSMOApplyNeg(string ICSASN)
  132. {
  133. string msg = App.SaveICSMOApplyNeg(ICSASN);
  134. if (!string.IsNullOrEmpty(msg))
  135. {
  136. return Error(msg);
  137. }
  138. else
  139. {
  140. return Success("添加成功!");
  141. }
  142. }
  143. [HttpPost]
  144. [HandlerAjaxOnly]
  145. public ActionResult UpdateICSMOApplyNeg(string ICSASN)
  146. {
  147. string msg = App.UpdateICSMOApplyNeg(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="POCode"></param>
  161. /// <param name="PORow"></param>
  162. /// <returns></returns>
  163. [HttpPost]
  164. [HandlerAjaxOnly]
  165. public ActionResult GetInputValue(string ID)
  166. {
  167. DataTable ListData = App.GetInputValue(ID);
  168. var JsonData = new
  169. {
  170. rows = ListData,
  171. };
  172. return Content(JsonData.ToJson());
  173. }
  174. public ActionResult GetICSMOApplyNegDetailTemp(string ApplyNegCode, Pagination pagination)
  175. {
  176. DataTable table = App.GetICSMOApplyNegDetailTemp(ApplyNegCode);
  177. var JsonData = new
  178. {
  179. total = pagination.total,
  180. page = pagination.page,
  181. records = pagination.records,
  182. rows = table
  183. };
  184. return Content(JsonData.ToJson());
  185. }
  186. public void UpdateMOApplyNegTemp(string json)
  187. {
  188. App.UpdateMOApplyNegTemp(json);
  189. }
  190. [HttpPost]
  191. [HandlerAjaxOnly]
  192. public ActionResult AuditICSMOApplyNeg(string ICSASN)
  193. {
  194. string msg = App.AuditICSMOApplyNeg(ICSASN);
  195. if (!string.IsNullOrEmpty(msg))
  196. {
  197. return Error(msg);
  198. }
  199. else
  200. {
  201. return Success("操作成功!");
  202. }
  203. }
  204. [HttpPost]
  205. [HandlerAjaxOnly]
  206. [ValidateAntiForgeryToken]
  207. public ActionResult DeleteICSMOApplyNeg(string keyValue)
  208. {
  209. string msg = App.DeleteICSMOApplyNeg(keyValue);
  210. if (string.IsNullOrEmpty(msg))
  211. {
  212. return Success("删除成功!");
  213. }
  214. else
  215. {
  216. return Error(msg);
  217. }
  218. }
  219. }
  220. }