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.

7139 lines
368 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  6. <script>
  7. debugger;
  8. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location';
  9. var _Clos = new Array();
  10. var Type = $.request("Type");
  11. var mold = $.request("mold");
  12. var Name = "单据号";
  13. var ColModelMain = [];
  14. var ColModelSub = [];
  15. $(function () {
  16. SetCols();
  17. if (Type != '1') {
  18. $("#NF - Prints").css('display', 'none');
  19. $("#NF-btnInWareHouse").css('display', 'none');
  20. }
  21. if (Type != '13' && Type != '9') {
  22. $(".HideItems2").css('display', 'none');
  23. }
  24. if (Type != '1' && Type != '12' && Type != '22' && Type != '23' && Type != '2' && Type != '3' && Type != '24'
  25. && Type != '5' && Type != '203') {
  26. $(".HideItemsTime").css('display', 'none');
  27. }
  28. if (Type != '22' && Type != '23' && Type != '2' && Type != '3' && Type != '24' && Type != '5' && Type != '203') {
  29. $(".HideWH").css('display', 'none');
  30. }
  31. if (Type != '3' && Type != '7' && Type != '8') {
  32. $(".selStatus").css('display', 'none');
  33. }
  34. if (Type != '3') {
  35. $(".HideClassGroup").css('display', 'none');
  36. }
  37. if (Type != '3' && Type != '4' && Type != '5' && Type != '7' && Type != '8' && Type != '22') {
  38. $(".HideItems3").css('display', 'none');
  39. }
  40. if (Type == '17') {
  41. Name = "条码号";
  42. $("#POCodeShowLable").text(Name);
  43. } else {
  44. $("#POCodeShowLable").text(Name);
  45. }
  46. if (Type!='3') {
  47. $("#GDLX").css('display', 'none');
  48. $("#GDLX2").css('display', 'none');
  49. $("#NF-Rebind").css('display', 'none');
  50. }
  51. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9' || Type == '17') {
  52. $(".HideItems").css('display', 'none');
  53. $(".HideItemsVednCode").css('display', 'none');
  54. }
  55. if (Type != "22") {
  56. $(".HideItemsSourceCode").css('display', 'none');
  57. }
  58. if (Type == '1') {
  59. gridList();
  60. }
  61. if (Type == '2') {
  62. gridList2();
  63. }
  64. if (Type == '3') {
  65. $(".GDLX").css('display', 'block');
  66. Select_SelGDLX();
  67. gridList3();
  68. }
  69. if (Type == '4') {
  70. gridList4();
  71. }
  72. if (Type == '5') {
  73. gridList5();
  74. }
  75. if (Type == '6') {
  76. gridList6();
  77. }
  78. //审核到货单生成条码
  79. if (Type == '7') {
  80. gridList7();
  81. }
  82. //审核委外到货单生成条码
  83. if (Type == '8') {
  84. gridList8();
  85. }
  86. //开立成品入库单生成条码
  87. if (Type == '9') {
  88. gridList9();
  89. }
  90. //审核拒收单生成条码
  91. if (Type == '10') {
  92. gridList10();
  93. }
  94. //审核委外拒收单生成条码
  95. if (Type == '11') {
  96. gridList11();
  97. }
  98. //领料申请退料生成条码
  99. if (Type == '12') {
  100. gridList12();
  101. }
  102. //材料出库退料生成条码
  103. if (Type == '13') {
  104. gridList13();
  105. }
  106. //委外领料申请退料生成条码
  107. if (Type == '14') {
  108. gridList14();
  109. }
  110. //委外材料出库退料生成条码
  111. if (Type == '15') {
  112. gridList15();
  113. }
  114. //返工工单
  115. if (Type == '16') {
  116. gridList16();
  117. }
  118. //不合格条码入库
  119. if (Type == '17') {
  120. gridList17();
  121. }
  122. //副产品
  123. if (Type == '18') {
  124. gridList18();
  125. }
  126. //锐腾两步调入生成条码
  127. if (Type == '20') {
  128. gridList20();
  129. }
  130. //采购入库生成条码
  131. if (Type == '22') {
  132. $(".HideItemsVednCode").css('display', 'none');
  133. gridList22();
  134. }
  135. //委外采购入库生成条码
  136. if (Type == '23') {
  137. gridList23();
  138. }
  139. //红字销售出库单
  140. if (Type == '24') {
  141. gridList24();
  142. }
  143. //线边仓调拨申请单生成条码(派纳)
  144. if (Type == '201') {
  145. gridList201();
  146. }
  147. //调拨申请单生成条码
  148. if (Type == '202') {
  149. gridList202();
  150. }
  151. })
  152. function SetCols() {
  153. $.ajax({
  154. url: "/Print/SelectColumnName?" + Math.random(),
  155. dataType: "json",
  156. async: false,
  157. success: function (data) {
  158. var cols = new Array();
  159. var cols1 = new Array();
  160. if (Type == '1') {
  161. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  162. cols.push(collast);
  163. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  164. cols.push(collast);
  165. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  166. cols.push(collast);
  167. var collast = { label: '工单子件', name: 'SourceDetailID', hidden: true, };
  168. cols.push(collast);
  169. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  170. cols.push(collast);
  171. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  172. cols.push(collast);
  173. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  174. cols.push(collast);
  175. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  176. cols.push(collast);
  177. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  178. cols.push(collast);
  179. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  180. cols.push(collast);
  181. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  182. cols.push(collast);
  183. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  184. //cols.push(collast);
  185. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  186. cols.push(collast);
  187. var collast = { label: '工单号', name: 'MOCode', width: 60, align: 'left', };
  188. cols.push(collast);
  189. var collast = { label: '创建日期', name: 'MTIME', width: 60, align: 'left', };
  190. cols.push(collast);
  191. $.ajax({
  192. url: "/Print/SelectTableColumnName?" + Math.random(),
  193. dataType: "json",
  194. async: false,
  195. success: function (data) {
  196. if (data != null && data.length > 0) {
  197. DateList = data;
  198. for (var i = 0; i < data.length; i++) {
  199. var TableCode = data[i].TableCode;
  200. if (TableCode == "ICSMOPick") {
  201. var Code = data[i].Code;
  202. var Name = data[i].Name;
  203. var obj = new Array();
  204. obj = {
  205. label: Name,
  206. name: Code,
  207. width: 80,
  208. align: "left"
  209. }
  210. cols.push(obj);
  211. }
  212. if (TableCode == "ICSInventory") {
  213. var Code = data[i].Code;
  214. var Name = data[i].Name;
  215. var obj = new Array();
  216. obj = {
  217. label: Name,
  218. name: Code,
  219. width: 80,
  220. align: "left"
  221. }
  222. cols.push(obj);
  223. //cols1.push(obj);
  224. }
  225. }
  226. }
  227. _Clos = cols;
  228. //_Clos1 = cols1;
  229. }
  230. });
  231. }
  232. if (Type == '2') {
  233. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  234. cols.push(collast);
  235. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  236. cols.push(collast);
  237. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  238. cols.push(collast);
  239. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  240. cols.push(collast);
  241. var collast = { label: '供应商', name: 'VenName', width: 150, align: 'left' };
  242. cols.push(collast);
  243. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  244. cols.push(collast);
  245. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  246. cols.push(collast);
  247. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  248. cols.push(collast);
  249. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  250. cols.push(collast);
  251. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  252. cols.push(collast);
  253. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  254. cols.push(collast);
  255. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  256. cols.push(collast);
  257. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  258. //cols.push(collast);
  259. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  260. cols.push(collast);
  261. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  262. //cols.push(collast);
  263. $.ajax({
  264. url: "/Print/SelectTableColumnName?" + Math.random(),
  265. dataType: "json",
  266. async: false,
  267. success: function (data) {
  268. if (data != null && data.length > 0) {
  269. DateList = data;
  270. for (var i = 0; i < data.length; i++) {
  271. var TableCode = data[i].TableCode;
  272. if (TableCode == "ICSOApplyNegDetail") {
  273. var Code = data[i].Code;
  274. var Name = data[i].Name;
  275. var obj = new Array();
  276. obj = {
  277. label: Name,
  278. name: Code,
  279. width: 80,
  280. align: "left"
  281. }
  282. cols.push(obj);
  283. }
  284. if (TableCode == "ICSInventory") {
  285. var Code = data[i].Code;
  286. var Name = data[i].Name;
  287. var obj = new Array();
  288. obj = {
  289. label: Name,
  290. name: Code,
  291. width: 80,
  292. align: "left"
  293. }
  294. cols.push(obj);
  295. //cols1.push(obj);
  296. }
  297. }
  298. }
  299. _Clos = cols;
  300. //_Clos1 = cols1;
  301. }
  302. });
  303. }
  304. if (Type == '3') {
  305. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  306. cols.push(collast);
  307. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  308. cols.push(collast);
  309. var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
  310. cols.push(collast);
  311. var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true };
  312. cols.push(collast);
  313. var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
  314. cols.push(collast);
  315. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  316. cols.push(collast);
  317. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  318. cols.push(collast);
  319. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  320. cols.push(collast);
  321. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  322. cols.push(collast);
  323. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  324. cols.push(collast);
  325. var collast = { label: '仓库编码', name: 'WHCode', width: 150, align: 'left' };
  326. cols.push(collast);
  327. var collast = { label: '仓库名称', name: 'WHName', width: 150, align: 'left' };
  328. cols.push(collast);
  329. var collast = { label: '工单部门', name: 'DepName', width: 100, align: 'left' };
  330. cols.push(collast);
  331. var collast = { label: '工单创建日期', name: 'CreateDateTime', width: 60, align: 'left', };
  332. cols.push(collast);
  333. var collast = {
  334. label: "状态", name: "MOStatus", width: 60, align: "left",
  335. formatter: function (cellvalue) {
  336. if (cellvalue == "1") {
  337. return "初始";
  338. } else if (cellvalue == "2") {
  339. return "下发";
  340. }
  341. else if (cellvalue == "3") {
  342. return "关单";
  343. }
  344. else { return ""; }
  345. }
  346. };
  347. cols.push(collast);
  348. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  349. cols.push(collast);
  350. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  351. cols.push(collast);
  352. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  353. //cols.push(collast);
  354. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  355. cols.push(collast);
  356. var collast = { label: '已入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  357. cols.push(collast);
  358. var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' };
  359. cols.push(collast);
  360. var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' };
  361. cols.push(collast);
  362. $.ajax({
  363. url: "/Print/SelectTableColumnName?" + Math.random(),
  364. dataType: "json",
  365. async: false,
  366. success: function (data) {
  367. if (data != null && data.length > 0) {
  368. DateList = data;
  369. for (var i = 0; i < data.length; i++) {
  370. var TableCode = data[i].TableCode;
  371. if (TableCode == "ICSMO") {
  372. var Code = data[i].Code;
  373. var Name = data[i].Name;
  374. var obj = new Array();
  375. obj = {
  376. label: Name,
  377. name: Code,
  378. width: 80,
  379. align: "left"
  380. }
  381. cols.push(obj);
  382. }
  383. if (TableCode == "ICSInventory") {
  384. var Code = data[i].Code;
  385. var Name = data[i].Name;
  386. var obj = new Array();
  387. obj = {
  388. label: Name,
  389. name: Code,
  390. width: 80,
  391. align: "left"
  392. }
  393. cols.push(obj);
  394. //cols1.push(obj);
  395. }
  396. }
  397. }
  398. _Clos = cols;
  399. //_Clos1 = cols1;
  400. }
  401. });
  402. }
  403. if (Type == '4') {
  404. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  405. cols.push(collast);
  406. var collast = { label: '单据号', name: 'SDNCode', width: 120, align: 'left' };
  407. cols.push(collast);
  408. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  409. cols.push(collast);
  410. var collast = { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' };
  411. cols.push(collast);
  412. var collast = { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' };
  413. cols.push(collast);
  414. var collast = { label: '客户代码', name: 'CusCode', width: 120, align: 'left' };
  415. cols.push(collast);
  416. var collast = { label: '客户名称', name: 'CusName', width: 50, align: 'left' };
  417. cols.push(collast);
  418. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  419. cols.push(collast);
  420. var collast = { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' };
  421. cols.push(collast);
  422. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  423. cols.push(collast);
  424. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  425. cols.push(collast);
  426. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  427. cols.push(collast);
  428. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  429. cols.push(collast);
  430. var collast = {
  431. label: "状态", name: "Status", width: 60, align: "left",
  432. formatter: function (cellvalue) {
  433. if (cellvalue == "1") {
  434. return "开立";
  435. } else if (cellvalue == "2") {
  436. return "审核";
  437. }
  438. else if (cellvalue == "3") {
  439. return "关闭";
  440. }
  441. else { return ""; }
  442. }
  443. };
  444. cols.push(collast);
  445. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  446. cols.push(collast);
  447. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  448. cols.push(collast);
  449. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  450. //cols.push(collast);
  451. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  452. cols.push(collast);
  453. $.ajax({
  454. url: "/Print/SelectTableColumnName?" + Math.random(),
  455. dataType: "json",
  456. async: false,
  457. success: function (data) {
  458. if (data != null && data.length > 0) {
  459. DateList = data;
  460. for (var i = 0; i < data.length; i++) {
  461. var TableCode = data[i].TableCode;
  462. if (TableCode == "ICSSDN") {
  463. var Code = data[i].Code;
  464. var Name = data[i].Name;
  465. var obj = new Array();
  466. obj = {
  467. label: Name,
  468. name: Code,
  469. width: 80,
  470. align: "left"
  471. }
  472. cols.push(obj);
  473. }
  474. if (TableCode == "ICSInventory") {
  475. var Code = data[i].Code;
  476. var Name = data[i].Name;
  477. var obj = new Array();
  478. obj = {
  479. label: Name,
  480. name: Code,
  481. width: 80,
  482. align: "left"
  483. }
  484. cols.push(obj);
  485. //cols1.push(obj);
  486. }
  487. }
  488. }
  489. _Clos = cols;
  490. //_Clos1 = cols1;
  491. }
  492. });
  493. }
  494. if (Type == '5') {
  495. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  496. cols.push(collast);
  497. var collast = { label: '单据号', name: 'InCode', width: 120, align: 'left' };
  498. cols.push(collast);
  499. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  500. cols.push(collast);
  501. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  502. cols.push(collast);
  503. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  504. cols.push(collast);
  505. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  506. cols.push(collast);
  507. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  508. cols.push(collast);
  509. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  510. cols.push(collast);
  511. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  512. cols.push(collast);
  513. var collast = { label: '收益部门', name: 'EATTRIBUTE4', width: 50, align: 'left' };
  514. cols.push(collast);
  515. var collast = { label: '供应商', name: 'EATTRIBUTE3', width: 50, align: 'left' };
  516. cols.push(collast);
  517. var collast = { label: '项目名称', name: 'EATTRIBUTE8', width: 50, align: 'left' };
  518. cols.push(collast);
  519. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  520. cols.push(collast);
  521. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  522. cols.push(collast);
  523. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  524. cols.push(collast);
  525. var collast = { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', };
  526. cols.push(collast);
  527. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  528. cols.push(collast);
  529. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  530. cols.push(collast);
  531. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  532. //cols.push(collast);
  533. $.ajax({
  534. url: "/Print/SelectTableColumnName?" + Math.random(),
  535. dataType: "json",
  536. async: false,
  537. success: function (data) {
  538. if (data != null && data.length > 0) {
  539. DateList = data;
  540. for (var i = 0; i < data.length; i++) {
  541. var TableCode = data[i].TableCode;
  542. if (TableCode == "ICSOtherIn") {
  543. var Code = data[i].Code;
  544. var Name = data[i].Name;
  545. var obj = new Array();
  546. obj = {
  547. label: Name,
  548. name: Code,
  549. width: 80,
  550. align: "left"
  551. }
  552. cols.push(obj);
  553. }
  554. if (TableCode == "ICSInventory") {
  555. var Code = data[i].Code;
  556. var Name = data[i].Name;
  557. var obj = new Array();
  558. obj = {
  559. label: Name,
  560. name: Code,
  561. width: 80,
  562. align: "left"
  563. }
  564. cols.push(obj);
  565. //cols1.push(obj);
  566. }
  567. }
  568. }
  569. _Clos = cols;
  570. //_Clos1 = cols1;
  571. }
  572. });
  573. }
  574. if (Type == '6') {
  575. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  576. cols.push(collast);
  577. var collast = { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' };
  578. cols.push(collast);
  579. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  580. cols.push(collast);
  581. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  582. cols.push(collast);
  583. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  584. cols.push(collast);
  585. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  586. cols.push(collast);
  587. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  588. cols.push(collast);
  589. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  590. cols.push(collast);
  591. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  592. cols.push(collast);
  593. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  594. cols.push(collast);
  595. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  596. cols.push(collast);
  597. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  598. cols.push(collast);
  599. var collast = { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', };
  600. cols.push(collast);
  601. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  602. cols.push(collast);
  603. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  604. cols.push(collast);
  605. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  606. //cols.push(collast);
  607. $.ajax({
  608. url: "/Print/SelectTableColumnName?" + Math.random(),
  609. dataType: "json",
  610. async: false,
  611. success: function (data) {
  612. if (data != null && data.length > 0) {
  613. DateList = data;
  614. for (var i = 0; i < data.length; i++) {
  615. var TableCode = data[i].TableCode;
  616. if (TableCode == "ICSReturn") {
  617. var Code = data[i].Code;
  618. var Name = data[i].Name;
  619. var obj = new Array();
  620. obj = {
  621. label: Name,
  622. name: Code,
  623. width: 80,
  624. align: "left"
  625. }
  626. cols.push(obj);
  627. }
  628. if (TableCode == "ICSInventory") {
  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. //cols1.push(obj);
  640. }
  641. }
  642. }
  643. _Clos = cols;
  644. //_Clos1 = cols1;
  645. }
  646. });
  647. }
  648. //审核到货单生成条码
  649. if (Type == '7') {
  650. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  651. cols.push(collast);
  652. var collast = { label: '单据号', name: 'DNCode', width: 120, align: 'left' };
  653. cols.push(collast);
  654. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  655. cols.push(collast);
  656. var collast = { label: '采购订单号', name: 'POCode', width: 50, align: 'left' };
  657. cols.push(collast);
  658. var collast = { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' };
  659. cols.push(collast);
  660. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  661. cols.push(collast);
  662. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  663. cols.push(collast);
  664. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  665. cols.push(collast);
  666. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  667. cols.push(collast);
  668. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  669. cols.push(collast);
  670. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  671. cols.push(collast);
  672. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  673. cols.push(collast);
  674. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  675. cols.push(collast);
  676. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  677. cols.push(collast);
  678. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  679. //cols.push(collast);
  680. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  681. cols.push(collast);
  682. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  683. cols.push(collast);
  684. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  685. cols.push(collast);
  686. var collast = { label: '未入库数量', name: 'NRCVQuantity', width: 60, align: 'left', };
  687. cols.push(collast);
  688. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  689. cols.push(collast);
  690. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  691. cols.push(collast);
  692. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  693. cols.push(collast);
  694. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  695. cols.push(collast);
  696. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  697. cols.push(collast);
  698. $.ajax({
  699. url: "/Print/SelectTableColumnName?" + Math.random(),
  700. dataType: "json",
  701. async: false,
  702. success: function (data) {
  703. if (data != null && data.length > 0) {
  704. DateList = data;
  705. for (var i = 0; i < data.length; i++) {
  706. var TableCode = data[i].TableCode;
  707. if (TableCode == "ICSDeliveryNotice") {
  708. debugger;
  709. var Code = data[i].Code;
  710. var Name = data[i].Name;
  711. var obj = new Array();
  712. obj = {
  713. label: Name,
  714. name: Code,
  715. width: 80,
  716. align: "left"
  717. }
  718. cols.push(obj);
  719. }
  720. if (TableCode == "ICSInventory") {
  721. var Code = data[i].Code;
  722. var Name = data[i].Name;
  723. var obj = new Array();
  724. obj = {
  725. label: Name,
  726. name: Code,
  727. width: 80,
  728. align: "left"
  729. }
  730. cols.push(obj);
  731. //cols1.push(obj);
  732. }
  733. }
  734. }
  735. _Clos = cols;
  736. //_Clos1 = cols1;
  737. }
  738. });
  739. }
  740. //审核委外到货单生成条码
  741. if (Type == '8') {
  742. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  743. cols.push(collast);
  744. var collast = { label: '单据号', name: 'ODNCode', width: 120, align: 'left' };
  745. cols.push(collast);
  746. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  747. cols.push(collast);
  748. var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  749. cols.push(collast);
  750. var collast = { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' };
  751. cols.push(collast);
  752. var collast = { label: '委外订单表体ID', name: 'OODetailID', hidden: true };
  753. cols.push(collast);
  754. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  755. cols.push(collast);
  756. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  757. cols.push(collast);
  758. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  759. cols.push(collast);
  760. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  761. cols.push(collast);
  762. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  763. cols.push(collast);
  764. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  765. cols.push(collast);
  766. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  767. cols.push(collast);
  768. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  769. cols.push(collast);
  770. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  771. cols.push(collast);
  772. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  773. //cols.push(collast);
  774. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  775. cols.push(collast);
  776. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  777. cols.push(collast);
  778. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  779. cols.push(collast);
  780. var collast = { label: '未入库数量', name: 'NRCVQuantity', width: 60, align: 'left', };
  781. cols.push(collast);
  782. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  783. cols.push(collast);
  784. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  785. cols.push(collast);
  786. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  787. cols.push(collast);
  788. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  789. cols.push(collast);
  790. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  791. cols.push(collast);
  792. $.ajax({
  793. url: "/Print/SelectTableColumnName?" + Math.random(),
  794. dataType: "json",
  795. async: false,
  796. success: function (data) {
  797. if (data != null && data.length > 0) {
  798. DateList = data;
  799. for (var i = 0; i < data.length; i++) {
  800. var TableCode = data[i].TableCode;
  801. if (TableCode == "ICSODeliveryNotice") {
  802. var Code = data[i].Code;
  803. var Name = data[i].Name;
  804. var obj = new Array();
  805. obj = {
  806. label: Name,
  807. name: Code,
  808. width: 80,
  809. align: "left"
  810. }
  811. cols.push(obj);
  812. }
  813. if (TableCode == "ICSInventory") {
  814. var Code = data[i].Code;
  815. var Name = data[i].Name;
  816. var obj = new Array();
  817. obj = {
  818. label: Name,
  819. name: Code,
  820. width: 80,
  821. align: "left"
  822. }
  823. cols.push(obj);
  824. //cols1.push(obj);
  825. }
  826. }
  827. }
  828. _Clos = cols;
  829. //_Clos1 = cols1;
  830. }
  831. });
  832. }
  833. //开立成品入库单生成条码
  834. if (Type == '9') {
  835. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  836. cols.push(collast);
  837. var collast = { label: '单据号', name: 'RCVCode', width: 120, align: 'left' };
  838. cols.push(collast);
  839. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  840. cols.push(collast);
  841. var collast = { label: '源头单据号', name: 'MOCode', width: 50, align: 'left' };
  842. cols.push(collast);
  843. var collast = { label: '仓库号', name: 'WHCode', width: 120, align: 'left' };
  844. cols.push(collast);
  845. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  846. cols.push(collast);
  847. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  848. cols.push(collast);
  849. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  850. cols.push(collast);
  851. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  852. cols.push(collast);
  853. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  854. cols.push(collast);
  855. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  856. cols.push(collast);
  857. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  858. //cols.push(collast);
  859. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  860. cols.push(collast);
  861. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  862. cols.push(collast);
  863. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  864. cols.push(collast);
  865. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  866. cols.push(collast);
  867. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  868. cols.push(collast);
  869. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  870. cols.push(collast);
  871. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  872. cols.push(collast);
  873. $.ajax({
  874. url: "/Print/SelectTableColumnName?" + Math.random(),
  875. dataType: "json",
  876. async: false,
  877. success: function (data) {
  878. if (data != null && data.length > 0) {
  879. DateList = data;
  880. for (var i = 0; i < data.length; i++) {
  881. var TableCode = data[i].TableCode;
  882. if (TableCode == "ICSMO") {
  883. var Code = data[i].Code;
  884. var Name = data[i].Name;
  885. var obj = new Array();
  886. obj = {
  887. label: Name,
  888. name: Code,
  889. width: 80,
  890. align: "left"
  891. }
  892. cols.push(obj);
  893. }
  894. if (TableCode == "ICSInventory") {
  895. var Code = data[i].Code;
  896. var Name = data[i].Name;
  897. var obj = new Array();
  898. obj = {
  899. label: Name,
  900. name: Code,
  901. width: 80,
  902. align: "left"
  903. }
  904. cols.push(obj);
  905. //cols1.push(obj);
  906. }
  907. }
  908. }
  909. _Clos = cols;
  910. //_Clos1 = cols1;
  911. }
  912. });
  913. }
  914. //审核拒收单生成条码
  915. if (Type == '10') {
  916. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  917. cols.push(collast);
  918. var collast = { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' };
  919. cols.push(collast);
  920. var collast = { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' };
  921. cols.push(collast);
  922. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  923. cols.push(collast);
  924. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  925. cols.push(collast);
  926. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  927. cols.push(collast);
  928. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  929. cols.push(collast);
  930. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  931. cols.push(collast);
  932. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  933. cols.push(collast);
  934. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  935. cols.push(collast);
  936. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  937. cols.push(collast);
  938. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  939. cols.push(collast);
  940. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  941. cols.push(collast);
  942. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  943. cols.push(collast);
  944. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  945. cols.push(collast);
  946. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  947. cols.push(collast);
  948. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  949. cols.push(collast);
  950. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  951. cols.push(collast);
  952. $.ajax({
  953. url: "/Print/SelectTableColumnName?" + Math.random(),
  954. dataType: "json",
  955. async: false,
  956. success: function (data) {
  957. if (data != null && data.length > 0) {
  958. DateList = data;
  959. for (var i = 0; i < data.length; i++) {
  960. var TableCode = data[i].TableCode;
  961. if (TableCode == "ICSDeliveryNotice") {
  962. var Code = data[i].Code;
  963. var Name = data[i].Name;
  964. var obj = new Array();
  965. obj = {
  966. label: Name,
  967. name: Code,
  968. width: 80,
  969. align: "left"
  970. }
  971. cols.push(obj);
  972. }
  973. if (TableCode == "ICSInventory") {
  974. var Code = data[i].Code;
  975. var Name = data[i].Name;
  976. var obj = new Array();
  977. obj = {
  978. label: Name,
  979. name: Code,
  980. width: 80,
  981. align: "left"
  982. }
  983. cols.push(obj);
  984. //cols1.push(obj);
  985. }
  986. }
  987. }
  988. _Clos = cols;
  989. //_Clos1 = cols1;
  990. }
  991. });
  992. }
  993. //审核委外拒收单生成条码
  994. if (Type == '11') {
  995. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  996. cols.push(collast);
  997. var collast = { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' };
  998. cols.push(collast);
  999. var collast = { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' };
  1000. cols.push(collast);
  1001. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  1002. cols.push(collast);
  1003. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  1004. cols.push(collast);
  1005. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1006. cols.push(collast);
  1007. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  1008. cols.push(collast);
  1009. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  1010. cols.push(collast);
  1011. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  1012. cols.push(collast);
  1013. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  1014. cols.push(collast);
  1015. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1016. cols.push(collast);
  1017. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1018. cols.push(collast);
  1019. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  1020. cols.push(collast);
  1021. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1022. cols.push(collast);
  1023. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  1024. cols.push(collast);
  1025. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  1026. cols.push(collast);
  1027. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  1028. cols.push(collast);
  1029. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  1030. cols.push(collast);
  1031. $.ajax({
  1032. url: "/Print/SelectTableColumnName?" + Math.random(),
  1033. dataType: "json",
  1034. async: false,
  1035. success: function (data) {
  1036. if (data != null && data.length > 0) {
  1037. DateList = data;
  1038. for (var i = 0; i < data.length; i++) {
  1039. var TableCode = data[i].TableCode;
  1040. if (TableCode == "ICSODeliveryNotice") {
  1041. var Code = data[i].Code;
  1042. var Name = data[i].Name;
  1043. var obj = new Array();
  1044. obj = {
  1045. label: Name,
  1046. name: Code,
  1047. width: 80,
  1048. align: "left"
  1049. }
  1050. cols.push(obj);
  1051. }
  1052. if (TableCode == "ICSInventory") {
  1053. var Code = data[i].Code;
  1054. var Name = data[i].Name;
  1055. var obj = new Array();
  1056. obj = {
  1057. label: Name,
  1058. name: Code,
  1059. width: 80,
  1060. align: "left"
  1061. }
  1062. cols.push(obj);
  1063. //cols1.push(obj);
  1064. }
  1065. }
  1066. }
  1067. _Clos = cols;
  1068. //_Clos1 = cols1;
  1069. }
  1070. });
  1071. }
  1072. //领料申请退料生成条码
  1073. if (Type == '12') {
  1074. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1075. cols.push(collast);
  1076. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  1077. cols.push(collast);
  1078. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1079. cols.push(collast);
  1080. var collast = { label: '来源单据号', name: 'SourceCodea', width: 120, align: 'left' };
  1081. cols.push(collast);
  1082. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  1083. cols.push(collast);
  1084. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1085. cols.push(collast);
  1086. var collast = { label: '料品编码', name: 'InvName', width: 150, align: 'left', };
  1087. cols.push(collast);
  1088. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1089. cols.push(collast);
  1090. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1091. cols.push(collast);
  1092. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1093. cols.push(collast);
  1094. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1095. cols.push(collast);
  1096. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1097. cols.push(collast);
  1098. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1099. //cols.push(collast);
  1100. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1101. cols.push(collast);
  1102. $.ajax({
  1103. url: "/Print/SelectTableColumnName?" + Math.random(),
  1104. dataType: "json",
  1105. async: false,
  1106. success: function (data) {
  1107. if (data != null && data.length > 0) {
  1108. DateList = data;
  1109. for (var i = 0; i < data.length; i++) {
  1110. var TableCode = data[i].TableCode;
  1111. if (TableCode == "ICSMOApplyNegDetail") {
  1112. var Code = data[i].Code;
  1113. var Name = data[i].Name;
  1114. var obj = new Array();
  1115. obj = {
  1116. label: Name,
  1117. name: Code,
  1118. width: 80,
  1119. align: "left"
  1120. }
  1121. cols.push(obj);
  1122. }
  1123. if (TableCode == "ICSInventory") {
  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. //cols1.push(obj);
  1135. }
  1136. }
  1137. }
  1138. _Clos = cols;
  1139. //_Clos1 = cols1;
  1140. }
  1141. });
  1142. }
  1143. //材料出库退料生成条码
  1144. if (Type == '13') {
  1145. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1146. cols.push(collast);
  1147. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  1148. cols.push(collast);
  1149. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1150. cols.push(collast);
  1151. var collast = { label: '源头单据号', name: 'SCode', width: 120, align: 'left' };
  1152. cols.push(collast);
  1153. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  1154. cols.push(collast);
  1155. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1156. cols.push(collast);
  1157. var collast = { label: '料品编码', name: 'InvName', width: 150, align: 'left', };
  1158. cols.push(collast);
  1159. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1160. cols.push(collast);
  1161. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1162. cols.push(collast);
  1163. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1164. cols.push(collast);
  1165. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1166. cols.push(collast);
  1167. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1168. cols.push(collast);
  1169. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1170. //cols.push(collast);
  1171. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1172. cols.push(collast);
  1173. }
  1174. //委外领料申请退料生成条码
  1175. if (Type == '14') {
  1176. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1177. cols.push(collast);
  1178. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1179. cols.push(collast);
  1180. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1181. cols.push(collast);
  1182. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1183. cols.push(collast);
  1184. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1185. cols.push(collast);
  1186. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1187. cols.push(collast);
  1188. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1189. cols.push(collast);
  1190. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1191. cols.push(collast);
  1192. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1193. cols.push(collast);
  1194. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1195. cols.push(collast);
  1196. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1197. cols.push(collast);
  1198. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1199. //cols.push(collast);
  1200. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1201. cols.push(collast);
  1202. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1203. //cols.push(collast);
  1204. $.ajax({
  1205. url: "/Print/SelectTableColumnName?" + Math.random(),
  1206. dataType: "json",
  1207. async: false,
  1208. success: function (data) {
  1209. if (data != null && data.length > 0) {
  1210. DateList = data;
  1211. for (var i = 0; i < data.length; i++) {
  1212. var TableCode = data[i].TableCode;
  1213. if (TableCode == "ICSOApplyNegDetail") {
  1214. var Code = data[i].Code;
  1215. var Name = data[i].Name;
  1216. var obj = new Array();
  1217. obj = {
  1218. label: Name,
  1219. name: Code,
  1220. width: 80,
  1221. align: "left"
  1222. }
  1223. cols.push(obj);
  1224. }
  1225. if (TableCode == "ICSInventory") {
  1226. var Code = data[i].Code;
  1227. var Name = data[i].Name;
  1228. var obj = new Array();
  1229. obj = {
  1230. label: Name,
  1231. name: Code,
  1232. width: 80,
  1233. align: "left"
  1234. }
  1235. cols.push(obj);
  1236. //cols1.push(obj);
  1237. }
  1238. }
  1239. }
  1240. _Clos = cols;
  1241. //_Clos1 = cols1;
  1242. }
  1243. });
  1244. }
  1245. //委外材料出库退料生成条码
  1246. if (Type == '15') {
  1247. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1248. cols.push(collast);
  1249. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  1250. cols.push(collast);
  1251. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  1252. cols.push(collast);
  1253. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  1254. cols.push(collast);
  1255. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1256. cols.push(collast);
  1257. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1258. cols.push(collast);
  1259. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1260. cols.push(collast);
  1261. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1262. cols.push(collast);
  1263. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  1264. cols.push(collast);
  1265. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1266. cols.push(collast);
  1267. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1268. cols.push(collast);
  1269. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1270. //cols.push(collast);
  1271. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1272. cols.push(collast);
  1273. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1274. //cols.push(collast);
  1275. $.ajax({
  1276. url: "/Print/SelectTableColumnName?" + Math.random(),
  1277. dataType: "json",
  1278. async: false,
  1279. success: function (data) {
  1280. if (data != null && data.length > 0) {
  1281. DateList = data;
  1282. for (var i = 0; i < data.length; i++) {
  1283. var TableCode = data[i].TableCode;
  1284. if (TableCode == "ICSOApplyNegDetail") {
  1285. var Code = data[i].Code;
  1286. var Name = data[i].Name;
  1287. var obj = new Array();
  1288. obj = {
  1289. label: Name,
  1290. name: Code,
  1291. width: 80,
  1292. align: "left"
  1293. }
  1294. cols.push(obj);
  1295. }
  1296. if (TableCode == "ICSInventory") {
  1297. var Code = data[i].Code;
  1298. var Name = data[i].Name;
  1299. var obj = new Array();
  1300. obj = {
  1301. label: Name,
  1302. name: Code,
  1303. width: 80,
  1304. align: "left"
  1305. }
  1306. cols.push(obj);
  1307. //cols1.push(obj);
  1308. }
  1309. }
  1310. }
  1311. _Clos = cols;
  1312. //_Clos1 = cols1;
  1313. }
  1314. });
  1315. }
  1316. //返工工单生成条码
  1317. if (Type == '16') {
  1318. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1319. cols.push(collast);
  1320. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1321. cols.push(collast);
  1322. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1323. cols.push(collast);
  1324. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1325. cols.push(collast);
  1326. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1327. cols.push(collast);
  1328. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1329. cols.push(collast);
  1330. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1331. cols.push(collast);
  1332. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1333. cols.push(collast);
  1334. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1335. cols.push(collast);
  1336. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1337. cols.push(collast);
  1338. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1339. cols.push(collast);
  1340. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1341. //cols.push(collast);
  1342. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1343. cols.push(collast);
  1344. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1345. //cols.push(collast);
  1346. $.ajax({
  1347. url: "/Print/SelectTableColumnName?" + Math.random(),
  1348. dataType: "json",
  1349. async: false,
  1350. success: function (data) {
  1351. if (data != null && data.length > 0) {
  1352. DateList = data;
  1353. for (var i = 0; i < data.length; i++) {
  1354. var TableCode = data[i].TableCode;
  1355. if (TableCode == "ICSMOPick") {
  1356. var Code = data[i].Code;
  1357. var Name = data[i].Name;
  1358. var obj = new Array();
  1359. obj = {
  1360. label: Name,
  1361. name: Code,
  1362. width: 80,
  1363. align: "left"
  1364. }
  1365. cols.push(obj);
  1366. }
  1367. if (TableCode == "ICSInventory") {
  1368. var Code = data[i].Code;
  1369. var Name = data[i].Name;
  1370. var obj = new Array();
  1371. obj = {
  1372. label: Name,
  1373. name: Code,
  1374. width: 80,
  1375. align: "left"
  1376. }
  1377. cols.push(obj);
  1378. //cols1.push(obj);
  1379. }
  1380. }
  1381. }
  1382. _Clos = cols;
  1383. //_Clos1 = cols1;
  1384. }
  1385. });
  1386. }
  1387. //不合格条码生成条码
  1388. if (Type == '17') {
  1389. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1390. cols.push(collast);
  1391. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  1392. cols.push(collast);
  1393. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1394. cols.push(collast);
  1395. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1396. cols.push(collast);
  1397. var collast = { label: '不合格数量', name: 'Quantity', width: 100, align: 'left' };
  1398. cols.push(collast);
  1399. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1400. cols.push(collast);
  1401. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1402. cols.push(collast);
  1403. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1404. cols.push(collast);
  1405. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1406. //cols.push(collast);
  1407. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1408. cols.push(collast);
  1409. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1410. //cols.push(collast);
  1411. $.ajax({
  1412. url: "/Print/SelectTableColumnName?" + Math.random(),
  1413. dataType: "json",
  1414. async: false,
  1415. success: function (data) {
  1416. if (data != null && data.length > 0) {
  1417. DateList = data;
  1418. for (var i = 0; i < data.length; i++) {
  1419. var TableCode = data[i].TableCode;
  1420. if (TableCode == "ICSInspection") {
  1421. var Code = data[i].Code;
  1422. var Name = data[i].Name;
  1423. var obj = new Array();
  1424. obj = {
  1425. label: Name,
  1426. name: Code,
  1427. width: 80,
  1428. align: "left"
  1429. }
  1430. cols.push(obj);
  1431. }
  1432. if (TableCode == "ICSInventory") {
  1433. var Code = data[i].Code;
  1434. var Name = data[i].Name;
  1435. var obj = new Array();
  1436. obj = {
  1437. label: Name,
  1438. name: Code,
  1439. width: 80,
  1440. align: "left"
  1441. }
  1442. cols.push(obj);
  1443. //cols1.push(obj);
  1444. }
  1445. }
  1446. }
  1447. _Clos = cols;
  1448. //_Clos1 = cols1;
  1449. }
  1450. });
  1451. }
  1452. //副产品生成条码
  1453. if (Type == '18') {
  1454. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1455. cols.push(collast);
  1456. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  1457. cols.push(collast);
  1458. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  1459. cols.push(collast);
  1460. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  1461. cols.push(collast);
  1462. var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 120, align: 'left' };
  1463. cols.push(collast);
  1464. var collast = { label: '料品编码(母)', name: 'MInvCode', width: 120, align: 'left' };
  1465. cols.push(collast);
  1466. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1467. cols.push(collast);
  1468. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1469. cols.push(collast);
  1470. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1471. cols.push(collast);
  1472. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  1473. cols.push(collast);
  1474. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1475. cols.push(collast);
  1476. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1477. cols.push(collast);
  1478. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1479. //cols.push(collast);
  1480. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1481. cols.push(collast);
  1482. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1483. //cols.push(collast);
  1484. $.ajax({
  1485. url: "/Print/SelectTableColumnName?" + Math.random(),
  1486. dataType: "json",
  1487. async: false,
  1488. success: function (data) {
  1489. if (data != null && data.length > 0) {
  1490. DateList = data;
  1491. for (var i = 0; i < data.length; i++) {
  1492. var TableCode = data[i].TableCode;
  1493. if (TableCode == "ICSMOPick") {
  1494. var Code = data[i].Code;
  1495. var Name = data[i].Name;
  1496. var obj = new Array();
  1497. obj = {
  1498. label: Name,
  1499. name: Code,
  1500. width: 80,
  1501. align: "left"
  1502. }
  1503. cols.push(obj);
  1504. }
  1505. if (TableCode == "ICSInventory") {
  1506. var Code = data[i].Code;
  1507. var Name = data[i].Name;
  1508. var obj = new Array();
  1509. obj = {
  1510. label: Name,
  1511. name: Code,
  1512. width: 80,
  1513. align: "left"
  1514. }
  1515. cols.push(obj);
  1516. //cols1.push(obj);
  1517. }
  1518. }
  1519. }
  1520. _Clos = cols;
  1521. //_Clos1 = cols1;
  1522. }
  1523. });
  1524. }
  1525. //锐腾两步调入生成条码
  1526. if (Type == '20') {
  1527. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1528. cols.push(collast);
  1529. var collast = { label: '调拨单号', name: 'TransferNO', width: 120, align: 'left' };
  1530. cols.push(collast);
  1531. var collast = { label: '调拨单行号', name: 'Sequence', width: 50, align: 'left' };
  1532. cols.push(collast);
  1533. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1534. cols.push(collast);
  1535. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1536. cols.push(collast);
  1537. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1538. cols.push(collast);
  1539. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1540. cols.push(collast);
  1541. var collast = { label: '已调入数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1542. cols.push(collast);
  1543. var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
  1544. cols.push(collast);
  1545. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  1546. cols.push(collast);
  1547. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1548. //cols.push(collast);
  1549. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1550. cols.push(collast);
  1551. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1552. //cols.push(collast);
  1553. $.ajax({
  1554. url: "/Print/SelectTableColumnName?" + Math.random(),
  1555. dataType: "json",
  1556. async: false,
  1557. success: function (data) {
  1558. if (data != null && data.length > 0) {
  1559. DateList = data;
  1560. for (var i = 0; i < data.length; i++) {
  1561. var TableCode = data[i].TableCode;
  1562. if (TableCode == "ICSMOPick") {
  1563. var Code = data[i].Code;
  1564. var Name = data[i].Name;
  1565. var obj = new Array();
  1566. obj = {
  1567. label: Name,
  1568. name: Code,
  1569. width: 80,
  1570. align: "left"
  1571. }
  1572. cols.push(obj);
  1573. }
  1574. if (TableCode == "ICSInventory") {
  1575. var Code = data[i].Code;
  1576. var Name = data[i].Name;
  1577. var obj = new Array();
  1578. obj = {
  1579. label: Name,
  1580. name: Code,
  1581. width: 80,
  1582. align: "left"
  1583. }
  1584. cols.push(obj);
  1585. //cols1.push(obj);
  1586. }
  1587. }
  1588. }
  1589. _Clos = cols;
  1590. //_Clos1 = cols1;
  1591. }
  1592. });
  1593. }
  1594. //采购入库生成条码
  1595. if (Type == '22') {
  1596. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1597. cols.push(collast);
  1598. var collast = { label: '入库单号', name: 'RCVCode', width: 120, align: 'left' };
  1599. cols.push(collast);
  1600. var collast = { label: '入库单行号', name: 'Sequence', width: 50, align: 'left' };
  1601. cols.push(collast);
  1602. var collast = { label: '采购订单号', name: 'POCode', width: 50, align: 'left' };
  1603. cols.push(collast);
  1604. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1605. cols.push(collast);
  1606. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1607. cols.push(collast);
  1608. var collast = { label: '规格型号', name: 'InvStd', width: 150, align: 'left', };
  1609. cols.push(collast);
  1610. var collast = { label: '厂商料号', name: 'ManufacturerInvCode', width: 150, align: 'left', };
  1611. cols.push(collast);
  1612. var collast = { label: '供应商', name: 'EATTRIBUTE3', width: 150, align: 'left', };
  1613. cols.push(collast);
  1614. var collast = { label: '供应商批号', name: 'SupplierBatch', width: 150, align: 'left', };
  1615. cols.push(collast);
  1616. var collast = { label: '采购员', name: 'F_RealName', width: 150, align: 'left', };
  1617. cols.push(collast);
  1618. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1619. cols.push(collast);
  1620. var collast = { label: '最小包装量', name: 'MPQ', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1621. cols.push(collast);
  1622. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1623. cols.push(collast);
  1624. var collast = { label: '已入数量', name: 'RCVQuantity', width: 100, align: 'left' };
  1625. cols.push(collast);
  1626. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1627. //cols.push(collast);
  1628. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1629. cols.push(collast);
  1630. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1631. //cols.push(collast);
  1632. $.ajax({
  1633. url: "/Print/SelectTableColumnName?" + Math.random(),
  1634. dataType: "json",
  1635. async: false,
  1636. success: function (data) {
  1637. if (data != null && data.length > 0) {
  1638. DateList = data;
  1639. for (var i = 0; i < data.length; i++) {
  1640. var TableCode = data[i].TableCode;
  1641. if (TableCode == "ICSPurchaseReceive") {
  1642. var Code = data[i].Code;
  1643. var Name = data[i].Name;
  1644. var obj = new Array();
  1645. obj = {
  1646. label: Name,
  1647. name: Code,
  1648. width: 80,
  1649. align: "left"
  1650. }
  1651. cols.push(obj);
  1652. }
  1653. if (TableCode == "ICSInventory") {
  1654. var Code = data[i].Code;
  1655. var Name = data[i].Name;
  1656. var obj = new Array();
  1657. obj = {
  1658. label: Name,
  1659. name: Code,
  1660. width: 80,
  1661. align: "left"
  1662. }
  1663. cols.push(obj);
  1664. //cols1.push(obj);
  1665. }
  1666. }
  1667. }
  1668. _Clos = cols;
  1669. //_Clos1 = cols1;
  1670. }
  1671. });
  1672. }
  1673. //采购入库生成条码
  1674. if (Type == '23') {
  1675. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1676. cols.push(collast);
  1677. var collast = { label: '委外入库单号', name: 'RCVCode', width: 120, align: 'left' };
  1678. cols.push(collast);
  1679. var collast = { label: '委外入库单行号', name: 'Sequence', width: 50, align: 'left' };
  1680. cols.push(collast);
  1681. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1682. cols.push(collast);
  1683. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1684. cols.push(collast);
  1685. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1686. cols.push(collast);
  1687. //var collast = { label: '最小包装量', name: 'minPackQty', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1688. //cols.push(collast);
  1689. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1690. cols.push(collast);
  1691. var collast = { label: '已入数量', name: 'RCVQuantity', width: 100, align: 'left' };
  1692. cols.push(collast);
  1693. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1694. //cols.push(collast);
  1695. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1696. cols.push(collast);
  1697. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1698. //cols.push(collast);
  1699. $.ajax({
  1700. url: "/Print/SelectTableColumnName?" + Math.random(),
  1701. dataType: "json",
  1702. async: false,
  1703. success: function (data) {
  1704. if (data != null && data.length > 0) {
  1705. DateList = data;
  1706. for (var i = 0; i < data.length; i++) {
  1707. var TableCode = data[i].TableCode;
  1708. if (TableCode == "ICSOutsourcingReceive") {
  1709. var Code = data[i].Code;
  1710. var Name = data[i].Name;
  1711. var obj = new Array();
  1712. obj = {
  1713. label: Name,
  1714. name: Code,
  1715. width: 80,
  1716. align: "left"
  1717. }
  1718. cols.push(obj);
  1719. }
  1720. if (TableCode == "ICSInventory") {
  1721. var Code = data[i].Code;
  1722. var Name = data[i].Name;
  1723. var obj = new Array();
  1724. obj = {
  1725. label: Name,
  1726. name: Code,
  1727. width: 80,
  1728. align: "left"
  1729. }
  1730. cols.push(obj);
  1731. //cols1.push(obj);
  1732. }
  1733. }
  1734. }
  1735. _Clos = cols;
  1736. //_Clos1 = cols1;
  1737. }
  1738. });
  1739. }
  1740. //红字销售单出库生成条码
  1741. if (Type == '24') {
  1742. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1743. cols.push(collast);
  1744. var collast = { label: '单据号', name: 'SSDCode', width: 120, align: 'left' };
  1745. cols.push(collast);
  1746. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  1747. cols.push(collast);
  1748. var collast = { label: '客户编码', name: 'CusCode', width: 120, align: 'left' };
  1749. cols.push(collast);
  1750. var collast = { label: '客户名称', name: 'CusName', width: 120, align: 'left' };
  1751. cols.push(collast);
  1752. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1753. cols.push(collast);
  1754. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  1755. cols.push(collast);
  1756. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  1757. cols.push(collast);
  1758. var collast = { label: '退货日期', name: 'CreateDateTime', width: 150, align: 'left' };
  1759. cols.push(collast);
  1760. var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' };
  1761. cols.push(collast);
  1762. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  1763. cols.push(collast);
  1764. var collast = { label: '料品型号', name: 'InvStd', width: 120, align: 'left' };
  1765. cols.push(collast);
  1766. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  1767. cols.push(collast);
  1768. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1769. cols.push(collast);
  1770. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1771. //cols.push(collast);
  1772. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  1773. cols.push(collast);
  1774. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1775. cols.push(collast);
  1776. var collast = { label: '入库数量', name: 'SSDQuantity', width: 60, align: 'left', };
  1777. cols.push(collast);
  1778. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  1779. cols.push(collast);
  1780. var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', };
  1781. cols.push(collast);
  1782. var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', };
  1783. cols.push(collast);
  1784. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  1785. cols.push(collast);
  1786. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  1787. cols.push(collast);
  1788. $.ajax({
  1789. url: "/Print/SelectTableColumnName?" + Math.random(),
  1790. dataType: "json",
  1791. async: false,
  1792. success: function (data) {
  1793. if (data != null && data.length > 0) {
  1794. DateList = data;
  1795. for (var i = 0; i < data.length; i++) {
  1796. var TableCode = data[i].TableCode;
  1797. if (TableCode == "ICSSSD") {
  1798. debugger;
  1799. var Code = data[i].Code;
  1800. var Name = data[i].Name;
  1801. var obj = new Array();
  1802. obj = {
  1803. label: Name,
  1804. name: Code,
  1805. width: 80,
  1806. align: "left"
  1807. }
  1808. cols.push(obj);
  1809. }
  1810. if (TableCode == "ICSInventory") {
  1811. var Code = data[i].Code;
  1812. var Name = data[i].Name;
  1813. var obj = new Array();
  1814. obj = {
  1815. label: Name,
  1816. name: Code,
  1817. width: 80,
  1818. align: "left"
  1819. }
  1820. cols.push(obj);
  1821. //cols1.push(obj);
  1822. }
  1823. }
  1824. }
  1825. _Clos = cols;
  1826. //_Clos1 = cols1;
  1827. }
  1828. });
  1829. }
  1830. //派纳线边仓调拨申请单生成条码
  1831. if (Type == '201') {
  1832. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1833. cols.push(collast);
  1834. var collast = { label: '单据号', name: 'TransferNO', width: 120, align: 'left' };
  1835. cols.push(collast);
  1836. var collast = { label: '单据行号', name: 'Sequence', width: 50, align: 'left' };
  1837. cols.push(collast);
  1838. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1839. cols.push(collast);
  1840. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  1841. cols.push(collast);
  1842. var collast = { label: '调出仓库', name: 'FromWHName', width: 100, align: 'left', };
  1843. cols.push(collast);
  1844. var collast = { label: '调入仓库', name: 'ToWHName', width: 100, align: 'left', };
  1845. cols.push(collast);
  1846. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1847. cols.push(collast);
  1848. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1849. cols.push(collast);
  1850. var collast = { label: '已调数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1851. cols.push(collast);
  1852. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1853. //cols.push(collast);
  1854. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1855. cols.push(collast);
  1856. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1857. //cols.push(collast);
  1858. $.ajax({
  1859. url: "/Print/SelectTableColumnName?" + Math.random(),
  1860. dataType: "json",
  1861. async: false,
  1862. success: function (data) {
  1863. if (data != null && data.length > 0) {
  1864. DateList = data;
  1865. for (var i = 0; i < data.length; i++) {
  1866. var TableCode = data[i].TableCode;
  1867. if (TableCode == "ICSTransferApplication") {
  1868. var Code = data[i].Code;
  1869. var Name = data[i].Name;
  1870. var obj = new Array();
  1871. obj = {
  1872. label: Name,
  1873. name: Code,
  1874. width: 80,
  1875. align: "left"
  1876. }
  1877. cols.push(obj);
  1878. }
  1879. if (TableCode == "ICSInventory") {
  1880. var Code = data[i].Code;
  1881. var Name = data[i].Name;
  1882. var obj = new Array();
  1883. obj = {
  1884. label: Name,
  1885. name: Code,
  1886. width: 80,
  1887. align: "left"
  1888. }
  1889. cols.push(obj);
  1890. //cols1.push(obj);
  1891. }
  1892. }
  1893. }
  1894. _Clos = cols;
  1895. //_Clos1 = cols1;
  1896. }
  1897. });
  1898. }
  1899. //调拨申请单生成条码
  1900. if (Type == '202') {
  1901. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1902. cols.push(collast);
  1903. var collast = { label: '单据号', name: 'TransferNO', width: 120, align: 'left' };
  1904. cols.push(collast);
  1905. var collast = { label: '单据行号', name: 'Sequence', width: 50, align: 'left' };
  1906. cols.push(collast);
  1907. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  1908. cols.push(collast);
  1909. var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
  1910. cols.push(collast);
  1911. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  1912. cols.push(collast);
  1913. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  1914. cols.push(collast);
  1915. var collast = { label: '已调数量', name: 'TransferQuantity', width: 100, align: 'left' };
  1916. cols.push(collast);
  1917. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1918. //cols.push(collast);
  1919. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  1920. cols.push(collast);
  1921. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1922. //cols.push(collast);
  1923. $.ajax({
  1924. url: "/Print/SelectTableColumnName?" + Math.random(),
  1925. dataType: "json",
  1926. async: false,
  1927. success: function (data) {
  1928. if (data != null && data.length > 0) {
  1929. DateList = data;
  1930. for (var i = 0; i < data.length; i++) {
  1931. var TableCode = data[i].TableCode;
  1932. if (TableCode == "ICSTransferApplication") {
  1933. var Code = data[i].Code;
  1934. var Name = data[i].Name;
  1935. var obj = new Array();
  1936. obj = {
  1937. label: Name,
  1938. name: Code,
  1939. width: 80,
  1940. align: "left"
  1941. }
  1942. cols.push(obj);
  1943. }
  1944. if (TableCode == "ICSInventory") {
  1945. var Code = data[i].Code;
  1946. var Name = data[i].Name;
  1947. var obj = new Array();
  1948. obj = {
  1949. label: Name,
  1950. name: Code,
  1951. width: 80,
  1952. align: "left"
  1953. }
  1954. cols.push(obj);
  1955. //cols1.push(obj);
  1956. }
  1957. }
  1958. }
  1959. _Clos = cols;
  1960. //_Clos1 = cols1;
  1961. }
  1962. });
  1963. }
  1964. //子表
  1965. if (Type=='17') {
  1966. var cols1 = new Array();
  1967. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  1968. cols1.push(collast1);
  1969. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  1970. cols1.push(collast1);
  1971. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  1972. cols1.push(collast1);
  1973. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  1974. cols1.push(collast1);
  1975. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  1976. cols1.push(collast1);
  1977. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  1978. cols1.push(collast1);
  1979. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  1980. cols1.push(collast1);
  1981. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  1982. cols1.push(collast1);
  1983. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  1984. cols1.push(collast1);
  1985. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  1986. cols1.push(collast1);
  1987. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  1988. cols1.push(collast1);
  1989. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  1990. cols1.push(collast1);
  1991. var collast1 = { label: '是否打印', name: 'isPrint', width: 150, align: 'left' };
  1992. cols1.push(collast1);
  1993. }
  1994. else {
  1995. var cols1 = new Array();
  1996. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  1997. cols1.push(collast1);
  1998. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  1999. cols1.push(collast1);
  2000. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  2001. cols1.push(collast1);
  2002. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  2003. cols1.push(collast1);
  2004. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  2005. cols1.push(collast1);
  2006. var collast1 = { label: '是否打印', name: 'isPrint', width: 150, align: 'left' };
  2007. cols1.push(collast1);
  2008. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  2009. cols1.push(collast1);
  2010. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  2011. cols1.push(collast1);
  2012. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  2013. cols1.push(collast1);
  2014. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  2015. cols1.push(collast1);
  2016. var collast1 = { label: '备注', name: 'EATTRIBUTE5', width: 100, align: 'left' };
  2017. cols1.push(collast1);
  2018. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  2019. cols1.push(collast1);
  2020. var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' };
  2021. cols1.push(collast1);
  2022. var collast1 = { label: '免检', name: 'isExemption', width: 100, align: 'left' };
  2023. cols1.push(collast1);
  2024. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  2025. cols1.push(collast1);
  2026. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  2027. cols1.push(collast1);
  2028. }
  2029. if (data != null && data.length > 0) {
  2030. DateList = data;
  2031. for (var i = 0; i < data.length; i++) {
  2032. var ColName = data[i].ColName;
  2033. var ColCode = data[i].ColCode;
  2034. var obj = new Array();
  2035. obj = {
  2036. label: ColName,
  2037. name: ColCode,
  2038. width: 80,
  2039. align: "left"
  2040. }
  2041. cols.push(obj);
  2042. cols1.push(obj);
  2043. }
  2044. }
  2045. _Clos = cols;
  2046. _Clos1 = cols1;
  2047. }
  2048. });
  2049. }
  2050. //生产退料
  2051. function gridList() {
  2052. var $gridList = $("#gridList");
  2053. var queryJson = {
  2054. POCode: $("#txt_POCode").val(),
  2055. InvCode: $("#txt_InvCode").val(),
  2056. InvName: $("#txt_InvName").val(),
  2057. BatchCode: $("#txt_BatchCode").val(),
  2058. FromTime: $("#FromTime").val(),
  2059. ToTime: $("#ToTime").val(),
  2060. POStatus: $("#selShow").val()
  2061. }
  2062. $gridList.dataGrid({
  2063. url: "/PNWMS/WMSCreateItemLot/GetGridJson" + "?" + Math.random(),
  2064. postData: { queryJson: JSON.stringify(queryJson) },
  2065. height: $(window).height() - 200,
  2066. width: $(window).width() - 300,
  2067. colModel: _Clos,
  2068. //colModel: [
  2069. // { label: "主键", name: "ID", hidden: true, key: true },
  2070. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2071. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2072. // { label: '工单子件', name: 'SourceDetailID', hidden: true, },
  2073. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2074. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2075. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2076. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2077. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2078. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2079. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2080. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2081. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2082. //],
  2083. //colModel: ColModelMain,
  2084. width: "100%",
  2085. autowidth: true,
  2086. //shrinkToFit: true,
  2087. gridComplete: function () {
  2088. },
  2089. pager: "#gridPager",
  2090. sortname: " MTIME desc ,ApplyNegCode asc,REPLICATE('0',10-len(Sequence))+Sequence  ",
  2091. // sortname: 'ApplyNegCode ',
  2092. //let str = `He said, "It's a 'beautiful' day."`,
  2093. //sortorder: "asc",
  2094. viewrecords: true,
  2095. multiselect: true,
  2096. //beforeSelectRow: function (rowid, e) {
  2097. // $("#gridList").jqGrid('resetSelection');
  2098. // return (true);
  2099. //},
  2100. subGrid: true, // (1)开启子表格支持
  2101. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2102. $("#gridList").jqGrid("setSelection", rowid, false);
  2103. bindSubGrid(subgrid_id, rowid)
  2104. }
  2105. });
  2106. $("#warehouse a.btn-default").click(function () {
  2107. $("#warehouse a.btn-default").removeClass("active");
  2108. $(this).addClass("active");
  2109. $('#btn_search').trigger("click");
  2110. });
  2111. $("#btn_search").click(function () {
  2112. var warehouse = $("#warehouse a.active").attr('data-value');
  2113. var queryJson = {
  2114. POCode: $("#txt_POCode").val(),
  2115. InvCode: $("#txt_InvCode").val(),
  2116. InvName: $("#txt_InvName").val(),
  2117. BatchCode: $("#txt_BatchCode").val(),
  2118. FromTime: $("#FromTime").val(),
  2119. ToTime: $("#ToTime").val(),
  2120. POStatus: $("#selShow").val()
  2121. }
  2122. $gridList.jqGrid('setGridParam', {
  2123. postData: { queryJson: JSON.stringify(queryJson) },
  2124. }).trigger('reloadGrid');
  2125. });
  2126. }
  2127. function bindSubGrid(subgrid_id, rowid) {
  2128. $("#gridList").jqGrid("setSelection", rowid, false);
  2129. var subgrid_table_id;
  2130. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2131. var subgrid_pager_id;
  2132. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2133. // (5)动态添加子报表的table和pager
  2134. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2135. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2136. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2137. // (6)创建jqGrid对象
  2138. $("#" + subgrid_table_id).dataGrid({
  2139. cellEdit: true,
  2140. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2141. //colModel: [
  2142. // { label: "主键", name: "ID", hidden: true, key: true },
  2143. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2144. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2145. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2146. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2147. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2148. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2149. //],
  2150. colModel: _Clos1,
  2151. //colModel: ColModelSub,
  2152. shrinkToFit: true,//宽度自适应
  2153. multiselect: true,
  2154. prmNames: { search: "search" },
  2155. viewrecords: true,
  2156. height: "100%",
  2157. rowNum: 20,
  2158. pager: subgrid_pager_id,
  2159. });
  2160. }
  2161. //委外退料
  2162. function gridList2() {
  2163. var $gridList = $("#gridList");
  2164. var queryJson = {
  2165. POCode: $("#txt_POCode").val(),
  2166. InvCode: $("#txt_InvCode").val(),
  2167. InvName: $("#txt_InvName").val(),
  2168. BatchCode: $("#txt_BatchCode").val(),
  2169. FromTime: $("#FromTime").val(),
  2170. ToTime: $("#ToTime").val(),
  2171. WHCode: $("#txt_WHCode").val(),
  2172. POStatus: $("#selShow").val()
  2173. }
  2174. $gridList.dataGrid({
  2175. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWeiWai" + "?" + Math.random(),
  2176. postData: { queryJson: JSON.stringify(queryJson) },
  2177. height: $(window).height() - 200,
  2178. width: $(window).width() - 300,
  2179. colModel: _Clos,
  2180. //colModel: [
  2181. // { label: "主键", name: "ID", hidden: true, key: true },
  2182. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2183. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2184. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2185. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2186. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2187. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2188. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2189. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2190. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2191. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2192. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2193. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2194. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2195. //],
  2196. //colModel: ColModelMain,
  2197. width: "100%",
  2198. autowidth: true,
  2199. //shrinkToFit: true,
  2200. gridComplete: function () {
  2201. },
  2202. pager: "#gridPager",
  2203. // sortname: 'OApplyNegCode,cast(Sequence as int)',
  2204. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2205. sortorder: "asc",
  2206. viewrecords: true,
  2207. multiselect: true,
  2208. //beforeSelectRow: function (rowid, e) {
  2209. // $("#gridList").jqGrid('resetSelection');
  2210. // return (true);
  2211. //},
  2212. subGrid: true, // (1)开启子表格支持
  2213. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2214. $("#gridList").jqGrid("setSelection", rowid, false);
  2215. bindSubGrid2(subgrid_id, rowid)
  2216. }
  2217. });
  2218. $("#warehouse a.btn-default").click(function () {
  2219. $("#warehouse a.btn-default").removeClass("active");
  2220. $(this).addClass("active");
  2221. $('#btn_search').trigger("click");
  2222. });
  2223. $("#btn_search").click(function () {
  2224. var warehouse = $("#warehouse a.active").attr('data-value');
  2225. var queryJson = {
  2226. POCode: $("#txt_POCode").val(),
  2227. InvCode: $("#txt_InvCode").val(),
  2228. InvName: $("#txt_InvName").val(),
  2229. BatchCode: $("#txt_BatchCode").val(),
  2230. FromTime: $("#FromTime").val(),
  2231. ToTime: $("#ToTime").val(),
  2232. WHCode: $("#txt_WHCode").val(),
  2233. POStatus: $("#selShow").val()
  2234. }
  2235. $gridList.jqGrid('setGridParam', {
  2236. postData: { queryJson: JSON.stringify(queryJson) },
  2237. }).trigger('reloadGrid');
  2238. });
  2239. }
  2240. function bindSubGrid2(subgrid_id, rowid) {
  2241. $("#gridList").jqGrid("setSelection", rowid, false);
  2242. var subgrid_table_id;
  2243. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2244. var subgrid_pager_id;
  2245. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2246. // (5)动态添加子报表的table和pager
  2247. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2248. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2249. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2250. // (6)创建jqGrid对象
  2251. $("#" + subgrid_table_id).dataGrid({
  2252. cellEdit: true,
  2253. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2254. //colModel: [
  2255. // { label: "主键", name: "ID", hidden: true, key: true },
  2256. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2257. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2258. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2259. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2260. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2261. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2262. //],
  2263. colModel: _Clos1,
  2264. //colModel: ColModelSub,
  2265. shrinkToFit: true,//宽度自适应
  2266. multiselect: true,
  2267. prmNames: { search: "search" },
  2268. viewrecords: true,
  2269. height: "100%",
  2270. rowNum: 20,
  2271. pager: subgrid_pager_id,
  2272. });
  2273. }
  2274. //成品
  2275. function gridList3() {
  2276. var $gridList = $("#gridList");
  2277. var queryJson = {
  2278. POCode: $("#txt_POCode").val(),
  2279. InvCode: $("#txt_InvCode").val(),
  2280. InvName: $("#txt_InvName").val(),
  2281. BatchCode: $("#txt_BatchCode").val(),
  2282. FromTime: $("#FromTime").val(),
  2283. ToTime: $("#ToTime").val(),
  2284. WHCode: $("#txt_WHCode").val(),
  2285. POStatus: $("#selShow").val(),
  2286. SelGDLX: $("#SelGDLX option:checked").val(),
  2287. WHStatus: $("#selStatus").val(),
  2288. InvStd: $("#txt_InvStd").val(),
  2289. ClassGroup: $("#selClassGroup").val(),
  2290. }
  2291. $gridList.dataGrid({
  2292. url: "/PNWMS/WMSCreateItemLot/GetGridJsonChengPing" + "?" + Math.random(),
  2293. postData: { queryJson: JSON.stringify(queryJson) },
  2294. height: $(window).height() - 200,
  2295. width: $(window).width() - 300,
  2296. colModel: _Clos,
  2297. //colModel: [
  2298. // { label: "主键", name: "ID", hidden: true, key: true },
  2299. // { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  2300. // { label: '工单行号', name: 'Sequence', width: 50, align: 'left' },
  2301. // { label: '已入库数量', name: 'RCVQuantity', hidden: true, },
  2302. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2303. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2304. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2305. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2306. // {
  2307. // label: "状态", name: "MOStatus", width: 60, align: "left",
  2308. // formatter: function (cellvalue) {
  2309. // if (cellvalue == "1") {
  2310. // return "初始";
  2311. // } else if (cellvalue == "2") {
  2312. // return "下发";
  2313. // }
  2314. // else if (cellvalue == "3") {
  2315. // return "关单";
  2316. // }
  2317. // else { return ""; }
  2318. // }
  2319. // },
  2320. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2321. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2322. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2323. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2324. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2325. // { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' },
  2326. //],
  2327. //colModel: ColModelMain,
  2328. width: "100%",
  2329. autowidth: true,
  2330. cellEdit: true,
  2331. cellsubmit: "clientArray",
  2332. //shrinkToFit: true,
  2333. gridComplete: function () {
  2334. },
  2335. pager: "#gridPager",
  2336. //sortname: 'MOCode,cast(Sequence as int)',
  2337. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2338. sortorder: "asc",
  2339. viewrecords: true,
  2340. multiselect: true,
  2341. //beforeSelectRow: function (rowid, e) {
  2342. // $("#gridList").jqGrid('resetSelection');
  2343. // return (true);
  2344. //},
  2345. subGrid: true, // (1)开启子表格支持
  2346. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2347. $("#gridList").jqGrid("setSelection", rowid, false);
  2348. bindSubGrid3(subgrid_id, rowid)
  2349. }
  2350. });
  2351. $("#warehouse a.btn-default").click(function () {
  2352. $("#warehouse a.btn-default").removeClass("active");
  2353. $(this).addClass("active");
  2354. $('#btn_search').trigger("click");
  2355. });
  2356. $("#btn_search").click(function () {
  2357. var warehouse = $("#warehouse a.active").attr('data-value');
  2358. var queryJson = {
  2359. POCode: $("#txt_POCode").val(),
  2360. InvCode: $("#txt_InvCode").val(),
  2361. InvName: $("#txt_InvName").val(),
  2362. BatchCode: $("#txt_BatchCode").val(),
  2363. FromTime: $("#FromTime").val(),
  2364. ToTime: $("#ToTime").val(),
  2365. WHCode: $("#txt_WHCode").val(),
  2366. POStatus: $("#selShow").val(),
  2367. SelGDLX: $("#SelGDLX option:checked").val(),
  2368. WHStatus: $("#selStatus").val(),
  2369. InvStd: $("#txt_InvStd").val(),
  2370. ClassGroup: $("#selClassGroup").val(),
  2371. }
  2372. $gridList.jqGrid('setGridParam', {
  2373. postData: { queryJson: JSON.stringify(queryJson) },
  2374. }).trigger('reloadGrid');
  2375. });
  2376. }
  2377. function bindSubGrid3(subgrid_id, rowid) {
  2378. $("#gridList").jqGrid("setSelection", rowid, false);
  2379. var subgrid_table_id;
  2380. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2381. var subgrid_pager_id;
  2382. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2383. // (5)动态添加子报表的table和pager
  2384. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2385. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  2386. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2387. var isPrint = $("#selPrint").val();
  2388. // (6)创建jqGrid对象
  2389. $("#" + subgrid_table_id).dataGrid({
  2390. cellEdit: true,
  2391. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2392. //colModel: [
  2393. // { label: "主键", name: "ID", hidden: true, key: true },
  2394. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2395. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2396. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2397. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2398. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2399. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2400. //],
  2401. colModel: _Clos1,
  2402. //colModel: ColModelSub,
  2403. shrinkToFit: true,//宽度自适应
  2404. multiselect: true,
  2405. prmNames: { search: "search" },
  2406. viewrecords: true,
  2407. height: "100%",
  2408. rowNum: 20,
  2409. pager: subgrid_pager_id,
  2410. });
  2411. }
  2412. //销售退货
  2413. function gridList4() {
  2414. var $gridList = $("#gridList");
  2415. var queryJson = {
  2416. POCode: $("#txt_POCode").val(),
  2417. InvCode: $("#txt_InvCode").val(),
  2418. InvName: $("#txt_InvName").val(),
  2419. BatchCode: $("#txt_BatchCode").val(),
  2420. POStatus: $("#selShow").val()
  2421. }
  2422. $gridList.dataGrid({
  2423. url: "/PNWMS/WMSCreateItemLot/GetGridJsonXiaoShou" + "?" + Math.random(),
  2424. postData: { queryJson: JSON.stringify(queryJson) },
  2425. height: $(window).height() - 200,
  2426. width: $(window).width() - 300,
  2427. colModel: _Clos,
  2428. //colModel: [
  2429. // { label: "主键", name: "ID", hidden: true, key: true },
  2430. // { label: '单据号', name: 'SDNCode', width: 120, align: 'left' },
  2431. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2432. // { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' },
  2433. // { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' },
  2434. // { label: '客户代码', name: 'CusCode', width: 120, align: 'left' },
  2435. // { label: '客户名称', name: 'CusName', width: 50, align: 'left' },
  2436. // { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' },
  2437. // { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' },
  2438. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2439. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2440. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2441. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2442. // {
  2443. // label: "状态", name: "Status", width: 60, align: "left",
  2444. // formatter: function (cellvalue) {
  2445. // if (cellvalue == "1") {
  2446. // return "开立";
  2447. // } else if (cellvalue == "2") {
  2448. // return "审核";
  2449. // }
  2450. // else if (cellvalue == "3") {
  2451. // return "关闭";
  2452. // }
  2453. // else { return ""; }
  2454. // }
  2455. // },
  2456. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2457. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2458. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2459. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2460. //],
  2461. //colModel: ColModelMain,
  2462. width: "100%",
  2463. autowidth: true,
  2464. //shrinkToFit: true,
  2465. gridComplete: function () {
  2466. },
  2467. pager: "#gridPager",
  2468. // sortname: 'SDNCode,cast(Sequence as int)',
  2469. sortname: "SDNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2470. sortorder: "asc",
  2471. viewrecords: true,
  2472. multiselect: true,
  2473. //beforeSelectRow: function (rowid, e) {
  2474. // $("#gridList").jqGrid('resetSelection');
  2475. // return (true);
  2476. //},
  2477. subGrid: true, // (1)开启子表格支持
  2478. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2479. $("#gridList").jqGrid("setSelection", rowid, false);
  2480. bindSubGrid4(subgrid_id, rowid)
  2481. }
  2482. });
  2483. $("#warehouse a.btn-default").click(function () {
  2484. $("#warehouse a.btn-default").removeClass("active");
  2485. $(this).addClass("active");
  2486. $('#btn_search').trigger("click");
  2487. });
  2488. $("#btn_search").click(function () {
  2489. var warehouse = $("#warehouse a.active").attr('data-value');
  2490. var queryJson = {
  2491. POCode: $("#txt_POCode").val(),
  2492. InvCode: $("#txt_InvCode").val(),
  2493. InvName: $("#txt_InvName").val(),
  2494. BatchCode: $("#txt_BatchCode").val(),
  2495. POStatus: $("#selShow").val()
  2496. }
  2497. $gridList.jqGrid('setGridParam', {
  2498. postData: { queryJson: JSON.stringify(queryJson) },
  2499. }).trigger('reloadGrid');
  2500. });
  2501. }
  2502. function bindSubGrid4(subgrid_id, rowid) {
  2503. $("#gridList").jqGrid("setSelection", rowid, false);
  2504. var subgrid_table_id;
  2505. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2506. var subgrid_pager_id;
  2507. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2508. // (5)动态添加子报表的table和pager
  2509. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2510. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  2511. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2512. var isPrint = $("#selPrint").val();
  2513. // (6)创建jqGrid对象
  2514. $("#" + subgrid_table_id).dataGrid({
  2515. cellEdit: true,
  2516. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2517. //colModel: [
  2518. // { label: "主键", name: "ID", hidden: true, key: true },
  2519. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2520. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2521. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2522. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2523. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2524. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2525. //],
  2526. colModel: _Clos1,
  2527. //colModel: ColModelSub,
  2528. shrinkToFit: true,//宽度自适应
  2529. multiselect: true,
  2530. prmNames: { search: "search" },
  2531. viewrecords: true,
  2532. height: "100%",
  2533. rowNum: 20,
  2534. pager: subgrid_pager_id,
  2535. });
  2536. }
  2537. //其它入库生成条码
  2538. function gridList5() {
  2539. var $gridList = $("#gridList");
  2540. var queryJson = {
  2541. POCode: $("#txt_POCode").val(),
  2542. InvCode: $("#txt_InvCode").val(),
  2543. InvName: $("#txt_InvName").val(),
  2544. BatchCode: $("#txt_BatchCode").val(),
  2545. FromTime: $("#FromTime").val(),
  2546. ToTime: $("#ToTime").val(),
  2547. WHCode: $("#txt_WHCode").val(),
  2548. POStatus: $("#selShow").val(),
  2549. InvStd: $("#txt_InvStd").val(),
  2550. }
  2551. $gridList.dataGrid({
  2552. url: "/PNWMS/WMSCreateItemLot/GetGridJsonQiTa" + "?" + Math.random(),
  2553. postData: { queryJson: JSON.stringify(queryJson) },
  2554. height: $(window).height() - 200,
  2555. width: $(window).width() - 300,
  2556. colModel: _Clos,
  2557. //colModel: [
  2558. // { label: "主键", name: "ID", hidden: true, key: true },
  2559. // { label: '单据号', name: 'InCode', width: 120, align: 'left' },
  2560. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2561. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  2562. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2563. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2564. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2565. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2566. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2567. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2568. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2569. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2570. // { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', },
  2571. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2572. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2573. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2574. //],
  2575. //colModel: ColModelMain,
  2576. width: "100%",
  2577. autowidth: true,
  2578. //shrinkToFit: true,
  2579. gridComplete: function () {
  2580. },
  2581. pager: "#gridPager",
  2582. sortname: 'InCode',
  2583. sortorder: "asc",
  2584. viewrecords: true,
  2585. multiselect: true,
  2586. //beforeSelectRow: function (rowid, e) {
  2587. // $("#gridList").jqGrid('resetSelection');
  2588. // return (true);
  2589. //},
  2590. subGrid: true, // (1)开启子表格支持
  2591. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2592. $("#gridList").jqGrid("setSelection", rowid, false);
  2593. bindSubGrid5(subgrid_id, rowid)
  2594. }
  2595. });
  2596. $("#warehouse a.btn-default").click(function () {
  2597. $("#warehouse a.btn-default").removeClass("active");
  2598. $(this).addClass("active");
  2599. $('#btn_search').trigger("click");
  2600. });
  2601. $("#btn_search").click(function () {
  2602. var warehouse = $("#warehouse a.active").attr('data-value');
  2603. var queryJson = {
  2604. POCode: $("#txt_POCode").val(),
  2605. InvCode: $("#txt_InvCode").val(),
  2606. InvName: $("#txt_InvName").val(),
  2607. BatchCode: $("#txt_BatchCode").val(),
  2608. FromTime: $("#FromTime").val(),
  2609. ToTime: $("#ToTime").val(),
  2610. WHCode: $("#txt_WHCode").val(),
  2611. POStatus: $("#selShow").val(),
  2612. InvStd: $("#txt_InvStd").val(),
  2613. }
  2614. $gridList.jqGrid('setGridParam', {
  2615. postData: { queryJson: JSON.stringify(queryJson) },
  2616. }).trigger('reloadGrid');
  2617. });
  2618. }
  2619. function bindSubGrid5(subgrid_id, rowid) {
  2620. $("#gridList").jqGrid("setSelection", rowid, false);
  2621. var subgrid_table_id;
  2622. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2623. var subgrid_pager_id;
  2624. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2625. // (5)动态添加子报表的table和pager
  2626. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2627. var InCode = $("#gridList").jqGrid('getRowData', rowid).InCode;
  2628. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2629. var isPrint = $("#selPrint").val();
  2630. // (6)创建jqGrid对象
  2631. $("#" + subgrid_table_id).dataGrid({
  2632. cellEdit: true,
  2633. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2634. //colModel: [
  2635. // { label: "主键", name: "ID", hidden: true, key: true },
  2636. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2637. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2638. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2639. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2640. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2641. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2642. //],
  2643. colModel: _Clos1,
  2644. //colModel: ColModelSub,
  2645. shrinkToFit: true,//宽度自适应
  2646. multiselect: true,
  2647. prmNames: { search: "search" },
  2648. viewrecords: true,
  2649. height: "100%",
  2650. rowNum: 20,
  2651. pager: subgrid_pager_id,
  2652. });
  2653. }
  2654. //归还单生成条码
  2655. function gridList6() {
  2656. var $gridList = $("#gridList");
  2657. var queryJson = {
  2658. POCode: $("#txt_POCode").val(),
  2659. InvCode: $("#txt_InvCode").val(),
  2660. InvName: $("#txt_InvName").val(),
  2661. BatchCode: $("#txt_BatchCode").val(),
  2662. POStatus: $("#selShow").val()
  2663. }
  2664. $gridList.dataGrid({
  2665. url: "/PNWMS/WMSCreateItemLot/GetGridJsonGuiHuan" + "?" + Math.random(),
  2666. postData: { queryJson: JSON.stringify(queryJson) },
  2667. height: $(window).height() - 200,
  2668. width: $(window).width() - 300,
  2669. colModel: _Clos,
  2670. //colModel: [
  2671. // { label: "主键", name: "ID", hidden: true, key: true },
  2672. // { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' },
  2673. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2674. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  2675. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2676. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2677. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2678. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2679. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2680. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2681. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2682. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2683. // { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', },
  2684. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2685. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2686. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2687. //],
  2688. //colModel: ColModelMain,
  2689. width: "100%",
  2690. autowidth: true,
  2691. //shrinkToFit: true,
  2692. gridComplete: function () {
  2693. },
  2694. pager: "#gridPager",
  2695. /// sortname: 'ReturnCode,cast(Sequence as int)',
  2696. sortname: "ReturnCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2697. sortorder: "asc",
  2698. viewrecords: true,
  2699. multiselect: true,
  2700. //beforeSelectRow: function (rowid, e) {
  2701. // $("#gridList").jqGrid('resetSelection');
  2702. // return (true);
  2703. //},
  2704. subGrid: true, // (1)开启子表格支持
  2705. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2706. $("#gridList").jqGrid("setSelection", rowid, false);
  2707. bindSubGrid6(subgrid_id, rowid)
  2708. }
  2709. });
  2710. $("#warehouse a.btn-default").click(function () {
  2711. $("#warehouse a.btn-default").removeClass("active");
  2712. $(this).addClass("active");
  2713. $('#btn_search').trigger("click");
  2714. });
  2715. $("#btn_search").click(function () {
  2716. var warehouse = $("#warehouse a.active").attr('data-value');
  2717. var queryJson = {
  2718. POCode: $("#txt_POCode").val(),
  2719. InvCode: $("#txt_InvCode").val(),
  2720. InvName: $("#txt_InvName").val(),
  2721. BatchCode: $("#txt_BatchCode").val(),
  2722. POStatus: $("#selShow").val()
  2723. }
  2724. $gridList.jqGrid('setGridParam', {
  2725. postData: { queryJson: JSON.stringify(queryJson) },
  2726. }).trigger('reloadGrid');
  2727. });
  2728. }
  2729. function bindSubGrid6(subgrid_id, rowid) {
  2730. $("#gridList").jqGrid("setSelection", rowid, false);
  2731. var subgrid_table_id;
  2732. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2733. var subgrid_pager_id;
  2734. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2735. // (5)动态添加子报表的table和pager
  2736. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2737. var ReturnCode = $("#gridList").jqGrid('getRowData', rowid).ReturnCode;
  2738. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2739. // (6)创建jqGrid对象
  2740. $("#" + subgrid_table_id).dataGrid({
  2741. cellEdit: true,
  2742. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2743. //colModel: [
  2744. // { label: "主键", name: "ID", hidden: true, key: true },
  2745. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2746. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2747. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2748. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2749. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2750. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2751. //],
  2752. colModel: _Clos1,
  2753. //colModel: ColModelSub,
  2754. shrinkToFit: true,//宽度自适应
  2755. multiselect: true,
  2756. prmNames: { search: "search" },
  2757. viewrecords: true,
  2758. height: "100%",
  2759. rowNum: 20,
  2760. pager: subgrid_pager_id,
  2761. });
  2762. }
  2763. //*审核到货单生成条码
  2764. function gridList7() {
  2765. var $gridList = $("#gridList");
  2766. var queryJson = {
  2767. POCode: $("#txt_POCode").val(),
  2768. VenCode: $("#txt_VenCode").val(),
  2769. VenName: $("#txt_VenName").val(),
  2770. InvCode: $("#txt_InvCode").val(),
  2771. InvName: $("#txt_InvName").val(),
  2772. BatchCode: $("#txt_BatchCode").val(),
  2773. POStatus: $("#selShow").val(),
  2774. WHStatus: $("#selStatus").val(),
  2775. InvStd: $("#txt_InvStd").val(),
  2776. }
  2777. $gridList.dataGrid({
  2778. url: "/PNWMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  2779. postData: { queryJson: JSON.stringify(queryJson) },
  2780. height: $(window).height() - 200,
  2781. width: $(window).width() - 300,
  2782. colModel: _Clos,
  2783. //colModel: [
  2784. // { label: "主键", name: "ID", hidden: true, key: true },
  2785. // { label: '单据号', name: 'DNCode', width: 120, align: 'left' },
  2786. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2787. // { label: '采购订单号', name: 'POCode', width: 50, align: 'left' },
  2788. // { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' },
  2789. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2790. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2791. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2792. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2793. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2794. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2795. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  2796. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2797. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2798. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2799. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2800. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2801. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2802. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2803. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2804. //],
  2805. //colModel: ColModelMain,
  2806. width: "100%",
  2807. autowidth: true,
  2808. //shrinkToFit: true,
  2809. gridComplete: function () {
  2810. },
  2811. pager: "#gridPager",
  2812. //sortname: 'DNCode,cast(Sequence as int)',
  2813. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2814. sortorder: "asc",
  2815. viewrecords: true,
  2816. multiselect: true,
  2817. //beforeSelectRow: function (rowid, e) {
  2818. // $("#gridList").jqGrid('resetSelection');
  2819. // return (true);
  2820. //},
  2821. subGrid: true, // (1)开启子表格支持
  2822. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2823. $("#gridList").jqGrid("setSelection", rowid, false);
  2824. bindSubGrid7(subgrid_id, rowid)
  2825. }
  2826. });
  2827. $("#warehouse a.btn-default").click(function () {
  2828. $("#warehouse a.btn-default").removeClass("active");
  2829. $(this).addClass("active");
  2830. $('#btn_search').trigger("click");
  2831. });
  2832. $("#btn_search").click(function () {
  2833. var warehouse = $("#warehouse a.active").attr('data-value');
  2834. var queryJson = {
  2835. POCode: $("#txt_POCode").val(),
  2836. VenCode: $("#txt_VenCode").val(),
  2837. VenName: $("#txt_VenName").val(),
  2838. InvCode: $("#txt_InvCode").val(),
  2839. InvName: $("#txt_InvName").val(),
  2840. BatchCode: $("#txt_BatchCode").val(),
  2841. POStatus: $("#selShow").val(),
  2842. WHStatus: $("#selStatus").val(),
  2843. InvStd: $("#txt_InvStd").val(),
  2844. }
  2845. $gridList.jqGrid('setGridParam', {
  2846. postData: { queryJson: JSON.stringify(queryJson) },
  2847. }).trigger('reloadGrid');
  2848. });
  2849. }
  2850. function bindSubGrid7(subgrid_id, rowid) {
  2851. $("#gridList").jqGrid("setSelection", rowid, false);
  2852. var subgrid_table_id;
  2853. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2854. var subgrid_pager_id;
  2855. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2856. // (5)动态添加子报表的table和pager
  2857. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2858. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  2859. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2860. var isPrint = $("#selPrint").val();
  2861. // (6)创建jqGrid对象
  2862. $("#" + subgrid_table_id).dataGrid({
  2863. cellEdit: true,
  2864. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2865. //colModel: [
  2866. // { label: "主键", name: "ID", hidden: true, key: true },
  2867. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2868. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2869. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2870. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2871. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2872. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2873. //],
  2874. colModel: _Clos1,
  2875. //colModel: ColModelSub,
  2876. shrinkToFit: true,//宽度自适应
  2877. multiselect: true,
  2878. prmNames: { search: "search" },
  2879. viewrecords: true,
  2880. height: "100%",
  2881. rowNum: 20,
  2882. pager: subgrid_pager_id,
  2883. });
  2884. }
  2885. //审核委外到货单生成条码
  2886. function gridList8() {
  2887. var $gridList = $("#gridList");
  2888. var queryJson = {
  2889. POCode: $("#txt_POCode").val(),
  2890. VenCode: $("#txt_VenCode").val(),
  2891. VenName: $("#txt_VenName").val(),
  2892. InvCode: $("#txt_InvCode").val(),
  2893. InvName: $("#txt_InvName").val(),
  2894. BatchCode: $("#txt_BatchCode").val(),
  2895. POStatus: $("#selShow").val(),
  2896. WHStatus: $("#selStatus").val(),
  2897. InvStd: $("#txt_InvStd").val(),
  2898. }
  2899. $gridList.dataGrid({
  2900. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(),
  2901. postData: { queryJson: JSON.stringify(queryJson) },
  2902. height: $(window).height() - 200,
  2903. width: $(window).width() - 300,
  2904. colModel: _Clos,
  2905. //colModel: [
  2906. // { label: "主键", name: "ID", hidden: true, key: true },
  2907. // { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  2908. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  2909. // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' },
  2910. // { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' },
  2911. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2912. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2913. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2914. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  2915. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  2916. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2917. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2918. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2919. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2920. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2921. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2922. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2923. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2924. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2925. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2926. //],
  2927. //colModel: ColModelMain,
  2928. width: "100%",
  2929. autowidth: true,
  2930. //shrinkToFit: true,
  2931. gridComplete: function () {
  2932. },
  2933. pager: "#gridPager",
  2934. //sortname: 'ODNCode,cast(Sequence as int)',
  2935. sortname: "ODNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  2936. sortorder: "asc",
  2937. viewrecords: true,
  2938. multiselect: true,
  2939. //beforeSelectRow: function (rowid, e) {
  2940. // $("#gridList").jqGrid('resetSelection');
  2941. // return (true);
  2942. //},
  2943. subGrid: true, // (1)开启子表格支持
  2944. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2945. $("#gridList").jqGrid("setSelection", rowid, false);
  2946. bindSubGrid8(subgrid_id, rowid)
  2947. }
  2948. });
  2949. $("#warehouse a.btn-default").click(function () {
  2950. $("#warehouse a.btn-default").removeClass("active");
  2951. $(this).addClass("active");
  2952. $('#btn_search').trigger("click");
  2953. });
  2954. $("#btn_search").click(function () {
  2955. var warehouse = $("#warehouse a.active").attr('data-value');
  2956. var queryJson = {
  2957. POCode: $("#txt_POCode").val(),
  2958. VenCode: $("#txt_VenCode").val(),
  2959. VenName: $("#txt_VenName").val(),
  2960. InvCode: $("#txt_InvCode").val(),
  2961. InvName: $("#txt_InvName").val(),
  2962. BatchCode: $("#txt_BatchCode").val(),
  2963. POStatus: $("#selShow").val(),
  2964. WHStatus: $("#selStatus").val(),
  2965. InvStd: $("#txt_InvStd").val(),
  2966. }
  2967. $gridList.jqGrid('setGridParam', {
  2968. postData: { queryJson: JSON.stringify(queryJson) },
  2969. }).trigger('reloadGrid');
  2970. });
  2971. }
  2972. function bindSubGrid8(subgrid_id, rowid) {
  2973. $("#gridList").jqGrid("setSelection", rowid, false);
  2974. var subgrid_table_id;
  2975. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2976. var subgrid_pager_id;
  2977. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2978. // (5)动态添加子报表的table和pager
  2979. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2980. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  2981. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2982. var isPrint = $("#selPrint").val();
  2983. // (6)创建jqGrid对象
  2984. $("#" + subgrid_table_id).dataGrid({
  2985. cellEdit: true,
  2986. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2987. //colModel: [
  2988. // { label: "主键", name: "ID", hidden: true, key: true },
  2989. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2990. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2991. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2992. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2993. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2994. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2995. //],
  2996. colModel: _Clos1,
  2997. //colModel: ColModelSub,
  2998. shrinkToFit: true,//宽度自适应
  2999. multiselect: true,
  3000. prmNames: { search: "search" },
  3001. viewrecords: true,
  3002. height: "100%",
  3003. rowNum: 20,
  3004. pager: subgrid_pager_id,
  3005. });
  3006. }
  3007. //开立得成品入库单 生成条码
  3008. function gridList9() {
  3009. var $gridList = $("#gridList");
  3010. var queryJson = {
  3011. POCode: $("#txt_POCode").val(),
  3012. InvCode: $("#txt_InvCode").val(),
  3013. InvName: $("#txt_InvName").val(),
  3014. BatchCode: $("#txt_BatchCode").val(),
  3015. POStatus: $("#selShow").val(),
  3016. SCode: $("#txt_SCode").val(),
  3017. }
  3018. $gridList.dataGrid({
  3019. url: "/PNWMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  3020. postData: { queryJson: JSON.stringify(queryJson) },
  3021. height: $(window).height() - 200,
  3022. width: $(window).width() - 300,
  3023. colModel: _Clos,
  3024. //colModel: [
  3025. // { label: "主键", name: "ID", hidden: true, key: true },
  3026. // { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  3027. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  3028. // { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  3029. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3030. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3031. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3032. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3033. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  3034. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3035. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3036. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3037. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3038. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3039. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3040. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3041. //],
  3042. //colModel: ColModelMain,
  3043. width: "100%",
  3044. autowidth: true,
  3045. //shrinkToFit: true,
  3046. gridComplete: function () {
  3047. },
  3048. pager: "#gridPager",
  3049. //sortname: 'RCVCode,cast(Sequence as int)',
  3050. sortname: "RCVCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3051. sortorder: "asc",
  3052. viewrecords: true,
  3053. multiselect: true,
  3054. //beforeSelectRow: function (rowid, e) {
  3055. // $("#gridList").jqGrid('resetSelection');
  3056. // return (true);
  3057. //},
  3058. subGrid: true, // (1)开启子表格支持
  3059. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3060. $("#gridList").jqGrid("setSelection", rowid, false);
  3061. bindSubGrid9(subgrid_id, rowid)
  3062. }
  3063. });
  3064. $("#warehouse a.btn-default").click(function () {
  3065. $("#warehouse a.btn-default").removeClass("active");
  3066. $(this).addClass("active");
  3067. $('#btn_search').trigger("click");
  3068. });
  3069. $("#btn_search").click(function () {
  3070. var warehouse = $("#warehouse a.active").attr('data-value');
  3071. var queryJson = {
  3072. POCode: $("#txt_POCode").val(),
  3073. InvCode: $("#txt_InvCode").val(),
  3074. InvName: $("#txt_InvName").val(),
  3075. BatchCode: $("#txt_BatchCode").val(),
  3076. POStatus: $("#selShow").val(),
  3077. SCode: $("#txt_SCode").val(),
  3078. }
  3079. $gridList.jqGrid('setGridParam', {
  3080. postData: { queryJson: JSON.stringify(queryJson) },
  3081. }).trigger('reloadGrid');
  3082. });
  3083. }
  3084. function bindSubGrid9(subgrid_id, rowid) {
  3085. $("#gridList").jqGrid("setSelection", rowid, false);
  3086. var subgrid_table_id;
  3087. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3088. var subgrid_pager_id;
  3089. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3090. // (5)动态添加子报表的table和pager
  3091. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3092. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  3093. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3094. // (6)创建jqGrid对象
  3095. $("#" + subgrid_table_id).dataGrid({
  3096. cellEdit: true,
  3097. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3098. //colModel: [
  3099. // { label: "主键", name: "ID", hidden: true, key: true },
  3100. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3101. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3102. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3103. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3104. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3105. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3106. //],
  3107. colModel: _Clos1,
  3108. //colModel: ColModelSub,
  3109. shrinkToFit: true,//宽度自适应
  3110. multiselect: true,
  3111. prmNames: { search: "search" },
  3112. viewrecords: true,
  3113. height: "100%",
  3114. rowNum: 20,
  3115. pager: subgrid_pager_id,
  3116. });
  3117. }
  3118. //采购拒收单
  3119. function gridList10() {
  3120. var $gridList = $("#gridList");
  3121. var queryJson = {
  3122. POCode: $("#txt_POCode").val(),
  3123. VenCode: $("#txt_VenCode").val(),
  3124. VenName: $("#txt_VenName").val(),
  3125. InvCode: $("#txt_InvCode").val(),
  3126. InvName: $("#txt_InvName").val(),
  3127. BatchCode: $("#txt_BatchCode").val(),
  3128. POStatus: $("#selShow").val()
  3129. }
  3130. $gridList.dataGrid({
  3131. url: "/PNWMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  3132. postData: { queryJson: JSON.stringify(queryJson) },
  3133. height: $(window).height() - 200,
  3134. width: $(window).width() - 300,
  3135. colModel: _Clos,
  3136. //colModel: [
  3137. // { label: "主键", name: "ID", hidden: true, key: true },
  3138. // { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  3139. // { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  3140. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  3141. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  3142. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3143. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3144. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3145. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3146. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  3147. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3148. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3149. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3150. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3151. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3152. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  3153. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3154. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3155. //],
  3156. //colModel: ColModelMain,
  3157. width: "100%",
  3158. autowidth: true,
  3159. //shrinkToFit: true,
  3160. gridComplete: function () {
  3161. },
  3162. pager: "#gridPager",
  3163. //sortname: 'DNCode,cast(Sequence as int)',
  3164. sortname: "DNCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3165. sortorder: "asc",
  3166. viewrecords: true,
  3167. multiselect: true,
  3168. //beforeSelectRow: function (rowid, e) {
  3169. // $("#gridList").jqGrid('resetSelection');
  3170. // return (true);
  3171. //},
  3172. subGrid: true, // (1)开启子表格支持
  3173. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3174. $("#gridList").jqGrid("setSelection", rowid, false);
  3175. bindSubGrid10(subgrid_id, rowid)
  3176. }
  3177. });
  3178. $("#warehouse a.btn-default").click(function () {
  3179. $("#warehouse a.btn-default").removeClass("active");
  3180. $(this).addClass("active");
  3181. $('#btn_search').trigger("click");
  3182. });
  3183. $("#btn_search").click(function () {
  3184. var warehouse = $("#warehouse a.active").attr('data-value');
  3185. var queryJson = {
  3186. POCode: $("#txt_POCode").val(),
  3187. VenCode: $("#txt_VenCode").val(),
  3188. VenName: $("#txt_VenName").val(),
  3189. InvCode: $("#txt_InvCode").val(),
  3190. InvName: $("#txt_InvName").val(),
  3191. BatchCode: $("#txt_BatchCode").val(),
  3192. POStatus: $("#selShow").val()
  3193. }
  3194. $gridList.jqGrid('setGridParam', {
  3195. postData: { queryJson: JSON.stringify(queryJson) },
  3196. }).trigger('reloadGrid');
  3197. });
  3198. }
  3199. function bindSubGrid10(subgrid_id, rowid) {
  3200. $("#gridList").jqGrid("setSelection", rowid, false);
  3201. var subgrid_table_id;
  3202. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3203. var subgrid_pager_id;
  3204. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3205. // (5)动态添加子报表的table和pager
  3206. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3207. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  3208. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3209. // (6)创建jqGrid对象
  3210. $("#" + subgrid_table_id).dataGrid({
  3211. cellEdit: true,
  3212. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3213. //colModel: [
  3214. // { label: "主键", name: "ID", hidden: true, key: true },
  3215. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3216. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3217. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3218. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3219. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3220. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3221. //],
  3222. colModel: _Clos1,
  3223. //colModel: ColModelSub,
  3224. shrinkToFit: true,//宽度自适应
  3225. multiselect: true,
  3226. prmNames: { search: "search" },
  3227. viewrecords: true,
  3228. height: "100%",
  3229. rowNum: 20,
  3230. pager: subgrid_pager_id,
  3231. });
  3232. }
  3233. //委外拒收单生成条码
  3234. function gridList11() {
  3235. var $gridList = $("#gridList");
  3236. var queryJson = {
  3237. POCode: $("#txt_POCode").val(),
  3238. VenCode: $("#txt_VenCode").val(),
  3239. VenName: $("#txt_VenName").val(),
  3240. InvCode: $("#txt_InvCode").val(),
  3241. InvName: $("#txt_InvName").val(),
  3242. BatchCode: $("#txt_BatchCode").val(),
  3243. POStatus: $("#selShow").val()
  3244. }
  3245. $gridList.dataGrid({
  3246. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  3247. postData: { queryJson: JSON.stringify(queryJson) },
  3248. height: $(window).height() - 200,
  3249. width: $(window).width() - 300,
  3250. colModel: _Clos,
  3251. //colModel: [
  3252. // { label: "主键", name: "ID", hidden: true, key: true },
  3253. // { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  3254. // { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  3255. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  3256. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  3257. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  3258. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  3259. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  3260. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  3261. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  3262. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3263. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3264. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  3265. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3266. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  3267. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  3268. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  3269. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  3270. //],
  3271. //colModel: ColModelMain,
  3272. width: "100%",
  3273. autowidth: true,
  3274. //shrinkToFit: true,
  3275. gridComplete: function () {
  3276. },
  3277. pager: "#gridPager",
  3278. // sortname: 'OOCode,cast(Sequence as int)',
  3279. sortname: "OOCode,REPLICATE('0',10-len(OOSequence))+OOSequence ",
  3280. sortorder: "asc",
  3281. viewrecords: true,
  3282. multiselect: true,
  3283. //beforeSelectRow: function (rowid, e) {
  3284. // $("#gridList").jqGrid('resetSelection');
  3285. // return (true);
  3286. //},
  3287. subGrid: true, // (1)开启子表格支持
  3288. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3289. $("#gridList").jqGrid("setSelection", rowid, false);
  3290. bindSubGrid11(subgrid_id, rowid)
  3291. }
  3292. });
  3293. $("#warehouse a.btn-default").click(function () {
  3294. $("#warehouse a.btn-default").removeClass("active");
  3295. $(this).addClass("active");
  3296. $('#btn_search').trigger("click");
  3297. });
  3298. $("#btn_search").click(function () {
  3299. var warehouse = $("#warehouse a.active").attr('data-value');
  3300. var queryJson = {
  3301. POCode: $("#txt_POCode").val(),
  3302. VenCode: $("#txt_VenCode").val(),
  3303. VenName: $("#txt_VenName").val(),
  3304. InvCode: $("#txt_InvCode").val(),
  3305. InvName: $("#txt_InvName").val(),
  3306. BatchCode: $("#txt_BatchCode").val(),
  3307. POStatus: $("#selShow").val()
  3308. }
  3309. $gridList.jqGrid('setGridParam', {
  3310. postData: { queryJson: JSON.stringify(queryJson) },
  3311. }).trigger('reloadGrid');
  3312. });
  3313. }
  3314. function bindSubGrid11(subgrid_id, rowid) {
  3315. $("#gridList").jqGrid("setSelection", rowid, false);
  3316. var subgrid_table_id;
  3317. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3318. var subgrid_pager_id;
  3319. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3320. // (5)动态添加子报表的table和pager
  3321. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3322. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).OOCode;
  3323. var Sequence = $("#gridList").jqGrid('getRowData', rowid).OOSequence;
  3324. // (6)创建jqGrid对象
  3325. $("#" + subgrid_table_id).dataGrid({
  3326. cellEdit: true,
  3327. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3328. //colModel: [
  3329. // { label: "主键", name: "ID", hidden: true, key: true },
  3330. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3331. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3332. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3333. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3334. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3335. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3336. //],
  3337. colModel: _Clos1,
  3338. //colModel: ColModelSub,
  3339. shrinkToFit: true,//宽度自适应
  3340. multiselect: true,
  3341. prmNames: { search: "search" },
  3342. viewrecords: true,
  3343. height: "100%",
  3344. rowNum: 20,
  3345. pager: subgrid_pager_id,
  3346. });
  3347. }
  3348. //领料申请退料生成条码
  3349. function gridList12() {
  3350. var $gridList = $("#gridList");
  3351. var queryJson = {
  3352. POCode: $("#txt_POCode").val(),
  3353. InvCode: $("#txt_InvCode").val(),
  3354. InvName: $("#txt_InvName").val(),
  3355. BatchCode: $("#txt_BatchCode").val(),
  3356. FromTime: $("#FromTime").val(),
  3357. ToTime: $("#ToTime").val(),
  3358. POStatus: $("#selShow").val()
  3359. }
  3360. $gridList.dataGrid({
  3361. url: "/PNWMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  3362. postData: { queryJson: JSON.stringify(queryJson) },
  3363. height: $(window).height() - 200,
  3364. width: $(window).width() - 300,
  3365. colModel: _Clos,
  3366. //colModel: [
  3367. // { label: "主键", name: "ID", hidden: true, key: true },
  3368. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  3369. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3370. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  3371. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3372. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  3373. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3374. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3375. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3376. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3377. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3378. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3379. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3380. //],
  3381. //colModel: ColModelMain,
  3382. width: "100%",
  3383. autowidth: true,
  3384. //shrinkToFit: true,
  3385. gridComplete: function () {
  3386. },
  3387. pager: "#gridPager",
  3388. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  3389. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3390. sortorder: "asc",
  3391. viewrecords: true,
  3392. multiselect: true,
  3393. //beforeSelectRow: function (rowid, e) {
  3394. // $("#gridList").jqGrid('resetSelection');
  3395. // return (true);
  3396. //},
  3397. subGrid: true, // (1)开启子表格支持
  3398. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3399. $("#gridList").jqGrid("setSelection", rowid, false);
  3400. bindSubGrid12(subgrid_id, rowid)
  3401. }
  3402. });
  3403. $("#warehouse a.btn-default").click(function () {
  3404. $("#warehouse a.btn-default").removeClass("active");
  3405. $(this).addClass("active");
  3406. $('#btn_search').trigger("click");
  3407. });
  3408. $("#btn_search").click(function () {
  3409. var warehouse = $("#warehouse a.active").attr('data-value');
  3410. var queryJson = {
  3411. POCode: $("#txt_POCode").val(),
  3412. InvCode: $("#txt_InvCode").val(),
  3413. InvName: $("#txt_InvName").val(),
  3414. BatchCode: $("#txt_BatchCode").val(),
  3415. FromTime: $("#FromTime").val(),
  3416. ToTime: $("#ToTime").val(),
  3417. POStatus: $("#selShow").val()
  3418. }
  3419. $gridList.jqGrid('setGridParam', {
  3420. postData: { queryJson: JSON.stringify(queryJson) },
  3421. }).trigger('reloadGrid');
  3422. });
  3423. }
  3424. function bindSubGrid12(subgrid_id, rowid) {
  3425. $("#gridList").jqGrid("setSelection", rowid, false);
  3426. var subgrid_table_id;
  3427. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3428. var subgrid_pager_id;
  3429. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3430. // (5)动态添加子报表的table和pager
  3431. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3432. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  3433. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3434. // (6)创建jqGrid对象
  3435. $("#" + subgrid_table_id).dataGrid({
  3436. cellEdit: true,
  3437. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3438. //colModel: [
  3439. // { label: "主键", name: "ID", hidden: true, key: true },
  3440. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3441. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3442. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3443. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3444. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3445. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3446. //],
  3447. colModel: _Clos1,
  3448. //colModel: ColModelSub,
  3449. shrinkToFit: true,//宽度自适应
  3450. multiselect: true,
  3451. prmNames: { search: "search" },
  3452. viewrecords: true,
  3453. height: "100%",
  3454. rowNum: 20,
  3455. pager: subgrid_pager_id,
  3456. });
  3457. }
  3458. //材料出库退料
  3459. function gridList13() {
  3460. var $gridList = $("#gridList");
  3461. var queryJson = {
  3462. POCode: $("#txt_POCode").val(),
  3463. InvCode: $("#txt_InvCode").val(),
  3464. InvName: $("#txt_InvName").val(),
  3465. BatchCode: $("#txt_BatchCode").val(),
  3466. POStatus: $("#selShow").val(),
  3467. SCode: $("#txt_SCode").val(),
  3468. }
  3469. $gridList.dataGrid({
  3470. url: "/PNWMS/WMSCreateItemLot/GetGridJsonCLCK" + "?" + Math.random(),
  3471. postData: { queryJson: JSON.stringify(queryJson) },
  3472. height: $(window).height() - 200,
  3473. width: $(window).width() - 300,
  3474. colModel: _Clos,
  3475. //colModel: [
  3476. // { label: "主键", name: "ID", hidden: true, key: true },
  3477. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  3478. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3479. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  3480. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3481. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  3482. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3483. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3484. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3485. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3486. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3487. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3488. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3489. //],
  3490. //colModel: ColModelMain,
  3491. width: "100%",
  3492. autowidth: true,
  3493. //shrinkToFit: true,
  3494. gridComplete: function () {
  3495. },
  3496. pager: "#gridPager",
  3497. // sortname: 'ApplyNegCode,cast(Sequence as int)',
  3498. sortname: "ApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3499. sortorder: "asc",
  3500. viewrecords: true,
  3501. multiselect: true,
  3502. //beforeSelectRow: function (rowid, e) {
  3503. // $("#gridList").jqGrid('resetSelection');
  3504. // return (true);
  3505. //},
  3506. subGrid: true, // (1)开启子表格支持
  3507. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3508. $("#gridList").jqGrid("setSelection", rowid, false);
  3509. bindSubGrid13(subgrid_id, rowid)
  3510. }
  3511. });
  3512. $("#warehouse a.btn-default").click(function () {
  3513. $("#warehouse a.btn-default").removeClass("active");
  3514. $(this).addClass("active");
  3515. $('#btn_search').trigger("click");
  3516. });
  3517. $("#btn_search").click(function () {
  3518. var warehouse = $("#warehouse a.active").attr('data-value');
  3519. var queryJson = {
  3520. POCode: $("#txt_POCode").val(),
  3521. InvCode: $("#txt_InvCode").val(),
  3522. InvName: $("#txt_InvName").val(),
  3523. BatchCode: $("#txt_BatchCode").val(),
  3524. POStatus: $("#selShow").val(),
  3525. SCode: $("#txt_SCode").val(),
  3526. }
  3527. $gridList.jqGrid('setGridParam', {
  3528. postData: { queryJson: JSON.stringify(queryJson) },
  3529. }).trigger('reloadGrid');
  3530. });
  3531. }
  3532. function bindSubGrid13(subgrid_id, rowid) {
  3533. $("#gridList").jqGrid("setSelection", rowid, false);
  3534. var subgrid_table_id;
  3535. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3536. var subgrid_pager_id;
  3537. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3538. // (5)动态添加子报表的table和pager
  3539. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3540. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  3541. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3542. // (6)创建jqGrid对象
  3543. $("#" + subgrid_table_id).dataGrid({
  3544. cellEdit: true,
  3545. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3546. //colModel: [
  3547. // { label: "主键", name: "ID", hidden: true, key: true },
  3548. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3549. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3550. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3551. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3552. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3553. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3554. //],
  3555. colModel: _Clos1,
  3556. //colModel: ColModelSub,
  3557. shrinkToFit: true,//宽度自适应
  3558. multiselect: true,
  3559. prmNames: { search: "search" },
  3560. viewrecords: true,
  3561. height: "100%",
  3562. rowNum: 20,
  3563. pager: subgrid_pager_id,
  3564. });
  3565. }
  3566. //委外领料申请退料
  3567. function gridList14() {
  3568. var $gridList = $("#gridList");
  3569. var queryJson = {
  3570. POCode: $("#txt_POCode").val(),
  3571. InvCode: $("#txt_InvCode").val(),
  3572. InvName: $("#txt_InvName").val(),
  3573. BatchCode: $("#txt_BatchCode").val(),
  3574. POStatus: $("#selShow").val()
  3575. }
  3576. $gridList.dataGrid({
  3577. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWWLLTL" + "?" + Math.random(),
  3578. postData: { queryJson: JSON.stringify(queryJson) },
  3579. height: $(window).height() - 200,
  3580. width: $(window).width() - 300,
  3581. colModel: _Clos,
  3582. //colModel: [
  3583. // { label: "主键", name: "ID", hidden: true, key: true },
  3584. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3585. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3586. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3587. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3588. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3589. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3590. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3591. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3592. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3593. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3594. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3595. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3596. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3597. //],
  3598. //colModel: ColModelMain,
  3599. width: "100%",
  3600. autowidth: true,
  3601. //shrinkToFit: true,
  3602. gridComplete: function () {
  3603. },
  3604. pager: "#gridPager",
  3605. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3606. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3607. sortorder: "asc",
  3608. viewrecords: true,
  3609. multiselect: true,
  3610. //beforeSelectRow: function (rowid, e) {
  3611. // $("#gridList").jqGrid('resetSelection');
  3612. // return (true);
  3613. //},
  3614. subGrid: true, // (1)开启子表格支持
  3615. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3616. $("#gridList").jqGrid("setSelection", rowid, false);
  3617. bindSubGrid14(subgrid_id, rowid)
  3618. }
  3619. });
  3620. $("#warehouse a.btn-default").click(function () {
  3621. $("#warehouse a.btn-default").removeClass("active");
  3622. $(this).addClass("active");
  3623. $('#btn_search').trigger("click");
  3624. });
  3625. $("#btn_search").click(function () {
  3626. var warehouse = $("#warehouse a.active").attr('data-value');
  3627. var queryJson = {
  3628. POCode: $("#txt_POCode").val(),
  3629. InvCode: $("#txt_InvCode").val(),
  3630. InvName: $("#txt_InvName").val(),
  3631. BatchCode: $("#txt_BatchCode").val(),
  3632. POStatus: $("#selShow").val()
  3633. }
  3634. $gridList.jqGrid('setGridParam', {
  3635. postData: { queryJson: JSON.stringify(queryJson) },
  3636. }).trigger('reloadGrid');
  3637. });
  3638. }
  3639. function bindSubGrid14(subgrid_id, rowid) {
  3640. $("#gridList").jqGrid("setSelection", rowid, false);
  3641. var subgrid_table_id;
  3642. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3643. var subgrid_pager_id;
  3644. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3645. // (5)动态添加子报表的table和pager
  3646. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3647. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3648. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3649. // (6)创建jqGrid对象
  3650. $("#" + subgrid_table_id).dataGrid({
  3651. cellEdit: true,
  3652. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3653. //colModel: [
  3654. // { label: "主键", name: "ID", hidden: true, key: true },
  3655. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3656. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3657. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3658. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3659. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3660. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3661. //],
  3662. colModel: _Clos1,
  3663. //colModel: ColModelSub,
  3664. shrinkToFit: true,//宽度自适应
  3665. multiselect: true,
  3666. prmNames: { search: "search" },
  3667. viewrecords: true,
  3668. height: "100%",
  3669. rowNum: 20,
  3670. pager: subgrid_pager_id,
  3671. });
  3672. }
  3673. //委外材料出库
  3674. function gridList15() {
  3675. var $gridList = $("#gridList");
  3676. var queryJson = {
  3677. POCode: $("#txt_POCode").val(),
  3678. InvCode: $("#txt_InvCode").val(),
  3679. InvName: $("#txt_InvName").val(),
  3680. BatchCode: $("#txt_BatchCode").val(),
  3681. POStatus: $("#selShow").val()
  3682. }
  3683. $gridList.dataGrid({
  3684. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWWCLCK" + "?" + Math.random(),
  3685. postData: { queryJson: JSON.stringify(queryJson) },
  3686. height: $(window).height() - 200,
  3687. width: $(window).width() - 300,
  3688. colModel: _Clos,
  3689. //colModel: [
  3690. // { label: "主键", name: "ID", hidden: true, key: true },
  3691. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3692. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3693. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3694. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3695. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3696. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3697. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3698. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3699. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3700. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3701. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3702. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3703. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3704. //],
  3705. //colModel: ColModelMain,
  3706. width: "100%",
  3707. autowidth: true,
  3708. //shrinkToFit: true,
  3709. gridComplete: function () {
  3710. },
  3711. pager: "#gridPager",
  3712. //sortname: 'OApplyNegCode,cast(Sequence as int)',
  3713. sortname: "OApplyNegCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3714. sortorder: "asc",
  3715. viewrecords: true,
  3716. multiselect: true,
  3717. //beforeSelectRow: function (rowid, e) {
  3718. // $("#gridList").jqGrid('resetSelection');
  3719. // return (true);
  3720. //},
  3721. subGrid: true, // (1)开启子表格支持
  3722. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3723. $("#gridList").jqGrid("setSelection", rowid, false);
  3724. bindSubGrid15(subgrid_id, rowid)
  3725. }
  3726. });
  3727. $("#warehouse a.btn-default").click(function () {
  3728. $("#warehouse a.btn-default").removeClass("active");
  3729. $(this).addClass("active");
  3730. $('#btn_search').trigger("click");
  3731. });
  3732. $("#btn_search").click(function () {
  3733. var warehouse = $("#warehouse a.active").attr('data-value');
  3734. var queryJson = {
  3735. POCode: $("#txt_POCode").val(),
  3736. InvCode: $("#txt_InvCode").val(),
  3737. InvName: $("#txt_InvName").val(),
  3738. BatchCode: $("#txt_BatchCode").val(),
  3739. POStatus: $("#selShow").val()
  3740. }
  3741. $gridList.jqGrid('setGridParam', {
  3742. postData: { queryJson: JSON.stringify(queryJson) },
  3743. }).trigger('reloadGrid');
  3744. });
  3745. }
  3746. function bindSubGrid15(subgrid_id, rowid) {
  3747. $("#gridList").jqGrid("setSelection", rowid, false);
  3748. var subgrid_table_id;
  3749. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3750. var subgrid_pager_id;
  3751. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3752. // (5)动态添加子报表的table和pager
  3753. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3754. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  3755. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3756. // (6)创建jqGrid对象
  3757. $("#" + subgrid_table_id).dataGrid({
  3758. cellEdit: true,
  3759. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3760. //colModel: [
  3761. // { label: "主键", name: "ID", hidden: true, key: true },
  3762. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3763. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3764. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3765. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3766. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3767. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3768. //],
  3769. colModel: _Clos1,
  3770. //colModel: ColModelSub,
  3771. shrinkToFit: true,//宽度自适应
  3772. //multiselect: true,
  3773. prmNames: { search: "search" },
  3774. multiselect: true,
  3775. viewrecords: true,
  3776. height: "100%",
  3777. rowNum: 20,
  3778. pager: subgrid_pager_id,
  3779. });
  3780. }
  3781. function gridList16() {
  3782. var $gridList = $("#gridList");
  3783. var queryJson = {
  3784. POCode: $("#txt_POCode").val(),
  3785. InvCode: $("#txt_InvCode").val(),
  3786. InvName: $("#txt_InvName").val(),
  3787. BatchCode: $("#txt_BatchCode").val(),
  3788. POStatus: $("#selShow").val()
  3789. }
  3790. $gridList.dataGrid({
  3791. url: "/PNWMS/WMSCreateItemLot/GetGridJsonFGGD" + "?" + Math.random(),
  3792. postData: { queryJson: JSON.stringify(queryJson) },
  3793. height: $(window).height() - 200,
  3794. width: $(window).width() - 300,
  3795. colModel: _Clos,
  3796. //colModel: [
  3797. // { label: "主键", name: "ID", hidden: true, key: true },
  3798. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3799. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3800. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3801. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3802. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3803. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3804. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3805. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3806. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3807. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3808. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3809. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3810. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3811. //],
  3812. //colModel: ColModelMain,
  3813. width: "100%",
  3814. autowidth: true,
  3815. //shrinkToFit: true,
  3816. gridComplete: function () {
  3817. },
  3818. pager: "#gridPager",
  3819. // sortname: 'MOCode,cast(Sequence as int)',
  3820. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  3821. sortorder: "asc",
  3822. viewrecords: true,
  3823. multiselect: true,
  3824. //beforeSelectRow: function (rowid, e) {
  3825. // $("#gridList").jqGrid('resetSelection');
  3826. // return (true);
  3827. //},
  3828. subGrid: true, // (1)开启子表格支持
  3829. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3830. $("#gridList").jqGrid("setSelection", rowid, false);
  3831. bindSubGrid16(subgrid_id, rowid)
  3832. }
  3833. });
  3834. $("#warehouse a.btn-default").click(function () {
  3835. $("#warehouse a.btn-default").removeClass("active");
  3836. $(this).addClass("active");
  3837. $('#btn_search').trigger("click");
  3838. });
  3839. $("#btn_search").click(function () {
  3840. var warehouse = $("#warehouse a.active").attr('data-value');
  3841. var queryJson = {
  3842. POCode: $("#txt_POCode").val(),
  3843. InvCode: $("#txt_InvCode").val(),
  3844. InvName: $("#txt_InvName").val(),
  3845. BatchCode: $("#txt_BatchCode").val(),
  3846. POStatus: $("#selShow").val()
  3847. }
  3848. $gridList.jqGrid('setGridParam', {
  3849. postData: { queryJson: JSON.stringify(queryJson) },
  3850. }).trigger('reloadGrid');
  3851. });
  3852. }
  3853. function bindSubGrid16(subgrid_id, rowid) {
  3854. $("#gridList").jqGrid("setSelection", rowid, false);
  3855. var subgrid_table_id;
  3856. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3857. var subgrid_pager_id;
  3858. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3859. // (5)动态添加子报表的table和pager
  3860. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3861. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  3862. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3863. // (6)创建jqGrid对象
  3864. $("#" + subgrid_table_id).dataGrid({
  3865. cellEdit: true,
  3866. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3867. //colModel: [
  3868. // { label: "主键", name: "ID", hidden: true, key: true },
  3869. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3870. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3871. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3872. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3873. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3874. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3875. //],
  3876. colModel: _Clos1,
  3877. //colModel: ColModelSub,
  3878. shrinkToFit: true,//宽度自适应
  3879. multiselect: true,
  3880. prmNames: { search: "search" },
  3881. viewrecords: true,
  3882. height: "100%",
  3883. rowNum: 20,
  3884. pager: subgrid_pager_id,
  3885. });
  3886. }
  3887. //检验不合格
  3888. function gridList17() {
  3889. var $gridList = $("#gridList");
  3890. var queryJson = {
  3891. POCode: $("#txt_POCode").val(),
  3892. InvCode: $("#txt_InvCode").val(),
  3893. InvName: $("#txt_InvName").val(),
  3894. BatchCode: $("#txt_BatchCode").val(),
  3895. POStatus: $("#selShow").val()
  3896. }
  3897. $gridList.dataGrid({
  3898. url: "/PNWMS/WMSCreateItemLot/GetGridJsonBHGTM" + "?" + Math.random(),
  3899. postData: { queryJson: JSON.stringify(queryJson) },
  3900. height: $(window).height() - 200,
  3901. width: $(window).width() - 300,
  3902. colModel: _Clos,
  3903. //colModel: [
  3904. // { label: "主键", name: "ID", hidden: true, key: true },
  3905. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  3906. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  3907. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  3908. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  3909. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  3910. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  3911. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  3912. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  3913. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  3914. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  3915. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3916. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  3917. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  3918. //],
  3919. //colModel: ColModelMain,
  3920. width: "100%",
  3921. autowidth: true,
  3922. //shrinkToFit: true,
  3923. gridComplete: function () {
  3924. },
  3925. pager: "#gridPager",
  3926. sortname: 'LotNo',
  3927. sortorder: "asc",
  3928. viewrecords: true,
  3929. multiselect: true,
  3930. //beforeSelectRow: function (rowid, e) {
  3931. // $("#gridList").jqGrid('resetSelection');
  3932. // return (true);
  3933. //},
  3934. subGrid: true, // (1)开启子表格支持
  3935. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  3936. $("#gridList").jqGrid("setSelection", rowid, false);
  3937. bindSubGrid17(subgrid_id, rowid)
  3938. }
  3939. });
  3940. $("#warehouse a.btn-default").click(function () {
  3941. $("#warehouse a.btn-default").removeClass("active");
  3942. $(this).addClass("active");
  3943. $('#btn_search').trigger("click");
  3944. });
  3945. $("#btn_search").click(function () {
  3946. var warehouse = $("#warehouse a.active").attr('data-value');
  3947. var queryJson = {
  3948. POCode: $("#txt_POCode").val(),
  3949. InvCode: $("#txt_InvCode").val(),
  3950. InvName: $("#txt_InvName").val(),
  3951. BatchCode: $("#txt_BatchCode").val(),
  3952. POStatus: $("#selShow").val()
  3953. }
  3954. $gridList.jqGrid('setGridParam', {
  3955. postData: { queryJson: JSON.stringify(queryJson) },
  3956. }).trigger('reloadGrid');
  3957. });
  3958. }
  3959. function bindSubGrid17(subgrid_id, rowid) {
  3960. $("#gridList").jqGrid("setSelection", rowid, false);
  3961. var subgrid_table_id;
  3962. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  3963. var subgrid_pager_id;
  3964. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  3965. // (5)动态添加子报表的table和pager
  3966. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  3967. var LotNo = $("#gridList").jqGrid('getRowData', rowid).LotNo;
  3968. // var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  3969. // (6)创建jqGrid对象
  3970. $("#" + subgrid_table_id).dataGrid({
  3971. cellEdit: true,
  3972. url: "/PNWMS/WMSCreateItemLot/GetSubGridJsonBHGTM?LotNo=" + LotNo + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  3973. //colModel: [
  3974. // { label: "主键", name: "ID", hidden: true, key: true },
  3975. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  3976. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  3977. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  3978. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  3979. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  3980. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  3981. //],
  3982. colModel: _Clos1,
  3983. //colModel: ColModelSub,
  3984. shrinkToFit: true,//宽度自适应
  3985. multiselect: true,
  3986. prmNames: { search: "search" },
  3987. viewrecords: true,
  3988. height: "100%",
  3989. rowNum: 20,
  3990. pager: subgrid_pager_id,
  3991. });
  3992. }
  3993. function gridList18() {
  3994. var $gridList = $("#gridList");
  3995. var queryJson = {
  3996. POCode: $("#txt_POCode").val(),
  3997. InvCode: $("#txt_InvCode").val(),
  3998. InvName: $("#txt_InvName").val(),
  3999. BatchCode: $("#txt_BatchCode").val(),
  4000. POStatus: $("#selShow").val()
  4001. }
  4002. $gridList.dataGrid({
  4003. url: "/PNWMS/WMSCreateItemLot/GetGridJsonFCP" + "?" + Math.random(),
  4004. postData: { queryJson: JSON.stringify(queryJson) },
  4005. height: $(window).height() - 200,
  4006. width: $(window).width() - 300,
  4007. colModel: _Clos,
  4008. //colModel: [
  4009. // { label: "主键", name: "ID", hidden: true, key: true },
  4010. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  4011. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  4012. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  4013. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  4014. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  4015. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  4016. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  4017. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  4018. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  4019. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  4020. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  4021. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  4022. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  4023. //],
  4024. //colModel: ColModelMain,
  4025. width: "100%",
  4026. autowidth: true,
  4027. //shrinkToFit: true,
  4028. gridComplete: function () {
  4029. },
  4030. pager: "#gridPager",
  4031. // sortname: 'MOCode,cast(Sequence as int)',
  4032. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  4033. sortorder: "asc",
  4034. viewrecords: true,
  4035. multiselect: true,
  4036. //beforeSelectRow: function (rowid, e) {
  4037. // $("#gridList").jqGrid('resetSelection');
  4038. // return (true);
  4039. //},
  4040. subGrid: true, // (1)开启子表格支持
  4041. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4042. $("#gridList").jqGrid("setSelection", rowid, false);
  4043. bindSubGrid18(subgrid_id, rowid)
  4044. }
  4045. });
  4046. $("#warehouse a.btn-default").click(function () {
  4047. $("#warehouse a.btn-default").removeClass("active");
  4048. $(this).addClass("active");
  4049. $('#btn_search').trigger("click");
  4050. });
  4051. $("#btn_search").click(function () {
  4052. var warehouse = $("#warehouse a.active").attr('data-value');
  4053. var queryJson = {
  4054. POCode: $("#txt_POCode").val(),
  4055. InvCode: $("#txt_InvCode").val(),
  4056. InvName: $("#txt_InvName").val(),
  4057. BatchCode: $("#txt_BatchCode").val(),
  4058. POStatus: $("#selShow").val()
  4059. }
  4060. $gridList.jqGrid('setGridParam', {
  4061. postData: { queryJson: JSON.stringify(queryJson) },
  4062. }).trigger('reloadGrid');
  4063. });
  4064. }
  4065. function bindSubGrid18(subgrid_id, rowid) {
  4066. $("#gridList").jqGrid("setSelection", rowid, false);
  4067. var subgrid_table_id;
  4068. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4069. var subgrid_pager_id;
  4070. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4071. // (5)动态添加子报表的table和pager
  4072. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4073. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  4074. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4075. // (6)创建jqGrid对象
  4076. $("#" + subgrid_table_id).dataGrid({
  4077. cellEdit: true,
  4078. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4079. //colModel: [
  4080. // { label: "主键", name: "ID", hidden: true, key: true },
  4081. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  4082. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  4083. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  4084. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  4085. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  4086. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  4087. //],
  4088. colModel: _Clos1,
  4089. //colModel: ColModelSub,
  4090. shrinkToFit: true,//宽度自适应
  4091. multiselect: true,
  4092. prmNames: { search: "search" },
  4093. viewrecords: true,
  4094. height: "100%",
  4095. rowNum: 20,
  4096. pager: subgrid_pager_id,
  4097. });
  4098. }
  4099. function gridList20() {
  4100. var $gridList = $("#gridList");
  4101. var queryJson = {
  4102. POCode: $("#txt_POCode").val(),
  4103. InvCode: $("#txt_InvCode").val(),
  4104. InvName: $("#txt_InvName").val(),
  4105. BatchCode: $("#txt_BatchCode").val(),
  4106. POStatus: $("#selShow").val()
  4107. }
  4108. $gridList.dataGrid({
  4109. url: "/PNWMS/WMSCreateItemLot/GetGridJsonTransfer" + "?" + Math.random(),
  4110. postData: { queryJson: JSON.stringify(queryJson) },
  4111. height: $(window).height() - 200,
  4112. width: $(window).width() - 300,
  4113. colModel: _Clos,
  4114. width: "100%",
  4115. autowidth: true,
  4116. //shrinkToFit: true,
  4117. gridComplete: function () {
  4118. },
  4119. pager: "#gridPager",
  4120. // sortname: 'MOCode,cast(Sequence as int)',
  4121. sortname: "TransferNO,Cast(Sequence as int) ",
  4122. sortorder: "asc",
  4123. viewrecords: true,
  4124. multiselect: true,
  4125. //beforeSelectRow: function (rowid, e) {
  4126. // $("#gridList").jqGrid('resetSelection');
  4127. // return (true);
  4128. //},
  4129. subGrid: true, // (1)开启子表格支持
  4130. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4131. $("#gridList").jqGrid("setSelection", rowid, false);
  4132. bindSubGrid20(subgrid_id, rowid)
  4133. }
  4134. });
  4135. $("#warehouse a.btn-default").click(function () {
  4136. $("#warehouse a.btn-default").removeClass("active");
  4137. $(this).addClass("active");
  4138. $('#btn_search').trigger("click");
  4139. });
  4140. $("#btn_search").click(function () {
  4141. var warehouse = $("#warehouse a.active").attr('data-value');
  4142. var queryJson = {
  4143. POCode: $("#txt_POCode").val(),
  4144. InvCode: $("#txt_InvCode").val(),
  4145. InvName: $("#txt_InvName").val(),
  4146. BatchCode: $("#txt_BatchCode").val(),
  4147. POStatus: $("#selShow").val()
  4148. }
  4149. $gridList.jqGrid('setGridParam', {
  4150. postData: { queryJson: JSON.stringify(queryJson) },
  4151. }).trigger('reloadGrid');
  4152. });
  4153. }
  4154. function bindSubGrid20(subgrid_id, rowid) {
  4155. debugger;
  4156. $("#gridList").jqGrid("setSelection", rowid, false);
  4157. var subgrid_table_id;
  4158. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4159. var subgrid_pager_id;
  4160. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4161. // (5)动态添加子报表的table和pager
  4162. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4163. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4164. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4165. // (6)创建jqGrid对象
  4166. $("#" + subgrid_table_id).dataGrid({
  4167. cellEdit: true,
  4168. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4169. colModel: _Clos1,
  4170. //colModel: ColModelSub,
  4171. shrinkToFit: true,//宽度自适应
  4172. multiselect: true,
  4173. prmNames: { search: "search" },
  4174. viewrecords: true,
  4175. height: "100%",
  4176. rowNum: 20,
  4177. pager: subgrid_pager_id,
  4178. });
  4179. }
  4180. //采购入库 ICSPurchaseReceive
  4181. function gridList22() {
  4182. var $gridList = $("#gridList");
  4183. var queryJson = {
  4184. POCode: $("#txt_POCode").val(),
  4185. SourceCode: $("#txt_SourceCode").val(),
  4186. InvCode: $("#txt_InvCode").val(),
  4187. InvName: $("#txt_InvName").val(),
  4188. VenCode: $("#txt_VenCode").val(),
  4189. VenName: $("#txt_VenName").val(),
  4190. BatchCode: $("#txt_BatchCode").val(),
  4191. FromTime: $("#FromTime").val(),
  4192. ToTime: $("#ToTime").val(),
  4193. WHCode: $("#txt_WHCode").val(),
  4194. POStatus: $("#selShow").val(),
  4195. WHStatus: $("#selStatus").val(),
  4196. }
  4197. $gridList.dataGrid({
  4198. url: "/PNWMS/WMSCreateItemLot/GetGridJsonPurchaseReceive" + "?" + Math.random(),
  4199. postData: { queryJson: JSON.stringify(queryJson) },
  4200. height: $(window).height() - 200,
  4201. width: $(window).width() - 300,
  4202. colModel: _Clos,
  4203. width: "100%",
  4204. cellEdit: true,
  4205. cellsubmit: "clientArray",
  4206. autowidth: true,
  4207. //shrinkToFit: true,
  4208. gridComplete: function () {
  4209. },
  4210. pager: "#gridPager",
  4211. // sortname: 'MOCode,cast(Sequence as int)',
  4212. sortname: "RCVCode ",
  4213. sortorder: "desc",
  4214. viewrecords: true,
  4215. multiselect: true,
  4216. //beforeSelectRow: function (rowid, e) {
  4217. // $("#gridList").jqGrid('resetSelection');
  4218. // return (true);
  4219. //},
  4220. subGrid: true, // (1)开启子表格支持
  4221. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4222. $("#gridList").jqGrid("setSelection", rowid, false);
  4223. bindSubGrid22(subgrid_id, rowid)
  4224. }
  4225. });
  4226. $("#warehouse a.btn-default").click(function () {
  4227. $("#warehouse a.btn-default").removeClass("active");
  4228. $(this).addClass("active");
  4229. $('#btn_search').trigger("click");
  4230. });
  4231. $("#btn_search").click(function () {
  4232. var warehouse = $("#warehouse a.active").attr('data-value');
  4233. var queryJson = {
  4234. POCode: $("#txt_POCode").val(),
  4235. SourceCode: $("#txt_SourceCode").val(),
  4236. InvCode: $("#txt_InvCode").val(),
  4237. InvName: $("#txt_InvName").val(),
  4238. VenCode: $("#txt_VenCode").val(),
  4239. VenName: $("#txt_VenName").val(),
  4240. BatchCode: $("#txt_BatchCode").val(),
  4241. FromTime: $("#FromTime").val(),
  4242. ToTime: $("#ToTime").val(),
  4243. WHCode: $("#txt_WHCode").val(),
  4244. POStatus: $("#selShow").val(),
  4245. WHStatus: $("#selStatus").val(),
  4246. }
  4247. $gridList.jqGrid('setGridParam', {
  4248. postData: { queryJson: JSON.stringify(queryJson) },
  4249. }).trigger('reloadGrid');
  4250. });
  4251. }
  4252. function bindSubGrid22(subgrid_id, rowid) {
  4253. debugger;
  4254. $("#gridList").jqGrid("setSelection", rowid, false);
  4255. var subgrid_table_id;
  4256. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4257. var subgrid_pager_id;
  4258. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4259. // (5)动态添加子报表的table和pager
  4260. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4261. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  4262. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4263. var isPrint = $("#selPrint").val();
  4264. // (6)创建jqGrid对象
  4265. $("#" + subgrid_table_id).dataGrid({
  4266. cellEdit: true,
  4267. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4268. colModel: _Clos1,
  4269. //colModel: ColModelSub,
  4270. shrinkToFit: true,//宽度自适应
  4271. multiselect: true,
  4272. prmNames: { search: "search" },
  4273. viewrecords: true,
  4274. height: "100%",
  4275. rowNum: 20,
  4276. pager: subgrid_pager_id,
  4277. });
  4278. }
  4279. //委外采购入库 ICSOutPurchaseReceive
  4280. function gridList23() {
  4281. var $gridList = $("#gridList");
  4282. var queryJson = {
  4283. POCode: $("#txt_POCode").val(),
  4284. InvCode: $("#txt_InvCode").val(),
  4285. InvName: $("#txt_InvName").val(),
  4286. BatchCode: $("#txt_BatchCode").val(),
  4287. FromTime: $("#FromTime").val(),
  4288. ToTime: $("#ToTime").val(),
  4289. WHCode: $("#txt_WHCode").val(),
  4290. POStatus: $("#selShow").val()
  4291. }
  4292. $gridList.dataGrid({
  4293. url: "/PNWMS/WMSCreateItemLot/GetGridJsonOutPurchaseReceive" + "?" + Math.random(),
  4294. postData: { queryJson: JSON.stringify(queryJson) },
  4295. height: $(window).height() - 200,
  4296. width: $(window).width() - 300,
  4297. colModel: _Clos,
  4298. width: "100%",
  4299. autowidth: true,
  4300. //shrinkToFit: true,
  4301. gridComplete: function () {
  4302. },
  4303. pager: "#gridPager",
  4304. // sortname: 'MOCode,cast(Sequence as int)',
  4305. sortname: "RCVCode ",
  4306. sortorder: "desc",
  4307. viewrecords: true,
  4308. multiselect: true,
  4309. //beforeSelectRow: function (rowid, e) {
  4310. // $("#gridList").jqGrid('resetSelection');
  4311. // return (true);
  4312. //},
  4313. subGrid: true, // (1)开启子表格支持
  4314. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4315. $("#gridList").jqGrid("setSelection", rowid, false);
  4316. bindSubGrid23(subgrid_id, rowid)
  4317. }
  4318. });
  4319. $("#warehouse a.btn-default").click(function () {
  4320. $("#warehouse a.btn-default").removeClass("active");
  4321. $(this).addClass("active");
  4322. $('#btn_search').trigger("click");
  4323. });
  4324. $("#btn_search").click(function () {
  4325. var warehouse = $("#warehouse a.active").attr('data-value');
  4326. var queryJson = {
  4327. POCode: $("#txt_POCode").val(),
  4328. InvCode: $("#txt_InvCode").val(),
  4329. InvName: $("#txt_InvName").val(),
  4330. BatchCode: $("#txt_BatchCode").val(),
  4331. FromTime: $("#FromTime").val(),
  4332. ToTime: $("#ToTime").val(),
  4333. WHCode: $("#txt_WHCode").val(),
  4334. POStatus: $("#selShow").val()
  4335. }
  4336. $gridList.jqGrid('setGridParam', {
  4337. postData: { queryJson: JSON.stringify(queryJson) },
  4338. }).trigger('reloadGrid');
  4339. });
  4340. }
  4341. function bindSubGrid23(subgrid_id, rowid) {
  4342. debugger;
  4343. $("#gridList").jqGrid("setSelection", rowid, false);
  4344. var subgrid_table_id;
  4345. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4346. var subgrid_pager_id;
  4347. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4348. // (5)动态添加子报表的table和pager
  4349. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4350. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  4351. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4352. // (6)创建jqGrid对象
  4353. $("#" + subgrid_table_id).dataGrid({
  4354. cellEdit: true,
  4355. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4356. colModel: _Clos1,
  4357. //colModel: ColModelSub,
  4358. shrinkToFit: true,//宽度自适应
  4359. multiselect: true,
  4360. prmNames: { search: "search" },
  4361. viewrecords: true,
  4362. height: "100%",
  4363. rowNum: 20,
  4364. pager: subgrid_pager_id,
  4365. });
  4366. }
  4367. //线边仓调拨申请单生成条码(派纳)
  4368. function gridList201() {
  4369. var $gridList = $("#gridList");
  4370. var queryJson = {
  4371. POCode: $("#txt_POCode").val(),
  4372. InvCode: $("#txt_InvCode").val(),
  4373. InvName: $("#txt_InvName").val(),
  4374. BatchCode: $("#txt_BatchCode").val(),
  4375. POStatus: $("#selShow").val()
  4376. }
  4377. $gridList.dataGrid({
  4378. url: "/PNWMS/WMSCreateItemLot/GetGridJsonTransferApplicationPN" + "?" + Math.random(),
  4379. postData: { queryJson: JSON.stringify(queryJson) },
  4380. height: $(window).height() - 200,
  4381. width: $(window).width() - 300,
  4382. colModel: _Clos,
  4383. width: "100%",
  4384. autowidth: true,
  4385. //shrinkToFit: true,
  4386. gridComplete: function () {
  4387. },
  4388. pager: "#gridPager",
  4389. // sortname: 'MOCode,cast(Sequence as int)',
  4390. sortname: "TransferNO,Cast(Sequence as int) ",
  4391. sortorder: "asc",
  4392. viewrecords: true,
  4393. multiselect: true,
  4394. //beforeSelectRow: function (rowid, e) {
  4395. // $("#gridList").jqGrid('resetSelection');
  4396. // return (true);
  4397. //},
  4398. subGrid: true, // (1)开启子表格支持
  4399. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4400. $("#gridList").jqGrid("setSelection", rowid, false);
  4401. bindSubGrid201(subgrid_id, rowid)
  4402. }
  4403. });
  4404. $("#warehouse a.btn-default").click(function () {
  4405. $("#warehouse a.btn-default").removeClass("active");
  4406. $(this).addClass("active");
  4407. $('#btn_search').trigger("click");
  4408. });
  4409. $("#btn_search").click(function () {
  4410. var warehouse = $("#warehouse a.active").attr('data-value');
  4411. var queryJson = {
  4412. POCode: $("#txt_POCode").val(),
  4413. InvCode: $("#txt_InvCode").val(),
  4414. InvName: $("#txt_InvName").val(),
  4415. BatchCode: $("#txt_BatchCode").val(),
  4416. POStatus: $("#selShow").val()
  4417. }
  4418. $gridList.jqGrid('setGridParam', {
  4419. postData: { queryJson: JSON.stringify(queryJson) },
  4420. }).trigger('reloadGrid');
  4421. });
  4422. }
  4423. //调拨申请单生成条码
  4424. function gridList202() {
  4425. var $gridList = $("#gridList");
  4426. var queryJson = {
  4427. POCode: $("#txt_POCode").val(),
  4428. InvCode: $("#txt_InvCode").val(),
  4429. InvName: $("#txt_InvName").val(),
  4430. BatchCode: $("#txt_BatchCode").val(),
  4431. POStatus: $("#selShow").val()
  4432. }
  4433. $gridList.dataGrid({
  4434. url: "/PNWMS/WMSCreateItemLot/GetGridJsonTransferApplication" + "?" + Math.random(),
  4435. postData: { queryJson: JSON.stringify(queryJson) },
  4436. height: $(window).height() - 200,
  4437. width: $(window).width() - 300,
  4438. colModel: _Clos,
  4439. width: "100%",
  4440. autowidth: true,
  4441. //shrinkToFit: true,
  4442. gridComplete: function () {
  4443. },
  4444. pager: "#gridPager",
  4445. // sortname: 'MOCode,cast(Sequence as int)',
  4446. sortname: "TransferNO,Cast(Sequence as int) ",
  4447. sortorder: "asc",
  4448. viewrecords: true,
  4449. multiselect: true,
  4450. //beforeSelectRow: function (rowid, e) {
  4451. // $("#gridList").jqGrid('resetSelection');
  4452. // return (true);
  4453. //},
  4454. subGrid: true, // (1)开启子表格支持
  4455. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4456. $("#gridList").jqGrid("setSelection", rowid, false);
  4457. bindSubGrid202(subgrid_id, rowid)
  4458. }
  4459. });
  4460. $("#warehouse a.btn-default").click(function () {
  4461. $("#warehouse a.btn-default").removeClass("active");
  4462. $(this).addClass("active");
  4463. $('#btn_search').trigger("click");
  4464. });
  4465. $("#btn_search").click(function () {
  4466. var warehouse = $("#warehouse a.active").attr('data-value');
  4467. var queryJson = {
  4468. POCode: $("#txt_POCode").val(),
  4469. InvCode: $("#txt_InvCode").val(),
  4470. InvName: $("#txt_InvName").val(),
  4471. BatchCode: $("#txt_BatchCode").val(),
  4472. POStatus: $("#selShow").val()
  4473. }
  4474. $gridList.jqGrid('setGridParam', {
  4475. postData: { queryJson: JSON.stringify(queryJson) },
  4476. }).trigger('reloadGrid');
  4477. });
  4478. }
  4479. function bindSubGrid201(subgrid_id, rowid) {
  4480. debugger;
  4481. $("#gridList").jqGrid("setSelection", rowid, false);
  4482. var subgrid_table_id;
  4483. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4484. var subgrid_pager_id;
  4485. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4486. // (5)动态添加子报表的table和pager
  4487. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4488. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4489. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4490. // (6)创建jqGrid对象
  4491. $("#" + subgrid_table_id).dataGrid({
  4492. cellEdit: true,
  4493. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4494. colModel: _Clos1,
  4495. //colModel: ColModelSub,
  4496. shrinkToFit: true,//宽度自适应
  4497. multiselect: true,
  4498. prmNames: { search: "search" },
  4499. viewrecords: true,
  4500. height: "100%",
  4501. rowNum: 20,
  4502. pager: subgrid_pager_id,
  4503. });
  4504. }
  4505. function bindSubGrid202(subgrid_id, rowid) {
  4506. debugger;
  4507. $("#gridList").jqGrid("setSelection", rowid, false);
  4508. var subgrid_table_id;
  4509. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4510. var subgrid_pager_id;
  4511. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4512. // (5)动态添加子报表的table和pager
  4513. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4514. var TransferNO = $("#gridList").jqGrid('getRowData', rowid).TransferNO;
  4515. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4516. // (6)创建jqGrid对象
  4517. $("#" + subgrid_table_id).dataGrid({
  4518. cellEdit: true,
  4519. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + TransferNO + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4520. colModel: _Clos1,
  4521. //colModel: ColModelSub,
  4522. shrinkToFit: true,//宽度自适应
  4523. multiselect: true,
  4524. prmNames: { search: "search" },
  4525. viewrecords: true,
  4526. height: "100%",
  4527. rowNum: 20,
  4528. pager: subgrid_pager_id,
  4529. });
  4530. }
  4531. //红字销售出库单
  4532. function gridList24() {
  4533. var $gridList = $("#gridList");
  4534. var queryJson = {
  4535. POCode: $("#txt_POCode").val(),
  4536. VenCode: $("#txt_VenCode").val(),
  4537. VenName: $("#txt_VenName").val(),
  4538. InvCode: $("#txt_InvCode").val(),
  4539. InvName: $("#txt_InvName").val(),
  4540. BatchCode: $("#txt_BatchCode").val(),
  4541. FromTime: $("#FromTime").val(),
  4542. ToTime: $("#ToTime").val(),
  4543. WHCode: $("#txt_WHCode").val(),
  4544. POStatus: $("#selShow").val(),
  4545. WHStatus: $("#selStatus").val()
  4546. }
  4547. $gridList.dataGrid({
  4548. url: "/PNWMS/WMSCreateItemLot/GetGridJsonWMSSSD" + "?" + Math.random(),
  4549. postData: { queryJson: JSON.stringify(queryJson) },
  4550. height: $(window).height() - 200,
  4551. width: $(window).width() - 300,
  4552. colModel: _Clos,
  4553. //colModel: ColModelMain,
  4554. width: "100%",
  4555. autowidth: true,
  4556. //shrinkToFit: true,
  4557. gridComplete: function () {
  4558. },
  4559. pager: "#gridPager",
  4560. //sortname: 'ODNCode,cast(Sequence as int)',
  4561. sortname: "SSDCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  4562. sortorder: "asc",
  4563. viewrecords: true,
  4564. multiselect: true,
  4565. //beforeSelectRow: function (rowid, e) {
  4566. // $("#gridList").jqGrid('resetSelection');
  4567. // return (true);
  4568. //},
  4569. subGrid: true, // (1)开启子表格支持
  4570. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  4571. $("#gridList").jqGrid("setSelection", rowid, false);
  4572. bindSubGrid24(subgrid_id, rowid)
  4573. }
  4574. });
  4575. $("#warehouse a.btn-default").click(function () {
  4576. $("#warehouse a.btn-default").removeClass("active");
  4577. $(this).addClass("active");
  4578. $('#btn_search').trigger("click");
  4579. });
  4580. $("#btn_search").click(function () {
  4581. var warehouse = $("#warehouse a.active").attr('data-value');
  4582. var queryJson = {
  4583. POCode: $("#txt_POCode").val(),
  4584. VenCode: $("#txt_VenCode").val(),
  4585. VenName: $("#txt_VenName").val(),
  4586. InvCode: $("#txt_InvCode").val(),
  4587. InvName: $("#txt_InvName").val(),
  4588. BatchCode: $("#txt_BatchCode").val(),
  4589. FromTime: $("#FromTime").val(),
  4590. ToTime: $("#ToTime").val(),
  4591. WHCode: $("#txt_WHCode").val(),
  4592. POStatus: $("#selShow").val(),
  4593. WHStatus: $("#selStatus").val()
  4594. }
  4595. $gridList.jqGrid('setGridParam', {
  4596. postData: { queryJson: JSON.stringify(queryJson) },
  4597. }).trigger('reloadGrid');
  4598. });
  4599. }
  4600. function bindSubGrid24(subgrid_id, rowid) {
  4601. $("#gridList").jqGrid("setSelection", rowid, false);
  4602. var subgrid_table_id;
  4603. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  4604. var subgrid_pager_id;
  4605. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  4606. // (5)动态添加子报表的table和pager
  4607. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  4608. var SSDCode = $("#gridList").jqGrid('getRowData', rowid).SSDCode;
  4609. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  4610. // (6)创建jqGrid对象
  4611. $("#" + subgrid_table_id).dataGrid({
  4612. cellEdit: true,
  4613. url: "/PNWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SSDCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  4614. //colModel: [
  4615. // { label: "主键", name: "ID", hidden: true, key: true },
  4616. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  4617. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  4618. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  4619. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  4620. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  4621. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  4622. //],
  4623. colModel: _Clos1,
  4624. //colModel: ColModelSub,
  4625. shrinkToFit: true,//宽度自适应
  4626. multiselect: true,
  4627. prmNames: { search: "search" },
  4628. viewrecords: true,
  4629. height: "100%",
  4630. rowNum: 20,
  4631. pager: subgrid_pager_id,
  4632. });
  4633. }
  4634. function btnDelete() {
  4635. var objArr = '';
  4636. var obj = $("#gridList").jqGrid("getRowData");
  4637. for (var i = 0; i < obj.length; i++) {
  4638. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  4639. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  4640. if (rowData != "undefined" && rowData != null) {
  4641. for (var j = 0; j < rowData.length; j++) {
  4642. objArr += "'" + rowData[j] + "',";
  4643. }
  4644. }
  4645. }
  4646. if (objArr == "") {
  4647. $.modalAlertNew("WMS00099");
  4648. return;
  4649. }
  4650. $.deleteForm({
  4651. url: "/PNWMS/WMSCreateItemLot/DeleteItemLot",
  4652. param: { keyValue: JSON.stringify(objArr) },
  4653. success: function () {
  4654. $.currentWindow().$("#gridList").trigger("reloadGrid");
  4655. }
  4656. })
  4657. }
  4658. function dateChange(num, date) {
  4659. if (!date) {
  4660. date = new Date();//没有传入值时,默认是当前日期
  4661. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4662. }
  4663. date += " 00:00:00";//设置为当天凌晨12点
  4664. date = Date.parse(new Date(date)) / 1000;//转换为时间戳
  4665. date += (86400) * num;//修改后的时间戳
  4666. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4667. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  4668. }
  4669. function btnCreate() {
  4670. debugger;
  4671. var PoStatus;
  4672. var jsonData = '';
  4673. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  4674. if (ids.length != 1) {
  4675. $.modalAlertNew("WMS00100");
  4676. return;
  4677. }
  4678. var POCode = "";
  4679. var PORow = "";
  4680. if (Type == '1') {
  4681. for (var i in ids) {
  4682. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4683. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4684. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4685. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4686. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4687. }
  4688. $.modalOpen({
  4689. id: "FormAddItemLot",
  4690. title: "生产退料条码生成",
  4691. url: "/PNWMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 1 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4692. width: "550px",
  4693. height: "1000px",
  4694. callBack: function (iframeId) {
  4695. top.frames[iframeId].submitForm();
  4696. }
  4697. });
  4698. } else if (Type == '2') {
  4699. for (var i in ids) {
  4700. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  4701. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4702. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4703. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4704. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4705. }
  4706. if ($(event.target).attr('id') == 'NF-CreateNew') {
  4707. $.modalOpen({
  4708. id: "FormAddItemLot",
  4709. title: "委外退料条码生成",
  4710. url: "/PNWMS/WMSCreateItemLot/FromNew?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4711. width: "550px",
  4712. height: "1000px",
  4713. callBack: function (iframeId) {
  4714. top.frames[iframeId].submitForm();
  4715. }
  4716. });
  4717. }
  4718. else {
  4719. $.modalOpen({
  4720. id: "FormAddItemLot",
  4721. title: "委外退料条码生成",
  4722. url: "/PNWMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4723. width: "550px",
  4724. height: "1000px",
  4725. callBack: function (iframeId) {
  4726. top.frames[iframeId].submitForm();
  4727. }
  4728. });
  4729. }
  4730. } else if (Type == '3') {
  4731. for (var i in ids) {
  4732. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  4733. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  4734. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4735. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4736. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4737. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4738. }
  4739. if ($(event.target).attr('id') == 'NF-CreateNew') {
  4740. $.modalOpen({
  4741. id: "FormAddItemLot",
  4742. title: "成品条码产生",
  4743. url: "/PNWMS/WMSCreateItemLot/FromNew?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  4744. width: "550px",
  4745. height: "1000px",
  4746. callBack: function (iframeId) {
  4747. top.frames[iframeId].submitForm();
  4748. }
  4749. });
  4750. }
  4751. else {
  4752. $.modalOpen({
  4753. id: "FormAddItemLot",
  4754. title: "成品条码产生",
  4755. url: "/PNWMS/WMSCreateItemLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  4756. width: "550px",
  4757. height: "1000px",
  4758. callBack: function (iframeId) {
  4759. top.frames[iframeId].submitForm();
  4760. }
  4761. });
  4762. }
  4763. } else if (Type == '4') {
  4764. for (var i in ids) {
  4765. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  4766. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4767. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4768. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4769. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4770. }
  4771. $.modalOpen({
  4772. id: "FormAddItemLot",
  4773. title: "销售退货条码产生",
  4774. url: "/PNWMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4775. width: "550px",
  4776. height: "1000px",
  4777. callBack: function (iframeId) {
  4778. top.frames[iframeId].submitForm();
  4779. }
  4780. });
  4781. } else if (Type == '5') {
  4782. for (var i in ids) {
  4783. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  4784. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4785. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4786. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4787. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4788. }
  4789. if ($(event.target).attr('id') == 'NF-CreateNew') {
  4790. $.modalOpen({
  4791. id: "FormAddItemLot",
  4792. title: "其他入库条码产生",
  4793. url: "/PNWMS/WMSCreateItemLot/FromNew?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4794. width: "550px",
  4795. height: "1000px",
  4796. callBack: function (iframeId) {
  4797. top.frames[iframeId].submitForm();
  4798. }
  4799. });
  4800. }
  4801. else {
  4802. $.modalOpen({
  4803. id: "FormAddItemLot",
  4804. title: "其他入库条码产生",
  4805. url: "/PNWMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4806. width: "550px",
  4807. height: "1000px",
  4808. callBack: function (iframeId) {
  4809. top.frames[iframeId].submitForm();
  4810. }
  4811. });
  4812. }
  4813. } else if (Type == '6') {
  4814. for (var i in ids) {
  4815. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  4816. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4817. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4818. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4819. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4820. }
  4821. $.modalOpen({
  4822. id: "FormAddItemLot",
  4823. title: "归还单条码产生",
  4824. url: "/PNWMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 6 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4825. width: "550px",
  4826. height: "1000px",
  4827. callBack: function (iframeId) {
  4828. top.frames[iframeId].submitForm();
  4829. }
  4830. });
  4831. } else if (Type == '7') {
  4832. for (var i in ids) {
  4833. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  4834. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4835. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4836. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4837. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4838. }
  4839. $.modalOpen({
  4840. id: "FormAddItemLot",
  4841. title: "审核到货单生成条码",
  4842. url: "/PNWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 7 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4843. width: "550px",
  4844. height: "1000px",
  4845. callBack: function (iframeId) {
  4846. top.frames[iframeId].submitForm();
  4847. }
  4848. });
  4849. } else if (Type == '8') {
  4850. for (var i in ids) {
  4851. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  4852. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4853. OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID;
  4854. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4855. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4856. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4857. }
  4858. $.modalOpen({
  4859. id: "FormAddItemLot",
  4860. title: "审核委外到货单生成条码",
  4861. url: "/PNWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&ID=" + ID + "&OODetailID=" + OODetailID + "&Quantity=" + Quantity + "&" + Math.random(),
  4862. width: "550px",
  4863. height: "1000px",
  4864. callBack: function (iframeId) {
  4865. top.frames[iframeId].submitForm();
  4866. }
  4867. });
  4868. } else if (Type == '9') {
  4869. for (var i in ids) {
  4870. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  4871. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4872. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4873. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4874. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4875. }
  4876. $.modalOpen({
  4877. id: "FormAddItemLot",
  4878. title: "开立成品入库单生成条码",
  4879. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 9 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4880. width: "550px",
  4881. height: "1000px",
  4882. callBack: function (iframeId) {
  4883. top.frames[iframeId].submitForm();
  4884. }
  4885. });
  4886. } else if (Type == '10') {
  4887. for (var i in ids) {
  4888. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  4889. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4890. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4891. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4892. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4893. }
  4894. $.modalOpen({
  4895. id: "FormAddItemLot",
  4896. title: "审核拒收单生成条码",
  4897. url: "/PNWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 10 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4898. width: "550px",
  4899. height: "1000px",
  4900. callBack: function (iframeId) {
  4901. top.frames[iframeId].submitForm();
  4902. }
  4903. });
  4904. } else if (Type == '11') {
  4905. for (var i in ids) {
  4906. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  4907. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  4908. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4909. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4910. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4911. }
  4912. $.modalOpen({
  4913. id: "FormAddItemLot",
  4914. title: "审核委外拒收单生成条码",
  4915. url: "/PNWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 11 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4916. width: "550px",
  4917. height: "1000px",
  4918. callBack: function (iframeId) {
  4919. top.frames[iframeId].submitForm();
  4920. }
  4921. });
  4922. } else if (Type == '12') {
  4923. for (var i in ids) {
  4924. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4925. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4926. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4927. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4928. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4929. }
  4930. if ($(event.target).attr('id') == 'NF-CreateNew') {
  4931. $.modalOpen({
  4932. id: "FormAddItemLot",
  4933. title: "审核领料申请退料生成条码",
  4934. url: "/PNWMS/WMSCreateItemLot/FromNew?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4935. width: "550px",
  4936. height: "1000px",
  4937. callBack: function (iframeId) {
  4938. top.frames[iframeId].submitForm();
  4939. }
  4940. });
  4941. }
  4942. else {
  4943. $.modalOpen({
  4944. id: "FormAddItemLot",
  4945. title: "审核领料申请退料生成条码",
  4946. url: "/PNWMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4947. width: "550px",
  4948. height: "1000px",
  4949. callBack: function (iframeId) {
  4950. top.frames[iframeId].submitForm();
  4951. }
  4952. });
  4953. }
  4954. } else if (Type == '13') {
  4955. for (var i in ids) {
  4956. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  4957. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4958. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4959. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4960. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4961. }
  4962. $.modalOpen({
  4963. id: "FormAddItemLot",
  4964. title: "材料出库退料生成条码",
  4965. url: "/PNWMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 13 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4966. width: "550px",
  4967. height: "1000px",
  4968. callBack: function (iframeId) {
  4969. top.frames[iframeId].submitForm();
  4970. }
  4971. });
  4972. } else if (Type == '14') {
  4973. for (var i in ids) {
  4974. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  4975. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4976. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4977. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4978. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4979. }
  4980. $.modalOpen({
  4981. id: "FormAddItemLot",
  4982. title: "委外领料退料条码生成",
  4983. url: "/PNWMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 14 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  4984. width: "550px",
  4985. height: "1000px",
  4986. callBack: function (iframeId) {
  4987. top.frames[iframeId].submitForm();
  4988. }
  4989. });
  4990. }
  4991. else if (Type == '15') {
  4992. for (var i in ids) {
  4993. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  4994. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  4995. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  4996. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  4997. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  4998. }
  4999. $.modalOpen({
  5000. id: "FormAddItemLot",
  5001. title: "委外材料出库退料生成条码",
  5002. url: "/PNWMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 15 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5003. width: "550px",
  5004. height: "1000px",
  5005. callBack: function (iframeId) {
  5006. top.frames[iframeId].submitForm();
  5007. }
  5008. });
  5009. }
  5010. else if (Type == '16') {
  5011. for (var i in ids) {
  5012. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5013. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5014. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5015. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5016. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5017. }
  5018. $.modalOpen({
  5019. id: "FormAddItemLot",
  5020. title: "返工工单生成条码",
  5021. url: "/PNWMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 16 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5022. width: "550px",
  5023. height: "1000px",
  5024. callBack: function (iframeId) {
  5025. top.frames[iframeId].submitForm();
  5026. }
  5027. });
  5028. }
  5029. else if (Type == '18') {
  5030. for (var i in ids) {
  5031. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5032. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5033. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
  5034. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5035. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5036. }
  5037. $.modalOpen({
  5038. id: "FormAddItemLot",
  5039. title: "副产品生成条码",
  5040. url: "/PNWMS/WMSCreateItemLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5041. width: "550px",
  5042. height: "1000px",
  5043. callBack: function (iframeId) {
  5044. top.frames[iframeId].submitForm();
  5045. }
  5046. });
  5047. }
  5048. else if (Type == '20') {
  5049. for (var i in ids) {
  5050. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5051. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5052. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5053. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5054. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5055. }
  5056. $.modalOpen({
  5057. id: "FormAddItemLot",
  5058. title: "两步调入生成条码",
  5059. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 20 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5060. width: "550px",
  5061. height: "1000px",
  5062. callBack: function (iframeId) {
  5063. top.frames[iframeId].submitForm();
  5064. }
  5065. });
  5066. }
  5067. else if (Type == '22') {
  5068. for (var i in ids) {
  5069. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5070. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5071. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5072. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5073. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5074. ProductDate = $("#gridList").jqGrid('getRowData', ids[i]).SupplierBatch;
  5075. }
  5076. console.log($(event.target).attr('id'));
  5077. if ($(event.target).attr('id') == 'NF-CreateNew')
  5078. {
  5079. $.modalOpen({
  5080. id: "FormAddItemLot",
  5081. title: "采购入库生成条码",
  5082. url: "/PNWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&ProductDate=" + ProductDate+"&" + Math.random(),
  5083. width: "550px",
  5084. height: "1000px",
  5085. callBack: function (iframeId) {
  5086. top.frames[iframeId].submitForm();
  5087. }
  5088. });
  5089. }
  5090. else {
  5091. $.modalOpen({
  5092. id: "FormAddItemLot",
  5093. title: "采购入库生成条码",
  5094. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&ProductDate=" + ProductDate + "&" + Math.random(),
  5095. width: "550px",
  5096. height: "1000px",
  5097. callBack: function (iframeId) {
  5098. top.frames[iframeId].submitForm();
  5099. }
  5100. });
  5101. }
  5102. }
  5103. else if (Type == '23') {
  5104. for (var i in ids) {
  5105. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5106. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5107. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5108. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5109. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5110. }
  5111. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5112. $.modalOpen({
  5113. id: "FormAddItemLot",
  5114. title: "委外采购入库生成条码",
  5115. url: "/PNWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5116. width: "550px",
  5117. height: "1000px",
  5118. callBack: function (iframeId) {
  5119. top.frames[iframeId].submitForm();
  5120. }
  5121. });
  5122. }
  5123. else {
  5124. $.modalOpen({
  5125. id: "FormAddItemLot",
  5126. title: "委外采购入库生成条码",
  5127. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5128. width: "550px",
  5129. height: "1000px",
  5130. callBack: function (iframeId) {
  5131. top.frames[iframeId].submitForm();
  5132. }
  5133. });
  5134. }
  5135. }
  5136. else if (Type == '24') {
  5137. for (var i in ids) {
  5138. SSDCode = $("#gridList").jqGrid('getRowData', ids[i]).SSDCode;
  5139. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5140. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5141. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5142. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5143. }
  5144. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5145. $.modalOpen({
  5146. id: "FormAddItemLot",
  5147. title: "红字销售出库单生成条码",
  5148. url: "/PNWMS/WMSCreateItemLot/FromNew?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5149. width: "550px",
  5150. height: "1000px",
  5151. callBack: function (iframeId) {
  5152. top.frames[iframeId].submitForm();
  5153. }
  5154. });
  5155. }
  5156. else {
  5157. $.modalOpen({
  5158. id: "FormAddItemLot",
  5159. title: "红字销售出库单生成条码",
  5160. url: "/PNWMS/WMSCreateItemLot/FromPN?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5161. width: "550px",
  5162. height: "1000px",
  5163. callBack: function (iframeId) {
  5164. top.frames[iframeId].submitForm();
  5165. }
  5166. });
  5167. }
  5168. }
  5169. else if (Type == '201') {
  5170. for (var i in ids) {
  5171. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5172. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5173. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5174. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5175. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5176. }
  5177. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5178. $.modalOpen({
  5179. id: "FormAddItemLot",
  5180. title: "调拨申请单生成条码",
  5181. url: "/PNWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5182. width: "550px",
  5183. height: "1000px",
  5184. callBack: function (iframeId) {
  5185. top.frames[iframeId].submitForm();
  5186. }
  5187. });
  5188. }
  5189. else {
  5190. $.modalOpen({
  5191. id: "FormAddItemLot",
  5192. title: "调拨申请单生成条码",
  5193. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5194. width: "550px",
  5195. height: "1000px",
  5196. callBack: function (iframeId) {
  5197. top.frames[iframeId].submitForm();
  5198. }
  5199. });
  5200. }
  5201. }
  5202. else if (Type == '202') {
  5203. for (var i in ids) {
  5204. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5205. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5206. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5207. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5208. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5209. }
  5210. $.modalOpen({
  5211. id: "FormAddItemLot",
  5212. title: "调拨申请单生成条码",
  5213. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5214. width: "550px",
  5215. height: "1000px",
  5216. callBack: function (iframeId) {
  5217. top.frames[iframeId].submitForm();
  5218. }
  5219. });
  5220. }
  5221. }
  5222. function btnCreatePN() {
  5223. debugger;
  5224. var PoStatus;
  5225. var jsonData = '';
  5226. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  5227. if (ids.length != 1) {
  5228. $.modalAlertNew("WMS00100");
  5229. return;
  5230. }
  5231. var POCode = "";
  5232. var PORow = "";
  5233. if (Type == '1') {
  5234. for (var i in ids) {
  5235. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5236. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5237. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5238. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5239. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5240. }
  5241. $.modalOpen({
  5242. id: "FormAddItemLot",
  5243. title: "生产退料条码生成",
  5244. url: "/PNWMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 1 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5245. width: "550px",
  5246. height: "1000px",
  5247. callBack: function (iframeId) {
  5248. top.frames[iframeId].submitForm();
  5249. }
  5250. });
  5251. } else if (Type == '2') {
  5252. for (var i in ids) {
  5253. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5254. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5255. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5256. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5257. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5258. }
  5259. $.modalOpen({
  5260. id: "FormAddItemLot",
  5261. title: "委外退料条码生成",
  5262. url: "/PNWMS/WMSCreateItemLot/FromPN?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 2 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5263. width: "550px",
  5264. height: "1000px",
  5265. callBack: function (iframeId) {
  5266. top.frames[iframeId].submitForm();
  5267. }
  5268. });
  5269. } else if (Type == '3') {
  5270. for (var i in ids) {
  5271. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  5272. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5273. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5274. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5275. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5276. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5277. }
  5278. $.modalOpen({
  5279. id: "FormAddItemLot",
  5280. title: "成品条码产生",
  5281. url: "/PNWMS/WMSCreateItemLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(),
  5282. width: "550px",
  5283. height: "1000px",
  5284. callBack: function (iframeId) {
  5285. top.frames[iframeId].submitForm();
  5286. }
  5287. });
  5288. } else if (Type == '4') {
  5289. for (var i in ids) {
  5290. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  5291. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5292. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5293. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5294. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5295. }
  5296. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5297. $.modalOpen({
  5298. id: "FormAddItemLot",
  5299. title: "销售退货条码产生",
  5300. url: "/PNWMS/WMSCreateItemLot/FromNew?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5301. width: "550px",
  5302. height: "1000px",
  5303. callBack: function (iframeId) {
  5304. top.frames[iframeId].submitForm();
  5305. }
  5306. });
  5307. }
  5308. else {
  5309. $.modalOpen({
  5310. id: "FormAddItemLot",
  5311. title: "销售退货条码产生",
  5312. url: "/PNWMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 4 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5313. width: "550px",
  5314. height: "1000px",
  5315. callBack: function (iframeId) {
  5316. top.frames[iframeId].submitForm();
  5317. }
  5318. });
  5319. }
  5320. } else if (Type == '5') {
  5321. for (var i in ids) {
  5322. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  5323. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5324. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5325. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5326. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5327. }
  5328. $.modalOpen({
  5329. id: "FormAddItemLot",
  5330. title: "其他入库条码产生",
  5331. url: "/PNWMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 5 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5332. width: "550px",
  5333. height: "1000px",
  5334. callBack: function (iframeId) {
  5335. top.frames[iframeId].submitForm();
  5336. }
  5337. });
  5338. } else if (Type == '6') {
  5339. for (var i in ids) {
  5340. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  5341. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5342. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5343. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5344. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5345. }
  5346. $.modalOpen({
  5347. id: "FormAddItemLot",
  5348. title: "归还单条码产生",
  5349. url: "/PNWMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 6 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5350. width: "550px",
  5351. height: "1000px",
  5352. callBack: function (iframeId) {
  5353. top.frames[iframeId].submitForm();
  5354. }
  5355. });
  5356. } else if (Type == '7') {
  5357. for (var i in ids) {
  5358. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5359. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5360. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5361. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5362. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5363. }
  5364. $.modalOpen({
  5365. id: "FormAddItemLot",
  5366. title: "审核到货单生成条码",
  5367. url: "/PNWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 7 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5368. width: "550px",
  5369. height: "1000px",
  5370. callBack: function (iframeId) {
  5371. top.frames[iframeId].submitForm();
  5372. }
  5373. });
  5374. } else if (Type == '8') {
  5375. for (var i in ids) {
  5376. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  5377. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5378. OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID;
  5379. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5380. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5381. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5382. }
  5383. $.modalOpen({
  5384. id: "FormAddItemLot",
  5385. title: "审核委外到货单生成条码",
  5386. url: "/PNWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&ID=" + ID + "&OODetailID=" + OODetailID + "&Quantity=" + Quantity + "&" + Math.random(),
  5387. width: "550px",
  5388. height: "1000px",
  5389. callBack: function (iframeId) {
  5390. top.frames[iframeId].submitForm();
  5391. }
  5392. });
  5393. } else if (Type == '9') {
  5394. for (var i in ids) {
  5395. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5396. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5397. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5398. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5399. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5400. }
  5401. $.modalOpen({
  5402. id: "FormAddItemLot",
  5403. title: "开立成品入库单生成条码",
  5404. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 9 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5405. width: "550px",
  5406. height: "1000px",
  5407. callBack: function (iframeId) {
  5408. top.frames[iframeId].submitForm();
  5409. }
  5410. });
  5411. } else if (Type == '10') {
  5412. for (var i in ids) {
  5413. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  5414. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5415. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5416. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5417. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5418. }
  5419. $.modalOpen({
  5420. id: "FormAddItemLot",
  5421. title: "审核拒收单生成条码",
  5422. url: "/PNWMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 10 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5423. width: "550px",
  5424. height: "1000px",
  5425. callBack: function (iframeId) {
  5426. top.frames[iframeId].submitForm();
  5427. }
  5428. });
  5429. } else if (Type == '11') {
  5430. for (var i in ids) {
  5431. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  5432. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  5433. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5434. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5435. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5436. }
  5437. $.modalOpen({
  5438. id: "FormAddItemLot",
  5439. title: "审核委外拒收单生成条码",
  5440. url: "/PNWMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 11 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5441. width: "550px",
  5442. height: "1000px",
  5443. callBack: function (iframeId) {
  5444. top.frames[iframeId].submitForm();
  5445. }
  5446. });
  5447. } else if (Type == '12') {
  5448. for (var i in ids) {
  5449. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5450. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5451. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5452. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5453. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5454. }
  5455. $.modalOpen({
  5456. id: "FormAddItemLot",
  5457. title: "审核领料申请退料生成条码",
  5458. url: "/PNWMS/WMSCreateItemLot/FromPN?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 12 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5459. width: "550px",
  5460. height: "1000px",
  5461. callBack: function (iframeId) {
  5462. top.frames[iframeId].submitForm();
  5463. }
  5464. });
  5465. } else if (Type == '13') {
  5466. for (var i in ids) {
  5467. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  5468. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5469. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5470. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5471. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5472. }
  5473. $.modalOpen({
  5474. id: "FormAddItemLot",
  5475. title: "材料出库退料生成条码",
  5476. url: "/PNWMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 13 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5477. width: "550px",
  5478. height: "1000px",
  5479. callBack: function (iframeId) {
  5480. top.frames[iframeId].submitForm();
  5481. }
  5482. });
  5483. } else if (Type == '14') {
  5484. for (var i in ids) {
  5485. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5486. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5487. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5488. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5489. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5490. }
  5491. $.modalOpen({
  5492. id: "FormAddItemLot",
  5493. title: "委外领料退料条码生成",
  5494. url: "/PNWMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 14 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5495. width: "550px",
  5496. height: "1000px",
  5497. callBack: function (iframeId) {
  5498. top.frames[iframeId].submitForm();
  5499. }
  5500. });
  5501. }
  5502. else if (Type == '15') {
  5503. for (var i in ids) {
  5504. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  5505. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5506. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5507. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5508. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5509. }
  5510. $.modalOpen({
  5511. id: "FormAddItemLot",
  5512. title: "委外材料出库退料生成条码",
  5513. url: "/PNWMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 15 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5514. width: "550px",
  5515. height: "1000px",
  5516. callBack: function (iframeId) {
  5517. top.frames[iframeId].submitForm();
  5518. }
  5519. });
  5520. }
  5521. else if (Type == '16') {
  5522. for (var i in ids) {
  5523. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5524. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5525. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5526. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5527. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5528. }
  5529. $.modalOpen({
  5530. id: "FormAddItemLot",
  5531. title: "返工工单生成条码",
  5532. url: "/PNWMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 16 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5533. width: "550px",
  5534. height: "1000px",
  5535. callBack: function (iframeId) {
  5536. top.frames[iframeId].submitForm();
  5537. }
  5538. });
  5539. }
  5540. else if (Type == '18') {
  5541. for (var i in ids) {
  5542. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  5543. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5544. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
  5545. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5546. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5547. }
  5548. $.modalOpen({
  5549. id: "FormAddItemLot",
  5550. title: "副产品生成条码",
  5551. url: "/PNWMS/WMSCreateItemLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5552. width: "550px",
  5553. height: "1000px",
  5554. callBack: function (iframeId) {
  5555. top.frames[iframeId].submitForm();
  5556. }
  5557. });
  5558. }
  5559. else if (Type == '20') {
  5560. for (var i in ids) {
  5561. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5562. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5563. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5564. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5565. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5566. }
  5567. $.modalOpen({
  5568. id: "FormAddItemLot",
  5569. title: "两步调入生成条码",
  5570. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 20 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5571. width: "550px",
  5572. height: "1000px",
  5573. callBack: function (iframeId) {
  5574. top.frames[iframeId].submitForm();
  5575. }
  5576. });
  5577. }
  5578. else if (Type == '22') {
  5579. for (var i in ids) {
  5580. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5581. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5582. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5583. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5584. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5585. }
  5586. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5587. $.modalOpen({
  5588. id: "FormAddItemLot",
  5589. title: "采购入库生成条码",
  5590. url: "/PNWMS/WMSCreateItemLot/FromNew?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5591. width: "550px",
  5592. height: "1000px",
  5593. callBack: function (iframeId) {
  5594. top.frames[iframeId].submitForm();
  5595. }
  5596. });
  5597. }
  5598. else {
  5599. $.modalOpen({
  5600. id: "FormAddItemLot",
  5601. title: "采购入库生成条码",
  5602. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 22 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5603. width: "550px",
  5604. height: "1000px",
  5605. callBack: function (iframeId) {
  5606. top.frames[iframeId].submitForm();
  5607. }
  5608. });
  5609. }
  5610. }
  5611. else if (Type == '23') {
  5612. for (var i in ids) {
  5613. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  5614. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5615. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5616. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5617. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5618. }
  5619. $.modalOpen({
  5620. id: "FormAddItemLot",
  5621. title: "委外采购入库生成条码",
  5622. url: "/PNWMS/WMSCreateItemLot/From?RCVCode=" + encodeURI(encodeURI(RCVCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 23 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5623. width: "550px",
  5624. height: "1000px",
  5625. callBack: function (iframeId) {
  5626. top.frames[iframeId].submitForm();
  5627. }
  5628. });
  5629. }
  5630. else if (Type == '24') {
  5631. for (var i in ids) {
  5632. SSDCode = $("#gridList").jqGrid('getRowData', ids[i]).SSDCode;
  5633. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5634. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5635. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5636. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5637. }
  5638. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5639. $.modalOpen({
  5640. id: "FormAddItemLot",
  5641. title: "红字销售出库单生成条码",
  5642. url: "/PNWMS/WMSCreateItemLot/FromNew?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5643. width: "550px",
  5644. height: "1000px",
  5645. callBack: function (iframeId) {
  5646. top.frames[iframeId].submitForm();
  5647. }
  5648. });
  5649. }
  5650. else {
  5651. $.modalOpen({
  5652. id: "FormAddItemLot",
  5653. title: "红字销售出库单生成条码",
  5654. url: "/PNWMS/WMSCreateItemLot/From?SSDCode=" + encodeURI(encodeURI(SSDCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 24 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5655. width: "550px",
  5656. height: "1000px",
  5657. callBack: function (iframeId) {
  5658. top.frames[iframeId].submitForm();
  5659. }
  5660. });
  5661. }
  5662. }
  5663. else if (Type == '201') {
  5664. for (var i in ids) {
  5665. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5666. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5667. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5668. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5669. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5670. }
  5671. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5672. $.modalOpen({
  5673. id: "FormAddItemLot",
  5674. title: "调拨申请单生成条码",
  5675. url: "/PNWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5676. width: "550px",
  5677. height: "1000px",
  5678. callBack: function (iframeId) {
  5679. top.frames[iframeId].submitForm();
  5680. }
  5681. });
  5682. }
  5683. else {
  5684. $.modalOpen({
  5685. id: "FormAddItemLot",
  5686. title: "调拨申请单生成条码",
  5687. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 201 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5688. width: "550px",
  5689. height: "1000px",
  5690. callBack: function (iframeId) {
  5691. top.frames[iframeId].submitForm();
  5692. }
  5693. });
  5694. }
  5695. }
  5696. else if (Type == '202') {
  5697. for (var i in ids) {
  5698. TransferNO = $("#gridList").jqGrid('getRowData', ids[i]).TransferNO;
  5699. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  5700. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  5701. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5702. Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity;
  5703. }
  5704. if ($(event.target).attr('id') == 'NF-CreateNew') {
  5705. $.modalOpen({
  5706. id: "FormAddItemLot",
  5707. title: "调拨申请单生成条码",
  5708. url: "/PNWMS/WMSCreateItemLot/FromNew?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5709. width: "550px",
  5710. height: "1000px",
  5711. callBack: function (iframeId) {
  5712. top.frames[iframeId].submitForm();
  5713. }
  5714. });
  5715. }
  5716. else {
  5717. $.modalOpen({
  5718. id: "FormAddItemLot",
  5719. title: "调拨申请单生成条码",
  5720. url: "/PNWMS/WMSCreateItemLot/From?TransferNO=" + encodeURI(encodeURI(TransferNO)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 202 + "&ID=" + ID + "&Quantity=" + Quantity + "&" + Math.random(),
  5721. width: "550px",
  5722. height: "1000px",
  5723. callBack: function (iframeId) {
  5724. top.frames[iframeId].submitForm();
  5725. }
  5726. });
  5727. }
  5728. }
  5729. }
  5730. function fullscreen() {
  5731. var docElm = document.documentElement;
  5732. if (docElm.requestFullscreen) {
  5733. docElm.requestFullscreen();
  5734. } else if (docElm.mozRequestFullScreen) {
  5735. docElm.mozRequestFullScreen();
  5736. } else if (docElm.webkitRequestFullScreen) {
  5737. docElm.webkitRequestFullScreen();
  5738. } else if (docElm.msRequestFullscreen) {
  5739. docElm.msRequestFullscreen();
  5740. }
  5741. $(window).bind('resize', function () {
  5742. $("#gridList").setGridWidth($(window).width());
  5743. }).trigger('resize');
  5744. $(window).bind('resize', function () {
  5745. $("#gridList").setGridHeight($(window).height());
  5746. }).trigger('resize');
  5747. }
  5748. function btnPrint() {
  5749. debugger;
  5750. if (mold == '')
  5751. {
  5752. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  5753. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  5754. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  5755. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  5756. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  5757. if (Type == '6') { mold = '00006'; }//归还单生成条码
  5758. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  5759. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  5760. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  5761. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  5762. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  5763. if (Type == '12') { mold = '00012'; }//领料申请退料
  5764. if (Type == '13') { mold = '00013'; }//材料出库退料
  5765. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  5766. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  5767. if (Type == '16') { mold = '00016'; }//返工工单
  5768. if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库
  5769. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  5770. if (Type == '22') { mold = '00018'; }//采购入库生成条码
  5771. if (Type == '23') { mold = '00019'; }//委外采购入库生成条码
  5772. if (Type == '201') { mold = '00020'; }//委外采购入库生成条码
  5773. if (Type == '202') { mold = '00020'; }//委外采购入库生成条码
  5774. if (Type == '203') { mold = 'DZ0001'; }//派纳特殊一步调入生成条码
  5775. }
  5776. var objArr = '';
  5777. var arr = [];
  5778. var obj = $("#gridList").jqGrid("getRowData");
  5779. for (var i = 0; i < obj.length; i++) {
  5780. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  5781. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  5782. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  5783. for (var j = 0; j < rowData.length; j++) {
  5784. objArr += "'" + rowData[j] + "',";
  5785. }
  5786. }
  5787. }
  5788. objArr = objArr.slice(0, objArr.length - 1);
  5789. if (objArr == "") {
  5790. $.modalAlertNew("WMS00101");
  5791. return;
  5792. }
  5793. objArr = "" + objArr + "|";
  5794. arr.push(objArr);
  5795. $.modalOpen({
  5796. id: "PrintLot",
  5797. title: "打印",
  5798. url: "/WMS/Print/PrintViewByLot?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  5799. width: "550px",
  5800. height: "1000px",
  5801. callBack: function (iframeId) {
  5802. top.frames[iframeId].submitForm();
  5803. }
  5804. });
  5805. }
  5806. function btnBatchPrint() {
  5807. debugger;
  5808. if (mold == '')
  5809. {
  5810. if (Type == '7') { mold = '00056'; }//普通到货单生成条码
  5811. if (Type == '8') { mold = '00057'; }//委外到货单生成条码
  5812. }
  5813. var objArr = '';
  5814. var arr = [];
  5815. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  5816. if (ids.length == 0) {
  5817. $.modalAlertNew("WMS00100");
  5818. return;
  5819. }
  5820. var ID = '';
  5821. for (var i in ids) {
  5822. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  5823. objArr += "'" + ID + "',";
  5824. }
  5825. objArr = objArr.slice(0, objArr.length - 1);
  5826. objArr = "" + objArr + "|";
  5827. arr.push(objArr);
  5828. var xxx = "";
  5829. $.modalOpen({
  5830. id: "PrintLot",
  5831. title: "打印",
  5832. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  5833. width: "550px",
  5834. height: "1000px",
  5835. callBack: function (iframeId) {
  5836. top.frames[iframeId].submitForm();
  5837. }
  5838. });
  5839. }
  5840. function btn_ExportAll() {
  5841. debugger;
  5842. var objArr = '';
  5843. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  5844. for (var i in ids) {
  5845. objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',";
  5846. }
  5847. if (objArr=="") {
  5848. $.modalAlert("请选择单据后导出!");
  5849. return;
  5850. }
  5851. var postData = "&Type=" + Type + "";
  5852. //postData += "&ID=" + ID
  5853. postData += "&ID=" + objArr;
  5854. $.download("/PNWMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post');
  5855. }
  5856. function Select_SelGDLX() {
  5857. $("#SelGDLX").find("option").remove();
  5858. var DeptName = $("#SelGDLX option:checked").text();
  5859. $("#SelGDLX").append("<option value=''>--请选择--</option>");
  5860. $.ajax({
  5861. url: "/PNWMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(),
  5862. dataType: "json",
  5863. async: false,
  5864. success: function (data) {
  5865. if (data != null && data.length > 0) {
  5866. for (var i = 0; i < data.length; i++) {
  5867. $("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
  5868. }
  5869. }
  5870. }
  5871. });
  5872. $("#SelGDLX option:checked").val('');
  5873. }
  5874. function btnCreateLook() {
  5875. var MODetailID = '';
  5876. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  5877. for (var i = 0; i < objList.length; i++) {
  5878. var rowId = objList[i];
  5879. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  5880. MODetailID = rowData.MODetailID;
  5881. }
  5882. $.modalOpenClean({
  5883. id: "FormMoPick",
  5884. title: "工单子件信息",
  5885. url: "/PNWMS/WMSCreateItemLot/FormMoPick" + "?" + Math.random() + "&MODetailID=" + MODetailID,
  5886. width: "90%",
  5887. height: "90%",
  5888. callBack: function (iframeId) {
  5889. top.frames[iframeId].submitForm();
  5890. }
  5891. });
  5892. }
  5893. function btn_Import() {
  5894. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  5895. if (objList.length != 1) {
  5896. $.modalAlertNew("WMS00100");
  5897. return;
  5898. }
  5899. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  5900. for (var i = 0; i < objList.length; i++) {
  5901. var rowId = objList[i];
  5902. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  5903. var Code = rowData.MOCode;
  5904. var Sequence = rowData.Sequence;
  5905. $.modalOpen({
  5906. id: "Upload",
  5907. title: "导入",
  5908. url: "/PNWMS/WMSCreateItemLot/ImportLot?Code=" + Code + "&Sequence=" + Sequence + "&" + Math.random(),
  5909. width: "400px",
  5910. height: "200px",
  5911. btn: null,
  5912. });
  5913. }
  5914. }
  5915. function btnPrints() {
  5916. debugger;
  5917. // var mold = '';
  5918. if (mold == '') {
  5919. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  5920. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  5921. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  5922. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  5923. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  5924. if (Type == '6') { mold = '00006'; }//归还单生成条码
  5925. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  5926. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  5927. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  5928. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  5929. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  5930. if (Type == '12') { mold = '00012'; }//领料申请退料
  5931. if (Type == '13') { mold = '00013'; }//材料出库退料
  5932. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  5933. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  5934. if (Type == '16') { mold = '00016'; }//返工工单
  5935. if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库
  5936. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  5937. if (Type == '22') { mold = '00018'; }//采购入库生成条码
  5938. if (Type == '23') { mold = '00019'; }//委外采购入库生成条码
  5939. if (Type == '203') { mold = 'DZ0001'; }//派纳特殊一步调入生成条码
  5940. }
  5941. var objArr = '';
  5942. var arr = [];
  5943. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  5944. for (var i = 0; i < objList.length; i++) {
  5945. var rowId = objList[i];
  5946. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  5947. objArr += "'" + rowData.ID + "',";
  5948. }
  5949. objArr = objArr.slice(0, objArr.length - 1);
  5950. if (objArr == "") {
  5951. $.modalAlertNew("WMS00110");
  5952. return;
  5953. }
  5954. objArr = "" + objArr + "|";
  5955. arr.push(objArr);
  5956. $.modalOpen({
  5957. id: "PrintLot",
  5958. title: "打印",
  5959. url: "/WMS/Print/PrintViewByLot?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  5960. width: "550px",
  5961. height: "1000px",
  5962. callBack: function (iframeId) {
  5963. top.frames[iframeId].submitForm();
  5964. }
  5965. });
  5966. }
  5967. function btnInWareHouse() {
  5968. debugger;
  5969. var objArr = '';
  5970. var arr = [];
  5971. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  5972. for (var i = 0; i < objList.length; i++) {
  5973. var rowId = objList[i];
  5974. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  5975. objArr += "'" + rowData.ID + "',";
  5976. }
  5977. objArr = objArr.slice(0, objArr.length - 1);
  5978. if (objArr == "") {
  5979. $.modalAlertNew("WMS00110");
  5980. return;
  5981. }
  5982. arr.push(objArr);
  5983. $.submitForm({
  5984. url: "/PNWMS/WMSCreateItemLot/PostInWareHouse" ,
  5985. param: {
  5986. IDs: JSON.stringify(objArr)
  5987. },
  5988. success: function () {
  5989. $.currentWindow().$("#gridList").trigger("reloadGrid");
  5990. }
  5991. })
  5992. }
  5993. function btn_Rebind() {
  5994. var objArr = '';
  5995. var obj = $("#gridList").jqGrid("getRowData");
  5996. for (var i = 0; i < obj.length; i++) {
  5997. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  5998. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  5999. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  6000. for (var j = 0; j < rowData.length; j++) {
  6001. var rowDataZ = $SubGird.jqGrid('getRowData', rowData[j]);
  6002. objArr += "'" + rowDataZ.LotNo + "',";
  6003. }
  6004. objArr = objArr.slice(0, objArr.length - 1);
  6005. }
  6006. }
  6007. if (objArr == "") {
  6008. $.modalAlert("请选择条码信息后,进行重新绑定!");
  6009. return;
  6010. }
  6011. $.modalOpen({
  6012. id: "ICSLotRebind",
  6013. title: "条码重新绑定",
  6014. url: "/PNWMS/WMSCreateItemLot/ICSLotRebind?LotNo=" + encodeURI(encodeURI(objArr)) + "&" + Math.random(),
  6015. width: "500px",
  6016. height: "350px",
  6017. callBack: function (iframeId) {
  6018. top.frames[iframeId].submitForm();
  6019. }
  6020. });
  6021. }
  6022. function btnAllCreatePN() {
  6023. $("#gridList").find($("td[aria-describedby='gridList_rn']")).click();
  6024. var PoStatus;
  6025. var jsonData = '';
  6026. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  6027. var POCode = "";
  6028. var PORow = "";
  6029. var VenCode = "";
  6030. var WorkPoint = "";
  6031. var VendorLot = "";
  6032. if (Type == '3') {
  6033. debugger;
  6034. var ARR = [];
  6035. for (var i in ids) {
  6036. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6037. var Code = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  6038. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6039. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6040. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6041. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6042. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6043. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6044. if (minPackQty == '' || minPackQty == 0) {
  6045. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6046. return;
  6047. }
  6048. var Complete = '';
  6049. $.ajax({
  6050. url: "/PNWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6051. dataType: "json",
  6052. async: false,
  6053. success: function (data) {
  6054. if (data != null && data.length > 0) {
  6055. Complete = data[0].BatchEnable;
  6056. }
  6057. }
  6058. });
  6059. if (Complete == true) {
  6060. if (BatchCode == "") {
  6061. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6062. return;
  6063. }
  6064. }
  6065. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6066. if (thisCreateQty == 0) {
  6067. $.modalAlert("该单据条码已全部生成完毕!");
  6068. return;
  6069. }
  6070. thisCreateQty = thisCreateQty.toFixed(6);
  6071. minPackQty = Number(minPackQty).toFixed(6);
  6072. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6073. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6074. }
  6075. else {
  6076. createPageCount = parseInt(thisCreateQty / minPackQty);
  6077. }
  6078. createPageCount = createPageCount.toFixed(0);
  6079. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//订单总数
  6080. Quantity = Quantity.toFixed(2);
  6081. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6082. CreatedQty = CreatedQty.toFixed(2);
  6083. if (Quantity == CreatedQty) {
  6084. return false;
  6085. }
  6086. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6087. if (EffectiveEnable == 'true') {
  6088. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6089. } else {
  6090. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6091. }
  6092. var obj = {
  6093. ID: ID,
  6094. Code: Code,
  6095. Sequence: Sequence,
  6096. thisCreateQty: thisCreateQty,
  6097. minPackQty: minPackQty,
  6098. createPageCount: createPageCount,
  6099. //VendorLot: VendorLot,
  6100. PRODUCTDATE: PRODUCTDATE,
  6101. ExpirationDate: ExpirationDate,
  6102. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6103. //自由项
  6104. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6105. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6106. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6107. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6108. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6109. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6110. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6111. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6112. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6113. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6114. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6115. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6116. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6117. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6118. }
  6119. ARR.push(obj);
  6120. }
  6121. $.submitForm({
  6122. url: "/PNWMS/WMSCreateItemLot/SubmitFormGDCPALL" + "?" + Math.random(),
  6123. param: {
  6124. keyValue: JSON.stringify(ARR)
  6125. },
  6126. success: function () {
  6127. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6128. }
  6129. })
  6130. }
  6131. if (Type == '22') {
  6132. debugger;
  6133. var ARR = [];
  6134. for (var i in ids) {
  6135. var ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6136. var Code = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  6137. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6138. var EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6139. var EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6140. var minPackQty = $("#gridList").jqGrid('getRowData', ids[i]).MPQ;
  6141. var InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  6142. var BatchCode = $("#gridList").jqGrid('getRowData', ids[i]).BatchCode;
  6143. if (minPackQty == '' || minPackQty == 0) {
  6144. $.modalAlert("单据:" + Code + ",行号:" + Sequence + "请输入最小包装量!");
  6145. return;
  6146. }
  6147. var Complete = '';
  6148. $.ajax({
  6149. url: "/PNWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  6150. dataType: "json",
  6151. async: false,
  6152. success: function (data) {
  6153. if (data != null && data.length > 0) {
  6154. Complete = data[0].BatchEnable;
  6155. }
  6156. }
  6157. });
  6158. if (Complete == true) {
  6159. if (BatchCode == "") {
  6160. $.modalAlert("单号:" + Code + " 行号:" + Sequence + " 物料:" + InvCode + ",料品已开启批次,请输入批次!", "warning");
  6161. return;
  6162. }
  6163. }
  6164. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6165. if (thisCreateQty == 0) {
  6166. $.modalAlert("该单据条码已全部生成完毕!");
  6167. return;
  6168. }
  6169. thisCreateQty = thisCreateQty.toFixed(6);
  6170. minPackQty = Number(minPackQty).toFixed(6);
  6171. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  6172. createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
  6173. }
  6174. else {
  6175. createPageCount = parseInt(thisCreateQty / minPackQty);
  6176. }
  6177. createPageCount = createPageCount.toFixed(0);
  6178. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6179. Quantity = Quantity.toFixed(2);
  6180. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6181. CreatedQty = CreatedQty.toFixed(2);
  6182. if (Quantity == CreatedQty) {
  6183. return false;
  6184. }
  6185. var PRODUCTDATE = $("#gridList").jqGrid('getRowData', ids[i]).SupplierBatch;//条码生产日期
  6186. if (EffectiveEnable == 'true') {
  6187. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6188. } else {
  6189. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6190. }
  6191. var obj = {
  6192. ID: ID,
  6193. Code: Code,
  6194. Sequence: Sequence,
  6195. thisCreateQty: thisCreateQty,
  6196. minPackQty: minPackQty,
  6197. createPageCount: createPageCount,
  6198. //VendorLot: VendorLot,
  6199. PRODUCTDATE: PRODUCTDATE,
  6200. ExpirationDate: ExpirationDate,
  6201. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6202. //自由项
  6203. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6204. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6205. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6206. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6207. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6208. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6209. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6210. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6211. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6212. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6213. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6214. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6215. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6216. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6217. }
  6218. ARR.push(obj);
  6219. }
  6220. $.submitForm({
  6221. url: "/PNWMS/WMSCreateItemLot/SubmitFormCGRKALL" + "?" + Math.random(),
  6222. param: {
  6223. keyValue: JSON.stringify(ARR)
  6224. },
  6225. success: function () {
  6226. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6227. }
  6228. })
  6229. }
  6230. if (Type == '23') {
  6231. }
  6232. }
  6233. function btnAllCreate() {
  6234. debugger;
  6235. var PoStatus;
  6236. var jsonData = '';
  6237. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  6238. var POCode = "";
  6239. var PORow = "";
  6240. var VenCode = "";
  6241. var WorkPoint = "";
  6242. var VendorLot = "";
  6243. //生产退料
  6244. if (Type == '1') {
  6245. debugger;
  6246. var ARR = [];
  6247. for (var i in ids) {
  6248. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6249. Code = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  6250. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6251. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6252. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6253. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  6254. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6255. if (thisCreateQty == 0) {
  6256. $.modalAlert("该单据条码已全部生成完毕!");
  6257. return;
  6258. }
  6259. thisCreateQty = thisCreateQty.toFixed(4);
  6260. var minPackQty = thisCreateQty;//最小包装量
  6261. //minPackQty = minPackQty.toFixed(4);
  6262. var createPageCount = 1;//本次生成张数
  6263. createPageCount = createPageCount.toFixed(0);
  6264. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  6265. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6266. Quantity = Quantity.toFixed(2);
  6267. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6268. CreatedQty = CreatedQty.toFixed(2);
  6269. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  6270. if (Quantity == CreatedQty) {
  6271. return false;
  6272. }
  6273. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6274. if (EffectiveEnable == 'true') {
  6275. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6276. } else {
  6277. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6278. }
  6279. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  6280. var obj = {
  6281. ID: ID,
  6282. Code: Code,
  6283. Sequence: Sequence,
  6284. thisCreateQty: thisCreateQty,
  6285. minPackQty: minPackQty,
  6286. createPageCount: createPageCount,
  6287. //VendorLot: VendorLot,
  6288. PRODUCTDATE: PRODUCTDATE,
  6289. ExpirationDate: ExpirationDate,
  6290. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6291. //自由项
  6292. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6293. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6294. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6295. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6296. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6297. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6298. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6299. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6300. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6301. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6302. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6303. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6304. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6305. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6306. }
  6307. ARR.push(obj);
  6308. }
  6309. $.submitForm({
  6310. url: "/PNWMS/WMSCreateItemLot/SubmitFormGDTLALL" + "?" + Math.random(),
  6311. param: {
  6312. keyValue: JSON.stringify(ARR)
  6313. },
  6314. success: function () {
  6315. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6316. }
  6317. })
  6318. }
  6319. //普通到货单
  6320. if (Type == '7') {
  6321. debugger;
  6322. var ARR = [];
  6323. for (var i in ids) {
  6324. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6325. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  6326. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6327. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6328. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6329. //console.log("单号:" + DNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  6330. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6331. if (thisCreateQty == 0) {
  6332. $.modalAlert("该单据条码已全部生成完毕!");
  6333. return;
  6334. }
  6335. thisCreateQty = thisCreateQty.toFixed(4);
  6336. var minPackQty = thisCreateQty;//最小包装量
  6337. //minPackQty = minPackQty.toFixed(4);
  6338. var createPageCount = 1;//本次生成张数
  6339. createPageCount = createPageCount.toFixed(0);
  6340. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  6341. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6342. Quantity = Quantity.toFixed(2);
  6343. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6344. CreatedQty = CreatedQty.toFixed(2);
  6345. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  6346. if (Quantity == CreatedQty) {
  6347. return false;
  6348. }
  6349. if (EffectiveEnable == 'true') {
  6350. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6351. } else {
  6352. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6353. }
  6354. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6355. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  6356. var obj = {
  6357. ID: ID,
  6358. Code: DNCode,
  6359. Sequence: Sequence,
  6360. thisCreateQty: thisCreateQty,
  6361. minPackQty: minPackQty,
  6362. createPageCount: createPageCount,
  6363. //VendorLot: VendorLot,
  6364. PRODUCTDATE: PRODUCTDATE,
  6365. ExpirationDate: ExpirationDate,
  6366. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6367. //自由项
  6368. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6369. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6370. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6371. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6372. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6373. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6374. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6375. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6376. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6377. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6378. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6379. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6380. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6381. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6382. }
  6383. ARR.push(obj);
  6384. }
  6385. $.submitForm({
  6386. url: "/PNWMS/WMSCreateItemLot/SubmitFormSHDHALL" + "?" + Math.random(),
  6387. param: {
  6388. keyValue: JSON.stringify(ARR)
  6389. },
  6390. success: function () {
  6391. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6392. }
  6393. })
  6394. }
  6395. //委外到货单
  6396. if (Type == '8') {
  6397. debugger;
  6398. var ARR = [];
  6399. for (var i in ids) {
  6400. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6401. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  6402. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6403. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6404. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6405. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  6406. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6407. if (thisCreateQty == 0) {
  6408. $.modalAlert("该单据条码已全部生成完毕!");
  6409. return;
  6410. }
  6411. thisCreateQty = thisCreateQty.toFixed(4);
  6412. var minPackQty = thisCreateQty;//最小包装量
  6413. //minPackQty = minPackQty.toFixed(4);
  6414. var createPageCount = 1;//本次生成张数
  6415. createPageCount = createPageCount.toFixed(0);
  6416. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  6417. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6418. Quantity = Quantity.toFixed(2);
  6419. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6420. CreatedQty = CreatedQty.toFixed(2);
  6421. console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  6422. if (Quantity == CreatedQty) {
  6423. return false;
  6424. }
  6425. if (EffectiveEnable == 'true') {
  6426. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6427. } else {
  6428. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6429. }
  6430. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6431. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  6432. var obj = {
  6433. ID: ID,
  6434. Code: ODNCode,
  6435. Sequence: Sequence,
  6436. thisCreateQty: thisCreateQty,
  6437. minPackQty: minPackQty,
  6438. createPageCount: createPageCount,
  6439. //VendorLot: VendorLot,
  6440. PRODUCTDATE: PRODUCTDATE,
  6441. ExpirationDate: ExpirationDate,
  6442. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6443. //自由项
  6444. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6445. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6446. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6447. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6448. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6449. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6450. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6451. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6452. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6453. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6454. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6455. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6456. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6457. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6458. }
  6459. ARR.push(obj);
  6460. }
  6461. $.submitForm({
  6462. url: "/PNWMS/WMSCreateItemLot/SubmitFormWWSHDHALL" + "?" + Math.random(),
  6463. param: {
  6464. keyValue: JSON.stringify(obj)
  6465. },
  6466. success: function () {
  6467. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6468. }
  6469. })
  6470. }
  6471. //成品入库单条码生成
  6472. if (Type == '9') {
  6473. debugger;
  6474. var ARR = [];
  6475. for (var i in ids) {
  6476. ID = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  6477. Code = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  6478. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  6479. EffectiveEnable = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveEnable;
  6480. EffectiveDays = $("#gridList").jqGrid('getRowData', ids[i]).EffectiveDays;
  6481. // console.log("单号:" + ODNCode + ",行号:" + Sequence + ",站位:" + WorkPoints);
  6482. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6483. if (thisCreateQty == 0) {
  6484. $.modalAlert("该单据条码已全部生成完毕!");
  6485. return;
  6486. }
  6487. thisCreateQty = thisCreateQty.toFixed(4);
  6488. var minPackQty = thisCreateQty;//最小包装量
  6489. //minPackQty = minPackQty.toFixed(4);
  6490. var createPageCount = 1;//本次生成张数
  6491. createPageCount = createPageCount.toFixed(0);
  6492. console.log("thisCreateQty:" + thisCreateQty + ",minPackQty:" + minPackQty);
  6493. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6494. Quantity = Quantity.toFixed(2);
  6495. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6496. CreatedQty = CreatedQty.toFixed(2);
  6497. // console.log("Quantity:" + Quantity + ",CreatedQty:" + CreatedQty);
  6498. if (Quantity == CreatedQty) {
  6499. return false;
  6500. }
  6501. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6502. if (EffectiveEnable == 'true') {
  6503. var ExpirationDate = dateChange(EffectiveDays, PRODUCTDATE);
  6504. } else {
  6505. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6506. }
  6507. // console.log("ExpirationDate:" + ExpirationDate + ",PRODUCTDATE:" + PRODUCTDATE);
  6508. var obj = {
  6509. ID: ID,
  6510. Code: Code,
  6511. Sequence: Sequence,
  6512. thisCreateQty: thisCreateQty,
  6513. minPackQty: minPackQty,
  6514. createPageCount: createPageCount,
  6515. //VendorLot: VendorLot,
  6516. PRODUCTDATE: PRODUCTDATE,
  6517. ExpirationDate: ExpirationDate,
  6518. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6519. //自由项
  6520. ProjectCode: $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).ProjectCode : '',
  6521. BatchCode: $("#gridList").jqGrid('getRowData', ids[i]).BatchCode !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).BatchCode : '',
  6522. Version: $("#gridList").jqGrid('getRowData', ids[i]).Version !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Version : '',
  6523. Brand: $("#gridList").jqGrid('getRowData', ids[i]).Brand !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).Brand : '',
  6524. cFree1: $("#gridList").jqGrid('getRowData', ids[i]).cFree1 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree1 : '',
  6525. cFree2: $("#gridList").jqGrid('getRowData', ids[i]).cFree2 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree2 : '',
  6526. cFree3: $("#gridList").jqGrid('getRowData', ids[i]).cFree3 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree3 : '',
  6527. cFree4: $("#gridList").jqGrid('getRowData', ids[i]).cFree4 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree4 : '',
  6528. cFree5: $("#gridList").jqGrid('getRowData', ids[i]).cFree5 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree5 : '',
  6529. cFree6: $("#gridList").jqGrid('getRowData', ids[i]).cFree6 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree6 : '',
  6530. cFree7: $("#gridList").jqGrid('getRowData', ids[i]).cFree7 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree7 : '',
  6531. cFree8: $("#gridList").jqGrid('getRowData', ids[i]).cFree8 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree8 : '',
  6532. cFree9: $("#gridList").jqGrid('getRowData', ids[i]).cFree9 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree9 : '',
  6533. cFree10: $("#gridList").jqGrid('getRowData', ids[i]).cFree10 !== undefined ? $("#gridList").jqGrid('getRowData', ids[i]).cFree10 : '',
  6534. }
  6535. ARR.push(obj);
  6536. }
  6537. $.submitForm({
  6538. url: "/PNWMS/WMSCreateItemLot/SubmitFormKLCPRKALL" + "?" + Math.random(),
  6539. param: {
  6540. keyValue: JSON.stringify(ARR)
  6541. },
  6542. success: function () {
  6543. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6544. }
  6545. })
  6546. }
  6547. if (Type == '17') {
  6548. for (var i in ids) {
  6549. LotNo = $("#gridList").jqGrid('getRowData', ids[i]).LotNo;
  6550. var thisCreateQty = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1 - $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//本次生成数量
  6551. if (thisCreateQty == 0) {
  6552. $.modalAlert("该条码已全部生成完毕!");
  6553. return;
  6554. }
  6555. thisCreateQty = thisCreateQty.toFixed(4);
  6556. var minPackQty = thisCreateQty;//最小包装量
  6557. var createPageCount = 1;//本次生成张数
  6558. createPageCount = createPageCount.toFixed(0);
  6559. var Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity * 1;//采购订单总数
  6560. Quantity = Quantity.toFixed(2);
  6561. var CreatedQty = $("#gridList").jqGrid('getRowData', ids[i]).LOTQTY * 1;//已生成数量
  6562. CreatedQty = CreatedQty.toFixed(2);
  6563. if (Quantity == CreatedQty) {
  6564. return false;
  6565. }
  6566. var ExpirationDate = '2999-12-31 00:00:00.000';//条码失效日期
  6567. var PRODUCTDATE = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();//条码生产日期
  6568. var obj = {
  6569. thisCreateQty: thisCreateQty,
  6570. minPackQty: minPackQty,
  6571. createPageCount: createPageCount,
  6572. //VendorLot: VendorLot,
  6573. PRODUCTDATE: PRODUCTDATE,
  6574. ExpirationDate: ExpirationDate,
  6575. Amount: $("#gridList").jqGrid('getRowData', ids[i]).Amount * 1,
  6576. }
  6577. $.submitForm({
  6578. url: "/PNWMS/WMSCreateItemLot/SubmitFormBHGTM?LotNo=" + LotNo + "&WorkPoint=" + WorkPoints,
  6579. param: {
  6580. keyValue: JSON.stringify(obj)
  6581. },
  6582. success: function () {
  6583. $.currentWindow().$("#gridList").trigger("reloadGrid");
  6584. }
  6585. })
  6586. }
  6587. }
  6588. }
  6589. </script>
  6590. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  6591. <script>
  6592. </script>
  6593. <div class="topPanel" style="height:149px;">
  6594. <div class="toolbar">
  6595. <div class="btn-group">
  6596. <a id="NF-ALLCreatePN" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnAllCreatePN()"><i class="fa fa-pencil-square-o"></i>整单条码生成</a>
  6597. <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>
  6598. <a id="NF-CreateNew" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>生成条码(非规则)</a>
  6599. <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>
  6600. <a id="NF-CreatePN" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreatePN()"><i class="fa fa-pencil-square-o"></i>生成条码</a>
  6601. <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>
  6602. <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>
  6603. <a id="NF-BatchPrint" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBatchPrint()"><i class="fa fa-pencil-square-o"></i>批量打印</a>
  6604. <a id="NF-btnInWareHouse" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnInWareHouse()"><i class="fa fa-pencil-square-o"></i>一键退库</a>
  6605. <a id="NF-Prints" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrints()"><i class="fa fa-pencil-square-o"></i>单据批量打印</a>
  6606. <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>
  6607. @*<a id="NF-ExportAll" authorize="yes" class="btn btn-default" onclick="btn_ExportAll()"><i class="fa fa-download"></i>导出</a>*@
  6608. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  6609. </div>
  6610. <div class="btn-group" style="display:block;padding-left:2px;">
  6611. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  6612. <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>
  6613. <a id="NF-Rebind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Rebind()"><i class="fa fa-pencil-square-o"></i>重新绑定</a>
  6614. <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>
  6615. </div>
  6616. <script>$('.toolbar').authorizeButton()</script>
  6617. </div>
  6618. <div class="search">
  6619. <table>
  6620. <tr>
  6621. <td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;</label>:</td>
  6622. <td class="POCodeShow">
  6623. <div class="input-group">
  6624. <input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
  6625. </div>
  6626. </td>
  6627. <td class="HideItemsSourceCode" style="text-align:right;"><label class="lglabel " for="txt_SourceCode">&nbsp;&nbsp;&nbsp;&nbsp;</label>采购订单号:</td>
  6628. <td class="HideItemsSourceCode">
  6629. <div class="input-group">
  6630. <input id="txt_SourceCode" type="text" class="form-control" style="width: 130px;">
  6631. </div>
  6632. </td>
  6633. <td class="HideItemsVednCode" style="text-align:right;"><label class="lglabel HideItemsVednCode" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  6634. <td class="HideItemsVednCode">
  6635. <div class="input-group HideItemsVednCode">
  6636. <input id="txt_VenCode" type="text" class="form-control HideItemsVednCode" style="width: 130px;">
  6637. </div>
  6638. </td>
  6639. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  6640. <td class="HideItems">
  6641. <div class="input-group HideItems">
  6642. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;">
  6643. </div>
  6644. </td>
  6645. <td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;源头单据号</label>:</td>
  6646. <td class="HideItems2">
  6647. <div class="input-group HideItems2">
  6648. <input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;">
  6649. </div>
  6650. </td>
  6651. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(从)</label>:</td>
  6652. <td class="HideItemsTime">
  6653. <div class="input-group HideItemsTime">
  6654. <input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(从)" />
  6655. </div>
  6656. </td>
  6657. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(到)</label>:</td>
  6658. <td class="HideItemsTime">
  6659. <div class="input-group HideItemsTime">
  6660. <input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" />
  6661. </div>
  6662. </td>
  6663. <td class="HideClassGroup" style="text-align:right;">
  6664. <label>&nbsp;&nbsp;&nbsp;班组:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6665. </td>
  6666. <td class="HideClassGroup">
  6667. <div class="input-group">
  6668. <select id="selClassGroup" name="F_Target" class="form-control" style="width: 130px;">
  6669. <option value=""></option>
  6670. <option value="风电一组">风电一组</option>
  6671. <option value="风电二组">风电二组</option>
  6672. <option value="数控组">数控组</option>
  6673. <option value="新能源组">新能源组</option>
  6674. <option value="裁线组">裁线组</option>
  6675. <option value="中高压组">中高压组</option>
  6676. <option value="样品组">样品组</option>
  6677. <option value="铜排">铜排</option>
  6678. <option value="风电三组">风电三组</option>
  6679. <option value="风电四组">风电四组</option>
  6680. <option value="机器人线束">机器人线束</option>
  6681. </select>
  6682. </div>
  6683. </td>
  6684. </tr>
  6685. <tr>
  6686. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  6687. <td>
  6688. <div class="input-group">
  6689. <input id="txt_InvCode" type="text" class="form-control" style="width: 130px;">
  6690. </div>
  6691. </td>
  6692. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  6693. <td>
  6694. <div class="input-group">
  6695. <input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
  6696. </div>
  6697. </td>
  6698. <td class="HideItems3" style="text-align:right;"><label class="lglabel HideItems3" for="txt_InvStd">&nbsp;&nbsp;&nbsp;&nbsp;规格型号</label>:</td>
  6699. <td class="HideItems3">
  6700. <div class="input-group HideItems3">
  6701. <input id="txt_InvStd" type="text" class="form-control" style="width: 130px;">
  6702. </div>
  6703. </td>
  6704. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  6705. <td>
  6706. <div class="input-group">
  6707. <input id="txt_BatchCode" type="text" class="form-control" style="width: 130px;">
  6708. </div>
  6709. </td>
  6710. <td id="GDLX">
  6711. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6712. </td>
  6713. <td id="GDLX2">
  6714. <div class="input-group">
  6715. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;"></select>
  6716. </div>
  6717. </td>
  6718. </tr>
  6719. <tr>
  6720. <td class="HideWH">
  6721. <label>&nbsp;&nbsp;&nbsp;仓库编码:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6722. </td>
  6723. <td class="HideWH">
  6724. <div class="input-group HideWH">
  6725. <input id="txt_WHCode" type="text" class="form-control HideWH" style="width: 130px;">
  6726. </div>
  6727. </td>
  6728. <td>
  6729. <label>&nbsp;&nbsp;&nbsp;是否全部生成:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6730. </td>
  6731. <td>
  6732. <div class="input-group">
  6733. <select id="selShow" name="F_Target" class="form-control" style="width: 130px;">
  6734. <option value="0" selected="selected">显示全部</option>
  6735. <option value="1">已全部生成</option>
  6736. <option value="2">未全部生成</option>
  6737. </select>
  6738. </div>
  6739. </td>
  6740. <td clsaa="Status">
  6741. <label>&nbsp;&nbsp;&nbsp;是否全部入库:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6742. </td>
  6743. <td clsaa="Status">
  6744. <div class="input-group">
  6745. <select id="selStatus" name="F_Target" class="form-control" style="width: 130px;">
  6746. <option value="0" selected="selected">全部</option>
  6747. <option value="1">未全部入库</option>
  6748. <option value="2">已全部入库</option>
  6749. </select>
  6750. </div>
  6751. </td>
  6752. <td class="HideItems3">
  6753. <label>&nbsp;&nbsp;&nbsp;条码是否打印:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  6754. </td>
  6755. <td class="HideItems3">
  6756. <div class="input-group HideItems3">
  6757. <select id="selPrint" name="selPrint" class="form-control HideItems3" style="width: 130px;">
  6758. <option value="0" selected="selected">显示全部</option>
  6759. <option value="1">已打印</option>
  6760. <option value="2">未打印</option>
  6761. </select>
  6762. </div>
  6763. </td>
  6764. <td>
  6765. <span class="input-group-btn">
  6766. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  6767. </span>
  6768. </td>
  6769. </tr>
  6770. </table>
  6771. </div>
  6772. </div>
  6773. <div class="gridPanel">
  6774. <table id="gridList"></table>
  6775. <div id="gridPager"></div>
  6776. </div>