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.

4693 lines
243 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. @*佑伦独有生成条码页面*@
  6. <script>
  7. debugger;
  8. var _Clos = new Array();
  9. var Type = $.request("Type");
  10. var Name = "单据号";
  11. var ColModelMain = [];
  12. var ColModelSub = [];
  13. $(function () {
  14. SetCols();
  15. if (Type == '17') {
  16. Name = "条码号";
  17. $("#POCodeShowLable").text(Name);
  18. } else {
  19. $("#POCodeShowLable").text(Name);
  20. }
  21. if (Type!='3') {
  22. $("#GDLX").css('display', 'none');
  23. $("#GDLX2").css('display', 'none');
  24. }
  25. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9' || Type == '17') {
  26. $(".HideItems").css('display', 'none');
  27. }
  28. if (Type == '1') {
  29. gridList();
  30. }
  31. if (Type == '2') {
  32. gridList2();
  33. }
  34. if (Type == '3') {
  35. $(".GDLX").css('display', 'block');
  36. Select_SelGDLX();
  37. gridList3();
  38. }
  39. if (Type == '4') {
  40. gridList4();
  41. }
  42. if (Type == '5') {
  43. gridList5();
  44. }
  45. if (Type == '6') {
  46. gridList6();
  47. }
  48. //审核到货单生成条码
  49. if (Type == '7') {
  50. gridList7();
  51. }
  52. //审核委外到货单生成条码
  53. if (Type == '8') {
  54. gridList8();
  55. }
  56. //开立成品入库单生成条码
  57. if (Type == '9') {
  58. gridList9();
  59. }
  60. //审核拒收单生成条码
  61. if (Type == '10') {
  62. gridList10();
  63. }
  64. //审核委外拒收单生成条码
  65. if (Type == '11') {
  66. gridList11();
  67. }
  68. //领料申请退料生成条码
  69. if (Type == '12') {
  70. gridList12();
  71. }
  72. //材料出库退料生成条码
  73. if (Type == '13') {
  74. gridList13();
  75. }
  76. //委外领料申请退料生成条码
  77. if (Type == '14') {
  78. gridList14();
  79. }
  80. //委外材料出库退料生成条码
  81. if (Type == '15') {
  82. gridList15();
  83. }
  84. //返工工单
  85. if (Type == '16') {
  86. gridList16();
  87. }
  88. //不合格条码入库
  89. if (Type == '17') {
  90. gridList17();
  91. }
  92. //副产品
  93. if (Type == '18') {
  94. gridList18();
  95. }
  96. })
  97. function SetCols() {
  98. $.ajax({
  99. url: "/Print/SelectColumnName?" + Math.random(),
  100. dataType: "json",
  101. async: false,
  102. success: function (data) {
  103. var cols = new Array();
  104. var cols1 = new Array();
  105. if (Type == '1') {
  106. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  107. cols.push(collast);
  108. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  109. cols.push(collast);
  110. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  111. cols.push(collast);
  112. var collast = { label: '工单子件', name: 'SourceDetailID', hidden: true, };
  113. cols.push(collast);
  114. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  115. cols.push(collast);
  116. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  117. cols.push(collast);
  118. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  119. cols.push(collast);
  120. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  121. cols.push(collast);
  122. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  123. cols.push(collast);
  124. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  125. cols.push(collast);
  126. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  127. cols.push(collast);
  128. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  129. //cols.push(collast);
  130. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  131. cols.push(collast);
  132. var collast = { label: '工单号', name: 'MOCode', width: 60, align: 'left', };
  133. cols.push(collast);
  134. var collast = { label: '创建日期', name: 'MTIME', width: 60, align: 'left', };
  135. cols.push(collast);
  136. $.ajax({
  137. url: "/Print/SelectTableColumnName?" + Math.random(),
  138. dataType: "json",
  139. async: false,
  140. success: function (data) {
  141. if (data != null && data.length > 0) {
  142. DateList = data;
  143. for (var i = 0; i < data.length; i++) {
  144. var TableCode = data[i].TableCode;
  145. if (TableCode == "ICSMOPick") {
  146. var Code = data[i].Code;
  147. var Name = data[i].Name;
  148. var obj = new Array();
  149. obj = {
  150. label: Name,
  151. name: Code,
  152. width: 80,
  153. align: "left"
  154. }
  155. cols.push(obj);
  156. }
  157. if (TableCode == "ICSInventory") {
  158. var Code = data[i].Code;
  159. var Name = data[i].Name;
  160. var obj = new Array();
  161. obj = {
  162. label: Name,
  163. name: Code,
  164. width: 80,
  165. align: "left"
  166. }
  167. cols.push(obj);
  168. //cols1.push(obj);
  169. }
  170. }
  171. }
  172. _Clos = cols;
  173. //_Clos1 = cols1;
  174. }
  175. });
  176. }
  177. if (Type == '2') {
  178. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  179. cols.push(collast);
  180. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  181. cols.push(collast);
  182. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  183. cols.push(collast);
  184. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  185. cols.push(collast);
  186. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  187. cols.push(collast);
  188. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  189. cols.push(collast);
  190. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  191. cols.push(collast);
  192. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  193. cols.push(collast);
  194. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  195. cols.push(collast);
  196. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  197. cols.push(collast);
  198. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  199. cols.push(collast);
  200. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  201. //cols.push(collast);
  202. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  203. cols.push(collast);
  204. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  205. //cols.push(collast);
  206. $.ajax({
  207. url: "/Print/SelectTableColumnName?" + Math.random(),
  208. dataType: "json",
  209. async: false,
  210. success: function (data) {
  211. if (data != null && data.length > 0) {
  212. DateList = data;
  213. for (var i = 0; i < data.length; i++) {
  214. var TableCode = data[i].TableCode;
  215. if (TableCode == "ICSOApplyNegDetail") {
  216. var Code = data[i].Code;
  217. var Name = data[i].Name;
  218. var obj = new Array();
  219. obj = {
  220. label: Name,
  221. name: Code,
  222. width: 80,
  223. align: "left"
  224. }
  225. cols.push(obj);
  226. }
  227. if (TableCode == "ICSInventory") {
  228. var Code = data[i].Code;
  229. var Name = data[i].Name;
  230. var obj = new Array();
  231. obj = {
  232. label: Name,
  233. name: Code,
  234. width: 80,
  235. align: "left"
  236. }
  237. cols.push(obj);
  238. //cols1.push(obj);
  239. }
  240. }
  241. }
  242. _Clos = cols;
  243. //_Clos1 = cols1;
  244. }
  245. });
  246. }
  247. if (Type == '3') {
  248. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  249. cols.push(collast);
  250. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  251. cols.push(collast);
  252. var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
  253. cols.push(collast);
  254. var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true };
  255. cols.push(collast);
  256. var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
  257. cols.push(collast);
  258. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  259. cols.push(collast);
  260. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  261. cols.push(collast);
  262. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  263. cols.push(collast);
  264. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  265. cols.push(collast);
  266. var collast = {
  267. label: "状态", name: "MOStatus", width: 60, align: "left",
  268. formatter: function (cellvalue) {
  269. if (cellvalue == "1") {
  270. return "初始";
  271. } else if (cellvalue == "2") {
  272. return "下发";
  273. }
  274. else if (cellvalue == "3") {
  275. return "关单";
  276. }
  277. else { return ""; }
  278. }
  279. };
  280. cols.push(collast);
  281. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  282. cols.push(collast);
  283. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  284. cols.push(collast);
  285. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  286. //cols.push(collast);
  287. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  288. cols.push(collast);
  289. var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' };
  290. cols.push(collast);
  291. var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' };
  292. cols.push(collast);
  293. $.ajax({
  294. url: "/Print/SelectTableColumnName?" + Math.random(),
  295. dataType: "json",
  296. async: false,
  297. success: function (data) {
  298. if (data != null && data.length > 0) {
  299. DateList = data;
  300. for (var i = 0; i < data.length; i++) {
  301. var TableCode = data[i].TableCode;
  302. if (TableCode == "ICSMO") {
  303. var Code = data[i].Code;
  304. var Name = data[i].Name;
  305. var obj = new Array();
  306. obj = {
  307. label: Name,
  308. name: Code,
  309. width: 80,
  310. align: "left"
  311. }
  312. cols.push(obj);
  313. }
  314. if (TableCode == "ICSInventory") {
  315. var Code = data[i].Code;
  316. var Name = data[i].Name;
  317. var obj = new Array();
  318. obj = {
  319. label: Name,
  320. name: Code,
  321. width: 80,
  322. align: "left"
  323. }
  324. cols.push(obj);
  325. //cols1.push(obj);
  326. }
  327. }
  328. }
  329. _Clos = cols;
  330. //_Clos1 = cols1;
  331. }
  332. });
  333. }
  334. if (Type == '4') {
  335. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  336. cols.push(collast);
  337. var collast = { label: '单据号', name: 'SDNCode', width: 120, align: 'left' };
  338. cols.push(collast);
  339. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  340. cols.push(collast);
  341. var collast = { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' };
  342. cols.push(collast);
  343. var collast = { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' };
  344. cols.push(collast);
  345. var collast = { label: '客户代码', name: 'CusCode', width: 120, align: 'left' };
  346. cols.push(collast);
  347. var collast = { label: '客户名称', name: 'CusName', width: 50, align: 'left' };
  348. cols.push(collast);
  349. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  350. cols.push(collast);
  351. var collast = { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' };
  352. cols.push(collast);
  353. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  354. cols.push(collast);
  355. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  356. cols.push(collast);
  357. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  358. cols.push(collast);
  359. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  360. cols.push(collast);
  361. var collast = {
  362. label: "状态", name: "Status", width: 60, align: "left",
  363. formatter: function (cellvalue) {
  364. if (cellvalue == "1") {
  365. return "开立";
  366. } else if (cellvalue == "2") {
  367. return "审核";
  368. }
  369. else if (cellvalue == "3") {
  370. return "关闭";
  371. }
  372. else { return ""; }
  373. }
  374. };
  375. cols.push(collast);
  376. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  377. cols.push(collast);
  378. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  379. cols.push(collast);
  380. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  381. //cols.push(collast);
  382. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  383. cols.push(collast);
  384. $.ajax({
  385. url: "/Print/SelectTableColumnName?" + Math.random(),
  386. dataType: "json",
  387. async: false,
  388. success: function (data) {
  389. if (data != null && data.length > 0) {
  390. DateList = data;
  391. for (var i = 0; i < data.length; i++) {
  392. var TableCode = data[i].TableCode;
  393. if (TableCode == "ICSSDN") {
  394. var Code = data[i].Code;
  395. var Name = data[i].Name;
  396. var obj = new Array();
  397. obj = {
  398. label: Name,
  399. name: Code,
  400. width: 80,
  401. align: "left"
  402. }
  403. cols.push(obj);
  404. }
  405. if (TableCode == "ICSInventory") {
  406. var Code = data[i].Code;
  407. var Name = data[i].Name;
  408. var obj = new Array();
  409. obj = {
  410. label: Name,
  411. name: Code,
  412. width: 80,
  413. align: "left"
  414. }
  415. cols.push(obj);
  416. //cols1.push(obj);
  417. }
  418. }
  419. }
  420. _Clos = cols;
  421. //_Clos1 = cols1;
  422. }
  423. });
  424. }
  425. if (Type == '5') {
  426. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  427. cols.push(collast);
  428. var collast = { label: '单据号', name: 'InCode', width: 120, align: 'left' };
  429. cols.push(collast);
  430. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  431. cols.push(collast);
  432. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  433. cols.push(collast);
  434. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  435. cols.push(collast);
  436. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  437. cols.push(collast);
  438. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  439. cols.push(collast);
  440. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  441. cols.push(collast);
  442. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  443. cols.push(collast);
  444. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  445. cols.push(collast);
  446. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  447. cols.push(collast);
  448. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  449. cols.push(collast);
  450. var collast = { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', };
  451. cols.push(collast);
  452. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  453. cols.push(collast);
  454. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  455. cols.push(collast);
  456. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  457. //cols.push(collast);
  458. $.ajax({
  459. url: "/Print/SelectTableColumnName?" + Math.random(),
  460. dataType: "json",
  461. async: false,
  462. success: function (data) {
  463. if (data != null && data.length > 0) {
  464. DateList = data;
  465. for (var i = 0; i < data.length; i++) {
  466. var TableCode = data[i].TableCode;
  467. if (TableCode == "ICSOtherIn") {
  468. var Code = data[i].Code;
  469. var Name = data[i].Name;
  470. var obj = new Array();
  471. obj = {
  472. label: Name,
  473. name: Code,
  474. width: 80,
  475. align: "left"
  476. }
  477. cols.push(obj);
  478. }
  479. if (TableCode == "ICSInventory") {
  480. var Code = data[i].Code;
  481. var Name = data[i].Name;
  482. var obj = new Array();
  483. obj = {
  484. label: Name,
  485. name: Code,
  486. width: 80,
  487. align: "left"
  488. }
  489. cols.push(obj);
  490. //cols1.push(obj);
  491. }
  492. }
  493. }
  494. _Clos = cols;
  495. //_Clos1 = cols1;
  496. }
  497. });
  498. }
  499. if (Type == '6') {
  500. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  501. cols.push(collast);
  502. var collast = { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' };
  503. cols.push(collast);
  504. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  505. cols.push(collast);
  506. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  507. cols.push(collast);
  508. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  509. cols.push(collast);
  510. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  511. cols.push(collast);
  512. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  513. cols.push(collast);
  514. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  515. cols.push(collast);
  516. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  517. cols.push(collast);
  518. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  519. cols.push(collast);
  520. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  521. cols.push(collast);
  522. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  523. cols.push(collast);
  524. var collast = { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', };
  525. cols.push(collast);
  526. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  527. cols.push(collast);
  528. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  529. cols.push(collast);
  530. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  531. //cols.push(collast);
  532. $.ajax({
  533. url: "/Print/SelectTableColumnName?" + Math.random(),
  534. dataType: "json",
  535. async: false,
  536. success: function (data) {
  537. if (data != null && data.length > 0) {
  538. DateList = data;
  539. for (var i = 0; i < data.length; i++) {
  540. var TableCode = data[i].TableCode;
  541. if (TableCode == "ICSReturn") {
  542. var Code = data[i].Code;
  543. var Name = data[i].Name;
  544. var obj = new Array();
  545. obj = {
  546. label: Name,
  547. name: Code,
  548. width: 80,
  549. align: "left"
  550. }
  551. cols.push(obj);
  552. }
  553. if (TableCode == "ICSInventory") {
  554. var Code = data[i].Code;
  555. var Name = data[i].Name;
  556. var obj = new Array();
  557. obj = {
  558. label: Name,
  559. name: Code,
  560. width: 80,
  561. align: "left"
  562. }
  563. cols.push(obj);
  564. //cols1.push(obj);
  565. }
  566. }
  567. }
  568. _Clos = cols;
  569. //_Clos1 = cols1;
  570. }
  571. });
  572. }
  573. //审核到货单生成条码
  574. if (Type == '7') {
  575. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  576. cols.push(collast);
  577. var collast = { label: '单据号', name: 'DNCode', width: 120, align: 'left' };
  578. cols.push(collast);
  579. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  580. cols.push(collast);
  581. var collast = { label: '采购订单号', name: 'POCode', width: 50, align: 'left' };
  582. cols.push(collast);
  583. var collast = { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' };
  584. cols.push(collast);
  585. //var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  586. //cols.push(collast);
  587. //var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  588. //cols.push(collast);
  589. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  590. cols.push(collast);
  591. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  592. cols.push(collast);
  593. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  594. cols.push(collast);
  595. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  596. cols.push(collast);
  597. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  598. cols.push(collast);
  599. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  600. cols.push(collast);
  601. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  602. //cols.push(collast);
  603. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  604. cols.push(collast);
  605. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  606. cols.push(collast);
  607. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  608. cols.push(collast);
  609. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  610. cols.push(collast);
  611. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  612. cols.push(collast);
  613. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  614. cols.push(collast);
  615. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  616. cols.push(collast);
  617. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  618. cols.push(collast);
  619. $.ajax({
  620. url: "/Print/SelectTableColumnName?" + Math.random(),
  621. dataType: "json",
  622. async: false,
  623. success: function (data) {
  624. if (data != null && data.length > 0) {
  625. DateList = data;
  626. for (var i = 0; i < data.length; i++) {
  627. var TableCode = data[i].TableCode;
  628. if (TableCode == "ICSDeliveryNotice") {
  629. debugger;
  630. var Code = data[i].Code;
  631. var Name = data[i].Name;
  632. var obj = new Array();
  633. obj = {
  634. label: Name,
  635. name: Code,
  636. width: 80,
  637. align: "left"
  638. }
  639. cols.push(obj);
  640. }
  641. if (TableCode == "ICSInventory") {
  642. var Code = data[i].Code;
  643. var Name = data[i].Name;
  644. var obj = new Array();
  645. obj = {
  646. label: Name,
  647. name: Code,
  648. width: 80,
  649. align: "left"
  650. }
  651. cols.push(obj);
  652. //cols1.push(obj);
  653. }
  654. }
  655. }
  656. _Clos = cols;
  657. //_Clos1 = cols1;
  658. }
  659. });
  660. }
  661. //审核委外到货单生成条码
  662. if (Type == '8') {
  663. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  664. cols.push(collast);
  665. var collast = { label: '单据号', name: 'ODNCode', width: 120, align: 'left' };
  666. cols.push(collast);
  667. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  668. cols.push(collast);
  669. var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  670. cols.push(collast);
  671. var collast = { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' };
  672. cols.push(collast);
  673. var collast = { label: '委外订单表体ID', name: 'OODetailID', hidden: true };
  674. cols.push(collast);
  675. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  676. cols.push(collast);
  677. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  678. cols.push(collast);
  679. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  680. cols.push(collast);
  681. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  682. cols.push(collast);
  683. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  684. cols.push(collast);
  685. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  686. cols.push(collast);
  687. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  688. cols.push(collast);
  689. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  690. cols.push(collast);
  691. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  692. //cols.push(collast);
  693. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  694. cols.push(collast);
  695. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  696. cols.push(collast);
  697. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  698. cols.push(collast);
  699. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  700. cols.push(collast);
  701. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  702. cols.push(collast);
  703. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  704. cols.push(collast);
  705. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  706. cols.push(collast);
  707. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  708. cols.push(collast);
  709. $.ajax({
  710. url: "/Print/SelectTableColumnName?" + Math.random(),
  711. dataType: "json",
  712. async: false,
  713. success: function (data) {
  714. if (data != null && data.length > 0) {
  715. DateList = data;
  716. for (var i = 0; i < data.length; i++) {
  717. var TableCode = data[i].TableCode;
  718. if (TableCode == "ICSODeliveryNotice") {
  719. var Code = data[i].Code;
  720. var Name = data[i].Name;
  721. var obj = new Array();
  722. obj = {
  723. label: Name,
  724. name: Code,
  725. width: 80,
  726. align: "left"
  727. }
  728. cols.push(obj);
  729. }
  730. if (TableCode == "ICSInventory") {
  731. var Code = data[i].Code;
  732. var Name = data[i].Name;
  733. var obj = new Array();
  734. obj = {
  735. label: Name,
  736. name: Code,
  737. width: 80,
  738. align: "left"
  739. }
  740. cols.push(obj);
  741. //cols1.push(obj);
  742. }
  743. }
  744. }
  745. _Clos = cols;
  746. //_Clos1 = cols1;
  747. }
  748. });
  749. }
  750. //开立成品入库单生成条码
  751. if (Type == '9') {
  752. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  753. cols.push(collast);
  754. var collast = { label: '单据号', name: 'RCVCode', width: 120, align: 'left' };
  755. cols.push(collast);
  756. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  757. cols.push(collast);
  758. var collast = { label: '仓库号', name: 'WHCode', width: 120, align: 'left' };
  759. cols.push(collast);
  760. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  761. cols.push(collast);
  762. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  763. cols.push(collast);
  764. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  765. cols.push(collast);
  766. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  767. cols.push(collast);
  768. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  769. cols.push(collast);
  770. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  771. cols.push(collast);
  772. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  773. //cols.push(collast);
  774. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  775. cols.push(collast);
  776. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  777. cols.push(collast);
  778. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  779. cols.push(collast);
  780. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  781. cols.push(collast);
  782. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  783. cols.push(collast);
  784. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  785. cols.push(collast);
  786. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  787. cols.push(collast);
  788. $.ajax({
  789. url: "/Print/SelectTableColumnName?" + Math.random(),
  790. dataType: "json",
  791. async: false,
  792. success: function (data) {
  793. if (data != null && data.length > 0) {
  794. DateList = data;
  795. for (var i = 0; i < data.length; i++) {
  796. var TableCode = data[i].TableCode;
  797. if (TableCode == "ICSMO") {
  798. var Code = data[i].Code;
  799. var Name = data[i].Name;
  800. var obj = new Array();
  801. obj = {
  802. label: Name,
  803. name: Code,
  804. width: 80,
  805. align: "left"
  806. }
  807. cols.push(obj);
  808. }
  809. if (TableCode == "ICSInventory") {
  810. var Code = data[i].Code;
  811. var Name = data[i].Name;
  812. var obj = new Array();
  813. obj = {
  814. label: Name,
  815. name: Code,
  816. width: 80,
  817. align: "left"
  818. }
  819. cols.push(obj);
  820. //cols1.push(obj);
  821. }
  822. }
  823. }
  824. _Clos = cols;
  825. //_Clos1 = cols1;
  826. }
  827. });
  828. }
  829. //审核拒收单生成条码
  830. if (Type == '10') {
  831. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  832. cols.push(collast);
  833. var collast = { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' };
  834. cols.push(collast);
  835. var collast = { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' };
  836. cols.push(collast);
  837. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  838. cols.push(collast);
  839. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  840. cols.push(collast);
  841. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  842. cols.push(collast);
  843. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  844. cols.push(collast);
  845. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  846. cols.push(collast);
  847. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  848. cols.push(collast);
  849. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  850. cols.push(collast);
  851. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  852. cols.push(collast);
  853. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  854. cols.push(collast);
  855. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  856. cols.push(collast);
  857. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  858. cols.push(collast);
  859. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  860. cols.push(collast);
  861. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  862. cols.push(collast);
  863. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  864. cols.push(collast);
  865. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  866. cols.push(collast);
  867. $.ajax({
  868. url: "/Print/SelectTableColumnName?" + Math.random(),
  869. dataType: "json",
  870. async: false,
  871. success: function (data) {
  872. if (data != null && data.length > 0) {
  873. DateList = data;
  874. for (var i = 0; i < data.length; i++) {
  875. var TableCode = data[i].TableCode;
  876. if (TableCode == "ICSDeliveryNotice") {
  877. var Code = data[i].Code;
  878. var Name = data[i].Name;
  879. var obj = new Array();
  880. obj = {
  881. label: Name,
  882. name: Code,
  883. width: 80,
  884. align: "left"
  885. }
  886. cols.push(obj);
  887. }
  888. if (TableCode == "ICSInventory") {
  889. var Code = data[i].Code;
  890. var Name = data[i].Name;
  891. var obj = new Array();
  892. obj = {
  893. label: Name,
  894. name: Code,
  895. width: 80,
  896. align: "left"
  897. }
  898. cols.push(obj);
  899. //cols1.push(obj);
  900. }
  901. }
  902. }
  903. _Clos = cols;
  904. //_Clos1 = cols1;
  905. }
  906. });
  907. }
  908. //审核委外拒收单生成条码
  909. if (Type == '11') {
  910. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  911. cols.push(collast);
  912. var collast = { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' };
  913. cols.push(collast);
  914. var collast = { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' };
  915. cols.push(collast);
  916. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  917. cols.push(collast);
  918. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  919. cols.push(collast);
  920. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  921. cols.push(collast);
  922. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  923. cols.push(collast);
  924. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  925. cols.push(collast);
  926. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  927. cols.push(collast);
  928. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  929. cols.push(collast);
  930. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  931. cols.push(collast);
  932. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  933. cols.push(collast);
  934. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  935. cols.push(collast);
  936. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  937. cols.push(collast);
  938. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  939. cols.push(collast);
  940. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  941. cols.push(collast);
  942. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  943. cols.push(collast);
  944. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  945. cols.push(collast);
  946. $.ajax({
  947. url: "/Print/SelectTableColumnName?" + Math.random(),
  948. dataType: "json",
  949. async: false,
  950. success: function (data) {
  951. if (data != null && data.length > 0) {
  952. DateList = data;
  953. for (var i = 0; i < data.length; i++) {
  954. var TableCode = data[i].TableCode;
  955. if (TableCode == "ICSODeliveryNotice") {
  956. var Code = data[i].Code;
  957. var Name = data[i].Name;
  958. var obj = new Array();
  959. obj = {
  960. label: Name,
  961. name: Code,
  962. width: 80,
  963. align: "left"
  964. }
  965. cols.push(obj);
  966. }
  967. if (TableCode == "ICSInventory") {
  968. var Code = data[i].Code;
  969. var Name = data[i].Name;
  970. var obj = new Array();
  971. obj = {
  972. label: Name,
  973. name: Code,
  974. width: 80,
  975. align: "left"
  976. }
  977. cols.push(obj);
  978. //cols1.push(obj);
  979. }
  980. }
  981. }
  982. _Clos = cols;
  983. //_Clos1 = cols1;
  984. }
  985. });
  986. }
  987. //领料申请退料生成条码
  988. if (Type == '12') {
  989. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  990. cols.push(collast);
  991. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  992. cols.push(collast);
  993. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  994. cols.push(collast);
  995. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  996. cols.push(collast);
  997. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  998. cols.push(collast);
  999. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  1000. cols.push(collast);
  1001. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1002. cols.push(collast);
  1003. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1004. cols.push(collast);
  1005. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1006. cols.push(collast);
  1007. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1008. cols.push(collast);
  1009. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1010. cols.push(collast);
  1011. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1012. //cols.push(collast);
  1013. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1014. cols.push(collast);
  1015. $.ajax({
  1016. url: "/Print/SelectTableColumnName?" + Math.random(),
  1017. dataType: "json",
  1018. async: false,
  1019. success: function (data) {
  1020. if (data != null && data.length > 0) {
  1021. DateList = data;
  1022. for (var i = 0; i < data.length; i++) {
  1023. var TableCode = data[i].TableCode;
  1024. if (TableCode == "ICSMOApplyNegDetail") {
  1025. var Code = data[i].Code;
  1026. var Name = data[i].Name;
  1027. var obj = new Array();
  1028. obj = {
  1029. label: Name,
  1030. name: Code,
  1031. width: 80,
  1032. align: "left"
  1033. }
  1034. cols.push(obj);
  1035. }
  1036. if (TableCode == "ICSInventory") {
  1037. var Code = data[i].Code;
  1038. var Name = data[i].Name;
  1039. var obj = new Array();
  1040. obj = {
  1041. label: Name,
  1042. name: Code,
  1043. width: 80,
  1044. align: "left"
  1045. }
  1046. cols.push(obj);
  1047. //cols1.push(obj);
  1048. }
  1049. }
  1050. }
  1051. _Clos = cols;
  1052. //_Clos1 = cols1;
  1053. }
  1054. });
  1055. }
  1056. //材料出库退料生成条码
  1057. if (Type == '13') {
  1058. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1059. cols.push(collast);
  1060. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  1061. cols.push(collast);
  1062. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1063. cols.push(collast);
  1064. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  1065. cols.push(collast);
  1066. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1067. cols.push(collast);
  1068. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  1069. cols.push(collast);
  1070. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1071. cols.push(collast);
  1072. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1073. cols.push(collast);
  1074. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1075. cols.push(collast);
  1076. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1077. cols.push(collast);
  1078. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1079. cols.push(collast);
  1080. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1081. //cols.push(collast);
  1082. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1083. cols.push(collast);
  1084. }
  1085. //委外领料申请退料生成条码
  1086. if (Type == '14') {
  1087. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1088. cols.push(collast);
  1089. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1090. cols.push(collast);
  1091. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1092. cols.push(collast);
  1093. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1094. cols.push(collast);
  1095. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1096. cols.push(collast);
  1097. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1098. cols.push(collast);
  1099. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1100. cols.push(collast);
  1101. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1102. cols.push(collast);
  1103. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1104. cols.push(collast);
  1105. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1106. cols.push(collast);
  1107. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1108. cols.push(collast);
  1109. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1110. //cols.push(collast);
  1111. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1112. cols.push(collast);
  1113. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1114. //cols.push(collast);
  1115. $.ajax({
  1116. url: "/Print/SelectTableColumnName?" + Math.random(),
  1117. dataType: "json",
  1118. async: false,
  1119. success: function (data) {
  1120. if (data != null && data.length > 0) {
  1121. DateList = data;
  1122. for (var i = 0; i < data.length; i++) {
  1123. var TableCode = data[i].TableCode;
  1124. if (TableCode == "ICSOApplyNegDetail") {
  1125. var Code = data[i].Code;
  1126. var Name = data[i].Name;
  1127. var obj = new Array();
  1128. obj = {
  1129. label: Name,
  1130. name: Code,
  1131. width: 80,
  1132. align: "left"
  1133. }
  1134. cols.push(obj);
  1135. }
  1136. if (TableCode == "ICSInventory") {
  1137. var Code = data[i].Code;
  1138. var Name = data[i].Name;
  1139. var obj = new Array();
  1140. obj = {
  1141. label: Name,
  1142. name: Code,
  1143. width: 80,
  1144. align: "left"
  1145. }
  1146. cols.push(obj);
  1147. //cols1.push(obj);
  1148. }
  1149. }
  1150. }
  1151. _Clos = cols;
  1152. //_Clos1 = cols1;
  1153. }
  1154. });
  1155. }
  1156. //委外材料出库退料生成条码
  1157. if (Type == '15') {
  1158. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1159. cols.push(collast);
  1160. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1161. cols.push(collast);
  1162. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1163. cols.push(collast);
  1164. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1165. cols.push(collast);
  1166. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1167. cols.push(collast);
  1168. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1169. cols.push(collast);
  1170. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1171. cols.push(collast);
  1172. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1173. cols.push(collast);
  1174. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1175. cols.push(collast);
  1176. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1177. cols.push(collast);
  1178. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1179. cols.push(collast);
  1180. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1181. //cols.push(collast);
  1182. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1183. cols.push(collast);
  1184. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1185. //cols.push(collast);
  1186. $.ajax({
  1187. url: "/Print/SelectTableColumnName?" + Math.random(),
  1188. dataType: "json",
  1189. async: false,
  1190. success: function (data) {
  1191. if (data != null && data.length > 0) {
  1192. DateList = data;
  1193. for (var i = 0; i < data.length; i++) {
  1194. var TableCode = data[i].TableCode;
  1195. if (TableCode == "ICSOApplyNegDetail") {
  1196. var Code = data[i].Code;
  1197. var Name = data[i].Name;
  1198. var obj = new Array();
  1199. obj = {
  1200. label: Name,
  1201. name: Code,
  1202. width: 80,
  1203. align: "left"
  1204. }
  1205. cols.push(obj);
  1206. }
  1207. if (TableCode == "ICSInventory") {
  1208. var Code = data[i].Code;
  1209. var Name = data[i].Name;
  1210. var obj = new Array();
  1211. obj = {
  1212. label: Name,
  1213. name: Code,
  1214. width: 80,
  1215. align: "left"
  1216. }
  1217. cols.push(obj);
  1218. //cols1.push(obj);
  1219. }
  1220. }
  1221. }
  1222. _Clos = cols;
  1223. //_Clos1 = cols1;
  1224. }
  1225. });
  1226. }
  1227. //返工工单生成条码
  1228. if (Type == '16') {
  1229. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1230. cols.push(collast);
  1231. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1232. cols.push(collast);
  1233. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1234. cols.push(collast);
  1235. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1236. cols.push(collast);
  1237. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1238. cols.push(collast);
  1239. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1240. cols.push(collast);
  1241. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1242. cols.push(collast);
  1243. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1244. cols.push(collast);
  1245. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1246. cols.push(collast);
  1247. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1248. cols.push(collast);
  1249. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1250. cols.push(collast);
  1251. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1252. //cols.push(collast);
  1253. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1254. cols.push(collast);
  1255. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1256. //cols.push(collast);
  1257. $.ajax({
  1258. url: "/Print/SelectTableColumnName?" + Math.random(),
  1259. dataType: "json",
  1260. async: false,
  1261. success: function (data) {
  1262. if (data != null && data.length > 0) {
  1263. DateList = data;
  1264. for (var i = 0; i < data.length; i++) {
  1265. var TableCode = data[i].TableCode;
  1266. if (TableCode == "ICSMOPick") {
  1267. var Code = data[i].Code;
  1268. var Name = data[i].Name;
  1269. var obj = new Array();
  1270. obj = {
  1271. label: Name,
  1272. name: Code,
  1273. width: 80,
  1274. align: "left"
  1275. }
  1276. cols.push(obj);
  1277. }
  1278. if (TableCode == "ICSInventory") {
  1279. var Code = data[i].Code;
  1280. var Name = data[i].Name;
  1281. var obj = new Array();
  1282. obj = {
  1283. label: Name,
  1284. name: Code,
  1285. width: 80,
  1286. align: "left"
  1287. }
  1288. cols.push(obj);
  1289. //cols1.push(obj);
  1290. }
  1291. }
  1292. }
  1293. _Clos = cols;
  1294. //_Clos1 = cols1;
  1295. }
  1296. });
  1297. }
  1298. //不合格条码生成条码
  1299. if (Type == '17') {
  1300. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1301. cols.push(collast);
  1302. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  1303. cols.push(collast);
  1304. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1305. cols.push(collast);
  1306. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1307. cols.push(collast);
  1308. var collast = { label: '不合格数量', name: 'Quantity', width: 100, align: 'left' };
  1309. cols.push(collast);
  1310. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1311. cols.push(collast);
  1312. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1313. cols.push(collast);
  1314. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1315. cols.push(collast);
  1316. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1317. //cols.push(collast);
  1318. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1319. cols.push(collast);
  1320. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1321. //cols.push(collast);
  1322. $.ajax({
  1323. url: "/Print/SelectTableColumnName?" + Math.random(),
  1324. dataType: "json",
  1325. async: false,
  1326. success: function (data) {
  1327. if (data != null && data.length > 0) {
  1328. DateList = data;
  1329. for (var i = 0; i < data.length; i++) {
  1330. var TableCode = data[i].TableCode;
  1331. if (TableCode == "ICSInspection") {
  1332. var Code = data[i].Code;
  1333. var Name = data[i].Name;
  1334. var obj = new Array();
  1335. obj = {
  1336. label: Name,
  1337. name: Code,
  1338. width: 80,
  1339. align: "left"
  1340. }
  1341. cols.push(obj);
  1342. }
  1343. if (TableCode == "ICSInventory") {
  1344. var Code = data[i].Code;
  1345. var Name = data[i].Name;
  1346. var obj = new Array();
  1347. obj = {
  1348. label: Name,
  1349. name: Code,
  1350. width: 80,
  1351. align: "left"
  1352. }
  1353. cols.push(obj);
  1354. //cols1.push(obj);
  1355. }
  1356. }
  1357. }
  1358. _Clos = cols;
  1359. //_Clos1 = cols1;
  1360. }
  1361. });
  1362. }
  1363. //副产品生成条码
  1364. if (Type == '18') {
  1365. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1366. cols.push(collast);
  1367. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1368. cols.push(collast);
  1369. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1370. cols.push(collast);
  1371. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1372. cols.push(collast);
  1373. var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 100, align: 'left' };
  1374. cols.push(collast);
  1375. var collast = { label: '料品编码(母)', name: 'MInvCode', width: 100, align: 'left' };
  1376. cols.push(collast);
  1377. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1378. cols.push(collast);
  1379. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1380. cols.push(collast);
  1381. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1382. cols.push(collast);
  1383. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1384. cols.push(collast);
  1385. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  1386. cols.push(collast);
  1387. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1388. cols.push(collast);
  1389. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1390. //cols.push(collast);
  1391. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1392. cols.push(collast);
  1393. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1394. //cols.push(collast);
  1395. $.ajax({
  1396. url: "/Print/SelectTableColumnName?" + Math.random(),
  1397. dataType: "json",
  1398. async: false,
  1399. success: function (data) {
  1400. if (data != null && data.length > 0) {
  1401. DateList = data;
  1402. for (var i = 0; i < data.length; i++) {
  1403. var TableCode = data[i].TableCode;
  1404. if (TableCode == "ICSMOPick") {
  1405. var Code = data[i].Code;
  1406. var Name = data[i].Name;
  1407. var obj = new Array();
  1408. obj = {
  1409. label: Name,
  1410. name: Code,
  1411. width: 80,
  1412. align: "left"
  1413. }
  1414. cols.push(obj);
  1415. }
  1416. if (TableCode == "ICSInventory") {
  1417. var Code = data[i].Code;
  1418. var Name = data[i].Name;
  1419. var obj = new Array();
  1420. obj = {
  1421. label: Name,
  1422. name: Code,
  1423. width: 80,
  1424. align: "left"
  1425. }
  1426. cols.push(obj);
  1427. //cols1.push(obj);
  1428. }
  1429. }
  1430. }
  1431. _Clos = cols;
  1432. //_Clos1 = cols1;
  1433. }
  1434. });
  1435. }
  1436. if (Type=='17') {
  1437. var cols1 = new Array();
  1438. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  1439. cols1.push(collast1);
  1440. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  1441. cols1.push(collast1);
  1442. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  1443. cols1.push(collast1);
  1444. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  1445. cols1.push(collast1);
  1446. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  1447. cols1.push(collast1);
  1448. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  1449. cols1.push(collast1);
  1450. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  1451. cols1.push(collast1);
  1452. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  1453. cols1.push(collast1);
  1454. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  1455. cols1.push(collast1);
  1456. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  1457. cols1.push(collast1);
  1458. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  1459. cols1.push(collast1);
  1460. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  1461. cols1.push(collast1);
  1462. } else {
  1463. var cols1 = new Array();
  1464. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  1465. cols1.push(collast1);
  1466. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  1467. cols1.push(collast1);
  1468. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  1469. cols1.push(collast1);
  1470. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  1471. cols1.push(collast1);
  1472. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  1473. cols1.push(collast1);
  1474. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  1475. cols1.push(collast1);
  1476. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  1477. cols1.push(collast1);
  1478. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  1479. cols1.push(collast1);
  1480. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  1481. cols1.push(collast1);
  1482. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  1483. cols1.push(collast1);
  1484. var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' };
  1485. cols1.push(collast1);
  1486. var collast1 = { label: '是否免检', name: 'isExemption', width: 100, align: 'left' };
  1487. cols1.push(collast1);
  1488. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  1489. cols1.push(collast1);
  1490. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  1491. cols1.push(collast1);
  1492. }
  1493. if (data != null && data.length > 0) {
  1494. DateList = data;
  1495. for (var i = 0; i < data.length; i++) {
  1496. var ColName = data[i].ColName;
  1497. var ColCode = data[i].ColCode;
  1498. var obj = new Array();
  1499. obj = {
  1500. label: ColName,
  1501. name: ColCode,
  1502. width: 80,
  1503. align: "left"
  1504. }
  1505. cols.push(obj);
  1506. cols1.push(obj);
  1507. }
  1508. }
  1509. _Clos = cols;
  1510. _Clos1 = cols1;
  1511. }
  1512. });
  1513. }
  1514. //生产退料
  1515. function gridList() {
  1516. var $gridList = $("#gridList");
  1517. var queryJson = {
  1518. POCode: $("#txt_POCode").val(),
  1519. InvCode: $("#txt_InvCode").val(),
  1520. InvName: $("#txt_InvName").val(),
  1521. BatchCode: $("#txt_BatchCode").val(),
  1522. POStatus: $("#selShow").val()
  1523. }
  1524. $gridList.dataGrid({
  1525. url: "/WMS/WMSCreateItemLot/GetGridJson" + "?" + Math.random(),
  1526. postData: { queryJson: JSON.stringify(queryJson) },
  1527. height: $(window).height() - 200,
  1528. width: $(window).width() - 300,
  1529. colModel: _Clos,
  1530. //colModel: [
  1531. // { label: "主键", name: "ID", hidden: true, key: true },
  1532. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  1533. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  1534. // { label: '工单子件', name: 'SourceDetailID', hidden: true, },
  1535. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1536. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  1537. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1538. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1539. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  1540. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1541. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1542. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1543. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1544. //],
  1545. //colModel: ColModelMain,
  1546. width: "100%",
  1547. autowidth: true,
  1548. //shrinkToFit: true,
  1549. gridComplete: function () {
  1550. },
  1551. pager: "#gridPager",
  1552. sortname: " MTIME desc ,ApplyNegCode asc,REPLICATE('0',10-len(Sequence))+Sequence  ",
  1553. // sortname: 'ApplyNegCode ',
  1554. //let str = `He said, "It's a 'beautiful' day."`,
  1555. //sortorder: "asc",
  1556. viewrecords: true,
  1557. multiselect: true,
  1558. //beforeSelectRow: function (rowid, e) {
  1559. // $("#gridList").jqGrid('resetSelection');
  1560. // return (true);
  1561. //},
  1562. subGrid: true, // (1)开启子表格支持
  1563. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1564. $("#gridList").jqGrid("setSelection", rowid, false);
  1565. bindSubGrid(subgrid_id, rowid)
  1566. }
  1567. });
  1568. $("#warehouse a.btn-default").click(function () {
  1569. $("#warehouse a.btn-default").removeClass("active");
  1570. $(this).addClass("active");
  1571. $('#btn_search').trigger("click");
  1572. });
  1573. $("#btn_search").click(function () {
  1574. var warehouse = $("#warehouse a.active").attr('data-value');
  1575. var queryJson = {
  1576. POCode: $("#txt_POCode").val(),
  1577. InvCode: $("#txt_InvCode").val(),
  1578. InvName: $("#txt_InvName").val(),
  1579. BatchCode: $("#txt_BatchCode").val(),
  1580. POStatus: $("#selShow").val()
  1581. }
  1582. $gridList.jqGrid('setGridParam', {
  1583. postData: { queryJson: JSON.stringify(queryJson) },
  1584. }).trigger('reloadGrid');
  1585. });
  1586. }
  1587. function bindSubGrid(subgrid_id, rowid) {
  1588. $("#gridList").jqGrid("setSelection", rowid, false);
  1589. var subgrid_table_id;
  1590. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1591. var subgrid_pager_id;
  1592. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1593. // (5)动态添加子报表的table和pager
  1594. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1595. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  1596. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1597. // (6)创建jqGrid对象
  1598. $("#" + subgrid_table_id).dataGrid({
  1599. cellEdit: true,
  1600. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1601. //colModel: [
  1602. // { label: "主键", name: "ID", hidden: true, key: true },
  1603. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1604. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1605. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1606. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1607. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1608. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1609. //],
  1610. colModel: _Clos1,
  1611. //colModel: ColModelSub,
  1612. shrinkToFit: true,//宽度自适应
  1613. multiselect: true,
  1614. prmNames: { search: "search" },
  1615. viewrecords: true,
  1616. height: "100%",
  1617. rowNum: 20,
  1618. pager: subgrid_pager_id,
  1619. });
  1620. }
  1621. //委外退料
  1622. function gridList2() {
  1623. var $gridList = $("#gridList");
  1624. var queryJson = {
  1625. POCode: $("#txt_POCode").val(),
  1626. InvCode: $("#txt_InvCode").val(),
  1627. InvName: $("#txt_InvName").val(),
  1628. BatchCode: $("#txt_BatchCode").val(),
  1629. POStatus: $("#selShow").val()
  1630. }
  1631. $gridList.dataGrid({
  1632. url: "/WMS/WMSCreateItemLot/GetGridJsonWeiWai" + "?" + Math.random(),
  1633. postData: { queryJson: JSON.stringify(queryJson) },
  1634. height: $(window).height() - 200,
  1635. width: $(window).width() - 300,
  1636. colModel: _Clos,
  1637. //colModel: [
  1638. // { label: "主键", name: "ID", hidden: true, key: true },
  1639. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  1640. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  1641. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  1642. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1643. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  1644. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1645. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1646. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  1647. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1648. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1649. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1650. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1651. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1652. //],
  1653. //colModel: ColModelMain,
  1654. width: "100%",
  1655. autowidth: true,
  1656. //shrinkToFit: true,
  1657. gridComplete: function () {
  1658. },
  1659. pager: "#gridPager",
  1660. // sortname: 'OApplyNegCode,cast(Sequence as int)',
  1661. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  1662. sortorder: "asc",
  1663. viewrecords: true,
  1664. multiselect: true,
  1665. //beforeSelectRow: function (rowid, e) {
  1666. // $("#gridList").jqGrid('resetSelection');
  1667. // return (true);
  1668. //},
  1669. subGrid: true, // (1)开启子表格支持
  1670. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1671. $("#gridList").jqGrid("setSelection", rowid, false);
  1672. bindSubGrid2(subgrid_id, rowid)
  1673. }
  1674. });
  1675. $("#warehouse a.btn-default").click(function () {
  1676. $("#warehouse a.btn-default").removeClass("active");
  1677. $(this).addClass("active");
  1678. $('#btn_search').trigger("click");
  1679. });
  1680. $("#btn_search").click(function () {
  1681. var warehouse = $("#warehouse a.active").attr('data-value');
  1682. var queryJson = {
  1683. POCode: $("#txt_POCode").val(),
  1684. InvCode: $("#txt_InvCode").val(),
  1685. InvName: $("#txt_InvName").val(),
  1686. BatchCode: $("#txt_BatchCode").val(),
  1687. POStatus: $("#selShow").val()
  1688. }
  1689. $gridList.jqGrid('setGridParam', {
  1690. postData: { queryJson: JSON.stringify(queryJson) },
  1691. }).trigger('reloadGrid');
  1692. });
  1693. }
  1694. function bindSubGrid2(subgrid_id, rowid) {
  1695. $("#gridList").jqGrid("setSelection", rowid, false);
  1696. var subgrid_table_id;
  1697. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1698. var subgrid_pager_id;
  1699. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1700. // (5)动态添加子报表的table和pager
  1701. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1702. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  1703. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1704. // (6)创建jqGrid对象
  1705. $("#" + subgrid_table_id).dataGrid({
  1706. cellEdit: true,
  1707. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1708. //colModel: [
  1709. // { label: "主键", name: "ID", hidden: true, key: true },
  1710. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1711. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1712. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1713. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1714. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1715. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1716. //],
  1717. colModel: _Clos1,
  1718. //colModel: ColModelSub,
  1719. shrinkToFit: true,//宽度自适应
  1720. multiselect: true,
  1721. prmNames: { search: "search" },
  1722. viewrecords: true,
  1723. height: "100%",
  1724. rowNum: 20,
  1725. pager: subgrid_pager_id,
  1726. });
  1727. }
  1728. //成品
  1729. function gridList3() {
  1730. var $gridList = $("#gridList");
  1731. var queryJson = {
  1732. POCode: $("#txt_POCode").val(),
  1733. InvCode: $("#txt_InvCode").val(),
  1734. InvName: $("#txt_InvName").val(),
  1735. BatchCode: $("#txt_BatchCode").val(),
  1736. POStatus: $("#selShow").val(),
  1737. SelGDLX: $("#SelGDLX option:checked").val(),
  1738. }
  1739. $gridList.dataGrid({
  1740. url: "/WMS/WMSCreateItemLot/GetGridJsonChengPing" + "?" + Math.random(),
  1741. postData: { queryJson: JSON.stringify(queryJson) },
  1742. height: $(window).height() - 200,
  1743. width: $(window).width() - 300,
  1744. colModel: _Clos,
  1745. //colModel: [
  1746. // { label: "主键", name: "ID", hidden: true, key: true },
  1747. // { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  1748. // { label: '工单行号', name: 'Sequence', width: 50, align: 'left' },
  1749. // { label: '已入库数量', name: 'RCVQuantity', hidden: true, },
  1750. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1751. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  1752. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1753. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1754. // {
  1755. // label: "状态", name: "MOStatus", width: 60, align: "left",
  1756. // formatter: function (cellvalue) {
  1757. // if (cellvalue == "1") {
  1758. // return "初始";
  1759. // } else if (cellvalue == "2") {
  1760. // return "下发";
  1761. // }
  1762. // else if (cellvalue == "3") {
  1763. // return "关单";
  1764. // }
  1765. // else { return ""; }
  1766. // }
  1767. // },
  1768. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1769. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1770. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1771. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1772. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1773. // { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' },
  1774. //],
  1775. //colModel: ColModelMain,
  1776. width: "100%",
  1777. autowidth: true,
  1778. //shrinkToFit: true,
  1779. gridComplete: function () {
  1780. },
  1781. pager: "#gridPager",
  1782. //sortname: 'MOCode,cast(Sequence as int)',
  1783. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  1784. sortorder: "asc",
  1785. viewrecords: true,
  1786. multiselect: true,
  1787. //beforeSelectRow: function (rowid, e) {
  1788. // $("#gridList").jqGrid('resetSelection');
  1789. // return (true);
  1790. //},
  1791. subGrid: true, // (1)开启子表格支持
  1792. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1793. $("#gridList").jqGrid("setSelection", rowid, false);
  1794. bindSubGrid3(subgrid_id, rowid)
  1795. }
  1796. });
  1797. $("#warehouse a.btn-default").click(function () {
  1798. $("#warehouse a.btn-default").removeClass("active");
  1799. $(this).addClass("active");
  1800. $('#btn_search').trigger("click");
  1801. });
  1802. $("#btn_search").click(function () {
  1803. var warehouse = $("#warehouse a.active").attr('data-value');
  1804. var queryJson = {
  1805. POCode: $("#txt_POCode").val(),
  1806. InvCode: $("#txt_InvCode").val(),
  1807. InvName: $("#txt_InvName").val(),
  1808. BatchCode: $("#txt_BatchCode").val(),
  1809. POStatus: $("#selShow").val(),
  1810. SelGDLX: $("#SelGDLX option:checked").val(),
  1811. }
  1812. $gridList.jqGrid('setGridParam', {
  1813. postData: { queryJson: JSON.stringify(queryJson) },
  1814. }).trigger('reloadGrid');
  1815. });
  1816. }
  1817. function bindSubGrid3(subgrid_id, rowid) {
  1818. $("#gridList").jqGrid("setSelection", rowid, false);
  1819. var subgrid_table_id;
  1820. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1821. var subgrid_pager_id;
  1822. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1823. // (5)动态添加子报表的table和pager
  1824. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1825. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  1826. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1827. // (6)创建jqGrid对象
  1828. $("#" + subgrid_table_id).dataGrid({
  1829. cellEdit: true,
  1830. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1831. //colModel: [
  1832. // { label: "主键", name: "ID", hidden: true, key: true },
  1833. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1834. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1835. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1836. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1837. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1838. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1839. //],
  1840. colModel: _Clos1,
  1841. //colModel: ColModelSub,
  1842. shrinkToFit: true,//宽度自适应
  1843. multiselect: true,
  1844. prmNames: { search: "search" },
  1845. viewrecords: true,
  1846. height: "100%",
  1847. rowNum: 20,
  1848. pager: subgrid_pager_id,
  1849. });
  1850. }
  1851. //销售退货
  1852. function gridList4() {
  1853. var $gridList = $("#gridList");
  1854. var queryJson = {
  1855. POCode: $("#txt_POCode").val(),
  1856. InvCode: $("#txt_InvCode").val(),
  1857. InvName: $("#txt_InvName").val(),
  1858. BatchCode: $("#txt_BatchCode").val(),
  1859. POStatus: $("#selShow").val()
  1860. }
  1861. $gridList.dataGrid({
  1862. url: "/WMS/WMSCreateItemLot/GetGridJsonXiaoShou" + "?" + Math.random(),
  1863. postData: { queryJson: JSON.stringify(queryJson) },
  1864. height: $(window).height() - 200,
  1865. width: $(window).width() - 300,
  1866. colModel: _Clos,
  1867. //colModel: [
  1868. // { label: "主键", name: "ID", hidden: true, key: true },
  1869. // { label: '单据号', name: 'SDNCode', width: 120, align: 'left' },
  1870. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1871. // { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' },
  1872. // { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' },
  1873. // { label: '客户代码', name: 'CusCode', width: 120, align: 'left' },
  1874. // { label: '客户名称', name: 'CusName', width: 50, align: 'left' },
  1875. // { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' },
  1876. // { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' },
  1877. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1878. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  1879. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1880. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1881. // {
  1882. // label: "状态", name: "Status", width: 60, align: "left",
  1883. // formatter: function (cellvalue) {
  1884. // if (cellvalue == "1") {
  1885. // return "开立";
  1886. // } else if (cellvalue == "2") {
  1887. // return "审核";
  1888. // }
  1889. // else if (cellvalue == "3") {
  1890. // return "关闭";
  1891. // }
  1892. // else { return ""; }
  1893. // }
  1894. // },
  1895. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1896. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1897. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1898. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1899. //],
  1900. //colModel: ColModelMain,
  1901. width: "100%",
  1902. autowidth: true,
  1903. //shrinkToFit: true,
  1904. gridComplete: function () {
  1905. },
  1906. pager: "#gridPager",
  1907. // sortname: 'SDNCode,cast(Sequence as int)',
  1908. sortname: "SDNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  1909. sortorder: "asc",
  1910. viewrecords: true,
  1911. multiselect: true,
  1912. //beforeSelectRow: function (rowid, e) {
  1913. // $("#gridList").jqGrid('resetSelection');
  1914. // return (true);
  1915. //},
  1916. subGrid: true, // (1)开启子表格支持
  1917. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1918. $("#gridList").jqGrid("setSelection", rowid, false);
  1919. bindSubGrid4(subgrid_id, rowid)
  1920. }
  1921. });
  1922. $("#warehouse a.btn-default").click(function () {
  1923. $("#warehouse a.btn-default").removeClass("active");
  1924. $(this).addClass("active");
  1925. $('#btn_search').trigger("click");
  1926. });
  1927. $("#btn_search").click(function () {
  1928. var warehouse = $("#warehouse a.active").attr('data-value');
  1929. var queryJson = {
  1930. POCode: $("#txt_POCode").val(),
  1931. InvCode: $("#txt_InvCode").val(),
  1932. InvName: $("#txt_InvName").val(),
  1933. BatchCode: $("#txt_BatchCode").val(),
  1934. POStatus: $("#selShow").val()
  1935. }
  1936. $gridList.jqGrid('setGridParam', {
  1937. postData: { queryJson: JSON.stringify(queryJson) },
  1938. }).trigger('reloadGrid');
  1939. });
  1940. }
  1941. function bindSubGrid4(subgrid_id, rowid) {
  1942. $("#gridList").jqGrid("setSelection", rowid, false);
  1943. var subgrid_table_id;
  1944. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1945. var subgrid_pager_id;
  1946. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1947. // (5)动态添加子报表的table和pager
  1948. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1949. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  1950. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1951. // (6)创建jqGrid对象
  1952. $("#" + subgrid_table_id).dataGrid({
  1953. cellEdit: true,
  1954. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1955. //colModel: [
  1956. // { label: "主键", name: "ID", hidden: true, key: true },
  1957. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1958. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1959. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1960. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1961. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1962. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1963. //],
  1964. colModel: _Clos1,
  1965. //colModel: ColModelSub,
  1966. shrinkToFit: true,//宽度自适应
  1967. multiselect: true,
  1968. prmNames: { search: "search" },
  1969. viewrecords: true,
  1970. height: "100%",
  1971. rowNum: 20,
  1972. pager: subgrid_pager_id,
  1973. });
  1974. }
  1975. //其它入库生成条码
  1976. function gridList5() {
  1977. var $gridList = $("#gridList");
  1978. var queryJson = {
  1979. POCode: $("#txt_POCode").val(),
  1980. InvCode: $("#txt_InvCode").val(),
  1981. InvName: $("#txt_InvName").val(),
  1982. BatchCode: $("#txt_BatchCode").val(),
  1983. POStatus: $("#selShow").val()
  1984. }
  1985. $gridList.dataGrid({
  1986. url: "/WMS/WMSCreateItemLot/GetGridJsonQiTa" + "?" + Math.random(),
  1987. postData: { queryJson: JSON.stringify(queryJson) },
  1988. height: $(window).height() - 200,
  1989. width: $(window).width() - 300,
  1990. colModel: _Clos,
  1991. //colModel: [
  1992. // { label: "主键", name: "ID", hidden: true, key: true },
  1993. // { label: '单据号', name: 'InCode', width: 120, align: 'left' },
  1994. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1995. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  1996. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1997. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1998. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1999. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2000. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2001. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2002. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2003. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2004. // { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', },
  2005. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2006. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2007. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2008. //],
  2009. //colModel: ColModelMain,
  2010. width: "100%",
  2011. autowidth: true,
  2012. //shrinkToFit: true,
  2013. gridComplete: function () {
  2014. },
  2015. pager: "#gridPager",
  2016. sortname: 'InCode',
  2017. sortorder: "asc",
  2018. viewrecords: true,
  2019. multiselect: true,
  2020. //beforeSelectRow: function (rowid, e) {
  2021. // $("#gridList").jqGrid('resetSelection');
  2022. // return (true);
  2023. //},
  2024. subGrid: true, // (1)开启子表格支持
  2025. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2026. $("#gridList").jqGrid("setSelection", rowid, false);
  2027. bindSubGrid5(subgrid_id, rowid)
  2028. }
  2029. });
  2030. $("#warehouse a.btn-default").click(function () {
  2031. $("#warehouse a.btn-default").removeClass("active");
  2032. $(this).addClass("active");
  2033. $('#btn_search').trigger("click");
  2034. });
  2035. $("#btn_search").click(function () {
  2036. var warehouse = $("#warehouse a.active").attr('data-value');
  2037. var queryJson = {
  2038. POCode: $("#txt_POCode").val(),
  2039. InvCode: $("#txt_InvCode").val(),
  2040. InvName: $("#txt_InvName").val(),
  2041. BatchCode: $("#txt_BatchCode").val(),
  2042. POStatus: $("#selShow").val()
  2043. }
  2044. $gridList.jqGrid('setGridParam', {
  2045. postData: { queryJson: JSON.stringify(queryJson) },
  2046. }).trigger('reloadGrid');
  2047. });
  2048. }
  2049. function bindSubGrid5(subgrid_id, rowid) {
  2050. $("#gridList").jqGrid("setSelection", rowid, false);
  2051. var subgrid_table_id;
  2052. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2053. var subgrid_pager_id;
  2054. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2055. // (5)动态添加子报表的table和pager
  2056. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2057. var InCode = $("#gridList").jqGrid('getRowData', rowid).InCode;
  2058. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2059. // (6)创建jqGrid对象
  2060. $("#" + subgrid_table_id).dataGrid({
  2061. cellEdit: true,
  2062. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2063. //colModel: [
  2064. // { label: "主键", name: "ID", hidden: true, key: true },
  2065. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2066. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2067. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2068. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2069. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2070. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2071. //],
  2072. colModel: _Clos1,
  2073. //colModel: ColModelSub,
  2074. shrinkToFit: true,//宽度自适应
  2075. multiselect: true,
  2076. prmNames: { search: "search" },
  2077. viewrecords: true,
  2078. height: "100%",
  2079. rowNum: 20,
  2080. pager: subgrid_pager_id,
  2081. });
  2082. }
  2083. //归还单生成条码
  2084. function gridList6() {
  2085. var $gridList = $("#gridList");
  2086. var queryJson = {
  2087. POCode: $("#txt_POCode").val(),
  2088. InvCode: $("#txt_InvCode").val(),
  2089. InvName: $("#txt_InvName").val(),
  2090. BatchCode: $("#txt_BatchCode").val(),
  2091. POStatus: $("#selShow").val()
  2092. }
  2093. $gridList.dataGrid({
  2094. url: "/WMS/WMSCreateItemLot/GetGridJsonGuiHuan" + "?" + Math.random(),
  2095. postData: { queryJson: JSON.stringify(queryJson) },
  2096. height: $(window).height() - 200,
  2097. width: $(window).width() - 300,
  2098. colModel: _Clos,
  2099. //colModel: [
  2100. // { label: "主键", name: "ID", hidden: true, key: true },
  2101. // { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' },
  2102. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2103. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  2104. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2105. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2106. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2107. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2108. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2109. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2110. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2111. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2112. // { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', },
  2113. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2114. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2115. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2116. //],
  2117. //colModel: ColModelMain,
  2118. width: "100%",
  2119. autowidth: true,
  2120. //shrinkToFit: true,
  2121. gridComplete: function () {
  2122. },
  2123. pager: "#gridPager",
  2124. /// sortname: 'ReturnCode,cast(Sequence as int)',
  2125. sortname: "ReturnCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2126. sortorder: "asc",
  2127. viewrecords: true,
  2128. multiselect: true,
  2129. //beforeSelectRow: function (rowid, e) {
  2130. // $("#gridList").jqGrid('resetSelection');
  2131. // return (true);
  2132. //},
  2133. subGrid: true, // (1)开启子表格支持
  2134. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2135. $("#gridList").jqGrid("setSelection", rowid, false);
  2136. bindSubGrid6(subgrid_id, rowid)
  2137. }
  2138. });
  2139. $("#warehouse a.btn-default").click(function () {
  2140. $("#warehouse a.btn-default").removeClass("active");
  2141. $(this).addClass("active");
  2142. $('#btn_search').trigger("click");
  2143. });
  2144. $("#btn_search").click(function () {
  2145. var warehouse = $("#warehouse a.active").attr('data-value');
  2146. var queryJson = {
  2147. POCode: $("#txt_POCode").val(),
  2148. InvCode: $("#txt_InvCode").val(),
  2149. InvName: $("#txt_InvName").val(),
  2150. BatchCode: $("#txt_BatchCode").val(),
  2151. POStatus: $("#selShow").val()
  2152. }
  2153. $gridList.jqGrid('setGridParam', {
  2154. postData: { queryJson: JSON.stringify(queryJson) },
  2155. }).trigger('reloadGrid');
  2156. });
  2157. }
  2158. function bindSubGrid6(subgrid_id, rowid) {
  2159. $("#gridList").jqGrid("setSelection", rowid, false);
  2160. var subgrid_table_id;
  2161. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2162. var subgrid_pager_id;
  2163. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2164. // (5)动态添加子报表的table和pager
  2165. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2166. var ReturnCode = $("#gridList").jqGrid('getRowData', rowid).ReturnCode;
  2167. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2168. // (6)创建jqGrid对象
  2169. $("#" + subgrid_table_id).dataGrid({
  2170. cellEdit: true,
  2171. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2172. //colModel: [
  2173. // { label: "主键", name: "ID", hidden: true, key: true },
  2174. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2175. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2176. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2177. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2178. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2179. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2180. //],
  2181. colModel: _Clos1,
  2182. //colModel: ColModelSub,
  2183. shrinkToFit: true,//宽度自适应
  2184. multiselect: true,
  2185. prmNames: { search: "search" },
  2186. viewrecords: true,
  2187. height: "100%",
  2188. rowNum: 20,
  2189. pager: subgrid_pager_id,
  2190. });
  2191. }
  2192. //*审核到货单生成条码
  2193. function gridList7() {
  2194. var $gridList = $("#gridList");
  2195. var queryJson = {
  2196. POCode: $("#txt_POCode").val(),
  2197. VenCode: $("#txt_VenCode").val(),
  2198. VenName: $("#txt_VenName").val(),
  2199. InvCode: $("#txt_InvCode").val(),
  2200. InvName: $("#txt_InvName").val(),
  2201. BatchCode: $("#txt_BatchCode").val(),
  2202. POStatus: $("#selShow").val(),
  2203. WHStatus: '',
  2204. InvStd: '',
  2205. }
  2206. $gridList.dataGrid({
  2207. url: "/WMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  2208. postData: { queryJson: JSON.stringify(queryJson) },
  2209. height: $(window).height() - 200,
  2210. width: $(window).width() - 300,
  2211. colModel: _Clos,
  2212. //colModel: [
  2213. // { label: "主键", name: "ID", hidden: true, key: true },
  2214. // { label: '单据号', name: 'DNCode', width: 120, align: 'left' },
  2215. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2216. // { label: '采购订单号', name: 'POCode', width: 50, align: 'left' },
  2217. // { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' },
  2218. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2219. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2220. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2221. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2222. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2223. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2224. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  2225. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2226. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2227. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2228. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2229. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2230. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2231. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2232. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2233. //],
  2234. //colModel: ColModelMain,
  2235. width: "100%",
  2236. autowidth: true,
  2237. //shrinkToFit: true,
  2238. gridComplete: function () {
  2239. },
  2240. pager: "#gridPager",
  2241. //sortname: 'DNCode,cast(Sequence as int)',
  2242. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2243. sortorder: "asc",
  2244. viewrecords: true,
  2245. multiselect: true,
  2246. //beforeSelectRow: function (rowid, e) {
  2247. // $("#gridList").jqGrid('resetSelection');
  2248. // return (true);
  2249. //},
  2250. subGrid: true, // (1)开启子表格支持
  2251. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2252. $("#gridList").jqGrid("setSelection", rowid, false);
  2253. bindSubGrid7(subgrid_id, rowid)
  2254. }
  2255. });
  2256. $("#warehouse a.btn-default").click(function () {
  2257. $("#warehouse a.btn-default").removeClass("active");
  2258. $(this).addClass("active");
  2259. $('#btn_search').trigger("click");
  2260. });
  2261. $("#btn_search").click(function () {
  2262. var warehouse = $("#warehouse a.active").attr('data-value');
  2263. var queryJson = {
  2264. POCode: $("#txt_POCode").val(),
  2265. VenCode: $("#txt_VenCode").val(),
  2266. VenName: $("#txt_VenName").val(),
  2267. InvCode: $("#txt_InvCode").val(),
  2268. InvName: $("#txt_InvName").val(),
  2269. BatchCode: $("#txt_BatchCode").val(),
  2270. POStatus: $("#selShow").val(),
  2271. WHStatus: '',
  2272. InvStd: '',
  2273. }
  2274. $gridList.jqGrid('setGridParam', {
  2275. postData: { queryJson: JSON.stringify(queryJson) },
  2276. }).trigger('reloadGrid');
  2277. });
  2278. }
  2279. function bindSubGrid7(subgrid_id, rowid) {
  2280. $("#gridList").jqGrid("setSelection", rowid, false);
  2281. var subgrid_table_id;
  2282. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2283. var subgrid_pager_id;
  2284. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2285. // (5)动态添加子报表的table和pager
  2286. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2287. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  2288. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2289. // (6)创建jqGrid对象
  2290. $("#" + subgrid_table_id).dataGrid({
  2291. cellEdit: true,
  2292. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2293. //colModel: [
  2294. // { label: "主键", name: "ID", hidden: true, key: true },
  2295. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2296. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2297. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2298. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2299. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2300. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2301. //],
  2302. colModel: _Clos1,
  2303. //colModel: ColModelSub,
  2304. shrinkToFit: true,//宽度自适应
  2305. multiselect: true,
  2306. prmNames: { search: "search" },
  2307. viewrecords: true,
  2308. height: "100%",
  2309. rowNum: 20,
  2310. pager: subgrid_pager_id,
  2311. });
  2312. }
  2313. //审核委外到货单生成条码
  2314. function gridList8() {
  2315. var $gridList = $("#gridList");
  2316. var queryJson = {
  2317. POCode: $("#txt_POCode").val(),
  2318. VenCode: $("#txt_VenCode").val(),
  2319. VenName: $("#txt_VenName").val(),
  2320. InvCode: $("#txt_InvCode").val(),
  2321. InvName: $("#txt_InvName").val(),
  2322. BatchCode: $("#txt_BatchCode").val(),
  2323. POStatus: $("#selShow").val()
  2324. }
  2325. $gridList.dataGrid({
  2326. url: "/WMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(),
  2327. postData: { queryJson: JSON.stringify(queryJson) },
  2328. height: $(window).height() - 200,
  2329. width: $(window).width() - 300,
  2330. colModel: _Clos,
  2331. //colModel: [
  2332. // { label: "主键", name: "ID", hidden: true, key: true },
  2333. // { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  2334. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2335. // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' },
  2336. // { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' },
  2337. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2338. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2339. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2340. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2341. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2342. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2343. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2344. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2345. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2346. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2347. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2348. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2349. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2350. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2351. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2352. //],
  2353. //colModel: ColModelMain,
  2354. width: "100%",
  2355. autowidth: true,
  2356. //shrinkToFit: true,
  2357. gridComplete: function () {
  2358. },
  2359. pager: "#gridPager",
  2360. //sortname: 'ODNCode,cast(Sequence as int)',
  2361. sortname: "ODNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2362. sortorder: "asc",
  2363. viewrecords: true,
  2364. multiselect: true,
  2365. //beforeSelectRow: function (rowid, e) {
  2366. // $("#gridList").jqGrid('resetSelection');
  2367. // return (true);
  2368. //},
  2369. subGrid: true, // (1)开启子表格支持
  2370. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2371. $("#gridList").jqGrid("setSelection", rowid, false);
  2372. bindSubGrid8(subgrid_id, rowid)
  2373. }
  2374. });
  2375. $("#warehouse a.btn-default").click(function () {
  2376. $("#warehouse a.btn-default").removeClass("active");
  2377. $(this).addClass("active");
  2378. $('#btn_search').trigger("click");
  2379. });
  2380. $("#btn_search").click(function () {
  2381. var warehouse = $("#warehouse a.active").attr('data-value');
  2382. var queryJson = {
  2383. POCode: $("#txt_POCode").val(),
  2384. VenCode: $("#txt_VenCode").val(),
  2385. VenName: $("#txt_VenName").val(),
  2386. InvCode: $("#txt_InvCode").val(),
  2387. InvName: $("#txt_InvName").val(),
  2388. BatchCode: $("#txt_BatchCode").val(),
  2389. POStatus: $("#selShow").val()
  2390. }
  2391. $gridList.jqGrid('setGridParam', {
  2392. postData: { queryJson: JSON.stringify(queryJson) },
  2393. }).trigger('reloadGrid');
  2394. });
  2395. }
  2396. function bindSubGrid8(subgrid_id, rowid) {
  2397. $("#gridList").jqGrid("setSelection", rowid, false);
  2398. var subgrid_table_id;
  2399. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2400. var subgrid_pager_id;
  2401. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2402. // (5)动态添加子报表的table和pager
  2403. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2404. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  2405. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2406. // (6)创建jqGrid对象
  2407. $("#" + subgrid_table_id).dataGrid({
  2408. cellEdit: true,
  2409. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2410. //colModel: [
  2411. // { label: "主键", name: "ID", hidden: true, key: true },
  2412. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2413. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2414. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2415. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2416. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2417. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2418. //],
  2419. colModel: _Clos1,
  2420. //colModel: ColModelSub,
  2421. shrinkToFit: true,//宽度自适应
  2422. multiselect: true,
  2423. prmNames: { search: "search" },
  2424. viewrecords: true,
  2425. height: "100%",
  2426. rowNum: 20,
  2427. pager: subgrid_pager_id,
  2428. });
  2429. }
  2430. //开立得成品入库单 生成条码
  2431. function gridList9() {
  2432. var $gridList = $("#gridList");
  2433. var queryJson = {
  2434. POCode: $("#txt_POCode").val(),
  2435. InvCode: $("#txt_InvCode").val(),
  2436. InvName: $("#txt_InvName").val(),
  2437. BatchCode: $("#txt_BatchCode").val(),
  2438. POStatus: $("#selShow").val()
  2439. }
  2440. $gridList.dataGrid({
  2441. url: "/WMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  2442. postData: { queryJson: JSON.stringify(queryJson) },
  2443. height: $(window).height() - 200,
  2444. width: $(window).width() - 300,
  2445. colModel: _Clos,
  2446. //colModel: [
  2447. // { label: "主键", name: "ID", hidden: true, key: true },
  2448. // { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  2449. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2450. // { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  2451. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2452. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2453. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2454. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2455. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2456. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2457. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2458. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2459. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2460. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2461. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2462. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2463. //],
  2464. //colModel: ColModelMain,
  2465. width: "100%",
  2466. autowidth: true,
  2467. //shrinkToFit: true,
  2468. gridComplete: function () {
  2469. },
  2470. pager: "#gridPager",
  2471. //sortname: 'RCVCode,cast(Sequence as int)',
  2472. sortname: "RCVCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2473. sortorder: "asc",
  2474. viewrecords: true,
  2475. multiselect: true,
  2476. //beforeSelectRow: function (rowid, e) {
  2477. // $("#gridList").jqGrid('resetSelection');
  2478. // return (true);
  2479. //},
  2480. subGrid: true, // (1)开启子表格支持
  2481. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2482. $("#gridList").jqGrid("setSelection", rowid, false);
  2483. bindSubGrid9(subgrid_id, rowid)
  2484. }
  2485. });
  2486. $("#warehouse a.btn-default").click(function () {
  2487. $("#warehouse a.btn-default").removeClass("active");
  2488. $(this).addClass("active");
  2489. $('#btn_search').trigger("click");
  2490. });
  2491. $("#btn_search").click(function () {
  2492. var warehouse = $("#warehouse a.active").attr('data-value');
  2493. var queryJson = {
  2494. POCode: $("#txt_POCode").val(),
  2495. InvCode: $("#txt_InvCode").val(),
  2496. InvName: $("#txt_InvName").val(),
  2497. BatchCode: $("#txt_BatchCode").val(),
  2498. POStatus: $("#selShow").val()
  2499. }
  2500. $gridList.jqGrid('setGridParam', {
  2501. postData: { queryJson: JSON.stringify(queryJson) },
  2502. }).trigger('reloadGrid');
  2503. });
  2504. }
  2505. function bindSubGrid9(subgrid_id, rowid) {
  2506. $("#gridList").jqGrid("setSelection", rowid, false);
  2507. var subgrid_table_id;
  2508. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2509. var subgrid_pager_id;
  2510. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2511. // (5)动态添加子报表的table和pager
  2512. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2513. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  2514. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2515. // (6)创建jqGrid对象
  2516. $("#" + subgrid_table_id).dataGrid({
  2517. cellEdit: true,
  2518. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2519. //colModel: [
  2520. // { label: "主键", name: "ID", hidden: true, key: true },
  2521. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2522. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2523. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2524. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2525. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2526. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2527. //],
  2528. colModel: _Clos1,
  2529. //colModel: ColModelSub,
  2530. shrinkToFit: true,//宽度自适应
  2531. multiselect: true,
  2532. prmNames: { search: "search" },
  2533. viewrecords: true,
  2534. height: "100%",
  2535. rowNum: 20,
  2536. pager: subgrid_pager_id,
  2537. });
  2538. }
  2539. //采购拒收单
  2540. function gridList10() {
  2541. var $gridList = $("#gridList");
  2542. var queryJson = {
  2543. POCode: $("#txt_POCode").val(),
  2544. VenCode: $("#txt_VenCode").val(),
  2545. VenName: $("#txt_VenName").val(),
  2546. InvCode: $("#txt_InvCode").val(),
  2547. InvName: $("#txt_InvName").val(),
  2548. BatchCode: $("#txt_BatchCode").val(),
  2549. POStatus: $("#selShow").val()
  2550. }
  2551. $gridList.dataGrid({
  2552. url: "/WMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  2553. postData: { queryJson: JSON.stringify(queryJson) },
  2554. height: $(window).height() - 200,
  2555. width: $(window).width() - 300,
  2556. colModel: _Clos,
  2557. //colModel: [
  2558. // { label: "主键", name: "ID", hidden: true, key: true },
  2559. // { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  2560. // { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  2561. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2562. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2563. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2564. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2565. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2566. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2567. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  2568. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2569. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2570. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2571. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2572. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2573. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2574. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2575. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2576. //],
  2577. //colModel: ColModelMain,
  2578. width: "100%",
  2579. autowidth: true,
  2580. //shrinkToFit: true,
  2581. gridComplete: function () {
  2582. },
  2583. pager: "#gridPager",
  2584. //sortname: 'DNCode,cast(Sequence as int)',
  2585. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2586. sortorder: "asc",
  2587. viewrecords: true,
  2588. multiselect: true,
  2589. //beforeSelectRow: function (rowid, e) {
  2590. // $("#gridList").jqGrid('resetSelection');
  2591. // return (true);
  2592. //},
  2593. subGrid: true, // (1)开启子表格支持
  2594. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2595. $("#gridList").jqGrid("setSelection", rowid, false);
  2596. bindSubGrid10(subgrid_id, rowid)
  2597. }
  2598. });
  2599. $("#warehouse a.btn-default").click(function () {
  2600. $("#warehouse a.btn-default").removeClass("active");
  2601. $(this).addClass("active");
  2602. $('#btn_search').trigger("click");
  2603. });
  2604. $("#btn_search").click(function () {
  2605. var warehouse = $("#warehouse a.active").attr('data-value');
  2606. var queryJson = {
  2607. POCode: $("#txt_POCode").val(),
  2608. VenCode: $("#txt_VenCode").val(),
  2609. VenName: $("#txt_VenName").val(),
  2610. InvCode: $("#txt_InvCode").val(),
  2611. InvName: $("#txt_InvName").val(),
  2612. BatchCode: $("#txt_BatchCode").val(),
  2613. POStatus: $("#selShow").val()
  2614. }
  2615. $gridList.jqGrid('setGridParam', {
  2616. postData: { queryJson: JSON.stringify(queryJson) },
  2617. }).trigger('reloadGrid');
  2618. });
  2619. }
  2620. function bindSubGrid10(subgrid_id, rowid) {
  2621. $("#gridList").jqGrid("setSelection", rowid, false);
  2622. var subgrid_table_id;
  2623. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2624. var subgrid_pager_id;
  2625. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2626. // (5)动态添加子报表的table和pager
  2627. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2628. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  2629. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2630. // (6)创建jqGrid对象
  2631. $("#" + subgrid_table_id).dataGrid({
  2632. cellEdit: true,
  2633. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2634. //colModel: [
  2635. // { label: "主键", name: "ID", hidden: true, key: true },
  2636. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2637. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2638. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2639. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2640. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2641. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2642. //],
  2643. colModel: _Clos1,
  2644. //colModel: ColModelSub,
  2645. shrinkToFit: true,//宽度自适应
  2646. multiselect: true,
  2647. prmNames: { search: "search" },
  2648. viewrecords: true,
  2649. height: "100%",
  2650. rowNum: 20,
  2651. pager: subgrid_pager_id,
  2652. });
  2653. }
  2654. //委外拒收单生成条码
  2655. function gridList11() {
  2656. var $gridList = $("#gridList");
  2657. var queryJson = {
  2658. POCode: $("#txt_POCode").val(),
  2659. VenCode: $("#txt_VenCode").val(),
  2660. VenName: $("#txt_VenName").val(),
  2661. InvCode: $("#txt_InvCode").val(),
  2662. InvName: $("#txt_InvName").val(),
  2663. BatchCode: $("#txt_BatchCode").val(),
  2664. POStatus: $("#selShow").val()
  2665. }
  2666. $gridList.dataGrid({
  2667. url: "/WMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  2668. postData: { queryJson: JSON.stringify(queryJson) },
  2669. height: $(window).height() - 200,
  2670. width: $(window).width() - 300,
  2671. colModel: _Clos,
  2672. //colModel: [
  2673. // { label: "主键", name: "ID", hidden: true, key: true },
  2674. // { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  2675. // { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  2676. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2677. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2678. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2679. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2680. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2681. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2682. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2683. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2684. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2685. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2686. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2687. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2688. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2689. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2690. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2691. //],
  2692. //colModel: ColModelMain,
  2693. width: "100%",
  2694. autowidth: true,
  2695. //shrinkToFit: true,
  2696. gridComplete: function () {
  2697. },
  2698. pager: "#gridPager",
  2699. // sortname: 'OOCode,cast(Sequence as int)',
  2700. sortname: "OOCode,REPLICATE('0',10-len(OOSequence))+OOSequence ",
  2701. sortorder: "asc",
  2702. viewrecords: true,
  2703. multiselect: true,
  2704. //beforeSelectRow: function (rowid, e) {
  2705. // $("#gridList").jqGrid('resetSelection');
  2706. // return (true);
  2707. //},
  2708. subGrid: true, // (1)开启子表格支持
  2709. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2710. $("#gridList").jqGrid("setSelection", rowid, false);
  2711. bindSubGrid11(subgrid_id, rowid)
  2712. }
  2713. });
  2714. $("#warehouse a.btn-default").click(function () {
  2715. $("#warehouse a.btn-default").removeClass("active");
  2716. $(this).addClass("active");
  2717. $('#btn_search').trigger("click");
  2718. });
  2719. $("#btn_search").click(function () {
  2720. var warehouse = $("#warehouse a.active").attr('data-value');
  2721. var queryJson = {
  2722. POCode: $("#txt_POCode").val(),
  2723. VenCode: $("#txt_VenCode").val(),
  2724. VenName: $("#txt_VenName").val(),
  2725. InvCode: $("#txt_InvCode").val(),
  2726. InvName: $("#txt_InvName").val(),
  2727. BatchCode: $("#txt_BatchCode").val(),
  2728. POStatus: $("#selShow").val()
  2729. }
  2730. $gridList.jqGrid('setGridParam', {
  2731. postData: { queryJson: JSON.stringify(queryJson) },
  2732. }).trigger('reloadGrid');
  2733. });
  2734. }
  2735. function bindSubGrid11(subgrid_id, rowid) {
  2736. $("#gridList").jqGrid("setSelection", rowid, false);
  2737. var subgrid_table_id;
  2738. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2739. var subgrid_pager_id;
  2740. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2741. // (5)动态添加子报表的table和pager
  2742. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2743. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).OOCode;
  2744. var Sequence = $("#gridList").jqGrid('getRowData', rowid).OOSequence;
  2745. // (6)创建jqGrid对象
  2746. $("#" + subgrid_table_id).dataGrid({
  2747. cellEdit: true,
  2748. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2749. //colModel: [
  2750. // { label: "主键", name: "ID", hidden: true, key: true },
  2751. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2752. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2753. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2754. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2755. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2756. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2757. //],
  2758. colModel: _Clos1,
  2759. //colModel: ColModelSub,
  2760. shrinkToFit: true,//宽度自适应
  2761. multiselect: true,
  2762. prmNames: { search: "search" },
  2763. viewrecords: true,
  2764. height: "100%",
  2765. rowNum: 20,
  2766. pager: subgrid_pager_id,
  2767. });
  2768. }
  2769. //领料申请退料生成条码
  2770. function gridList12() {
  2771. var $gridList = $("#gridList");
  2772. var queryJson = {
  2773. POCode: $("#txt_POCode").val(),
  2774. InvCode: $("#txt_InvCode").val(),
  2775. InvName: $("#txt_InvName").val(),
  2776. BatchCode: $("#txt_BatchCode").val(),
  2777. POStatus: $("#selShow").val()
  2778. }
  2779. $gridList.dataGrid({
  2780. url: "/WMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  2781. postData: { queryJson: JSON.stringify(queryJson) },
  2782. height: $(window).height() - 200,
  2783. width: $(window).width() - 300,
  2784. colModel: _Clos,
  2785. //colModel: [
  2786. // { label: "主键", name: "ID", hidden: true, key: true },
  2787. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2788. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2789. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  2790. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2791. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2792. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2793. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2794. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2795. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2796. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2797. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2798. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2799. //],
  2800. //colModel: ColModelMain,
  2801. width: "100%",
  2802. autowidth: true,
  2803. //shrinkToFit: true,
  2804. gridComplete: function () {
  2805. },
  2806. pager: "#gridPager",
  2807. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  2808. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2809. sortorder: "asc",
  2810. viewrecords: true,
  2811. multiselect: true,
  2812. //beforeSelectRow: function (rowid, e) {
  2813. // $("#gridList").jqGrid('resetSelection');
  2814. // return (true);
  2815. //},
  2816. subGrid: true, // (1)开启子表格支持
  2817. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2818. $("#gridList").jqGrid("setSelection", rowid, false);
  2819. bindSubGrid12(subgrid_id, rowid)
  2820. }
  2821. });
  2822. $("#warehouse a.btn-default").click(function () {
  2823. $("#warehouse a.btn-default").removeClass("active");
  2824. $(this).addClass("active");
  2825. $('#btn_search').trigger("click");
  2826. });
  2827. $("#btn_search").click(function () {
  2828. var warehouse = $("#warehouse a.active").attr('data-value');
  2829. var queryJson = {
  2830. POCode: $("#txt_POCode").val(),
  2831. InvCode: $("#txt_InvCode").val(),
  2832. InvName: $("#txt_InvName").val(),
  2833. BatchCode: $("#txt_BatchCode").val(),
  2834. POStatus: $("#selShow").val()
  2835. }
  2836. $gridList.jqGrid('setGridParam', {
  2837. postData: { queryJson: JSON.stringify(queryJson) },
  2838. }).trigger('reloadGrid');
  2839. });
  2840. }
  2841. function bindSubGrid12(subgrid_id, rowid) {
  2842. $("#gridList").jqGrid("setSelection", rowid, false);
  2843. var subgrid_table_id;
  2844. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2845. var subgrid_pager_id;
  2846. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2847. // (5)动态添加子报表的table和pager
  2848. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2849. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2850. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2851. // (6)创建jqGrid对象
  2852. $("#" + subgrid_table_id).dataGrid({
  2853. cellEdit: true,
  2854. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2855. //colModel: [
  2856. // { label: "主键", name: "ID", hidden: true, key: true },
  2857. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2858. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2859. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2860. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2861. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2862. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2863. //],
  2864. colModel: _Clos1,
  2865. //colModel: ColModelSub,
  2866. shrinkToFit: true,//宽度自适应
  2867. multiselect: true,
  2868. prmNames: { search: "search" },
  2869. viewrecords: true,
  2870. height: "100%",
  2871. rowNum: 20,
  2872. pager: subgrid_pager_id,
  2873. });
  2874. }
  2875. //材料出库退料
  2876. function gridList13() {
  2877. var $gridList = $("#gridList");
  2878. var queryJson = {
  2879. POCode: $("#txt_POCode").val(),
  2880. InvCode: $("#txt_InvCode").val(),
  2881. InvName: $("#txt_InvName").val(),
  2882. BatchCode: $("#txt_BatchCode").val(),
  2883. POStatus: $("#selShow").val()
  2884. }
  2885. $gridList.dataGrid({
  2886. url: "/WMS/WMSCreateItemLot/GetGridJsonCLCK" + "?" + Math.random(),
  2887. postData: { queryJson: JSON.stringify(queryJson) },
  2888. height: $(window).height() - 200,
  2889. width: $(window).width() - 300,
  2890. colModel: _Clos,
  2891. //colModel: [
  2892. // { label: "主键", name: "ID", hidden: true, key: true },
  2893. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2894. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2895. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  2896. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2897. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2898. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2899. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2900. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2901. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2902. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2903. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2904. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2905. //],
  2906. //colModel: ColModelMain,
  2907. width: "100%",
  2908. autowidth: true,
  2909. //shrinkToFit: true,
  2910. gridComplete: function () {
  2911. },
  2912. pager: "#gridPager",
  2913. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  2914. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2915. sortorder: "asc",
  2916. viewrecords: true,
  2917. multiselect: true,
  2918. //beforeSelectRow: function (rowid, e) {
  2919. // $("#gridList").jqGrid('resetSelection');
  2920. // return (true);
  2921. //},
  2922. subGrid: true, // (1)开启子表格支持
  2923. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2924. $("#gridList").jqGrid("setSelection", rowid, false);
  2925. bindSubGrid13(subgrid_id, rowid)
  2926. }
  2927. });
  2928. $("#warehouse a.btn-default").click(function () {
  2929. $("#warehouse a.btn-default").removeClass("active");
  2930. $(this).addClass("active");
  2931. $('#btn_search').trigger("click");
  2932. });
  2933. $("#btn_search").click(function () {
  2934. var warehouse = $("#warehouse a.active").attr('data-value');
  2935. var queryJson = {
  2936. POCode: $("#txt_POCode").val(),
  2937. InvCode: $("#txt_InvCode").val(),
  2938. InvName: $("#txt_InvName").val(),
  2939. BatchCode: $("#txt_BatchCode").val(),
  2940. POStatus: $("#selShow").val()
  2941. }
  2942. $gridList.jqGrid('setGridParam', {
  2943. postData: { queryJson: JSON.stringify(queryJson) },
  2944. }).trigger('reloadGrid');
  2945. });
  2946. }
  2947. function bindSubGrid13(subgrid_id, rowid) {
  2948. $("#gridList").jqGrid("setSelection", rowid, false);
  2949. var subgrid_table_id;
  2950. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2951. var subgrid_pager_id;
  2952. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2953. // (5)动态添加子报表的table和pager
  2954. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2955. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2956. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2957. // (6)创建jqGrid对象
  2958. $("#" + subgrid_table_id).dataGrid({
  2959. cellEdit: true,
  2960. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2961. //colModel: [
  2962. // { label: "主键", name: "ID", hidden: true, key: true },
  2963. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2964. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2965. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2966. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2967. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2968. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2969. //],
  2970. colModel: _Clos1,
  2971. //colModel: ColModelSub,
  2972. shrinkToFit: true,//宽度自适应
  2973. multiselect: true,
  2974. prmNames: { search: "search" },
  2975. viewrecords: true,
  2976. height: "100%",
  2977. rowNum: 20,
  2978. pager: subgrid_pager_id,
  2979. });
  2980. }
  2981. //委外领料申请退料
  2982. function gridList14() {
  2983. var $gridList = $("#gridList");
  2984. var queryJson = {
  2985. POCode: $("#txt_POCode").val(),
  2986. InvCode: $("#txt_InvCode").val(),
  2987. InvName: $("#txt_InvName").val(),
  2988. BatchCode: $("#txt_BatchCode").val(),
  2989. POStatus: $("#selShow").val()
  2990. }
  2991. $gridList.dataGrid({
  2992. url: "/WMS/WMSCreateItemLot/GetGridJsonWWLLTL" + "?" + Math.random(),
  2993. postData: { queryJson: JSON.stringify(queryJson) },
  2994. height: $(window).height() - 200,
  2995. width: $(window).width() - 300,
  2996. colModel: _Clos,
  2997. //colModel: [
  2998. // { label: "主键", name: "ID", hidden: true, key: true },
  2999. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3000. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3001. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3002. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3003. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3004. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3005. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3006. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3007. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3008. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3009. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3010. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3011. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3012. //],
  3013. //colModel: ColModelMain,
  3014. width: "100%",
  3015. autowidth: true,
  3016. //shrinkToFit: true,
  3017. gridComplete: function () {
  3018. },
  3019. pager: "#gridPager",
  3020. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3021. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3022. sortorder: "asc",
  3023. viewrecords: true,
  3024. multiselect: true,
  3025. //beforeSelectRow: function (rowid, e) {
  3026. // $("#gridList").jqGrid('resetSelection');
  3027. // return (true);
  3028. //},
  3029. subGrid: true, // (1)开启子表格支持
  3030. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3031. $("#gridList").jqGrid("setSelection", rowid, false);
  3032. bindSubGrid14(subgrid_id, rowid)
  3033. }
  3034. });
  3035. $("#warehouse a.btn-default").click(function () {
  3036. $("#warehouse a.btn-default").removeClass("active");
  3037. $(this).addClass("active");
  3038. $('#btn_search').trigger("click");
  3039. });
  3040. $("#btn_search").click(function () {
  3041. var warehouse = $("#warehouse a.active").attr('data-value');
  3042. var queryJson = {
  3043. POCode: $("#txt_POCode").val(),
  3044. InvCode: $("#txt_InvCode").val(),
  3045. InvName: $("#txt_InvName").val(),
  3046. BatchCode: $("#txt_BatchCode").val(),
  3047. POStatus: $("#selShow").val()
  3048. }
  3049. $gridList.jqGrid('setGridParam', {
  3050. postData: { queryJson: JSON.stringify(queryJson) },
  3051. }).trigger('reloadGrid');
  3052. });
  3053. }
  3054. function bindSubGrid14(subgrid_id, rowid) {
  3055. $("#gridList").jqGrid("setSelection", rowid, false);
  3056. var subgrid_table_id;
  3057. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3058. var subgrid_pager_id;
  3059. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3060. // (5)动态添加子报表的table和pager
  3061. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3062. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3063. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3064. // (6)创建jqGrid对象
  3065. $("#" + subgrid_table_id).dataGrid({
  3066. cellEdit: true,
  3067. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3068. //colModel: [
  3069. // { label: "主键", name: "ID", hidden: true, key: true },
  3070. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3071. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3072. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3073. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3074. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3075. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3076. //],
  3077. colModel: _Clos1,
  3078. //colModel: ColModelSub,
  3079. shrinkToFit: true,//宽度自适应
  3080. multiselect: true,
  3081. prmNames: { search: "search" },
  3082. viewrecords: true,
  3083. height: "100%",
  3084. rowNum: 20,
  3085. pager: subgrid_pager_id,
  3086. });
  3087. }
  3088. //委外材料出库
  3089. function gridList15() {
  3090. var $gridList = $("#gridList");
  3091. var queryJson = {
  3092. POCode: $("#txt_POCode").val(),
  3093. InvCode: $("#txt_InvCode").val(),
  3094. InvName: $("#txt_InvName").val(),
  3095. BatchCode: $("#txt_BatchCode").val(),
  3096. POStatus: $("#selShow").val()
  3097. }
  3098. $gridList.dataGrid({
  3099. url: "/WMS/WMSCreateItemLot/GetGridJsonWWCLCK" + "?" + Math.random(),
  3100. postData: { queryJson: JSON.stringify(queryJson) },
  3101. height: $(window).height() - 200,
  3102. width: $(window).width() - 300,
  3103. colModel: _Clos,
  3104. //colModel: [
  3105. // { label: "主键", name: "ID", hidden: true, key: true },
  3106. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3107. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3108. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3109. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3110. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3111. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3112. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3113. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3114. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3115. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3116. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3117. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3118. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3119. //],
  3120. //colModel: ColModelMain,
  3121. width: "100%",
  3122. autowidth: true,
  3123. //shrinkToFit: true,
  3124. gridComplete: function () {
  3125. },
  3126. pager: "#gridPager",
  3127. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3128. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3129. sortorder: "asc",
  3130. viewrecords: true,
  3131. multiselect: true,
  3132. //beforeSelectRow: function (rowid, e) {
  3133. // $("#gridList").jqGrid('resetSelection');
  3134. // return (true);
  3135. //},
  3136. subGrid: true, // (1)开启子表格支持
  3137. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3138. $("#gridList").jqGrid("setSelection", rowid, false);
  3139. bindSubGrid15(subgrid_id, rowid)
  3140. }
  3141. });
  3142. $("#warehouse a.btn-default").click(function () {
  3143. $("#warehouse a.btn-default").removeClass("active");
  3144. $(this).addClass("active");
  3145. $('#btn_search').trigger("click");
  3146. });
  3147. $("#btn_search").click(function () {
  3148. var warehouse = $("#warehouse a.active").attr('data-value');
  3149. var queryJson = {
  3150. POCode: $("#txt_POCode").val(),
  3151. InvCode: $("#txt_InvCode").val(),
  3152. InvName: $("#txt_InvName").val(),
  3153. BatchCode: $("#txt_BatchCode").val(),
  3154. POStatus: $("#selShow").val()
  3155. }
  3156. $gridList.jqGrid('setGridParam', {
  3157. postData: { queryJson: JSON.stringify(queryJson) },
  3158. }).trigger('reloadGrid');
  3159. });
  3160. }
  3161. function bindSubGrid15(subgrid_id, rowid) {
  3162. $("#gridList").jqGrid("setSelection", rowid, false);
  3163. var subgrid_table_id;
  3164. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3165. var subgrid_pager_id;
  3166. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3167. // (5)动态添加子报表的table和pager
  3168. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3169. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3170. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3171. // (6)创建jqGrid对象
  3172. $("#" + subgrid_table_id).dataGrid({
  3173. cellEdit: true,
  3174. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3175. //colModel: [
  3176. // { label: "主键", name: "ID", hidden: true, key: true },
  3177. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3178. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3179. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3180. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3181. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3182. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3183. //],
  3184. colModel: _Clos1,
  3185. //colModel: ColModelSub,
  3186. shrinkToFit: true,//宽度自适应
  3187. //multiselect: true,
  3188. prmNames: { search: "search" },
  3189. multiselect: true,
  3190. viewrecords: true,
  3191. height: "100%",
  3192. rowNum: 20,
  3193. pager: subgrid_pager_id,
  3194. });
  3195. }
  3196. function gridList16() {
  3197. var $gridList = $("#gridList");
  3198. var queryJson = {
  3199. POCode: $("#txt_POCode").val(),
  3200. InvCode: $("#txt_InvCode").val(),
  3201. InvName: $("#txt_InvName").val(),
  3202. BatchCode: $("#txt_BatchCode").val(),
  3203. POStatus: $("#selShow").val()
  3204. }
  3205. $gridList.dataGrid({
  3206. url: "/WMS/WMSCreateItemLot/GetGridJsonFGGD" + "?" + Math.random(),
  3207. postData: { queryJson: JSON.stringify(queryJson) },
  3208. height: $(window).height() - 200,
  3209. width: $(window).width() - 300,
  3210. colModel: _Clos,
  3211. //colModel: [
  3212. // { label: "主键", name: "ID", hidden: true, key: true },
  3213. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3214. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3215. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3216. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3217. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3218. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3219. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3220. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3221. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3222. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3223. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3224. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3225. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3226. //],
  3227. //colModel: ColModelMain,
  3228. width: "100%",
  3229. autowidth: true,
  3230. //shrinkToFit: true,
  3231. gridComplete: function () {
  3232. },
  3233. pager: "#gridPager",
  3234. // sortname: 'MOCode,cast(Sequence as int)',
  3235. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3236. sortorder: "asc",
  3237. viewrecords: true,
  3238. multiselect: true,
  3239. //beforeSelectRow: function (rowid, e) {
  3240. // $("#gridList").jqGrid('resetSelection');
  3241. // return (true);
  3242. //},
  3243. subGrid: true, // (1)开启子表格支持
  3244. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3245. $("#gridList").jqGrid("setSelection", rowid, false);
  3246. bindSubGrid16(subgrid_id, rowid)
  3247. }
  3248. });
  3249. $("#warehouse a.btn-default").click(function () {
  3250. $("#warehouse a.btn-default").removeClass("active");
  3251. $(this).addClass("active");
  3252. $('#btn_search').trigger("click");
  3253. });
  3254. $("#btn_search").click(function () {
  3255. var warehouse = $("#warehouse a.active").attr('data-value');
  3256. var queryJson = {
  3257. POCode: $("#txt_POCode").val(),
  3258. InvCode: $("#txt_InvCode").val(),
  3259. InvName: $("#txt_InvName").val(),
  3260. BatchCode: $("#txt_BatchCode").val(),
  3261. POStatus: $("#selShow").val()
  3262. }
  3263. $gridList.jqGrid('setGridParam', {
  3264. postData: { queryJson: JSON.stringify(queryJson) },
  3265. }).trigger('reloadGrid');
  3266. });
  3267. }
  3268. function bindSubGrid16(subgrid_id, rowid) {
  3269. $("#gridList").jqGrid("setSelection", rowid, false);
  3270. var subgrid_table_id;
  3271. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3272. var subgrid_pager_id;
  3273. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3274. // (5)动态添加子报表的table和pager
  3275. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3276. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  3277. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3278. // (6)创建jqGrid对象
  3279. $("#" + subgrid_table_id).dataGrid({
  3280. cellEdit: true,
  3281. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3282. //colModel: [
  3283. // { label: "主键", name: "ID", hidden: true, key: true },
  3284. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3285. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3286. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3287. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3288. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3289. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3290. //],
  3291. colModel: _Clos1,
  3292. //colModel: ColModelSub,
  3293. shrinkToFit: true,//宽度自适应
  3294. multiselect: true,
  3295. prmNames: { search: "search" },
  3296. viewrecords: true,
  3297. height: "100%",
  3298. rowNum: 20,
  3299. pager: subgrid_pager_id,
  3300. });
  3301. }
  3302. //检验不合格
  3303. function gridList17() {
  3304. var $gridList = $("#gridList");
  3305. var queryJson = {
  3306. POCode: $("#txt_POCode").val(),
  3307. InvCode: $("#txt_InvCode").val(),
  3308. InvName: $("#txt_InvName").val(),
  3309. BatchCode: $("#txt_BatchCode").val(),
  3310. POStatus: $("#selShow").val()
  3311. }
  3312. $gridList.dataGrid({
  3313. url: "/WMS/WMSCreateItemLot/GetGridJsonBHGTM" + "?" + Math.random(),
  3314. postData: { queryJson: JSON.stringify(queryJson) },
  3315. height: $(window).height() - 200,
  3316. width: $(window).width() - 300,
  3317. colModel: _Clos,
  3318. //colModel: [
  3319. // { label: "主键", name: "ID", hidden: true, key: true },
  3320. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3321. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3322. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3323. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3324. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3325. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3326. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3327. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3328. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3329. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3330. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3331. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3332. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3333. //],
  3334. //colModel: ColModelMain,
  3335. width: "100%",
  3336. autowidth: true,
  3337. //shrinkToFit: true,
  3338. gridComplete: function () {
  3339. },
  3340. pager: "#gridPager",
  3341. sortname: 'LotNo',
  3342. sortorder: "asc",
  3343. viewrecords: true,
  3344. multiselect: true,
  3345. //beforeSelectRow: function (rowid, e) {
  3346. // $("#gridList").jqGrid('resetSelection');
  3347. // return (true);
  3348. //},
  3349. subGrid: true, // (1)开启子表格支持
  3350. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3351. $("#gridList").jqGrid("setSelection", rowid, false);
  3352. bindSubGrid17(subgrid_id, rowid)
  3353. }
  3354. });
  3355. $("#warehouse a.btn-default").click(function () {
  3356. $("#warehouse a.btn-default").removeClass("active");
  3357. $(this).addClass("active");
  3358. $('#btn_search').trigger("click");
  3359. });
  3360. $("#btn_search").click(function () {
  3361. var warehouse = $("#warehouse a.active").attr('data-value');
  3362. var queryJson = {
  3363. POCode: $("#txt_POCode").val(),
  3364. InvCode: $("#txt_InvCode").val(),
  3365. InvName: $("#txt_InvName").val(),
  3366. BatchCode: $("#txt_BatchCode").val(),
  3367. POStatus: $("#selShow").val()
  3368. }
  3369. $gridList.jqGrid('setGridParam', {
  3370. postData: { queryJson: JSON.stringify(queryJson) },
  3371. }).trigger('reloadGrid');
  3372. });
  3373. }
  3374. function bindSubGrid17(subgrid_id, rowid) {
  3375. $("#gridList").jqGrid("setSelection", rowid, false);
  3376. var subgrid_table_id;
  3377. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3378. var subgrid_pager_id;
  3379. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3380. // (5)动态添加子报表的table和pager
  3381. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3382. var LotNo = $("#gridList").jqGrid('getRowData', rowid).LotNo;
  3383. // var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3384. // (6)创建jqGrid对象
  3385. $("#" + subgrid_table_id).dataGrid({
  3386. cellEdit: true,
  3387. url: "/WMS/WMSCreateItemLot/GetSubGridJsonBHGTM?LotNo=" + LotNo + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3388. //colModel: [
  3389. // { label: "主键", name: "ID", hidden: true, key: true },
  3390. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3391. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3392. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3393. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3394. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3395. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3396. //],
  3397. colModel: _Clos1,
  3398. //colModel: ColModelSub,
  3399. shrinkToFit: true,//宽度自适应
  3400. multiselect: true,
  3401. prmNames: { search: "search" },
  3402. viewrecords: true,
  3403. height: "100%",
  3404. rowNum: 20,
  3405. pager: subgrid_pager_id,
  3406. });
  3407. }
  3408. function gridList18() {
  3409. var $gridList = $("#gridList");
  3410. var queryJson = {
  3411. POCode: $("#txt_POCode").val(),
  3412. InvCode: $("#txt_InvCode").val(),
  3413. InvName: $("#txt_InvName").val(),
  3414. BatchCode: $("#txt_BatchCode").val(),
  3415. POStatus: $("#selShow").val()
  3416. }
  3417. $gridList.dataGrid({
  3418. url: "/WMS/WMSCreateItemLot/GetGridJsonFCP" + "?" + Math.random(),
  3419. postData: { queryJson: JSON.stringify(queryJson) },
  3420. height: $(window).height() - 200,
  3421. width: $(window).width() - 300,
  3422. colModel: _Clos,
  3423. //colModel: [
  3424. // { label: "主键", name: "ID", hidden: true, key: true },
  3425. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3426. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3427. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3428. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3429. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3430. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3431. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3432. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3433. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3434. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3435. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3436. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3437. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3438. //],
  3439. //colModel: ColModelMain,
  3440. width: "100%",
  3441. autowidth: true,
  3442. //shrinkToFit: true,
  3443. gridComplete: function () {
  3444. },
  3445. pager: "#gridPager",
  3446. // sortname: 'MOCode,cast(Sequence as int)',
  3447. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3448. sortorder: "asc",
  3449. viewrecords: true,
  3450. multiselect: true,
  3451. //beforeSelectRow: function (rowid, e) {
  3452. // $("#gridList").jqGrid('resetSelection');
  3453. // return (true);
  3454. //},
  3455. subGrid: true, // (1)开启子表格支持
  3456. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3457. $("#gridList").jqGrid("setSelection", rowid, false);
  3458. bindSubGrid18(subgrid_id, rowid)
  3459. }
  3460. });
  3461. $("#warehouse a.btn-default").click(function () {
  3462. $("#warehouse a.btn-default").removeClass("active");
  3463. $(this).addClass("active");
  3464. $('#btn_search').trigger("click");
  3465. });
  3466. $("#btn_search").click(function () {
  3467. var warehouse = $("#warehouse a.active").attr('data-value');
  3468. var queryJson = {
  3469. POCode: $("#txt_POCode").val(),
  3470. InvCode: $("#txt_InvCode").val(),
  3471. InvName: $("#txt_InvName").val(),
  3472. BatchCode: $("#txt_BatchCode").val(),
  3473. POStatus: $("#selShow").val()
  3474. }
  3475. $gridList.jqGrid('setGridParam', {
  3476. postData: { queryJson: JSON.stringify(queryJson) },
  3477. }).trigger('reloadGrid');
  3478. });
  3479. }
  3480. function bindSubGrid18(subgrid_id, rowid) {
  3481. $("#gridList").jqGrid("setSelection", rowid, false);
  3482. var subgrid_table_id;
  3483. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3484. var subgrid_pager_id;
  3485. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3486. // (5)动态添加子报表的table和pager
  3487. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3488. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  3489. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3490. // (6)创建jqGrid对象
  3491. $("#" + subgrid_table_id).dataGrid({
  3492. cellEdit: true,
  3493. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3494. //colModel: [
  3495. // { label: "主键", name: "ID", hidden: true, key: true },
  3496. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3497. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3498. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3499. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3500. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3501. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3502. //],
  3503. colModel: _Clos1,
  3504. //colModel: ColModelSub,
  3505. shrinkToFit: true,//宽度自适应
  3506. multiselect: true,
  3507. prmNames: { search: "search" },
  3508. viewrecords: true,
  3509. height: "100%",
  3510. rowNum: 20,
  3511. pager: subgrid_pager_id,
  3512. });
  3513. }
  3514. function btnDelete() {
  3515. var objArr = '';
  3516. var obj = $("#gridList").jqGrid("getRowData");
  3517. for (var i = 0; i < obj.length; i++) {
  3518. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  3519. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  3520. if (rowData != "undefined" && rowData != null) {
  3521. for (var j = 0; j < rowData.length; j++) {
  3522. objArr += "'" + rowData[j] + "',";
  3523. }
  3524. }
  3525. }
  3526. if (objArr == "") {
  3527. $.modalAlertNew("WMS00099");
  3528. return;
  3529. }
  3530. $.deleteForm({
  3531. url: "/WMS/WMSCreateItemLot/DeleteItemLot",
  3532. param: { keyValue: JSON.stringify(objArr) },
  3533. success: function () {
  3534. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3535. }
  3536. })
  3537. }
  3538. function btnAllCreate() {
  3539. debugger;
  3540. var PoStatus;
  3541. var jsonData = '';
  3542. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  3543. //if (ids.length != 1) {
  3544. // $.modalAlertNew("WMS00100");
  3545. // return;
  3546. //}
  3547. var POCode = "";
  3548. var PORow = "";
  3549. var VenCode = "";
  3550. var WorkPoint = "";
  3551. var VendorLot = "";
  3552. //生产退料
  3553. if (Type == '1') {
  3554. debugger;
  3555. var ARR = [];
  3556. for (var i in ids) {
  3557. Code = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  3558. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3559. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  3560. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  3561. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  3562. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  3563. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  3564. if (thisCreateQty == 0) {
  3565. $.modalAlert("该单据条码已全部生成完毕!");
  3566. return;
  3567. }
  3568. thisCreateQty = thisCreateQty.toFixed(4);
  3569. var minPackQty = thisCreateQty;//最小包装量
  3570. //minPackQty = minPackQty.toFixed(4);
  3571. var createPageCount = 1;//本次生成张数
  3572. createPageCount = createPageCount.toFixed(0);
  3573. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  3574. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  3575. Quantity = Quantity.toFixed(2);
  3576. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  3577. CreatedQty = CreatedQty.toFixed(2);
  3578. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  3579. if (Quantity == CreatedQty) {
  3580. return false;
  3581. }
  3582. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  3583. if (EffectiveEnable == 'true') {
  3584. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  3585. } else {
  3586. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  3587. }
  3588. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  3589. var obj = {
  3590. Code: Code,
  3591. Sequence: Sequence,
  3592. thisCreateQty: thisCreateQty,
  3593. minPackQty: minPackQty,
  3594. createPageCount: createPageCount,
  3595. //VendorLot: VendorLot,
  3596. PRODUCTDATE: PRODUCTDATE,
  3597. ExpirationDate: ExpirationDate,
  3598. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  3599. //自由项
  3600. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  3601. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  3602. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  3603. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  3604. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  3605. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  3606. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  3607. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  3608. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  3609. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  3610. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  3611. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  3612. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  3613. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  3614. }
  3615. ARR.push(obj);
  3616. }
  3617. $.submitForm({
  3618. url: "/WMS/WMSCreateItemLot/SubmitFormGDTLALL" + "?" + Math.random(),
  3619. param: {
  3620. keyValue: JSON.stringify(ARR)
  3621. },
  3622. success: function () {
  3623. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3624. }
  3625. })
  3626. }
  3627. //普通到货单
  3628. if (Type == '7') {
  3629. debugger;
  3630. var ARR = [];
  3631. for (var i in ids) {
  3632. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  3633. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  3634. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3635. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  3636. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  3637. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  3638. //console.log("单号:" + DNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  3639. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  3640. if (thisCreateQty == 0) {
  3641. $.modalAlert("该单据条码已全部生成完毕!");
  3642. return;
  3643. }
  3644. thisCreateQty = thisCreateQty.toFixed(4);
  3645. var minPackQty = thisCreateQty;//最小包装量
  3646. //minPackQty = minPackQty.toFixed(4);
  3647. var createPageCount = 1;//本次生成张数
  3648. createPageCount = createPageCount.toFixed(0);
  3649. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  3650. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  3651. Quantity = Quantity.toFixed(2);
  3652. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  3653. CreatedQty = CreatedQty.toFixed(2);
  3654. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  3655. if (Quantity == CreatedQty) {
  3656. return false;
  3657. }
  3658. if (EffectiveEnable == 'true') {
  3659. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  3660. } else {
  3661. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  3662. }
  3663. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  3664. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  3665. var obj = {
  3666. ID:ID,
  3667. Code: DNCode,
  3668. Sequence: Sequence,
  3669. thisCreateQty: thisCreateQty,
  3670. minPackQty: minPackQty,
  3671. createPageCount: createPageCount,
  3672. //VendorLot: VendorLot,
  3673. PRODUCTDATE: PRODUCTDATE,
  3674. ExpirationDate: ExpirationDate,
  3675. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  3676. //自由项
  3677. ProjectCode : $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  3678. BatchCode : $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  3679. Version : $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  3680. Brand : $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  3681. cFree1 : $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  3682. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  3683. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  3684. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  3685. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  3686. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  3687. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  3688. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  3689. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  3690. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  3691. }
  3692. ARR.push(obj);
  3693. }
  3694. $.submitForm({
  3695. url: "/WMS/WMSCreateItemLot/SubmitFormSHDHALL" + "?" + Math.random(),
  3696. param: {
  3697. keyValue: JSON.stringify(ARR)
  3698. },
  3699. success: function () {
  3700. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3701. }
  3702. })
  3703. }
  3704. //委外到货单
  3705. if (Type == '8') {
  3706. debugger;
  3707. var ARR = [];
  3708. for (var i in ids) {
  3709. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  3710. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3711. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  3712. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  3713. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  3714. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  3715. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  3716. if (thisCreateQty == 0) {
  3717. $.modalAlert("该单据条码已全部生成完毕!");
  3718. return;
  3719. }
  3720. thisCreateQty = thisCreateQty.toFixed(4);
  3721. var minPackQty = thisCreateQty;//最小包装量
  3722. //minPackQty = minPackQty.toFixed(4);
  3723. var createPageCount = 1;//本次生成张数
  3724. createPageCount = createPageCount.toFixed(0);
  3725. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  3726. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  3727. Quantity = Quantity.toFixed(2);
  3728. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  3729. CreatedQty = CreatedQty.toFixed(2);
  3730. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  3731. if (Quantity == CreatedQty) {
  3732. return false;
  3733. }
  3734. if (EffectiveEnable == 'true') {
  3735. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  3736. } else {
  3737. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  3738. }
  3739. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  3740. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  3741. var obj = {
  3742. Code: ODNCode,
  3743. Sequence: Sequence,
  3744. thisCreateQty: thisCreateQty,
  3745. minPackQty: minPackQty,
  3746. createPageCount: createPageCount,
  3747. //VendorLot: VendorLot,
  3748. PRODUCTDATE: PRODUCTDATE,
  3749. ExpirationDate: ExpirationDate,
  3750. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  3751. //自由项
  3752. ProjectCode : $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  3753. BatchCode : $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  3754. Version : $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  3755. Brand : $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  3756. cFree1 : $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  3757. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  3758. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  3759. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  3760. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  3761. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  3762. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  3763. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  3764. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  3765. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  3766. }
  3767. ARR.push(obj);
  3768. }
  3769. $.submitForm({
  3770. url: "/WMS/WMSCreateItemLot/SubmitFormWWSHDHALL" + "?" + Math.random(),
  3771. param: {
  3772. keyValue: JSON.stringify(obj)
  3773. },
  3774. success: function () {
  3775. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3776. }
  3777. })
  3778. }
  3779. //成品入库单条码生成
  3780. if (Type == '9') {
  3781. debugger;
  3782. var ARR = [];
  3783. for (var i in ids) {
  3784. Code = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  3785. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3786. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  3787. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  3788. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  3789. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  3790. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  3791. if (thisCreateQty == 0) {
  3792. $.modalAlert("该单据条码已全部生成完毕!");
  3793. return;
  3794. }
  3795. thisCreateQty = thisCreateQty.toFixed(4);
  3796. var minPackQty = thisCreateQty;//最小包装量
  3797. //minPackQty = minPackQty.toFixed(4);
  3798. var createPageCount = 1;//本次生成张数
  3799. createPageCount = createPageCount.toFixed(0);
  3800. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  3801. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  3802. Quantity = Quantity.toFixed(2);
  3803. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  3804. CreatedQty = CreatedQty.toFixed(2);
  3805. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  3806. if (Quantity == CreatedQty) {
  3807. return false;
  3808. }
  3809. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  3810. if (EffectiveEnable=='true') {
  3811. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  3812. } else {
  3813. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  3814. }
  3815. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  3816. var obj = {
  3817. Code: Code,
  3818. Sequence:Sequence,
  3819. thisCreateQty: thisCreateQty,
  3820. minPackQty: minPackQty,
  3821. createPageCount: createPageCount,
  3822. //VendorLot: VendorLot,
  3823. PRODUCTDATE: PRODUCTDATE,
  3824. ExpirationDate: ExpirationDate,
  3825. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  3826. //自由项
  3827. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  3828. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  3829. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  3830. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  3831. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  3832. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  3833. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  3834. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  3835. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  3836. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  3837. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  3838. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  3839. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  3840. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  3841. }
  3842. ARR.push(obj);
  3843. }
  3844. $.submitForm({
  3845. url: "/WMS/WMSCreateItemLot/SubmitFormKLCPRKALL" + "?" + Math.random(),
  3846. param: {
  3847. keyValue: JSON.stringify(ARR)
  3848. },
  3849. success: function () {
  3850. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3851. }
  3852. })
  3853. }
  3854. if (Type == '17') {
  3855. for (var i in ids) {
  3856. LotNo = $("#gridList").jqGrid('getRowData', ids[i]).LotNo;
  3857. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  3858. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  3859. if (thisCreateQty==0) {
  3860. $.modalAlert("该条码已全部生成完毕!");
  3861. return;
  3862. }
  3863. thisCreateQty = thisCreateQty.toFixed(4);
  3864. var minPackQty = thisCreateQty;//最小包装量
  3865. var createPageCount = 1;//本次生成张数
  3866. createPageCount = createPageCount.toFixed(0);
  3867. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  3868. Quantity = Quantity.toFixed(2);
  3869. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  3870. CreatedQty = CreatedQty.toFixed(2);
  3871. if (Quantity == CreatedQty) {
  3872. return false;
  3873. }
  3874. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  3875. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  3876. var obj = {
  3877. thisCreateQty: thisCreateQty,
  3878. minPackQty: minPackQty,
  3879. createPageCount: createPageCount,
  3880. //VendorLot: VendorLot,
  3881. PRODUCTDATE: PRODUCTDATE,
  3882. ExpirationDate: ExpirationDate,
  3883. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  3884. }
  3885. $.submitForm({
  3886. url: "/WMS/WMSCreateItemLot/SubmitFormBHGTM?LotNo=" + LotNo + "&WorkPoint=" + WorkPoints,
  3887. param: {
  3888. keyValue: JSON.stringify(obj)
  3889. },
  3890. success: function () {
  3891. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3892. }
  3893. })
  3894. }
  3895. }
  3896. }
  3897. function dateChange(num, date) {
  3898. if (!date) {
  3899. date = new Date();//没有传入值时,默认是当前日期
  3900. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  3901. }
  3902. date += " 00:00:00";//设置为当天凌晨12点
  3903. date = Date.parse(new Date(date)) / 1000;//转换为时间戳
  3904. date += (86400) * num;//修改后的时间戳
  3905. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  3906. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  3907. }
  3908. function btnCreate() {
  3909. debugger;
  3910. var PoStatus;
  3911. var jsonData = '';
  3912. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  3913. if (ids.length != 1) {
  3914. $.modalAlertNew("WMS00100");
  3915. return;
  3916. }
  3917. var POCode = "";
  3918. var PORow = "";
  3919. if (Type == '1') {
  3920. for (var i in ids) {
  3921. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  3922. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3923. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  3924. }
  3925. $.modalOpen({
  3926. id: "FormAddItemLot",
  3927. title: "生产退料条码生成",
  3928. url: "/WMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 1 + "&" + Math.random(),
  3929. width: "550px",
  3930. height: "1000px",
  3931. callBack: function (iframeId) {
  3932. top.frames[iframeId].submitForm();
  3933. }
  3934. });
  3935. } else if (Type == '2') {
  3936. for (var i in ids) {
  3937. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  3938. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3939. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  3940. }
  3941. $.modalOpen({
  3942. id: "FormAddItemLot",
  3943. title: "委外退料条码生成",
  3944. url: "/WMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&" + Math.random(),
  3945. width: "550px",
  3946. height: "1000px",
  3947. callBack: function (iframeId) {
  3948. top.frames[iframeId].submitForm();
  3949. }
  3950. });
  3951. } else if (Type == '3') {
  3952. for (var i in ids) {
  3953. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  3954. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  3955. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3956. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  3957. }
  3958. $.modalOpen({
  3959. id: "FormAddItemLot",
  3960. title: "成品条码产生",
  3961. url: "/WMS/WMSCreateItemLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&" + Math.random(),
  3962. width: "550px",
  3963. height: "1000px",
  3964. callBack: function (iframeId) {
  3965. top.frames[iframeId].submitForm();
  3966. }
  3967. });
  3968. } else if (Type == '4') {
  3969. for (var i in ids) {
  3970. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  3971. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3972. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  3973. }
  3974. $.modalOpen({
  3975. id: "FormAddItemLot",
  3976. title: "销售退货条码产生",
  3977. url: "/WMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&" + Math.random(),
  3978. width: "550px",
  3979. height: "1000px",
  3980. callBack: function (iframeId) {
  3981. top.frames[iframeId].submitForm();
  3982. }
  3983. });
  3984. } else if (Type == '5') {
  3985. for (var i in ids) {
  3986. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  3987. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3988. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  3989. }
  3990. $.modalOpen({
  3991. id: "FormAddItemLot",
  3992. title: "其他入库条码产生",
  3993. url: "/WMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&" + Math.random(),
  3994. width: "550px",
  3995. height: "1000px",
  3996. callBack: function (iframeId) {
  3997. top.frames[iframeId].submitForm();
  3998. }
  3999. });
  4000. } else if (Type == '6') {
  4001. for (var i in ids) {
  4002. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  4003. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4004. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4005. }
  4006. $.modalOpen({
  4007. id: "FormAddItemLot",
  4008. title: "归还单条码产生",
  4009. url: "/WMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 6 + "&" + Math.random(),
  4010. width: "550px",
  4011. height: "1000px",
  4012. callBack: function (iframeId) {
  4013. top.frames[iframeId].submitForm();
  4014. }
  4015. });
  4016. } else if (Type == '7') {
  4017. for (var i in ids) {
  4018. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4019. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  4020. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4021. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4022. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4023. }
  4024. $.modalOpen({
  4025. id: "FormAddItemLot",
  4026. title: "审核到货单生成条码",
  4027. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 7 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4028. width: "550px",
  4029. height: "1000px",
  4030. callBack: function (iframeId) {
  4031. top.frames[iframeId].submitForm();
  4032. }
  4033. });
  4034. } else if (Type == '8') {
  4035. for (var i in ids) {
  4036. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  4037. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4038. OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID;
  4039. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4040. }
  4041. $.modalOpen({
  4042. id: "FormAddItemLot",
  4043. title: "审核委外到货单生成条码",
  4044. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&OODetailID=" + OODetailID + "&" + Math.random(),
  4045. width: "550px",
  4046. height: "1000px",
  4047. callBack: function (iframeId) {
  4048. top.frames[iframeId].submitForm();
  4049. }
  4050. });
  4051. } else if (Type == '9') {
  4052. for (var i in ids) {
  4053. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  4054. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4055. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4056. }
  4057. $.modalOpen({
  4058. id: "FormAddItemLot",
  4059. title: "开立成品入库单生成条码",
  4060. url: "/WMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 9 + "&" + Math.random(),
  4061. width: "550px",
  4062. height: "1000px",
  4063. callBack: function (iframeId) {
  4064. top.frames[iframeId].submitForm();
  4065. }
  4066. });
  4067. } else if (Type == '10') {
  4068. for (var i in ids) {
  4069. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  4070. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4071. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4072. }
  4073. $.modalOpen({
  4074. id: "FormAddItemLot",
  4075. title: "审核拒收单生成条码",
  4076. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 10 + "&" + Math.random(),
  4077. width: "550px",
  4078. height: "1000px",
  4079. callBack: function (iframeId) {
  4080. top.frames[iframeId].submitForm();
  4081. }
  4082. });
  4083. } else if (Type == '11') {
  4084. for (var i in ids) {
  4085. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  4086. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  4087. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4088. }
  4089. $.modalOpen({
  4090. id: "FormAddItemLot",
  4091. title: "审核委外拒收单生成条码",
  4092. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 11 + "&" + Math.random(),
  4093. width: "550px",
  4094. height: "1000px",
  4095. callBack: function (iframeId) {
  4096. top.frames[iframeId].submitForm();
  4097. }
  4098. });
  4099. } else if (Type == '12') {
  4100. for (var i in ids) {
  4101. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4102. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4103. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4104. }
  4105. $.modalOpen({
  4106. id: "FormAddItemLot",
  4107. title: "审核领料申请退料生成条码",
  4108. url: "/WMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&" + Math.random(),
  4109. width: "550px",
  4110. height: "1000px",
  4111. callBack: function (iframeId) {
  4112. top.frames[iframeId].submitForm();
  4113. }
  4114. });
  4115. } else if (Type == '13') {
  4116. for (var i in ids) {
  4117. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4118. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4119. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4120. }
  4121. $.modalOpen({
  4122. id: "FormAddItemLot",
  4123. title: "材料出库退料生成条码",
  4124. url: "/WMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 13 + "&" + Math.random(),
  4125. width: "550px",
  4126. height: "1000px",
  4127. callBack: function (iframeId) {
  4128. top.frames[iframeId].submitForm();
  4129. }
  4130. });
  4131. } else if (Type == '14') {
  4132. for (var i in ids) {
  4133. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  4134. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4135. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4136. }
  4137. $.modalOpen({
  4138. id: "FormAddItemLot",
  4139. title: "委外领料退料条码生成",
  4140. url: "/WMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 14 + "&" + Math.random(),
  4141. width: "550px",
  4142. height: "1000px",
  4143. callBack: function (iframeId) {
  4144. top.frames[iframeId].submitForm();
  4145. }
  4146. });
  4147. }
  4148. else if (Type == '15') {
  4149. for (var i in ids) {
  4150. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  4151. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4152. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4153. }
  4154. $.modalOpen({
  4155. id: "FormAddItemLot",
  4156. title: "委外材料出库退料生成条码",
  4157. url: "/WMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 15 + "&" + Math.random(),
  4158. width: "550px",
  4159. height: "1000px",
  4160. callBack: function (iframeId) {
  4161. top.frames[iframeId].submitForm();
  4162. }
  4163. });
  4164. }
  4165. else if (Type == '16') {
  4166. for (var i in ids) {
  4167. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  4168. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4169. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4170. }
  4171. $.modalOpen({
  4172. id: "FormAddItemLot",
  4173. title: "返工工单生成条码",
  4174. url: "/WMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 16 + "&" + Math.random(),
  4175. width: "550px",
  4176. height: "1000px",
  4177. callBack: function (iframeId) {
  4178. top.frames[iframeId].submitForm();
  4179. }
  4180. });
  4181. }
  4182. else if (Type == '18') {
  4183. for (var i in ids) {
  4184. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  4185. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4186. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4187. }
  4188. $.modalOpen({
  4189. id: "FormAddItemLot",
  4190. title: "副产品生成条码",
  4191. url: "/WMS/WMSCreateItemLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&" + Math.random(),
  4192. width: "550px",
  4193. height: "1000px",
  4194. callBack: function (iframeId) {
  4195. top.frames[iframeId].submitForm();
  4196. }
  4197. });
  4198. }
  4199. }
  4200. function fullscreen() {
  4201. var docElm = document.documentElement;
  4202. if (docElm.requestFullscreen) {
  4203. docElm.requestFullscreen();
  4204. } else if (docElm.mozRequestFullScreen) {
  4205. docElm.mozRequestFullScreen();
  4206. } else if (docElm.webkitRequestFullScreen) {
  4207. docElm.webkitRequestFullScreen();
  4208. } else if (docElm.msRequestFullscreen) {
  4209. docElm.msRequestFullscreen();
  4210. }
  4211. $(window).bind('resize', function () {
  4212. $("#gridList").setGridWidth($(window).width());
  4213. }).trigger('resize');
  4214. $(window).bind('resize', function () {
  4215. $("#gridList").setGridHeight($(window).height());
  4216. }).trigger('resize');
  4217. }
  4218. function btnPrint() {
  4219. debugger;
  4220. var mold = '';
  4221. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  4222. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  4223. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  4224. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  4225. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  4226. if (Type == '6') { mold = '00006'; }//归还单生成条码
  4227. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  4228. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  4229. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  4230. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  4231. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  4232. if (Type == '12') { mold = '00012'; }//领料申请退料
  4233. if (Type == '13') { mold = '00013'; }//材料出库退料
  4234. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  4235. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  4236. if (Type == '16') { mold = '00016'; }//返工工单
  4237. if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库
  4238. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  4239. var objArr = '';
  4240. var arr = [];
  4241. var obj = $("#gridList").jqGrid("getRowData");
  4242. for (var i = 0; i < obj.length; i++) {
  4243. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  4244. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  4245. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  4246. for (var j = 0; j < rowData.length; j++) {
  4247. objArr += "'" + rowData[j] + "',";
  4248. }
  4249. objArr = objArr.slice(0, objArr.length - 1);
  4250. objArr = "" + objArr + "|";
  4251. arr.push(objArr);
  4252. }
  4253. }
  4254. if (objArr == "") {
  4255. $.modalAlertNew("WMS00101");
  4256. return;
  4257. }
  4258. $.modalOpen({
  4259. id: "PrintLot",
  4260. title: "打印",
  4261. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  4262. width: "550px",
  4263. height: "1000px",
  4264. callBack: function (iframeId) {
  4265. top.frames[iframeId].submitForm();
  4266. }
  4267. });
  4268. }
  4269. function btn_ExportAll() {
  4270. debugger;
  4271. var objArr = '';
  4272. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  4273. for (var i in ids) {
  4274. objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',";
  4275. }
  4276. if (objArr=="") {
  4277. $.modalAlert("请选择单据后导出!");
  4278. return;
  4279. }
  4280. var postData = "&Type=" + Type + "";
  4281. //postData += "&ID=" + ID
  4282. postData += "&ID=" + objArr;
  4283. $.download("/WMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post');
  4284. }
  4285. function Select_SelGDLX() {
  4286. $("#SelGDLX").find("option").remove();
  4287. var DeptName = $("#SelGDLX option:checked").text();
  4288. $("#SelGDLX").append("<option value=''>--请选择--</option>");
  4289. $.ajax({
  4290. url: "/WMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(),
  4291. dataType: "json",
  4292. async: false,
  4293. success: function (data) {
  4294. if (data != null && data.length > 0) {
  4295. for (var i = 0; i < data.length; i++) {
  4296. $("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
  4297. }
  4298. }
  4299. }
  4300. });
  4301. $("#SelGDLX option:checked").val('');
  4302. }
  4303. function btnCreateLook() {
  4304. var MODetailID = '';
  4305. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  4306. for (var i = 0; i < objList.length; i++) {
  4307. var rowId = objList[i];
  4308. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  4309. MODetailID = rowData.MODetailID;
  4310. }
  4311. $.modalOpenClean({
  4312. id: "FormMoPick",
  4313. title: "工单子件信息",
  4314. url: "/WMS/WMSCreateItemLot/FormMoPick" + "?" + Math.random() + "&MODetailID=" + MODetailID,
  4315. width: "90%",
  4316. height: "90%",
  4317. callBack: function (iframeId) {
  4318. top.frames[iframeId].submitForm();
  4319. }
  4320. });
  4321. }
  4322. function btn_Import() {
  4323. $.modalOpen({
  4324. id: "Upload",
  4325. title: "导入",
  4326. url: "/WMS/WMSCreateItemLot/ImportLot?" + Math.random(),
  4327. width: "400px",
  4328. height: "200px",
  4329. btn: null,
  4330. });
  4331. }
  4332. </script>
  4333. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  4334. <script>
  4335. </script>
  4336. <div class="topPanel" style="height:100px;">
  4337. <div class="toolbar">
  4338. <div class="btn-group">
  4339. <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>
  4340. <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>
  4341. <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>
  4342. <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>
  4343. <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>
  4344. @*<a id="NF-ExportAll" authorize="yes" class="btn btn-default" onclick="btn_ExportAll()"><i class="fa fa-download"></i>导出</a>*@
  4345. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  4346. </div>
  4347. <div class="btn-group" style="display:block;padding-left:2px;">
  4348. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  4349. <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>
  4350. <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>
  4351. </div>
  4352. <script>$('.toolbar').authorizeButton()</script>
  4353. </div>
  4354. <div class="search">
  4355. <table>
  4356. <tr>
  4357. <td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;</label>:</td>
  4358. <td class="POCodeShow">
  4359. <div class="input-group">
  4360. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  4361. </div>
  4362. </td>
  4363. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  4364. <td class="HideItems">
  4365. <div class="input-group HideItems">
  4366. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  4367. </div>
  4368. </td>
  4369. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  4370. <td class="HideItems">
  4371. <div class="input-group HideItems">
  4372. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  4373. </div>
  4374. </td>
  4375. </tr>
  4376. <tr>
  4377. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  4378. <td>
  4379. <div class="input-group">
  4380. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  4381. </div>
  4382. </td>
  4383. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  4384. <td>
  4385. <div class="input-group">
  4386. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  4387. </div>
  4388. </td>
  4389. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  4390. <td>
  4391. <div class="input-group">
  4392. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  4393. </div>
  4394. </td>
  4395. <td>
  4396. <label>&nbsp;&nbsp;&nbsp;是否全部生成:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  4397. </td>
  4398. <td>
  4399. <div class="input-group">
  4400. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  4401. <option value="0">显示全部</option>
  4402. <option value="1">已全部生成</option>
  4403. <option value="2" selected="selected">未全部生成</option>
  4404. </select>
  4405. </div>
  4406. </td>
  4407. <td id="GDLX">
  4408. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  4409. </td>
  4410. <td id="GDLX2">
  4411. <div class="input-group">
  4412. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 100px;"></select>
  4413. </div>
  4414. </td>
  4415. @*<td class="GDLX" style="display:none">
  4416. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  4417. </td>
  4418. <td class="GDLX" style="display:none">
  4419. <div class="input-group">
  4420. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  4421. <option value="0">显示全部</option>
  4422. <option value="1">已全部生成</option>
  4423. <option value="2" selected="selected">未全部生成</option>
  4424. </select>
  4425. </div>
  4426. </td>*@
  4427. <td>
  4428. <span class="input-group-btn">
  4429. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  4430. </span>
  4431. </td>
  4432. </tr>
  4433. </table>
  4434. </div>
  4435. </div>
  4436. <div class="gridPanel">
  4437. <table id="gridList"></table>
  4438. <div id="gridPager"></div>
  4439. </div>