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

1363 lines
63 KiB

3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 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
2 years ago
3 years ago
10 months 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
2 years ago
3 years ago
3 years ago
3 years ago
2 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
2 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
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. var FGGDMOCode = $.request("FGGDMOCode");
  23. var MODetailID = $.request("MODetailID");
  24. debugger;
  25. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  26. $(function () {
  27. $("#minPackQty").keyup(function () {
  28. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  29. }).bind("paste", function () { //CTR+V事件处理
  30. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  31. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  32. $("#thisCreateQty").keyup(function () {
  33. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  34. }).bind("paste", function () { //CTR+V事件处理
  35. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  36. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  37. $("#cretePageCount").keyup(function () {
  38. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  39. }).bind("paste", function () { //CTR+V事件处理
  40. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  41. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  42. var VenCode = "";
  43. var WorkPoint = "";
  44. var myDate = new Date();
  45. var nowDate = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate();
  46. debugger;
  47. //initControl();
  48. if (Type=='1') {
  49. if (!!ApplyNegCode && !!Sequence) {
  50. $.ajax({
  51. url: "/WMS/WMSCreateItemLot/GetSubGridJsonByCreate?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  52. //data: { keyValue: keyValue },
  53. dataType: "json",
  54. async: false,
  55. success: function (data) {
  56. debugger;
  57. $("#InvCode").val(data.rows[0].InvCode);
  58. $("#INVNAME").val(data.rows[0].InvName);
  59. $("#INVSTD").val(data.rows[0].InvStd);
  60. $("#Quantity").val(data.rows[0].Quantity);
  61. $("#CreatedQty").val(data.rows[0].CreatedQty);
  62. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  63. $("#YAmount").val(data.rows[0].Amount);
  64. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  65. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  66. $("#PRODUCTDATE").val(nowDate);
  67. VenCode = data.rows[0].VenCode;
  68. WorkPoint = data.rows[0].WorkPoint;
  69. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  70. $("#thisCreateQty").attr("disabled", "disabled");
  71. $("#minPackQty").attr("disabled", "disabled");
  72. $("#VendorLotNo").attr("disabled", "disabled");
  73. }
  74. }
  75. });
  76. $.ajax({
  77. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  78. //data: { keyValue: keyValue },
  79. dataType: "json",
  80. async: false,
  81. success: function (data) {
  82. $("#VendorLotNo").val(data.VendorLotNo);
  83. }
  84. });
  85. }
  86. }
  87. if (Type=='2') {
  88. if (!!OApplyNegCode && !!Sequence) {
  89. $.ajax({
  90. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWeiWaiByCreate?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  91. dataType: "json",
  92. async: false,
  93. success: function (data) {
  94. debugger;
  95. $("#InvCode").val(data.rows[0].InvCode);
  96. $("#INVNAME").val(data.rows[0].InvName);
  97. $("#INVSTD").val(data.rows[0].InvStd);
  98. $("#Quantity").val(data.rows[0].Quantity);
  99. $("#CreatedQty").val(data.rows[0].CreatedQty);
  100. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  101. $("#YAmount").val(data.rows[0].Amount);
  102. $("#PRODUCTDATE").val(nowDate);
  103. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  104. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  105. VenCode = data.rows[0].VenCode;
  106. WorkPoint = data.rows[0].WorkPoint;
  107. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  108. $("#thisCreateQty").attr("disabled", "disabled");
  109. $("#minPackQty").attr("disabled", "disabled");
  110. $("#VendorLotNo").attr("disabled", "disabled");
  111. }
  112. }
  113. });
  114. $.ajax({
  115. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  116. dataType: "json",
  117. async: false,
  118. success: function (data) {
  119. $("#VendorLotNo").val(data.VendorLotNo);
  120. }
  121. });
  122. }
  123. }
  124. if (Type == '3') {
  125. if (!!MOCode && !!Sequence) {
  126. $.ajax({
  127. url: "/WMS/WMSCreateItemLot/GetSubGridJsonChengPingByCreate?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  128. dataType: "json",
  129. async: false,
  130. success: function (data) {
  131. debugger;
  132. $("#InvCode").val(data.rows[0].InvCode);
  133. $("#INVNAME").val(data.rows[0].InvName);
  134. $("#INVSTD").val(data.rows[0].InvStd);
  135. $("#Quantity").val(data.rows[0].Quantity);
  136. $("#CreatedQty").val(data.rows[0].CreatedQty);
  137. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  138. $("#YAmount").val(data.rows[0].Amount);
  139. $("#PRODUCTDATE").val(nowDate);
  140. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  141. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  142. $("#Enable").val(data.rows[0].Enable);
  143. VenCode = data.rows[0].VenCode;
  144. WorkPoint = data.rows[0].WorkPoint;
  145. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  146. $("#thisCreateQty").attr("disabled", "disabled");
  147. $("#minPackQty").attr("disabled", "disabled");
  148. $("#VendorLotNo").attr("disabled", "disabled");
  149. }
  150. }
  151. });
  152. $.ajax({
  153. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  154. dataType: "json",
  155. async: false,
  156. success: function (data) {
  157. $("#VendorLotNo").val(data.VendorLotNo);
  158. }
  159. });
  160. }
  161. }
  162. if (Type == '4') {
  163. if (!!SDNCode && !!Sequence) {
  164. $.ajax({
  165. url: "/WMS/WMSCreateItemLot/GetSubGridJsonXiaoShouByCreate?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  166. dataType: "json",
  167. async: false,
  168. success: function (data) {
  169. debugger;
  170. $("#InvCode").val(data.rows[0].InvCode);
  171. $("#INVNAME").val(data.rows[0].InvName);
  172. $("#INVSTD").val(data.rows[0].InvStd);
  173. $("#Quantity").val(data.rows[0].Quantity);
  174. $("#CreatedQty").val(data.rows[0].CreatedQty);
  175. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  176. $("#YAmount").val(data.rows[0].Amount);
  177. $("#PRODUCTDATE").val(nowDate);
  178. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  179. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  180. VenCode = data.rows[0].VenCode;
  181. WorkPoint = data.rows[0].WorkPoint;
  182. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  183. $("#thisCreateQty").attr("disabled", "disabled");
  184. $("#minPackQty").attr("disabled", "disabled");
  185. $("#VendorLotNo").attr("disabled", "disabled");
  186. }
  187. }
  188. });
  189. $.ajax({
  190. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  191. dataType: "json",
  192. async: false,
  193. success: function (data) {
  194. $("#VendorLotNo").val(data.VendorLotNo);
  195. }
  196. });
  197. }
  198. }
  199. if (Type == '5') {
  200. if (!!InCode && !!Sequence) {
  201. $.ajax({
  202. url: "/WMS/WMSCreateItemLot/GetSubGridJsonQiTaByCreate?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  203. dataType: "json",
  204. async: false,
  205. success: function (data) {
  206. debugger;
  207. $("#InvCode").val(data.rows[0].InvCode);
  208. $("#INVNAME").val(data.rows[0].InvName);
  209. $("#INVSTD").val(data.rows[0].InvStd);
  210. $("#Quantity").val(data.rows[0].Quantity);
  211. $("#CreatedQty").val(data.rows[0].CreatedQty);
  212. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  213. $("#YAmount").val(data.rows[0].Amount);
  214. $("#PRODUCTDATE").val(nowDate);
  215. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  216. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  217. VenCode = data.rows[0].VenCode;
  218. WorkPoint = data.rows[0].WorkPoint;
  219. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  220. $("#thisCreateQty").attr("disabled", "disabled");
  221. $("#minPackQty").attr("disabled", "disabled");
  222. $("#VendorLotNo").attr("disabled", "disabled");
  223. }
  224. }
  225. });
  226. $.ajax({
  227. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  228. //data: { keyValue: keyValue },
  229. dataType: "json",
  230. async: false,
  231. success: function (data) {
  232. $("#VendorLotNo").val(data.VendorLotNo);
  233. }
  234. });
  235. }
  236. }
  237. if (Type == '6') {
  238. if (!!ReturnCode && !!Sequence) {
  239. $.ajax({
  240. url: "/WMS/WMSCreateItemLot/GetSubGridJsonGuiHuanByCreate?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  241. dataType: "json",
  242. async: false,
  243. success: function (data) {
  244. debugger;
  245. $("#InvCode").val(data.rows[0].InvCode);
  246. $("#INVNAME").val(data.rows[0].InvName);
  247. $("#INVSTD").val(data.rows[0].InvStd);
  248. $("#Quantity").val(data.rows[0].Quantity);
  249. $("#CreatedQty").val(data.rows[0].CreatedQty);
  250. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  251. $("#YAmount").val(data.rows[0].Amount);
  252. $("#PRODUCTDATE").val(nowDate);
  253. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  254. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  255. VenCode = data.rows[0].VenCode;
  256. WorkPoint = data.rows[0].WorkPoint;
  257. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  258. $("#thisCreateQty").attr("disabled", "disabled");
  259. $("#minPackQty").attr("disabled", "disabled");
  260. $("#VendorLotNo").attr("disabled", "disabled");
  261. }
  262. }
  263. });
  264. $.ajax({
  265. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  266. //data: { keyValue: keyValue },
  267. dataType: "json",
  268. async: false,
  269. success: function (data) {
  270. $("#VendorLotNo").val(data.VendorLotNo);
  271. }
  272. });
  273. }
  274. }
  275. if (Type == '7') {
  276. if (!!DNCode && !!Sequence) {
  277. $.ajax({
  278. url: "/WMS/WMSCreateItemLot/GetSubGridJsonSHDHByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  279. dataType: "json",
  280. async: false,
  281. success: function (data) {
  282. debugger;
  283. $("#InvCode").val(data.rows[0].InvCode);
  284. $("#INVNAME").val(data.rows[0].InvName);
  285. $("#INVSTD").val(data.rows[0].InvStd);
  286. $("#Quantity").val(data.rows[0].Quantity);
  287. $("#CreatedQty").val(data.rows[0].CreatedQty);
  288. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  289. $("#YAmount").val(data.rows[0].Amount);
  290. $("#PRODUCTDATE").val(nowDate);
  291. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  292. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  293. $("#ProjectCode").val(data.rows[0].ProjectCode);
  294. $("#BatchCode").val(data.rows[0].BatchCode);
  295. $("#Brand").val(data.rows[0].Brand);
  296. $("#PRODUCTDATE").val(nowDate);
  297. VenCode = data.rows[0].VenCode;
  298. WorkPoint = data.rows[0].WorkPoint;
  299. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  300. $("#thisCreateQty").attr("disabled", "disabled");
  301. $("#minPackQty").attr("disabled", "disabled");
  302. $("#VendorLotNo").attr("disabled", "disabled");
  303. }
  304. }
  305. });
  306. $.ajax({
  307. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  308. //data: { keyValue: keyValue },
  309. dataType: "json",
  310. async: false,
  311. success: function (data) {
  312. $("#VendorLotNo").val(data.VendorLotNo);
  313. }
  314. });
  315. }
  316. }
  317. if (Type == '8') {
  318. debugger;
  319. if (!!ODNCode && !!Sequence) {
  320. $.ajax({
  321. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWSHDHByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  322. dataType: "json",
  323. async: false,
  324. success: function (data) {
  325. debugger;
  326. $("#InvCode").val(data.rows[0].InvCode);
  327. $("#INVNAME").val(data.rows[0].InvName);
  328. $("#INVSTD").val(data.rows[0].InvStd);
  329. $("#Quantity").val(data.rows[0].Quantity);
  330. $("#CreatedQty").val(data.rows[0].CreatedQty);
  331. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  332. $("#YAmount").val(data.rows[0].Amount);
  333. $("#PRODUCTDATE").val(nowDate);
  334. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  335. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  336. VenCode = data.rows[0].VenCode;
  337. WorkPoint = data.rows[0].WorkPoint;
  338. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  339. $("#thisCreateQty").attr("disabled", "disabled");
  340. $("#minPackQty").attr("disabled", "disabled");
  341. $("#VendorLotNo").attr("disabled", "disabled");
  342. }
  343. }
  344. });
  345. $.ajax({
  346. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  347. //data: { keyValue: keyValue },
  348. dataType: "json",
  349. async: false,
  350. success: function (data) {
  351. $("#VendorLotNo").val(data.VendorLotNo);
  352. }
  353. });
  354. }
  355. }
  356. if (Type == '9') {
  357. debugger;
  358. if (!!RCVCode && !!Sequence) {
  359. $.ajax({
  360. url: "/WMS/WMSCreateItemLot/GetSubGridJsonKLCPRKByCreate?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  361. dataType: "json",
  362. async: false,
  363. success: function (data) {
  364. debugger;
  365. $("#InvCode").val(data.rows[0].InvCode);
  366. $("#INVNAME").val(data.rows[0].InvName);
  367. $("#INVSTD").val(data.rows[0].InvStd);
  368. $("#Quantity").val(data.rows[0].Quantity);
  369. $("#CreatedQty").val(data.rows[0].CreatedQty);
  370. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  371. $("#YAmount").val(data.rows[0].Amount);
  372. $("#PRODUCTDATE").val(nowDate);
  373. $("#ProjectCode").val(data.rows[0].ProjectCode);
  374. $("#BatchCode").val(data.rows[0].BatchCode);
  375. $("#Brand").val(data.rows[0].Brand);
  376. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  377. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  378. VenCode = data.rows[0].VenCode;
  379. WorkPoint = data.rows[0].WorkPoint;
  380. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  381. $("#thisCreateQty").attr("disabled", "disabled");
  382. $("#minPackQty").attr("disabled", "disabled");
  383. $("#VendorLotNo").attr("disabled", "disabled");
  384. }
  385. }
  386. });
  387. $.ajax({
  388. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  389. //data: { keyValue: keyValue },
  390. dataType: "json",
  391. async: false,
  392. success: function (data) {
  393. $("#VendorLotNo").val(data.VendorLotNo);
  394. }
  395. });
  396. }
  397. }
  398. if (Type == '10') {
  399. if (!!DNCode && !!Sequence) {
  400. $.ajax({
  401. url: "/WMS/WMSCreateItemLot/GetSubGridJsonJSDByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  402. dataType: "json",
  403. async: false,
  404. success: function (data) {
  405. debugger;
  406. $("#InvCode").val(data.rows[0].InvCode);
  407. $("#INVNAME").val(data.rows[0].InvName);
  408. $("#INVSTD").val(data.rows[0].InvStd);
  409. $("#Quantity").val(data.rows[0].Quantity);
  410. $("#CreatedQty").val(data.rows[0].CreatedQty);
  411. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  412. $("#YAmount").val(data.rows[0].Amount);
  413. $("#PRODUCTDATE").val(nowDate);
  414. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  415. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  416. VenCode = data.rows[0].VenCode;
  417. WorkPoint = data.rows[0].WorkPoint;
  418. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  419. $("#thisCreateQty").attr("disabled", "disabled");
  420. $("#minPackQty").attr("disabled", "disabled");
  421. $("#VendorLotNo").attr("disabled", "disabled");
  422. }
  423. }
  424. });
  425. $.ajax({
  426. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  427. //data: { keyValue: keyValue },
  428. dataType: "json",
  429. async: false,
  430. success: function (data) {
  431. $("#VendorLotNo").val(data.VendorLotNo);
  432. }
  433. });
  434. }
  435. }
  436. if (Type == '11') {
  437. debugger;
  438. if (!!ODNCode && !!Sequence) {
  439. $.ajax({
  440. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWJSDByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  441. dataType: "json",
  442. async: false,
  443. success: function (data) {
  444. debugger;
  445. $("#InvCode").val(data.rows[0].InvCode);
  446. $("#INVNAME").val(data.rows[0].InvName);
  447. $("#INVSTD").val(data.rows[0].InvStd);
  448. $("#Quantity").val(data.rows[0].Quantity);
  449. $("#CreatedQty").val(data.rows[0].CreatedQty);
  450. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  451. $("#YAmount").val(data.rows[0].Amount);
  452. $("#PRODUCTDATE").val(nowDate);
  453. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  454. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  455. VenCode = data.rows[0].VenCode;
  456. WorkPoint = data.rows[0].WorkPoint;
  457. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  458. $("#thisCreateQty").attr("disabled", "disabled");
  459. $("#minPackQty").attr("disabled", "disabled");
  460. $("#VendorLotNo").attr("disabled", "disabled");
  461. }
  462. }
  463. });
  464. $.ajax({
  465. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  466. //data: { keyValue: keyValue },
  467. dataType: "json",
  468. async: false,
  469. success: function (data) {
  470. $("#VendorLotNo").val(data.VendorLotNo);
  471. }
  472. });
  473. }
  474. }
  475. if (Type == '12') {
  476. if (!!LLApplyNegCode && !!Sequence) {
  477. $.ajax({
  478. url: "/WMS/WMSCreateItemLot/GetSubGridJsonLLSQDByCreate?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  479. //data: { keyValue: keyValue },
  480. dataType: "json",
  481. async: false,
  482. success: function (data) {
  483. debugger;
  484. $("#InvCode").val(data.rows[0].InvCode);
  485. $("#INVNAME").val(data.rows[0].InvName);
  486. $("#INVSTD").val(data.rows[0].InvStd);
  487. $("#Quantity").val(data.rows[0].Quantity);
  488. $("#CreatedQty").val(data.rows[0].CreatedQty);
  489. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  490. $("#YAmount").val(data.rows[0].Amount);
  491. $("#PRODUCTDATE").val(nowDate);
  492. $("#ProjectCode").val(data.rows[0].ProjectCode);
  493. $("#BatchCode").val(data.rows[0].BatchCode);
  494. $("#Brand").val(data.rows[0].Brand);
  495. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  496. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  497. VenCode = data.rows[0].VenCode;
  498. WorkPoint = data.rows[0].WorkPoint;
  499. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  500. $("#thisCreateQty").attr("disabled", "disabled");
  501. $("#minPackQty").attr("disabled", "disabled");
  502. $("#VendorLotNo").attr("disabled", "disabled");
  503. }
  504. }
  505. });
  506. $.ajax({
  507. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  508. //data: { keyValue: keyValue },
  509. dataType: "json",
  510. async: false,
  511. success: function (data) {
  512. $("#VendorLotNo").val(data.VendorLotNo);
  513. }
  514. });
  515. }
  516. }
  517. if (Type == '13') {
  518. if (!!CLApplyNegCode && !!Sequence) {
  519. $.ajax({
  520. url: "/WMS/WMSCreateItemLot/GetSubGridJsonCLCKByCreate?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  521. //data: { keyValue: keyValue },
  522. dataType: "json",
  523. async: false,
  524. success: function (data) {
  525. debugger;
  526. $("#InvCode").val(data.rows[0].InvCode);
  527. $("#INVNAME").val(data.rows[0].InvName);
  528. $("#INVSTD").val(data.rows[0].InvStd);
  529. $("#Quantity").val(data.rows[0].Quantity);
  530. $("#CreatedQty").val(data.rows[0].CreatedQty);
  531. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  532. $("#YAmount").val(data.rows[0].Amount);
  533. $("#PRODUCTDATE").val(nowDate);
  534. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  535. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  536. VenCode = data.rows[0].VenCode;
  537. WorkPoint = data.rows[0].WorkPoint;
  538. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  539. $("#thisCreateQty").attr("disabled", "disabled");
  540. $("#minPackQty").attr("disabled", "disabled");
  541. $("#VendorLotNo").attr("disabled", "disabled");
  542. }
  543. }
  544. });
  545. $.ajax({
  546. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  547. //data: { keyValue: keyValue },
  548. dataType: "json",
  549. async: false,
  550. success: function (data) {
  551. $("#VendorLotNo").val(data.VendorLotNo);
  552. }
  553. });
  554. }
  555. }
  556. if (Type == '14') {
  557. if (!!WWLLOApplyNegCode && !!Sequence) {
  558. $.ajax({
  559. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWLLByCreate?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  560. dataType: "json",
  561. async: false,
  562. success: function (data) {
  563. debugger;
  564. $("#InvCode").val(data.rows[0].InvCode);
  565. $("#INVNAME").val(data.rows[0].InvName);
  566. $("#INVSTD").val(data.rows[0].InvStd);
  567. $("#Quantity").val(data.rows[0].Quantity);
  568. $("#CreatedQty").val(data.rows[0].CreatedQty);
  569. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  570. $("#YAmount").val(data.rows[0].Amount);
  571. $("#PRODUCTDATE").val(nowDate);
  572. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  573. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  574. VenCode = data.rows[0].VenCode;
  575. WorkPoint = data.rows[0].WorkPoint;
  576. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  577. $("#thisCreateQty").attr("disabled", "disabled");
  578. $("#minPackQty").attr("disabled", "disabled");
  579. $("#VendorLotNo").attr("disabled", "disabled");
  580. }
  581. }
  582. });
  583. $.ajax({
  584. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  585. dataType: "json",
  586. async: false,
  587. success: function (data) {
  588. $("#VendorLotNo").val(data.VendorLotNo);
  589. }
  590. });
  591. }
  592. }
  593. if (Type == '15') {
  594. if (!!WWCLOApplyNegCode && !!Sequence) {
  595. $.ajax({
  596. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWCLByCreate?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  597. dataType: "json",
  598. async: false,
  599. success: function (data) {
  600. debugger;
  601. $("#InvCode").val(data.rows[0].InvCode);
  602. $("#INVNAME").val(data.rows[0].InvName);
  603. $("#INVSTD").val(data.rows[0].InvStd);
  604. $("#Quantity").val(data.rows[0].Quantity);
  605. $("#CreatedQty").val(data.rows[0].CreatedQty);
  606. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  607. $("#YAmount").val(data.rows[0].Amount);
  608. $("#PRODUCTDATE").val(nowDate);
  609. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  610. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  611. VenCode = data.rows[0].VenCode;
  612. WorkPoint = data.rows[0].WorkPoint;
  613. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  614. $("#thisCreateQty").attr("disabled", "disabled");
  615. $("#minPackQty").attr("disabled", "disabled");
  616. $("#VendorLotNo").attr("disabled", "disabled");
  617. }
  618. }
  619. });
  620. $.ajax({
  621. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  622. dataType: "json",
  623. async: false,
  624. success: function (data) {
  625. $("#VendorLotNo").val(data.VendorLotNo);
  626. }
  627. });
  628. }
  629. }
  630. if (Type == '16') {
  631. if (!!FGGDMOCode && !!Sequence) {
  632. $.ajax({
  633. url: "/WMS/WMSCreateItemLot/GetSubGridJsonFGGDCreate?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  634. dataType: "json",
  635. async: false,
  636. success: function (data) {
  637. debugger;
  638. $("#InvCode").val(data.rows[0].InvCode);
  639. $("#INVNAME").val(data.rows[0].InvName);
  640. $("#INVSTD").val(data.rows[0].InvStd);
  641. $("#Quantity").val(data.rows[0].Quantity);
  642. $("#CreatedQty").val(data.rows[0].CreatedQty);
  643. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  644. $("#YAmount").val(data.rows[0].Amount);
  645. $("#PRODUCTDATE").val(nowDate);
  646. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  647. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  648. VenCode = data.rows[0].VenCode;
  649. WorkPoint = data.rows[0].WorkPoint;
  650. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  651. $("#thisCreateQty").attr("disabled", "disabled");
  652. $("#minPackQty").attr("disabled", "disabled");
  653. $("#VendorLotNo").attr("disabled", "disabled");
  654. }
  655. }
  656. });
  657. $.ajax({
  658. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  659. dataType: "json",
  660. async: false,
  661. success: function (data) {
  662. $("#VendorLotNo").val(data.VendorLotNo);
  663. }
  664. });
  665. }
  666. }
  667. //查询后台自由项表(控制前台显示)
  668. $.ajax({
  669. url: "/WMS/WMSCreateItemLot/SelectICSExtensionEnable" + "?" + Math.random(),
  670. dataType: "json",
  671. async: false,
  672. success: function (data) {
  673. debugger;
  674. if (data != null && data.length > 0) {
  675. for (var i = 0; i < data.length; i++) {
  676. if (data[i].ColCode == 'ProjectCode') { $("#trProjectCode").css('display', 'none'); }
  677. if (data[i].ColCode == 'BatchCode') { $("#trBatchCode").css('display', 'none'); }
  678. if (data[i].ColCode == 'Version') { $("#trVersion").css('display', 'none'); }
  679. if (data[i].ColCode == 'Brand') { $("#trBrand").css('display', 'none'); }
  680. if (data[i].ColCode == 'cFree1') { $("#trcFree1").css('display', 'none'); }
  681. if (data[i].ColCode == 'cFree2') { $("#trcFree2").css('display', 'none'); }
  682. if (data[i].ColCode == 'cFree3') { $("#trcFree3").css('display', 'none'); }
  683. if (data[i].ColCode == 'cFree4') { $("#trcFree4").css('display', 'none'); }
  684. if (data[i].ColCode == 'cFree5') { $("#trcFree5").css('display', 'none'); }
  685. if (data[i].ColCode == 'cFree6') { $("#trcFree6").css('display', 'none'); }
  686. if (data[i].ColCode == 'cFree7') { $("#trcFree7").css('display', 'none'); }
  687. if (data[i].ColCode == 'cFree8') { $("#trcFree8").css('display', 'none'); }
  688. if (data[i].ColCode == 'cFree9') { $("#trcFree9").css('display', 'none'); }
  689. if (data[i].ColCode == 'cFree10') { $("#trcFree10").css('display', 'none'); }
  690. //if (i >= 4) {
  691. // if (data[i].ColName == 'cFree' + (i - 3)) {$("#trcFree'" + (i - 3) + "'").css('display', 'none');}
  692. //}
  693. }
  694. }
  695. }
  696. });
  697. $("#minPackQty").change(minPackQty_Change);
  698. $("#thisCreateQty").change(thisCreateQty_Change);
  699. $("#cretePageCount").change(function () {
  700. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  701. createPageCount = createPageCount.toFixed(0);
  702. if (createPageCount <= 0) {
  703. $.modalAlertNew("WMS00102");
  704. return false;
  705. }
  706. });
  707. });
  708. //最小包装量值改变事件
  709. function minPackQty_Change() {
  710. debugger;
  711. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  712. thisCreateQty = thisCreateQty.toFixed(2);
  713. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  714. minPackQty = minPackQty.toFixed(2);
  715. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  716. var Quantity = $("#Quantity").val() * 1;//数量
  717. var YAmount = $("#YAmount").val() * 1;//辅计量数量
  718. createPageCount = createPageCount.toFixed(0);
  719. if (minPackQty <= 0) {
  720. $.modalAlertNew("WMS00102");
  721. return false;
  722. }
  723. //不可以整除,生成张数+1;
  724. if (thisCreateQty % minPackQty != 0) {
  725. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  726. $("#cretePageCount").val(createPageCount);
  727. }
  728. else {
  729. createPageCount = parseInt(thisCreateQty / minPackQty);
  730. $("#cretePageCount").val(createPageCount);
  731. }
  732. var Ratio = YAmount / Quantity * minPackQty;
  733. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  734. }
  735. //本次生成数量值改变事件
  736. function thisCreateQty_Change() {
  737. debugger;
  738. var Quantity_str = $("#Quantity").val() * 1;//采购订单总数
  739. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  740. var thisCreateQty_str = $("#thisCreateQty").val() * 1;//本次生成数量
  741. var Quantity = Number(Quantity_str);
  742. var CreatedQty = Number(CreatedQty_str);
  743. var thisCreateQty = Number(thisCreateQty_str);
  744. if (thisCreateQty <= 0) {
  745. $.modalAlertNew("WMS00102");
  746. return false;
  747. }
  748. if (thisCreateQty <= 0 || thisCreateQty > (Quantity - CreatedQty)) {
  749. var maxQty = Quantity - CreatedQty;
  750. $.modalAlertNew("WMS00103",maxQty);
  751. //$.modalAlert("请输入0到" + maxQty + "范围内的数!");
  752. $("#thisCreateQty").val("");
  753. return false;
  754. } else {
  755. minPackQty_Change();
  756. return true;
  757. }
  758. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  759. minPackQty_Change();
  760. }
  761. function submitForm() {
  762. debugger;
  763. if (!$('#form1').formValid()) {
  764. return false;
  765. }
  766. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  767. thisCreateQty = thisCreateQty.toFixed(2);
  768. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  769. minPackQty = minPackQty.toFixed(2);
  770. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  771. createPageCount = createPageCount.toFixed(0);
  772. //校验
  773. var flag1 = thisCreateQty_Change();
  774. //var flag2 = CheckNum();
  775. var VendorLot = $("#VendorLotNo").val();
  776. if (flag1) { }
  777. else {
  778. return false;
  779. }
  780. var Quantity = $("#Quantity").val() * 1;//采购订单总数
  781. Quantity = Quantity.toFixed(2);
  782. var CreatedQty = $("#CreatedQty").val() * 1;//已生成数量
  783. CreatedQty = CreatedQty.toFixed(2);
  784. if (Quantity == CreatedQty ) {
  785. return false;
  786. }
  787. var ExpirationDate = '';//条码失效日期
  788. var EffectiveEnable = $("#EffectiveEnable").val();//料品是否启用有效天数
  789. var EffectiveDays = $("#EffectiveDays").val();//料品有效期天数
  790. var PRODUCTDATE = $("#PRODUCTDATE").val();//条码生产日期
  791. if (EffectiveEnable=='1') {
  792. var ExpirationDate= dateChange(EffectiveDays, PRODUCTDATE);
  793. } else {
  794. var ExpirationDate = '2999-12-31 00:00:00.000';
  795. }
  796. var obj = {
  797. thisCreateQty: thisCreateQty,
  798. minPackQty: minPackQty,
  799. createPageCount: createPageCount,
  800. VendorLot: VendorLot,
  801. PRODUCTDATE: PRODUCTDATE,
  802. ExpirationDate:ExpirationDate,
  803. Amount: $("#Amount").val(),
  804. //自由项
  805. ProjectCode: $("#ProjectCode").val(),
  806. BatchCode: $("#BatchCode").val(),
  807. Version: $("#Version").val(),
  808. Brand: $("#Brand").val(),
  809. cFree1: $("#cFree1").val(),
  810. cFree2: $("#cFree2").val(),
  811. cFree3: $("#cFree3").val(),
  812. cFree4: $("#cFree4").val(),
  813. cFree5: $("#cFree5").val(),
  814. cFree6: $("#cFree6").val(),
  815. cFree7: $("#cFree7").val(),
  816. cFree8: $("#cFree8").val(),
  817. cFree9: $("#cFree9").val(),
  818. cFree10: $("#cFree10").val(),
  819. }
  820. if (Type == '1') {
  821. var Flag = GetGetGeneratedNum(ApplyNegCode, Sequence, thisCreateQty);
  822. if (Flag == false) {
  823. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  824. return;
  825. }
  826. $.submitForm({
  827. url: "/WMS/WMSCreateItemLot/SubmitForm?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  828. param: {
  829. keyValue: JSON.stringify(obj)
  830. },
  831. success: function () {
  832. $.currentWindow().$("#gridList").trigger("reloadGrid");
  833. }
  834. })
  835. }
  836. if (Type == '2') {
  837. var Flag = GetGetGeneratedNum(OApplyNegCode, Sequence, thisCreateQty);
  838. if (Flag == false) {
  839. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  840. return;
  841. }
  842. $.submitForm({
  843. url: "/WMS/WMSCreateItemLot/SubmitFormWeiWai?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  844. param: {
  845. keyValue: JSON.stringify(obj)
  846. },
  847. success: function () {
  848. $.currentWindow().$("#gridList").trigger("reloadGrid");
  849. }
  850. })
  851. }
  852. if (Type == '3') {
  853. var Flag = GetGetGeneratedNum(MOCode, Sequence, thisCreateQty);
  854. if (Flag == false) {
  855. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  856. return;
  857. }
  858. var QiSetNum = '';
  859. var Msg = '';
  860. if ($("#Enable").val() == 'true') {
  861. var Header = {
  862. WorkPoint:WorkPoints,
  863. DetailID: MODetailID,
  864. Type: '生产订单',
  865. }
  866. var keyValue = [];
  867. keyValue.push(Header);
  868. $.ajax({
  869. url: "/WMS/WMSCreateItemLot/GetQiSetNum" + "?" + Math.random(),
  870. data: { keyValue: JSON.stringify(keyValue) },
  871. dataType: "json",
  872. async: false,
  873. success: function (data) {
  874. Msg = data.msg;
  875. QiSetNum = data.Num;
  876. }
  877. });
  878. }
  879. if (Msg!='') {
  880. $.modalAlert(Msg);
  881. return;
  882. }
  883. if (thisCreateQty > (QiSetNum - CreatedQty)) {
  884. $.modalAlert("该订单未发料,请发料后生成条码!");
  885. $("#thisCreateQty").val("");
  886. return ;
  887. }
  888. $.submitForm({
  889. url: "/WMS/WMSCreateItemLot/SubmitFormChengPing?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  890. param: {
  891. keyValue: JSON.stringify(obj)
  892. },
  893. success: function () {
  894. $.currentWindow().$("#gridList").trigger("reloadGrid");
  895. }
  896. })
  897. }
  898. if (Type == '4') {
  899. var Flag = GetGetGeneratedNum(SDNCode, Sequence, thisCreateQty);
  900. if (Flag == false) {
  901. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  902. return;
  903. }
  904. $.submitForm({
  905. url: "/WMS/WMSCreateItemLot/SubmitFormXiaoShou?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  906. param: {
  907. keyValue: JSON.stringify(obj)
  908. },
  909. success: function () {
  910. $.currentWindow().$("#gridList").trigger("reloadGrid");
  911. }
  912. })
  913. }
  914. if (Type == '5') {
  915. var Flag = GetGetGeneratedNum(InCode, Sequence, thisCreateQty);
  916. if (Flag == false) {
  917. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  918. return;
  919. }
  920. $.submitForm({
  921. url: "/WMS/WMSCreateItemLot/SubmitFormQiTa?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  922. param: {
  923. keyValue: JSON.stringify(obj)
  924. },
  925. success: function () {
  926. $.currentWindow().$("#gridList").trigger("reloadGrid");
  927. }
  928. })
  929. }
  930. if (Type == '6') {
  931. var Flag = GetGetGeneratedNum(ReturnCode, Sequence, thisCreateQty);
  932. if (Flag == false) {
  933. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  934. return;
  935. }
  936. $.submitForm({
  937. url: "/WMS/WMSCreateItemLot/SubmitFormGuiHuan?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  938. param: {
  939. keyValue: JSON.stringify(obj)
  940. },
  941. success: function () {
  942. $.currentWindow().$("#gridList").trigger("reloadGrid");
  943. }
  944. })
  945. }
  946. if (Type == '7') {
  947. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  948. if (Flag == false) {
  949. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  950. return;
  951. }
  952. $.submitForm({
  953. url: "/WMS/WMSCreateItemLot/SubmitFormSHDH?DNCode=" + DNCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  954. param: {
  955. keyValue: JSON.stringify(obj)
  956. },
  957. success: function () {
  958. $.currentWindow().$("#gridList").trigger("reloadGrid");
  959. }
  960. })
  961. }
  962. if (Type == '8') {
  963. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  964. if (Flag == false) {
  965. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  966. return;
  967. }
  968. $.submitForm({
  969. url: "/WMS/WMSCreateItemLot/SubmitFormWWSHDH?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  970. param: {
  971. keyValue: JSON.stringify(obj)
  972. },
  973. success: function () {
  974. $.currentWindow().$("#gridList").trigger("reloadGrid");
  975. }
  976. })
  977. }
  978. if (Type == '9') {
  979. var Flag = GetGetGeneratedNum(RCVCode, Sequence, thisCreateQty);
  980. if (Flag == false) {
  981. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  982. return;
  983. }
  984. $.submitForm({
  985. url: "/WMS/WMSCreateItemLot/SubmitFormKLCPRK?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  986. param: {
  987. keyValue: JSON.stringify(obj)
  988. },
  989. success: function () {
  990. $.currentWindow().$("#gridList").trigger("reloadGrid");
  991. }
  992. })
  993. }
  994. if (Type == '10') {
  995. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  996. if (Flag == false) {
  997. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  998. return;
  999. }
  1000. $.submitForm({
  1001. url: "/WMS/WMSCreateItemLot/SubmitFormJSD?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1002. param: {
  1003. keyValue: JSON.stringify(obj)
  1004. },
  1005. success: function () {
  1006. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1007. }
  1008. })
  1009. }
  1010. if (Type == '11') {
  1011. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  1012. if (Flag == false) {
  1013. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1014. return;
  1015. }
  1016. $.submitForm({
  1017. url: "/WMS/WMSCreateItemLot/SubmitFormWWJSD?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1018. param: {
  1019. keyValue: JSON.stringify(obj)
  1020. },
  1021. success: function () {
  1022. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1023. }
  1024. })
  1025. }
  1026. if (Type == '12') {
  1027. var Flag = GetGetGeneratedNum(LLApplyNegCode, Sequence, thisCreateQty);
  1028. if (Flag == false) {
  1029. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1030. return;
  1031. }
  1032. $.submitForm({
  1033. url: "/WMS/WMSCreateItemLot/SubmitFormLLSQTL?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  1034. param: {
  1035. keyValue: JSON.stringify(obj)
  1036. },
  1037. success: function () {
  1038. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1039. }
  1040. })
  1041. }
  1042. if (Type == '13') {
  1043. var Flag = GetGetGeneratedNum(CLApplyNegCode, Sequence, thisCreateQty);
  1044. if (Flag == false) {
  1045. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1046. return;
  1047. }
  1048. $.submitForm({
  1049. url: "/WMS/WMSCreateItemLot/SubmitFormCLCKT?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1050. param: {
  1051. keyValue: JSON.stringify(obj)
  1052. },
  1053. success: function () {
  1054. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1055. }
  1056. })
  1057. }
  1058. if (Type == '14') {
  1059. var Flag = GetGetGeneratedNum(WWLLOApplyNegCode, Sequence, thisCreateQty);
  1060. if (Flag == false) {
  1061. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1062. return;
  1063. }
  1064. $.submitForm({
  1065. url: "/WMS/WMSCreateItemLot/SubmitFormWWLL?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1066. param: {
  1067. keyValue: JSON.stringify(obj)
  1068. },
  1069. success: function () {
  1070. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1071. }
  1072. })
  1073. }
  1074. if (Type == '15') {
  1075. var Flag = GetGetGeneratedNum(WWCLOApplyNegCode, Sequence, thisCreateQty);
  1076. if (Flag == false) {
  1077. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1078. return;
  1079. }
  1080. $.submitForm({
  1081. url: "/WMS/WMSCreateItemLot/SubmitFormWWCL?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1082. param: {
  1083. keyValue: JSON.stringify(obj)
  1084. },
  1085. success: function () {
  1086. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1087. }
  1088. })
  1089. }
  1090. if (Type == '16') {
  1091. var Flag = GetGetGeneratedNum(FGGDMOCode, Sequence, thisCreateQty);
  1092. if (Flag == false) {
  1093. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1094. return;
  1095. }
  1096. $.submitForm({
  1097. url: "/WMS/WMSCreateItemLot/SubmitFormFGGD?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1098. param: {
  1099. keyValue: JSON.stringify(obj)
  1100. },
  1101. success: function () {
  1102. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1103. }
  1104. })
  1105. }
  1106. }
  1107. //解决网络延迟问题每次实时验证本次生成数量 有没有超
  1108. function GetGetGeneratedNum(Code, Sequence, thisCreateQty) {
  1109. var Flags;
  1110. $.ajax({
  1111. url: "/WMS/WMSCreateItemLot/GetGeneratedNum?Code=" + Code + "&Sequence=" + Sequence + "&Type=" + Type + "&thisCreateQty=" + thisCreateQty,
  1112. dataType: "json",
  1113. async: false,
  1114. success: function (data) {
  1115. Flags = data.Flag;
  1116. }
  1117. });
  1118. return Flags;
  1119. }
  1120. function dateChange(num ,date ) {
  1121. if (!date) {
  1122. date = new Date();//没有传入值时,默认是当前日期
  1123. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  1124. }
  1125. date += " 00:00:00";//设置为当天凌晨12点
  1126. date = Date.parse(new Date(date))/1000;//转换为时间戳
  1127. date += (86400) * num;//修改后的时间戳
  1128. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  1129. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  1130. }
  1131. </script>
  1132. <form id="form1">
  1133. <div style="padding-top: 20px; margin-right: 20px;">
  1134. <table class="form">
  1135. <tr>
  1136. <th class="formTitle">料品编码</th>
  1137. <td class="formValue">
  1138. <input id="InvCode" name="InvCode" type="text" class="form-control " disabled="disabled" />
  1139. <input id="Enable" name="Enable" type="text" style="display:none" disabled="disabled" />
  1140. </td>
  1141. </tr>
  1142. <tr>
  1143. <th class="formTitle">物料描述</th>
  1144. <td class="formValue">
  1145. <input id="INVNAME" name="INVNAME" type="text" class="form-control " disabled="disabled" />
  1146. </td>
  1147. </tr>
  1148. <tr>
  1149. <th class="formTitle">规格型号</th>
  1150. <td class="formValue">
  1151. <input id="INVSTD" name="INVSTD" type="text" class="form-control " disabled="disabled" />
  1152. </td>
  1153. </tr>
  1154. <tr>
  1155. <th class="formTitle">计量单位</th>
  1156. <td class="formValue">
  1157. <input id="INVUOM" name="INVUOM" type="text" class="form-control " disabled="disabled" />
  1158. </td>
  1159. </tr>
  1160. <tr>
  1161. <th class="formTitle">数量</th>
  1162. <td class="formValue">
  1163. <input id="Quantity" name="Quantity" type="text" class="form-control " disabled="disabled" />
  1164. <input id="YAmount" name="YAmount" type="text" style="display:none" disabled="disabled" />
  1165. <input id="DJQuantity" name="DJQuantity" type="text" style="display:none" disabled="disabled" />
  1166. </td>
  1167. </tr>
  1168. <tr>
  1169. <th class="formTitle">已生成条码数量</th>
  1170. <td class="formValue">
  1171. <input id="CreatedQty" name="CreatedQty" type="text" class="form-control " disabled="disabled" />
  1172. </td>
  1173. </tr>
  1174. <tr>
  1175. <th class="formTitle"><span style="color: red;">*</span>本次生成数量</th>
  1176. <td class="formValue">
  1177. <input id="thisCreateQty" name="thisCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" />
  1178. </td>
  1179. </tr>
  1180. <tr>
  1181. <th class="formTitle"><span style="color: red;">*</span>最小包装量</th>
  1182. <td class="formValue">
  1183. <input id="minPackQty" name="minPackQty" type="text" class="form-control required" placeholder="请输入最小包装量" />
  1184. </td>
  1185. </tr>
  1186. <tr>
  1187. <th class="formTitle"><span style="color: red;">*</span>生产日期</th>
  1188. <td class="formValue">
  1189. <input type="text" name="PRODUCTDATE" id="PRODUCTDATE" class="form-control required" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="生产日期" />
  1190. <input id="EffectiveEnable" name="EffectiveEnable" type="text" style="display:none" />
  1191. <input id="EffectiveDays" name="EffectiveDays" type="text" style="display:none" />
  1192. </td>
  1193. </tr>
  1194. <tr>
  1195. <th class="formTitle"><span style="color: red;">*</span>生成张数</th>
  1196. <td class="formValue">
  1197. <input id="cretePageCount" name="cretePageCount" class="form-control required" type="text" placeholder="请输入生成张数" />
  1198. </td>
  1199. </tr>
  1200. <tr>
  1201. <th class="formTitle">辅计量数量</th>
  1202. <td class="formValue">
  1203. <input id="Amount" name="Amount" class="form-control" type="text" placeholder="请输入辅计量数量" />
  1204. </td>
  1205. </tr>
  1206. @*sssss*@
  1207. <tr id="trProjectCode">
  1208. <th class="formTitle">销售凭证</th>
  1209. <td class="formValue">
  1210. @*<input id="ProjectCode" name="ProjectCode" class="form-control " type="text" placeholder="请输入项目号" />*@
  1211. <input id="ProjectCode" name="ProjectCode" class="form-control " type="text" disabled="disabled" />
  1212. </td>
  1213. </tr>
  1214. <tr id="trBatchCode">
  1215. <th class="formTitle">序列号</th>
  1216. <td class="formValue">
  1217. @*<input id="BatchCode" name="BatchCode" class="form-control " type="text" placeholder="请输入批次" />*@
  1218. <input id="BatchCode" name="BatchCode" class="form-control " type="text" disabled="disabled" />
  1219. </td>
  1220. </tr>
  1221. <tr id="trVersion">
  1222. <th class="formTitle">版本</th>
  1223. <td class="formValue">
  1224. <input id="Version" name="Version" class="form-control " type="text" placeholder="请输入版本" disabled="disabled" />
  1225. </td>
  1226. </tr>
  1227. <tr id="trBrand">
  1228. <th class="formTitle">销售凭证项号</th>
  1229. <td class="formValue">
  1230. @*<input id="Brand" name="Brand" type="text" class="form-control " placeholder="请输入厂牌" />*@
  1231. <input id="Brand" name="Brand" type="text" class="form-control " disabled="disabled" />
  1232. </td>
  1233. </tr>
  1234. <tr id="trcFree1">
  1235. <th class="formTitle">自由项1</th>
  1236. <td class="formValue">
  1237. <input id="cFree1" name="cFree1" type="text" class="form-control " placeholder="请输入自由项1" />
  1238. </td>
  1239. </tr>
  1240. <tr id="trcFree2">
  1241. <th class="formTitle">自由项2</th>
  1242. <td class="formValue">
  1243. <input id="cFree2" name="cFree2" type="text" class="form-control " placeholder="请输入自由项2" />
  1244. </td>
  1245. </tr>
  1246. <tr id="trcFree3">
  1247. <th class="formTitle">自由项3</th>
  1248. <td class="formValue">
  1249. <input id="cFree3" name="cFree3" type="text" class="form-control " placeholder="请输入自由项3" />
  1250. </td>
  1251. </tr>
  1252. <tr id="trcFree4">
  1253. <th class="formTitle">自由项4</th>
  1254. <td class="formValue">
  1255. <input id="cFree4" name="cFree4" type="text" class="form-control " placeholder="请输入自由项4" />
  1256. </td>
  1257. </tr>
  1258. <tr id="trcFree5">
  1259. <th class="formTitle">自由项5</th>
  1260. <td class="formValue">
  1261. <input id="cFree5" name="cFree5" type="text" class="form-control " placeholder="请输入自由项5" />
  1262. </td>
  1263. </tr>
  1264. <tr id="trcFree6">
  1265. <th class="formTitle">自由项6</th>
  1266. <td class="formValue">
  1267. <input id="cFree6" name="cFree6" type="text" class="form-control " placeholder="请输入自由项6" />
  1268. </td>
  1269. </tr>
  1270. <tr id="trcFree7">
  1271. <th class="formTitle">自由项7</th>
  1272. <td class="formValue">
  1273. <input id="cFree7" name="cFree7" type="text" class="form-control " placeholder="请输入自由项7" />
  1274. </td>
  1275. </tr>
  1276. <tr id="trcFree8">
  1277. <th class="formTitle">自由项8</th>
  1278. <td class="formValue">
  1279. <input id="cFree8" name="cFree8" type="text" class="form-control " placeholder="请输入自由项8" />
  1280. </td>
  1281. </tr>
  1282. <tr id="trcFree9">
  1283. <th class="formTitle">自由项9</th>
  1284. <td class="formValue">
  1285. <input id="cFree9" name="cFree9" type="text" class="form-control " placeholder="请输入自由项9" />
  1286. </td>
  1287. </tr>
  1288. <tr id="trcFree10">
  1289. <th class="formTitle">自由项10</th>
  1290. <td class="formValue">
  1291. <input id="cFree10" name="cFree10" type="text" class="form-control " placeholder="请输入自由项10" />
  1292. </td>
  1293. </tr>
  1294. </table>
  1295. </div>
  1296. </form>