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.

4600 lines
238 KiB

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