纽威
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.

162 lines
5.2 KiB

3 years ago
3 years ago
3 years ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. namespace NFine.Web.Areas.WMS.Controllers
  16. {
  17. public class PickMaterialController : ControllerBase
  18. {
  19. // GET: WMS/PickMaterial
  20. PickMaterialApp App = new PickMaterialApp();
  21. public ActionResult ICSMOPickMerge()
  22. {
  23. return View();
  24. }
  25. [HttpGet]
  26. [HandlerAjaxOnly]
  27. public ActionResult GetGridJson(Pagination pagination, string queryJson, string Type)
  28. {
  29. DataTable ListData = new DataTable();
  30. if (Type == "1")//工单
  31. {
  32. ListData = App.GetGridJson(queryJson, ref pagination);
  33. }
  34. if (Type=="2")//工单发料
  35. {
  36. ListData = App.GetGridJson2(queryJson, ref pagination);
  37. }
  38. if (Type=="3")//工单材料出库
  39. {
  40. ListData = App.GetGridJson3(queryJson, ref pagination);
  41. }
  42. if (Type == "4")//委外备料
  43. {
  44. ListData = App.GetGridJson4(queryJson, ref pagination);
  45. }
  46. if (Type == "5")//委外领料
  47. {
  48. ListData = App.GetGridJson5(queryJson, ref pagination);
  49. }
  50. if (Type == "6")//委外材料出库
  51. {
  52. ListData = App.GetGridJson6(queryJson, ref pagination);
  53. }
  54. if (Type == "7")//销售发货
  55. {
  56. ListData = App.GetGridJson7(queryJson, ref pagination);
  57. }
  58. if (Type == "8")//其它出库
  59. {
  60. ListData = App.GetGridJson8(queryJson, ref pagination);
  61. }
  62. if (Type == "9")//借用单
  63. {
  64. ListData = App.GetGridJson9(queryJson, ref pagination);
  65. }
  66. if (Type == "10")//物料调拨
  67. {
  68. ListData = App.GetGridJson10(queryJson, ref pagination);
  69. }
  70. if (Type == "11")//两步调出
  71. {
  72. ListData = App.GetGridJson11(queryJson, ref pagination);
  73. }
  74. var JsonData = new
  75. {
  76. total = pagination.total,
  77. page = pagination.page,
  78. records = pagination.records,
  79. rows = ListData,
  80. };
  81. return Content(JsonData.ToJson());
  82. }
  83. //子表查询
  84. [HttpGet]
  85. [HandlerAjaxOnly]
  86. public ActionResult GetSubGridJson(string Code,string Type)
  87. {
  88. DataTable ListData = new DataTable();
  89. if (Type=="1"){ListData = App.GetSubGridJson1(Code); }//工单
  90. if (Type=="2"){ListData = App.GetSubGridJson2(Code); }//工单发料
  91. if (Type == "3") { ListData = App.GetSubGridJson3(Code); }//材料出库
  92. if (Type == "4") { ListData = App.GetSubGridJson4(Code); }//委外备料
  93. if (Type == "5") { ListData = App.GetSubGridJson5(Code); }//委外领料
  94. if (Type == "6") { ListData = App.GetSubGridJson6(Code); }//委外材料出库
  95. if (Type == "7") { ListData = App.GetSubGridJson7(Code); }//销售发货
  96. if (Type == "8") { ListData = App.GetSubGridJson8(Code); }//其它出库
  97. if (Type == "9") { ListData = App.GetSubGridJson9(Code); }//借用单
  98. if (Type == "10") { ListData = App.GetSubGridJson10(Code); }//物料调拨
  99. if (Type == "11") { ListData = App.GetSubGridJson11(Code); }//两步调出
  100. var JsonData = new
  101. {
  102. rows = ListData,
  103. };
  104. return Content(JsonData.ToJson());
  105. }
  106. [HttpGet]
  107. [HandlerAjaxOnly]
  108. public ActionResult GetICSMOPickMergeTemp(Pagination pagination, string ID,string Type,string flag)
  109. {
  110. DataTable ListData = new DataTable();
  111. if (flag=="1")
  112. {
  113. ListData = App.GetICSMOPickMergeTemp(ID, Type);
  114. }
  115. else
  116. {
  117. ListData = App.GetICSMOPickMergeTemp2(ID, Type);
  118. }
  119. var JsonData = new
  120. {
  121. total = pagination.total,
  122. page = pagination.page,
  123. records = pagination.records,
  124. rows = ListData,
  125. };
  126. return Content(JsonData.ToJson());
  127. }
  128. [HttpPost]
  129. [HandlerAjaxOnly]
  130. public ActionResult MergeMaterial(string keyValue,string Type)
  131. {
  132. string msg = App.MergeMaterial(keyValue, Type);
  133. if (!string.IsNullOrEmpty(msg))
  134. {
  135. return Error(msg);
  136. }
  137. else
  138. {
  139. return Success("添加成功!");
  140. }
  141. }
  142. [HttpPost]
  143. public ActionResult CheckQty(string objArr)
  144. {
  145. string i = App.CheckQty(objArr);
  146. var JsonData = new
  147. {
  148. count = i
  149. };
  150. return Content(JsonData.ToJson());
  151. }
  152. }
  153. }