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.

187 lines
5.5 KiB

3 weeks ago
  1. using NFine.Application.HGWMS;
  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.HGWMS.Controllers
  10. {
  11. public class WMSCreateItemLotController : ControllerBase
  12. {
  13. private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
  14. public ActionResult CreateItemLot()
  15. {
  16. return View();
  17. }
  18. public ActionResult From()
  19. {
  20. return View();
  21. }
  22. public ActionResult UpdateCount()
  23. {
  24. return View();
  25. }
  26. public ActionResult UpdatePrintTemplate()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 获取工单主表数据
  32. /// </summary>
  33. /// <param name="pagination"></param>
  34. /// <param name="queryJson"></param>
  35. /// <returns></returns>
  36. [HttpGet]
  37. [HandlerAjaxOnly]
  38. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  39. {
  40. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  41. var JsonData = new
  42. {
  43. total = pagination.total,
  44. page = pagination.page,
  45. records = pagination.records,
  46. rows = ListData,
  47. };
  48. return Content(JsonData.ToJson());
  49. }
  50. [HttpGet]
  51. [HandlerAjaxOnly]
  52. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, string isPrint, Pagination pagination)
  53. {
  54. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, isPrint, ref pagination);
  55. var JsonData = new
  56. {
  57. total = pagination.total,
  58. page = pagination.page,
  59. records = pagination.records,
  60. rows = ListData,
  61. };
  62. return Content(JsonData.ToJson());
  63. }
  64. //成品
  65. [HttpPost]
  66. [HandlerAjaxOnly]
  67. [ValidateAntiForgeryToken]
  68. public ActionResult SubmitFormChengPing( string keyValue)
  69. {
  70. string msg = App.SubmitFormChengPing( keyValue);
  71. if (msg=="")
  72. {
  73. return Success("生成成功!");
  74. }
  75. else
  76. {
  77. return Error(msg);
  78. }
  79. }
  80. /// <summary>
  81. /// 删除子件条码信息
  82. /// </summary>
  83. /// <param name="keyValue"></param>
  84. /// <returns></returns>
  85. [HttpPost]
  86. [HandlerAjaxOnly]
  87. [ValidateAntiForgeryToken]
  88. public ActionResult DeleteItemLot(string MOCodes)
  89. {
  90. MOCodes = MOCodes.Substring(1, MOCodes.Length-2);
  91. string msg = App.DeleteItemLot(MOCodes);
  92. if (string.IsNullOrWhiteSpace(msg))
  93. {
  94. return Success("删除成功!");
  95. }
  96. else
  97. {
  98. return Error(msg);
  99. }
  100. }
  101. /// <summary>
  102. /// 打印子件条码信息
  103. /// </summary>
  104. /// <param name="keyValue"></param>
  105. /// <returns></returns>
  106. [HttpPost]
  107. [HandlerAjaxOnly]
  108. [ValidateAntiForgeryToken]
  109. public ActionResult PrintViewByLot(string MOCodes, string PrintTemplate)
  110. {
  111. string msg = App.PrintViewByLot(MOCodes,PrintTemplate);
  112. if (string.IsNullOrWhiteSpace(msg))
  113. {
  114. return Success("打印成功!");
  115. }
  116. else
  117. {
  118. return Error(msg);
  119. }
  120. }
  121. /// <summary>
  122. /// 打印子件条码信息(单个条码)
  123. /// </summary>
  124. /// <param name="keyValue"></param>
  125. /// <returns></returns>
  126. [HttpPost]
  127. [HandlerAjaxOnly]
  128. [ValidateAntiForgeryToken]
  129. public ActionResult PrintViewByLotSingle(string Lots,int PrintCount,string PrintTemplate)
  130. {
  131. string msg = App.PrintViewByLotSingle(Lots, PrintCount, PrintTemplate);
  132. if (string.IsNullOrWhiteSpace(msg))
  133. {
  134. return Success("打印成功!");
  135. }
  136. else
  137. {
  138. return Error(msg);
  139. }
  140. }
  141. [HttpGet]
  142. [HandlerAjaxOnly]
  143. public ActionResult GetPrintTemplate()
  144. {
  145. string dt = App.GetPrintTemplate();
  146. return Content(dt);
  147. }
  148. [HttpGet]
  149. [HandlerAjaxOnly]
  150. public ActionResult GetGridJsonChengPingNormal(Pagination pagination, string queryJson)
  151. {
  152. DataTable ListData = App.GetGridJsonChengPingNormal(queryJson, ref pagination);
  153. var JsonData = new
  154. {
  155. total = pagination.total,
  156. page = pagination.page,
  157. records = pagination.records,
  158. rows = ListData,
  159. };
  160. return Content(JsonData.ToJson());
  161. }
  162. [HttpGet]
  163. [HandlerAjaxOnly]
  164. public ActionResult GetSubGridJsonNormal(string ApplyNegCode, string Sequence, string Type, string isPrint, Pagination pagination)
  165. {
  166. DataTable ListData = App.GetSubGridJsonNormal(ApplyNegCode, Sequence, Type, isPrint, ref pagination);
  167. var JsonData = new
  168. {
  169. total = pagination.total,
  170. page = pagination.page,
  171. records = pagination.records,
  172. rows = ListData,
  173. };
  174. return Content(JsonData.ToJson());
  175. }
  176. }
  177. }