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.

7590 lines
393 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  6. <script>
  7. debugger;
  8. var _Clos = new Array();
  9. var Type = $.request("Type");
  10. var mold = $.request("mold");
  11. var Name = "单据号";
  12. var ColModelMain = [];
  13. var ColModelSub = [];
  14. $(function () {
  15. SetCols();
  16. if (Type != '1') {
  17. $("#NF - Prints").css('display', 'none');
  18. $("#NF-btnInWareHouse").css('display', 'none');
  19. }
  20. if (Type != '13' && Type != '9') {
  21. $(".HideItems2").css('display', 'none');
  22. }
  23. if (Type != '23' ) {
  24. $(".HideItems4").css('display', 'none');
  25. }
  26. if (Type != '1' && Type != '12' && Type != '22' && Type != '23' && Type != '2' && Type != '3' && Type != '24'
  27. && Type != '203') {
  28. $(".HideItemsTime").css('display', 'none');
  29. }
  30. if (Type != '22' && Type != '23' && Type != '2' && Type != '3' && Type != '24' && Type != '203') {
  31. $(".HideWH").css('display', 'none');
  32. }
  33. if (Type != '3' && Type != '7' && Type != '8') {
  34. $(".selStatus").css('display', 'none');
  35. }
  36. if (Type != '3') {
  37. $(".HideClassGroup").css('display', 'none');
  38. }
  39. if (Type != '3' && Type != '4' && Type != '5' && Type != '7' && Type != '8' && Type != '22') {
  40. $(".HideItems3").css('display', 'none');
  41. }
  42. if (Type == '17') {
  43. Name = "条码号";
  44. $("#POCodeShowLable").text(Name);
  45. } else {
  46. $("#POCodeShowLable").text(Name);
  47. }
  48. if (Type!='3') {
  49. $("#GDLX").css('display', 'none');
  50. $("#GDLX2").css('display', 'none');
  51. $("#NF-Rebind").css('display', 'none');
  52. }
  53. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9' || Type == '17' ) {
  54. $(".HideItems").css('display', 'none');
  55. }
  56. if (Type == '1') {
  57. gridList();
  58. }
  59. if (Type == '2') {
  60. gridList2();
  61. }
  62. if (Type == '3') {
  63. $(".GDLX").css('display', 'block');
  64. Select_SelGDLX();
  65. gridList3();
  66. }
  67. if (Type == '4') {
  68. gridList4();
  69. }
  70. if (Type == '5') {
  71. gridList5();
  72. }
  73. if (Type == '6') {
  74. gridList6();
  75. }
  76. //审核到货单生成条码
  77. if (Type == '7') {
  78. gridList7();
  79. }
  80. //审核委外到货单生成条码
  81. if (Type == '8') {
  82. gridList8();
  83. }
  84. //开立成品入库单生成条码
  85. if (Type == '9') {
  86. gridList9();
  87. }
  88. //审核拒收单生成条码
  89. if (Type == '10') {
  90. gridList10();
  91. }
  92. //审核委外拒收单生成条码
  93. if (Type == '11') {
  94. gridList11();
  95. }
  96. //领料申请退料生成条码
  97. if (Type == '12') {
  98. gridList12();
  99. }
  100. //材料出库退料生成条码
  101. if (Type == '13') {
  102. gridList13();
  103. }
  104. //委外领料申请退料生成条码
  105. if (Type == '14') {
  106. gridList14();
  107. }
  108. //委外材料出库退料生成条码
  109. if (Type == '15') {
  110. gridList15();
  111. }
  112. //返工工单
  113. if (Type == '16') {
  114. gridList16();
  115. }
  116. //不合格条码入库
  117. if (Type == '17') {
  118. gridList17();
  119. }
  120. //副产品
  121. if (Type == '18') {
  122. gridList18();
  123. }
  124. //锐腾两步调入生成条码
  125. if (Type == '20') {
  126. gridList20();
  127. }
  128. //采购入库生成条码
  129. if (Type == '22') {
  130. gridList22();
  131. }
  132. //委外采购入库生成条码
  133. if (Type == '23') {
  134. gridList23();
  135. }
  136. //红字销售出库单
  137. if (Type == '24') {
  138. gridList24();
  139. }
  140. //线边仓调拨申请单生成条码(派纳)
  141. if (Type == '201') {
  142. gridList201();
  143. }
  144. //调拨申请单生成条码
  145. if (Type == '202') {
  146. gridList202();
  147. }
  148. if (Type == '203') {
  149. gridList203();
  150. }
  151. })
  152. function SetCols() {
  153. $.ajax({
  154. url: "/Print/SelectColumnName?" + Math.random(),
  155. dataType: "json",
  156. async: false,
  157. success: function (data) {
  158. var cols = new Array();
  159. var cols1 = new Array();
  160. if (Type == '1') {
  161. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  162. cols.push(collast);
  163. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  164. cols.push(collast);
  165. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  166. cols.push(collast);
  167. var collast = { label: '工单子件', name: 'SourceDetailID', hidden: true, };
  168. cols.push(collast);
  169. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  170. cols.push(collast);
  171. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  172. cols.push(collast);
  173. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  174. cols.push(collast);
  175. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  176. cols.push(collast);
  177. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  178. cols.push(collast);
  179. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  180. cols.push(collast);
  181. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  182. cols.push(collast);
  183. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  184. //cols.push(collast);
  185. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  186. cols.push(collast);
  187. var collast = { label: '工单号', name: 'MOCode', width: 60, align: 'left', };
  188. cols.push(collast);
  189. var collast = { label: '创建日期', name: 'MTIME', width: 60, align: 'left', };
  190. cols.push(collast);
  191. $.ajax({
  192. url: "/Print/SelectTableColumnName?" + Math.random(),
  193. dataType: "json",
  194. async: false,
  195. success: function (data) {
  196. if (data != null && data.length > 0) {
  197. DateList = data;
  198. for (var i = 0; i < data.length; i++) {
  199. var TableCode = data[i].TableCode;
  200. if (TableCode == "ICSMOPick") {
  201. var Code = data[i].Code;
  202. var Name = data[i].Name;
  203. var obj = new Array();
  204. obj = {
  205. label: Name,
  206. name: Code,
  207. width: 80,
  208. align: "left"
  209. }
  210. cols.push(obj);
  211. }
  212. if (TableCode == "ICSInventory") {
  213. var Code = data[i].Code;
  214. var Name = data[i].Name;
  215. var obj = new Array();
  216. obj = {
  217. label: Name,
  218. name: Code,
  219. width: 80,
  220. align: "left"
  221. }
  222. cols.push(obj);
  223. //cols1.push(obj);
  224. }
  225. }
  226. }
  227. _Clos = cols;
  228. //_Clos1 = cols1;
  229. }
  230. });
  231. }
  232. if (Type == '2') {
  233. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  234. cols.push(collast);
  235. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  236. cols.push(collast);
  237. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  238. cols.push(collast);
  239. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  240. cols.push(collast);
  241. var collast = { label: '供应商', name: 'VenName', width: 150, align: 'left' };
  242. cols.push(collast);
  243. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  244. cols.push(collast);
  245. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  246. cols.push(collast);
  247. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  248. cols.push(collast);
  249. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  250. cols.push(collast);
  251. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  252. cols.push(collast);
  253. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  254. cols.push(collast);
  255. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  256. cols.push(collast);
  257. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  258. //cols.push(collast);
  259. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  260. cols.push(collast);
  261. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  262. //cols.push(collast);
  263. $.ajax({
  264. url: "/Print/SelectTableColumnName?" + Math.random(),
  265. dataType: "json",
  266. async: false,
  267. success: function (data) {
  268. if (data != null && data.length > 0) {
  269. DateList = data;
  270. for (var i = 0; i < data.length; i++) {
  271. var TableCode = data[i].TableCode;
  272. if (TableCode == "ICSOApplyNegDetail") {
  273. var Code = data[i].Code;
  274. var Name = data[i].Name;
  275. var obj = new Array();
  276. obj = {
  277. label: Name,
  278. name: Code,
  279. width: 80,
  280. align: "left"
  281. }
  282. cols.push(obj);
  283. }
  284. if (TableCode == "ICSInventory") {
  285. var Code = data[i].Code;
  286. var Name = data[i].Name;
  287. var obj = new Array();
  288. obj = {
  289. label: Name,
  290. name: Code,
  291. width: 80,
  292. align: "left"
  293. }
  294. cols.push(obj);
  295. //cols1.push(obj);
  296. }
  297. }
  298. }
  299. _Clos = cols;
  300. //_Clos1 = cols1;
  301. }
  302. });
  303. }
  304. if (Type == '3') {
  305. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  306. cols.push(collast);
  307. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  308. cols.push(collast);
  309. var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
  310. cols.push(collast);
  311. var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true };
  312. cols.push(collast);
  313. var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
  314. cols.push(collast);
  315. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  316. cols.push(collast);
  317. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  318. cols.push(collast);
  319. var collast = { label: '客户料号', name: 'CustInvCode', width: 150, align: 'left', };
  320. cols.push(collast);
  321. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  322. cols.push(collast);
  323. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  324. cols.push(collast);
  325. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  326. cols.push(collast);
  327. var collast = { label: '仓库编码', name: 'WHCode', width: 150, align: 'left' };
  328. cols.push(collast);
  329. var collast = { label: '仓库名称', name: 'WHName', width: 150, align: 'left' };
  330. cols.push(collast);
  331. var collast = { label: '工单部门', name: 'DepName', width: 100, align: 'left' };
  332. cols.push(collast);
  333. var collast = { label: '工单创建日期', name: 'CreateDateTime', width: 60, align: 'left', };
  334. cols.push(collast);
  335. var collast = {
  336. label: "状态", name: "MOStatus", width: 60, align: "left",
  337. formatter: function (cellvalue) {
  338. if (cellvalue == "1") {
  339. return "初始";
  340. } else if (cellvalue == "2") {
  341. return "下发";
  342. }
  343. else if (cellvalue == "3") {
  344. return "关单";
  345. }
  346. else { return ""; }
  347. }
  348. };
  349. cols.push(collast);
  350. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  351. cols.push(collast);
  352. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  353. cols.push(collast);
  354. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  355. //cols.push(collast);
  356. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  357. cols.push(collast);
  358. var collast = { label: '已入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  359. cols.push(collast);
  360. var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' };
  361. cols.push(collast);
  362. var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' };
  363. cols.push(collast);
  364. $.ajax({
  365. url: "/Print/SelectTableColumnName?" + Math.random(),
  366. dataType: "json",
  367. async: false,
  368. success: function (data) {
  369. if (data != null && data.length > 0) {
  370. DateList = data;
  371. for (var i = 0; i < data.length; i++) {
  372. var TableCode = data[i].TableCode;
  373. if (TableCode == "ICSMO") {
  374. var Code = data[i].Code;
  375. var Name = data[i].Name;
  376. var obj = new Array();
  377. obj = {
  378. label: Name,
  379. name: Code,
  380. width: 80,
  381. align: "left"
  382. }
  383. cols.push(obj);
  384. }
  385. if (TableCode == "ICSInventory") {
  386. var Code = data[i].Code;
  387. var Name = data[i].Name;
  388. var obj = new Array();
  389. obj = {
  390. label: Name,
  391. name: Code,
  392. width: 80,
  393. align: "left"
  394. }
  395. cols.push(obj);
  396. //cols1.push(obj);
  397. }
  398. }
  399. }
  400. _Clos = cols;
  401. //_Clos1 = cols1;
  402. }
  403. });
  404. }
  405. if (Type == '4') {
  406. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  407. cols.push(collast);
  408. var collast = { label: '单据号', name: 'SDNCode', width: 120, align: 'left' };
  409. cols.push(collast);
  410. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  411. cols.push(collast);
  412. var collast = { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' };
  413. cols.push(collast);
  414. var collast = { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' };
  415. cols.push(collast);
  416. var collast = { label: '客户代码', name: 'CusCode', width: 120, align: 'left' };
  417. cols.push(collast);
  418. var collast = { label: '客户名称', name: 'CusName', width: 50, align: 'left' };
  419. cols.push(collast);
  420. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  421. cols.push(collast);
  422. var collast = { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' };
  423. cols.push(collast);
  424. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  425. cols.push(collast);
  426. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  427. cols.push(collast);
  428. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  429. cols.push(collast);
  430. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  431. cols.push(collast);
  432. var collast = {
  433. label: "状态", name: "Status", width: 60, align: "left",
  434. formatter: function (cellvalue) {
  435. if (cellvalue == "1") {
  436. return "开立";
  437. } else if (cellvalue == "2") {
  438. return "审核";
  439. }
  440. else if (cellvalue == "3") {
  441. return "关闭";
  442. }
  443. else { return ""; }
  444. }
  445. };
  446. cols.push(collast);
  447. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  448. cols.push(collast);
  449. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  450. cols.push(collast);
  451. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  452. //cols.push(collast);
  453. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  454. cols.push(collast);
  455. $.ajax({
  456. url: "/Print/SelectTableColumnName?" + Math.random(),
  457. dataType: "json",
  458. async: false,
  459. success: function (data) {
  460. if (data != null && data.length > 0) {
  461. DateList = data;
  462. for (var i = 0; i < data.length; i++) {
  463. var TableCode = data[i].TableCode;
  464. if (TableCode == "ICSSDN") {
  465. var Code = data[i].Code;
  466. var Name = data[i].Name;
  467. var obj = new Array();
  468. obj = {
  469. label: Name,
  470. name: Code,
  471. width: 80,
  472. align: "left"
  473. }
  474. cols.push(obj);
  475. }
  476. if (TableCode == "ICSInventory") {
  477. var Code = data[i].Code;
  478. var Name = data[i].Name;
  479. var obj = new Array();
  480. obj = {
  481. label: Name,
  482. name: Code,
  483. width: 80,
  484. align: "left"
  485. }
  486. cols.push(obj);
  487. //cols1.push(obj);
  488. }
  489. }
  490. }
  491. _Clos = cols;
  492. //_Clos1 = cols1;
  493. }
  494. });
  495. }
  496. if (Type == '5') {
  497. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  498. cols.push(collast);
  499. var collast = { label: '单据号', name: 'InCode', width: 120, align: 'left' };
  500. cols.push(collast);
  501. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  502. cols.push(collast);
  503. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  504. cols.push(collast);
  505. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  506. cols.push(collast);
  507. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  508. cols.push(collast);
  509. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  510. cols.push(collast);
  511. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  512. cols.push(collast);
  513. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  514. cols.push(collast);
  515. var collast = { label: '收益部门', name: 'EATTRIBUTE4', width: 50, align: 'left' };
  516. cols.push(collast);
  517. var collast = { label: '供应商', name: 'EATTRIBUTE3', width: 50, align: 'left' };
  518. cols.push(collast);
  519. var collast = { label: '项目名称', name: 'EATTRIBUTE8', width: 50, align: 'left' };
  520. cols.push(collast);
  521. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  522. cols.push(collast);
  523. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  524. cols.push(collast);
  525. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  526. cols.push(collast);
  527. var collast = { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', };
  528. cols.push(collast);
  529. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  530. cols.push(collast);
  531. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  532. cols.push(collast);
  533. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  534. //cols.push(collast);
  535. $.ajax({
  536. url: "/Print/SelectTableColumnName?" + Math.random(),
  537. dataType: "json",
  538. async: false,
  539. success: function (data) {
  540. if (data != null && data.length > 0) {
  541. DateList = data;
  542. for (var i = 0; i < data.length; i++) {
  543. var TableCode = data[i].TableCode;
  544. if (TableCode == "ICSOtherIn") {
  545. var Code = data[i].Code;
  546. var Name = data[i].Name;
  547. var obj = new Array();
  548. obj = {
  549. label: Name,
  550. name: Code,
  551. width: 80,
  552. align: "left"
  553. }
  554. cols.push(obj);
  555. }
  556. if (TableCode == "ICSInventory") {
  557. var Code = data[i].Code;
  558. var Name = data[i].Name;
  559. var obj = new Array();
  560. obj = {
  561. label: Name,
  562. name: Code,
  563. width: 80,
  564. align: "left"
  565. }
  566. cols.push(obj);
  567. //cols1.push(obj);
  568. }
  569. }
  570. }
  571. _Clos = cols;
  572. //_Clos1 = cols1;
  573. }
  574. });
  575. }
  576. if (Type == '6') {
  577. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  578. cols.push(collast);
  579. var collast = { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' };
  580. cols.push(collast);
  581. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  582. cols.push(collast);
  583. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  584. cols.push(collast);
  585. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  586. cols.push(collast);
  587. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  588. cols.push(collast);
  589. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  590. cols.push(collast);
  591. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  592. cols.push(collast);
  593. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  594. cols.push(collast);
  595. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  596. cols.push(collast);
  597. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  598. cols.push(collast);
  599. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  600. cols.push(collast);
  601. var collast = { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', };
  602. cols.push(collast);
  603. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  604. cols.push(collast);
  605. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  606. cols.push(collast);
  607. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  608. //cols.push(collast);
  609. $.ajax({
  610. url: "/Print/SelectTableColumnName?" + Math.random(),
  611. dataType: "json",
  612. async: false,
  613. success: function (data) {
  614. if (data != null && data.length > 0) {
  615. DateList = data;
  616. for (var i = 0; i < data.length; i++) {
  617. var TableCode = data[i].TableCode;
  618. if (TableCode == "ICSReturn") {
  619. var Code = data[i].Code;
  620. var Name = data[i].Name;
  621. var obj = new Array();
  622. obj = {
  623. label: Name,
  624. name: Code,
  625. width: 80,
  626. align: "left"
  627. }
  628. cols.push(obj);
  629. }
  630. if (TableCode == "ICSInventory") {
  631. var Code = data[i].Code;
  632. var Name = data[i].Name;
  633. var obj = new Array();
  634. obj = {
  635. label: Name,
  636. name: Code,
  637. width: 80,
  638. align: "left"
  639. }
  640. cols.push(obj);
  641. //cols1.push(obj);
  642. }
  643. }
  644. }
  645. _Clos = cols;
  646. //_Clos1 = cols1;
  647. }
  648. });
  649. }
  650. //审核到货单生成条码
  651. if (Type == '7') {
  652. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  653. cols.push(collast);
  654. var collast = { label: '单据号', name: 'DNCode', width: 120, align: 'left' };
  655. cols.push(collast);
  656. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  657. cols.push(collast);
  658. var collast = { label: '采购订单号', name: 'POCode', width: 50, align: 'left' };
  659. cols.push(collast);
  660. var collast = { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' };
  661. cols.push(collast);
  662. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  663. cols.push(collast);
  664. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  665. cols.push(collast);
  666. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  667. cols.push(collast);
  668. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  669. cols.push(collast);
  670. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  671. cols.push(collast);
  672. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  673. cols.push(collast);
  674. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  675. cols.push(collast);
  676. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  677. cols.push(collast);
  678. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  679. cols.push(collast);
  680. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  681. //cols.push(collast);
  682. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  683. cols.push(collast);
  684. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  685. cols.push(collast);
  686. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  687. cols.push(collast);
  688. var collast = { label: '未入库数量', name: 'NRCVQuantity', width: 60, align: 'left', };
  689. cols.push(collast);
  690. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  691. cols.push(collast);
  692. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  693. cols.push(collast);
  694. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  695. cols.push(collast);
  696. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  697. cols.push(collast);
  698. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  699. cols.push(collast);
  700. $.ajax({
  701. url: "/Print/SelectTableColumnName?" + Math.random(),
  702. dataType: "json",
  703. async: false,
  704. success: function (data) {
  705. if (data != null && data.length > 0) {
  706. DateList = data;
  707. for (var i = 0; i < data.length; i++) {
  708. var TableCode = data[i].TableCode;
  709. if (TableCode == "ICSDeliveryNotice") {
  710. debugger;
  711. var Code = data[i].Code;
  712. var Name = data[i].Name;
  713. var obj = new Array();
  714. obj = {
  715. label: Name,
  716. name: Code,
  717. width: 80,
  718. align: "left"
  719. }
  720. cols.push(obj);
  721. }
  722. if (TableCode == "ICSInventory") {
  723. var Code = data[i].Code;
  724. var Name = data[i].Name;
  725. var obj = new Array();
  726. obj = {
  727. label: Name,
  728. name: Code,
  729. width: 80,
  730. align: "left"
  731. }
  732. cols.push(obj);
  733. //cols1.push(obj);
  734. }
  735. }
  736. }
  737. _Clos = cols;
  738. //_Clos1 = cols1;
  739. }
  740. });
  741. }
  742. //审核委外到货单生成条码
  743. if (Type == '8') {
  744. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  745. cols.push(collast);
  746. var collast = { label: '单据号', name: 'ODNCode', width: 120, align: 'left' };
  747. cols.push(collast);
  748. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  749. cols.push(collast);
  750. var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  751. cols.push(collast);
  752. var collast = { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' };
  753. cols.push(collast);
  754. var collast = { label: '委外订单表体ID', name: 'OODetailID', hidden: true };
  755. cols.push(collast);
  756. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  757. cols.push(collast);
  758. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  759. cols.push(collast);
  760. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  761. cols.push(collast);
  762. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  763. cols.push(collast);
  764. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  765. cols.push(collast);
  766. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  767. cols.push(collast);
  768. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  769. cols.push(collast);
  770. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  771. cols.push(collast);
  772. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  773. cols.push(collast);
  774. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  775. //cols.push(collast);
  776. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  777. cols.push(collast);
  778. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  779. cols.push(collast);
  780. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  781. cols.push(collast);
  782. var collast = { label: '未入库数量', name: 'NRCVQuantity', width: 60, align: 'left', };
  783. cols.push(collast);
  784. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  785. cols.push(collast);
  786. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  787. cols.push(collast);
  788. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  789. cols.push(collast);
  790. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  791. cols.push(collast);
  792. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  793. cols.push(collast);
  794. $.ajax({
  795. url: "/Print/SelectTableColumnName?" + Math.random(),
  796. dataType: "json",
  797. async: false,
  798. success: function (data) {
  799. if (data != null && data.length > 0) {
  800. DateList = data;
  801. for (var i = 0; i < data.length; i++) {
  802. var TableCode = data[i].TableCode;
  803. if (TableCode == "ICSODeliveryNotice") {
  804. var Code = data[i].Code;
  805. var Name = data[i].Name;
  806. var obj = new Array();
  807. obj = {
  808. label: Name,
  809. name: Code,
  810. width: 80,
  811. align: "left"
  812. }
  813. cols.push(obj);
  814. }
  815. if (TableCode == "ICSInventory") {
  816. var Code = data[i].Code;
  817. var Name = data[i].Name;
  818. var obj = new Array();
  819. obj = {
  820. label: Name,
  821. name: Code,
  822. width: 80,
  823. align: "left"
  824. }
  825. cols.push(obj);
  826. //cols1.push(obj);
  827. }
  828. }
  829. }
  830. _Clos = cols;
  831. //_Clos1 = cols1;
  832. }
  833. });
  834. }
  835. //开立成品入库单生成条码
  836. if (Type == '9') {
  837. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  838. cols.push(collast);
  839. var collast = { label: '单据号', name: 'RCVCode', width: 120, align: 'left' };
  840. cols.push(collast);
  841. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  842. cols.push(collast);
  843. var collast = { label: '源头单据号', name: 'MOCode', width: 50, align: 'left' };
  844. cols.push(collast);
  845. var collast = { label: '仓库号', name: 'WHCode', width: 120, align: 'left' };
  846. cols.push(collast);
  847. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  848. cols.push(collast);
  849. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  850. cols.push(collast);
  851. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  852. cols.push(collast);
  853. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  854. cols.push(collast);
  855. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  856. cols.push(collast);
  857. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  858. cols.push(collast);
  859. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  860. //cols.push(collast);
  861. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  862. cols.push(collast);
  863. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  864. cols.push(collast);
  865. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  866. cols.push(collast);
  867. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  868. cols.push(collast);
  869. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  870. cols.push(collast);
  871. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  872. cols.push(collast);
  873. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  874. cols.push(collast);
  875. $.ajax({
  876. url: "/Print/SelectTableColumnName?" + Math.random(),
  877. dataType: "json",
  878. async: false,
  879. success: function (data) {
  880. if (data != null && data.length > 0) {
  881. DateList = data;
  882. for (var i = 0; i < data.length; i++) {
  883. var TableCode = data[i].TableCode;
  884. if (TableCode == "ICSMO") {
  885. var Code = data[i].Code;
  886. var Name = data[i].Name;
  887. var obj = new Array();
  888. obj = {
  889. label: Name,
  890. name: Code,
  891. width: 80,
  892. align: "left"
  893. }
  894. cols.push(obj);
  895. }
  896. if (TableCode == "ICSInventory") {
  897. var Code = data[i].Code;
  898. var Name = data[i].Name;
  899. var obj = new Array();
  900. obj = {
  901. label: Name,
  902. name: Code,
  903. width: 80,
  904. align: "left"
  905. }
  906. cols.push(obj);
  907. //cols1.push(obj);
  908. }
  909. }
  910. }
  911. _Clos = cols;
  912. //_Clos1 = cols1;
  913. }
  914. });
  915. }
  916. //审核拒收单生成条码
  917. if (Type == '10') {
  918. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  919. cols.push(collast);
  920. var collast = { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' };
  921. cols.push(collast);
  922. var collast = { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' };
  923. cols.push(collast);
  924. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  925. cols.push(collast);
  926. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  927. cols.push(collast);
  928. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  929. cols.push(collast);
  930. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  931. cols.push(collast);
  932. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  933. cols.push(collast);
  934. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  935. cols.push(collast);
  936. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  937. cols.push(collast);
  938. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  939. cols.push(collast);
  940. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  941. cols.push(collast);
  942. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  943. cols.push(collast);
  944. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  945. cols.push(collast);
  946. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  947. cols.push(collast);
  948. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  949. cols.push(collast);
  950. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  951. cols.push(collast);
  952. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  953. cols.push(collast);
  954. $.ajax({
  955. url: "/Print/SelectTableColumnName?" + Math.random(),
  956. dataType: "json",
  957. async: false,
  958. success: function (data) {
  959. if (data != null && data.length > 0) {
  960. DateList = data;
  961. for (var i = 0; i < data.length; i++) {
  962. var TableCode = data[i].TableCode;
  963. if (TableCode == "ICSDeliveryNotice") {
  964. var Code = data[i].Code;
  965. var Name = data[i].Name;
  966. var obj = new Array();
  967. obj = {
  968. label: Name,
  969. name: Code,
  970. width: 80,
  971. align: "left"
  972. }
  973. cols.push(obj);
  974. }
  975. if (TableCode == "ICSInventory") {
  976. var Code = data[i].Code;
  977. var Name = data[i].Name;
  978. var obj = new Array();
  979. obj = {
  980. label: Name,
  981. name: Code,
  982. width: 80,
  983. align: "left"
  984. }
  985. cols.push(obj);
  986. //cols1.push(obj);
  987. }
  988. }
  989. }
  990. _Clos = cols;
  991. //_Clos1 = cols1;
  992. }
  993. });
  994. }
  995. //审核委外拒收单生成条码
  996. if (Type == '11') {
  997. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  998. cols.push(collast);
  999. var collast = { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' };
  1000. cols.push(collast);
  1001. var collast = { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' };
  1002. cols.push(collast);
  1003. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  1004. cols.push(collast);
  1005. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  1006. cols.push(collast);
  1007. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1008. cols.push(collast);
  1009. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  1010. cols.push(collast);
  1011. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  1012. cols.push(collast);
  1013. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  1014. cols.push(collast);
  1015. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  1016. cols.push(collast);
  1017. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1018. cols.push(collast);
  1019. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1020. cols.push(collast);
  1021. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  1022. cols.push(collast);
  1023. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1024. cols.push(collast);
  1025. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  1026. cols.push(collast);
  1027. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  1028. cols.push(collast);
  1029. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  1030. cols.push(collast);
  1031. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  1032. cols.push(collast);
  1033. $.ajax({
  1034. url: "/Print/SelectTableColumnName?" + Math.random(),
  1035. dataType: "json",
  1036. async: false,
  1037. success: function (data) {
  1038. if (data != null && data.length > 0) {
  1039. DateList = data;
  1040. for (var i = 0; i < data.length; i++) {
  1041. var TableCode = data[i].TableCode;
  1042. if (TableCode == "ICSODeliveryNotice") {
  1043. var Code = data[i].Code;
  1044. var Name = data[i].Name;
  1045. var obj = new Array();
  1046. obj = {
  1047. label: Name,
  1048. name: Code,
  1049. width: 80,
  1050. align: "left"
  1051. }
  1052. cols.push(obj);
  1053. }
  1054. if (TableCode == "ICSInventory") {
  1055. var Code = data[i].Code;
  1056. var Name = data[i].Name;
  1057. var obj = new Array();
  1058. obj = {
  1059. label: Name,
  1060. name: Code,
  1061. width: 80,
  1062. align: "left"
  1063. }
  1064. cols.push(obj);
  1065. //cols1.push(obj);
  1066. }
  1067. }
  1068. }
  1069. _Clos = cols;
  1070. //_Clos1 = cols1;
  1071. }
  1072. });
  1073. }
  1074. //领料申请退料生成条码
  1075. if (Type == '12') {
  1076. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1077. cols.push(collast);
  1078. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  1079. cols.push(collast);
  1080. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1081. cols.push(collast);
  1082. var collast = { label: '来源单据号', name: 'SourceCodea', width: 120, align: 'left' };
  1083. cols.push(collast);
  1084. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  1085. cols.push(collast);
  1086. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1087. cols.push(collast);
  1088. var collast = { label: '料品编码', name: 'InvName', width: 150, align: 'left', };
  1089. cols.push(collast);
  1090. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1091. cols.push(collast);
  1092. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1093. cols.push(collast);
  1094. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1095. cols.push(collast);
  1096. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1097. cols.push(collast);
  1098. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1099. cols.push(collast);
  1100. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1101. //cols.push(collast);
  1102. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1103. cols.push(collast);
  1104. $.ajax({
  1105. url: "/Print/SelectTableColumnName?" + Math.random(),
  1106. dataType: "json",
  1107. async: false,
  1108. success: function (data) {
  1109. if (data != null && data.length > 0) {
  1110. DateList = data;
  1111. for (var i = 0; i < data.length; i++) {
  1112. var TableCode = data[i].TableCode;
  1113. if (TableCode == "ICSMOApplyNegDetail") {
  1114. var Code = data[i].Code;
  1115. var Name = data[i].Name;
  1116. var obj = new Array();
  1117. obj = {
  1118. label: Name,
  1119. name: Code,
  1120. width: 80,
  1121. align: "left"
  1122. }
  1123. cols.push(obj);
  1124. }
  1125. if (TableCode == "ICSInventory") {
  1126. var Code = data[i].Code;
  1127. var Name = data[i].Name;
  1128. var obj = new Array();
  1129. obj = {
  1130. label: Name,
  1131. name: Code,
  1132. width: 80,
  1133. align: "left"
  1134. }
  1135. cols.push(obj);
  1136. //cols1.push(obj);
  1137. }
  1138. }
  1139. }
  1140. _Clos = cols;
  1141. //_Clos1 = cols1;
  1142. }
  1143. });
  1144. }
  1145. //材料出库退料生成条码
  1146. if (Type == '13') {
  1147. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1148. cols.push(collast);
  1149. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  1150. cols.push(collast);
  1151. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1152. cols.push(collast);
  1153. var collast = { label: '源头单据号', name: 'SCode', width: 120, align: 'left' };
  1154. cols.push(collast);
  1155. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  1156. cols.push(collast);
  1157. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1158. cols.push(collast);
  1159. var collast = { label: '料品编码', name: 'InvName', width: 150, align: 'left', };
  1160. cols.push(collast);
  1161. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1162. cols.push(collast);
  1163. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1164. cols.push(collast);
  1165. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1166. cols.push(collast);
  1167. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1168. cols.push(collast);
  1169. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1170. cols.push(collast);
  1171. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1172. //cols.push(collast);
  1173. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1174. cols.push(collast);
  1175. }
  1176. //委外领料申请退料生成条码
  1177. if (Type == '14') {
  1178. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1179. cols.push(collast);
  1180. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1181. cols.push(collast);
  1182. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1183. cols.push(collast);
  1184. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1185. cols.push(collast);
  1186. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1187. cols.push(collast);
  1188. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1189. cols.push(collast);
  1190. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1191. cols.push(collast);
  1192. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1193. cols.push(collast);
  1194. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1195. cols.push(collast);
  1196. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1197. cols.push(collast);
  1198. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1199. cols.push(collast);
  1200. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1201. //cols.push(collast);
  1202. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1203. cols.push(collast);
  1204. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1205. //cols.push(collast);
  1206. $.ajax({
  1207. url: "/Print/SelectTableColumnName?" + Math.random(),
  1208. dataType: "json",
  1209. async: false,
  1210. success: function (data) {
  1211. if (data != null && data.length > 0) {
  1212. DateList = data;
  1213. for (var i = 0; i < data.length; i++) {
  1214. var TableCode = data[i].TableCode;
  1215. if (TableCode == "ICSOApplyNegDetail") {
  1216. var Code = data[i].Code;
  1217. var Name = data[i].Name;
  1218. var obj = new Array();
  1219. obj = {
  1220. label: Name,
  1221. name: Code,
  1222. width: 80,
  1223. align: "left"
  1224. }
  1225. cols.push(obj);
  1226. }
  1227. if (TableCode == "ICSInventory") {
  1228. var Code = data[i].Code;
  1229. var Name = data[i].Name;
  1230. var obj = new Array();
  1231. obj = {
  1232. label: Name,
  1233. name: Code,
  1234. width: 80,
  1235. align: "left"
  1236. }
  1237. cols.push(obj);
  1238. //cols1.push(obj);
  1239. }
  1240. }
  1241. }
  1242. _Clos = cols;
  1243. //_Clos1 = cols1;
  1244. }
  1245. });
  1246. }
  1247. //委外材料出库退料生成条码
  1248. if (Type == '15') {
  1249. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1250. cols.push(collast);
  1251. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1252. cols.push(collast);
  1253. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1254. cols.push(collast);
  1255. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1256. cols.push(collast);
  1257. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1258. cols.push(collast);
  1259. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1260. cols.push(collast);
  1261. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1262. cols.push(collast);
  1263. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1264. cols.push(collast);
  1265. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1266. cols.push(collast);
  1267. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1268. cols.push(collast);
  1269. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1270. cols.push(collast);
  1271. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1272. //cols.push(collast);
  1273. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1274. cols.push(collast);
  1275. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1276. //cols.push(collast);
  1277. $.ajax({
  1278. url: "/Print/SelectTableColumnName?" + Math.random(),
  1279. dataType: "json",
  1280. async: false,
  1281. success: function (data) {
  1282. if (data != null && data.length > 0) {
  1283. DateList = data;
  1284. for (var i = 0; i < data.length; i++) {
  1285. var TableCode = data[i].TableCode;
  1286. if (TableCode == "ICSOApplyNegDetail") {
  1287. var Code = data[i].Code;
  1288. var Name = data[i].Name;
  1289. var obj = new Array();
  1290. obj = {
  1291. label: Name,
  1292. name: Code,
  1293. width: 80,
  1294. align: "left"
  1295. }
  1296. cols.push(obj);
  1297. }
  1298. if (TableCode == "ICSInventory") {
  1299. var Code = data[i].Code;
  1300. var Name = data[i].Name;
  1301. var obj = new Array();
  1302. obj = {
  1303. label: Name,
  1304. name: Code,
  1305. width: 80,
  1306. align: "left"
  1307. }
  1308. cols.push(obj);
  1309. //cols1.push(obj);
  1310. }
  1311. }
  1312. }
  1313. _Clos = cols;
  1314. //_Clos1 = cols1;
  1315. }
  1316. });
  1317. }
  1318. //返工工单生成条码
  1319. if (Type == '16') {
  1320. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1321. cols.push(collast);
  1322. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1323. cols.push(collast);
  1324. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1325. cols.push(collast);
  1326. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1327. cols.push(collast);
  1328. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1329. cols.push(collast);
  1330. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1331. cols.push(collast);
  1332. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1333. cols.push(collast);
  1334. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1335. cols.push(collast);
  1336. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1337. cols.push(collast);
  1338. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1339. cols.push(collast);
  1340. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1341. cols.push(collast);
  1342. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1343. //cols.push(collast);
  1344. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1345. cols.push(collast);
  1346. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1347. //cols.push(collast);
  1348. $.ajax({
  1349. url: "/Print/SelectTableColumnName?" + Math.random(),
  1350. dataType: "json",
  1351. async: false,
  1352. success: function (data) {
  1353. if (data != null && data.length > 0) {
  1354. DateList = data;
  1355. for (var i = 0; i < data.length; i++) {
  1356. var TableCode = data[i].TableCode;
  1357. if (TableCode == "ICSMOPick") {
  1358. var Code = data[i].Code;
  1359. var Name = data[i].Name;
  1360. var obj = new Array();
  1361. obj = {
  1362. label: Name,
  1363. name: Code,
  1364. width: 80,
  1365. align: "left"
  1366. }
  1367. cols.push(obj);
  1368. }
  1369. if (TableCode == "ICSInventory") {
  1370. var Code = data[i].Code;
  1371. var Name = data[i].Name;
  1372. var obj = new Array();
  1373. obj = {
  1374. label: Name,
  1375. name: Code,
  1376. width: 80,
  1377. align: "left"
  1378. }
  1379. cols.push(obj);
  1380. //cols1.push(obj);
  1381. }
  1382. }
  1383. }
  1384. _Clos = cols;
  1385. //_Clos1 = cols1;
  1386. }
  1387. });
  1388. }
  1389. //不合格条码生成条码
  1390. if (Type == '17') {
  1391. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1392. cols.push(collast);
  1393. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  1394. cols.push(collast);
  1395. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1396. cols.push(collast);
  1397. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1398. cols.push(collast);
  1399. var collast = { label: '不合格数量', name: 'Quantity', width: 100, align: 'left' };
  1400. cols.push(collast);
  1401. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1402. cols.push(collast);
  1403. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1404. cols.push(collast);
  1405. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1406. cols.push(collast);
  1407. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1408. //cols.push(collast);
  1409. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1410. cols.push(collast);
  1411. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1412. //cols.push(collast);
  1413. $.ajax({
  1414. url: "/Print/SelectTableColumnName?" + Math.random(),
  1415. dataType: "json",
  1416. async: false,
  1417. success: function (data) {
  1418. if (data != null && data.length > 0) {
  1419. DateList = data;
  1420. for (var i = 0; i < data.length; i++) {
  1421. var TableCode = data[i].TableCode;
  1422. if (TableCode == "ICSInspection") {
  1423. var Code = data[i].Code;
  1424. var Name = data[i].Name;
  1425. var obj = new Array();
  1426. obj = {
  1427. label: Name,
  1428. name: Code,
  1429. width: 80,
  1430. align: "left"
  1431. }
  1432. cols.push(obj);
  1433. }
  1434. if (TableCode == "ICSInventory") {
  1435. var Code = data[i].Code;
  1436. var Name = data[i].Name;
  1437. var obj = new Array();
  1438. obj = {
  1439. label: Name,
  1440. name: Code,
  1441. width: 80,
  1442. align: "left"
  1443. }
  1444. cols.push(obj);
  1445. //cols1.push(obj);
  1446. }
  1447. }
  1448. }
  1449. _Clos = cols;
  1450. //_Clos1 = cols1;
  1451. }
  1452. });
  1453. }
  1454. //副产品生成条码
  1455. if (Type == '18') {
  1456. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1457. cols.push(collast);
  1458. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1459. cols.push(collast);
  1460. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1461. cols.push(collast);
  1462. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1463. cols.push(collast);
  1464. var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 120, align: 'left' };
  1465. cols.push(collast);
  1466. var collast = { label: '料品编码(母)', name: 'MInvCode', width: 120, align: 'left' };
  1467. cols.push(collast);
  1468. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1469. cols.push(collast);
  1470. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1471. cols.push(collast);
  1472. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1473. cols.push(collast);
  1474. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1475. cols.push(collast);
  1476. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1477. cols.push(collast);
  1478. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1479. cols.push(collast);
  1480. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1481. //cols.push(collast);
  1482. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1483. cols.push(collast);
  1484. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1485. //cols.push(collast);
  1486. $.ajax({
  1487. url: "/Print/SelectTableColumnName?" + Math.random(),
  1488. dataType: "json",
  1489. async: false,
  1490. success: function (data) {
  1491. if (data != null && data.length > 0) {
  1492. DateList = data;
  1493. for (var i = 0; i < data.length; i++) {
  1494. var TableCode = data[i].TableCode;
  1495. if (TableCode == "ICSMOPick") {
  1496. var Code = data[i].Code;
  1497. var Name = data[i].Name;
  1498. var obj = new Array();
  1499. obj = {
  1500. label: Name,
  1501. name: Code,
  1502. width: 80,
  1503. align: "left"
  1504. }
  1505. cols.push(obj);
  1506. }
  1507. if (TableCode == "ICSInventory") {
  1508. var Code = data[i].Code;
  1509. var Name = data[i].Name;
  1510. var obj = new Array();
  1511. obj = {
  1512. label: Name,
  1513. name: Code,
  1514. width: 80,
  1515. align: "left"
  1516. }
  1517. cols.push(obj);
  1518. //cols1.push(obj);
  1519. }
  1520. }
  1521. }
  1522. _Clos = cols;
  1523. //_Clos1 = cols1;
  1524. }
  1525. });
  1526. }
  1527. //锐腾两步调入生成条码
  1528. if (Type == '20') {
  1529. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1530. cols.push(collast);
  1531. var collast = { label: '调拨单号', name: 'TransferNO', width: 120, align: 'left' };
  1532. cols.push(collast);
  1533. var collast = { label: '调拨单行号', name: 'Sequence', width: 50, align: 'left' };
  1534. cols.push(collast);
  1535. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1536. cols.push(collast);
  1537. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1538. cols.push(collast);
  1539. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1540. cols.push(collast);
  1541. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1542. cols.push(collast);
  1543. var collast = { label: '已调入数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1544. cols.push(collast);
  1545. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1546. cols.push(collast);
  1547. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1548. cols.push(collast);
  1549. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1550. //cols.push(collast);
  1551. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1552. cols.push(collast);
  1553. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1554. //cols.push(collast);
  1555. $.ajax({
  1556. url: "/Print/SelectTableColumnName?" + Math.random(),
  1557. dataType: "json",
  1558. async: false,
  1559. success: function (data) {
  1560. if (data != null && data.length > 0) {
  1561. DateList = data;
  1562. for (var i = 0; i < data.length; i++) {
  1563. var TableCode = data[i].TableCode;
  1564. if (TableCode == "ICSMOPick") {
  1565. var Code = data[i].Code;
  1566. var Name = data[i].Name;
  1567. var obj = new Array();
  1568. obj = {
  1569. label: Name,
  1570. name: Code,
  1571. width: 80,
  1572. align: "left"
  1573. }
  1574. cols.push(obj);
  1575. }
  1576. if (TableCode == "ICSInventory") {
  1577. var Code = data[i].Code;
  1578. var Name = data[i].Name;
  1579. var obj = new Array();
  1580. obj = {
  1581. label: Name,
  1582. name: Code,
  1583. width: 80,
  1584. align: "left"
  1585. }
  1586. cols.push(obj);
  1587. //cols1.push(obj);
  1588. }
  1589. }
  1590. }
  1591. _Clos = cols;
  1592. //_Clos1 = cols1;
  1593. }
  1594. });
  1595. }
  1596. //采购入库生成条码
  1597. if (Type == '22') {
  1598. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1599. cols.push(collast);
  1600. var collast = { label: '入库单号', name: 'RCVCode', width: 120, align: 'left' };
  1601. cols.push(collast);
  1602. var collast = { label: '入库单行号', name: 'Sequence', width: 50, align: 'left' };
  1603. cols.push(collast);
  1604. var collast = { label: '采购订单号', name: 'SourceCode', width: 50, align: 'left' };
  1605. cols.push(collast);
  1606. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1607. cols.push(collast);
  1608. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1609. cols.push(collast);
  1610. var collast = { label: '规格型号', name: 'InvStd', width: 150, align: 'left', };
  1611. cols.push(collast);
  1612. var collast = { label: '厂商料号', name: 'ManufacturerInvCode', width: 150, align: 'left', };
  1613. cols.push(collast);
  1614. var collast = { label: '供应商', name: 'EATTRIBUTE3', width: 150, align: 'left', };
  1615. cols.push(collast);
  1616. var collast = { label: '采购员', name: 'F_RealName', width: 150, align: 'left', };
  1617. cols.push(collast);
  1618. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1619. cols.push(collast);
  1620. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1621. cols.push(collast);
  1622. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1623. cols.push(collast);
  1624. var collast = { label: '已入数量', name: 'RCVQuantity', width: 100, align: 'left' };
  1625. cols.push(collast);
  1626. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1627. //cols.push(collast);
  1628. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1629. cols.push(collast);
  1630. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1631. //cols.push(collast);
  1632. $.ajax({
  1633. url: "/Print/SelectTableColumnName?" + Math.random(),
  1634. dataType: "json",
  1635. async: false,
  1636. success: function (data) {
  1637. if (data != null && data.length > 0) {
  1638. DateList = data;
  1639. for (var i = 0; i < data.length; i++) {
  1640. var TableCode = data[i].TableCode;
  1641. if (TableCode == "ICSPurchaseReceive") {
  1642. var Code = data[i].Code;
  1643. var Name = data[i].Name;
  1644. var obj = new Array();
  1645. obj = {
  1646. label: Name,
  1647. name: Code,
  1648. width: 80,
  1649. align: "left"
  1650. }
  1651. cols.push(obj);
  1652. }
  1653. if (TableCode == "ICSInventory") {
  1654. var Code = data[i].Code;
  1655. var Name = data[i].Name;
  1656. var obj = new Array();
  1657. obj = {
  1658. label: Name,
  1659. name: Code,
  1660. width: 80,
  1661. align: "left"
  1662. }
  1663. cols.push(obj);
  1664. //cols1.push(obj);
  1665. }
  1666. }
  1667. }
  1668. _Clos = cols;
  1669. //_Clos1 = cols1;
  1670. }
  1671. });
  1672. }
  1673. //采购入库生成条码
  1674. if (Type == '23') {
  1675. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1676. cols.push(collast);
  1677. var collast = { label: '委外入库单号', name: 'RCVCode', width: 120, align: 'left' };
  1678. cols.push(collast);
  1679. var collast = { label: '委外入库单行号', name: 'Sequence', width: 50, align: 'left' };
  1680. cols.push(collast);
  1681. var collast = { label: '采购单号', name: 'OOCode', width: 120, align: 'left' };
  1682. cols.push(collast);
  1683. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1684. cols.push(collast);
  1685. var collast = { label: '供应商', name: 'VenName', width: 150, align: 'left', };
  1686. cols.push(collast);
  1687. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1688. cols.push(collast);
  1689. var collast = { label: '规格型号', name: 'InvStd', width: 150, align: 'left', };
  1690. cols.push(collast);
  1691. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1692. cols.push(collast);
  1693. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1694. cols.push(collast);
  1695. var collast = { label: '已入数量', name: 'RCVQuantity', width: 100, align: 'left' };
  1696. cols.push(collast);
  1697. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1698. //cols.push(collast);
  1699. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1700. cols.push(collast);
  1701. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1702. //cols.push(collast);
  1703. $.ajax({
  1704. url: "/Print/SelectTableColumnName?" + Math.random(),
  1705. dataType: "json",
  1706. async: false,
  1707. success: function (data) {
  1708. if (data != null && data.length > 0) {
  1709. DateList = data;
  1710. for (var i = 0; i < data.length; i++) {
  1711. var TableCode = data[i].TableCode;
  1712. if (TableCode == "ICSOutsourcingReceive") {
  1713. var Code = data[i].Code;
  1714. var Name = data[i].Name;
  1715. var obj = new Array();
  1716. obj = {
  1717. label: Name,
  1718. name: Code,
  1719. width: 80,
  1720. align: "left"
  1721. }
  1722. cols.push(obj);
  1723. }
  1724. if (TableCode == "ICSInventory") {
  1725. var Code = data[i].Code;
  1726. var Name = data[i].Name;
  1727. var obj = new Array();
  1728. obj = {
  1729. label: Name,
  1730. name: Code,
  1731. width: 80,
  1732. align: "left"
  1733. }
  1734. cols.push(obj);
  1735. //cols1.push(obj);
  1736. }
  1737. }
  1738. }
  1739. _Clos = cols;
  1740. //_Clos1 = cols1;
  1741. }
  1742. });
  1743. }
  1744. //红字销售单出库生成条码
  1745. if (Type == '24') {
  1746. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1747. cols.push(collast);
  1748. var collast = { label: '单据号', name: 'SSDCode', width: 120, align: 'left' };
  1749. cols.push(collast);
  1750. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  1751. cols.push(collast);
  1752. var collast = { label: '客户编码', name: 'CusCode', width: 120, align: 'left' };
  1753. cols.push(collast);
  1754. var collast = { label: '客户名称', name: 'CusName', width: 120, align: 'left' };
  1755. cols.push(collast);
  1756. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1757. cols.push(collast);
  1758. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  1759. cols.push(collast);
  1760. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  1761. cols.push(collast);
  1762. var collast = { label: '退货日期', name: 'CreateDateTime', width: 150, align: 'left' };
  1763. cols.push(collast);
  1764. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  1765. cols.push(collast);
  1766. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  1767. cols.push(collast);
  1768. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  1769. cols.push(collast);
  1770. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  1771. cols.push(collast);
  1772. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1773. cols.push(collast);
  1774. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1775. cols.push(collast);
  1776. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1777. //cols.push(collast);
  1778. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  1779. cols.push(collast);
  1780. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1781. cols.push(collast);
  1782. var collast = { label: '入库数量', name: 'SSDQuantity', width: 60, align: 'left', };
  1783. cols.push(collast);
  1784. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  1785. cols.push(collast);
  1786. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  1787. cols.push(collast);
  1788. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  1789. cols.push(collast);
  1790. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  1791. cols.push(collast);
  1792. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  1793. cols.push(collast);
  1794. $.ajax({
  1795. url: "/Print/SelectTableColumnName?" + Math.random(),
  1796. dataType: "json",
  1797. async: false,
  1798. success: function (data) {
  1799. if (data != null && data.length > 0) {
  1800. DateList = data;
  1801. for (var i = 0; i < data.length; i++) {
  1802. var TableCode = data[i].TableCode;
  1803. if (TableCode == "ICSSSD") {
  1804. debugger;
  1805. var Code = data[i].Code;
  1806. var Name = data[i].Name;
  1807. var obj = new Array();
  1808. obj = {
  1809. label: Name,
  1810. name: Code,
  1811. width: 80,
  1812. align: "left"
  1813. }
  1814. cols.push(obj);
  1815. }
  1816. if (TableCode == "ICSInventory") {
  1817. var Code = data[i].Code;
  1818. var Name = data[i].Name;
  1819. var obj = new Array();
  1820. obj = {
  1821. label: Name,
  1822. name: Code,
  1823. width: 80,
  1824. align: "left"
  1825. }
  1826. cols.push(obj);
  1827. //cols1.push(obj);
  1828. }
  1829. }
  1830. }
  1831. _Clos = cols;
  1832. //_Clos1 = cols1;
  1833. }
  1834. });
  1835. }
  1836. //派纳线边仓调拨申请单生成条码
  1837. if (Type == '201') {
  1838. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1839. cols.push(collast);
  1840. var collast = { label: '单据号', name: 'TransferNO', width: 120, align: 'left' };
  1841. cols.push(collast);
  1842. var collast = { label: '单据行号', name: 'Sequence', width: 50, align: 'left' };
  1843. cols.push(collast);
  1844. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1845. cols.push(collast);
  1846. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1847. cols.push(collast);
  1848. var collast = { label: '调出仓库', name: 'FromWHName', width: 100, align: 'left', };
  1849. cols.push(collast);
  1850. var collast = { label: '调入仓库', name: 'ToWHName', width: 100, align: 'left', };
  1851. cols.push(collast);
  1852. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1853. cols.push(collast);
  1854. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1855. cols.push(collast);
  1856. var collast = { label: '已调数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1857. cols.push(collast);
  1858. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1859. //cols.push(collast);
  1860. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1861. cols.push(collast);
  1862. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1863. //cols.push(collast);
  1864. $.ajax({
  1865. url: "/Print/SelectTableColumnName?" + Math.random(),
  1866. dataType: "json",
  1867. async: false,
  1868. success: function (data) {
  1869. if (data != null && data.length > 0) {
  1870. DateList = data;
  1871. for (var i = 0; i < data.length; i++) {
  1872. var TableCode = data[i].TableCode;
  1873. if (TableCode == "ICSTransferApplication") {
  1874. var Code = data[i].Code;
  1875. var Name = data[i].Name;
  1876. var obj = new Array();
  1877. obj = {
  1878. label: Name,
  1879. name: Code,
  1880. width: 80,
  1881. align: "left"
  1882. }
  1883. cols.push(obj);
  1884. }
  1885. if (TableCode == "ICSInventory") {
  1886. var Code = data[i].Code;
  1887. var Name = data[i].Name;
  1888. var obj = new Array();
  1889. obj = {
  1890. label: Name,
  1891. name: Code,
  1892. width: 80,
  1893. align: "left"
  1894. }
  1895. cols.push(obj);
  1896. //cols1.push(obj);
  1897. }
  1898. }
  1899. }
  1900. _Clos = cols;
  1901. //_Clos1 = cols1;
  1902. }
  1903. });
  1904. }
  1905. //调拨申请单生成条码
  1906. if (Type == '202') {
  1907. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1908. cols.push(collast);
  1909. var collast = { label: '单据号', name: 'TransferNO', width: 120, align: 'left' };
  1910. cols.push(collast);
  1911. var collast = { label: '单据行号', name: 'Sequence', width: 50, align: 'left' };
  1912. cols.push(collast);
  1913. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1914. cols.push(collast);
  1915. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1916. cols.push(collast);
  1917. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1918. cols.push(collast);
  1919. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1920. cols.push(collast);
  1921. var collast = { label: '已调数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1922. cols.push(collast);
  1923. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1924. //cols.push(collast);
  1925. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1926. cols.push(collast);
  1927. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1928. //cols.push(collast);
  1929. $.ajax({
  1930. url: "/Print/SelectTableColumnName?" + Math.random(),
  1931. dataType: "json",
  1932. async: false,
  1933. success: function (data) {
  1934. if (data != null && data.length > 0) {
  1935. DateList = data;
  1936. for (var i = 0; i < data.length; i++) {
  1937. var TableCode = data[i].TableCode;
  1938. if (TableCode == "ICSTransferApplication") {
  1939. var Code = data[i].Code;
  1940. var Name = data[i].Name;
  1941. var obj = new Array();
  1942. obj = {
  1943. label: Name,
  1944. name: Code,
  1945. width: 80,
  1946. align: "left"
  1947. }
  1948. cols.push(obj);
  1949. }
  1950. if (TableCode == "ICSInventory") {
  1951. var Code = data[i].Code;
  1952. var Name = data[i].Name;
  1953. var obj = new Array();
  1954. obj = {
  1955. label: Name,
  1956. name: Code,
  1957. width: 80,
  1958. align: "left"
  1959. }
  1960. cols.push(obj);
  1961. //cols1.push(obj);
  1962. }
  1963. }
  1964. }
  1965. _Clos = cols;
  1966. //_Clos1 = cols1;
  1967. }
  1968. });
  1969. }
  1970. //一步调入单生成条码
  1971. if (Type == '203') {
  1972. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1973. cols.push(collast);
  1974. var collast = { label: '单据号', name: 'TransferNO', width: 120, align: 'left' };
  1975. cols.push(collast);
  1976. var collast = { label: '单据行号', name: 'Sequence', width: 50, align: 'left' };
  1977. cols.push(collast);
  1978. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1979. cols.push(collast);
  1980. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1981. cols.push(collast);
  1982. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1983. cols.push(collast);
  1984. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1985. cols.push(collast);
  1986. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1987. cols.push(collast);
  1988. var collast = { label: '已调数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1989. cols.push(collast);
  1990. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1991. //cols.push(collast);
  1992. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1993. cols.push(collast);
  1994. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1995. //cols.push(collast);
  1996. $.ajax({
  1997. url: "/Print/SelectTableColumnName?" + Math.random(),
  1998. dataType: "json",
  1999. async: false,
  2000. success: function (data) {
  2001. if (data != null && data.length > 0) {
  2002. DateList = data;
  2003. for (var i = 0; i < data.length; i++) {
  2004. var TableCode = data[i].TableCode;
  2005. if (TableCode == "ICSTransferApplication") {
  2006. var Code = data[i].Code;
  2007. var Name = data[i].Name;
  2008. var obj = new Array();
  2009. obj = {
  2010. label: Name,
  2011. name: Code,
  2012. width: 80,
  2013. align: "left"
  2014. }
  2015. cols.push(obj);
  2016. }
  2017. if (TableCode == "ICSInventory") {
  2018. var Code = data[i].Code;
  2019. var Name = data[i].Name;
  2020. var obj = new Array();
  2021. obj = {
  2022. label: Name,
  2023. name: Code,
  2024. width: 80,
  2025. align: "left"
  2026. }
  2027. cols.push(obj);
  2028. //cols1.push(obj);
  2029. }
  2030. }
  2031. }
  2032. _Clos = cols;
  2033. //_Clos1 = cols1;
  2034. }
  2035. });
  2036. }
  2037. if (Type=='17') {
  2038. var cols1 = new Array();
  2039. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  2040. cols1.push(collast1);
  2041. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  2042. cols1.push(collast1);
  2043. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  2044. cols1.push(collast1);
  2045. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  2046. cols1.push(collast1);
  2047. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  2048. cols1.push(collast1);
  2049. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  2050. cols1.push(collast1);
  2051. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  2052. cols1.push(collast1);
  2053. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  2054. cols1.push(collast1);
  2055. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  2056. cols1.push(collast1);
  2057. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  2058. cols1.push(collast1);
  2059. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  2060. cols1.push(collast1);
  2061. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  2062. cols1.push(collast1);
  2063. var collast1 = { label: '是否打印', name: 'isPrint', width: 150, align: 'left' };
  2064. cols1.push(collast1);
  2065. } else {
  2066. var cols1 = new Array();
  2067. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  2068. cols1.push(collast1);
  2069. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  2070. cols1.push(collast1);
  2071. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  2072. cols1.push(collast1);
  2073. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  2074. cols1.push(collast1);
  2075. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  2076. cols1.push(collast1);
  2077. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  2078. cols1.push(collast1);
  2079. //var collast1 = { label: '炉批号', name: 'EATTRIBUTE4', width: 100, align: 'left' };
  2080. //cols1.push(collast1);
  2081. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  2082. cols1.push(collast1);
  2083. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  2084. cols1.push(collast1);
  2085. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  2086. cols1.push(collast1);
  2087. var collast1 = { label: '备注', name: 'EATTRIBUTE5', width: 100, align: 'left' };
  2088. cols1.push(collast1);
  2089. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  2090. cols1.push(collast1);
  2091. var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' };
  2092. cols1.push(collast1);
  2093. var collast1 = { label: '免检', name: 'isExemption', width: 100, align: 'left' };
  2094. cols1.push(collast1);
  2095. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  2096. cols1.push(collast1);
  2097. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  2098. cols1.push(collast1);
  2099. var collast1 = { label: '是否打印', name: 'isPrint', width: 150, align: 'left' };
  2100. cols1.push(collast1);
  2101. }
  2102. if (data != null && data.length > 0) {
  2103. DateList = data;
  2104. for (var i = 0; i < data.length; i++) {
  2105. var ColName = data[i].ColName;
  2106. var ColCode = data[i].ColCode;
  2107. var obj = new Array();
  2108. obj = {
  2109. label: ColName,
  2110. name: ColCode,
  2111. width: 80,
  2112. align: "left"
  2113. }
  2114. cols.push(obj);
  2115. cols1.push(obj);
  2116. }
  2117. }
  2118. _Clos = cols;
  2119. _Clos1 = cols1;
  2120. }
  2121. });
  2122. }
  2123. //生产退料
  2124. function gridList() {
  2125. var $gridList = $("#gridList");
  2126. var queryJson = {
  2127. POCode: $("#txt_POCode").val(),
  2128. InvCode: $("#txt_InvCode").val(),
  2129. InvName: $("#txt_InvName").val(),
  2130. BatchCode: $("#txt_BatchCode").val(),
  2131. FromTime: $("#FromTime").val(),
  2132. ToTime: $("#ToTime").val(),
  2133. POStatus: $("#selShow").val()
  2134. }
  2135. $gridList.dataGrid({
  2136. url: "/JHWMS/WMSCreateItemLot/GetGridJson" + "?" + Math.random(),
  2137. postData: { queryJson: JSON.stringify(queryJson) },
  2138. height: $(window).height() - 200,
  2139. width: $(window).width() - 300,
  2140. colModel: _Clos,
  2141. //colModel: [
  2142. // { label: "主键", name: "ID", hidden: true, key: true },
  2143. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2144. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2145. // { label: '工单子件', name: 'SourceDetailID', hidden: true, },
  2146. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2147. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2148. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2149. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2150. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2151. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2152. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2153. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2154. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2155. //],
  2156. //colModel: ColModelMain,
  2157. width: "100%",
  2158. autowidth: true,
  2159. //shrinkToFit: true,
  2160. gridComplete: function () {
  2161. },
  2162. pager: "#gridPager",
  2163. sortname: " MTIME ,ApplyNegCode desc,REPLICATE('0',10-len(Sequence))+Sequence  ",
  2164. // sortname: 'ApplyNegCode ',
  2165. //let str = `He said, "It's a 'beautiful' day."`,
  2166. sortorder: "desc",
  2167. viewrecords: true,
  2168. multiselect: true,
  2169. //beforeSelectRow: function (rowid, e) {
  2170. // $("#gridList").jqGrid('resetSelection');
  2171. // return (true);
  2172. //},
  2173. subGrid: true, // (1)开启子表格支持
  2174. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2175. $("#gridList").jqGrid("setSelection", rowid, false);
  2176. bindSubGrid(subgrid_id, rowid)
  2177. }
  2178. });
  2179. $("#warehouse a.btn-default").click(function () {
  2180. $("#warehouse a.btn-default").removeClass("active");
  2181. $(this).addClass("active");
  2182. $('#btn_search').trigger("click");
  2183. });
  2184. $("#btn_search").click(function () {
  2185. var warehouse = $("#warehouse a.active").attr('data-value');
  2186. var queryJson = {
  2187. POCode: $("#txt_POCode").val(),
  2188. InvCode: $("#txt_InvCode").val(),
  2189. InvName: $("#txt_InvName").val(),
  2190. BatchCode: $("#txt_BatchCode").val(),
  2191. FromTime: $("#FromTime").val(),
  2192. ToTime: $("#ToTime").val(),
  2193. POStatus: $("#selShow").val()
  2194. }
  2195. $gridList.jqGrid('setGridParam', {
  2196. postData: { queryJson: JSON.stringify(queryJson) },
  2197. }).trigger('reloadGrid');
  2198. });
  2199. }
  2200. function bindSubGrid(subgrid_id, rowid) {
  2201. $("#gridList").jqGrid("setSelection", rowid, false);
  2202. var subgrid_table_id;
  2203. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2204. var subgrid_pager_id;
  2205. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2206. // (5)动态添加子报表的table和pager
  2207. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2208. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2209. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2210. // (6)创建jqGrid对象
  2211. $("#" + subgrid_table_id).dataGrid({
  2212. cellEdit: true,
  2213. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2214. //colModel: [
  2215. // { label: "主键", name: "ID", hidden: true, key: true },
  2216. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2217. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2218. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2219. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2220. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2221. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2222. //],
  2223. colModel: _Clos1,
  2224. //colModel: ColModelSub,
  2225. shrinkToFit: true,//宽度自适应
  2226. multiselect: true,
  2227. prmNames: { search: "search" },
  2228. viewrecords: true,
  2229. height: "100%",
  2230. rowNum: 20,
  2231. pager: subgrid_pager_id,
  2232. });
  2233. }
  2234. //委外退料
  2235. function gridList2() {
  2236. var $gridList = $("#gridList");
  2237. var queryJson = {
  2238. POCode: $("#txt_POCode").val(),
  2239. InvCode: $("#txt_InvCode").val(),
  2240. InvName: $("#txt_InvName").val(),
  2241. BatchCode: $("#txt_BatchCode").val(),
  2242. FromTime: $("#FromTime").val(),
  2243. ToTime: $("#ToTime").val(),
  2244. WHCode: $("#txt_WHCode").val(),
  2245. POStatus: $("#selShow").val()
  2246. }
  2247. $gridList.dataGrid({
  2248. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWeiWai" + "?" + Math.random(),
  2249. postData: { queryJson: JSON.stringify(queryJson) },
  2250. height: $(window).height() - 200,
  2251. width: $(window).width() - 300,
  2252. colModel: _Clos,
  2253. //colModel: [
  2254. // { label: "主键", name: "ID", hidden: true, key: true },
  2255. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2256. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2257. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2258. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2259. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2260. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2261. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2262. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2263. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2264. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2265. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2266. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2267. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2268. //],
  2269. //colModel: ColModelMain,
  2270. width: "100%",
  2271. autowidth: true,
  2272. //shrinkToFit: true,
  2273. gridComplete: function () {
  2274. },
  2275. pager: "#gridPager",
  2276. // sortname: 'OApplyNegCode,cast(Sequence as int)',
  2277. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2278. sortorder: "desc",
  2279. viewrecords: true,
  2280. multiselect: true,
  2281. //beforeSelectRow: function (rowid, e) {
  2282. // $("#gridList").jqGrid('resetSelection');
  2283. // return (true);
  2284. //},
  2285. subGrid: true, // (1)开启子表格支持
  2286. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2287. $("#gridList").jqGrid("setSelection", rowid, false);
  2288. bindSubGrid2(subgrid_id, rowid)
  2289. }
  2290. });
  2291. $("#warehouse a.btn-default").click(function () {
  2292. $("#warehouse a.btn-default").removeClass("active");
  2293. $(this).addClass("active");
  2294. $('#btn_search').trigger("click");
  2295. });
  2296. $("#btn_search").click(function () {
  2297. var warehouse = $("#warehouse a.active").attr('data-value');
  2298. var queryJson = {
  2299. POCode: $("#txt_POCode").val(),
  2300. InvCode: $("#txt_InvCode").val(),
  2301. InvName: $("#txt_InvName").val(),
  2302. BatchCode: $("#txt_BatchCode").val(),
  2303. FromTime: $("#FromTime").val(),
  2304. ToTime: $("#ToTime").val(),
  2305. WHCode: $("#txt_WHCode").val(),
  2306. POStatus: $("#selShow").val()
  2307. }
  2308. $gridList.jqGrid('setGridParam', {
  2309. postData: { queryJson: JSON.stringify(queryJson) },
  2310. }).trigger('reloadGrid');
  2311. });
  2312. }
  2313. function bindSubGrid2(subgrid_id, rowid) {
  2314. $("#gridList").jqGrid("setSelection", rowid, false);
  2315. var subgrid_table_id;
  2316. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2317. var subgrid_pager_id;
  2318. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2319. // (5)动态添加子报表的table和pager
  2320. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2321. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2322. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2323. // (6)创建jqGrid对象
  2324. $("#" + subgrid_table_id).dataGrid({
  2325. cellEdit: true,
  2326. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2327. //colModel: [
  2328. // { label: "主键", name: "ID", hidden: true, key: true },
  2329. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2330. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2331. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2332. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2333. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2334. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2335. //],
  2336. colModel: _Clos1,
  2337. //colModel: ColModelSub,
  2338. shrinkToFit: true,//宽度自适应
  2339. multiselect: true,
  2340. prmNames: { search: "search" },
  2341. viewrecords: true,
  2342. height: "100%",
  2343. rowNum: 20,
  2344. pager: subgrid_pager_id,
  2345. });
  2346. }
  2347. //成品
  2348. function gridList3() {
  2349. var $gridList = $("#gridList");
  2350. var queryJson = {
  2351. POCode: $("#txt_POCode").val(),
  2352. InvCode: $("#txt_InvCode").val(),
  2353. InvName: $("#txt_InvName").val(),
  2354. BatchCode: $("#txt_BatchCode").val(),
  2355. FromTime: $("#FromTime").val(),
  2356. ToTime: $("#ToTime").val(),
  2357. WHCode: $("#txt_WHCode").val(),
  2358. POStatus: $("#selShow").val(),
  2359. SelGDLX: $("#SelGDLX option:checked").val(),
  2360. WHStatus: $("#selStatus").val(),
  2361. InvStd: $("#txt_InvStd").val(),
  2362. ClassGroup: $("#selClassGroup").val(),
  2363. }
  2364. $gridList.dataGrid({
  2365. url: "/JHWMS/WMSCreateItemLot/GetGridJsonChengPing" + "?" + Math.random(),
  2366. postData: { queryJson: JSON.stringify(queryJson) },
  2367. height: $(window).height() - 200,
  2368. width: $(window).width() - 300,
  2369. colModel: _Clos,
  2370. //colModel: [
  2371. // { label: "主键", name: "ID", hidden: true, key: true },
  2372. // { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  2373. // { label: '工单行号', name: 'Sequence', width: 50, align: 'left' },
  2374. // { label: '已入库数量', name: 'RCVQuantity', hidden: true, },
  2375. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2376. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2377. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2378. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2379. // {
  2380. // label: "状态", name: "MOStatus", width: 60, align: "left",
  2381. // formatter: function (cellvalue) {
  2382. // if (cellvalue == "1") {
  2383. // return "初始";
  2384. // } else if (cellvalue == "2") {
  2385. // return "下发";
  2386. // }
  2387. // else if (cellvalue == "3") {
  2388. // return "关单";
  2389. // }
  2390. // else { return ""; }
  2391. // }
  2392. // },
  2393. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2394. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2395. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2396. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2397. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2398. // { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' },
  2399. //],
  2400. //colModel: ColModelMain,
  2401. width: "100%",
  2402. cellEdit: true,
  2403. cellsubmit: "clientArray",
  2404. autowidth: true,
  2405. //shrinkToFit: true,
  2406. gridComplete: function () {
  2407. },
  2408. pager: "#gridPager",
  2409. //sortname: 'MOCode,cast(Sequence as int)',
  2410. sortname: "MOCode desc,REPLICATE('0',10-len(Sequence))+Sequence ",
  2411. // sortorder: "asc",
  2412. viewrecords: true,
  2413. multiselect: true,
  2414. //beforeSelectRow: function (rowid, e) {
  2415. // $("#gridList").jqGrid('resetSelection');
  2416. // return (true);
  2417. //},
  2418. subGrid: true, // (1)开启子表格支持
  2419. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2420. $("#gridList").jqGrid("setSelection", rowid, false);
  2421. bindSubGrid3(subgrid_id, rowid)
  2422. }
  2423. });
  2424. $("#warehouse a.btn-default").click(function () {
  2425. $("#warehouse a.btn-default").removeClass("active");
  2426. $(this).addClass("active");
  2427. $('#btn_search').trigger("click");
  2428. });
  2429. $("#btn_search").click(function () {
  2430. var warehouse = $("#warehouse a.active").attr('data-value');
  2431. var queryJson = {
  2432. POCode: $("#txt_POCode").val(),
  2433. InvCode: $("#txt_InvCode").val(),
  2434. InvName: $("#txt_InvName").val(),
  2435. BatchCode: $("#txt_BatchCode").val(),
  2436. FromTime: $("#FromTime").val(),
  2437. ToTime: $("#ToTime").val(),
  2438. WHCode: $("#txt_WHCode").val(),
  2439. POStatus: $("#selShow").val(),
  2440. SelGDLX: $("#SelGDLX option:checked").val(),
  2441. WHStatus: $("#selStatus").val(),
  2442. InvStd: $("#txt_InvStd").val(),
  2443. ClassGroup: $("#selClassGroup").val(),
  2444. }
  2445. $gridList.jqGrid('setGridParam', {
  2446. postData: { queryJson: JSON.stringify(queryJson) },
  2447. }).trigger('reloadGrid');
  2448. });
  2449. }
  2450. function bindSubGrid3(subgrid_id, rowid) {
  2451. $("#gridList").jqGrid("setSelection", rowid, false);
  2452. var subgrid_table_id;
  2453. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2454. var subgrid_pager_id;
  2455. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2456. // (5)动态添加子报表的table和pager
  2457. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2458. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  2459. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2460. var isPrint = $("#selPrint").val();
  2461. // (6)创建jqGrid对象
  2462. $("#" + subgrid_table_id).dataGrid({
  2463. cellEdit: true,
  2464. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2465. //colModel: [
  2466. // { label: "主键", name: "ID", hidden: true, key: true },
  2467. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2468. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2469. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2470. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2471. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2472. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2473. //],
  2474. colModel: _Clos1,
  2475. //colModel: ColModelSub,
  2476. shrinkToFit: true,//宽度自适应
  2477. multiselect: true,
  2478. prmNames: { search: "search" },
  2479. viewrecords: true,
  2480. height: "100%",
  2481. rowNum: 20,
  2482. pager: subgrid_pager_id,
  2483. });
  2484. }
  2485. //销售退货
  2486. function gridList4() {
  2487. var $gridList = $("#gridList");
  2488. var queryJson = {
  2489. POCode: $("#txt_POCode").val(),
  2490. InvCode: $("#txt_InvCode").val(),
  2491. InvName: $("#txt_InvName").val(),
  2492. BatchCode: $("#txt_BatchCode").val(),
  2493. POStatus: $("#selShow").val()
  2494. }
  2495. $gridList.dataGrid({
  2496. url: "/JHWMS/WMSCreateItemLot/GetGridJsonXiaoShou" + "?" + Math.random(),
  2497. postData: { queryJson: JSON.stringify(queryJson) },
  2498. height: $(window).height() - 200,
  2499. width: $(window).width() - 300,
  2500. colModel: _Clos,
  2501. //colModel: [
  2502. // { label: "主键", name: "ID", hidden: true, key: true },
  2503. // { label: '单据号', name: 'SDNCode', width: 120, align: 'left' },
  2504. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2505. // { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' },
  2506. // { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' },
  2507. // { label: '客户代码', name: 'CusCode', width: 120, align: 'left' },
  2508. // { label: '客户名称', name: 'CusName', width: 50, align: 'left' },
  2509. // { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' },
  2510. // { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' },
  2511. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2512. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2513. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2514. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2515. // {
  2516. // label: "状态", name: "Status", width: 60, align: "left",
  2517. // formatter: function (cellvalue) {
  2518. // if (cellvalue == "1") {
  2519. // return "开立";
  2520. // } else if (cellvalue == "2") {
  2521. // return "审核";
  2522. // }
  2523. // else if (cellvalue == "3") {
  2524. // return "关闭";
  2525. // }
  2526. // else { return ""; }
  2527. // }
  2528. // },
  2529. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2530. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2531. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2532. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2533. //],
  2534. //colModel: ColModelMain,
  2535. width: "100%",
  2536. autowidth: true,
  2537. //shrinkToFit: true,
  2538. gridComplete: function () {
  2539. },
  2540. pager: "#gridPager",
  2541. // sortname: 'SDNCode,cast(Sequence as int)',
  2542. sortname: "SDNCode,REPLICATE('0',10-len(Sequence))+Sequence",
  2543. sortorder: "desc",
  2544. viewrecords: true,
  2545. multiselect: true,
  2546. //beforeSelectRow: function (rowid, e) {
  2547. // $("#gridList").jqGrid('resetSelection');
  2548. // return (true);
  2549. //},
  2550. subGrid: true, // (1)开启子表格支持
  2551. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2552. $("#gridList").jqGrid("setSelection", rowid, false);
  2553. bindSubGrid4(subgrid_id, rowid)
  2554. }
  2555. });
  2556. $("#warehouse a.btn-default").click(function () {
  2557. $("#warehouse a.btn-default").removeClass("active");
  2558. $(this).addClass("active");
  2559. $('#btn_search').trigger("click");
  2560. });
  2561. $("#btn_search").click(function () {
  2562. var warehouse = $("#warehouse a.active").attr('data-value');
  2563. var queryJson = {
  2564. POCode: $("#txt_POCode").val(),
  2565. InvCode: $("#txt_InvCode").val(),
  2566. InvName: $("#txt_InvName").val(),
  2567. BatchCode: $("#txt_BatchCode").val(),
  2568. POStatus: $("#selShow").val()
  2569. }
  2570. $gridList.jqGrid('setGridParam', {
  2571. postData: { queryJson: JSON.stringify(queryJson) },
  2572. }).trigger('reloadGrid');
  2573. });
  2574. }
  2575. function bindSubGrid4(subgrid_id, rowid) {
  2576. $("#gridList").jqGrid("setSelection", rowid, false);
  2577. var subgrid_table_id;
  2578. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2579. var subgrid_pager_id;
  2580. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2581. // (5)动态添加子报表的table和pager
  2582. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2583. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  2584. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2585. var isPrint = $("#selPrint").val();
  2586. // (6)创建jqGrid对象
  2587. $("#" + subgrid_table_id).dataGrid({
  2588. cellEdit: true,
  2589. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2590. //colModel: [
  2591. // { label: "主键", name: "ID", hidden: true, key: true },
  2592. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2593. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2594. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2595. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2596. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2597. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2598. //],
  2599. colModel: _Clos1,
  2600. //colModel: ColModelSub,
  2601. shrinkToFit: true,//宽度自适应
  2602. multiselect: true,
  2603. prmNames: { search: "search" },
  2604. viewrecords: true,
  2605. height: "100%",
  2606. rowNum: 20,
  2607. pager: subgrid_pager_id,
  2608. });
  2609. }
  2610. //其它入库生成条码
  2611. function gridList5() {
  2612. var $gridList = $("#gridList");
  2613. var queryJson = {
  2614. POCode: $("#txt_POCode").val(),
  2615. InvCode: $("#txt_InvCode").val(),
  2616. InvName: $("#txt_InvName").val(),
  2617. BatchCode: $("#txt_BatchCode").val(),
  2618. FromTime: $("#FromTime").val(),
  2619. ToTime: $("#ToTime").val(),
  2620. WHCode: $("#txt_WHCode").val(),
  2621. POStatus: $("#selShow").val(),
  2622. InvStd: $("#txt_InvStd").val(),
  2623. }
  2624. $gridList.dataGrid({
  2625. url: "/JHWMS/WMSCreateItemLot/GetGridJsonQiTa" + "?" + Math.random(),
  2626. postData: { queryJson: JSON.stringify(queryJson) },
  2627. height: $(window).height() - 200,
  2628. width: $(window).width() - 300,
  2629. colModel: _Clos,
  2630. //colModel: [
  2631. // { label: "主键", name: "ID", hidden: true, key: true },
  2632. // { label: '单据号', name: 'InCode', width: 120, align: 'left' },
  2633. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2634. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  2635. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2636. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2637. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2638. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2639. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2640. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2641. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2642. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2643. // { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', },
  2644. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2645. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2646. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2647. //],
  2648. //colModel: ColModelMain,
  2649. width: "100%",
  2650. autowidth: true,
  2651. //shrinkToFit: true,
  2652. gridComplete: function () {
  2653. },
  2654. pager: "#gridPager",
  2655. sortname: 'CreateDateTime ',
  2656. sortorder: "desc",
  2657. viewrecords: true,
  2658. multiselect: true,
  2659. //beforeSelectRow: function (rowid, e) {
  2660. // $("#gridList").jqGrid('resetSelection');
  2661. // return (true);
  2662. //},
  2663. subGrid: true, // (1)开启子表格支持
  2664. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2665. $("#gridList").jqGrid("setSelection", rowid, false);
  2666. bindSubGrid5(subgrid_id, rowid)
  2667. }
  2668. });
  2669. $("#warehouse a.btn-default").click(function () {
  2670. $("#warehouse a.btn-default").removeClass("active");
  2671. $(this).addClass("active");
  2672. $('#btn_search').trigger("click");
  2673. });
  2674. $("#btn_search").click(function () {
  2675. var warehouse = $("#warehouse a.active").attr('data-value');
  2676. var queryJson = {
  2677. POCode: $("#txt_POCode").val(),
  2678. InvCode: $("#txt_InvCode").val(),
  2679. InvName: $("#txt_InvName").val(),
  2680. BatchCode: $("#txt_BatchCode").val(),
  2681. FromTime: $("#FromTime").val(),
  2682. ToTime: $("#ToTime").val(),
  2683. WHCode: $("#txt_WHCode").val(),
  2684. POStatus: $("#selShow").val(),
  2685. InvStd: $("#txt_InvStd").val(),
  2686. }
  2687. $gridList.jqGrid('setGridParam', {
  2688. postData: { queryJson: JSON.stringify(queryJson) },
  2689. }).trigger('reloadGrid');
  2690. });
  2691. }
  2692. function bindSubGrid5(subgrid_id, rowid) {
  2693. $("#gridList").jqGrid("setSelection", rowid, false);
  2694. var subgrid_table_id;
  2695. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2696. var subgrid_pager_id;
  2697. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2698. // (5)动态添加子报表的table和pager
  2699. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2700. var InCode = $("#gridList").jqGrid('getRowData', rowid).InCode;
  2701. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2702. var isPrint = $("#selPrint").val();
  2703. // (6)创建jqGrid对象
  2704. $("#" + subgrid_table_id).dataGrid({
  2705. cellEdit: true,
  2706. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2707. //colModel: [
  2708. // { label: "主键", name: "ID", hidden: true, key: true },
  2709. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2710. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2711. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2712. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2713. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2714. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2715. //],
  2716. colModel: _Clos1,
  2717. //colModel: ColModelSub,
  2718. shrinkToFit: true,//宽度自适应
  2719. multiselect: true,
  2720. prmNames: { search: "search" },
  2721. viewrecords: true,
  2722. height: "100%",
  2723. rowNum: 20,
  2724. pager: subgrid_pager_id,
  2725. });
  2726. }
  2727. //归还单生成条码
  2728. function gridList6() {
  2729. var $gridList = $("#gridList");
  2730. var queryJson = {
  2731. POCode: $("#txt_POCode").val(),
  2732. InvCode: $("#txt_InvCode").val(),
  2733. InvName: $("#txt_InvName").val(),
  2734. BatchCode: $("#txt_BatchCode").val(),
  2735. POStatus: $("#selShow").val()
  2736. }
  2737. $gridList.dataGrid({
  2738. url: "/JHWMS/WMSCreateItemLot/GetGridJsonGuiHuan" + "?" + Math.random(),
  2739. postData: { queryJson: JSON.stringify(queryJson) },
  2740. height: $(window).height() - 200,
  2741. width: $(window).width() - 300,
  2742. colModel: _Clos,
  2743. //colModel: [
  2744. // { label: "主键", name: "ID", hidden: true, key: true },
  2745. // { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' },
  2746. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2747. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  2748. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2749. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2750. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2751. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2752. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2753. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2754. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2755. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2756. // { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', },
  2757. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2758. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2759. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2760. //],
  2761. //colModel: ColModelMain,
  2762. width: "100%",
  2763. autowidth: true,
  2764. //shrinkToFit: true,
  2765. gridComplete: function () {
  2766. },
  2767. pager: "#gridPager",
  2768. /// sortname: 'ReturnCode,cast(Sequence as int)',
  2769. sortname: "ReturnCode,REPLICATE('0',10-len(Sequence))+Sequence",
  2770. sortorder: "desc",
  2771. viewrecords: true,
  2772. multiselect: true,
  2773. //beforeSelectRow: function (rowid, e) {
  2774. // $("#gridList").jqGrid('resetSelection');
  2775. // return (true);
  2776. //},
  2777. subGrid: true, // (1)开启子表格支持
  2778. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2779. $("#gridList").jqGrid("setSelection", rowid, false);
  2780. bindSubGrid6(subgrid_id, rowid)
  2781. }
  2782. });
  2783. $("#warehouse a.btn-default").click(function () {
  2784. $("#warehouse a.btn-default").removeClass("active");
  2785. $(this).addClass("active");
  2786. $('#btn_search').trigger("click");
  2787. });
  2788. $("#btn_search").click(function () {
  2789. var warehouse = $("#warehouse a.active").attr('data-value');
  2790. var queryJson = {
  2791. POCode: $("#txt_POCode").val(),
  2792. InvCode: $("#txt_InvCode").val(),
  2793. InvName: $("#txt_InvName").val(),
  2794. BatchCode: $("#txt_BatchCode").val(),
  2795. POStatus: $("#selShow").val()
  2796. }
  2797. $gridList.jqGrid('setGridParam', {
  2798. postData: { queryJson: JSON.stringify(queryJson) },
  2799. }).trigger('reloadGrid');
  2800. });
  2801. }
  2802. function bindSubGrid6(subgrid_id, rowid) {
  2803. $("#gridList").jqGrid("setSelection", rowid, false);
  2804. var subgrid_table_id;
  2805. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2806. var subgrid_pager_id;
  2807. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2808. // (5)动态添加子报表的table和pager
  2809. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2810. var ReturnCode = $("#gridList").jqGrid('getRowData', rowid).ReturnCode;
  2811. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2812. // (6)创建jqGrid对象
  2813. $("#" + subgrid_table_id).dataGrid({
  2814. cellEdit: true,
  2815. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2816. //colModel: [
  2817. // { label: "主键", name: "ID", hidden: true, key: true },
  2818. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2819. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2820. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2821. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2822. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2823. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2824. //],
  2825. colModel: _Clos1,
  2826. //colModel: ColModelSub,
  2827. shrinkToFit: true,//宽度自适应
  2828. multiselect: true,
  2829. prmNames: { search: "search" },
  2830. viewrecords: true,
  2831. height: "100%",
  2832. rowNum: 20,
  2833. pager: subgrid_pager_id,
  2834. });
  2835. }
  2836. //*审核到货单生成条码
  2837. function gridList7() {
  2838. var $gridList = $("#gridList");
  2839. var queryJson = {
  2840. POCode: $("#txt_POCode").val(),
  2841. VenCode: $("#txt_VenCode").val(),
  2842. VenName: $("#txt_VenName").val(),
  2843. InvCode: $("#txt_InvCode").val(),
  2844. InvName: $("#txt_InvName").val(),
  2845. BatchCode: $("#txt_BatchCode").val(),
  2846. POStatus: $("#selShow").val(),
  2847. WHStatus: $("#selStatus").val(),
  2848. InvStd: $("#txt_InvStd").val(),
  2849. }
  2850. $gridList.dataGrid({
  2851. url: "/JHWMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  2852. postData: { queryJson: JSON.stringify(queryJson) },
  2853. height: $(window).height() - 200,
  2854. width: $(window).width() - 300,
  2855. colModel: _Clos,
  2856. //colModel: [
  2857. // { label: "主键", name: "ID", hidden: true, key: true },
  2858. // { label: '单据号', name: 'DNCode', width: 120, align: 'left' },
  2859. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2860. // { label: '采购订单号', name: 'POCode', width: 50, align: 'left' },
  2861. // { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' },
  2862. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2863. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2864. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2865. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2866. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2867. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2868. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  2869. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2870. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2871. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2872. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2873. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2874. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2875. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2876. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2877. //],
  2878. //colModel: ColModelMain,
  2879. width: "100%",
  2880. autowidth: true,
  2881. //shrinkToFit: true,
  2882. gridComplete: function () {
  2883. },
  2884. pager: "#gridPager",
  2885. //sortname: 'DNCode,cast(Sequence as int)',
  2886. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2887. sortorder: "asc",
  2888. viewrecords: true,
  2889. multiselect: true,
  2890. //beforeSelectRow: function (rowid, e) {
  2891. // $("#gridList").jqGrid('resetSelection');
  2892. // return (true);
  2893. //},
  2894. subGrid: true, // (1)开启子表格支持
  2895. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2896. $("#gridList").jqGrid("setSelection", rowid, false);
  2897. bindSubGrid7(subgrid_id, rowid)
  2898. }
  2899. });
  2900. $("#warehouse a.btn-default").click(function () {
  2901. $("#warehouse a.btn-default").removeClass("active");
  2902. $(this).addClass("active");
  2903. $('#btn_search').trigger("click");
  2904. });
  2905. $("#btn_search").click(function () {
  2906. var warehouse = $("#warehouse a.active").attr('data-value');
  2907. var queryJson = {
  2908. POCode: $("#txt_POCode").val(),
  2909. VenCode: $("#txt_VenCode").val(),
  2910. VenName: $("#txt_VenName").val(),
  2911. InvCode: $("#txt_InvCode").val(),
  2912. InvName: $("#txt_InvName").val(),
  2913. BatchCode: $("#txt_BatchCode").val(),
  2914. POStatus: $("#selShow").val(),
  2915. WHStatus: $("#selStatus").val(),
  2916. InvStd: $("#txt_InvStd").val(),
  2917. }
  2918. $gridList.jqGrid('setGridParam', {
  2919. postData: { queryJson: JSON.stringify(queryJson) },
  2920. }).trigger('reloadGrid');
  2921. });
  2922. }
  2923. function bindSubGrid7(subgrid_id, rowid) {
  2924. $("#gridList").jqGrid("setSelection", rowid, false);
  2925. var subgrid_table_id;
  2926. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2927. var subgrid_pager_id;
  2928. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2929. // (5)动态添加子报表的table和pager
  2930. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2931. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  2932. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2933. var isPrint = $("#selPrint").val();
  2934. // (6)创建jqGrid对象
  2935. $("#" + subgrid_table_id).dataGrid({
  2936. cellEdit: true,
  2937. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2938. //colModel: [
  2939. // { label: "主键", name: "ID", hidden: true, key: true },
  2940. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2941. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2942. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2943. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2944. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2945. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2946. //],
  2947. colModel: _Clos1,
  2948. //colModel: ColModelSub,
  2949. shrinkToFit: true,//宽度自适应
  2950. multiselect: true,
  2951. prmNames: { search: "search" },
  2952. viewrecords: true,
  2953. height: "100%",
  2954. rowNum: 20,
  2955. pager: subgrid_pager_id,
  2956. });
  2957. }
  2958. //审核委外到货单生成条码
  2959. function gridList8() {
  2960. var $gridList = $("#gridList");
  2961. var queryJson = {
  2962. POCode: $("#txt_POCode").val(),
  2963. VenCode: $("#txt_VenCode").val(),
  2964. VenName: $("#txt_VenName").val(),
  2965. InvCode: $("#txt_InvCode").val(),
  2966. InvName: $("#txt_InvName").val(),
  2967. BatchCode: $("#txt_BatchCode").val(),
  2968. POStatus: $("#selShow").val(),
  2969. WHStatus: $("#selStatus").val(),
  2970. InvStd: $("#txt_InvStd").val(),
  2971. }
  2972. $gridList.dataGrid({
  2973. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(),
  2974. postData: { queryJson: JSON.stringify(queryJson) },
  2975. height: $(window).height() - 200,
  2976. width: $(window).width() - 300,
  2977. colModel: _Clos,
  2978. //colModel: [
  2979. // { label: "主键", name: "ID", hidden: true, key: true },
  2980. // { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  2981. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2982. // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' },
  2983. // { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' },
  2984. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2985. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2986. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2987. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2988. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2989. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2990. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2991. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2992. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2993. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2994. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2995. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2996. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2997. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2998. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2999. //],
  3000. //colModel: ColModelMain,
  3001. width: "100%",
  3002. autowidth: true,
  3003. //shrinkToFit: true,
  3004. gridComplete: function () {
  3005. },
  3006. pager: "#gridPager",
  3007. //sortname: 'ODNCode,cast(Sequence as int)',
  3008. sortname: "ODNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3009. sortorder: "asc",
  3010. viewrecords: true,
  3011. multiselect: true,
  3012. //beforeSelectRow: function (rowid, e) {
  3013. // $("#gridList").jqGrid('resetSelection');
  3014. // return (true);
  3015. //},
  3016. subGrid: true, // (1)开启子表格支持
  3017. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3018. $("#gridList").jqGrid("setSelection", rowid, false);
  3019. bindSubGrid8(subgrid_id, rowid)
  3020. }
  3021. });
  3022. $("#warehouse a.btn-default").click(function () {
  3023. $("#warehouse a.btn-default").removeClass("active");
  3024. $(this).addClass("active");
  3025. $('#btn_search').trigger("click");
  3026. });
  3027. $("#btn_search").click(function () {
  3028. var warehouse = $("#warehouse a.active").attr('data-value');
  3029. var queryJson = {
  3030. POCode: $("#txt_POCode").val(),
  3031. VenCode: $("#txt_VenCode").val(),
  3032. VenName: $("#txt_VenName").val(),
  3033. InvCode: $("#txt_InvCode").val(),
  3034. InvName: $("#txt_InvName").val(),
  3035. BatchCode: $("#txt_BatchCode").val(),
  3036. POStatus: $("#selShow").val(),
  3037. WHStatus: $("#selStatus").val(),
  3038. InvStd: $("#txt_InvStd").val(),
  3039. }
  3040. $gridList.jqGrid('setGridParam', {
  3041. postData: { queryJson: JSON.stringify(queryJson) },
  3042. }).trigger('reloadGrid');
  3043. });
  3044. }
  3045. function bindSubGrid8(subgrid_id, rowid) {
  3046. $("#gridList").jqGrid("setSelection", rowid, false);
  3047. var subgrid_table_id;
  3048. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3049. var subgrid_pager_id;
  3050. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3051. // (5)动态添加子报表的table和pager
  3052. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3053. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  3054. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3055. var isPrint = $("#selPrint").val();
  3056. // (6)创建jqGrid对象
  3057. $("#" + subgrid_table_id).dataGrid({
  3058. cellEdit: true,
  3059. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3060. //colModel: [
  3061. // { label: "主键", name: "ID", hidden: true, key: true },
  3062. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3063. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3064. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3065. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3066. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3067. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3068. //],
  3069. colModel: _Clos1,
  3070. //colModel: ColModelSub,
  3071. shrinkToFit: true,//宽度自适应
  3072. multiselect: true,
  3073. prmNames: { search: "search" },
  3074. viewrecords: true,
  3075. height: "100%",
  3076. rowNum: 20,
  3077. pager: subgrid_pager_id,
  3078. });
  3079. }
  3080. //开立得成品入库单 生成条码
  3081. function gridList9() {
  3082. var $gridList = $("#gridList");
  3083. var queryJson = {
  3084. POCode: $("#txt_POCode").val(),
  3085. InvCode: $("#txt_InvCode").val(),
  3086. InvName: $("#txt_InvName").val(),
  3087. BatchCode: $("#txt_BatchCode").val(),
  3088. POStatus: $("#selShow").val(),
  3089. SCode: $("#txt_SCode").val(),
  3090. }
  3091. $gridList.dataGrid({
  3092. url: "/JHWMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  3093. postData: { queryJson: JSON.stringify(queryJson) },
  3094. height: $(window).height() - 200,
  3095. width: $(window).width() - 300,
  3096. colModel: _Clos,
  3097. //colModel: [
  3098. // { label: "主键", name: "ID", hidden: true, key: true },
  3099. // { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  3100. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  3101. // { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  3102. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3103. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3104. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3105. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3106. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  3107. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3108. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3109. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3110. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3111. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3112. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3113. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3114. //],
  3115. //colModel: ColModelMain,
  3116. width: "100%",
  3117. autowidth: true,
  3118. //shrinkToFit: true,
  3119. gridComplete: function () {
  3120. },
  3121. pager: "#gridPager",
  3122. //sortname: 'RCVCode,cast(Sequence as int)',
  3123. sortname: "RCVCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3124. sortorder: "asc",
  3125. viewrecords: true,
  3126. multiselect: true,
  3127. //beforeSelectRow: function (rowid, e) {
  3128. // $("#gridList").jqGrid('resetSelection');
  3129. // return (true);
  3130. //},
  3131. subGrid: true, // (1)开启子表格支持
  3132. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3133. $("#gridList").jqGrid("setSelection", rowid, false);
  3134. bindSubGrid9(subgrid_id, rowid)
  3135. }
  3136. });
  3137. $("#warehouse a.btn-default").click(function () {
  3138. $("#warehouse a.btn-default").removeClass("active");
  3139. $(this).addClass("active");
  3140. $('#btn_search').trigger("click");
  3141. });
  3142. $("#btn_search").click(function () {
  3143. var warehouse = $("#warehouse a.active").attr('data-value');
  3144. var queryJson = {
  3145. POCode: $("#txt_POCode").val(),
  3146. InvCode: $("#txt_InvCode").val(),
  3147. InvName: $("#txt_InvName").val(),
  3148. BatchCode: $("#txt_BatchCode").val(),
  3149. POStatus: $("#selShow").val(),
  3150. SCode: $("#txt_SCode").val(),
  3151. }
  3152. $gridList.jqGrid('setGridParam', {
  3153. postData: { queryJson: JSON.stringify(queryJson) },
  3154. }).trigger('reloadGrid');
  3155. });
  3156. }
  3157. function bindSubGrid9(subgrid_id, rowid) {
  3158. $("#gridList").jqGrid("setSelection", rowid, false);
  3159. var subgrid_table_id;
  3160. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3161. var subgrid_pager_id;
  3162. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3163. // (5)动态添加子报表的table和pager
  3164. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3165. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  3166. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3167. // (6)创建jqGrid对象
  3168. $("#" + subgrid_table_id).dataGrid({
  3169. cellEdit: true,
  3170. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3171. //colModel: [
  3172. // { label: "主键", name: "ID", hidden: true, key: true },
  3173. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3174. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3175. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3176. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3177. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3178. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3179. //],
  3180. colModel: _Clos1,
  3181. //colModel: ColModelSub,
  3182. shrinkToFit: true,//宽度自适应
  3183. multiselect: true,
  3184. prmNames: { search: "search" },
  3185. viewrecords: true,
  3186. height: "100%",
  3187. rowNum: 20,
  3188. pager: subgrid_pager_id,
  3189. });
  3190. }
  3191. //采购拒收单
  3192. function gridList10() {
  3193. var $gridList = $("#gridList");
  3194. var queryJson = {
  3195. POCode: $("#txt_POCode").val(),
  3196. VenCode: $("#txt_VenCode").val(),
  3197. VenName: $("#txt_VenName").val(),
  3198. InvCode: $("#txt_InvCode").val(),
  3199. InvName: $("#txt_InvName").val(),
  3200. BatchCode: $("#txt_BatchCode").val(),
  3201. POStatus: $("#selShow").val()
  3202. }
  3203. $gridList.dataGrid({
  3204. url: "/JHWMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  3205. postData: { queryJson: JSON.stringify(queryJson) },
  3206. height: $(window).height() - 200,
  3207. width: $(window).width() - 300,
  3208. colModel: _Clos,
  3209. //colModel: [
  3210. // { label: "主键", name: "ID", hidden: true, key: true },
  3211. // { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  3212. // { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  3213. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  3214. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  3215. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3216. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3217. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3218. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3219. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  3220. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3221. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3222. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3223. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3224. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3225. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  3226. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3227. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3228. //],
  3229. //colModel: ColModelMain,
  3230. width: "100%",
  3231. autowidth: true,
  3232. //shrinkToFit: true,
  3233. gridComplete: function () {
  3234. },
  3235. pager: "#gridPager",
  3236. //sortname: 'DNCode,cast(Sequence as int)',
  3237. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3238. sortorder: "asc",
  3239. viewrecords: true,
  3240. multiselect: true,
  3241. //beforeSelectRow: function (rowid, e) {
  3242. // $("#gridList").jqGrid('resetSelection');
  3243. // return (true);
  3244. //},
  3245. subGrid: true, // (1)开启子表格支持
  3246. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3247. $("#gridList").jqGrid("setSelection", rowid, false);
  3248. bindSubGrid10(subgrid_id, rowid)
  3249. }
  3250. });
  3251. $("#warehouse a.btn-default").click(function () {
  3252. $("#warehouse a.btn-default").removeClass("active");
  3253. $(this).addClass("active");
  3254. $('#btn_search').trigger("click");
  3255. });
  3256. $("#btn_search").click(function () {
  3257. var warehouse = $("#warehouse a.active").attr('data-value');
  3258. var queryJson = {
  3259. POCode: $("#txt_POCode").val(),
  3260. VenCode: $("#txt_VenCode").val(),
  3261. VenName: $("#txt_VenName").val(),
  3262. InvCode: $("#txt_InvCode").val(),
  3263. InvName: $("#txt_InvName").val(),
  3264. BatchCode: $("#txt_BatchCode").val(),
  3265. POStatus: $("#selShow").val()
  3266. }
  3267. $gridList.jqGrid('setGridParam', {
  3268. postData: { queryJson: JSON.stringify(queryJson) },
  3269. }).trigger('reloadGrid');
  3270. });
  3271. }
  3272. function bindSubGrid10(subgrid_id, rowid) {
  3273. $("#gridList").jqGrid("setSelection", rowid, false);
  3274. var subgrid_table_id;
  3275. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3276. var subgrid_pager_id;
  3277. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3278. // (5)动态添加子报表的table和pager
  3279. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3280. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  3281. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3282. // (6)创建jqGrid对象
  3283. $("#" + subgrid_table_id).dataGrid({
  3284. cellEdit: true,
  3285. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3286. //colModel: [
  3287. // { label: "主键", name: "ID", hidden: true, key: true },
  3288. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3289. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3290. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3291. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3292. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3293. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3294. //],
  3295. colModel: _Clos1,
  3296. //colModel: ColModelSub,
  3297. shrinkToFit: true,//宽度自适应
  3298. multiselect: true,
  3299. prmNames: { search: "search" },
  3300. viewrecords: true,
  3301. height: "100%",
  3302. rowNum: 20,
  3303. pager: subgrid_pager_id,
  3304. });
  3305. }
  3306. //委外拒收单生成条码
  3307. function gridList11() {
  3308. var $gridList = $("#gridList");
  3309. var queryJson = {
  3310. POCode: $("#txt_POCode").val(),
  3311. VenCode: $("#txt_VenCode").val(),
  3312. VenName: $("#txt_VenName").val(),
  3313. InvCode: $("#txt_InvCode").val(),
  3314. InvName: $("#txt_InvName").val(),
  3315. BatchCode: $("#txt_BatchCode").val(),
  3316. POStatus: $("#selShow").val()
  3317. }
  3318. $gridList.dataGrid({
  3319. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  3320. postData: { queryJson: JSON.stringify(queryJson) },
  3321. height: $(window).height() - 200,
  3322. width: $(window).width() - 300,
  3323. colModel: _Clos,
  3324. //colModel: [
  3325. // { label: "主键", name: "ID", hidden: true, key: true },
  3326. // { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  3327. // { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  3328. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  3329. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  3330. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3331. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3332. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3333. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3334. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  3335. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3336. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3337. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3338. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3339. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3340. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  3341. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3342. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3343. //],
  3344. //colModel: ColModelMain,
  3345. width: "100%",
  3346. autowidth: true,
  3347. //shrinkToFit: true,
  3348. gridComplete: function () {
  3349. },
  3350. pager: "#gridPager",
  3351. // sortname: 'OOCode,cast(Sequence as int)',
  3352. sortname: "OOCode,REPLICATE('0',10-len(OOSequence))+OOSequence ",
  3353. sortorder: "asc",
  3354. viewrecords: true,
  3355. multiselect: true,
  3356. //beforeSelectRow: function (rowid, e) {
  3357. // $("#gridList").jqGrid('resetSelection');
  3358. // return (true);
  3359. //},
  3360. subGrid: true, // (1)开启子表格支持
  3361. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3362. $("#gridList").jqGrid("setSelection", rowid, false);
  3363. bindSubGrid11(subgrid_id, rowid)
  3364. }
  3365. });
  3366. $("#warehouse a.btn-default").click(function () {
  3367. $("#warehouse a.btn-default").removeClass("active");
  3368. $(this).addClass("active");
  3369. $('#btn_search').trigger("click");
  3370. });
  3371. $("#btn_search").click(function () {
  3372. var warehouse = $("#warehouse a.active").attr('data-value');
  3373. var queryJson = {
  3374. POCode: $("#txt_POCode").val(),
  3375. VenCode: $("#txt_VenCode").val(),
  3376. VenName: $("#txt_VenName").val(),
  3377. InvCode: $("#txt_InvCode").val(),
  3378. InvName: $("#txt_InvName").val(),
  3379. BatchCode: $("#txt_BatchCode").val(),
  3380. POStatus: $("#selShow").val()
  3381. }
  3382. $gridList.jqGrid('setGridParam', {
  3383. postData: { queryJson: JSON.stringify(queryJson) },
  3384. }).trigger('reloadGrid');
  3385. });
  3386. }
  3387. function bindSubGrid11(subgrid_id, rowid) {
  3388. $("#gridList").jqGrid("setSelection", rowid, false);
  3389. var subgrid_table_id;
  3390. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3391. var subgrid_pager_id;
  3392. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3393. // (5)动态添加子报表的table和pager
  3394. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3395. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).OOCode;
  3396. var Sequence = $("#gridList").jqGrid('getRowData', rowid).OOSequence;
  3397. // (6)创建jqGrid对象
  3398. $("#" + subgrid_table_id).dataGrid({
  3399. cellEdit: true,
  3400. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3401. //colModel: [
  3402. // { label: "主键", name: "ID", hidden: true, key: true },
  3403. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3404. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3405. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3406. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3407. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3408. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3409. //],
  3410. colModel: _Clos1,
  3411. //colModel: ColModelSub,
  3412. shrinkToFit: true,//宽度自适应
  3413. multiselect: true,
  3414. prmNames: { search: "search" },
  3415. viewrecords: true,
  3416. height: "100%",
  3417. rowNum: 20,
  3418. pager: subgrid_pager_id,
  3419. });
  3420. }
  3421. //领料申请退料生成条码
  3422. function gridList12() {
  3423. var $gridList = $("#gridList");
  3424. var queryJson = {
  3425. POCode: $("#txt_POCode").val(),
  3426. InvCode: $("#txt_InvCode").val(),
  3427. InvName: $("#txt_InvName").val(),
  3428. BatchCode: $("#txt_BatchCode").val(),
  3429. FromTime: $("#FromTime").val(),
  3430. ToTime: $("#ToTime").val(),
  3431. POStatus: $("#selShow").val()
  3432. }
  3433. $gridList.dataGrid({
  3434. url: "/JHWMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  3435. postData: { queryJson: JSON.stringify(queryJson) },
  3436. height: $(window).height() - 200,
  3437. width: $(window).width() - 300,
  3438. colModel: _Clos,
  3439. //colModel: [
  3440. // { label: "主键", name: "ID", hidden: true, key: true },
  3441. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  3442. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3443. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  3444. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3445. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  3446. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3447. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3448. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3449. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3450. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3451. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3452. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3453. //],
  3454. //colModel: ColModelMain,
  3455. width: "100%",
  3456. autowidth: true,
  3457. //shrinkToFit: true,
  3458. gridComplete: function () {
  3459. },
  3460. pager: "#gridPager",
  3461. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  3462. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3463. sortorder: "asc",
  3464. viewrecords: true,
  3465. multiselect: true,
  3466. //beforeSelectRow: function (rowid, e) {
  3467. // $("#gridList").jqGrid('resetSelection');
  3468. // return (true);
  3469. //},
  3470. subGrid: true, // (1)开启子表格支持
  3471. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3472. $("#gridList").jqGrid("setSelection", rowid, false);
  3473. bindSubGrid12(subgrid_id, rowid)
  3474. }
  3475. });
  3476. $("#warehouse a.btn-default").click(function () {
  3477. $("#warehouse a.btn-default").removeClass("active");
  3478. $(this).addClass("active");
  3479. $('#btn_search').trigger("click");
  3480. });
  3481. $("#btn_search").click(function () {
  3482. var warehouse = $("#warehouse a.active").attr('data-value');
  3483. var queryJson = {
  3484. POCode: $("#txt_POCode").val(),
  3485. InvCode: $("#txt_InvCode").val(),
  3486. InvName: $("#txt_InvName").val(),
  3487. BatchCode: $("#txt_BatchCode").val(),
  3488. FromTime: $("#FromTime").val(),
  3489. ToTime: $("#ToTime").val(),
  3490. POStatus: $("#selShow").val()
  3491. }
  3492. $gridList.jqGrid('setGridParam', {
  3493. postData: { queryJson: JSON.stringify(queryJson) },
  3494. }).trigger('reloadGrid');
  3495. });
  3496. }
  3497. function bindSubGrid12(subgrid_id, rowid) {
  3498. $("#gridList").jqGrid("setSelection", rowid, false);
  3499. var subgrid_table_id;
  3500. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3501. var subgrid_pager_id;
  3502. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3503. // (5)动态添加子报表的table和pager
  3504. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3505. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  3506. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3507. // (6)创建jqGrid对象
  3508. $("#" + subgrid_table_id).dataGrid({
  3509. cellEdit: true,
  3510. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3511. //colModel: [
  3512. // { label: "主键", name: "ID", hidden: true, key: true },
  3513. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3514. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3515. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3516. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3517. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3518. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3519. //],
  3520. colModel: _Clos1,
  3521. //colModel: ColModelSub,
  3522. shrinkToFit: true,//宽度自适应
  3523. multiselect: true,
  3524. prmNames: { search: "search" },
  3525. viewrecords: true,
  3526. height: "100%",
  3527. rowNum: 20,
  3528. pager: subgrid_pager_id,
  3529. });
  3530. }
  3531. //材料出库退料
  3532. function gridList13() {
  3533. var $gridList = $("#gridList");
  3534. var queryJson = {
  3535. POCode: $("#txt_POCode").val(),
  3536. InvCode: $("#txt_InvCode").val(),
  3537. InvName: $("#txt_InvName").val(),
  3538. BatchCode: $("#txt_BatchCode").val(),
  3539. POStatus: $("#selShow").val(),
  3540. SCode: $("#txt_SCode").val(),
  3541. }
  3542. $gridList.dataGrid({
  3543. url: "/JHWMS/WMSCreateItemLot/GetGridJsonCLCK" + "?" + Math.random(),
  3544. postData: { queryJson: JSON.stringify(queryJson) },
  3545. height: $(window).height() - 200,
  3546. width: $(window).width() - 300,
  3547. colModel: _Clos,
  3548. //colModel: [
  3549. // { label: "主键", name: "ID", hidden: true, key: true },
  3550. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  3551. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3552. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  3553. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3554. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  3555. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3556. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3557. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3558. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3559. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3560. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3561. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3562. //],
  3563. //colModel: ColModelMain,
  3564. width: "100%",
  3565. autowidth: true,
  3566. //shrinkToFit: true,
  3567. gridComplete: function () {
  3568. },
  3569. pager: "#gridPager",
  3570. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  3571. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3572. sortorder: "asc",
  3573. viewrecords: true,
  3574. multiselect: true,
  3575. //beforeSelectRow: function (rowid, e) {
  3576. // $("#gridList").jqGrid('resetSelection');
  3577. // return (true);
  3578. //},
  3579. subGrid: true, // (1)开启子表格支持
  3580. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3581. $("#gridList").jqGrid("setSelection", rowid, false);
  3582. bindSubGrid13(subgrid_id, rowid)
  3583. }
  3584. });
  3585. $("#warehouse a.btn-default").click(function () {
  3586. $("#warehouse a.btn-default").removeClass("active");
  3587. $(this).addClass("active");
  3588. $('#btn_search').trigger("click");
  3589. });
  3590. $("#btn_search").click(function () {
  3591. var warehouse = $("#warehouse a.active").attr('data-value');
  3592. var queryJson = {
  3593. POCode: $("#txt_POCode").val(),
  3594. InvCode: $("#txt_InvCode").val(),
  3595. InvName: $("#txt_InvName").val(),
  3596. BatchCode: $("#txt_BatchCode").val(),
  3597. POStatus: $("#selShow").val(),
  3598. SCode: $("#txt_SCode").val(),
  3599. }
  3600. $gridList.jqGrid('setGridParam', {
  3601. postData: { queryJson: JSON.stringify(queryJson) },
  3602. }).trigger('reloadGrid');
  3603. });
  3604. }
  3605. function bindSubGrid13(subgrid_id, rowid) {
  3606. $("#gridList").jqGrid("setSelection", rowid, false);
  3607. var subgrid_table_id;
  3608. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3609. var subgrid_pager_id;
  3610. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3611. // (5)动态添加子报表的table和pager
  3612. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3613. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  3614. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3615. // (6)创建jqGrid对象
  3616. $("#" + subgrid_table_id).dataGrid({
  3617. cellEdit: true,
  3618. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3619. //colModel: [
  3620. // { label: "主键", name: "ID", hidden: true, key: true },
  3621. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3622. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3623. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3624. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3625. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3626. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3627. //],
  3628. colModel: _Clos1,
  3629. //colModel: ColModelSub,
  3630. shrinkToFit: true,//宽度自适应
  3631. multiselect: true,
  3632. prmNames: { search: "search" },
  3633. viewrecords: true,
  3634. height: "100%",
  3635. rowNum: 20,
  3636. pager: subgrid_pager_id,
  3637. });
  3638. }
  3639. //委外领料申请退料
  3640. function gridList14() {
  3641. var $gridList = $("#gridList");
  3642. var queryJson = {
  3643. POCode: $("#txt_POCode").val(),
  3644. InvCode: $("#txt_InvCode").val(),
  3645. InvName: $("#txt_InvName").val(),
  3646. BatchCode: $("#txt_BatchCode").val(),
  3647. POStatus: $("#selShow").val()
  3648. }
  3649. $gridList.dataGrid({
  3650. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWWLLTL" + "?" + Math.random(),
  3651. postData: { queryJson: JSON.stringify(queryJson) },
  3652. height: $(window).height() - 200,
  3653. width: $(window).width() - 300,
  3654. colModel: _Clos,
  3655. //colModel: [
  3656. // { label: "主键", name: "ID", hidden: true, key: true },
  3657. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3658. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3659. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3660. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3661. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3662. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3663. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3664. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3665. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3666. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3667. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3668. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3669. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3670. //],
  3671. //colModel: ColModelMain,
  3672. width: "100%",
  3673. autowidth: true,
  3674. //shrinkToFit: true,
  3675. gridComplete: function () {
  3676. },
  3677. pager: "#gridPager",
  3678. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3679. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3680. sortorder: "asc",
  3681. viewrecords: true,
  3682. multiselect: true,
  3683. //beforeSelectRow: function (rowid, e) {
  3684. // $("#gridList").jqGrid('resetSelection');
  3685. // return (true);
  3686. //},
  3687. subGrid: true, // (1)开启子表格支持
  3688. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3689. $("#gridList").jqGrid("setSelection", rowid, false);
  3690. bindSubGrid14(subgrid_id, rowid)
  3691. }
  3692. });
  3693. $("#warehouse a.btn-default").click(function () {
  3694. $("#warehouse a.btn-default").removeClass("active");
  3695. $(this).addClass("active");
  3696. $('#btn_search').trigger("click");
  3697. });
  3698. $("#btn_search").click(function () {
  3699. var warehouse = $("#warehouse a.active").attr('data-value');
  3700. var queryJson = {
  3701. POCode: $("#txt_POCode").val(),
  3702. InvCode: $("#txt_InvCode").val(),
  3703. InvName: $("#txt_InvName").val(),
  3704. BatchCode: $("#txt_BatchCode").val(),
  3705. POStatus: $("#selShow").val()
  3706. }
  3707. $gridList.jqGrid('setGridParam', {
  3708. postData: { queryJson: JSON.stringify(queryJson) },
  3709. }).trigger('reloadGrid');
  3710. });
  3711. }
  3712. function bindSubGrid14(subgrid_id, rowid) {
  3713. $("#gridList").jqGrid("setSelection", rowid, false);
  3714. var subgrid_table_id;
  3715. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3716. var subgrid_pager_id;
  3717. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3718. // (5)动态添加子报表的table和pager
  3719. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3720. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3721. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3722. // (6)创建jqGrid对象
  3723. $("#" + subgrid_table_id).dataGrid({
  3724. cellEdit: true,
  3725. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3726. //colModel: [
  3727. // { label: "主键", name: "ID", hidden: true, key: true },
  3728. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3729. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3730. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3731. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3732. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3733. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3734. //],
  3735. colModel: _Clos1,
  3736. //colModel: ColModelSub,
  3737. shrinkToFit: true,//宽度自适应
  3738. multiselect: true,
  3739. prmNames: { search: "search" },
  3740. viewrecords: true,
  3741. height: "100%",
  3742. rowNum: 20,
  3743. pager: subgrid_pager_id,
  3744. });
  3745. }
  3746. //委外材料出库
  3747. function gridList15() {
  3748. var $gridList = $("#gridList");
  3749. var queryJson = {
  3750. POCode: $("#txt_POCode").val(),
  3751. InvCode: $("#txt_InvCode").val(),
  3752. InvName: $("#txt_InvName").val(),
  3753. BatchCode: $("#txt_BatchCode").val(),
  3754. POStatus: $("#selShow").val()
  3755. }
  3756. $gridList.dataGrid({
  3757. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWWCLCK" + "?" + Math.random(),
  3758. postData: { queryJson: JSON.stringify(queryJson) },
  3759. height: $(window).height() - 200,
  3760. width: $(window).width() - 300,
  3761. colModel: _Clos,
  3762. //colModel: [
  3763. // { label: "主键", name: "ID", hidden: true, key: true },
  3764. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3765. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3766. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3767. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3768. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3769. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3770. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3771. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3772. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3773. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3774. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3775. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3776. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3777. //],
  3778. //colModel: ColModelMain,
  3779. width: "100%",
  3780. autowidth: true,
  3781. //shrinkToFit: true,
  3782. gridComplete: function () {
  3783. },
  3784. pager: "#gridPager",
  3785. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3786. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3787. sortorder: "asc",
  3788. viewrecords: true,
  3789. multiselect: true,
  3790. //beforeSelectRow: function (rowid, e) {
  3791. // $("#gridList").jqGrid('resetSelection');
  3792. // return (true);
  3793. //},
  3794. subGrid: true, // (1)开启子表格支持
  3795. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3796. $("#gridList").jqGrid("setSelection", rowid, false);
  3797. bindSubGrid15(subgrid_id, rowid)
  3798. }
  3799. });
  3800. $("#warehouse a.btn-default").click(function () {
  3801. $("#warehouse a.btn-default").removeClass("active");
  3802. $(this).addClass("active");
  3803. $('#btn_search').trigger("click");
  3804. });
  3805. $("#btn_search").click(function () {
  3806. var warehouse = $("#warehouse a.active").attr('data-value');
  3807. var queryJson = {
  3808. POCode: $("#txt_POCode").val(),
  3809. InvCode: $("#txt_InvCode").val(),
  3810. InvName: $("#txt_InvName").val(),
  3811. BatchCode: $("#txt_BatchCode").val(),
  3812. POStatus: $("#selShow").val()
  3813. }
  3814. $gridList.jqGrid('setGridParam', {
  3815. postData: { queryJson: JSON.stringify(queryJson) },
  3816. }).trigger('reloadGrid');
  3817. });
  3818. }
  3819. function bindSubGrid15(subgrid_id, rowid) {
  3820. $("#gridList").jqGrid("setSelection", rowid, false);
  3821. var subgrid_table_id;
  3822. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3823. var subgrid_pager_id;
  3824. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3825. // (5)动态添加子报表的table和pager
  3826. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3827. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3828. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3829. // (6)创建jqGrid对象
  3830. $("#" + subgrid_table_id).dataGrid({
  3831. cellEdit: true,
  3832. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3833. //colModel: [
  3834. // { label: "主键", name: "ID", hidden: true, key: true },
  3835. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3836. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3837. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3838. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3839. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3840. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3841. //],
  3842. colModel: _Clos1,
  3843. //colModel: ColModelSub,
  3844. shrinkToFit: true,//宽度自适应
  3845. //multiselect: true,
  3846. prmNames: { search: "search" },
  3847. multiselect: true,
  3848. viewrecords: true,
  3849. height: "100%",
  3850. rowNum: 20,
  3851. pager: subgrid_pager_id,
  3852. });
  3853. }
  3854. function gridList16() {
  3855. var $gridList = $("#gridList");
  3856. var queryJson = {
  3857. POCode: $("#txt_POCode").val(),
  3858. InvCode: $("#txt_InvCode").val(),
  3859. InvName: $("#txt_InvName").val(),
  3860. BatchCode: $("#txt_BatchCode").val(),
  3861. POStatus: $("#selShow").val()
  3862. }
  3863. $gridList.dataGrid({
  3864. url: "/JHWMS/WMSCreateItemLot/GetGridJsonFGGD" + "?" + Math.random(),
  3865. postData: { queryJson: JSON.stringify(queryJson) },
  3866. height: $(window).height() - 200,
  3867. width: $(window).width() - 300,
  3868. colModel: _Clos,
  3869. //colModel: [
  3870. // { label: "主键", name: "ID", hidden: true, key: true },
  3871. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3872. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3873. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3874. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3875. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3876. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3877. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3878. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3879. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3880. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3881. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3882. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3883. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3884. //],
  3885. //colModel: ColModelMain,
  3886. width: "100%",
  3887. autowidth: true,
  3888. //shrinkToFit: true,
  3889. gridComplete: function () {
  3890. },
  3891. pager: "#gridPager",
  3892. // sortname: 'MOCode,cast(Sequence as int)',
  3893. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3894. sortorder: "asc",
  3895. viewrecords: true,
  3896. multiselect: true,
  3897. //beforeSelectRow: function (rowid, e) {
  3898. // $("#gridList").jqGrid('resetSelection');
  3899. // return (true);
  3900. //},
  3901. subGrid: true, // (1)开启子表格支持
  3902. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3903. $("#gridList").jqGrid("setSelection", rowid, false);
  3904. bindSubGrid16(subgrid_id, rowid)
  3905. }
  3906. });
  3907. $("#warehouse a.btn-default").click(function () {
  3908. $("#warehouse a.btn-default").removeClass("active");
  3909. $(this).addClass("active");
  3910. $('#btn_search').trigger("click");
  3911. });
  3912. $("#btn_search").click(function () {
  3913. var warehouse = $("#warehouse a.active").attr('data-value');
  3914. var queryJson = {
  3915. POCode: $("#txt_POCode").val(),
  3916. InvCode: $("#txt_InvCode").val(),
  3917. InvName: $("#txt_InvName").val(),
  3918. BatchCode: $("#txt_BatchCode").val(),
  3919. POStatus: $("#selShow").val()
  3920. }
  3921. $gridList.jqGrid('setGridParam', {
  3922. postData: { queryJson: JSON.stringify(queryJson) },
  3923. }).trigger('reloadGrid');
  3924. });
  3925. }
  3926. function bindSubGrid16(subgrid_id, rowid) {
  3927. $("#gridList").jqGrid("setSelection", rowid, false);
  3928. var subgrid_table_id;
  3929. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3930. var subgrid_pager_id;
  3931. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3932. // (5)动态添加子报表的table和pager
  3933. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3934. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  3935. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3936. // (6)创建jqGrid对象
  3937. $("#" + subgrid_table_id).dataGrid({
  3938. cellEdit: true,
  3939. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3940. //colModel: [
  3941. // { label: "主键", name: "ID", hidden: true, key: true },
  3942. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3943. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3944. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3945. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3946. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3947. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3948. //],
  3949. colModel: _Clos1,
  3950. //colModel: ColModelSub,
  3951. shrinkToFit: true,//宽度自适应
  3952. multiselect: true,
  3953. prmNames: { search: "search" },
  3954. viewrecords: true,
  3955. height: "100%",
  3956. rowNum: 20,
  3957. pager: subgrid_pager_id,
  3958. });
  3959. }
  3960. //检验不合格
  3961. function gridList17() {
  3962. var $gridList = $("#gridList");
  3963. var queryJson = {
  3964. POCode: $("#txt_POCode").val(),
  3965. InvCode: $("#txt_InvCode").val(),
  3966. InvName: $("#txt_InvName").val(),
  3967. BatchCode: $("#txt_BatchCode").val(),
  3968. POStatus: $("#selShow").val()
  3969. }
  3970. $gridList.dataGrid({
  3971. url: "/JHWMS/WMSCreateItemLot/GetGridJsonBHGTM" + "?" + Math.random(),
  3972. postData: { queryJson: JSON.stringify(queryJson) },
  3973. height: $(window).height() - 200,
  3974. width: $(window).width() - 300,
  3975. colModel: _Clos,
  3976. //colModel: [
  3977. // { label: "主键", name: "ID", hidden: true, key: true },
  3978. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3979. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3980. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3981. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3982. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3983. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3984. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3985. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3986. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3987. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3988. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3989. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3990. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3991. //],
  3992. //colModel: ColModelMain,
  3993. width: "100%",
  3994. autowidth: true,
  3995. //shrinkToFit: true,
  3996. gridComplete: function () {
  3997. },
  3998. pager: "#gridPager",
  3999. sortname: 'LotNo',
  4000. sortorder: "asc",
  4001. viewrecords: true,
  4002. multiselect: true,
  4003. //beforeSelectRow: function (rowid, e) {
  4004. // $("#gridList").jqGrid('resetSelection');
  4005. // return (true);
  4006. //},
  4007. subGrid: true, // (1)开启子表格支持
  4008. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4009. $("#gridList").jqGrid("setSelection", rowid, false);
  4010. bindSubGrid17(subgrid_id, rowid)
  4011. }
  4012. });
  4013. $("#warehouse a.btn-default").click(function () {
  4014. $("#warehouse a.btn-default").removeClass("active");
  4015. $(this).addClass("active");
  4016. $('#btn_search').trigger("click");
  4017. });
  4018. $("#btn_search").click(function () {
  4019. var warehouse = $("#warehouse a.active").attr('data-value');
  4020. var queryJson = {
  4021. POCode: $("#txt_POCode").val(),
  4022. InvCode: $("#txt_InvCode").val(),
  4023. InvName: $("#txt_InvName").val(),
  4024. BatchCode: $("#txt_BatchCode").val(),
  4025. POStatus: $("#selShow").val()
  4026. }
  4027. $gridList.jqGrid('setGridParam', {
  4028. postData: { queryJson: JSON.stringify(queryJson) },
  4029. }).trigger('reloadGrid');
  4030. });
  4031. }
  4032. function bindSubGrid17(subgrid_id, rowid) {
  4033. $("#gridList").jqGrid("setSelection", rowid, false);
  4034. var subgrid_table_id;
  4035. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4036. var subgrid_pager_id;
  4037. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4038. // (5)动态添加子报表的table和pager
  4039. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4040. var LotNo = $("#gridList").jqGrid('getRowData', rowid).LotNo;
  4041. // var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4042. // (6)创建jqGrid对象
  4043. $("#" + subgrid_table_id).dataGrid({
  4044. cellEdit: true,
  4045. url: "/JHWMS/WMSCreateItemLot/GetSubGridJsonBHGTM?LotNo=" + LotNo + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4046. //colModel: [
  4047. // { label: "主键", name: "ID", hidden: true, key: true },
  4048. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  4049. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  4050. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  4051. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  4052. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  4053. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  4054. //],
  4055. colModel: _Clos1,
  4056. //colModel: ColModelSub,
  4057. shrinkToFit: true,//宽度自适应
  4058. multiselect: true,
  4059. prmNames: { search: "search" },
  4060. viewrecords: true,
  4061. height: "100%",
  4062. rowNum: 20,
  4063. pager: subgrid_pager_id,
  4064. });
  4065. }
  4066. function gridList18() {
  4067. var $gridList = $("#gridList");
  4068. var queryJson = {
  4069. POCode: $("#txt_POCode").val(),
  4070. InvCode: $("#txt_InvCode").val(),
  4071. InvName: $("#txt_InvName").val(),
  4072. BatchCode: $("#txt_BatchCode").val(),
  4073. POStatus: $("#selShow").val()
  4074. }
  4075. $gridList.dataGrid({
  4076. url: "/JHWMS/WMSCreateItemLot/GetGridJsonFCP" + "?" + Math.random(),
  4077. postData: { queryJson: JSON.stringify(queryJson) },
  4078. height: $(window).height() - 200,
  4079. width: $(window).width() - 300,
  4080. colModel: _Clos,
  4081. //colModel: [
  4082. // { label: "主键", name: "ID", hidden: true, key: true },
  4083. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  4084. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  4085. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  4086. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  4087. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  4088. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  4089. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  4090. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  4091. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  4092. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  4093. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  4094. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  4095. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  4096. //],
  4097. //colModel: ColModelMain,
  4098. width: "100%",
  4099. autowidth: true,
  4100. //shrinkToFit: true,
  4101. gridComplete: function () {
  4102. },
  4103. pager: "#gridPager",
  4104. // sortname: 'MOCode,cast(Sequence as int)',
  4105. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  4106. sortorder: "asc",
  4107. viewrecords: true,
  4108. multiselect: true,
  4109. //beforeSelectRow: function (rowid, e) {
  4110. // $("#gridList").jqGrid('resetSelection');
  4111. // return (true);
  4112. //},
  4113. subGrid: true, // (1)开启子表格支持
  4114. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4115. $("#gridList").jqGrid("setSelection", rowid, false);
  4116. bindSubGrid18(subgrid_id, rowid)
  4117. }
  4118. });
  4119. $("#warehouse a.btn-default").click(function () {
  4120. $("#warehouse a.btn-default").removeClass("active");
  4121. $(this).addClass("active");
  4122. $('#btn_search').trigger("click");
  4123. });
  4124. $("#btn_search").click(function () {
  4125. var warehouse = $("#warehouse a.active").attr('data-value');
  4126. var queryJson = {
  4127. POCode: $("#txt_POCode").val(),
  4128. InvCode: $("#txt_InvCode").val(),
  4129. InvName: $("#txt_InvName").val(),
  4130. BatchCode: $("#txt_BatchCode").val(),
  4131. POStatus: $("#selShow").val()
  4132. }
  4133. $gridList.jqGrid('setGridParam', {
  4134. postData: { queryJson: JSON.stringify(queryJson) },
  4135. }).trigger('reloadGrid');
  4136. });
  4137. }
  4138. function bindSubGrid18(subgrid_id, rowid) {
  4139. $("#gridList").jqGrid("setSelection", rowid, false);
  4140. var subgrid_table_id;
  4141. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4142. var subgrid_pager_id;
  4143. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4144. // (5)动态添加子报表的table和pager
  4145. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4146. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  4147. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4148. // (6)创建jqGrid对象
  4149. $("#" + subgrid_table_id).dataGrid({
  4150. cellEdit: true,
  4151. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4152. //colModel: [
  4153. // { label: "主键", name: "ID", hidden: true, key: true },
  4154. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  4155. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  4156. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  4157. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  4158. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  4159. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  4160. //],
  4161. colModel: _Clos1,
  4162. //colModel: ColModelSub,
  4163. shrinkToFit: true,//宽度自适应
  4164. multiselect: true,
  4165. prmNames: { search: "search" },
  4166. viewrecords: true,
  4167. height: "100%",
  4168. rowNum: 20,
  4169. pager: subgrid_pager_id,
  4170. });
  4171. }
  4172. function gridList20() {
  4173. var $gridList = $("#gridList");
  4174. var queryJson = {
  4175. POCode: $("#txt_POCode").val(),
  4176. InvCode: $("#txt_InvCode").val(),
  4177. InvName: $("#txt_InvName").val(),
  4178. BatchCode: $("#txt_BatchCode").val(),
  4179. POStatus: $("#selShow").val()
  4180. }
  4181. $gridList.dataGrid({
  4182. url: "/JHWMS/WMSCreateItemLot/GetGridJsonTransfer" + "?" + Math.random(),
  4183. postData: { queryJson: JSON.stringify(queryJson) },
  4184. height: $(window).height() - 200,
  4185. width: $(window).width() - 300,
  4186. colModel: _Clos,
  4187. width: "100%",
  4188. autowidth: true,
  4189. //shrinkToFit: true,
  4190. gridComplete: function () {
  4191. },
  4192. pager: "#gridPager",
  4193. // sortname: 'MOCode,cast(Sequence as int)',
  4194. sortname: "TransferNO,Cast(Sequence as int) ",
  4195. sortorder: "asc",
  4196. viewrecords: true,
  4197. multiselect: true,
  4198. //beforeSelectRow: function (rowid, e) {
  4199. // $("#gridList").jqGrid('resetSelection');
  4200. // return (true);
  4201. //},
  4202. subGrid: true, // (1)开启子表格支持
  4203. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4204. $("#gridList").jqGrid("setSelection", rowid, false);
  4205. bindSubGrid20(subgrid_id, rowid)
  4206. }
  4207. });
  4208. $("#warehouse a.btn-default").click(function () {
  4209. $("#warehouse a.btn-default").removeClass("active");
  4210. $(this).addClass("active");
  4211. $('#btn_search').trigger("click");
  4212. });
  4213. $("#btn_search").click(function () {
  4214. var warehouse = $("#warehouse a.active").attr('data-value');
  4215. var queryJson = {
  4216. POCode: $("#txt_POCode").val(),
  4217. InvCode: $("#txt_InvCode").val(),
  4218. InvName: $("#txt_InvName").val(),
  4219. BatchCode: $("#txt_BatchCode").val(),
  4220. POStatus: $("#selShow").val()
  4221. }
  4222. $gridList.jqGrid('setGridParam', {
  4223. postData: { queryJson: JSON.stringify(queryJson) },
  4224. }).trigger('reloadGrid');
  4225. });
  4226. }
  4227. function bindSubGrid20(subgrid_id, rowid) {
  4228. debugger;
  4229. $("#gridList").jqGrid("setSelection", rowid, false);
  4230. var subgrid_table_id;
  4231. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4232. var subgrid_pager_id;
  4233. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4234. // (5)动态添加子报表的table和pager
  4235. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4236. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4237. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4238. // (6)创建jqGrid对象
  4239. $("#" + subgrid_table_id).dataGrid({
  4240. cellEdit: true,
  4241. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4242. colModel: _Clos1,
  4243. //colModel: ColModelSub,
  4244. shrinkToFit: true,//宽度自适应
  4245. multiselect: true,
  4246. prmNames: { search: "search" },
  4247. viewrecords: true,
  4248. height: "100%",
  4249. rowNum: 20,
  4250. pager: subgrid_pager_id,
  4251. });
  4252. }
  4253. //采购入库 ICSPurchaseReceive
  4254. function gridList22() {
  4255. var $gridList = $("#gridList");
  4256. var queryJson = {
  4257. POCode: $("#txt_POCode").val(),
  4258. InvCode: $("#txt_InvCode").val(),
  4259. InvName: $("#txt_InvName").val(),
  4260. BatchCode: $("#txt_BatchCode").val(),
  4261. FromTime: $("#FromTime").val(),
  4262. ToTime: $("#ToTime").val(),
  4263. WHCode: $("#txt_WHCode").val(),
  4264. POStatus: $("#selShow").val(),
  4265. WHStatus: $("#selStatus").val(),
  4266. }
  4267. $gridList.dataGrid({
  4268. url: "/JHWMS/WMSCreateItemLot/GetGridJsonPurchaseReceive" + "?" + Math.random(),
  4269. postData: { queryJson: JSON.stringify(queryJson) },
  4270. height: $(window).height() - 200,
  4271. width: $(window).width() - 300,
  4272. colModel: _Clos,
  4273. width: "100%",
  4274. cellEdit: true,
  4275. cellsubmit: "clientArray",
  4276. autowidth: true,
  4277. //shrinkToFit: true,
  4278. gridComplete: function () {
  4279. },
  4280. pager: "#gridPager",
  4281. // sortname: 'MOCode,cast(Sequence as int)',
  4282. sortname: "RCVCode ",
  4283. sortorder: "desc",
  4284. viewrecords: true,
  4285. multiselect: true,
  4286. //beforeSelectRow: function (rowid, e) {
  4287. // $("#gridList").jqGrid('resetSelection');
  4288. // return (true);
  4289. //},
  4290. subGrid: true, // (1)开启子表格支持
  4291. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4292. $("#gridList").jqGrid("setSelection", rowid, false);
  4293. bindSubGrid22(subgrid_id, rowid)
  4294. }
  4295. });
  4296. $("#warehouse a.btn-default").click(function () {
  4297. $("#warehouse a.btn-default").removeClass("active");
  4298. $(this).addClass("active");
  4299. $('#btn_search').trigger("click");
  4300. });
  4301. $("#btn_search").click(function () {
  4302. var warehouse = $("#warehouse a.active").attr('data-value');
  4303. var queryJson = {
  4304. POCode: $("#txt_POCode").val(),
  4305. InvCode: $("#txt_InvCode").val(),
  4306. InvName: $("#txt_InvName").val(),
  4307. BatchCode: $("#txt_BatchCode").val(),
  4308. FromTime: $("#FromTime").val(),
  4309. ToTime: $("#ToTime").val(),
  4310. WHCode: $("#txt_WHCode").val(),
  4311. POStatus: $("#selShow").val(),
  4312. WHStatus: $("#selStatus").val(),
  4313. }
  4314. $gridList.jqGrid('setGridParam', {
  4315. postData: { queryJson: JSON.stringify(queryJson) },
  4316. }).trigger('reloadGrid');
  4317. });
  4318. }
  4319. function bindSubGrid22(subgrid_id, rowid) {
  4320. debugger;
  4321. $("#gridList").jqGrid("setSelection", rowid, false);
  4322. var subgrid_table_id;
  4323. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4324. var subgrid_pager_id;
  4325. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4326. // (5)动态添加子报表的table和pager
  4327. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4328. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  4329. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4330. var isPrint = $("#selPrint").val();
  4331. // (6)创建jqGrid对象
  4332. $("#" + subgrid_table_id).dataGrid({
  4333. cellEdit: true,
  4334. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4335. colModel: _Clos1,
  4336. //colModel: ColModelSub,
  4337. shrinkToFit: true,//宽度自适应
  4338. multiselect: true,
  4339. prmNames: { search: "search" },
  4340. viewrecords: true,
  4341. height: "100%",
  4342. rowNum: 20,
  4343. pager: subgrid_pager_id,
  4344. });
  4345. }
  4346. //委外采购入库 ICSOutPurchaseReceive
  4347. function gridList23() {
  4348. var $gridList = $("#gridList");
  4349. var queryJson = {
  4350. POCode: $("#txt_POCode").val(),
  4351. SourceCode: $("#txt_SourceCode").val(),
  4352. VenCode: $("#txt_VenCode").val(),
  4353. VenName: $("#txt_VenName").val(),
  4354. InvCode: $("#txt_InvCode").val(),
  4355. InvName: $("#txt_InvName").val(),
  4356. BatchCode: $("#txt_BatchCode").val(),
  4357. FromTime: $("#FromTime").val(),
  4358. ToTime: $("#ToTime").val(),
  4359. WHCode: $("#txt_WHCode").val(),
  4360. POStatus: $("#selShow").val(),
  4361. WHStatus: $("#selStatus").val(),
  4362. }
  4363. $gridList.dataGrid({
  4364. url: "/JHWMS/WMSCreateItemLot/GetGridJsonOutPurchaseReceive" + "?" + Math.random(),
  4365. postData: { queryJson: JSON.stringify(queryJson) },
  4366. height: $(window).height() - 200,
  4367. width: $(window).width() - 300,
  4368. colModel: _Clos,
  4369. width: "100%",
  4370. autowidth: true,
  4371. //shrinkToFit: true,
  4372. gridComplete: function () {
  4373. },
  4374. pager: "#gridPager",
  4375. // sortname: 'MOCode,cast(Sequence as int)',
  4376. sortname: "RCVCode ",
  4377. sortorder: "desc",
  4378. viewrecords: true,
  4379. multiselect: true,
  4380. //beforeSelectRow: function (rowid, e) {
  4381. // $("#gridList").jqGrid('resetSelection');
  4382. // return (true);
  4383. //},
  4384. subGrid: true, // (1)开启子表格支持
  4385. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4386. $("#gridList").jqGrid("setSelection", rowid, false);
  4387. bindSubGrid23(subgrid_id, rowid)
  4388. }
  4389. });
  4390. $("#warehouse a.btn-default").click(function () {
  4391. $("#warehouse a.btn-default").removeClass("active");
  4392. $(this).addClass("active");
  4393. $('#btn_search').trigger("click");
  4394. });
  4395. $("#btn_search").click(function () {
  4396. var warehouse = $("#warehouse a.active").attr('data-value');
  4397. var queryJson = {
  4398. POCode: $("#txt_POCode").val(),
  4399. SourceCode: $("#txt_SourceCode").val(),
  4400. VenCode: $("#txt_VenCode").val(),
  4401. VenName: $("#txt_VenName").val(),
  4402. InvCode: $("#txt_InvCode").val(),
  4403. InvName: $("#txt_InvName").val(),
  4404. BatchCode: $("#txt_BatchCode").val(),
  4405. FromTime: $("#FromTime").val(),
  4406. ToTime: $("#ToTime").val(),
  4407. WHCode: $("#txt_WHCode").val(),
  4408. POStatus: $("#selShow").val(),
  4409. WHStatus: $("#selStatus").val(),
  4410. }
  4411. $gridList.jqGrid('setGridParam', {
  4412. postData: { queryJson: JSON.stringify(queryJson) },
  4413. }).trigger('reloadGrid');
  4414. });
  4415. }
  4416. function bindSubGrid23(subgrid_id, rowid) {
  4417. debugger;
  4418. $("#gridList").jqGrid("setSelection", rowid, false);
  4419. var subgrid_table_id;
  4420. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4421. var subgrid_pager_id;
  4422. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4423. // (5)动态添加子报表的table和pager
  4424. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4425. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  4426. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4427. // (6)创建jqGrid对象
  4428. $("#" + subgrid_table_id).dataGrid({
  4429. cellEdit: true,
  4430. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4431. colModel: _Clos1,
  4432. //colModel: ColModelSub,
  4433. shrinkToFit: true,//宽度自适应
  4434. multiselect: true,
  4435. prmNames: { search: "search" },
  4436. viewrecords: true,
  4437. height: "100%",
  4438. rowNum: 20,
  4439. pager: subgrid_pager_id,
  4440. });
  4441. }
  4442. //线边仓调拨申请单生成条码(派纳)
  4443. function gridList201() {
  4444. var $gridList = $("#gridList");
  4445. var queryJson = {
  4446. POCode: $("#txt_POCode").val(),
  4447. InvCode: $("#txt_InvCode").val(),
  4448. InvName: $("#txt_InvName").val(),
  4449. BatchCode: $("#txt_BatchCode").val(),
  4450. POStatus: $("#selShow").val()
  4451. }
  4452. $gridList.dataGrid({
  4453. url: "/JHWMS/WMSCreateItemLot/GetGridJsonTransferApplicationPN" + "?" + Math.random(),
  4454. postData: { queryJson: JSON.stringify(queryJson) },
  4455. height: $(window).height() - 200,
  4456. width: $(window).width() - 300,
  4457. colModel: _Clos,
  4458. width: "100%",
  4459. autowidth: true,
  4460. //shrinkToFit: true,
  4461. gridComplete: function () {
  4462. },
  4463. pager: "#gridPager",
  4464. // sortname: 'MOCode,cast(Sequence as int)',
  4465. sortname: "TransferNO,Cast(Sequence as int) ",
  4466. sortorder: "asc",
  4467. viewrecords: true,
  4468. multiselect: true,
  4469. //beforeSelectRow: function (rowid, e) {
  4470. // $("#gridList").jqGrid('resetSelection');
  4471. // return (true);
  4472. //},
  4473. subGrid: true, // (1)开启子表格支持
  4474. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4475. $("#gridList").jqGrid("setSelection", rowid, false);
  4476. bindSubGrid201(subgrid_id, rowid)
  4477. }
  4478. });
  4479. $("#warehouse a.btn-default").click(function () {
  4480. $("#warehouse a.btn-default").removeClass("active");
  4481. $(this).addClass("active");
  4482. $('#btn_search').trigger("click");
  4483. });
  4484. $("#btn_search").click(function () {
  4485. var warehouse = $("#warehouse a.active").attr('data-value');
  4486. var queryJson = {
  4487. POCode: $("#txt_POCode").val(),
  4488. InvCode: $("#txt_InvCode").val(),
  4489. InvName: $("#txt_InvName").val(),
  4490. BatchCode: $("#txt_BatchCode").val(),
  4491. POStatus: $("#selShow").val()
  4492. }
  4493. $gridList.jqGrid('setGridParam', {
  4494. postData: { queryJson: JSON.stringify(queryJson) },
  4495. }).trigger('reloadGrid');
  4496. });
  4497. }
  4498. //调拨申请单生成条码
  4499. function gridList202() {
  4500. var $gridList = $("#gridList");
  4501. var queryJson = {
  4502. POCode: $("#txt_POCode").val(),
  4503. InvCode: $("#txt_InvCode").val(),
  4504. InvName: $("#txt_InvName").val(),
  4505. BatchCode: $("#txt_BatchCode").val(),
  4506. POStatus: $("#selShow").val()
  4507. }
  4508. $gridList.dataGrid({
  4509. url: "/JHWMS/WMSCreateItemLot/GetGridJsonTransferApplication" + "?" + Math.random(),
  4510. postData: { queryJson: JSON.stringify(queryJson) },
  4511. height: $(window).height() - 200,
  4512. width: $(window).width() - 300,
  4513. colModel: _Clos,
  4514. width: "100%",
  4515. autowidth: true,
  4516. //shrinkToFit: true,
  4517. gridComplete: function () {
  4518. },
  4519. pager: "#gridPager",
  4520. // sortname: 'MOCode,cast(Sequence as int)',
  4521. sortname: "TransferNO,Cast(Sequence as int) ",
  4522. sortorder: "asc",
  4523. viewrecords: true,
  4524. multiselect: true,
  4525. //beforeSelectRow: function (rowid, e) {
  4526. // $("#gridList").jqGrid('resetSelection');
  4527. // return (true);
  4528. //},
  4529. subGrid: true, // (1)开启子表格支持
  4530. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4531. $("#gridList").jqGrid("setSelection", rowid, false);
  4532. bindSubGrid202(subgrid_id, rowid)
  4533. }
  4534. });
  4535. $("#warehouse a.btn-default").click(function () {
  4536. $("#warehouse a.btn-default").removeClass("active");
  4537. $(this).addClass("active");
  4538. $('#btn_search').trigger("click");
  4539. });
  4540. $("#btn_search").click(function () {
  4541. var warehouse = $("#warehouse a.active").attr('data-value');
  4542. var queryJson = {
  4543. POCode: $("#txt_POCode").val(),
  4544. InvCode: $("#txt_InvCode").val(),
  4545. InvName: $("#txt_InvName").val(),
  4546. BatchCode: $("#txt_BatchCode").val(),
  4547. POStatus: $("#selShow").val()
  4548. }
  4549. $gridList.jqGrid('setGridParam', {
  4550. postData: { queryJson: JSON.stringify(queryJson) },
  4551. }).trigger('reloadGrid');
  4552. });
  4553. }
  4554. function bindSubGrid201(subgrid_id, rowid) {
  4555. debugger;
  4556. $("#gridList").jqGrid("setSelection", rowid, false);
  4557. var subgrid_table_id;
  4558. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4559. var subgrid_pager_id;
  4560. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4561. // (5)动态添加子报表的table和pager
  4562. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4563. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4564. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4565. // (6)创建jqGrid对象
  4566. $("#" + subgrid_table_id).dataGrid({
  4567. cellEdit: true,
  4568. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4569. colModel: _Clos1,
  4570. //colModel: ColModelSub,
  4571. shrinkToFit: true,//宽度自适应
  4572. multiselect: true,
  4573. prmNames: { search: "search" },
  4574. viewrecords: true,
  4575. height: "100%",
  4576. rowNum: 20,
  4577. pager: subgrid_pager_id,
  4578. });
  4579. }
  4580. function bindSubGrid202(subgrid_id, rowid) {
  4581. debugger;
  4582. $("#gridList").jqGrid("setSelection", rowid, false);
  4583. var subgrid_table_id;
  4584. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4585. var subgrid_pager_id;
  4586. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4587. // (5)动态添加子报表的table和pager
  4588. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4589. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4590. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4591. // (6)创建jqGrid对象
  4592. $("#" + subgrid_table_id).dataGrid({
  4593. cellEdit: true,
  4594. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4595. colModel: _Clos1,
  4596. //colModel: ColModelSub,
  4597. shrinkToFit: true,//宽度自适应
  4598. multiselect: true,
  4599. prmNames: { search: "search" },
  4600. viewrecords: true,
  4601. height: "100%",
  4602. rowNum: 20,
  4603. pager: subgrid_pager_id,
  4604. });
  4605. }
  4606. //线边仓一步调入单生成条码(派纳)
  4607. function gridList203() {
  4608. var $gridList = $("#gridList");
  4609. var queryJson = {
  4610. POCode: $("#txt_POCode").val(),
  4611. InvCode: $("#txt_InvCode").val(),
  4612. InvName: $("#txt_InvName").val(),
  4613. BatchCode: $("#txt_BatchCode").val(),
  4614. FromTime: $("#FromTime").val(),
  4615. ToTime: $("#ToTime").val(),
  4616. WHCode: $("#txt_WHCode").val(),
  4617. POStatus: $("#selShow").val()
  4618. }
  4619. $gridList.dataGrid({
  4620. url: "/JHWMS/WMSCreateItemLot/GetGridJsonOneSetpTransPN" + "?" + Math.random(),
  4621. postData: { queryJson: JSON.stringify(queryJson) },
  4622. height: $(window).height() - 200,
  4623. width: $(window).width() - 300,
  4624. colModel: _Clos,
  4625. width: "100%",
  4626. cellEdit: true,
  4627. cellsubmit: "clientArray",
  4628. autowidth: true,
  4629. //shrinkToFit: true,
  4630. gridComplete: function () {
  4631. },
  4632. pager: "#gridPager",
  4633. // sortname: 'MOCode,cast(Sequence as int)',
  4634. sortname: "TransferNO,Cast(Sequence as int) ",
  4635. sortorder: "asc",
  4636. viewrecords: true,
  4637. multiselect: true,
  4638. //beforeSelectRow: function (rowid, e) {
  4639. // $("#gridList").jqGrid('resetSelection');
  4640. // return (true);
  4641. //},
  4642. subGrid: true, // (1)开启子表格支持
  4643. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4644. $("#gridList").jqGrid("setSelection", rowid, false);
  4645. bindSubGrid203(subgrid_id, rowid)
  4646. }
  4647. });
  4648. $("#warehouse a.btn-default").click(function () {
  4649. $("#warehouse a.btn-default").removeClass("active");
  4650. $(this).addClass("active");
  4651. $('#btn_search').trigger("click");
  4652. });
  4653. $("#btn_search").click(function () {
  4654. var warehouse = $("#warehouse a.active").attr('data-value');
  4655. var queryJson = {
  4656. POCode: $("#txt_POCode").val(),
  4657. InvCode: $("#txt_InvCode").val(),
  4658. InvName: $("#txt_InvName").val(),
  4659. BatchCode: $("#txt_BatchCode").val(),
  4660. FromTime: $("#FromTime").val(),
  4661. ToTime: $("#ToTime").val(),
  4662. WHCode: $("#txt_WHCode").val(),
  4663. POStatus: $("#selShow").val()
  4664. }
  4665. $gridList.jqGrid('setGridParam', {
  4666. postData: { queryJson: JSON.stringify(queryJson) },
  4667. }).trigger('reloadGrid');
  4668. });
  4669. }
  4670. function bindSubGrid203(subgrid_id, rowid) {
  4671. debugger;
  4672. $("#gridList").jqGrid("setSelection", rowid, false);
  4673. var subgrid_table_id;
  4674. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4675. var subgrid_pager_id;
  4676. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4677. // (5)动态添加子报表的table和pager
  4678. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4679. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4680. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4681. // (6)创建jqGrid对象
  4682. $("#" + subgrid_table_id).dataGrid({
  4683. cellEdit: true,
  4684. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4685. colModel: _Clos1,
  4686. //colModel: ColModelSub,
  4687. shrinkToFit: true,//宽度自适应
  4688. multiselect: true,
  4689. prmNames: { search: "search" },
  4690. viewrecords: true,
  4691. height: "100%",
  4692. rowNum: 20,
  4693. pager: subgrid_pager_id,
  4694. });
  4695. }
  4696. //红字销售出库单
  4697. function gridList24() {
  4698. var $gridList = $("#gridList");
  4699. var queryJson = {
  4700. POCode: $("#txt_POCode").val(),
  4701. VenCode: $("#txt_VenCode").val(),
  4702. VenName: $("#txt_VenName").val(),
  4703. InvCode: $("#txt_InvCode").val(),
  4704. InvName: $("#txt_InvName").val(),
  4705. BatchCode: $("#txt_BatchCode").val(),
  4706. FromTime: $("#FromTime").val(),
  4707. ToTime: $("#ToTime").val(),
  4708. WHCode: $("#txt_WHCode").val(),
  4709. POStatus: $("#selShow").val(),
  4710. WHStatus: $("#selStatus").val()
  4711. }
  4712. $gridList.dataGrid({
  4713. url: "/JHWMS/WMSCreateItemLot/GetGridJsonWMSSSD" + "?" + Math.random(),
  4714. postData: { queryJson: JSON.stringify(queryJson) },
  4715. height: $(window).height() - 200,
  4716. width: $(window).width() - 300,
  4717. colModel: _Clos,
  4718. //colModel: ColModelMain,
  4719. width: "100%",
  4720. autowidth: true,
  4721. cellEdit: true,
  4722. cellsubmit: "clientArray",
  4723. //shrinkToFit: true,
  4724. gridComplete: function () {
  4725. },
  4726. pager: "#gridPager",
  4727. //sortname: 'ODNCode,cast(Sequence as int)',
  4728. sortname: "SSDCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  4729. sortorder: "asc",
  4730. viewrecords: true,
  4731. multiselect: true,
  4732. //beforeSelectRow: function (rowid, e) {
  4733. // $("#gridList").jqGrid('resetSelection');
  4734. // return (true);
  4735. //},
  4736. subGrid: true, // (1)开启子表格支持
  4737. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4738. $("#gridList").jqGrid("setSelection", rowid, false);
  4739. bindSubGrid24(subgrid_id, rowid)
  4740. }
  4741. });
  4742. $("#warehouse a.btn-default").click(function () {
  4743. $("#warehouse a.btn-default").removeClass("active");
  4744. $(this).addClass("active");
  4745. $('#btn_search').trigger("click");
  4746. });
  4747. $("#btn_search").click(function () {
  4748. var warehouse = $("#warehouse a.active").attr('data-value');
  4749. var queryJson = {
  4750. POCode: $("#txt_POCode").val(),
  4751. VenCode: $("#txt_VenCode").val(),
  4752. VenName: $("#txt_VenName").val(),
  4753. InvCode: $("#txt_InvCode").val(),
  4754. InvName: $("#txt_InvName").val(),
  4755. BatchCode: $("#txt_BatchCode").val(),
  4756. FromTime: $("#FromTime").val(),
  4757. ToTime: $("#ToTime").val(),
  4758. WHCode: $("#txt_WHCode").val(),
  4759. POStatus: $("#selShow").val(),
  4760. WHStatus: $("#selStatus").val()
  4761. }
  4762. $gridList.jqGrid('setGridParam', {
  4763. postData: { queryJson: JSON.stringify(queryJson) },
  4764. }).trigger('reloadGrid');
  4765. });
  4766. }
  4767. function bindSubGrid24(subgrid_id, rowid) {
  4768. $("#gridList").jqGrid("setSelection", rowid, false);
  4769. var subgrid_table_id;
  4770. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4771. var subgrid_pager_id;
  4772. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4773. // (5)动态添加子报表的table和pager
  4774. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4775. var SSDCode = $("#gridList").jqGrid('getRowData', rowid).SSDCode;
  4776. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4777. // (6)创建jqGrid对象
  4778. $("#" + subgrid_table_id).dataGrid({
  4779. cellEdit: true,
  4780. url: "/JHWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SSDCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4781. //colModel: [
  4782. // { label: "主键", name: "ID", hidden: true, key: true },
  4783. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  4784. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  4785. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  4786. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  4787. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  4788. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  4789. //],
  4790. colModel: _Clos1,
  4791. //colModel: ColModelSub,
  4792. shrinkToFit: true,//宽度自适应
  4793. multiselect: true,
  4794. prmNames: { search: "search" },
  4795. viewrecords: true,
  4796. height: "100%",
  4797. rowNum: 20,
  4798. pager: subgrid_pager_id,
  4799. });
  4800. }
  4801. function btnDelete() {
  4802. var objArr = '';
  4803. var obj = $("#gridList").jqGrid("getRowData");
  4804. for (var i = 0; i < obj.length; i++) {
  4805. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  4806. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  4807. if (rowData != "undefined" && rowData != null) {
  4808. for (var j = 0; j < rowData.length; j++) {
  4809. objArr += "'" + rowData[j] + "',";
  4810. }
  4811. }
  4812. }
  4813. if (objArr == "") {
  4814. $.modalAlertNew("WMS00099");
  4815. return;
  4816. }
  4817. $.deleteForm({
  4818. url: "/JHWMS/WMSCreateItemLot/DeleteItemLot",
  4819. param: { keyValue: JSON.stringify(objArr) },
  4820. success: function () {
  4821. $.currentWindow().$("#gridList").trigger("reloadGrid");
  4822. }
  4823. })
  4824. }
  4825. function btnAllCreate() {
  4826. debugger;
  4827. var PoStatus;
  4828. var jsonData = '';
  4829. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  4830. //if (ids.length != 1) {
  4831. // $.modalAlertNew("WMS00100");
  4832. // return;
  4833. //}
  4834. var POCode = "";
  4835. var PORow = "";
  4836. var VenCode = "";
  4837. var WorkPoint = "";
  4838. var VendorLot = "";
  4839. //生产退料
  4840. if (Type == '1') {
  4841. debugger;
  4842. var ARR = [];
  4843. for (var i in ids) {
  4844. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4845. Code = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4846. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4847. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  4848. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  4849. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  4850. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  4851. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  4852. if (thisCreateQty == 0) {
  4853. $.modalAlert("该单据条码已全部生成完毕!");
  4854. return;
  4855. }
  4856. thisCreateQty = thisCreateQty.toFixed(4);
  4857. var minPackQty = thisCreateQty;//最小包装量
  4858. //minPackQty = minPackQty.toFixed(4);
  4859. var createPageCount = 1;//本次生成张数
  4860. createPageCount = createPageCount.toFixed(0);
  4861. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  4862. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  4863. Quantity = Quantity.toFixed(2);
  4864. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  4865. CreatedQty = CreatedQty.toFixed(2);
  4866. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  4867. if (Quantity == CreatedQty) {
  4868. return false;
  4869. }
  4870. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  4871. if (EffectiveEnable == 'true') {
  4872. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  4873. } else {
  4874. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  4875. }
  4876. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  4877. var obj = {
  4878. ID:ID,
  4879. Code: Code,
  4880. Sequence: Sequence,
  4881. thisCreateQty: thisCreateQty,
  4882. minPackQty: minPackQty,
  4883. createPageCount: createPageCount,
  4884. //VendorLot: VendorLot,
  4885. PRODUCTDATE: PRODUCTDATE,
  4886. ExpirationDate: ExpirationDate,
  4887. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  4888. //自由项
  4889. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  4890. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  4891. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  4892. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  4893. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  4894. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  4895. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  4896. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  4897. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  4898. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  4899. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  4900. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  4901. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  4902. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  4903. }
  4904. ARR.push(obj);
  4905. }
  4906. $.submitForm({
  4907. url: "/JHWMS/WMSCreateItemLot/SubmitFormGDTLALL" + "?" + Math.random(),
  4908. param: {
  4909. keyValue: JSON.stringify(ARR)
  4910. },
  4911. success: function () {
  4912. $.currentWindow().$("#gridList").trigger("reloadGrid");
  4913. }
  4914. })
  4915. }
  4916. //普通到货单
  4917. if (Type == '7') {
  4918. debugger;
  4919. var ARR = [];
  4920. for (var i in ids) {
  4921. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4922. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  4923. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4924. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  4925. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  4926. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  4927. //console.log("单号:" + DNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  4928. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  4929. if (thisCreateQty == 0) {
  4930. $.modalAlert("该单据条码已全部生成完毕!");
  4931. return;
  4932. }
  4933. thisCreateQty = thisCreateQty.toFixed(4);
  4934. var minPackQty = thisCreateQty;//最小包装量
  4935. //minPackQty = minPackQty.toFixed(4);
  4936. var createPageCount = 1;//本次生成张数
  4937. createPageCount = createPageCount.toFixed(0);
  4938. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  4939. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  4940. Quantity = Quantity.toFixed(2);
  4941. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  4942. CreatedQty = CreatedQty.toFixed(2);
  4943. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  4944. if (Quantity == CreatedQty) {
  4945. return false;
  4946. }
  4947. if (EffectiveEnable == 'true') {
  4948. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  4949. } else {
  4950. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  4951. }
  4952. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  4953. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  4954. var obj = {
  4955. ID:ID,
  4956. Code: DNCode,
  4957. Sequence: Sequence,
  4958. thisCreateQty: thisCreateQty,
  4959. minPackQty: minPackQty,
  4960. createPageCount: createPageCount,
  4961. //VendorLot: VendorLot,
  4962. PRODUCTDATE: PRODUCTDATE,
  4963. ExpirationDate: ExpirationDate,
  4964. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  4965. //自由项
  4966. ProjectCode : $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  4967. BatchCode : $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  4968. Version : $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  4969. Brand : $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  4970. cFree1 : $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  4971. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  4972. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  4973. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  4974. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  4975. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  4976. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  4977. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  4978. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  4979. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  4980. }
  4981. ARR.push(obj);
  4982. }
  4983. $.submitForm({
  4984. url: "/JHWMS/WMSCreateItemLot/SubmitFormSHDHALL" + "?" + Math.random(),
  4985. param: {
  4986. keyValue: JSON.stringify(ARR)
  4987. },
  4988. success: function () {
  4989. $.currentWindow().$("#gridList").trigger("reloadGrid");
  4990. }
  4991. })
  4992. }
  4993. //委外到货单
  4994. if (Type == '8') {
  4995. debugger;
  4996. var ARR = [];
  4997. for (var i in ids) {
  4998. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4999. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  5000. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5001. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  5002. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  5003. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  5004. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  5005. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  5006. if (thisCreateQty == 0) {
  5007. $.modalAlert("该单据条码已全部生成完毕!");
  5008. return;
  5009. }
  5010. thisCreateQty = thisCreateQty.toFixed(4);
  5011. var minPackQty = thisCreateQty;//最小包装量
  5012. //minPackQty = minPackQty.toFixed(4);
  5013. var createPageCount = 1;//本次生成张数
  5014. createPageCount = createPageCount.toFixed(0);
  5015. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  5016. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  5017. Quantity = Quantity.toFixed(2);
  5018. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  5019. CreatedQty = CreatedQty.toFixed(2);
  5020. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  5021. if (Quantity == CreatedQty) {
  5022. return false;
  5023. }
  5024. if (EffectiveEnable == 'true') {
  5025. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  5026. } else {
  5027. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  5028. }
  5029. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  5030. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  5031. var obj = {
  5032. ID:ID,
  5033. Code: ODNCode,
  5034. Sequence: Sequence,
  5035. thisCreateQty: thisCreateQty,
  5036. minPackQty: minPackQty,
  5037. createPageCount: createPageCount,
  5038. //VendorLot: VendorLot,
  5039. PRODUCTDATE: PRODUCTDATE,
  5040. ExpirationDate: ExpirationDate,
  5041. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  5042. //自由项
  5043. ProjectCode : $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  5044. BatchCode : $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  5045. Version : $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  5046. Brand : $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  5047. cFree1 : $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  5048. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  5049. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  5050. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  5051. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  5052. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  5053. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  5054. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  5055. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  5056. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  5057. }
  5058. ARR.push(obj);
  5059. }
  5060. $.submitForm({
  5061. url: "/JHWMS/WMSCreateItemLot/SubmitFormWWSHDHALL" + "?" + Math.random(),
  5062. param: {
  5063. keyValue: JSON.stringify(obj)
  5064. },
  5065. success: function () {
  5066. $.currentWindow().$("#gridList").trigger("reloadGrid");
  5067. }
  5068. })
  5069. }
  5070. //成品入库单条码生成
  5071. if (Type == '9') {
  5072. debugger;
  5073. var ARR = [];
  5074. for (var i in ids) {
  5075. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5076. Code = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5077. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5078. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  5079. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  5080. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  5081. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  5082. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  5083. if (thisCreateQty == 0) {
  5084. $.modalAlert("该单据条码已全部生成完毕!");
  5085. return;
  5086. }
  5087. thisCreateQty = thisCreateQty.toFixed(4);
  5088. var minPackQty = thisCreateQty;//最小包装量
  5089. //minPackQty = minPackQty.toFixed(4);
  5090. var createPageCount = 1;//本次生成张数
  5091. createPageCount = createPageCount.toFixed(0);
  5092. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  5093. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  5094. Quantity = Quantity.toFixed(2);
  5095. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  5096. CreatedQty = CreatedQty.toFixed(2);
  5097. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  5098. if (Quantity == CreatedQty) {
  5099. return false;
  5100. }
  5101. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  5102. if (EffectiveEnable=='true') {
  5103. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  5104. } else {
  5105. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  5106. }
  5107. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  5108. var obj = {
  5109. ID:ID,
  5110. Code: Code,
  5111. Sequence:Sequence,
  5112. thisCreateQty: thisCreateQty,
  5113. minPackQty: minPackQty,
  5114. createPageCount: createPageCount,
  5115. //VendorLot: VendorLot,
  5116. PRODUCTDATE: PRODUCTDATE,
  5117. ExpirationDate: ExpirationDate,
  5118. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  5119. //自由项
  5120. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  5121. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  5122. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  5123. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  5124. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  5125. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  5126. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  5127. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  5128. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  5129. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  5130. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  5131. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  5132. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  5133. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  5134. }
  5135. ARR.push(obj);
  5136. }
  5137. $.submitForm({
  5138. url: "/JHWMS/WMSCreateItemLot/SubmitFormKLCPRKALL" + "?" + Math.random(),
  5139. param: {
  5140. keyValue: JSON.stringify(ARR)
  5141. },
  5142. success: function () {
  5143. $.currentWindow().$("#gridList").trigger("reloadGrid");
  5144. }
  5145. })
  5146. }
  5147. if (Type == '17') {
  5148. for (var i in ids) {
  5149. LotNo = $("#gridList").jqGrid('getRowData', ids[i]).LotNo;
  5150. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  5151. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  5152. if (thisCreateQty==0) {
  5153. $.modalAlert("该条码已全部生成完毕!");
  5154. return;
  5155. }
  5156. thisCreateQty = thisCreateQty.toFixed(4);
  5157. var minPackQty = thisCreateQty;//最小包装量
  5158. var createPageCount = 1;//本次生成张数
  5159. createPageCount = createPageCount.toFixed(0);
  5160. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  5161. Quantity = Quantity.toFixed(2);
  5162. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  5163. CreatedQty = CreatedQty.toFixed(2);
  5164. if (Quantity == CreatedQty) {
  5165. return false;
  5166. }
  5167. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  5168. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  5169. var obj = {
  5170. thisCreateQty: thisCreateQty,
  5171. minPackQty: minPackQty,
  5172. createPageCount: createPageCount,
  5173. //VendorLot: VendorLot,
  5174. PRODUCTDATE: PRODUCTDATE,
  5175. ExpirationDate: ExpirationDate,
  5176. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  5177. }
  5178. $.submitForm({
  5179. url: "/JHWMS/WMSCreateItemLot/SubmitFormBHGTM?LotNo=" + LotNo + "&WorkPoint=" + WorkPoints,
  5180. param: {
  5181. keyValue: JSON.stringify(obj)
  5182. },
  5183. success: function () {
  5184. $.currentWindow().$("#gridList").trigger("reloadGrid");
  5185. }
  5186. })
  5187. }
  5188. }
  5189. }
  5190. function dateChange(num, date) {
  5191. if (!date) {
  5192. date = new Date();//没有传入值时,默认是当前日期
  5193. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  5194. }
  5195. date += " 00:00:00";//设置为当天凌晨12点
  5196. date = Date.parse(new Date(date)) / 1000;//转换为时间戳
  5197. date += (86400) * num;//修改后的时间戳
  5198. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  5199. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  5200. }
  5201. function btnCreate() {
  5202. debugger;
  5203. var PoStatus;
  5204. var jsonData = '';
  5205. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  5206. if (ids.length != 1) {
  5207. $.modalAlertNew("WMS00100");
  5208. return;
  5209. }
  5210. var POCode = "";
  5211. var PORow = "";
  5212. if (Type == '1') {
  5213. for (var i in ids) {
  5214. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5215. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5216. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5217. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5218. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5219. }
  5220. $.modalOpen({
  5221. id: "FormAddItemLot",
  5222. title: "生产退料条码生成",
  5223. url: "/JHWMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 1 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5224. width: "550px",
  5225. height: "1000px",
  5226. callBack: function (iframeId) {
  5227. top.frames[iframeId].submitForm();
  5228. }
  5229. });
  5230. } else if (Type == '2') {
  5231. for (var i in ids) {
  5232. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5233. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5234. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5235. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5236. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5237. }
  5238. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5239. $.modalOpen({
  5240. id: "FormAddItemLot",
  5241. title: "委外退料条码生成",
  5242. url: "/JHWMS/WMSCreateItemLot/FromNew?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5243. width: "550px",
  5244. height: "1000px",
  5245. callBack: function (iframeId) {
  5246. top.frames[iframeId].submitForm();
  5247. }
  5248. });
  5249. }
  5250. else {
  5251. $.modalOpen({
  5252. id: "FormAddItemLot",
  5253. title: "委外退料条码生成",
  5254. url: "/JHWMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5255. width: "550px",
  5256. height: "1000px",
  5257. callBack: function (iframeId) {
  5258. top.frames[iframeId].submitForm();
  5259. }
  5260. });
  5261. }
  5262. } else if (Type == '3') {
  5263. for (var i in ids) {
  5264. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  5265. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5266. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5267. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5268. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5269. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5270. }
  5271. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5272. $.modalOpen({
  5273. id: "FormAddItemLot",
  5274. title: "成品条码产生",
  5275. url: "/JHWMS/WMSCreateItemLot/FromNew?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  5276. width: "550px",
  5277. height: "1000px",
  5278. callBack: function (iframeId) {
  5279. top.frames[iframeId].submitForm();
  5280. }
  5281. });
  5282. }
  5283. else {
  5284. $.modalOpen({
  5285. id: "FormAddItemLot",
  5286. title: "成品条码产生",
  5287. url: "/JHWMS/WMSCreateItemLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  5288. width: "550px",
  5289. height: "1000px",
  5290. callBack: function (iframeId) {
  5291. top.frames[iframeId].submitForm();
  5292. }
  5293. });
  5294. }
  5295. } else if (Type == '4') {
  5296. for (var i in ids) {
  5297. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  5298. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5299. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5300. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5301. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5302. }
  5303. $.modalOpen({
  5304. id: "FormAddItemLot",
  5305. title: "销售退货条码产生",
  5306. url: "/JHWMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5307. width: "550px",
  5308. height: "1000px",
  5309. callBack: function (iframeId) {
  5310. top.frames[iframeId].submitForm();
  5311. }
  5312. });
  5313. } else if (Type == '5') {
  5314. for (var i in ids) {
  5315. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  5316. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5317. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5318. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5319. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5320. }
  5321. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5322. $.modalOpen({
  5323. id: "FormAddItemLot",
  5324. title: "其他入库条码产生",
  5325. url: "/JHWMS/WMSCreateItemLot/FromNew?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5326. width: "550px",
  5327. height: "1000px",
  5328. callBack: function (iframeId) {
  5329. top.frames[iframeId].submitForm();
  5330. }
  5331. });
  5332. }
  5333. else {
  5334. $.modalOpen({
  5335. id: "FormAddItemLot",
  5336. title: "其他入库条码产生",
  5337. url: "/JHWMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5338. width: "550px",
  5339. height: "1000px",
  5340. callBack: function (iframeId) {
  5341. top.frames[iframeId].submitForm();
  5342. }
  5343. });
  5344. }
  5345. } else if (Type == '6') {
  5346. for (var i in ids) {
  5347. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  5348. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5349. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5350. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5351. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5352. }
  5353. $.modalOpen({
  5354. id: "FormAddItemLot",
  5355. title: "归还单条码产生",
  5356. url: "/JHWMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 6 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5357. width: "550px",
  5358. height: "1000px",
  5359. callBack: function (iframeId) {
  5360. top.frames[iframeId].submitForm();
  5361. }
  5362. });
  5363. } else if (Type == '7') {
  5364. for (var i in ids) {
  5365. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5366. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5367. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5368. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5369. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5370. }
  5371. $.modalOpen({
  5372. id: "FormAddItemLot",
  5373. title: "审核到货单生成条码",
  5374. url: "/JHWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 7 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5375. width: "550px",
  5376. height: "1000px",
  5377. callBack: function (iframeId) {
  5378. top.frames[iframeId].submitForm();
  5379. }
  5380. });
  5381. } else if (Type == '8') {
  5382. for (var i in ids) {
  5383. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  5384. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5385. OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID;
  5386. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5387. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5388. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5389. }
  5390. $.modalOpen({
  5391. id: "FormAddItemLot",
  5392. title: "审核委外到货单生成条码",
  5393. url: "/JHWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&ID=" + ID + "&OODetailID=" + OODetailID + "&Quantity=" + Quantity + "&" + Math.random(),
  5394. width: "550px",
  5395. height: "1000px",
  5396. callBack: function (iframeId) {
  5397. top.frames[iframeId].submitForm();
  5398. }
  5399. });
  5400. } else if (Type == '9') {
  5401. for (var i in ids) {
  5402. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5403. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5404. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5405. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5406. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5407. }
  5408. $.modalOpen({
  5409. id: "FormAddItemLot",
  5410. title: "开立成品入库单生成条码",
  5411. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 9 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5412. width: "550px",
  5413. height: "1000px",
  5414. callBack: function (iframeId) {
  5415. top.frames[iframeId].submitForm();
  5416. }
  5417. });
  5418. } else if (Type == '10') {
  5419. for (var i in ids) {
  5420. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5421. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5422. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5423. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5424. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5425. }
  5426. $.modalOpen({
  5427. id: "FormAddItemLot",
  5428. title: "审核拒收单生成条码",
  5429. url: "/JHWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 10 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5430. width: "550px",
  5431. height: "1000px",
  5432. callBack: function (iframeId) {
  5433. top.frames[iframeId].submitForm();
  5434. }
  5435. });
  5436. } else if (Type == '11') {
  5437. for (var i in ids) {
  5438. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  5439. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  5440. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5441. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5442. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5443. }
  5444. $.modalOpen({
  5445. id: "FormAddItemLot",
  5446. title: "审核委外拒收单生成条码",
  5447. url: "/JHWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 11 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5448. width: "550px",
  5449. height: "1000px",
  5450. callBack: function (iframeId) {
  5451. top.frames[iframeId].submitForm();
  5452. }
  5453. });
  5454. } else if (Type == '12') {
  5455. for (var i in ids) {
  5456. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5457. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5458. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5459. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5460. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5461. }
  5462. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5463. $.modalOpen({
  5464. id: "FormAddItemLot",
  5465. title: "审核领料申请退料生成条码",
  5466. url: "/JHWMS/WMSCreateItemLot/FromNew?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5467. width: "550px",
  5468. height: "1000px",
  5469. callBack: function (iframeId) {
  5470. top.frames[iframeId].submitForm();
  5471. }
  5472. });
  5473. }
  5474. else {
  5475. $.modalOpen({
  5476. id: "FormAddItemLot",
  5477. title: "审核领料申请退料生成条码",
  5478. url: "/JHWMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5479. width: "550px",
  5480. height: "1000px",
  5481. callBack: function (iframeId) {
  5482. top.frames[iframeId].submitForm();
  5483. }
  5484. });
  5485. }
  5486. } else if (Type == '13') {
  5487. for (var i in ids) {
  5488. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5489. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5490. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5491. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5492. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5493. }
  5494. $.modalOpen({
  5495. id: "FormAddItemLot",
  5496. title: "材料出库退料生成条码",
  5497. url: "/JHWMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 13 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5498. width: "550px",
  5499. height: "1000px",
  5500. callBack: function (iframeId) {
  5501. top.frames[iframeId].submitForm();
  5502. }
  5503. });
  5504. } else if (Type == '14') {
  5505. for (var i in ids) {
  5506. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5507. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5508. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5509. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5510. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5511. }
  5512. $.modalOpen({
  5513. id: "FormAddItemLot",
  5514. title: "委外领料退料条码生成",
  5515. url: "/JHWMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 14 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5516. width: "550px",
  5517. height: "1000px",
  5518. callBack: function (iframeId) {
  5519. top.frames[iframeId].submitForm();
  5520. }
  5521. });
  5522. }
  5523. else if (Type == '15') {
  5524. for (var i in ids) {
  5525. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5526. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5527. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5528. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5529. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5530. }
  5531. $.modalOpen({
  5532. id: "FormAddItemLot",
  5533. title: "委外材料出库退料生成条码",
  5534. url: "/JHWMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 15 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5535. width: "550px",
  5536. height: "1000px",
  5537. callBack: function (iframeId) {
  5538. top.frames[iframeId].submitForm();
  5539. }
  5540. });
  5541. }
  5542. else if (Type == '16') {
  5543. for (var i in ids) {
  5544. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5545. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5546. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5547. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5548. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5549. }
  5550. $.modalOpen({
  5551. id: "FormAddItemLot",
  5552. title: "返工工单生成条码",
  5553. url: "/JHWMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 16 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5554. width: "550px",
  5555. height: "1000px",
  5556. callBack: function (iframeId) {
  5557. top.frames[iframeId].submitForm();
  5558. }
  5559. });
  5560. }
  5561. else if (Type == '18') {
  5562. for (var i in ids) {
  5563. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5564. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5565. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
  5566. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5567. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5568. }
  5569. $.modalOpen({
  5570. id: "FormAddItemLot",
  5571. title: "副产品生成条码",
  5572. url: "/JHWMS/WMSCreateItemLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5573. width: "550px",
  5574. height: "1000px",
  5575. callBack: function (iframeId) {
  5576. top.frames[iframeId].submitForm();
  5577. }
  5578. });
  5579. }
  5580. else if (Type == '20') {
  5581. for (var i in ids) {
  5582. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5583. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5584. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5585. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5586. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5587. }
  5588. $.modalOpen({
  5589. id: "FormAddItemLot",
  5590. title: "两步调入生成条码",
  5591. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 20 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5592. width: "550px",
  5593. height: "1000px",
  5594. callBack: function (iframeId) {
  5595. top.frames[iframeId].submitForm();
  5596. }
  5597. });
  5598. }
  5599. else if (Type == '22') {
  5600. for (var i in ids) {
  5601. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5602. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5603. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5604. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5605. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5606. }
  5607. console.log($(event.target).attr('id'));
  5608. if ($(event.target).attr('id') == 'NF-CreateNew')
  5609. {
  5610. $.modalOpen({
  5611. id: "FormAddItemLot",
  5612. title: "采购入库生成条码",
  5613. url: "/JHWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5614. width: "550px",
  5615. height: "1000px",
  5616. callBack: function (iframeId) {
  5617. top.frames[iframeId].submitForm();
  5618. }
  5619. });
  5620. }
  5621. else {
  5622. $.modalOpen({
  5623. id: "FormAddItemLot",
  5624. title: "采购入库生成条码",
  5625. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5626. width: "550px",
  5627. height: "1000px",
  5628. callBack: function (iframeId) {
  5629. top.frames[iframeId].submitForm();
  5630. }
  5631. });
  5632. }
  5633. }
  5634. else if (Type == '23') {
  5635. for (var i in ids) {
  5636. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5637. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5638. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5639. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5640. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5641. }
  5642. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5643. $.modalOpen({
  5644. id: "FormAddItemLot",
  5645. title: "委外采购入库生成条码",
  5646. url: "/JHWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5647. width: "550px",
  5648. height: "1000px",
  5649. callBack: function (iframeId) {
  5650. top.frames[iframeId].submitForm();
  5651. }
  5652. });
  5653. }
  5654. else {
  5655. $.modalOpen({
  5656. id: "FormAddItemLot",
  5657. title: "委外采购入库生成条码",
  5658. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5659. width: "550px",
  5660. height: "1000px",
  5661. callBack: function (iframeId) {
  5662. top.frames[iframeId].submitForm();
  5663. }
  5664. });
  5665. }
  5666. }
  5667. else if (Type == '24') {
  5668. for (var i in ids) {
  5669. SSDCode = $("#gridList").jqGrid('getRowData', ids[i]).SSDCode;
  5670. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5671. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5672. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5673. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5674. }
  5675. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5676. $.modalOpen({
  5677. id: "FormAddItemLot",
  5678. title: "红字销售出库单生成条码",
  5679. url: "/JHWMS/WMSCreateItemLot/FromNew?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5680. width: "550px",
  5681. height: "1000px",
  5682. callBack: function (iframeId) {
  5683. top.frames[iframeId].submitForm();
  5684. }
  5685. });
  5686. }
  5687. else {
  5688. $.modalOpen({
  5689. id: "FormAddItemLot",
  5690. title: "红字销售出库单生成条码",
  5691. url: "/JHWMS/WMSCreateItemLot/FromPN?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5692. width: "550px",
  5693. height: "1000px",
  5694. callBack: function (iframeId) {
  5695. top.frames[iframeId].submitForm();
  5696. }
  5697. });
  5698. }
  5699. }
  5700. else if (Type == '201') {
  5701. for (var i in ids) {
  5702. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5703. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5704. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5705. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5706. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5707. }
  5708. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5709. $.modalOpen({
  5710. id: "FormAddItemLot",
  5711. title: "调拨申请单生成条码",
  5712. url: "/JHWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5713. width: "550px",
  5714. height: "1000px",
  5715. callBack: function (iframeId) {
  5716. top.frames[iframeId].submitForm();
  5717. }
  5718. });
  5719. }
  5720. else {
  5721. $.modalOpen({
  5722. id: "FormAddItemLot",
  5723. title: "调拨申请单生成条码",
  5724. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5725. width: "550px",
  5726. height: "1000px",
  5727. callBack: function (iframeId) {
  5728. top.frames[iframeId].submitForm();
  5729. }
  5730. });
  5731. }
  5732. }
  5733. else if (Type == '202') {
  5734. for (var i in ids) {
  5735. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5736. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5737. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5738. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5739. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5740. }
  5741. $.modalOpen({
  5742. id: "FormAddItemLot",
  5743. title: "调拨申请单生成条码",
  5744. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5745. width: "550px",
  5746. height: "1000px",
  5747. callBack: function (iframeId) {
  5748. top.frames[iframeId].submitForm();
  5749. }
  5750. });
  5751. }
  5752. else if (Type == '203') {
  5753. for (var i in ids) {
  5754. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5755. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5756. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5757. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5758. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5759. }
  5760. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5761. $.modalOpen({
  5762. id: "FormAddItemLot",
  5763. title: "调拨申请单生成条码",
  5764. url: "/JHWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 203 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5765. width: "550px",
  5766. height: "1000px",
  5767. callBack: function (iframeId) {
  5768. top.frames[iframeId].submitForm();
  5769. }
  5770. });
  5771. }
  5772. else {
  5773. $.modalOpen({
  5774. id: "FormAddItemLot",
  5775. title: "调拨申请单生成条码",
  5776. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 203 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5777. width: "550px",
  5778. height: "1000px",
  5779. callBack: function (iframeId) {
  5780. top.frames[iframeId].submitForm();
  5781. }
  5782. });
  5783. }
  5784. }
  5785. }
  5786. function btnCreatePN() {
  5787. debugger;
  5788. var PoStatus;
  5789. var jsonData = '';
  5790. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  5791. if (ids.length != 1) {
  5792. $.modalAlertNew("WMS00100");
  5793. return;
  5794. }
  5795. var POCode = "";
  5796. var PORow = "";
  5797. if (Type == '1') {
  5798. for (var i in ids) {
  5799. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5800. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5801. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5802. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5803. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5804. }
  5805. $.modalOpen({
  5806. id: "FormAddItemLot",
  5807. title: "生产退料条码生成",
  5808. url: "/JHWMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 1 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5809. width: "550px",
  5810. height: "1000px",
  5811. callBack: function (iframeId) {
  5812. top.frames[iframeId].submitForm();
  5813. }
  5814. });
  5815. } else if (Type == '2') {
  5816. for (var i in ids) {
  5817. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5818. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5819. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5820. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5821. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5822. }
  5823. $.modalOpen({
  5824. id: "FormAddItemLot",
  5825. title: "委外退料条码生成",
  5826. url: "/JHWMS/WMSCreateItemLot/FromPN?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5827. width: "550px",
  5828. height: "1000px",
  5829. callBack: function (iframeId) {
  5830. top.frames[iframeId].submitForm();
  5831. }
  5832. });
  5833. } else if (Type == '3') {
  5834. for (var i in ids) {
  5835. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  5836. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5837. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5838. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5839. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5840. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5841. }
  5842. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5843. $.modalOpen({
  5844. id: "FormAddItemLot",
  5845. title: "成品条码产生",
  5846. url: "/JHWMS/WMSCreateItemLot/FromNew?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  5847. width: "550px",
  5848. height: "1000px",
  5849. callBack: function (iframeId) {
  5850. top.frames[iframeId].submitForm();
  5851. }
  5852. });
  5853. }
  5854. else {
  5855. $.modalOpen({
  5856. id: "FormAddItemLot",
  5857. title: "成品条码产生",
  5858. url: "/JHWMS/WMSCreateItemLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  5859. width: "550px",
  5860. height: "1000px",
  5861. callBack: function (iframeId) {
  5862. top.frames[iframeId].submitForm();
  5863. }
  5864. });
  5865. }
  5866. } else if (Type == '4') {
  5867. for (var i in ids) {
  5868. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  5869. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5870. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5871. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5872. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5873. }
  5874. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5875. $.modalOpen({
  5876. id: "FormAddItemLot",
  5877. title: "销售退货条码产生",
  5878. url: "/JHWMS/WMSCreateItemLot/FromNew?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5879. width: "550px",
  5880. height: "1000px",
  5881. callBack: function (iframeId) {
  5882. top.frames[iframeId].submitForm();
  5883. }
  5884. });
  5885. }
  5886. else {
  5887. $.modalOpen({
  5888. id: "FormAddItemLot",
  5889. title: "销售退货条码产生",
  5890. url: "/JHWMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5891. width: "550px",
  5892. height: "1000px",
  5893. callBack: function (iframeId) {
  5894. top.frames[iframeId].submitForm();
  5895. }
  5896. });
  5897. }
  5898. } else if (Type == '5') {
  5899. for (var i in ids) {
  5900. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  5901. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5902. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5903. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5904. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5905. }
  5906. $.modalOpen({
  5907. id: "FormAddItemLot",
  5908. title: "其他入库条码产生",
  5909. url: "/JHWMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5910. width: "550px",
  5911. height: "1000px",
  5912. callBack: function (iframeId) {
  5913. top.frames[iframeId].submitForm();
  5914. }
  5915. });
  5916. } else if (Type == '6') {
  5917. for (var i in ids) {
  5918. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  5919. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5920. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5921. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5922. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5923. }
  5924. $.modalOpen({
  5925. id: "FormAddItemLot",
  5926. title: "归还单条码产生",
  5927. url: "/JHWMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 6 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5928. width: "550px",
  5929. height: "1000px",
  5930. callBack: function (iframeId) {
  5931. top.frames[iframeId].submitForm();
  5932. }
  5933. });
  5934. } else if (Type == '7') {
  5935. for (var i in ids) {
  5936. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5937. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5938. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5939. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5940. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5941. }
  5942. $.modalOpen({
  5943. id: "FormAddItemLot",
  5944. title: "审核到货单生成条码",
  5945. url: "/JHWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 7 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5946. width: "550px",
  5947. height: "1000px",
  5948. callBack: function (iframeId) {
  5949. top.frames[iframeId].submitForm();
  5950. }
  5951. });
  5952. } else if (Type == '8') {
  5953. for (var i in ids) {
  5954. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  5955. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5956. OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID;
  5957. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5958. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5959. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5960. }
  5961. $.modalOpen({
  5962. id: "FormAddItemLot",
  5963. title: "审核委外到货单生成条码",
  5964. url: "/JHWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&ID=" + ID + "&OODetailID=" + OODetailID + "&Quantity=" + Quantity + "&" + Math.random(),
  5965. width: "550px",
  5966. height: "1000px",
  5967. callBack: function (iframeId) {
  5968. top.frames[iframeId].submitForm();
  5969. }
  5970. });
  5971. } else if (Type == '9') {
  5972. for (var i in ids) {
  5973. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5974. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5975. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5976. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5977. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5978. }
  5979. $.modalOpen({
  5980. id: "FormAddItemLot",
  5981. title: "开立成品入库单生成条码",
  5982. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 9 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5983. width: "550px",
  5984. height: "1000px",
  5985. callBack: function (iframeId) {
  5986. top.frames[iframeId].submitForm();
  5987. }
  5988. });
  5989. } else if (Type == '10') {
  5990. for (var i in ids) {
  5991. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5992. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5993. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5994. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5995. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5996. }
  5997. $.modalOpen({
  5998. id: "FormAddItemLot",
  5999. title: "审核拒收单生成条码",
  6000. url: "/JHWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 10 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6001. width: "550px",
  6002. height: "1000px",
  6003. callBack: function (iframeId) {
  6004. top.frames[iframeId].submitForm();
  6005. }
  6006. });
  6007. } else if (Type == '11') {
  6008. for (var i in ids) {
  6009. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  6010. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  6011. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6012. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6013. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6014. }
  6015. $.modalOpen({
  6016. id: "FormAddItemLot",
  6017. title: "审核委外拒收单生成条码",
  6018. url: "/JHWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 11 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6019. width: "550px",
  6020. height: "1000px",
  6021. callBack: function (iframeId) {
  6022. top.frames[iframeId].submitForm();
  6023. }
  6024. });
  6025. } else if (Type == '12') {
  6026. for (var i in ids) {
  6027. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  6028. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6029. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6030. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6031. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6032. }
  6033. $.modalOpen({
  6034. id: "FormAddItemLot",
  6035. title: "审核领料申请退料生成条码",
  6036. url: "/JHWMS/WMSCreateItemLot/FromPN?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6037. width: "550px",
  6038. height: "1000px",
  6039. callBack: function (iframeId) {
  6040. top.frames[iframeId].submitForm();
  6041. }
  6042. });
  6043. } else if (Type == '13') {
  6044. for (var i in ids) {
  6045. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  6046. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6047. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6048. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6049. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6050. }
  6051. $.modalOpen({
  6052. id: "FormAddItemLot",
  6053. title: "材料出库退料生成条码",
  6054. url: "/JHWMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 13 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6055. width: "550px",
  6056. height: "1000px",
  6057. callBack: function (iframeId) {
  6058. top.frames[iframeId].submitForm();
  6059. }
  6060. });
  6061. } else if (Type == '14') {
  6062. for (var i in ids) {
  6063. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  6064. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6065. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6066. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6067. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6068. }
  6069. $.modalOpen({
  6070. id: "FormAddItemLot",
  6071. title: "委外领料退料条码生成",
  6072. url: "/JHWMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 14 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6073. width: "550px",
  6074. height: "1000px",
  6075. callBack: function (iframeId) {
  6076. top.frames[iframeId].submitForm();
  6077. }
  6078. });
  6079. }
  6080. else if (Type == '15') {
  6081. for (var i in ids) {
  6082. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  6083. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6084. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6085. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6086. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6087. }
  6088. $.modalOpen({
  6089. id: "FormAddItemLot",
  6090. title: "委外材料出库退料生成条码",
  6091. url: "/JHWMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 15 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6092. width: "550px",
  6093. height: "1000px",
  6094. callBack: function (iframeId) {
  6095. top.frames[iframeId].submitForm();
  6096. }
  6097. });
  6098. }
  6099. else if (Type == '16') {
  6100. for (var i in ids) {
  6101. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  6102. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6103. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6104. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6105. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6106. }
  6107. $.modalOpen({
  6108. id: "FormAddItemLot",
  6109. title: "返工工单生成条码",
  6110. url: "/JHWMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 16 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6111. width: "550px",
  6112. height: "1000px",
  6113. callBack: function (iframeId) {
  6114. top.frames[iframeId].submitForm();
  6115. }
  6116. });
  6117. }
  6118. else if (Type == '18') {
  6119. for (var i in ids) {
  6120. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  6121. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6122. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
  6123. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6124. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6125. }
  6126. $.modalOpen({
  6127. id: "FormAddItemLot",
  6128. title: "副产品生成条码",
  6129. url: "/JHWMS/WMSCreateItemLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6130. width: "550px",
  6131. height: "1000px",
  6132. callBack: function (iframeId) {
  6133. top.frames[iframeId].submitForm();
  6134. }
  6135. });
  6136. }
  6137. else if (Type == '20') {
  6138. for (var i in ids) {
  6139. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  6140. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6141. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6142. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6143. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6144. }
  6145. $.modalOpen({
  6146. id: "FormAddItemLot",
  6147. title: "两步调入生成条码",
  6148. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 20 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6149. width: "550px",
  6150. height: "1000px",
  6151. callBack: function (iframeId) {
  6152. top.frames[iframeId].submitForm();
  6153. }
  6154. });
  6155. }
  6156. else if (Type == '22') {
  6157. for (var i in ids) {
  6158. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  6159. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6160. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6161. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6162. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6163. }
  6164. if ($(event.target).attr('id') == 'NF-CreateNew') {
  6165. $.modalOpen({
  6166. id: "FormAddItemLot",
  6167. title: "采购入库生成条码",
  6168. url: "/JHWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6169. width: "550px",
  6170. height: "1000px",
  6171. callBack: function (iframeId) {
  6172. top.frames[iframeId].submitForm();
  6173. }
  6174. });
  6175. }
  6176. else {
  6177. $.modalOpen({
  6178. id: "FormAddItemLot",
  6179. title: "采购入库生成条码",
  6180. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6181. width: "550px",
  6182. height: "1000px",
  6183. callBack: function (iframeId) {
  6184. top.frames[iframeId].submitForm();
  6185. }
  6186. });
  6187. }
  6188. }
  6189. else if (Type == '23') {
  6190. for (var i in ids) {
  6191. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  6192. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6193. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6194. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6195. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6196. }
  6197. $.modalOpen({
  6198. id: "FormAddItemLot",
  6199. title: "委外采购入库生成条码",
  6200. url: "/JHWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6201. width: "550px",
  6202. height: "1000px",
  6203. callBack: function (iframeId) {
  6204. top.frames[iframeId].submitForm();
  6205. }
  6206. });
  6207. }
  6208. else if (Type == '24') {
  6209. for (var i in ids) {
  6210. SSDCode = $("#gridList").jqGrid('getRowData', ids[i]).SSDCode;
  6211. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6212. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6213. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6214. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6215. }
  6216. if ($(event.target).attr('id') == 'NF-CreateNew') {
  6217. $.modalOpen({
  6218. id: "FormAddItemLot",
  6219. title: "红字销售出库单生成条码",
  6220. url: "/JHWMS/WMSCreateItemLot/FromNew?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6221. width: "550px",
  6222. height: "1000px",
  6223. callBack: function (iframeId) {
  6224. top.frames[iframeId].submitForm();
  6225. }
  6226. });
  6227. }
  6228. else {
  6229. $.modalOpen({
  6230. id: "FormAddItemLot",
  6231. title: "红字销售出库单生成条码",
  6232. url: "/JHWMS/WMSCreateItemLot/From?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6233. width: "550px",
  6234. height: "1000px",
  6235. callBack: function (iframeId) {
  6236. top.frames[iframeId].submitForm();
  6237. }
  6238. });
  6239. }
  6240. }
  6241. else if (Type == '201') {
  6242. for (var i in ids) {
  6243. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  6244. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6245. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6246. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6247. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6248. }
  6249. if ($(event.target).attr('id') == 'NF-CreateNew') {
  6250. $.modalOpen({
  6251. id: "FormAddItemLot",
  6252. title: "调拨申请单生成条码",
  6253. url: "/JHWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6254. width: "550px",
  6255. height: "1000px",
  6256. callBack: function (iframeId) {
  6257. top.frames[iframeId].submitForm();
  6258. }
  6259. });
  6260. }
  6261. else {
  6262. $.modalOpen({
  6263. id: "FormAddItemLot",
  6264. title: "调拨申请单生成条码",
  6265. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6266. width: "550px",
  6267. height: "1000px",
  6268. callBack: function (iframeId) {
  6269. top.frames[iframeId].submitForm();
  6270. }
  6271. });
  6272. }
  6273. }
  6274. else if (Type == '202') {
  6275. for (var i in ids) {
  6276. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  6277. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6278. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6279. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6280. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  6281. }
  6282. if ($(event.target).attr('id') == 'NF-CreateNew') {
  6283. $.modalOpen({
  6284. id: "FormAddItemLot",
  6285. title: "调拨申请单生成条码",
  6286. url: "/JHWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6287. width: "550px",
  6288. height: "1000px",
  6289. callBack: function (iframeId) {
  6290. top.frames[iframeId].submitForm();
  6291. }
  6292. });
  6293. }
  6294. else {
  6295. $.modalOpen({
  6296. id: "FormAddItemLot",
  6297. title: "调拨申请单生成条码",
  6298. url: "/JHWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  6299. width: "550px",
  6300. height: "1000px",
  6301. callBack: function (iframeId) {
  6302. top.frames[iframeId].submitForm();
  6303. }
  6304. });
  6305. }
  6306. }
  6307. }
  6308. function fullscreen() {
  6309. var docElm = document.documentElement;
  6310. if (docElm.requestFullscreen) {
  6311. docElm.requestFullscreen();
  6312. } else if (docElm.mozRequestFullScreen) {
  6313. docElm.mozRequestFullScreen();
  6314. } else if (docElm.webkitRequestFullScreen) {
  6315. docElm.webkitRequestFullScreen();
  6316. } else if (docElm.msRequestFullscreen) {
  6317. docElm.msRequestFullscreen();
  6318. }
  6319. $(window).bind('resize', function () {
  6320. $("#gridList").setGridWidth($(window).width());
  6321. }).trigger('resize');
  6322. $(window).bind('resize', function () {
  6323. $("#gridList").setGridHeight($(window).height());
  6324. }).trigger('resize');
  6325. }
  6326. function btnPrint() {
  6327. debugger;
  6328. if (mold == '')
  6329. {
  6330. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  6331. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  6332. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  6333. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  6334. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  6335. if (Type == '6') { mold = '00006'; }//归还单生成条码
  6336. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  6337. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  6338. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  6339. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  6340. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  6341. if (Type == '12') { mold = '00012'; }//领料申请退料
  6342. if (Type == '13') { mold = '00013'; }//材料出库退料
  6343. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  6344. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  6345. if (Type == '16') { mold = '00016'; }//返工工单
  6346. if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库
  6347. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  6348. if (Type == '22') { mold = '00018'; }//采购入库生成条码
  6349. if (Type == '23') { mold = '00019'; }//委外采购入库生成条码
  6350. if (Type == '201') { mold = '00020'; }//委外采购入库生成条码
  6351. if (Type == '202') { mold = '00020'; }//委外采购入库生成条码
  6352. if (Type == '203') { mold = 'DZ0001'; }//派纳特殊一步调入生成条码
  6353. if (Type == '24') { mold = 'HZXS0001'; }//红字销售出库单
  6354. }
  6355. var objArr = '';
  6356. var arr = [];
  6357. var obj = $("#gridList").jqGrid("getRowData");
  6358. for (var i = 0; i < obj.length; i++) {
  6359. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  6360. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  6361. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  6362. for (var j = 0; j < rowData.length; j++) {
  6363. objArr += "'" + rowData[j] + "',";
  6364. }
  6365. }
  6366. }
  6367. objArr = objArr.slice(0, objArr.length - 1);
  6368. if (objArr == "") {
  6369. $.modalAlertNew("WMS00101");
  6370. return;
  6371. }
  6372. objArr = "" + objArr + "|";
  6373. arr.push(objArr);
  6374. $.modalOpen({
  6375. id: "PrintLot",
  6376. title: "打印",
  6377. url: "/WMS/Print/PrintViewByLot?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  6378. width: "550px",
  6379. height: "1000px",
  6380. callBack: function (iframeId) {
  6381. top.frames[iframeId].submitForm();
  6382. }
  6383. });
  6384. }
  6385. function btnBatchPrint() {
  6386. debugger;
  6387. if (mold == '')
  6388. {
  6389. if (Type == '7') { mold = '00056'; }//普通到货单生成条码
  6390. if (Type == '8') { mold = '00057'; }//委外到货单生成条码
  6391. }
  6392. var objArr = '';
  6393. var arr = [];
  6394. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  6395. if (ids.length == 0) {
  6396. $.modalAlertNew("WMS00100");
  6397. return;
  6398. }
  6399. var ID = '';
  6400. for (var i in ids) {
  6401. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6402. objArr += "'" + ID + "',";
  6403. }
  6404. objArr = objArr.slice(0, objArr.length - 1);
  6405. objArr = "" + objArr + "|";
  6406. arr.push(objArr);
  6407. var xxx = "";
  6408. $.modalOpen({
  6409. id: "PrintLot",
  6410. title: "打印",
  6411. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  6412. width: "550px",
  6413. height: "1000px",
  6414. callBack: function (iframeId) {
  6415. top.frames[iframeId].submitForm();
  6416. }
  6417. });
  6418. }
  6419. function btn_ExportAll() {
  6420. debugger;
  6421. var objArr = '';
  6422. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  6423. for (var i in ids) {
  6424. objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',";
  6425. }
  6426. if (objArr=="") {
  6427. $.modalAlert("请选择单据后导出!");
  6428. return;
  6429. }
  6430. var postData = "&Type=" + Type + "";
  6431. //postData += "&ID=" + ID
  6432. postData += "&ID=" + objArr;
  6433. $.download("/JHWMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post');
  6434. }
  6435. function Select_SelGDLX() {
  6436. $("#SelGDLX").find("option").remove();
  6437. var DeptName = $("#SelGDLX option:checked").text();
  6438. $("#SelGDLX").append("<option value=''>--请选择--</option>");
  6439. $.ajax({
  6440. url: "/JHWMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(),
  6441. dataType: "json",
  6442. async: false,
  6443. success: function (data) {
  6444. if (data != null && data.length > 0) {
  6445. for (var i = 0; i < data.length; i++) {
  6446. $("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
  6447. }
  6448. }
  6449. }
  6450. });
  6451. $("#SelGDLX option:checked").val('');
  6452. }
  6453. function btnCreateLook() {
  6454. var MODetailID = '';
  6455. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  6456. for (var i = 0; i < objList.length; i++) {
  6457. var rowId = objList[i];
  6458. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  6459. MODetailID = rowData.MODetailID;
  6460. }
  6461. $.modalOpenClean({
  6462. id: "FormMoPick",
  6463. title: "工单子件信息",
  6464. url: "/JHWMS/WMSCreateItemLot/FormMoPick" + "?" + Math.random() + "&MODetailID=" + MODetailID,
  6465. width: "90%",
  6466. height: "90%",
  6467. callBack: function (iframeId) {
  6468. top.frames[iframeId].submitForm();
  6469. }
  6470. });
  6471. }
  6472. function btn_Import() {
  6473. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  6474. if (objList.length != 1) {
  6475. $.modalAlertNew("WMS00100");
  6476. return;
  6477. }
  6478. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  6479. for (var i = 0; i < objList.length; i++) {
  6480. var rowId = objList[i];
  6481. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  6482. var Code = rowData.MOCode;
  6483. var Sequence = rowData.Sequence;
  6484. $.modalOpen({
  6485. id: "Upload",
  6486. title: "导入",
  6487. url: "/JHWMS/WMSCreateItemLot/ImportLot?Code=" + Code + "&Sequence=" + Sequence + "&" + Math.random(),
  6488. width: "400px",
  6489. height: "200px",
  6490. btn: null,
  6491. });
  6492. }
  6493. }
  6494. function btnPrints() {
  6495. debugger;
  6496. // var mold = '';
  6497. if (mold == '') {
  6498. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  6499. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  6500. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  6501. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  6502. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  6503. if (Type == '6') { mold = '00006'; }//归还单生成条码
  6504. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  6505. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  6506. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  6507. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  6508. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  6509. if (Type == '12') { mold = '00012'; }//领料申请退料
  6510. if (Type == '13') { mold = '00013'; }//材料出库退料
  6511. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  6512. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  6513. if (Type == '16') { mold = '00016'; }//返工工单
  6514. if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库
  6515. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  6516. if (Type == '22') { mold = '00018'; }//采购入库生成条码
  6517. if (Type == '23') { mold = '00019'; }//委外采购入库生成条码
  6518. if (Type == '203') { mold = 'DZ0001'; }//派纳特殊一步调入生成条码
  6519. }
  6520. var objArr = '';
  6521. var arr = [];
  6522. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  6523. for (var i = 0; i < objList.length; i++) {
  6524. var rowId = objList[i];
  6525. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  6526. objArr += "'" + rowData.ID + "',";
  6527. }
  6528. objArr = objArr.slice(0, objArr.length - 1);
  6529. if (objArr == "") {
  6530. $.modalAlertNew("WMS00110");
  6531. return;
  6532. }
  6533. objArr = "" + objArr + "|";
  6534. arr.push(objArr);
  6535. $.modalOpen({
  6536. id: "PrintLot",
  6537. title: "打印",
  6538. url: "/WMS/Print/PrintViewByLot?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  6539. width: "550px",
  6540. height: "1000px",
  6541. callBack: function (iframeId) {
  6542. top.frames[iframeId].submitForm();
  6543. }
  6544. });
  6545. }
  6546. function btnInWareHouse() {
  6547. debugger;
  6548. var objArr = '';
  6549. var arr = [];
  6550. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  6551. for (var i = 0; i < objList.length; i++) {
  6552. var rowId = objList[i];
  6553. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  6554. objArr += "'" + rowData.ID + "',";
  6555. }
  6556. objArr = objArr.slice(0, objArr.length - 1);
  6557. if (objArr == "") {
  6558. $.modalAlertNew("WMS00110");
  6559. return;
  6560. }
  6561. arr.push(objArr);
  6562. $.submitForm({
  6563. url: "/JHWMS/WMSCreateItemLot/PostInWareHouse" ,
  6564. param: {
  6565. IDs: JSON.stringify(objArr)
  6566. },
  6567. success: function () {
  6568. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6569. }
  6570. })
  6571. }
  6572. function btn_Rebind() {
  6573. var objArr = '';
  6574. var obj = $("#gridList").jqGrid("getRowData");
  6575. for (var i = 0; i < obj.length; i++) {
  6576. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  6577. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  6578. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  6579. for (var j = 0; j < rowData.length; j++) {
  6580. var rowDataZ = $SubGird.jqGrid('getRowData', rowData[j]);
  6581. objArr += "'" + rowDataZ.LotNo + "',";
  6582. }
  6583. objArr = objArr.slice(0, objArr.length - 1);
  6584. }
  6585. }
  6586. if (objArr == "") {
  6587. $.modalAlert("请选择条码信息后,进行重新绑定!");
  6588. return;
  6589. }
  6590. $.modalOpen({
  6591. id: "ICSLotRebind",
  6592. title: "条码重新绑定",
  6593. url: "/JHWMS/WMSCreateItemLot/ICSLotRebind?LotNo=" + encodeURI(encodeURI(objArr)) + "&" + Math.random(),
  6594. width: "500px",
  6595. height: "350px",
  6596. callBack: function (iframeId) {
  6597. top.frames[iframeId].submitForm();
  6598. }
  6599. });
  6600. }
  6601. function btnAllCreatePN() {
  6602. $("#gridList").find($("td[aria-describedby='gridList_rn']")).click();
  6603. var PoStatus;
  6604. var jsonData = '';
  6605. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  6606. var POCode = "";
  6607. var PORow = "";
  6608. var VenCode = "";
  6609. var WorkPoint = "";
  6610. var VendorLot = "";
  6611. if (Type == '3') {
  6612. debugger;
  6613. var ARR = [];
  6614. for (var i in ids) {
  6615. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6616. var Code = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  6617. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6618. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6619. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6620. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6621. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6622. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6623. if (minPackQty == '' || minPackQty == 0) {
  6624. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6625. return;
  6626. }
  6627. var Complete = '';
  6628. $.ajax({
  6629. url: "/JHWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6630. dataType: "json",
  6631. async: false,
  6632. success: function (data) {
  6633. if (data != null && data.length > 0) {
  6634. Complete = data[0].BatchEnable;
  6635. }
  6636. }
  6637. });
  6638. if (Complete == true) {
  6639. if (BatchCode == "") {
  6640. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6641. return;
  6642. }
  6643. }
  6644. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6645. if (thisCreateQty == 0) {
  6646. $.modalAlert("该单据条码已全部生成完毕!");
  6647. return;
  6648. }
  6649. thisCreateQty = thisCreateQty.toFixed(6);
  6650. minPackQty = Number(minPackQty).toFixed(6);
  6651. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6652. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6653. }
  6654. else {
  6655. createPageCount = parseInt(thisCreateQty / minPackQty);
  6656. }
  6657. createPageCount = createPageCount.toFixed(0);
  6658. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//订单总数
  6659. Quantity = Quantity.toFixed(2);
  6660. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6661. CreatedQty = CreatedQty.toFixed(2);
  6662. if (Quantity == CreatedQty) {
  6663. return false;
  6664. }
  6665. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6666. if (EffectiveEnable == 'true') {
  6667. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6668. } else {
  6669. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6670. }
  6671. var obj = {
  6672. ID: ID,
  6673. Code: Code,
  6674. Sequence: Sequence,
  6675. thisCreateQty: thisCreateQty,
  6676. minPackQty: minPackQty,
  6677. createPageCount: createPageCount,
  6678. //VendorLot: VendorLot,
  6679. PRODUCTDATE: PRODUCTDATE,
  6680. ExpirationDate: ExpirationDate,
  6681. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6682. //自由项
  6683. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6684. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6685. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6686. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6687. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6688. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6689. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6690. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6691. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6692. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6693. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6694. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6695. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6696. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6697. }
  6698. ARR.push(obj);
  6699. }
  6700. $.submitForm({
  6701. url: "/JHWMS/WMSCreateItemLot/SubmitFormGDCPALL" + "?" + Math.random(),
  6702. param: {
  6703. keyValue: JSON.stringify(ARR)
  6704. },
  6705. success: function () {
  6706. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6707. }
  6708. })
  6709. }
  6710. if (Type == '22') {
  6711. debugger;
  6712. var ARR = [];
  6713. for (var i in ids) {
  6714. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6715. var Code = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  6716. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6717. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6718. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6719. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6720. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6721. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6722. if (minPackQty == '' || minPackQty == 0) {
  6723. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6724. return;
  6725. }
  6726. var Complete = '';
  6727. $.ajax({
  6728. url: "/JHWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6729. dataType: "json",
  6730. async: false,
  6731. success: function (data) {
  6732. if (data != null && data.length > 0) {
  6733. Complete = data[0].BatchEnable;
  6734. }
  6735. }
  6736. });
  6737. if (Complete == true) {
  6738. if (BatchCode == "") {
  6739. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6740. return;
  6741. }
  6742. }
  6743. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6744. if (thisCreateQty == 0) {
  6745. $.modalAlert("该单据条码已全部生成完毕!");
  6746. return;
  6747. }
  6748. thisCreateQty = thisCreateQty.toFixed(6);
  6749. minPackQty = Number(minPackQty).toFixed(6);
  6750. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6751. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6752. }
  6753. else {
  6754. createPageCount = parseInt(thisCreateQty / minPackQty);
  6755. }
  6756. createPageCount = createPageCount.toFixed(0);
  6757. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6758. Quantity = Quantity.toFixed(2);
  6759. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6760. CreatedQty = CreatedQty.toFixed(2);
  6761. if (Quantity == CreatedQty) {
  6762. return false;
  6763. }
  6764. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6765. if (EffectiveEnable == 'true') {
  6766. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6767. } else {
  6768. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6769. }
  6770. var obj = {
  6771. ID: ID,
  6772. Code: Code,
  6773. Sequence: Sequence,
  6774. thisCreateQty: thisCreateQty,
  6775. minPackQty: minPackQty,
  6776. createPageCount: createPageCount,
  6777. //VendorLot: VendorLot,
  6778. PRODUCTDATE: PRODUCTDATE,
  6779. ExpirationDate: ExpirationDate,
  6780. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6781. //自由项
  6782. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6783. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6784. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6785. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6786. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6787. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6788. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6789. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6790. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6791. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6792. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6793. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6794. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6795. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6796. }
  6797. ARR.push(obj);
  6798. }
  6799. $.submitForm({
  6800. url: "/JHWMS/WMSCreateItemLot/SubmitFormCGRKALL" + "?" + Math.random(),
  6801. param: {
  6802. keyValue: JSON.stringify(ARR)
  6803. },
  6804. success: function () {
  6805. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6806. }
  6807. })
  6808. }
  6809. if (Type == '24') {
  6810. debugger;
  6811. var ARR = [];
  6812. for (var i in ids) {
  6813. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6814. var Code = $("#gridList").jqGrid('getRowData', ids[i]).SSDCode;
  6815. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6816. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6817. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6818. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6819. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6820. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6821. if (minPackQty == '' || minPackQty == 0) {
  6822. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6823. return;
  6824. }
  6825. var Complete = '';
  6826. $.ajax({
  6827. url: "/JHWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6828. dataType: "json",
  6829. async: false,
  6830. success: function (data) {
  6831. if (data != null && data.length > 0) {
  6832. Complete = data[0].BatchEnable;
  6833. }
  6834. }
  6835. });
  6836. if (Complete == true) {
  6837. if (BatchCode == "") {
  6838. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6839. return;
  6840. }
  6841. }
  6842. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6843. if (thisCreateQty == 0) {
  6844. $.modalAlert("该单据条码已全部生成完毕!");
  6845. return;
  6846. }
  6847. thisCreateQty = thisCreateQty.toFixed(6);
  6848. minPackQty = Number(minPackQty).toFixed(6);
  6849. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6850. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6851. }
  6852. else {
  6853. createPageCount = parseInt(thisCreateQty / minPackQty);
  6854. }
  6855. createPageCount = createPageCount.toFixed(0);
  6856. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//订单总数
  6857. Quantity = Quantity.toFixed(2);
  6858. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6859. CreatedQty = CreatedQty.toFixed(2);
  6860. if (Quantity == CreatedQty) {
  6861. return false;
  6862. }
  6863. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6864. if (EffectiveEnable == 'true') {
  6865. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6866. } else {
  6867. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6868. }
  6869. var obj = {
  6870. ID: ID,
  6871. Code: Code,
  6872. Sequence: Sequence,
  6873. thisCreateQty: thisCreateQty,
  6874. minPackQty: minPackQty,
  6875. createPageCount: createPageCount,
  6876. //VendorLot: VendorLot,
  6877. PRODUCTDATE: PRODUCTDATE,
  6878. ExpirationDate: ExpirationDate,
  6879. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6880. //自由项
  6881. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6882. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6883. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6884. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6885. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6886. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6887. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6888. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6889. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6890. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6891. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6892. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6893. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6894. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6895. }
  6896. ARR.push(obj);
  6897. }
  6898. $.submitForm({
  6899. url: "/JHWMS/WMSCreateItemLot/SubmitFormXSTHALL" + "?" + Math.random(),
  6900. param: {
  6901. keyValue: JSON.stringify(ARR)
  6902. },
  6903. success: function () {
  6904. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6905. }
  6906. })
  6907. }
  6908. if (Type == '203') {
  6909. debugger;
  6910. var ARR = [];
  6911. for (var i in ids) {
  6912. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6913. var Code = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  6914. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6915. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6916. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6917. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6918. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6919. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6920. if (minPackQty == '' || minPackQty == 0) {
  6921. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6922. return;
  6923. }
  6924. var Complete = '';
  6925. $.ajax({
  6926. url: "/JHWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6927. dataType: "json",
  6928. async: false,
  6929. success: function (data) {
  6930. if (data != null && data.length > 0) {
  6931. Complete = data[0].BatchEnable;
  6932. }
  6933. }
  6934. });
  6935. if (Complete == true) {
  6936. if (BatchCode == "") {
  6937. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6938. return;
  6939. }
  6940. }
  6941. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6942. if (thisCreateQty == 0) {
  6943. $.modalAlert("该单据条码已全部生成完毕!");
  6944. return;
  6945. }
  6946. thisCreateQty = thisCreateQty.toFixed(6);
  6947. minPackQty = Number(minPackQty).toFixed(6);
  6948. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6949. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6950. }
  6951. else {
  6952. createPageCount = parseInt(thisCreateQty / minPackQty);
  6953. }
  6954. createPageCount = createPageCount.toFixed(0);
  6955. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6956. Quantity = Quantity.toFixed(2);
  6957. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6958. CreatedQty = CreatedQty.toFixed(2);
  6959. if (Quantity == CreatedQty) {
  6960. return false;
  6961. }
  6962. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6963. if (EffectiveEnable == 'true') {
  6964. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6965. } else {
  6966. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6967. }
  6968. var obj = {
  6969. ID: ID,
  6970. Code: Code,
  6971. Sequence: Sequence,
  6972. thisCreateQty: thisCreateQty,
  6973. minPackQty: minPackQty,
  6974. createPageCount: createPageCount,
  6975. //VendorLot: VendorLot,
  6976. PRODUCTDATE: PRODUCTDATE,
  6977. ExpirationDate: ExpirationDate,
  6978. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6979. //自由项
  6980. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6981. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6982. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6983. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6984. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6985. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6986. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6987. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6988. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6989. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6990. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6991. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6992. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6993. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6994. }
  6995. ARR.push(obj);
  6996. }
  6997. $.submitForm({
  6998. url: "/JHWMS/WMSCreateItemLot/SubmitFormYBDBALL" + "?" + Math.random(),
  6999. param: {
  7000. keyValue: JSON.stringify(ARR)
  7001. },
  7002. success: function () {
  7003. $.currentWindow().$("#gridList").trigger("reloadGrid");
  7004. }
  7005. })
  7006. }
  7007. }
  7008. </script>
  7009. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  7010. <script>
  7011. </script>
  7012. <div class="topPanel" style="height:149px;">
  7013. <div class="toolbar">
  7014. <div class="btn-group">
  7015. <a id="NF-ALLCreatePN" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnAllCreatePN()"><i class="fa fa-pencil-square-o"></i>整单条码生成</a>
  7016. <a id="NF-ALLCreate" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnAllCreate()"><i class="fa fa-pencil-square-o"></i>一键生成</a>
  7017. <a id="NF-CreateNew" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>生成条码(非规则)</a>
  7018. <a id="NF-Create" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>生成条码</a>
  7019. <a id="NF-CreatePN" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreatePN()"><i class="fa fa-pencil-square-o"></i>生成条码</a>
  7020. <a id="NF-Delete" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnDelete()"><i class="fa fa-pencil-square-o"></i>删除条码</a>
  7021. <a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>
  7022. <a id="NF-BatchPrint" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBatchPrint()"><i class="fa fa-pencil-square-o"></i>批量打印</a>
  7023. <a id="NF-btnInWareHouse" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnInWareHouse()"><i class="fa fa-pencil-square-o"></i>一键退库</a>
  7024. <a id="NF-Prints" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrints()"><i class="fa fa-pencil-square-o"></i>单据批量打印</a>
  7025. <a id="NF-ExportAll" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ExportAll()"><i class="fa fa-pencil-square-o"></i>导出</a>
  7026. @*<a id="NF-ExportAll" authorize="yes" class="btn btn-default" onclick="btn_ExportAll()"><i class="fa fa-download"></i>导出</a>*@
  7027. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  7028. </div>
  7029. <div class="btn-group" style="display:block;padding-left:2px;">
  7030. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  7031. <a id="NF-Import" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Import()"><i class="fa fa-pencil-square-o"></i>导入</a>
  7032. <a id="NF-Rebind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Rebind()"><i class="fa fa-pencil-square-o"></i>重新绑定</a>
  7033. <a id="NF-Looks" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreateLook()"><i class="fa fa-pencil-square-o"></i>查看子件信息</a>
  7034. </div>
  7035. <script>$('.toolbar').authorizeButton()</script>
  7036. </div>
  7037. <div class="search">
  7038. <table>
  7039. <tr>
  7040. <td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;</label>:</td>
  7041. <td class="POCodeShow">
  7042. <div class="input-group">
  7043. <input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
  7044. </div>
  7045. </td>
  7046. <td class="HideItems4" style="text-align:right;"><label class="lglabel HideItems4" for="txt_SourceCode">&nbsp;&nbsp;&nbsp;&nbsp;采购单号</label>:</td>
  7047. <td class="HideItems4">
  7048. <div class="input-group HideItems4">
  7049. <input id="txt_SourceCode" type="text" class="form-control HideItems4" style="width: 130px;">
  7050. </div>
  7051. </td>
  7052. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  7053. <td class="HideItems">
  7054. <div class="input-group HideItems">
  7055. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 130px;">
  7056. </div>
  7057. </td>
  7058. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  7059. <td class="HideItems">
  7060. <div class="input-group HideItems">
  7061. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;">
  7062. </div>
  7063. </td>
  7064. <td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;源头单据号</label>:</td>
  7065. <td class="HideItems2">
  7066. <div class="input-group HideItems2">
  7067. <input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;">
  7068. </div>
  7069. </td>
  7070. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(从)</label>:</td>
  7071. <td class="HideItemsTime">
  7072. <div class="input-group HideItemsTime">
  7073. <input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(从)" />
  7074. </div>
  7075. </td>
  7076. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(到)</label>:</td>
  7077. <td class="HideItemsTime">
  7078. <div class="input-group HideItemsTime">
  7079. <input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" />
  7080. </div>
  7081. </td>
  7082. <td class="HideClassGroup" style="text-align:right;">
  7083. <label>&nbsp;&nbsp;&nbsp;班组:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7084. </td>
  7085. <td class="HideClassGroup">
  7086. <div class="input-group">
  7087. <select id="selClassGroup" name="F_Target" class="form-control" style="width: 130px;">
  7088. <option value=""></option>
  7089. <option value="风电一组">风电一组</option>
  7090. <option value="风电二组">风电二组</option>
  7091. <option value="数控组">数控组</option>
  7092. <option value="新能源组">新能源组</option>
  7093. <option value="裁线组">裁线组</option>
  7094. <option value="中高压组">中高压组</option>
  7095. <option value="样品组">样品组</option>
  7096. <option value="铜排">铜排</option>
  7097. <option value="风电三组">风电三组</option>
  7098. <option value="风电四组">风电四组</option>
  7099. <option value="机器人线束">机器人线束</option>
  7100. </select>
  7101. </div>
  7102. </td>
  7103. </tr>
  7104. <tr>
  7105. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  7106. <td>
  7107. <div class="input-group">
  7108. <input id="txt_InvCode" type="text" class="form-control" style="width: 130px;">
  7109. </div>
  7110. </td>
  7111. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  7112. <td>
  7113. <div class="input-group">
  7114. <input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
  7115. </div>
  7116. </td>
  7117. <td class="HideItems3" style="text-align:right;"><label class="lglabel HideItems3" for="txt_InvStd">&nbsp;&nbsp;&nbsp;&nbsp;规格型号</label>:</td>
  7118. <td class="HideItems3">
  7119. <div class="input-group HideItems3">
  7120. <input id="txt_InvStd" type="text" class="form-control" style="width: 130px;">
  7121. </div>
  7122. </td>
  7123. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  7124. <td>
  7125. <div class="input-group">
  7126. <input id="txt_BatchCode" type="text" class="form-control" style="width: 130px;">
  7127. </div>
  7128. </td>
  7129. <td id="GDLX">
  7130. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7131. </td>
  7132. <td id="GDLX2">
  7133. <div class="input-group">
  7134. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;">
  7135. </select>
  7136. </div>
  7137. </td>
  7138. </tr>
  7139. <tr>
  7140. <td class="HideWH" style="text-align:right;">
  7141. <label>&nbsp;&nbsp;&nbsp;仓库编码:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7142. </td>
  7143. <td class="HideWH">
  7144. <div class="input-group HideWH">
  7145. <input id="txt_WHCode" type="text" class="form-control HideWH" style="width: 130px;">
  7146. </div>
  7147. </td>
  7148. <td>
  7149. <label>&nbsp;&nbsp;&nbsp;是否全部生成:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7150. </td>
  7151. <td>
  7152. <div class="input-group">
  7153. <select id="selShow" name="F_Target" class="form-control" style="width: 130px;">
  7154. <option value="0" selected="selected">显示全部</option>
  7155. <option value="1">已全部生成</option>
  7156. <option value="2">未全部生成</option>
  7157. </select>
  7158. </div>
  7159. </td>
  7160. <td clsaa="Status">
  7161. <label>&nbsp;&nbsp;&nbsp;是否全部入库:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7162. </td>
  7163. <td clsaa="Status">
  7164. <div class="input-group">
  7165. <select id="selStatus" name="F_Target" class="form-control" style="width: 130px;">
  7166. <option value="0" selected="selected">全部</option>
  7167. <option value="1">未全部入库</option>
  7168. <option value="2">已全部入库</option>
  7169. </select>
  7170. </div>
  7171. </td>
  7172. <td class="HideItems3">
  7173. <label>&nbsp;&nbsp;&nbsp;条码是否打印:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  7174. </td>
  7175. <td class="HideItems3">
  7176. <div class="input-group HideItems3">
  7177. <select id="selPrint" name="selPrint" class="form-control HideItems3" style="width: 130px;">
  7178. <option value="0" selected="selected">显示全部</option>
  7179. <option value="1">已打印</option>
  7180. <option value="2">未打印</option>
  7181. </select>
  7182. </div>
  7183. </td>
  7184. <td>
  7185. <span class="input-group-btn">
  7186. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  7187. </span>
  7188. </td>
  7189. </tr>
  7190. </table>
  7191. </div>
  7192. </div>
  7193. <div class="gridPanel">
  7194. <table id="gridList"></table>
  7195. <div id="gridPager"></div>
  7196. </div>