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

1360 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
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. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  493. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  494. VenCode = data.rows[0].VenCode;
  495. WorkPoint = data.rows[0].WorkPoint;
  496. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  497. $("#thisCreateQty").attr("disabled", "disabled");
  498. $("#minPackQty").attr("disabled", "disabled");
  499. $("#VendorLotNo").attr("disabled", "disabled");
  500. }
  501. }
  502. });
  503. $.ajax({
  504. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  505. //data: { keyValue: keyValue },
  506. dataType: "json",
  507. async: false,
  508. success: function (data) {
  509. $("#VendorLotNo").val(data.VendorLotNo);
  510. }
  511. });
  512. }
  513. }
  514. if (Type == '13') {
  515. if (!!CLApplyNegCode && !!Sequence) {
  516. $.ajax({
  517. url: "/WMS/WMSCreateItemLot/GetSubGridJsonCLCKByCreate?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  518. //data: { keyValue: keyValue },
  519. dataType: "json",
  520. async: false,
  521. success: function (data) {
  522. debugger;
  523. $("#InvCode").val(data.rows[0].InvCode);
  524. $("#INVNAME").val(data.rows[0].InvName);
  525. $("#INVSTD").val(data.rows[0].InvStd);
  526. $("#Quantity").val(data.rows[0].Quantity);
  527. $("#CreatedQty").val(data.rows[0].CreatedQty);
  528. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  529. $("#YAmount").val(data.rows[0].Amount);
  530. $("#PRODUCTDATE").val(nowDate);
  531. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  532. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  533. VenCode = data.rows[0].VenCode;
  534. WorkPoint = data.rows[0].WorkPoint;
  535. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  536. $("#thisCreateQty").attr("disabled", "disabled");
  537. $("#minPackQty").attr("disabled", "disabled");
  538. $("#VendorLotNo").attr("disabled", "disabled");
  539. }
  540. }
  541. });
  542. $.ajax({
  543. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  544. //data: { keyValue: keyValue },
  545. dataType: "json",
  546. async: false,
  547. success: function (data) {
  548. $("#VendorLotNo").val(data.VendorLotNo);
  549. }
  550. });
  551. }
  552. }
  553. if (Type == '14') {
  554. if (!!WWLLOApplyNegCode && !!Sequence) {
  555. $.ajax({
  556. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWLLByCreate?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  557. dataType: "json",
  558. async: false,
  559. success: function (data) {
  560. debugger;
  561. $("#InvCode").val(data.rows[0].InvCode);
  562. $("#INVNAME").val(data.rows[0].InvName);
  563. $("#INVSTD").val(data.rows[0].InvStd);
  564. $("#Quantity").val(data.rows[0].Quantity);
  565. $("#CreatedQty").val(data.rows[0].CreatedQty);
  566. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  567. $("#YAmount").val(data.rows[0].Amount);
  568. $("#PRODUCTDATE").val(nowDate);
  569. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  570. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  571. VenCode = data.rows[0].VenCode;
  572. WorkPoint = data.rows[0].WorkPoint;
  573. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  574. $("#thisCreateQty").attr("disabled", "disabled");
  575. $("#minPackQty").attr("disabled", "disabled");
  576. $("#VendorLotNo").attr("disabled", "disabled");
  577. }
  578. }
  579. });
  580. $.ajax({
  581. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  582. dataType: "json",
  583. async: false,
  584. success: function (data) {
  585. $("#VendorLotNo").val(data.VendorLotNo);
  586. }
  587. });
  588. }
  589. }
  590. if (Type == '15') {
  591. if (!!WWCLOApplyNegCode && !!Sequence) {
  592. $.ajax({
  593. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWCLByCreate?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  594. dataType: "json",
  595. async: false,
  596. success: function (data) {
  597. debugger;
  598. $("#InvCode").val(data.rows[0].InvCode);
  599. $("#INVNAME").val(data.rows[0].InvName);
  600. $("#INVSTD").val(data.rows[0].InvStd);
  601. $("#Quantity").val(data.rows[0].Quantity);
  602. $("#CreatedQty").val(data.rows[0].CreatedQty);
  603. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  604. $("#YAmount").val(data.rows[0].Amount);
  605. $("#PRODUCTDATE").val(nowDate);
  606. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  607. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  608. VenCode = data.rows[0].VenCode;
  609. WorkPoint = data.rows[0].WorkPoint;
  610. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  611. $("#thisCreateQty").attr("disabled", "disabled");
  612. $("#minPackQty").attr("disabled", "disabled");
  613. $("#VendorLotNo").attr("disabled", "disabled");
  614. }
  615. }
  616. });
  617. $.ajax({
  618. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  619. dataType: "json",
  620. async: false,
  621. success: function (data) {
  622. $("#VendorLotNo").val(data.VendorLotNo);
  623. }
  624. });
  625. }
  626. }
  627. if (Type == '16') {
  628. if (!!FGGDMOCode && !!Sequence) {
  629. $.ajax({
  630. url: "/WMS/WMSCreateItemLot/GetSubGridJsonFGGDCreate?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  631. dataType: "json",
  632. async: false,
  633. success: function (data) {
  634. debugger;
  635. $("#InvCode").val(data.rows[0].InvCode);
  636. $("#INVNAME").val(data.rows[0].InvName);
  637. $("#INVSTD").val(data.rows[0].InvStd);
  638. $("#Quantity").val(data.rows[0].Quantity);
  639. $("#CreatedQty").val(data.rows[0].CreatedQty);
  640. $("#thisCreateQty").val(data.rows[0].thisCreateQty);
  641. $("#YAmount").val(data.rows[0].Amount);
  642. $("#PRODUCTDATE").val(nowDate);
  643. $("#EffectiveEnable").val(data.rows[0].EffectiveEnable);
  644. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  645. VenCode = data.rows[0].VenCode;
  646. WorkPoint = data.rows[0].WorkPoint;
  647. if (data.rows[0].Quantity == data.rows[0].CreatedQty) {
  648. $("#thisCreateQty").attr("disabled", "disabled");
  649. $("#minPackQty").attr("disabled", "disabled");
  650. $("#VendorLotNo").attr("disabled", "disabled");
  651. }
  652. }
  653. });
  654. $.ajax({
  655. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  656. dataType: "json",
  657. async: false,
  658. success: function (data) {
  659. $("#VendorLotNo").val(data.VendorLotNo);
  660. }
  661. });
  662. }
  663. }
  664. //查询后台自由项表(控制前台显示)
  665. $.ajax({
  666. url: "/WMS/WMSCreateItemLot/SelectICSExtensionEnable" + "?" + Math.random(),
  667. dataType: "json",
  668. async: false,
  669. success: function (data) {
  670. debugger;
  671. if (data != null && data.length > 0) {
  672. for (var i = 0; i < data.length; i++) {
  673. if (data[i].ColCode == 'ProjectCode') { $("#trProjectCode").css('display', 'none'); }
  674. if (data[i].ColCode == 'BatchCode') { $("#trBatchCode").css('display', 'none'); }
  675. if (data[i].ColCode == 'Version') { $("#trVersion").css('display', 'none'); }
  676. if (data[i].ColCode == 'Brand') { $("#trBrand").css('display', 'none'); }
  677. if (data[i].ColCode == 'cFree1') { $("#trcFree1").css('display', 'none'); }
  678. if (data[i].ColCode == 'cFree2') { $("#trcFree2").css('display', 'none'); }
  679. if (data[i].ColCode == 'cFree3') { $("#trcFree3").css('display', 'none'); }
  680. if (data[i].ColCode == 'cFree4') { $("#trcFree4").css('display', 'none'); }
  681. if (data[i].ColCode == 'cFree5') { $("#trcFree5").css('display', 'none'); }
  682. if (data[i].ColCode == 'cFree6') { $("#trcFree6").css('display', 'none'); }
  683. if (data[i].ColCode == 'cFree7') { $("#trcFree7").css('display', 'none'); }
  684. if (data[i].ColCode == 'cFree8') { $("#trcFree8").css('display', 'none'); }
  685. if (data[i].ColCode == 'cFree9') { $("#trcFree9").css('display', 'none'); }
  686. if (data[i].ColCode == 'cFree10') { $("#trcFree10").css('display', 'none'); }
  687. //if (i >= 4) {
  688. // if (data[i].ColName == 'cFree' + (i - 3)) {$("#trcFree'" + (i - 3) + "'").css('display', 'none');}
  689. //}
  690. }
  691. }
  692. }
  693. });
  694. $("#minPackQty").change(minPackQty_Change);
  695. $("#thisCreateQty").change(thisCreateQty_Change);
  696. $("#cretePageCount").change(function () {
  697. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  698. createPageCount = createPageCount.toFixed(0);
  699. if (createPageCount <= 0) {
  700. $.modalAlertNew("WMS00102");
  701. return false;
  702. }
  703. });
  704. });
  705. //最小包装量值改变事件
  706. function minPackQty_Change() {
  707. debugger;
  708. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  709. thisCreateQty = thisCreateQty.toFixed(2);
  710. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  711. minPackQty = minPackQty.toFixed(2);
  712. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  713. var Quantity = $("#Quantity").val() * 1;//数量
  714. var YAmount = $("#YAmount").val() * 1;//辅计量数量
  715. createPageCount = createPageCount.toFixed(0);
  716. if (minPackQty <= 0) {
  717. $.modalAlertNew("WMS00102");
  718. return false;
  719. }
  720. //不可以整除,生成张数+1;
  721. if (thisCreateQty % minPackQty != 0) {
  722. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  723. $("#cretePageCount").val(createPageCount);
  724. }
  725. else {
  726. createPageCount = parseInt(thisCreateQty / minPackQty);
  727. $("#cretePageCount").val(createPageCount);
  728. }
  729. var Ratio = YAmount / Quantity * minPackQty;
  730. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  731. }
  732. //本次生成数量值改变事件
  733. function thisCreateQty_Change() {
  734. debugger;
  735. var Quantity_str = $("#Quantity").val() * 1;//采购订单总数
  736. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  737. var thisCreateQty_str = $("#thisCreateQty").val() * 1;//本次生成数量
  738. var Quantity = Number(Quantity_str);
  739. var CreatedQty = Number(CreatedQty_str);
  740. var thisCreateQty = Number(thisCreateQty_str);
  741. if (thisCreateQty <= 0) {
  742. $.modalAlertNew("WMS00102");
  743. return false;
  744. }
  745. if (thisCreateQty <= 0 || thisCreateQty > (Quantity - CreatedQty)) {
  746. var maxQty = Quantity - CreatedQty;
  747. $.modalAlertNew("WMS00103",maxQty);
  748. //$.modalAlert("请输入0到" + maxQty + "范围内的数!");
  749. $("#thisCreateQty").val("");
  750. return false;
  751. } else {
  752. minPackQty_Change();
  753. return true;
  754. }
  755. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  756. minPackQty_Change();
  757. }
  758. function submitForm() {
  759. debugger;
  760. if (!$('#form1').formValid()) {
  761. return false;
  762. }
  763. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  764. thisCreateQty = thisCreateQty.toFixed(2);
  765. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  766. minPackQty = minPackQty.toFixed(2);
  767. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  768. createPageCount = createPageCount.toFixed(0);
  769. //校验
  770. var flag1 = thisCreateQty_Change();
  771. //var flag2 = CheckNum();
  772. var VendorLot = $("#VendorLotNo").val();
  773. if (flag1) { }
  774. else {
  775. return false;
  776. }
  777. var Quantity = $("#Quantity").val() * 1;//采购订单总数
  778. Quantity = Quantity.toFixed(2);
  779. var CreatedQty = $("#CreatedQty").val() * 1;//已生成数量
  780. CreatedQty = CreatedQty.toFixed(2);
  781. if (Quantity == CreatedQty ) {
  782. return false;
  783. }
  784. var ExpirationDate = '';//条码失效日期
  785. var EffectiveEnable = $("#EffectiveEnable").val();//料品是否启用有效天数
  786. var EffectiveDays = $("#EffectiveDays").val();//料品有效期天数
  787. var PRODUCTDATE = $("#PRODUCTDATE").val();//条码生产日期
  788. if (EffectiveEnable=='1') {
  789. var ExpirationDate= dateChange(EffectiveDays, PRODUCTDATE);
  790. } else {
  791. var ExpirationDate = '2999-12-31 00:00:00.000';
  792. }
  793. var obj = {
  794. thisCreateQty: thisCreateQty,
  795. minPackQty: minPackQty,
  796. createPageCount: createPageCount,
  797. VendorLot: VendorLot,
  798. PRODUCTDATE: PRODUCTDATE,
  799. ExpirationDate:ExpirationDate,
  800. Amount: $("#Amount").val(),
  801. //自由项
  802. ProjectCode: $("#ProjectCode").val(),
  803. BatchCode: $("#BatchCode").val(),
  804. Version: $("#Version").val(),
  805. Brand: $("#Brand").val(),
  806. cFree1: $("#cFree1").val(),
  807. cFree2: $("#cFree2").val(),
  808. cFree3: $("#cFree3").val(),
  809. cFree4: $("#cFree4").val(),
  810. cFree5: $("#cFree5").val(),
  811. cFree6: $("#cFree6").val(),
  812. cFree7: $("#cFree7").val(),
  813. cFree8: $("#cFree8").val(),
  814. cFree9: $("#cFree9").val(),
  815. cFree10: $("#cFree10").val(),
  816. }
  817. if (Type == '1') {
  818. var Flag = GetGetGeneratedNum(ApplyNegCode, Sequence, thisCreateQty);
  819. if (Flag == false) {
  820. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  821. return;
  822. }
  823. $.submitForm({
  824. url: "/WMS/WMSCreateItemLot/SubmitForm?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  825. param: {
  826. keyValue: JSON.stringify(obj)
  827. },
  828. success: function () {
  829. $.currentWindow().$("#gridList").trigger("reloadGrid");
  830. }
  831. })
  832. }
  833. if (Type == '2') {
  834. var Flag = GetGetGeneratedNum(OApplyNegCode, Sequence, thisCreateQty);
  835. if (Flag == false) {
  836. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  837. return;
  838. }
  839. $.submitForm({
  840. url: "/WMS/WMSCreateItemLot/SubmitFormWeiWai?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  841. param: {
  842. keyValue: JSON.stringify(obj)
  843. },
  844. success: function () {
  845. $.currentWindow().$("#gridList").trigger("reloadGrid");
  846. }
  847. })
  848. }
  849. if (Type == '3') {
  850. var Flag = GetGetGeneratedNum(MOCode, Sequence, thisCreateQty);
  851. if (Flag == false) {
  852. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  853. return;
  854. }
  855. var QiSetNum = '';
  856. var Msg = '';
  857. if ($("#Enable").val() == 'true') {
  858. var Header = {
  859. WorkPoint:WorkPoints,
  860. DetailID: MODetailID,
  861. Type: '生产订单',
  862. }
  863. var keyValue = [];
  864. keyValue.push(Header);
  865. $.ajax({
  866. url: "/WMS/WMSCreateItemLot/GetQiSetNum" + "?" + Math.random(),
  867. data: { keyValue: JSON.stringify(keyValue) },
  868. dataType: "json",
  869. async: false,
  870. success: function (data) {
  871. Msg = data.msg;
  872. QiSetNum = data.Num;
  873. }
  874. });
  875. }
  876. if (Msg!='') {
  877. $.modalAlert(Msg);
  878. return;
  879. }
  880. if (thisCreateQty > (QiSetNum - CreatedQty)) {
  881. $.modalAlert("该订单未发料,请发料后生成条码!");
  882. $("#thisCreateQty").val("");
  883. return ;
  884. }
  885. $.submitForm({
  886. url: "/WMS/WMSCreateItemLot/SubmitFormChengPing?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  887. param: {
  888. keyValue: JSON.stringify(obj)
  889. },
  890. success: function () {
  891. $.currentWindow().$("#gridList").trigger("reloadGrid");
  892. }
  893. })
  894. }
  895. if (Type == '4') {
  896. var Flag = GetGetGeneratedNum(SDNCode, Sequence, thisCreateQty);
  897. if (Flag == false) {
  898. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  899. return;
  900. }
  901. $.submitForm({
  902. url: "/WMS/WMSCreateItemLot/SubmitFormXiaoShou?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  903. param: {
  904. keyValue: JSON.stringify(obj)
  905. },
  906. success: function () {
  907. $.currentWindow().$("#gridList").trigger("reloadGrid");
  908. }
  909. })
  910. }
  911. if (Type == '5') {
  912. var Flag = GetGetGeneratedNum(InCode, Sequence, thisCreateQty);
  913. if (Flag == false) {
  914. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  915. return;
  916. }
  917. $.submitForm({
  918. url: "/WMS/WMSCreateItemLot/SubmitFormQiTa?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  919. param: {
  920. keyValue: JSON.stringify(obj)
  921. },
  922. success: function () {
  923. $.currentWindow().$("#gridList").trigger("reloadGrid");
  924. }
  925. })
  926. }
  927. if (Type == '6') {
  928. var Flag = GetGetGeneratedNum(ReturnCode, Sequence, thisCreateQty);
  929. if (Flag == false) {
  930. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  931. return;
  932. }
  933. $.submitForm({
  934. url: "/WMS/WMSCreateItemLot/SubmitFormGuiHuan?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  935. param: {
  936. keyValue: JSON.stringify(obj)
  937. },
  938. success: function () {
  939. $.currentWindow().$("#gridList").trigger("reloadGrid");
  940. }
  941. })
  942. }
  943. if (Type == '7') {
  944. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  945. if (Flag == false) {
  946. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  947. return;
  948. }
  949. $.submitForm({
  950. url: "/WMS/WMSCreateItemLot/SubmitFormSHDH?DNCode=" + DNCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  951. param: {
  952. keyValue: JSON.stringify(obj)
  953. },
  954. success: function () {
  955. $.currentWindow().$("#gridList").trigger("reloadGrid");
  956. }
  957. })
  958. }
  959. if (Type == '8') {
  960. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  961. if (Flag == false) {
  962. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  963. return;
  964. }
  965. $.submitForm({
  966. url: "/WMS/WMSCreateItemLot/SubmitFormWWSHDH?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  967. param: {
  968. keyValue: JSON.stringify(obj)
  969. },
  970. success: function () {
  971. $.currentWindow().$("#gridList").trigger("reloadGrid");
  972. }
  973. })
  974. }
  975. if (Type == '9') {
  976. var Flag = GetGetGeneratedNum(RCVCode, Sequence, thisCreateQty);
  977. if (Flag == false) {
  978. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  979. return;
  980. }
  981. $.submitForm({
  982. url: "/WMS/WMSCreateItemLot/SubmitFormKLCPRK?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  983. param: {
  984. keyValue: JSON.stringify(obj)
  985. },
  986. success: function () {
  987. $.currentWindow().$("#gridList").trigger("reloadGrid");
  988. }
  989. })
  990. }
  991. if (Type == '10') {
  992. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  993. if (Flag == false) {
  994. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  995. return;
  996. }
  997. $.submitForm({
  998. url: "/WMS/WMSCreateItemLot/SubmitFormJSD?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  999. param: {
  1000. keyValue: JSON.stringify(obj)
  1001. },
  1002. success: function () {
  1003. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1004. }
  1005. })
  1006. }
  1007. if (Type == '11') {
  1008. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  1009. if (Flag == false) {
  1010. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1011. return;
  1012. }
  1013. $.submitForm({
  1014. url: "/WMS/WMSCreateItemLot/SubmitFormWWJSD?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1015. param: {
  1016. keyValue: JSON.stringify(obj)
  1017. },
  1018. success: function () {
  1019. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1020. }
  1021. })
  1022. }
  1023. if (Type == '12') {
  1024. var Flag = GetGetGeneratedNum(LLApplyNegCode, Sequence, thisCreateQty);
  1025. if (Flag == false) {
  1026. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1027. return;
  1028. }
  1029. $.submitForm({
  1030. url: "/WMS/WMSCreateItemLot/SubmitFormLLSQTL?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&INVCode=" + $("#InvCode").val() + "&WorkPoint=" + WorkPoints,
  1031. param: {
  1032. keyValue: JSON.stringify(obj)
  1033. },
  1034. success: function () {
  1035. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1036. }
  1037. })
  1038. }
  1039. if (Type == '13') {
  1040. var Flag = GetGetGeneratedNum(CLApplyNegCode, Sequence, thisCreateQty);
  1041. if (Flag == false) {
  1042. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1043. return;
  1044. }
  1045. $.submitForm({
  1046. url: "/WMS/WMSCreateItemLot/SubmitFormCLCKT?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1047. param: {
  1048. keyValue: JSON.stringify(obj)
  1049. },
  1050. success: function () {
  1051. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1052. }
  1053. })
  1054. }
  1055. if (Type == '14') {
  1056. var Flag = GetGetGeneratedNum(WWLLOApplyNegCode, Sequence, thisCreateQty);
  1057. if (Flag == false) {
  1058. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1059. return;
  1060. }
  1061. $.submitForm({
  1062. url: "/WMS/WMSCreateItemLot/SubmitFormWWLL?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1063. param: {
  1064. keyValue: JSON.stringify(obj)
  1065. },
  1066. success: function () {
  1067. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1068. }
  1069. })
  1070. }
  1071. if (Type == '15') {
  1072. var Flag = GetGetGeneratedNum(WWCLOApplyNegCode, Sequence, thisCreateQty);
  1073. if (Flag == false) {
  1074. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1075. return;
  1076. }
  1077. $.submitForm({
  1078. url: "/WMS/WMSCreateItemLot/SubmitFormWWCL?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1079. param: {
  1080. keyValue: JSON.stringify(obj)
  1081. },
  1082. success: function () {
  1083. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1084. }
  1085. })
  1086. }
  1087. if (Type == '16') {
  1088. var Flag = GetGetGeneratedNum(FGGDMOCode, Sequence, thisCreateQty);
  1089. if (Flag == false) {
  1090. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1091. return;
  1092. }
  1093. $.submitForm({
  1094. url: "/WMS/WMSCreateItemLot/SubmitFormFGGD?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1095. param: {
  1096. keyValue: JSON.stringify(obj)
  1097. },
  1098. success: function () {
  1099. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1100. }
  1101. })
  1102. }
  1103. }
  1104. //解决网络延迟问题每次实时验证本次生成数量 有没有超
  1105. function GetGetGeneratedNum(Code, Sequence, thisCreateQty) {
  1106. var Flags;
  1107. $.ajax({
  1108. url: "/WMS/WMSCreateItemLot/GetGeneratedNum?Code=" + Code + "&Sequence=" + Sequence + "&Type=" + Type + "&thisCreateQty=" + thisCreateQty,
  1109. dataType: "json",
  1110. async: false,
  1111. success: function (data) {
  1112. Flags = data.Flag;
  1113. }
  1114. });
  1115. return Flags;
  1116. }
  1117. function dateChange(num ,date ) {
  1118. if (!date) {
  1119. date = new Date();//没有传入值时,默认是当前日期
  1120. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  1121. }
  1122. date += " 00:00:00";//设置为当天凌晨12点
  1123. date = Date.parse(new Date(date))/1000;//转换为时间戳
  1124. date += (86400) * num;//修改后的时间戳
  1125. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  1126. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  1127. }
  1128. </script>
  1129. <form id="form1">
  1130. <div style="padding-top: 20px; margin-right: 20px;">
  1131. <table class="form">
  1132. <tr>
  1133. <th class="formTitle">料品编码</th>
  1134. <td class="formValue">
  1135. <input id="InvCode" name="InvCode" type="text" class="form-control " disabled="disabled" />
  1136. <input id="Enable" name="Enable" type="text" style="display:none" disabled="disabled" />
  1137. </td>
  1138. </tr>
  1139. <tr>
  1140. <th class="formTitle">物料描述</th>
  1141. <td class="formValue">
  1142. <input id="INVNAME" name="INVNAME" type="text" class="form-control " disabled="disabled" />
  1143. </td>
  1144. </tr>
  1145. <tr>
  1146. <th class="formTitle">规格型号</th>
  1147. <td class="formValue">
  1148. <input id="INVSTD" name="INVSTD" type="text" class="form-control " disabled="disabled" />
  1149. </td>
  1150. </tr>
  1151. <tr>
  1152. <th class="formTitle">计量单位</th>
  1153. <td class="formValue">
  1154. <input id="INVUOM" name="INVUOM" type="text" class="form-control " disabled="disabled" />
  1155. </td>
  1156. </tr>
  1157. <tr>
  1158. <th class="formTitle">数量</th>
  1159. <td class="formValue">
  1160. <input id="Quantity" name="Quantity" type="text" class="form-control " disabled="disabled" />
  1161. <input id="YAmount" name="YAmount" type="text" style="display:none" disabled="disabled" />
  1162. <input id="DJQuantity" name="DJQuantity" type="text" style="display:none" disabled="disabled" />
  1163. </td>
  1164. </tr>
  1165. <tr>
  1166. <th class="formTitle">已生成条码数量</th>
  1167. <td class="formValue">
  1168. <input id="CreatedQty" name="CreatedQty" type="text" class="form-control " disabled="disabled" />
  1169. </td>
  1170. </tr>
  1171. <tr>
  1172. <th class="formTitle"><span style="color: red;">*</span>本次生成数量</th>
  1173. <td class="formValue">
  1174. <input id="thisCreateQty" name="thisCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" />
  1175. </td>
  1176. </tr>
  1177. <tr>
  1178. <th class="formTitle"><span style="color: red;">*</span>最小包装量</th>
  1179. <td class="formValue">
  1180. <input id="minPackQty" name="minPackQty" type="text" class="form-control required" placeholder="请输入最小包装量" />
  1181. </td>
  1182. </tr>
  1183. <tr>
  1184. <th class="formTitle"><span style="color: red;">*</span>生产日期</th>
  1185. <td class="formValue">
  1186. <input type="text" name="PRODUCTDATE" id="PRODUCTDATE" class="form-control required" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="生产日期" />
  1187. <input id="EffectiveEnable" name="EffectiveEnable" type="text" style="display:none" />
  1188. <input id="EffectiveDays" name="EffectiveDays" type="text" style="display:none" />
  1189. </td>
  1190. </tr>
  1191. <tr>
  1192. <th class="formTitle"><span style="color: red;">*</span>生成张数</th>
  1193. <td class="formValue">
  1194. <input id="cretePageCount" name="cretePageCount" class="form-control required" type="text" placeholder="请输入生成张数" />
  1195. </td>
  1196. </tr>
  1197. <tr>
  1198. <th class="formTitle">辅计量数量</th>
  1199. <td class="formValue">
  1200. <input id="Amount" name="Amount" class="form-control" type="text" placeholder="请输入辅计量数量" />
  1201. </td>
  1202. </tr>
  1203. @*sssss*@
  1204. <tr id="trProjectCode">
  1205. <th class="formTitle">销售凭证</th>
  1206. <td class="formValue">
  1207. @*<input id="ProjectCode" name="ProjectCode" class="form-control " type="text" placeholder="请输入项目号" />*@
  1208. <input id="ProjectCode" name="ProjectCode" class="form-control " type="text" disabled="disabled" />
  1209. </td>
  1210. </tr>
  1211. <tr id="trBatchCode">
  1212. <th class="formTitle">序列号</th>
  1213. <td class="formValue">
  1214. @*<input id="BatchCode" name="BatchCode" class="form-control " type="text" placeholder="请输入批次" />*@
  1215. <input id="BatchCode" name="BatchCode" class="form-control " type="text" disabled="disabled" />
  1216. </td>
  1217. </tr>
  1218. <tr id="trVersion">
  1219. <th class="formTitle">版本</th>
  1220. <td class="formValue">
  1221. <input id="Version" name="Version" class="form-control " type="text" placeholder="请输入版本" disabled="disabled" />
  1222. </td>
  1223. </tr>
  1224. <tr id="trBrand">
  1225. <th class="formTitle">销售凭证项号</th>
  1226. <td class="formValue">
  1227. @*<input id="Brand" name="Brand" type="text" class="form-control " placeholder="请输入厂牌" />*@
  1228. <input id="Brand" name="Brand" type="text" class="form-control " disabled="disabled" />
  1229. </td>
  1230. </tr>
  1231. <tr id="trcFree1">
  1232. <th class="formTitle">自由项1</th>
  1233. <td class="formValue">
  1234. <input id="cFree1" name="cFree1" type="text" class="form-control " placeholder="请输入自由项1" />
  1235. </td>
  1236. </tr>
  1237. <tr id="trcFree2">
  1238. <th class="formTitle">自由项2</th>
  1239. <td class="formValue">
  1240. <input id="cFree2" name="cFree2" type="text" class="form-control " placeholder="请输入自由项2" />
  1241. </td>
  1242. </tr>
  1243. <tr id="trcFree3">
  1244. <th class="formTitle">自由项3</th>
  1245. <td class="formValue">
  1246. <input id="cFree3" name="cFree3" type="text" class="form-control " placeholder="请输入自由项3" />
  1247. </td>
  1248. </tr>
  1249. <tr id="trcFree4">
  1250. <th class="formTitle">自由项4</th>
  1251. <td class="formValue">
  1252. <input id="cFree4" name="cFree4" type="text" class="form-control " placeholder="请输入自由项4" />
  1253. </td>
  1254. </tr>
  1255. <tr id="trcFree5">
  1256. <th class="formTitle">自由项5</th>
  1257. <td class="formValue">
  1258. <input id="cFree5" name="cFree5" type="text" class="form-control " placeholder="请输入自由项5" />
  1259. </td>
  1260. </tr>
  1261. <tr id="trcFree6">
  1262. <th class="formTitle">自由项6</th>
  1263. <td class="formValue">
  1264. <input id="cFree6" name="cFree6" type="text" class="form-control " placeholder="请输入自由项6" />
  1265. </td>
  1266. </tr>
  1267. <tr id="trcFree7">
  1268. <th class="formTitle">自由项7</th>
  1269. <td class="formValue">
  1270. <input id="cFree7" name="cFree7" type="text" class="form-control " placeholder="请输入自由项7" />
  1271. </td>
  1272. </tr>
  1273. <tr id="trcFree8">
  1274. <th class="formTitle">自由项8</th>
  1275. <td class="formValue">
  1276. <input id="cFree8" name="cFree8" type="text" class="form-control " placeholder="请输入自由项8" />
  1277. </td>
  1278. </tr>
  1279. <tr id="trcFree9">
  1280. <th class="formTitle">自由项9</th>
  1281. <td class="formValue">
  1282. <input id="cFree9" name="cFree9" type="text" class="form-control " placeholder="请输入自由项9" />
  1283. </td>
  1284. </tr>
  1285. <tr id="trcFree10">
  1286. <th class="formTitle">自由项10</th>
  1287. <td class="formValue">
  1288. <input id="cFree10" name="cFree10" type="text" class="form-control " placeholder="请输入自由项10" />
  1289. </td>
  1290. </tr>
  1291. </table>
  1292. </div>
  1293. </form>