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

367 lines
13 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <script src="~/Content/js/select2/select2.min.js"></script>
  8. <style>
  9. .form {
  10. margin: 25px 15px;
  11. }
  12. </style>
  13. <script>
  14. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  15. var User = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  16. var Times = new Date();
  17. var Time = formatDate("YYYY-mm-dd HH:MM:SS", Times);
  18. $(function () {
  19. $("#minPackQty").keyup(function () {
  20. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  21. }).bind("paste", function () { //CTR+V事件处理
  22. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  23. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  24. $("#thisCreateQty").keyup(function () {
  25. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  26. }).bind("paste", function () { //CTR+V事件处理
  27. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  28. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  29. $("#cretePageCount").keyup(function () {
  30. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  31. }).bind("paste", function () { //CTR+V事件处理
  32. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  33. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  34. $("#txtMUSER").val(User);
  35. $("#txtMTIME").val(Time);
  36. $("#txtMUSER").attr("disabled", "disabled");
  37. $("#txtMTIME").attr("disabled", "disabled");
  38. InitControl();
  39. $("#sel_WHCode").change(function () {
  40. debugger;
  41. if ($("#sel_WHCode").val() == "") {
  42. $.modalAlertNew("WMS00041");
  43. return;
  44. }
  45. else {
  46. var WHCodeID = $("#sel_WHCode").val();
  47. var a = WHCodeID.split("|");
  48. WHCodeID = a[0];
  49. var $QU = $("#sel_QU");
  50. $QU.select2({
  51. allowClear: true,
  52. escapeMarkup: function (m) {
  53. return m;
  54. }
  55. });
  56. $.ajax({
  57. url: "/WMS/Blitem/GetQU?WHCodeID=" + WHCodeID + "&" + Math.random(),
  58. dataType: "json",
  59. async: false,
  60. success: function (data) {
  61. $.each(data, function (index, item) {
  62. $QU.append("<option value='" + item.QUValue + "'>" + item.QUName + "</option>");
  63. });
  64. }
  65. });
  66. }
  67. });
  68. $("#sel_QU").change(function () {
  69. debugger;
  70. if ($("#sel_QU").val() == "") {
  71. $.modalAlertNew("WMS00041");
  72. return;
  73. }
  74. else {
  75. var WHCodeID = $("#sel_WHCode").val();
  76. var a = WHCodeID.split("|");
  77. WHCodeID = a[0];
  78. var Qu = $("#sel_QU").val();
  79. var $Pai = $("#sel_Pai");
  80. $Pai.select2({
  81. allowClear: true,
  82. escapeMarkup: function (m) {
  83. return m;
  84. }
  85. });
  86. $.ajax({
  87. url: "/WMS/Blitem/GetPai?WHCodeID=" + WHCodeID + "&Qu=" + Qu + "&" + Math.random(),
  88. dataType: "json",
  89. async: false,
  90. success: function (data) {
  91. $.each(data, function (index, item) {
  92. $Pai.append("<option value='" + item.PaiValue + "'>" + item.PaiName + "</option>");
  93. });
  94. }
  95. });
  96. }
  97. });
  98. $("#sel_Pai").change(function () {
  99. debugger;
  100. if ($("#sel_Pai").val() == "") {
  101. $.modalAlertNew("WMS00041");
  102. return;
  103. }
  104. else {
  105. var WHCodeID = $("#sel_WHCode").val();
  106. var a = WHCodeID.split("|");
  107. WHCodeID = a[0];
  108. var Qu = $("#sel_QU").val();
  109. var Pai = $("#sel_Pai").val();
  110. var $HuoJia = $("#sel_HuoJia");
  111. $HuoJia.select2({
  112. allowClear: true,
  113. escapeMarkup: function (m) {
  114. return m;
  115. }
  116. });
  117. $.ajax({
  118. url: "/WMS/Blitem/GetHuoJia?WHCodeID=" + WHCodeID + "&Qu=" + Qu + "&Pai=" + Pai + "&" + Math.random(),
  119. dataType: "json",
  120. async: false,
  121. success: function (data) {
  122. $.each(data, function (index, item) {
  123. $HuoJia.append("<option value='" + item.HuoJiaValue + "'>" + item.HuoJiaName + "</option>");
  124. });
  125. }
  126. });
  127. }
  128. });
  129. $("#sel_HuoJia").change(function () {
  130. debugger;
  131. if ($("#sel_HuoJia").val() == "") {
  132. $.modalAlertNew("WMS00041");
  133. return;
  134. }
  135. else {
  136. var WHCodeID = $("#sel_WHCode").val();
  137. var a = WHCodeID.split("|");
  138. WHCodeID = a[0];
  139. var Qu = $("#sel_QU").val();
  140. var Pai = $("#sel_Pai").val();
  141. var HuoJia = $("#sel_HuoJia").val();
  142. var $Ceng = $("#sel_Ceng");
  143. $Ceng.select2({
  144. allowClear: true,
  145. escapeMarkup: function (m) {
  146. return m;
  147. }
  148. });
  149. $.ajax({
  150. url: "/WMS/Blitem/GetCeng?WHCodeID=" + WHCodeID + "&Qu=" + Qu + "&Pai=" + Pai + "&HuoJia=" + HuoJia + "&" + Math.random(),
  151. dataType: "json",
  152. async: false,
  153. success: function (data) {
  154. $.each(data, function (index, item) {
  155. $Ceng.append("<option value='" + item.CengValue + "'>" + item.CengName + "</option>");
  156. });
  157. }
  158. });
  159. }
  160. });
  161. $("#sel_Ceng").change(function () {
  162. debugger;
  163. if ($("#sel_Ceng").val() == "") {
  164. $.modalAlertNew("WMS00041");
  165. return;
  166. }
  167. else {
  168. var WHCodeID = $("#sel_WHCode").val();
  169. var a = WHCodeID.split("|");
  170. WHCodeID = a[0];
  171. var Qu = $("#sel_QU").val();
  172. var Pai = $("#sel_Pai").val();
  173. var HuoJia = $("#sel_HuoJia").val();
  174. var Ceng = $("#sel_Ceng").val();
  175. var $Ge = $("#sel_Ge");
  176. $Ge.select2({
  177. allowClear: true,
  178. escapeMarkup: function (m) {
  179. return m;
  180. }
  181. });
  182. $.ajax({
  183. url: "/WMS/Blitem/GetGe?WHCodeID=" + WHCodeID + "&Qu=" + Qu + "&Pai=" + Pai + "&HuoJia=" + HuoJia + "&Ceng=" + Ceng + "&" + Math.random(),
  184. dataType: "json",
  185. async: false,
  186. success: function (data) {
  187. $.each(data, function (index, item) {
  188. $Ge.append("<option value='" + item.GeValue + "'>" + item.GeName + "</option>");
  189. });
  190. }
  191. });
  192. }
  193. });
  194. });
  195. function formatDate(fomatType, date) {
  196. let ret;
  197. let valueDate = date;
  198. if (!date) valueDate = new Date()
  199. let opt = {
  200. "Y+": valueDate.getFullYear().toString(), // 年
  201. "m+": (valueDate.getMonth() + 1).toString(), // 月
  202. "d+": valueDate.getDate().toString(), // 日
  203. "H+": valueDate.getHours().toString(), // 时
  204. "M+": valueDate.getMinutes().toString(), // 分
  205. "S+": valueDate.getSeconds().toString() // 秒
  206. };
  207. for (let k in opt) {
  208. ret = new RegExp("(" + k + ")").exec(fomatType);
  209. if (ret) {
  210. fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
  211. };
  212. };
  213. return fomatType;
  214. }
  215. function InitControl() {
  216. debugger;
  217. var $WHCode = $("#sel_WHCode");
  218. $WHCode.select2({
  219. allowClear: true,
  220. escapeMarkup: function (m) {
  221. return m;
  222. }
  223. });
  224. $.ajax({
  225. url: "/WMS/Blitem/GetWHCode?" + Math.random(),
  226. dataType: "json",
  227. async: false,
  228. success: function (data) {
  229. $.each(data, function (index, item) {
  230. $WHCode.append("<option value='" + item.ID + "'>" + item.WarehouseName + "</option>");
  231. });
  232. }
  233. });
  234. }
  235. function submitForm() {
  236. debugger;
  237. if (!$('#form1').formValid()) {
  238. return false;
  239. }
  240. var WHCode = $("#sel_WHCode").val();
  241. if (WHCode == '') {
  242. $.modalAlertNew("WMS00041");
  243. return;
  244. }
  245. var SelectLevel = '';
  246. var WHCodeID = $("#sel_WHCode").val();
  247. var a = WHCodeID.split("|");
  248. WHCodeID = a[1];
  249. var Qu = $("#sel_QU").val();
  250. var Pai = $("#sel_Pai").val();
  251. var HuoJia = $("#sel_HuoJia").val();
  252. var Ceng = $("#sel_Ceng").val();
  253. var Ge = $("#sel_Ge").val();
  254. if (WHCodeID!="") {
  255. SelectLevel += WHCodeID;
  256. } else if (Qu!="") {
  257. SelectLevel += SelectLevel + '-' + Qu;
  258. } else if (Pai!="") {
  259. SelectLevel += SelectLevel + '-' + Pai;
  260. } else if (HuoJia!="") {
  261. SelectLevel += SelectLevel + '-' + HuoJia;
  262. } else if (Ceng!="") {
  263. SelectLevel += SelectLevel + '-' + Ceng;
  264. } else if (Ge!="") {
  265. SelectLevel += SelectLevel + '-' + Ge;
  266. }
  267. var Details = [];
  268. var obj = {
  269. SelectLevel: SelectLevel,
  270. };
  271. Details.push(obj);
  272. var Header = {
  273. User: User,
  274. MTIME: Time,
  275. WorkPoint: WorkPoints,
  276. Detail: Details,
  277. }
  278. var Parameter = [];
  279. Parameter.push(Header);
  280. $.submitForm({
  281. url: "/WMS/Blitem/AddICSCheck?" + Math.random(),
  282. param: { Parameter: JSON.stringify(Parameter) },
  283. success: function () {
  284. $.currentWindow().$("#gridList").trigger("reloadGrid");
  285. }
  286. })
  287. }
  288. </script>
  289. <form id="form1">
  290. <div style="padding-top: 20px; margin-right: 20px;">
  291. <table class="form">
  292. <tr>
  293. <th class="formTitle" style="width:10px">仓库:</th>
  294. <td style="width:80px">
  295. <select id="sel_WHCode" name="sel_WHCode" class="form-control select2" style="width:80px" ></select>
  296. </td>
  297. <th class="formTitle" style="width:10px">区:</th>
  298. <td style="width:60px" id="Qu">
  299. <select id="sel_QU" name="sel_QU" class="form-control select2" style="width: 45px;height:20px" > </select>
  300. </td>
  301. <th class="formTitle" style="width:10px">排:</th>
  302. <td style="width:60px" id="Pai">
  303. <select id="sel_Pai" name="sel_Pai" class="form-control select2" style="width: 45px;height:20px" ></select>
  304. </td>
  305. <th class="formTitle" style="width:10px">货架:</th>
  306. <td style="width:60px" id="HuoJia">
  307. <select id="sel_HuoJia" name="sel_HuoJia" class="form-control select2" style="width: 45px;height:20px"></select>
  308. </td>
  309. <th class="formTitle" style="width:10px">层:</th>
  310. <td style="width:60px" id="Ceng">
  311. <select id="sel_Ceng" name="sel_Ceng" class="form-control select2" style="width: 45px;height:20px" ></select>
  312. </td>
  313. <th class="formTitle" style="width:10px">格:</th>
  314. <td style="width:60px" id="Ge">
  315. <select id="sel_Ge" name="sel_Ge" class="form-control select2" style="width: 45px;height:20px" ></select>
  316. </td>
  317. </tr>
  318. <tr>
  319. <th class="formTitle">维护人:</th>
  320. <td class="formValue">
  321. <input id="txtMUSER" name="txtMUSER" type="text" class="form-control" style="width: 160px" />
  322. </td>
  323. </tr>
  324. <tr>
  325. <th class="formTitle">维护日期:</th>
  326. <td class="formValue">
  327. <input id="txtMTIME" name="txtMTIME" type="text" class="form-control " style="width: 160px"/>
  328. </td>
  329. </tr>
  330. </table>
  331. </div>
  332. </form>