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

1073 lines
49 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
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. <script>
  7. var Type = $.request("Type");
  8. var ApplyNegCode = $.request("ApplyNegCode");
  9. var OApplyNegCode = $.request("OApplyNegCode");
  10. var SDNCode = $.request("SDNCode");
  11. var InCode = $.request("InCode");
  12. var Sequence = $.request("Sequence");
  13. var MOCode = $.request("MOCode");
  14. var ReturnCode = $.request("ReturnCode");
  15. var DNCode = $.request("DNCode");
  16. var ODNCode = $.request("ODNCode");
  17. var RCVCode = $.request("RCVCode");
  18. var LLApplyNegCode = $.request("LLApplyNegCode");
  19. var CLApplyNegCode = $.request("CLApplyNegCode");
  20. var WWLLOApplyNegCode = $.request("WWLLOApplyNegCode");
  21. var WWCLOApplyNegCode = $.request("WWCLOApplyNegCode");
  22. debugger;
  23. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  24. $(function () {
  25. $("#minPackQty").keyup(function () {
  26. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  27. }).bind("paste", function () { //CTR+V事件处理
  28. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  29. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  30. $("#thisCreateQty").keyup(function () {
  31. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  32. }).bind("paste", function () { //CTR+V事件处理
  33. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  34. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  35. $("#cretePageCount").keyup(function () {
  36. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  37. }).bind("paste", function () { //CTR+V事件处理
  38. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  39. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  40. var VenCode = "";
  41. var WorkPoint = "";
  42. debugger;
  43. //initControl();
  44. if (Type=='1') {
  45. if (!!ApplyNegCode && !!Sequence) {
  46. $.ajax({
  47. url: "/WMS/WMSCreateItemLot/GetSubGridJsonByCreate?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  48. //data: { keyValue: keyValue },
  49. dataType: "json",
  50. async: false,
  51. success: function (data) {
  52. debugger;
  53. $("#InvCode").val(data.rows[0].InvCode);
  54. $("#INVNAME").val(data.rows[0].InvName);
  55. $("#INVSTD").val(data.rows[0].InvStd);
  56. $("#Quantity").val(data.rows[0].Quantity);
  57. $("#CreatedQty").val(data.rows[0].CreatedQty);
  58. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  59. $("#YAmount").val(data.rows[0].Amount);
  60. VenCode = data.rows[0].VenCode;
  61. WorkPoint = data.rows[0].WorkPoint;
  62. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  63. $("#thisCreateQty").attr("disabled", "disabled");
  64. $("#minPackQty").attr("disabled", "disabled");
  65. $("#VendorLotNo").attr("disabled", "disabled");
  66. }
  67. }
  68. });
  69. $.ajax({
  70. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  71. //data: { keyValue: keyValue },
  72. dataType: "json",
  73. async: false,
  74. success: function (data) {
  75. $("#VendorLotNo").val(data.VendorLotNo);
  76. }
  77. });
  78. }
  79. }
  80. if (Type=='2') {
  81. if (!!OApplyNegCode && !!Sequence) {
  82. $.ajax({
  83. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWeiWaiByCreate?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  84. dataType: "json",
  85. async: false,
  86. success: function (data) {
  87. debugger;
  88. $("#InvCode").val(data.rows[0].InvCode);
  89. $("#INVNAME").val(data.rows[0].InvName);
  90. $("#INVSTD").val(data.rows[0].InvStd);
  91. $("#Quantity").val(data.rows[0].Quantity);
  92. $("#CreatedQty").val(data.rows[0].CreatedQty);
  93. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  94. $("#YAmount").val(data.rows[0].Amount);
  95. VenCode = data.rows[0].VenCode;
  96. WorkPoint = data.rows[0].WorkPoint;
  97. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  98. $("#thisCreateQty").attr("disabled", "disabled");
  99. $("#minPackQty").attr("disabled", "disabled");
  100. $("#VendorLotNo").attr("disabled", "disabled");
  101. }
  102. }
  103. });
  104. $.ajax({
  105. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  106. dataType: "json",
  107. async: false,
  108. success: function (data) {
  109. $("#VendorLotNo").val(data.VendorLotNo);
  110. }
  111. });
  112. }
  113. }
  114. if (Type == '3') {
  115. if (!!MOCode && !!Sequence) {
  116. $.ajax({
  117. url: "/WMS/WMSCreateItemLot/GetSubGridJsonChengPingByCreate?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  118. dataType: "json",
  119. async: false,
  120. success: function (data) {
  121. debugger;
  122. $("#InvCode").val(data.rows[0].InvCode);
  123. $("#INVNAME").val(data.rows[0].InvName);
  124. $("#INVSTD").val(data.rows[0].InvStd);
  125. $("#Quantity").val(data.rows[0].Quantity);
  126. $("#CreatedQty").val(data.rows[0].CreatedQty);
  127. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  128. $("#YAmount").val(data.rows[0].Amount);
  129. VenCode = data.rows[0].VenCode;
  130. WorkPoint = data.rows[0].WorkPoint;
  131. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  132. $("#thisCreateQty").attr("disabled", "disabled");
  133. $("#minPackQty").attr("disabled", "disabled");
  134. $("#VendorLotNo").attr("disabled", "disabled");
  135. }
  136. }
  137. });
  138. $.ajax({
  139. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  140. dataType: "json",
  141. async: false,
  142. success: function (data) {
  143. $("#VendorLotNo").val(data.VendorLotNo);
  144. }
  145. });
  146. }
  147. }
  148. if (Type == '4') {
  149. if (!!SDNCode && !!Sequence) {
  150. $.ajax({
  151. url: "/WMS/WMSCreateItemLot/GetSubGridJsonXiaoShouByCreate?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  152. dataType: "json",
  153. async: false,
  154. success: function (data) {
  155. debugger;
  156. $("#InvCode").val(data.rows[0].InvCode);
  157. $("#INVNAME").val(data.rows[0].InvName);
  158. $("#INVSTD").val(data.rows[0].InvStd);
  159. $("#Quantity").val(data.rows[0].Quantity);
  160. $("#CreatedQty").val(data.rows[0].CreatedQty);
  161. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  162. $("#YAmount").val(data.rows[0].Amount);
  163. VenCode = data.rows[0].VenCode;
  164. WorkPoint = data.rows[0].WorkPoint;
  165. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  166. $("#thisCreateQty").attr("disabled", "disabled");
  167. $("#minPackQty").attr("disabled", "disabled");
  168. $("#VendorLotNo").attr("disabled", "disabled");
  169. }
  170. }
  171. });
  172. $.ajax({
  173. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  174. dataType: "json",
  175. async: false,
  176. success: function (data) {
  177. $("#VendorLotNo").val(data.VendorLotNo);
  178. }
  179. });
  180. }
  181. }
  182. if (Type == '5') {
  183. if (!!InCode && !!Sequence) {
  184. $.ajax({
  185. url: "/WMS/WMSCreateItemLot/GetSubGridJsonQiTaByCreate?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  186. dataType: "json",
  187. async: false,
  188. success: function (data) {
  189. debugger;
  190. $("#InvCode").val(data.rows[0].InvCode);
  191. $("#INVNAME").val(data.rows[0].InvName);
  192. $("#INVSTD").val(data.rows[0].InvStd);
  193. $("#Quantity").val(data.rows[0].Quantity);
  194. $("#CreatedQty").val(data.rows[0].CreatedQty);
  195. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  196. $("#YAmount").val(data.rows[0].Amount);
  197. VenCode = data.rows[0].VenCode;
  198. WorkPoint = data.rows[0].WorkPoint;
  199. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  200. $("#thisCreateQty").attr("disabled", "disabled");
  201. $("#minPackQty").attr("disabled", "disabled");
  202. $("#VendorLotNo").attr("disabled", "disabled");
  203. }
  204. }
  205. });
  206. $.ajax({
  207. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  208. //data: { keyValue: keyValue },
  209. dataType: "json",
  210. async: false,
  211. success: function (data) {
  212. $("#VendorLotNo").val(data.VendorLotNo);
  213. }
  214. });
  215. }
  216. }
  217. if (Type == '6') {
  218. if (!!ReturnCode && !!Sequence) {
  219. $.ajax({
  220. url: "/WMS/WMSCreateItemLot/GetSubGridJsonGuiHuanByCreate?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  221. dataType: "json",
  222. async: false,
  223. success: function (data) {
  224. debugger;
  225. $("#InvCode").val(data.rows[0].InvCode);
  226. $("#INVNAME").val(data.rows[0].InvName);
  227. $("#INVSTD").val(data.rows[0].InvStd);
  228. $("#Quantity").val(data.rows[0].Quantity);
  229. $("#CreatedQty").val(data.rows[0].CreatedQty);
  230. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  231. $("#YAmount").val(data.rows[0].Amount);
  232. VenCode = data.rows[0].VenCode;
  233. WorkPoint = data.rows[0].WorkPoint;
  234. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  235. $("#thisCreateQty").attr("disabled", "disabled");
  236. $("#minPackQty").attr("disabled", "disabled");
  237. $("#VendorLotNo").attr("disabled", "disabled");
  238. }
  239. }
  240. });
  241. $.ajax({
  242. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  243. //data: { keyValue: keyValue },
  244. dataType: "json",
  245. async: false,
  246. success: function (data) {
  247. $("#VendorLotNo").val(data.VendorLotNo);
  248. }
  249. });
  250. }
  251. }
  252. if (Type == '7') {
  253. if (!!DNCode && !!Sequence) {
  254. $.ajax({
  255. url: "/WMS/WMSCreateItemLot/GetSubGridJsonSHDHByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  256. dataType: "json",
  257. async: false,
  258. success: function (data) {
  259. debugger;
  260. $("#InvCode").val(data.rows[0].InvCode);
  261. $("#INVNAME").val(data.rows[0].InvName);
  262. $("#INVSTD").val(data.rows[0].InvStd);
  263. $("#Quantity").val(data.rows[0].Quantity);
  264. $("#CreatedQty").val(data.rows[0].CreatedQty);
  265. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  266. $("#YAmount").val(data.rows[0].Amount);
  267. VenCode = data.rows[0].VenCode;
  268. WorkPoint = data.rows[0].WorkPoint;
  269. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  270. $("#thisCreateQty").attr("disabled", "disabled");
  271. $("#minPackQty").attr("disabled", "disabled");
  272. $("#VendorLotNo").attr("disabled", "disabled");
  273. }
  274. }
  275. });
  276. $.ajax({
  277. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  278. //data: { keyValue: keyValue },
  279. dataType: "json",
  280. async: false,
  281. success: function (data) {
  282. $("#VendorLotNo").val(data.VendorLotNo);
  283. }
  284. });
  285. }
  286. }
  287. if (Type == '8') {
  288. debugger;
  289. if (!!ODNCode && !!Sequence) {
  290. $.ajax({
  291. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWSHDHByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  292. dataType: "json",
  293. async: false,
  294. success: function (data) {
  295. debugger;
  296. $("#InvCode").val(data.rows[0].InvCode);
  297. $("#INVNAME").val(data.rows[0].InvName);
  298. $("#INVSTD").val(data.rows[0].InvStd);
  299. $("#Quantity").val(data.rows[0].Quantity);
  300. $("#CreatedQty").val(data.rows[0].CreatedQty);
  301. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  302. $("#YAmount").val(data.rows[0].Amount);
  303. VenCode = data.rows[0].VenCode;
  304. WorkPoint = data.rows[0].WorkPoint;
  305. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  306. $("#thisCreateQty").attr("disabled", "disabled");
  307. $("#minPackQty").attr("disabled", "disabled");
  308. $("#VendorLotNo").attr("disabled", "disabled");
  309. }
  310. }
  311. });
  312. $.ajax({
  313. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  314. //data: { keyValue: keyValue },
  315. dataType: "json",
  316. async: false,
  317. success: function (data) {
  318. $("#VendorLotNo").val(data.VendorLotNo);
  319. }
  320. });
  321. }
  322. }
  323. if (Type == '9') {
  324. debugger;
  325. if (!!RCVCode && !!Sequence) {
  326. $.ajax({
  327. url: "/WMS/WMSCreateItemLot/GetSubGridJsonKLCPRKByCreate?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  328. dataType: "json",
  329. async: false,
  330. success: function (data) {
  331. debugger;
  332. $("#InvCode").val(data.rows[0].InvCode);
  333. $("#INVNAME").val(data.rows[0].InvName);
  334. $("#INVSTD").val(data.rows[0].InvStd);
  335. $("#Quantity").val(data.rows[0].Quantity);
  336. $("#CreatedQty").val(data.rows[0].CreatedQty);
  337. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  338. $("#YAmount").val(data.rows[0].Amount);
  339. VenCode = data.rows[0].VenCode;
  340. WorkPoint = data.rows[0].WorkPoint;
  341. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  342. $("#thisCreateQty").attr("disabled", "disabled");
  343. $("#minPackQty").attr("disabled", "disabled");
  344. $("#VendorLotNo").attr("disabled", "disabled");
  345. }
  346. }
  347. });
  348. $.ajax({
  349. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  350. //data: { keyValue: keyValue },
  351. dataType: "json",
  352. async: false,
  353. success: function (data) {
  354. $("#VendorLotNo").val(data.VendorLotNo);
  355. }
  356. });
  357. }
  358. }
  359. if (Type == '10') {
  360. if (!!DNCode && !!Sequence) {
  361. $.ajax({
  362. url: "/WMS/WMSCreateItemLot/GetSubGridJsonJSDByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  363. dataType: "json",
  364. async: false,
  365. success: function (data) {
  366. debugger;
  367. $("#InvCode").val(data.rows[0].InvCode);
  368. $("#INVNAME").val(data.rows[0].InvName);
  369. $("#INVSTD").val(data.rows[0].InvStd);
  370. $("#Quantity").val(data.rows[0].Quantity);
  371. $("#CreatedQty").val(data.rows[0].CreatedQty);
  372. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  373. $("#YAmount").val(data.rows[0].Amount);
  374. VenCode = data.rows[0].VenCode;
  375. WorkPoint = data.rows[0].WorkPoint;
  376. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  377. $("#thisCreateQty").attr("disabled", "disabled");
  378. $("#minPackQty").attr("disabled", "disabled");
  379. $("#VendorLotNo").attr("disabled", "disabled");
  380. }
  381. }
  382. });
  383. $.ajax({
  384. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  385. //data: { keyValue: keyValue },
  386. dataType: "json",
  387. async: false,
  388. success: function (data) {
  389. $("#VendorLotNo").val(data.VendorLotNo);
  390. }
  391. });
  392. }
  393. }
  394. if (Type == '11') {
  395. debugger;
  396. if (!!ODNCode && !!Sequence) {
  397. $.ajax({
  398. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWJSDByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  399. dataType: "json",
  400. async: false,
  401. success: function (data) {
  402. debugger;
  403. $("#InvCode").val(data.rows[0].InvCode);
  404. $("#INVNAME").val(data.rows[0].InvName);
  405. $("#INVSTD").val(data.rows[0].InvStd);
  406. $("#Quantity").val(data.rows[0].Quantity);
  407. $("#CreatedQty").val(data.rows[0].CreatedQty);
  408. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  409. $("#YAmount").val(data.rows[0].Amount);
  410. VenCode = data.rows[0].VenCode;
  411. WorkPoint = data.rows[0].WorkPoint;
  412. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  413. $("#thisCreateQty").attr("disabled", "disabled");
  414. $("#minPackQty").attr("disabled", "disabled");
  415. $("#VendorLotNo").attr("disabled", "disabled");
  416. }
  417. }
  418. });
  419. $.ajax({
  420. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  421. //data: { keyValue: keyValue },
  422. dataType: "json",
  423. async: false,
  424. success: function (data) {
  425. $("#VendorLotNo").val(data.VendorLotNo);
  426. }
  427. });
  428. }
  429. }
  430. if (Type == '12') {
  431. if (!!LLApplyNegCode && !!Sequence) {
  432. $.ajax({
  433. url: "/WMS/WMSCreateItemLot/GetSubGridJsonLLSQDByCreate?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  434. //data: { keyValue: keyValue },
  435. dataType: "json",
  436. async: false,
  437. success: function (data) {
  438. debugger;
  439. $("#InvCode").val(data.rows[0].InvCode);
  440. $("#INVNAME").val(data.rows[0].InvName);
  441. $("#INVSTD").val(data.rows[0].InvStd);
  442. $("#Quantity").val(data.rows[0].Quantity);
  443. $("#CreatedQty").val(data.rows[0].CreatedQty);
  444. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  445. $("#YAmount").val(data.rows[0].Amount);
  446. VenCode = data.rows[0].VenCode;
  447. WorkPoint = data.rows[0].WorkPoint;
  448. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  449. $("#thisCreateQty").attr("disabled", "disabled");
  450. $("#minPackQty").attr("disabled", "disabled");
  451. $("#VendorLotNo").attr("disabled", "disabled");
  452. }
  453. }
  454. });
  455. $.ajax({
  456. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  457. //data: { keyValue: keyValue },
  458. dataType: "json",
  459. async: false,
  460. success: function (data) {
  461. $("#VendorLotNo").val(data.VendorLotNo);
  462. }
  463. });
  464. }
  465. }
  466. if (Type == '13') {
  467. if (!!CLApplyNegCode && !!Sequence) {
  468. $.ajax({
  469. url: "/WMS/WMSCreateItemLot/GetSubGridJsonCLCKByCreate?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  470. //data: { keyValue: keyValue },
  471. dataType: "json",
  472. async: false,
  473. success: function (data) {
  474. debugger;
  475. $("#InvCode").val(data.rows[0].InvCode);
  476. $("#INVNAME").val(data.rows[0].InvName);
  477. $("#INVSTD").val(data.rows[0].InvStd);
  478. $("#Quantity").val(data.rows[0].Quantity);
  479. $("#CreatedQty").val(data.rows[0].CreatedQty);
  480. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  481. $("#YAmount").val(data.rows[0].Amount);
  482. VenCode = data.rows[0].VenCode;
  483. WorkPoint = data.rows[0].WorkPoint;
  484. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  485. $("#thisCreateQty").attr("disabled", "disabled");
  486. $("#minPackQty").attr("disabled", "disabled");
  487. $("#VendorLotNo").attr("disabled", "disabled");
  488. }
  489. }
  490. });
  491. $.ajax({
  492. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  493. //data: { keyValue: keyValue },
  494. dataType: "json",
  495. async: false,
  496. success: function (data) {
  497. $("#VendorLotNo").val(data.VendorLotNo);
  498. }
  499. });
  500. }
  501. }
  502. if (Type == '14') {
  503. if (!!WWLLOApplyNegCode && !!Sequence) {
  504. $.ajax({
  505. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWLLByCreate?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  506. dataType: "json",
  507. async: false,
  508. success: function (data) {
  509. debugger;
  510. $("#InvCode").val(data.rows[0].InvCode);
  511. $("#INVNAME").val(data.rows[0].InvName);
  512. $("#INVSTD").val(data.rows[0].InvStd);
  513. $("#Quantity").val(data.rows[0].Quantity);
  514. $("#CreatedQty").val(data.rows[0].CreatedQty);
  515. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  516. $("#YAmount").val(data.rows[0].Amount);
  517. VenCode = data.rows[0].VenCode;
  518. WorkPoint = data.rows[0].WorkPoint;
  519. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  520. $("#thisCreateQty").attr("disabled", "disabled");
  521. $("#minPackQty").attr("disabled", "disabled");
  522. $("#VendorLotNo").attr("disabled", "disabled");
  523. }
  524. }
  525. });
  526. $.ajax({
  527. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  528. dataType: "json",
  529. async: false,
  530. success: function (data) {
  531. $("#VendorLotNo").val(data.VendorLotNo);
  532. }
  533. });
  534. }
  535. }
  536. if (Type == '15') {
  537. if (!!WWCLOApplyNegCode && !!Sequence) {
  538. $.ajax({
  539. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWCLByCreate?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  540. dataType: "json",
  541. async: false,
  542. success: function (data) {
  543. debugger;
  544. $("#InvCode").val(data.rows[0].InvCode);
  545. $("#INVNAME").val(data.rows[0].InvName);
  546. $("#INVSTD").val(data.rows[0].InvStd);
  547. $("#Quantity").val(data.rows[0].Quantity);
  548. $("#CreatedQty").val(data.rows[0].CreatedQty);
  549. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  550. $("#YAmount").val(data.rows[0].Amount);
  551. VenCode = data.rows[0].VenCode;
  552. WorkPoint = data.rows[0].WorkPoint;
  553. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  554. $("#thisCreateQty").attr("disabled", "disabled");
  555. $("#minPackQty").attr("disabled", "disabled");
  556. $("#VendorLotNo").attr("disabled", "disabled");
  557. }
  558. }
  559. });
  560. $.ajax({
  561. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  562. dataType: "json",
  563. async: false,
  564. success: function (data) {
  565. $("#VendorLotNo").val(data.VendorLotNo);
  566. }
  567. });
  568. }
  569. }
  570. //查询后台自由项表(控制前台显示)
  571. $.ajax({
  572. url: "/WMS/WMSCreateItemLot/SelectICSExtensionEnable" + "?" + Math.random(),
  573. dataType: "json",
  574. async: false,
  575. success: function (data) {
  576. debugger;
  577. if (data != null && data.length > 0) {
  578. for (var i = 0; i < data.length; i++) {
  579. if (data[i].ColCode == 'ProjectCode') { $("#trProjectCode").css('display', 'none'); }
  580. if (data[i].ColCode == 'BatchCode') { $("#trBatchCode").css('display', 'none'); }
  581. if (data[i].ColCode == 'Version') { $("#trVersion").css('display', 'none'); }
  582. if (data[i].ColCode == 'Brand') { $("#trBrand").css('display', 'none'); }
  583. if (data[i].ColCode == 'cFree1') { $("#trcFree1").css('display', 'none'); }
  584. if (data[i].ColCode == 'cFree2') { $("#trcFree2").css('display', 'none'); }
  585. if (data[i].ColCode == 'cFree3') { $("#trcFree3").css('display', 'none'); }
  586. if (data[i].ColCode == 'cFree4') { $("#trcFree4").css('display', 'none'); }
  587. if (data[i].ColCode == 'cFree5') { $("#trcFree5").css('display', 'none'); }
  588. if (data[i].ColCode == 'cFree6') { $("#trcFree6").css('display', 'none'); }
  589. if (data[i].ColCode == 'cFree7') { $("#trcFree7").css('display', 'none'); }
  590. if (data[i].ColCode == 'cFree8') { $("#trcFree8").css('display', 'none'); }
  591. if (data[i].ColCode == 'cFree9') { $("#trcFree9").css('display', 'none'); }
  592. if (data[i].ColCode == 'cFree10') { $("#trcFree10").css('display', 'none'); }
  593. //if (i >= 4) {
  594. // if (data[i].ColName == 'cFree' + (i - 3)) {$("#trcFree'" + (i - 3) + "'").css('display', 'none');}
  595. //}
  596. }
  597. }
  598. }
  599. });
  600. $("#minPackQty").change(minPackQty_Change);
  601. $("#thisCreateQty").change(thisCreateQty_Change);
  602. $("#cretePageCount").change(function () {
  603. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  604. createPageCount = createPageCount.toFixed(0);
  605. if (createPageCount <= 0) {
  606. $.modalAlert("请输入大于0的数!");
  607. return false;
  608. }
  609. });
  610. });
  611. //最小包装量值改变事件
  612. function minPackQty_Change() {
  613. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  614. thisCreateQty = thisCreateQty.toFixed(2);
  615. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  616. minPackQty = minPackQty.toFixed(2);
  617. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  618. var Quantity = $("#Quantity").val() * 1;//数量
  619. var YAmount = $("#YAmount").val() * 1;//辅计量数量
  620. var Ratio = YAmount / Quantity;
  621. createPageCount = createPageCount.toFixed(0);
  622. if (minPackQty <= 0) {
  623. $.modalAlert("请输入大于0的数!");
  624. return false;
  625. }
  626. //不可以整除,生成张数+1;
  627. if (thisCreateQty % minPackQty != 0) {
  628. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  629. $("#cretePageCount").val(createPageCount);
  630. }
  631. else {
  632. createPageCount = parseInt(thisCreateQty / minPackQty);
  633. $("#cretePageCount").val(createPageCount);
  634. }
  635. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  636. }
  637. //本次生成数量值改变事件
  638. function thisCreateQty_Change() {
  639. debugger;
  640. var Quantity_str = $("#Quantity").val() * 1;//采购订单总数
  641. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  642. var thisCreateQty_str = $("#thisCreateQty").val() * 1;//本次生成数量
  643. var Quantity = Number(Quantity_str);
  644. var CreatedQty = Number(CreatedQty_str);
  645. var thisCreateQty = Number(thisCreateQty_str);
  646. if (thisCreateQty <= 0) {
  647. $.modalAlert("请输入大于0的数!");
  648. return false;
  649. }
  650. if (thisCreateQty <= 0 || thisCreateQty > (Quantity - CreatedQty)) {
  651. var maxQty = Quantity - CreatedQty;
  652. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  653. $("#thisCreateQty").val("");
  654. return false;
  655. } else {
  656. minPackQty_Change();
  657. return true;
  658. }
  659. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  660. minPackQty_Change();
  661. }
  662. function submitForm() {
  663. debugger;
  664. if (!$('#form1').formValid()) {
  665. return false;
  666. }
  667. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  668. thisCreateQty = thisCreateQty.toFixed(2);
  669. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  670. minPackQty = minPackQty.toFixed(2);
  671. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  672. createPageCount = createPageCount.toFixed(0);
  673. //校验
  674. var flag1 = thisCreateQty_Change();
  675. //var flag2 = CheckNum();
  676. var VendorLot = $("#VendorLotNo").val();
  677. if (flag1) { }
  678. else {
  679. return false;
  680. }
  681. var Quantity = $("#Quantity").val() * 1;//采购订单总数
  682. Quantity = Quantity.toFixed(2);
  683. var CreatedQty = $("#CreatedQty").val() * 1;//已生成数量
  684. CreatedQty = CreatedQty.toFixed(2);
  685. if (Quantity == CreatedQty ) {
  686. return false;
  687. }
  688. var obj = {
  689. thisCreateQty: thisCreateQty,
  690. minPackQty: minPackQty,
  691. createPageCount: createPageCount,
  692. VendorLot: VendorLot,
  693. PRODUCTDATE: $("#PRODUCTDATE").val(),
  694. Amount: $("#Amount").val(),
  695. //自由项
  696. ProjectCode: $("#ProjectCode").val(),
  697. BatchCode: $("#BatchCode").val(),
  698. Version: $("#Version").val(),
  699. Brand: $("#Brand").val(),
  700. cFree1: $("#cFree1").val(),
  701. cFree2: $("#cFree2").val(),
  702. cFree3: $("#cFree3").val(),
  703. cFree4: $("#cFree4").val(),
  704. cFree5: $("#cFree5").val(),
  705. cFree6: $("#cFree6").val(),
  706. cFree7: $("#cFree7").val(),
  707. cFree8: $("#cFree8").val(),
  708. cFree9: $("#cFree9").val(),
  709. cFree10: $("#cFree10").val(),
  710. }
  711. if (Type=='1') {
  712. $.submitForm({
  713. url: "/WMS/WMSCreateItemLot/SubmitForm?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  714. param: {
  715. keyValue: JSON.stringify(obj)
  716. },
  717. success: function () {
  718. $.currentWindow().$("#gridList").trigger("reloadGrid");
  719. }
  720. })
  721. }
  722. if (Type=='2') {
  723. $.submitForm({
  724. url: "/WMS/WMSCreateItemLot/SubmitFormWeiWai?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  725. param: {
  726. keyValue: JSON.stringify(obj)
  727. },
  728. success: function () {
  729. $.currentWindow().$("#gridList").trigger("reloadGrid");
  730. }
  731. })
  732. }
  733. if (Type == '3') {
  734. $.submitForm({
  735. url: "/WMS/WMSCreateItemLot/SubmitFormChengPing?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  736. param: {
  737. keyValue: JSON.stringify(obj)
  738. },
  739. success: function () {
  740. $.currentWindow().$("#gridList").trigger("reloadGrid");
  741. }
  742. })
  743. }
  744. if (Type == '4') {
  745. $.submitForm({
  746. url: "/WMS/WMSCreateItemLot/SubmitFormXiaoShou?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  747. param: {
  748. keyValue: JSON.stringify(obj)
  749. },
  750. success: function () {
  751. $.currentWindow().$("#gridList").trigger("reloadGrid");
  752. }
  753. })
  754. }
  755. if (Type == '5') {
  756. $.submitForm({
  757. url: "/WMS/WMSCreateItemLot/SubmitFormQiTa?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  758. param: {
  759. keyValue: JSON.stringify(obj)
  760. },
  761. success: function () {
  762. $.currentWindow().$("#gridList").trigger("reloadGrid");
  763. }
  764. })
  765. }
  766. if (Type == '6') {
  767. $.submitForm({
  768. url: "/WMS/WMSCreateItemLot/SubmitFormGuiHuan?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  769. param: {
  770. keyValue: JSON.stringify(obj)
  771. },
  772. success: function () {
  773. $.currentWindow().$("#gridList").trigger("reloadGrid");
  774. }
  775. })
  776. }
  777. if (Type == '7') {
  778. $.submitForm({
  779. url: "/WMS/WMSCreateItemLot/SubmitFormSHDH?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  780. param: {
  781. keyValue: JSON.stringify(obj)
  782. },
  783. success: function () {
  784. $.currentWindow().$("#gridList").trigger("reloadGrid");
  785. }
  786. })
  787. }
  788. if (Type == '8') {
  789. $.submitForm({
  790. url: "/WMS/WMSCreateItemLot/SubmitFormWWSHDH?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  791. param: {
  792. keyValue: JSON.stringify(obj)
  793. },
  794. success: function () {
  795. $.currentWindow().$("#gridList").trigger("reloadGrid");
  796. }
  797. })
  798. }
  799. if (Type == '9') {
  800. $.submitForm({
  801. url: "/WMS/WMSCreateItemLot/SubmitFormKLCPRK?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  802. param: {
  803. keyValue: JSON.stringify(obj)
  804. },
  805. success: function () {
  806. $.currentWindow().$("#gridList").trigger("reloadGrid");
  807. }
  808. })
  809. }
  810. if (Type == '10') {
  811. $.submitForm({
  812. url: "/WMS/WMSCreateItemLot/SubmitFormJSD?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  813. param: {
  814. keyValue: JSON.stringify(obj)
  815. },
  816. success: function () {
  817. $.currentWindow().$("#gridList").trigger("reloadGrid");
  818. }
  819. })
  820. }
  821. if (Type == '11') {
  822. $.submitForm({
  823. url: "/WMS/WMSCreateItemLot/SubmitFormWWJSD?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  824. param: {
  825. keyValue: JSON.stringify(obj)
  826. },
  827. success: function () {
  828. $.currentWindow().$("#gridList").trigger("reloadGrid");
  829. }
  830. })
  831. }
  832. if (Type == '12') {
  833. $.submitForm({
  834. url: "/WMS/WMSCreateItemLot/SubmitFormLLSQTL?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  835. param: {
  836. keyValue: JSON.stringify(obj)
  837. },
  838. success: function () {
  839. $.currentWindow().$("#gridList").trigger("reloadGrid");
  840. }
  841. })
  842. }
  843. if (Type == '13') {
  844. $.submitForm({
  845. url: "/WMS/WMSCreateItemLot/SubmitFormCLCKT?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  846. param: {
  847. keyValue: JSON.stringify(obj)
  848. },
  849. success: function () {
  850. $.currentWindow().$("#gridList").trigger("reloadGrid");
  851. }
  852. })
  853. }
  854. if (Type == '14') {
  855. $.submitForm({
  856. url: "/WMS/WMSCreateItemLot/SubmitFormWWLL?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  857. param: {
  858. keyValue: JSON.stringify(obj)
  859. },
  860. success: function () {
  861. $.currentWindow().$("#gridList").trigger("reloadGrid");
  862. }
  863. })
  864. }
  865. if (Type == '15') {
  866. $.submitForm({
  867. url: "/WMS/WMSCreateItemLot/SubmitFormWWCL?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  868. param: {
  869. keyValue: JSON.stringify(obj)
  870. },
  871. success: function () {
  872. $.currentWindow().$("#gridList").trigger("reloadGrid");
  873. }
  874. })
  875. }
  876. }
  877. </script>
  878. <form id="form1">
  879. <div style="padding-top: 20px; margin-right: 20px;">
  880. <table class="form">
  881. <tr>
  882. <th class="formTitle">料品编码</th>
  883. <td class="formValue">
  884. <input id="InvCode" name="InvCode" type="text" class="form-control " />
  885. </td>
  886. </tr>
  887. <tr>
  888. <th class="formTitle">料品名称</th>
  889. <td class="formValue">
  890. <input id="INVNAME" name="INVNAME" type="text" class="form-control " />
  891. </td>
  892. </tr>
  893. <tr>
  894. <th class="formTitle">规格型号</th>
  895. <td class="formValue">
  896. <input id="INVSTD" name="INVSTD" type="text" class="form-control " />
  897. </td>
  898. </tr>
  899. <tr>
  900. <th class="formTitle">计量单位</th>
  901. <td class="formValue">
  902. <input id="INVUOM" name="INVUOM" type="text" class="form-control " />
  903. </td>
  904. </tr>
  905. <tr>
  906. <th class="formTitle">数量</th>
  907. <td class="formValue">
  908. <input id="Quantity" name="Quantity" type="text" class="form-control " />
  909. <input id="YAmount" name="YAmount" type="text" style="display:none" />
  910. </td>
  911. </tr>
  912. <tr>
  913. <th class="formTitle">已生成条码数量</th>
  914. <td class="formValue">
  915. <input id="CreatedQty" name="CreatedQty" type="text" class="form-control " />
  916. </td>
  917. </tr>
  918. <tr>
  919. <th class="formTitle"><span style="color: red;">*</span>本次生成数量</th>
  920. <td class="formValue">
  921. <input id="thisCreateQty" name="thisCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" />
  922. </td>
  923. </tr>
  924. <tr>
  925. <th class="formTitle"><span style="color: red;">*</span>最小包装量</th>
  926. <td class="formValue">
  927. <input id="minPackQty" name="minPackQty" type="text" class="form-control required" placeholder="请输入最小包装量" />
  928. </td>
  929. </tr>
  930. <tr >
  931. <th class="formTitle"><span style="color: red;">*</span>生产日期</th>
  932. <td class="formValue">
  933. <input type="text" name="PRODUCTDATE" id="PRODUCTDATE" class="form-control required" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="生产日期" />
  934. </td>
  935. </tr>
  936. <tr>
  937. <th class="formTitle"><span style="color: red;">*</span>生成张数</th>
  938. <td class="formValue">
  939. <input id="cretePageCount" name="cretePageCount" class="form-control required" type="text" placeholder="请输入生成张数" />
  940. </td>
  941. </tr>
  942. <tr>
  943. <th class="formTitle">辅计量数量</th>
  944. <td class="formValue">
  945. <input id="Amount" name="Amount" class="form-control" type="text" placeholder="请输入辅计量数量" />
  946. </td>
  947. </tr>
  948. @*sssss*@
  949. <tr id="trProjectCode">
  950. <th class="formTitle">项目号</th>
  951. <td class="formValue">
  952. <input id="ProjectCode"name="ProjectCode" class="form-control " type="text" placeholder="请输入项目号" />
  953. </td>
  954. </tr>
  955. <tr id="trBatchCode">
  956. <th class="formTitle">批次</th>
  957. <td class="formValue">
  958. <input id="BatchCode" name="BatchCode" class="form-control " type="text" placeholder="请输入批次" />
  959. </td>
  960. </tr>
  961. <tr id="trVersion">
  962. <th class="formTitle">版本</th>
  963. <td class="formValue">
  964. <input id="Version" name="Version" class="form-control " type="text" placeholder="请输入版本" />
  965. </td>
  966. </tr>
  967. <tr id="trBrand">
  968. <th class="formTitle">厂牌</th>
  969. <td class="formValue">
  970. <input id="Brand" name="Brand" type="text" class="form-control " placeholder="请输入厂牌" />
  971. </td>
  972. </tr>
  973. <tr id="trcFree1">
  974. <th class="formTitle">自由项1</th>
  975. <td class="formValue">
  976. <input id="cFree1" name="cFree1" type="text" class="form-control " placeholder="请输入自由项1" />
  977. </td>
  978. </tr>
  979. <tr id="trcFree2">
  980. <th class="formTitle">自由项2</th>
  981. <td class="formValue">
  982. <input id="cFree2" name="cFree2" type="text" class="form-control " placeholder="请输入自由项2" />
  983. </td>
  984. </tr>
  985. <tr id="trcFree3">
  986. <th class="formTitle">自由项3</th>
  987. <td class="formValue">
  988. <input id="cFree3" name="cFree3" type="text" class="form-control " placeholder="请输入自由项3" />
  989. </td>
  990. </tr>
  991. <tr id="trcFree4">
  992. <th class="formTitle">自由项4</th>
  993. <td class="formValue">
  994. <input id="cFree4" name="cFree4" type="text" class="form-control " placeholder="请输入自由项4" />
  995. </td>
  996. </tr>
  997. <tr id="trcFree5">
  998. <th class="formTitle">自由项5</th>
  999. <td class="formValue">
  1000. <input id="cFree5" name="cFree5" type="text" class="form-control " placeholder="请输入自由项5" />
  1001. </td>
  1002. </tr>
  1003. <tr id="trcFree6">
  1004. <th class="formTitle">自由项6</th>
  1005. <td class="formValue">
  1006. <input id="cFree6" name="cFree6" type="text" class="form-control " placeholder="请输入自由项6" />
  1007. </td>
  1008. </tr>
  1009. <tr id="trcFree7">
  1010. <th class="formTitle">自由项7</th>
  1011. <td class="formValue">
  1012. <input id="cFree7" name="cFree7" type="text" class="form-control " placeholder="请输入自由项7" />
  1013. </td>
  1014. </tr>
  1015. <tr id="trcFree8">
  1016. <th class="formTitle">自由项8</th>
  1017. <td class="formValue">
  1018. <input id="cFree8" name="cFree8" type="text" class="form-control " placeholder="请输入自由项8" />
  1019. </td>
  1020. </tr>
  1021. <tr id="trcFree9">
  1022. <th class="formTitle">自由项9</th>
  1023. <td class="formValue">
  1024. <input id="cFree9" name="cFree9" type="text" class="form-control " placeholder="请输入自由项9" />
  1025. </td>
  1026. </tr>
  1027. <tr id="trcFree10">
  1028. <th class="formTitle">自由项10</th>
  1029. <td class="formValue">
  1030. <input id="cFree10" name="cFree10" type="text" class="form-control " placeholder="请输入自由项10" />
  1031. </td>
  1032. </tr>
  1033. </table>
  1034. </div>
  1035. </form>