爱思开
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.

3010 lines
153 KiB

2 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. debugger;
  7. var _Clos = new Array();
  8. var Type = $.request("Type");
  9. var ColModelMain = [];
  10. var ColModelSub = [];
  11. $(function () {
  12. SetCols();
  13. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9') {
  14. $(".HideItems").css('display', 'none');
  15. }
  16. if (Type == '1') {
  17. gridList();
  18. }
  19. if (Type == '2') {
  20. gridList2();
  21. }
  22. if (Type == '3') {
  23. $("#NF-Uploading").css('display', 'block');
  24. gridList3();
  25. }
  26. if (Type == '4') {
  27. gridList4();
  28. }
  29. if (Type == '5') {
  30. gridList5();
  31. }
  32. if (Type == '6') {
  33. gridList6();
  34. }
  35. //审核到货单生成条码
  36. if (Type == '7') {
  37. gridList7();
  38. }
  39. //审核委外到货单生成条码
  40. if (Type == '8') {
  41. gridList8();
  42. }
  43. //开立成品入库单生成条码
  44. if (Type == '9') {
  45. gridList9();
  46. }
  47. //审核拒收单生成条码
  48. if (Type == '10') {
  49. gridList10();
  50. }
  51. //审核委外拒收单生成条码
  52. if (Type == '11') {
  53. gridList11();
  54. }
  55. //领料申请退料生成条码
  56. if (Type == '12') {
  57. gridList12();
  58. }
  59. //材料出库退料生成条码
  60. if (Type == '13') {
  61. gridList13();
  62. }
  63. //委外领料申请退料生成条码
  64. if (Type == '14') {
  65. gridList14();
  66. }
  67. //委外材料出库退料生成条码
  68. if (Type == '15') {
  69. gridList15();
  70. }
  71. if (Type == '16') {
  72. gridList16();
  73. }
  74. })
  75. function SetCols() {
  76. $.ajax({
  77. url: "/Print/SelectColumnName?" + Math.random(),
  78. dataType: "json",
  79. async: false,
  80. success: function (data) {
  81. var cols = new Array();
  82. if (Type == '1') {
  83. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  84. cols.push(collast);
  85. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  86. cols.push(collast);
  87. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  88. cols.push(collast);
  89. var collast = { label: '工单子件', name: 'SourceDetailID', hidden: true, };
  90. cols.push(collast);
  91. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  92. cols.push(collast);
  93. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  94. cols.push(collast);
  95. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  96. cols.push(collast);
  97. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  98. cols.push(collast);
  99. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  100. cols.push(collast);
  101. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  102. cols.push(collast);
  103. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  104. cols.push(collast);
  105. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  106. //cols.push(collast);
  107. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  108. cols.push(collast);
  109. }
  110. if (Type == '2') {
  111. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  112. cols.push(collast);
  113. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  114. cols.push(collast);
  115. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  116. cols.push(collast);
  117. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  118. cols.push(collast);
  119. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  120. cols.push(collast);
  121. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  122. cols.push(collast);
  123. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  124. cols.push(collast);
  125. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  126. cols.push(collast);
  127. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  128. cols.push(collast);
  129. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  130. cols.push(collast);
  131. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  132. cols.push(collast);
  133. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  134. //cols.push(collast);
  135. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  136. cols.push(collast);
  137. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  138. //cols.push(collast);
  139. }
  140. if (Type == '3') {
  141. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  142. cols.push(collast);
  143. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  144. cols.push(collast);
  145. var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
  146. cols.push(collast);
  147. var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
  148. cols.push(collast);
  149. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  150. cols.push(collast);
  151. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  152. cols.push(collast);
  153. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  154. cols.push(collast);
  155. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  156. cols.push(collast);
  157. var collast = {
  158. label: "状态", name: "MOStatus", width: 60, align: "left",
  159. formatter: function (cellvalue) {
  160. if (cellvalue == "1") {
  161. return "初始";
  162. } else if (cellvalue == "2") {
  163. return "下发";
  164. }
  165. else if (cellvalue == "3") {
  166. return "关单";
  167. }
  168. else { return ""; }
  169. }
  170. };
  171. cols.push(collast);
  172. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  173. cols.push(collast);
  174. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  175. cols.push(collast);
  176. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  177. //cols.push(collast);
  178. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  179. cols.push(collast);
  180. var collast = { label: '时间', name: 'MTIME', hidden: true };
  181. cols.push(collast);
  182. }
  183. if (Type == '4') {
  184. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  185. cols.push(collast);
  186. var collast = { label: '单据号', name: 'SDNCode', width: 120, align: 'left' };
  187. cols.push(collast);
  188. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  189. cols.push(collast);
  190. var collast = { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' };
  191. cols.push(collast);
  192. var collast = { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' };
  193. cols.push(collast);
  194. var collast = { label: '客户代码', name: 'CusCode', width: 120, align: 'left' };
  195. cols.push(collast);
  196. var collast = { label: '客户名称', name: 'CusName', width: 50, align: 'left' };
  197. cols.push(collast);
  198. var collast = { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' };
  199. cols.push(collast);
  200. var collast = { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' };
  201. cols.push(collast);
  202. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  203. cols.push(collast);
  204. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  205. cols.push(collast);
  206. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  207. cols.push(collast);
  208. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  209. cols.push(collast);
  210. var collast = {
  211. label: "状态", name: "Status", width: 60, align: "left",
  212. formatter: function (cellvalue) {
  213. if (cellvalue == "1") {
  214. return "开立";
  215. } else if (cellvalue == "2") {
  216. return "审核";
  217. }
  218. else if (cellvalue == "3") {
  219. return "关闭";
  220. }
  221. else { return ""; }
  222. }
  223. };
  224. cols.push(collast);
  225. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  226. cols.push(collast);
  227. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  228. cols.push(collast);
  229. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  230. //cols.push(collast);
  231. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  232. cols.push(collast);
  233. }
  234. if (Type == '5') {
  235. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  236. cols.push(collast);
  237. var collast = { label: '单据号', name: 'InCode', width: 120, align: 'left' };
  238. cols.push(collast);
  239. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  240. cols.push(collast);
  241. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  242. cols.push(collast);
  243. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  244. cols.push(collast);
  245. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  246. cols.push(collast);
  247. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  248. cols.push(collast);
  249. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  250. cols.push(collast);
  251. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  252. cols.push(collast);
  253. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  254. cols.push(collast);
  255. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  256. cols.push(collast);
  257. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  258. cols.push(collast);
  259. var collast = { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', };
  260. cols.push(collast);
  261. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  262. cols.push(collast);
  263. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  264. cols.push(collast);
  265. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  266. //cols.push(collast);
  267. }
  268. if (Type == '6') {
  269. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  270. cols.push(collast);
  271. var collast = { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' };
  272. cols.push(collast);
  273. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  274. cols.push(collast);
  275. var collast = { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' };
  276. cols.push(collast);
  277. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  278. cols.push(collast);
  279. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  280. cols.push(collast);
  281. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  282. cols.push(collast);
  283. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  284. cols.push(collast);
  285. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  286. cols.push(collast);
  287. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  288. cols.push(collast);
  289. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  290. cols.push(collast);
  291. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  292. cols.push(collast);
  293. var collast = { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', };
  294. cols.push(collast);
  295. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  296. cols.push(collast);
  297. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  298. cols.push(collast);
  299. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  300. //cols.push(collast);
  301. }
  302. //审核到货单生成条码
  303. if (Type == '7') {
  304. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  305. cols.push(collast);
  306. var collast = { label: '单据号', name: 'DNCode', width: 120, align: 'left' };
  307. cols.push(collast);
  308. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  309. cols.push(collast);
  310. var collast = { label: '采购订单号', name: 'POCode', width: 100, align: 'left' };
  311. cols.push(collast);
  312. var collast = { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' };
  313. cols.push(collast);
  314. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  315. cols.push(collast);
  316. var collast = { label: '供应商名称', name: 'VenName', width: 180, align: 'left' };
  317. cols.push(collast);
  318. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  319. cols.push(collast);
  320. var collast = { label: '料品名称', name: 'InvName', width: 80, align: 'left' };
  321. cols.push(collast);
  322. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  323. cols.push(collast);
  324. var collast = { label: '料品型号', name: 'InvStd', width: 100, align: 'left' };
  325. cols.push(collast);
  326. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  327. cols.push(collast);
  328. var collast = { label: '数量', name: 'Quantity', width: 80, align: 'left' };
  329. cols.push(collast);
  330. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  331. cols.push(collast);
  332. var collast = { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' };
  333. cols.push(collast);
  334. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  335. cols.push(collast);
  336. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  337. cols.push(collast);
  338. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  339. cols.push(collast);
  340. var collast = { label: '创建时间', name: 'CreateDateTime', width: 120, align: 'left' };
  341. cols.push(collast);
  342. }
  343. //审核委外到货单生成条码
  344. if (Type == '8') {
  345. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  346. cols.push(collast);
  347. var collast = { label: '单据号', name: 'ODNCode', width: 120, align: 'left' };
  348. cols.push(collast);
  349. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  350. cols.push(collast);
  351. var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  352. cols.push(collast);
  353. var collast = { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' };
  354. cols.push(collast);
  355. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  356. cols.push(collast);
  357. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  358. cols.push(collast);
  359. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  360. cols.push(collast);
  361. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  362. cols.push(collast);
  363. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  364. cols.push(collast);
  365. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  366. cols.push(collast);
  367. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  368. cols.push(collast);
  369. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  370. cols.push(collast);
  371. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  372. //cols.push(collast);
  373. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  374. cols.push(collast);
  375. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  376. cols.push(collast);
  377. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  378. cols.push(collast);
  379. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  380. cols.push(collast);
  381. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  382. cols.push(collast);
  383. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  384. cols.push(collast);
  385. }
  386. //开立成品入库单生成条码
  387. if (Type == '9') {
  388. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  389. cols.push(collast);
  390. var collast = { label: '单据号', name: 'RCVCode', width: 120, align: 'left' };
  391. cols.push(collast);
  392. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  393. cols.push(collast);
  394. var collast = { label: '仓库号', name: 'WHCode', width: 120, align: 'left' };
  395. cols.push(collast);
  396. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  397. cols.push(collast);
  398. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  399. cols.push(collast);
  400. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  401. cols.push(collast);
  402. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  403. cols.push(collast);
  404. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  405. cols.push(collast);
  406. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  407. cols.push(collast);
  408. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  409. //cols.push(collast);
  410. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  411. cols.push(collast);
  412. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  413. cols.push(collast);
  414. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  415. cols.push(collast);
  416. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  417. cols.push(collast);
  418. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  419. cols.push(collast);
  420. }
  421. //审核拒收单生成条码
  422. if (Type == '10') {
  423. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  424. cols.push(collast);
  425. var collast = { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' };
  426. cols.push(collast);
  427. var collast = { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' };
  428. cols.push(collast);
  429. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  430. cols.push(collast);
  431. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  432. cols.push(collast);
  433. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  434. cols.push(collast);
  435. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  436. cols.push(collast);
  437. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  438. cols.push(collast);
  439. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  440. cols.push(collast);
  441. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  442. cols.push(collast);
  443. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  444. cols.push(collast);
  445. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  446. cols.push(collast);
  447. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  448. cols.push(collast);
  449. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  450. cols.push(collast);
  451. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  452. cols.push(collast);
  453. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  454. cols.push(collast);
  455. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  456. cols.push(collast);
  457. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  458. cols.push(collast);
  459. }
  460. //审核委外拒收单生成条码
  461. if (Type == '11') {
  462. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  463. cols.push(collast);
  464. var collast = { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' };
  465. cols.push(collast);
  466. var collast = { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' };
  467. cols.push(collast);
  468. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  469. cols.push(collast);
  470. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  471. cols.push(collast);
  472. var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' };
  473. cols.push(collast);
  474. var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' };
  475. cols.push(collast);
  476. var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' };
  477. cols.push(collast);
  478. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' };
  479. cols.push(collast);
  480. var collast = { label: '料品单位', name: 'InvStd', width: 50, align: 'left' };
  481. cols.push(collast);
  482. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  483. cols.push(collast);
  484. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  485. cols.push(collast);
  486. var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' };
  487. cols.push(collast);
  488. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  489. cols.push(collast);
  490. var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', };
  491. cols.push(collast);
  492. var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', };
  493. cols.push(collast);
  494. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  495. cols.push(collast);
  496. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  497. cols.push(collast);
  498. }
  499. //领料申请退料生成条码
  500. if (Type == '12') {
  501. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  502. cols.push(collast);
  503. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  504. cols.push(collast);
  505. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  506. cols.push(collast);
  507. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  508. cols.push(collast);
  509. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  510. cols.push(collast);
  511. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  512. cols.push(collast);
  513. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  514. cols.push(collast);
  515. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  516. cols.push(collast);
  517. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  518. cols.push(collast);
  519. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  520. cols.push(collast);
  521. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  522. cols.push(collast);
  523. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  524. //cols.push(collast);
  525. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  526. cols.push(collast);
  527. }
  528. //材料出库退料生成条码
  529. if (Type == '13') {
  530. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  531. cols.push(collast);
  532. var collast = { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' };
  533. cols.push(collast);
  534. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  535. cols.push(collast);
  536. var collast = { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, };
  537. cols.push(collast);
  538. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  539. cols.push(collast);
  540. var collast = { label: '料品编码', name: 'InvName', width: 60, align: 'left', };
  541. cols.push(collast);
  542. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  543. cols.push(collast);
  544. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  545. cols.push(collast);
  546. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  547. cols.push(collast);
  548. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  549. cols.push(collast);
  550. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  551. cols.push(collast);
  552. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  553. //cols.push(collast);
  554. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  555. cols.push(collast);
  556. }
  557. //委外领料申请退料生成条码
  558. if (Type == '14') {
  559. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  560. cols.push(collast);
  561. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  562. cols.push(collast);
  563. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  564. cols.push(collast);
  565. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  566. cols.push(collast);
  567. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  568. cols.push(collast);
  569. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  570. cols.push(collast);
  571. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  572. cols.push(collast);
  573. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  574. cols.push(collast);
  575. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  576. cols.push(collast);
  577. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  578. cols.push(collast);
  579. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  580. cols.push(collast);
  581. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  582. //cols.push(collast);
  583. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  584. cols.push(collast);
  585. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  586. //cols.push(collast);
  587. }
  588. //委外材料出库退料生成条码
  589. if (Type == '15') {
  590. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  591. cols.push(collast);
  592. var collast = { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' };
  593. cols.push(collast);
  594. var collast = { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' };
  595. cols.push(collast);
  596. var collast = { label: '来源单据ID', name: 'SourceDetailID', hidden: true, };
  597. cols.push(collast);
  598. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  599. cols.push(collast);
  600. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  601. cols.push(collast);
  602. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  603. cols.push(collast);
  604. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  605. cols.push(collast);
  606. var collast = { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  607. cols.push(collast);
  608. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  609. cols.push(collast);
  610. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  611. cols.push(collast);
  612. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  613. cols.push(collast);
  614. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  615. cols.push(collast);
  616. var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  617. cols.push(collast);
  618. }
  619. //返工工单生成条码
  620. if (Type == '16') {
  621. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  622. cols.push(collast);
  623. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  624. cols.push(collast);
  625. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  626. cols.push(collast);
  627. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  628. cols.push(collast);
  629. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  630. cols.push(collast);
  631. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  632. cols.push(collast);
  633. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  634. cols.push(collast);
  635. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  636. cols.push(collast);
  637. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  638. cols.push(collast);
  639. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  640. cols.push(collast);
  641. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  642. cols.push(collast);
  643. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  644. //cols.push(collast);
  645. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  646. cols.push(collast);
  647. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  648. //cols.push(collast);
  649. }
  650. var cols1 = new Array();
  651. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  652. cols1.push(collast1);
  653. var collast1 = { label: "来源单据号", name: "TransCode", width: 200, align: 'left' };
  654. cols1.push(collast1);
  655. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' };
  656. cols1.push(collast1);
  657. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  658. cols1.push(collast1);
  659. var collast1 = { label: '条码数量', name: 'Quantity', width: 200, align: 'left' };
  660. cols1.push(collast1);
  661. var collast1 = { label: '是否入库', name: 'RKState', width: 200, align: 'left' };
  662. cols1.push(collast1);
  663. var collast1 = { label: '操作人', name: 'MUSERName', width: 200, align: 'left' };
  664. cols1.push(collast1);
  665. var collast1 = { label: '操作时间', name: 'MTIME', width: 200, align: 'left' };
  666. cols1.push(collast1);
  667. if (data != null && data.length > 0) {
  668. DateList = data;
  669. for (var i = 0; i < data.length; i++) {
  670. var ColName = data[i].ColName;
  671. var ColCode = data[i].ColCode;
  672. var obj = new Array();
  673. obj = {
  674. label: ColName,
  675. name: ColCode,
  676. width: 80,
  677. align: "left"
  678. }
  679. cols.push(obj);
  680. cols1.push(obj);
  681. }
  682. }
  683. _Clos = cols;
  684. _Clos1 = cols1;
  685. }
  686. });
  687. }
  688. //生产退料
  689. function gridList() {
  690. var $gridList = $("#gridList");
  691. var queryJson = {
  692. POCode: $("#txt_POCode").val(),
  693. InvCode: $("#txt_InvCode").val(),
  694. InvName: $("#txt_InvName").val(),
  695. BatchCode: $("#txt_BatchCode").val(),
  696. }
  697. $gridList.dataGrid({
  698. url: "/WMS/WMSCreateItemLot/GetGridJson" + "?" + Math.random(),
  699. postData: { queryJson: JSON.stringify(queryJson) },
  700. height: $(window).height() - 200,
  701. width: $(window).width() - 300,
  702. colModel: _Clos,
  703. //colModel: [
  704. // { label: "主键", name: "ID", hidden: true, key: true },
  705. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  706. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  707. // { label: '工单子件', name: 'SourceDetailID', hidden: true, },
  708. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  709. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  710. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  711. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  712. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  713. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  714. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  715. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  716. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  717. //],
  718. //colModel: ColModelMain,
  719. width: "100%",
  720. autowidth: true,
  721. //shrinkToFit: true,
  722. gridComplete: function () {
  723. },
  724. pager: "#gridPager",
  725. sortname: 'ApplyNegCode,Sequence',
  726. sortorder: "asc",
  727. viewrecords: true,
  728. multiselect: true,
  729. beforeSelectRow: function (rowid, e) {
  730. $("#gridList").jqGrid('resetSelection');
  731. return (true);
  732. },
  733. subGrid: true, // (1)开启子表格支持
  734. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  735. $("#gridList").jqGrid("setSelection", rowid, false);
  736. bindSubGrid(subgrid_id, rowid)
  737. }
  738. });
  739. $("#warehouse a.btn-default").click(function () {
  740. $("#warehouse a.btn-default").removeClass("active");
  741. $(this).addClass("active");
  742. $('#btn_search').trigger("click");
  743. });
  744. $("#btn_search").click(function () {
  745. var warehouse = $("#warehouse a.active").attr('data-value');
  746. var queryJson = {
  747. POCode: $("#txt_POCode").val(),
  748. InvCode: $("#txt_InvCode").val(),
  749. InvName: $("#txt_InvName").val(),
  750. BatchCode: $("#txt_BatchCode").val(),
  751. }
  752. $gridList.jqGrid('setGridParam', {
  753. postData: { queryJson: JSON.stringify(queryJson) },
  754. }).trigger('reloadGrid');
  755. });
  756. }
  757. function bindSubGrid(subgrid_id, rowid) {
  758. $("#gridList").jqGrid("setSelection", rowid, false);
  759. var subgrid_table_id;
  760. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  761. var subgrid_pager_id;
  762. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  763. // (5)动态添加子报表的table和pager
  764. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  765. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  766. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  767. // (6)创建jqGrid对象
  768. $("#" + subgrid_table_id).dataGrid({
  769. cellEdit: true,
  770. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  771. //colModel: [
  772. // { label: "主键", name: "ID", hidden: true, key: true },
  773. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  774. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  775. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  776. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  777. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  778. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  779. //],
  780. colModel: _Clos1,
  781. //colModel: ColModelSub,
  782. shrinkToFit: true,//宽度自适应
  783. multiselect: true,
  784. prmNames: { search: "search" },
  785. viewrecords: true,
  786. height: "100%",
  787. rowNum: 20,
  788. pager: subgrid_pager_id,
  789. });
  790. }
  791. //委外退料
  792. function gridList2() {
  793. var $gridList = $("#gridList");
  794. var queryJson = {
  795. POCode: $("#txt_POCode").val(),
  796. InvCode: $("#txt_InvCode").val(),
  797. InvName: $("#txt_InvName").val(),
  798. BatchCode: $("#txt_BatchCode").val(),
  799. }
  800. $gridList.dataGrid({
  801. url: "/WMS/WMSCreateItemLot/GetGridJsonWeiWai" + "?" + Math.random(),
  802. postData: { queryJson: JSON.stringify(queryJson) },
  803. height: $(window).height() - 200,
  804. width: $(window).width() - 300,
  805. colModel: _Clos,
  806. //colModel: [
  807. // { label: "主键", name: "ID", hidden: true, key: true },
  808. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  809. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  810. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  811. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  812. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  813. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  814. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  815. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  816. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  817. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  818. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  819. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  820. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  821. //],
  822. //colModel: ColModelMain,
  823. width: "100%",
  824. autowidth: true,
  825. //shrinkToFit: true,
  826. gridComplete: function () {
  827. },
  828. pager: "#gridPager",
  829. sortname: 'OApplyNegCode,Sequence',
  830. sortorder: "asc",
  831. viewrecords: true,
  832. multiselect: true,
  833. beforeSelectRow: function (rowid, e) {
  834. $("#gridList").jqGrid('resetSelection');
  835. return (true);
  836. },
  837. subGrid: true, // (1)开启子表格支持
  838. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  839. $("#gridList").jqGrid("setSelection", rowid, false);
  840. bindSubGrid2(subgrid_id, rowid)
  841. }
  842. });
  843. $("#warehouse a.btn-default").click(function () {
  844. $("#warehouse a.btn-default").removeClass("active");
  845. $(this).addClass("active");
  846. $('#btn_search').trigger("click");
  847. });
  848. $("#btn_search").click(function () {
  849. var warehouse = $("#warehouse a.active").attr('data-value');
  850. var queryJson = {
  851. POCode: $("#txt_POCode").val(),
  852. InvCode: $("#txt_InvCode").val(),
  853. InvName: $("#txt_InvName").val(),
  854. BatchCode: $("#txt_BatchCode").val(),
  855. }
  856. $gridList.jqGrid('setGridParam', {
  857. postData: { queryJson: JSON.stringify(queryJson) },
  858. }).trigger('reloadGrid');
  859. });
  860. }
  861. function bindSubGrid2(subgrid_id, rowid) {
  862. $("#gridList").jqGrid("setSelection", rowid, false);
  863. var subgrid_table_id;
  864. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  865. var subgrid_pager_id;
  866. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  867. // (5)动态添加子报表的table和pager
  868. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  869. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  870. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  871. // (6)创建jqGrid对象
  872. $("#" + subgrid_table_id).dataGrid({
  873. cellEdit: true,
  874. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  875. //colModel: [
  876. // { label: "主键", name: "ID", hidden: true, key: true },
  877. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  878. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  879. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  880. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  881. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  882. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  883. //],
  884. colModel: _Clos1,
  885. //colModel: ColModelSub,
  886. shrinkToFit: true,//宽度自适应
  887. multiselect: true,
  888. prmNames: { search: "search" },
  889. viewrecords: true,
  890. height: "100%",
  891. rowNum: 20,
  892. pager: subgrid_pager_id,
  893. });
  894. }
  895. //成品
  896. function gridList3() {
  897. var $gridList = $("#gridList");
  898. var queryJson = {
  899. POCode: $("#txt_POCode").val(),
  900. InvCode: $("#txt_InvCode").val(),
  901. InvName: $("#txt_InvName").val(),
  902. BatchCode: $("#txt_BatchCode").val(),
  903. }
  904. $gridList.dataGrid({
  905. url: "/WMS/WMSCreateItemLot/GetGridJsonChengPing" + "?" + Math.random(),
  906. postData: { queryJson: JSON.stringify(queryJson) },
  907. height: $(window).height() - 200,
  908. width: $(window).width() - 300,
  909. colModel: _Clos,
  910. //colModel: [
  911. // { label: "主键", name: "ID", hidden: true, key: true },
  912. // { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  913. // { label: '工单行号', name: 'Sequence', width: 50, align: 'left' },
  914. // { label: '已入库数量', name: 'RCVQuantity', hidden: true, },
  915. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  916. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  917. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  918. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  919. // {
  920. // label: "状态", name: "MOStatus", width: 60, align: "left",
  921. // formatter: function (cellvalue) {
  922. // if (cellvalue == "1") {
  923. // return "初始";
  924. // } else if (cellvalue == "2") {
  925. // return "下发";
  926. // }
  927. // else if (cellvalue == "3") {
  928. // return "关单";
  929. // }
  930. // else { return ""; }
  931. // }
  932. // },
  933. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  934. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  935. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  936. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  937. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  938. //],
  939. //colModel: ColModelMain,
  940. width: "100%",
  941. autowidth: true,
  942. //shrinkToFit: true,
  943. gridComplete: function () {
  944. },
  945. pager: "#gridPager",
  946. sortname: 'MTIME desc,MOCode asc,Sequence asc',
  947. sortorder: "",
  948. viewrecords: true,
  949. multiselect: true,
  950. beforeSelectRow: function (rowid, e) {
  951. $("#gridList").jqGrid('resetSelection');
  952. return (true);
  953. },
  954. subGrid: true, // (1)开启子表格支持
  955. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  956. $("#gridList").jqGrid("setSelection", rowid, false);
  957. bindSubGrid3(subgrid_id, rowid)
  958. }
  959. });
  960. $("#warehouse a.btn-default").click(function () {
  961. $("#warehouse a.btn-default").removeClass("active");
  962. $(this).addClass("active");
  963. $('#btn_search').trigger("click");
  964. });
  965. $("#btn_search").click(function () {
  966. var warehouse = $("#warehouse a.active").attr('data-value');
  967. var queryJson = {
  968. POCode: $("#txt_POCode").val(),
  969. InvCode: $("#txt_InvCode").val(),
  970. InvName: $("#txt_InvName").val(),
  971. BatchCode: $("#txt_BatchCode").val(),
  972. }
  973. $gridList.jqGrid('setGridParam', {
  974. postData: { queryJson: JSON.stringify(queryJson) },
  975. }).trigger('reloadGrid');
  976. });
  977. }
  978. function bindSubGrid3(subgrid_id, rowid) {
  979. $("#gridList").jqGrid("setSelection", rowid, false);
  980. var subgrid_table_id;
  981. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  982. var subgrid_pager_id;
  983. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  984. // (5)动态添加子报表的table和pager
  985. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  986. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  987. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  988. // (6)创建jqGrid对象
  989. $("#" + subgrid_table_id).dataGrid({
  990. cellEdit: true,
  991. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  992. //colModel: [
  993. // { label: "主键", name: "ID", hidden: true, key: true },
  994. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  995. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  996. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  997. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  998. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  999. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1000. //],
  1001. colModel: _Clos1,
  1002. //colModel: ColModelSub,
  1003. shrinkToFit: true,//宽度自适应
  1004. multiselect: true,
  1005. prmNames: { search: "search" },
  1006. viewrecords: true,
  1007. sortname: 'LotNo',
  1008. sortorder: "desc",
  1009. height: "100%",
  1010. rowNum: 20,
  1011. pager: subgrid_pager_id,
  1012. });
  1013. }
  1014. //销售退货
  1015. function gridList4() {
  1016. var $gridList = $("#gridList");
  1017. var queryJson = {
  1018. POCode: $("#txt_POCode").val(),
  1019. InvCode: $("#txt_InvCode").val(),
  1020. InvName: $("#txt_InvName").val(),
  1021. BatchCode: $("#txt_BatchCode").val(),
  1022. }
  1023. $gridList.dataGrid({
  1024. url: "/WMS/WMSCreateItemLot/GetGridJsonXiaoShou" + "?" + Math.random(),
  1025. postData: { queryJson: JSON.stringify(queryJson) },
  1026. height: $(window).height() - 200,
  1027. width: $(window).width() - 300,
  1028. colModel: _Clos,
  1029. //colModel: [
  1030. // { label: "主键", name: "ID", hidden: true, key: true },
  1031. // { label: '单据号', name: 'SDNCode', width: 120, align: 'left' },
  1032. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1033. // { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' },
  1034. // { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' },
  1035. // { label: '客户代码', name: 'CusCode', width: 120, align: 'left' },
  1036. // { label: '客户名称', name: 'CusName', width: 50, align: 'left' },
  1037. // { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' },
  1038. // { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' },
  1039. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1040. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  1041. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1042. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1043. // {
  1044. // label: "状态", name: "Status", width: 60, align: "left",
  1045. // formatter: function (cellvalue) {
  1046. // if (cellvalue == "1") {
  1047. // return "开立";
  1048. // } else if (cellvalue == "2") {
  1049. // return "审核";
  1050. // }
  1051. // else if (cellvalue == "3") {
  1052. // return "关闭";
  1053. // }
  1054. // else { return ""; }
  1055. // }
  1056. // },
  1057. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1058. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1059. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1060. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1061. //],
  1062. //colModel: ColModelMain,
  1063. width: "100%",
  1064. autowidth: true,
  1065. //shrinkToFit: true,
  1066. gridComplete: function () {
  1067. },
  1068. pager: "#gridPager",
  1069. sortname: 'SDNCode,Sequence',
  1070. sortorder: "asc",
  1071. viewrecords: true,
  1072. multiselect: true,
  1073. beforeSelectRow: function (rowid, e) {
  1074. $("#gridList").jqGrid('resetSelection');
  1075. return (true);
  1076. },
  1077. subGrid: true, // (1)开启子表格支持
  1078. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1079. $("#gridList").jqGrid("setSelection", rowid, false);
  1080. bindSubGrid4(subgrid_id, rowid)
  1081. }
  1082. });
  1083. $("#warehouse a.btn-default").click(function () {
  1084. $("#warehouse a.btn-default").removeClass("active");
  1085. $(this).addClass("active");
  1086. $('#btn_search').trigger("click");
  1087. });
  1088. $("#btn_search").click(function () {
  1089. var warehouse = $("#warehouse a.active").attr('data-value');
  1090. var queryJson = {
  1091. POCode: $("#txt_POCode").val(),
  1092. InvCode: $("#txt_InvCode").val(),
  1093. InvName: $("#txt_InvName").val(),
  1094. BatchCode: $("#txt_BatchCode").val(),
  1095. }
  1096. $gridList.jqGrid('setGridParam', {
  1097. postData: { queryJson: JSON.stringify(queryJson) },
  1098. }).trigger('reloadGrid');
  1099. });
  1100. }
  1101. function bindSubGrid4(subgrid_id, rowid) {
  1102. $("#gridList").jqGrid("setSelection", rowid, false);
  1103. var subgrid_table_id;
  1104. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1105. var subgrid_pager_id;
  1106. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1107. // (5)动态添加子报表的table和pager
  1108. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1109. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  1110. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1111. // (6)创建jqGrid对象
  1112. $("#" + subgrid_table_id).dataGrid({
  1113. cellEdit: true,
  1114. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1115. //colModel: [
  1116. // { label: "主键", name: "ID", hidden: true, key: true },
  1117. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1118. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1119. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1120. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1121. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1122. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1123. //],
  1124. colModel: _Clos1,
  1125. //colModel: ColModelSub,
  1126. shrinkToFit: true,//宽度自适应
  1127. multiselect: true,
  1128. prmNames: { search: "search" },
  1129. viewrecords: true,
  1130. sortname: 'LotNo',
  1131. sortorder: "desc",
  1132. height: "100%",
  1133. rowNum: 20,
  1134. pager: subgrid_pager_id,
  1135. });
  1136. }
  1137. //其它入库生成条码
  1138. function gridList5() {
  1139. var $gridList = $("#gridList");
  1140. var queryJson = {
  1141. POCode: $("#txt_POCode").val(),
  1142. InvCode: $("#txt_InvCode").val(),
  1143. InvName: $("#txt_InvName").val(),
  1144. BatchCode: $("#txt_BatchCode").val(),
  1145. }
  1146. $gridList.dataGrid({
  1147. url: "/WMS/WMSCreateItemLot/GetGridJsonQiTa" + "?" + Math.random(),
  1148. postData: { queryJson: JSON.stringify(queryJson) },
  1149. height: $(window).height() - 200,
  1150. width: $(window).width() - 300,
  1151. colModel: _Clos,
  1152. //colModel: [
  1153. // { label: "主键", name: "ID", hidden: true, key: true },
  1154. // { label: '单据号', name: 'InCode', width: 120, align: 'left' },
  1155. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1156. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  1157. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1158. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1159. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1160. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1161. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1162. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1163. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1164. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1165. // { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', },
  1166. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1167. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1168. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1169. //],
  1170. //colModel: ColModelMain,
  1171. width: "100%",
  1172. autowidth: true,
  1173. //shrinkToFit: true,
  1174. gridComplete: function () {
  1175. },
  1176. pager: "#gridPager",
  1177. sortname: 'InCode,Sequence',
  1178. sortorder: "asc",
  1179. viewrecords: true,
  1180. multiselect: true,
  1181. beforeSelectRow: function (rowid, e) {
  1182. $("#gridList").jqGrid('resetSelection');
  1183. return (true);
  1184. },
  1185. subGrid: true, // (1)开启子表格支持
  1186. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1187. $("#gridList").jqGrid("setSelection", rowid, false);
  1188. bindSubGrid5(subgrid_id, rowid)
  1189. }
  1190. });
  1191. $("#warehouse a.btn-default").click(function () {
  1192. $("#warehouse a.btn-default").removeClass("active");
  1193. $(this).addClass("active");
  1194. $('#btn_search').trigger("click");
  1195. });
  1196. $("#btn_search").click(function () {
  1197. var warehouse = $("#warehouse a.active").attr('data-value');
  1198. var queryJson = {
  1199. POCode: $("#txt_POCode").val(),
  1200. InvCode: $("#txt_InvCode").val(),
  1201. InvName: $("#txt_InvName").val(),
  1202. BatchCode: $("#txt_BatchCode").val(),
  1203. }
  1204. $gridList.jqGrid('setGridParam', {
  1205. postData: { queryJson: JSON.stringify(queryJson) },
  1206. }).trigger('reloadGrid');
  1207. });
  1208. }
  1209. function bindSubGrid5(subgrid_id, rowid) {
  1210. $("#gridList").jqGrid("setSelection", rowid, false);
  1211. var subgrid_table_id;
  1212. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1213. var subgrid_pager_id;
  1214. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1215. // (5)动态添加子报表的table和pager
  1216. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1217. var InCode = $("#gridList").jqGrid('getRowData', rowid).InCode;
  1218. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1219. // (6)创建jqGrid对象
  1220. $("#" + subgrid_table_id).dataGrid({
  1221. cellEdit: true,
  1222. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1223. //colModel: [
  1224. // { label: "主键", name: "ID", hidden: true, key: true },
  1225. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1226. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1227. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1228. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1229. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1230. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1231. //],
  1232. colModel: _Clos1,
  1233. //colModel: ColModelSub,
  1234. shrinkToFit: true,//宽度自适应
  1235. multiselect: true,
  1236. prmNames: { search: "search" },
  1237. viewrecords: true,
  1238. height: "100%",
  1239. rowNum: 20,
  1240. pager: subgrid_pager_id,
  1241. });
  1242. }
  1243. //归还单生成条码
  1244. function gridList6() {
  1245. var $gridList = $("#gridList");
  1246. var queryJson = {
  1247. POCode: $("#txt_POCode").val(),
  1248. InvCode: $("#txt_InvCode").val(),
  1249. InvName: $("#txt_InvName").val(),
  1250. BatchCode: $("#txt_BatchCode").val(),
  1251. }
  1252. $gridList.dataGrid({
  1253. url: "/WMS/WMSCreateItemLot/GetGridJsonGuiHuan" + "?" + Math.random(),
  1254. postData: { queryJson: JSON.stringify(queryJson) },
  1255. height: $(window).height() - 200,
  1256. width: $(window).width() - 300,
  1257. colModel: _Clos,
  1258. //colModel: [
  1259. // { label: "主键", name: "ID", hidden: true, key: true },
  1260. // { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' },
  1261. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1262. // { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  1263. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1264. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1265. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1266. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1267. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1268. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1269. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1270. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1271. // { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', },
  1272. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1273. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1274. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1275. //],
  1276. //colModel: ColModelMain,
  1277. width: "100%",
  1278. autowidth: true,
  1279. //shrinkToFit: true,
  1280. gridComplete: function () {
  1281. },
  1282. pager: "#gridPager",
  1283. sortname: 'ReturnCode,Sequence',
  1284. sortorder: "asc",
  1285. viewrecords: true,
  1286. multiselect: true,
  1287. beforeSelectRow: function (rowid, e) {
  1288. $("#gridList").jqGrid('resetSelection');
  1289. return (true);
  1290. },
  1291. subGrid: true, // (1)开启子表格支持
  1292. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1293. $("#gridList").jqGrid("setSelection", rowid, false);
  1294. bindSubGrid6(subgrid_id, rowid)
  1295. }
  1296. });
  1297. $("#warehouse a.btn-default").click(function () {
  1298. $("#warehouse a.btn-default").removeClass("active");
  1299. $(this).addClass("active");
  1300. $('#btn_search').trigger("click");
  1301. });
  1302. $("#btn_search").click(function () {
  1303. var warehouse = $("#warehouse a.active").attr('data-value');
  1304. var queryJson = {
  1305. POCode: $("#txt_POCode").val(),
  1306. InvCode: $("#txt_InvCode").val(),
  1307. InvName: $("#txt_InvName").val(),
  1308. BatchCode: $("#txt_BatchCode").val(),
  1309. }
  1310. $gridList.jqGrid('setGridParam', {
  1311. postData: { queryJson: JSON.stringify(queryJson) },
  1312. }).trigger('reloadGrid');
  1313. });
  1314. }
  1315. function bindSubGrid6(subgrid_id, rowid) {
  1316. $("#gridList").jqGrid("setSelection", rowid, false);
  1317. var subgrid_table_id;
  1318. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1319. var subgrid_pager_id;
  1320. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1321. // (5)动态添加子报表的table和pager
  1322. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1323. var ReturnCode = $("#gridList").jqGrid('getRowData', rowid).ReturnCode;
  1324. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1325. // (6)创建jqGrid对象
  1326. $("#" + subgrid_table_id).dataGrid({
  1327. cellEdit: true,
  1328. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1329. //colModel: [
  1330. // { label: "主键", name: "ID", hidden: true, key: true },
  1331. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1332. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1333. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1334. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1335. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1336. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1337. //],
  1338. colModel: _Clos1,
  1339. //colModel: ColModelSub,
  1340. shrinkToFit: true,//宽度自适应
  1341. multiselect: true,
  1342. prmNames: { search: "search" },
  1343. viewrecords: true,
  1344. height: "100%",
  1345. rowNum: 20,
  1346. pager: subgrid_pager_id,
  1347. });
  1348. }
  1349. //*审核到货单生成条码
  1350. function gridList7() {
  1351. var $gridList = $("#gridList");
  1352. var queryJson = {
  1353. POCode: $("#txt_POCode").val(),
  1354. VenCode: $("#txt_VenCode").val(),
  1355. VenName: $("#txt_VenName").val(),
  1356. InvCode: $("#txt_InvCode").val(),
  1357. InvName: $("#txt_InvName").val(),
  1358. BatchCode: $("#txt_BatchCode").val(),
  1359. }
  1360. $gridList.dataGrid({
  1361. url: "/WMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  1362. postData: { queryJson: JSON.stringify(queryJson) },
  1363. height: $(window).height() - 200,
  1364. width: $(window).width() - 300,
  1365. colModel: _Clos,
  1366. //colModel: [
  1367. // { label: "主键", name: "ID", hidden: true, key: true },
  1368. // { label: '单据号', name: 'DNCode', width: 120, align: 'left' },
  1369. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1370. // { label: '采购订单号', name: 'POCode', width: 50, align: 'left' },
  1371. // { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' },
  1372. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1373. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1374. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1375. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1376. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1377. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1378. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  1379. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1380. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1381. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1382. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1383. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1384. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1385. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1386. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1387. //],
  1388. //colModel: ColModelMain,
  1389. width: "100%",
  1390. autowidth: true,
  1391. //shrinkToFit: true,
  1392. gridComplete: function () {
  1393. },
  1394. pager: "#gridPager",
  1395. sortname: 'CreateDateTime desc, DNCode asc,Sequence asc',
  1396. sortorder: "",
  1397. viewrecords: true,
  1398. multiselect: true,
  1399. beforeSelectRow: function (rowid, e) {
  1400. $("#gridList").jqGrid('resetSelection');
  1401. return (true);
  1402. },
  1403. subGrid: true, // (1)开启子表格支持
  1404. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1405. $("#gridList").jqGrid("setSelection", rowid, false);
  1406. bindSubGrid7(subgrid_id, rowid)
  1407. }
  1408. });
  1409. $("#warehouse a.btn-default").click(function () {
  1410. $("#warehouse a.btn-default").removeClass("active");
  1411. $(this).addClass("active");
  1412. $('#btn_search').trigger("click");
  1413. });
  1414. $("#btn_search").click(function () {
  1415. var warehouse = $("#warehouse a.active").attr('data-value');
  1416. var queryJson = {
  1417. POCode: $("#txt_POCode").val(),
  1418. VenCode: $("#txt_VenCode").val(),
  1419. VenName: $("#txt_VenName").val(),
  1420. InvCode: $("#txt_InvCode").val(),
  1421. InvName: $("#txt_InvName").val(),
  1422. BatchCode: $("#txt_BatchCode").val(),
  1423. }
  1424. $gridList.jqGrid('setGridParam', {
  1425. postData: { queryJson: JSON.stringify(queryJson) },
  1426. }).trigger('reloadGrid');
  1427. });
  1428. }
  1429. function bindSubGrid7(subgrid_id, rowid) {
  1430. $("#gridList").jqGrid("setSelection", rowid, false);
  1431. var subgrid_table_id;
  1432. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1433. var subgrid_pager_id;
  1434. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1435. // (5)动态添加子报表的table和pager
  1436. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1437. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  1438. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1439. // (6)创建jqGrid对象
  1440. $("#" + subgrid_table_id).dataGrid({
  1441. cellEdit: true,
  1442. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1443. //colModel: [
  1444. // { label: "主键", name: "ID", hidden: true, key: true },
  1445. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1446. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1447. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1448. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1449. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1450. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1451. //],
  1452. colModel: _Clos1,
  1453. //colModel: ColModelSub,
  1454. shrinkToFit: true,//宽度自适应
  1455. multiselect: true,
  1456. prmNames: { search: "search" },
  1457. viewrecords: true,
  1458. sortname: 'LotNo',
  1459. sortorder: "desc",
  1460. height: "100%",
  1461. rowNum: 20,
  1462. pager: subgrid_pager_id,
  1463. });
  1464. }
  1465. //审核委外到货单生成条码
  1466. function gridList8() {
  1467. var $gridList = $("#gridList");
  1468. var queryJson = {
  1469. POCode: $("#txt_POCode").val(),
  1470. VenCode: $("#txt_VenCode").val(),
  1471. VenName: $("#txt_VenName").val(),
  1472. InvCode: $("#txt_InvCode").val(),
  1473. InvName: $("#txt_InvName").val(),
  1474. BatchCode: $("#txt_BatchCode").val(),
  1475. }
  1476. $gridList.dataGrid({
  1477. url: "/WMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(),
  1478. postData: { queryJson: JSON.stringify(queryJson) },
  1479. height: $(window).height() - 200,
  1480. width: $(window).width() - 300,
  1481. colModel: _Clos,
  1482. //colModel: [
  1483. // { label: "主键", name: "ID", hidden: true, key: true },
  1484. // { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  1485. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1486. // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' },
  1487. // { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' },
  1488. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1489. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1490. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1491. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1492. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1493. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1494. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1495. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1496. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1497. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1498. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1499. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1500. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1501. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1502. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1503. //],
  1504. //colModel: ColModelMain,
  1505. width: "100%",
  1506. autowidth: true,
  1507. //shrinkToFit: true,
  1508. gridComplete: function () {
  1509. },
  1510. pager: "#gridPager",
  1511. sortname: 'ODNCode,Sequence',
  1512. sortorder: "asc",
  1513. viewrecords: true,
  1514. multiselect: true,
  1515. beforeSelectRow: function (rowid, e) {
  1516. $("#gridList").jqGrid('resetSelection');
  1517. return (true);
  1518. },
  1519. subGrid: true, // (1)开启子表格支持
  1520. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1521. $("#gridList").jqGrid("setSelection", rowid, false);
  1522. bindSubGrid8(subgrid_id, rowid)
  1523. }
  1524. });
  1525. $("#warehouse a.btn-default").click(function () {
  1526. $("#warehouse a.btn-default").removeClass("active");
  1527. $(this).addClass("active");
  1528. $('#btn_search').trigger("click");
  1529. });
  1530. $("#btn_search").click(function () {
  1531. var warehouse = $("#warehouse a.active").attr('data-value');
  1532. var queryJson = {
  1533. POCode: $("#txt_POCode").val(),
  1534. VenCode: $("#txt_VenCode").val(),
  1535. VenName: $("#txt_VenName").val(),
  1536. InvCode: $("#txt_InvCode").val(),
  1537. InvName: $("#txt_InvName").val(),
  1538. BatchCode: $("#txt_BatchCode").val(),
  1539. }
  1540. $gridList.jqGrid('setGridParam', {
  1541. postData: { queryJson: JSON.stringify(queryJson) },
  1542. }).trigger('reloadGrid');
  1543. });
  1544. }
  1545. function bindSubGrid8(subgrid_id, rowid) {
  1546. $("#gridList").jqGrid("setSelection", rowid, false);
  1547. var subgrid_table_id;
  1548. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1549. var subgrid_pager_id;
  1550. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1551. // (5)动态添加子报表的table和pager
  1552. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1553. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  1554. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1555. // (6)创建jqGrid对象
  1556. $("#" + subgrid_table_id).dataGrid({
  1557. cellEdit: true,
  1558. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1559. //colModel: [
  1560. // { label: "主键", name: "ID", hidden: true, key: true },
  1561. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1562. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1563. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1564. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1565. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1566. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1567. //],
  1568. colModel: _Clos1,
  1569. //colModel: ColModelSub,
  1570. shrinkToFit: true,//宽度自适应
  1571. multiselect: true,
  1572. prmNames: { search: "search" },
  1573. viewrecords: true,
  1574. height: "100%",
  1575. rowNum: 20,
  1576. pager: subgrid_pager_id,
  1577. });
  1578. }
  1579. //开立得成品入库单 生成条码
  1580. function gridList9() {
  1581. var $gridList = $("#gridList");
  1582. var queryJson = {
  1583. POCode: $("#txt_POCode").val(),
  1584. InvCode: $("#txt_InvCode").val(),
  1585. InvName: $("#txt_InvName").val(),
  1586. BatchCode: $("#txt_BatchCode").val(),
  1587. }
  1588. $gridList.dataGrid({
  1589. url: "/WMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  1590. postData: { queryJson: JSON.stringify(queryJson) },
  1591. height: $(window).height() - 200,
  1592. width: $(window).width() - 300,
  1593. colModel: _Clos,
  1594. //colModel: [
  1595. // { label: "主键", name: "ID", hidden: true, key: true },
  1596. // { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  1597. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1598. // { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  1599. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1600. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1601. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1602. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1603. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1604. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1605. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1606. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1607. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1608. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1609. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1610. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1611. //],
  1612. //colModel: ColModelMain,
  1613. width: "100%",
  1614. autowidth: true,
  1615. //shrinkToFit: true,
  1616. gridComplete: function () {
  1617. },
  1618. pager: "#gridPager",
  1619. sortname: 'RCVCode,Sequence',
  1620. sortorder: "asc",
  1621. viewrecords: true,
  1622. multiselect: true,
  1623. beforeSelectRow: function (rowid, e) {
  1624. $("#gridList").jqGrid('resetSelection');
  1625. return (true);
  1626. },
  1627. subGrid: true, // (1)开启子表格支持
  1628. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1629. $("#gridList").jqGrid("setSelection", rowid, false);
  1630. bindSubGrid9(subgrid_id, rowid)
  1631. }
  1632. });
  1633. $("#warehouse a.btn-default").click(function () {
  1634. $("#warehouse a.btn-default").removeClass("active");
  1635. $(this).addClass("active");
  1636. $('#btn_search').trigger("click");
  1637. });
  1638. $("#btn_search").click(function () {
  1639. var warehouse = $("#warehouse a.active").attr('data-value');
  1640. var queryJson = {
  1641. POCode: $("#txt_POCode").val(),
  1642. InvCode: $("#txt_InvCode").val(),
  1643. InvName: $("#txt_InvName").val(),
  1644. BatchCode: $("#txt_BatchCode").val(),
  1645. }
  1646. $gridList.jqGrid('setGridParam', {
  1647. postData: { queryJson: JSON.stringify(queryJson) },
  1648. }).trigger('reloadGrid');
  1649. });
  1650. }
  1651. function bindSubGrid9(subgrid_id, rowid) {
  1652. $("#gridList").jqGrid("setSelection", rowid, false);
  1653. var subgrid_table_id;
  1654. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1655. var subgrid_pager_id;
  1656. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1657. // (5)动态添加子报表的table和pager
  1658. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1659. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  1660. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1661. // (6)创建jqGrid对象
  1662. $("#" + subgrid_table_id).dataGrid({
  1663. cellEdit: true,
  1664. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1665. //colModel: [
  1666. // { label: "主键", name: "ID", hidden: true, key: true },
  1667. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1668. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1669. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1670. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1671. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1672. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1673. //],
  1674. colModel: _Clos1,
  1675. //colModel: ColModelSub,
  1676. shrinkToFit: true,//宽度自适应
  1677. multiselect: true,
  1678. prmNames: { search: "search" },
  1679. viewrecords: true,
  1680. height: "100%",
  1681. rowNum: 20,
  1682. pager: subgrid_pager_id,
  1683. });
  1684. }
  1685. //采购拒收单
  1686. function gridList10() {
  1687. var $gridList = $("#gridList");
  1688. var queryJson = {
  1689. POCode: $("#txt_POCode").val(),
  1690. VenCode: $("#txt_VenCode").val(),
  1691. VenName: $("#txt_VenName").val(),
  1692. InvCode: $("#txt_InvCode").val(),
  1693. InvName: $("#txt_InvName").val(),
  1694. BatchCode: $("#txt_BatchCode").val(),
  1695. }
  1696. $gridList.dataGrid({
  1697. url: "/WMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  1698. postData: { queryJson: JSON.stringify(queryJson) },
  1699. height: $(window).height() - 200,
  1700. width: $(window).width() - 300,
  1701. colModel: _Clos,
  1702. //colModel: [
  1703. // { label: "主键", name: "ID", hidden: true, key: true },
  1704. // { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  1705. // { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  1706. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1707. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1708. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1709. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1710. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1711. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1712. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  1713. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1714. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1715. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1716. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1717. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1718. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1719. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1720. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1721. //],
  1722. //colModel: ColModelMain,
  1723. width: "100%",
  1724. autowidth: true,
  1725. //shrinkToFit: true,
  1726. gridComplete: function () {
  1727. },
  1728. pager: "#gridPager",
  1729. sortname: 'DNCode,Sequence',
  1730. sortorder: "asc",
  1731. viewrecords: true,
  1732. multiselect: true,
  1733. beforeSelectRow: function (rowid, e) {
  1734. $("#gridList").jqGrid('resetSelection');
  1735. return (true);
  1736. },
  1737. subGrid: true, // (1)开启子表格支持
  1738. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1739. $("#gridList").jqGrid("setSelection", rowid, false);
  1740. bindSubGrid10(subgrid_id, rowid)
  1741. }
  1742. });
  1743. $("#warehouse a.btn-default").click(function () {
  1744. $("#warehouse a.btn-default").removeClass("active");
  1745. $(this).addClass("active");
  1746. $('#btn_search').trigger("click");
  1747. });
  1748. $("#btn_search").click(function () {
  1749. var warehouse = $("#warehouse a.active").attr('data-value');
  1750. var queryJson = {
  1751. POCode: $("#txt_POCode").val(),
  1752. VenCode: $("#txt_VenCode").val(),
  1753. VenName: $("#txt_VenName").val(),
  1754. InvCode: $("#txt_InvCode").val(),
  1755. InvName: $("#txt_InvName").val(),
  1756. BatchCode: $("#txt_BatchCode").val(),
  1757. }
  1758. $gridList.jqGrid('setGridParam', {
  1759. postData: { queryJson: JSON.stringify(queryJson) },
  1760. }).trigger('reloadGrid');
  1761. });
  1762. }
  1763. function bindSubGrid10(subgrid_id, rowid) {
  1764. $("#gridList").jqGrid("setSelection", rowid, false);
  1765. var subgrid_table_id;
  1766. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1767. var subgrid_pager_id;
  1768. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1769. // (5)动态添加子报表的table和pager
  1770. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1771. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  1772. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1773. // (6)创建jqGrid对象
  1774. $("#" + subgrid_table_id).dataGrid({
  1775. cellEdit: true,
  1776. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1777. //colModel: [
  1778. // { label: "主键", name: "ID", hidden: true, key: true },
  1779. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1780. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1781. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1782. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1783. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1784. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1785. //],
  1786. colModel: _Clos1,
  1787. //colModel: ColModelSub,
  1788. shrinkToFit: true,//宽度自适应
  1789. multiselect: true,
  1790. prmNames: { search: "search" },
  1791. viewrecords: true,
  1792. height: "100%",
  1793. rowNum: 20,
  1794. pager: subgrid_pager_id,
  1795. });
  1796. }
  1797. //委外拒收单生成条码
  1798. function gridList11() {
  1799. var $gridList = $("#gridList");
  1800. var queryJson = {
  1801. POCode: $("#txt_POCode").val(),
  1802. VenCode: $("#txt_VenCode").val(),
  1803. VenName: $("#txt_VenName").val(),
  1804. InvCode: $("#txt_InvCode").val(),
  1805. InvName: $("#txt_InvName").val(),
  1806. BatchCode: $("#txt_BatchCode").val(),
  1807. }
  1808. $gridList.dataGrid({
  1809. url: "/WMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  1810. postData: { queryJson: JSON.stringify(queryJson) },
  1811. height: $(window).height() - 200,
  1812. width: $(window).width() - 300,
  1813. colModel: _Clos,
  1814. //colModel: [
  1815. // { label: "主键", name: "ID", hidden: true, key: true },
  1816. // { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  1817. // { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  1818. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1819. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1820. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1821. // { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1822. // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1823. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1824. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1825. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1826. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1827. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1828. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1829. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1830. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1831. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1832. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1833. //],
  1834. //colModel: ColModelMain,
  1835. width: "100%",
  1836. autowidth: true,
  1837. //shrinkToFit: true,
  1838. gridComplete: function () {
  1839. },
  1840. pager: "#gridPager",
  1841. sortname: 'OOCode,OOSequence',
  1842. sortorder: "asc",
  1843. viewrecords: true,
  1844. multiselect: true,
  1845. beforeSelectRow: function (rowid, e) {
  1846. $("#gridList").jqGrid('resetSelection');
  1847. return (true);
  1848. },
  1849. subGrid: true, // (1)开启子表格支持
  1850. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1851. $("#gridList").jqGrid("setSelection", rowid, false);
  1852. bindSubGrid11(subgrid_id, rowid)
  1853. }
  1854. });
  1855. $("#warehouse a.btn-default").click(function () {
  1856. $("#warehouse a.btn-default").removeClass("active");
  1857. $(this).addClass("active");
  1858. $('#btn_search').trigger("click");
  1859. });
  1860. $("#btn_search").click(function () {
  1861. var warehouse = $("#warehouse a.active").attr('data-value');
  1862. var queryJson = {
  1863. POCode: $("#txt_POCode").val(),
  1864. VenCode: $("#txt_VenCode").val(),
  1865. VenName: $("#txt_VenName").val(),
  1866. InvCode: $("#txt_InvCode").val(),
  1867. InvName: $("#txt_InvName").val(),
  1868. BatchCode: $("#txt_BatchCode").val(),
  1869. }
  1870. $gridList.jqGrid('setGridParam', {
  1871. postData: { queryJson: JSON.stringify(queryJson) },
  1872. }).trigger('reloadGrid');
  1873. });
  1874. }
  1875. function bindSubGrid11(subgrid_id, rowid) {
  1876. $("#gridList").jqGrid("setSelection", rowid, false);
  1877. var subgrid_table_id;
  1878. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1879. var subgrid_pager_id;
  1880. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1881. // (5)动态添加子报表的table和pager
  1882. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1883. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).OOCode;
  1884. var Sequence = $("#gridList").jqGrid('getRowData', rowid).OOSequence;
  1885. // (6)创建jqGrid对象
  1886. $("#" + subgrid_table_id).dataGrid({
  1887. cellEdit: true,
  1888. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1889. //colModel: [
  1890. // { label: "主键", name: "ID", hidden: true, key: true },
  1891. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1892. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1893. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1894. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1895. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1896. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1897. //],
  1898. colModel: _Clos1,
  1899. //colModel: ColModelSub,
  1900. shrinkToFit: true,//宽度自适应
  1901. multiselect: true,
  1902. prmNames: { search: "search" },
  1903. viewrecords: true,
  1904. height: "100%",
  1905. rowNum: 20,
  1906. pager: subgrid_pager_id,
  1907. });
  1908. }
  1909. //领料申请退料生成条码
  1910. function gridList12() {
  1911. var $gridList = $("#gridList");
  1912. var queryJson = {
  1913. POCode: $("#txt_POCode").val(),
  1914. InvCode: $("#txt_InvCode").val(),
  1915. InvName: $("#txt_InvName").val(),
  1916. BatchCode: $("#txt_BatchCode").val(),
  1917. }
  1918. $gridList.dataGrid({
  1919. url: "/WMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  1920. postData: { queryJson: JSON.stringify(queryJson) },
  1921. height: $(window).height() - 200,
  1922. width: $(window).width() - 300,
  1923. colModel: _Clos,
  1924. //colModel: [
  1925. // { label: "主键", name: "ID", hidden: true, key: true },
  1926. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  1927. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  1928. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  1929. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1930. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  1931. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1932. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1933. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  1934. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1935. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1936. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1937. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1938. //],
  1939. //colModel: ColModelMain,
  1940. width: "100%",
  1941. autowidth: true,
  1942. //shrinkToFit: true,
  1943. gridComplete: function () {
  1944. },
  1945. pager: "#gridPager",
  1946. sortname: 'ApplyNegCode,Sequence',
  1947. sortorder: "asc",
  1948. viewrecords: true,
  1949. multiselect: true,
  1950. beforeSelectRow: function (rowid, e) {
  1951. $("#gridList").jqGrid('resetSelection');
  1952. return (true);
  1953. },
  1954. subGrid: true, // (1)开启子表格支持
  1955. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1956. $("#gridList").jqGrid("setSelection", rowid, false);
  1957. bindSubGrid12(subgrid_id, rowid)
  1958. }
  1959. });
  1960. $("#warehouse a.btn-default").click(function () {
  1961. $("#warehouse a.btn-default").removeClass("active");
  1962. $(this).addClass("active");
  1963. $('#btn_search').trigger("click");
  1964. });
  1965. $("#btn_search").click(function () {
  1966. var warehouse = $("#warehouse a.active").attr('data-value');
  1967. var queryJson = {
  1968. POCode: $("#txt_POCode").val(),
  1969. InvCode: $("#txt_InvCode").val(),
  1970. InvName: $("#txt_InvName").val(),
  1971. BatchCode: $("#txt_BatchCode").val(),
  1972. }
  1973. $gridList.jqGrid('setGridParam', {
  1974. postData: { queryJson: JSON.stringify(queryJson) },
  1975. }).trigger('reloadGrid');
  1976. });
  1977. }
  1978. function bindSubGrid12(subgrid_id, rowid) {
  1979. $("#gridList").jqGrid("setSelection", rowid, false);
  1980. var subgrid_table_id;
  1981. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1982. var subgrid_pager_id;
  1983. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1984. // (5)动态添加子报表的table和pager
  1985. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1986. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  1987. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1988. // (6)创建jqGrid对象
  1989. $("#" + subgrid_table_id).dataGrid({
  1990. cellEdit: true,
  1991. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1992. //colModel: [
  1993. // { label: "主键", name: "ID", hidden: true, key: true },
  1994. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1995. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1996. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1997. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1998. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1999. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2000. //],
  2001. colModel: _Clos1,
  2002. //colModel: ColModelSub,
  2003. shrinkToFit: true,//宽度自适应
  2004. multiselect: true,
  2005. prmNames: { search: "search" },
  2006. viewrecords: true,
  2007. height: "100%",
  2008. rowNum: 20,
  2009. pager: subgrid_pager_id,
  2010. });
  2011. }
  2012. //材料出库退料
  2013. function gridList13() {
  2014. var $gridList = $("#gridList");
  2015. var queryJson = {
  2016. POCode: $("#txt_POCode").val(),
  2017. InvCode: $("#txt_InvCode").val(),
  2018. InvName: $("#txt_InvName").val(),
  2019. BatchCode: $("#txt_BatchCode").val(),
  2020. }
  2021. $gridList.dataGrid({
  2022. url: "/WMS/WMSCreateItemLot/GetGridJsonCLCK" + "?" + Math.random(),
  2023. postData: { queryJson: JSON.stringify(queryJson) },
  2024. height: $(window).height() - 200,
  2025. width: $(window).width() - 300,
  2026. colModel: _Clos,
  2027. //colModel: [
  2028. // { label: "主键", name: "ID", hidden: true, key: true },
  2029. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2030. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2031. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  2032. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2033. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2034. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2035. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2036. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2037. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2038. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2039. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2040. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2041. //],
  2042. //colModel: ColModelMain,
  2043. width: "100%",
  2044. autowidth: true,
  2045. //shrinkToFit: true,
  2046. gridComplete: function () {
  2047. },
  2048. pager: "#gridPager",
  2049. sortname: 'ApplyNegCode,Sequence',
  2050. sortorder: "asc",
  2051. viewrecords: true,
  2052. multiselect: true,
  2053. beforeSelectRow: function (rowid, e) {
  2054. $("#gridList").jqGrid('resetSelection');
  2055. return (true);
  2056. },
  2057. subGrid: true, // (1)开启子表格支持
  2058. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2059. $("#gridList").jqGrid("setSelection", rowid, false);
  2060. bindSubGrid13(subgrid_id, rowid)
  2061. }
  2062. });
  2063. $("#warehouse a.btn-default").click(function () {
  2064. $("#warehouse a.btn-default").removeClass("active");
  2065. $(this).addClass("active");
  2066. $('#btn_search').trigger("click");
  2067. });
  2068. $("#btn_search").click(function () {
  2069. var warehouse = $("#warehouse a.active").attr('data-value');
  2070. var queryJson = {
  2071. POCode: $("#txt_POCode").val(),
  2072. InvCode: $("#txt_InvCode").val(),
  2073. InvName: $("#txt_InvName").val(),
  2074. BatchCode: $("#txt_BatchCode").val(),
  2075. }
  2076. $gridList.jqGrid('setGridParam', {
  2077. postData: { queryJson: JSON.stringify(queryJson) },
  2078. }).trigger('reloadGrid');
  2079. });
  2080. }
  2081. function bindSubGrid13(subgrid_id, rowid) {
  2082. $("#gridList").jqGrid("setSelection", rowid, false);
  2083. var subgrid_table_id;
  2084. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2085. var subgrid_pager_id;
  2086. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2087. // (5)动态添加子报表的table和pager
  2088. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2089. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2090. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2091. // (6)创建jqGrid对象
  2092. $("#" + subgrid_table_id).dataGrid({
  2093. cellEdit: true,
  2094. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2095. //colModel: [
  2096. // { label: "主键", name: "ID", hidden: true, key: true },
  2097. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2098. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2099. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2100. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2101. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2102. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2103. //],
  2104. colModel: _Clos1,
  2105. //colModel: ColModelSub,
  2106. shrinkToFit: true,//宽度自适应
  2107. multiselect: true,
  2108. prmNames: { search: "search" },
  2109. viewrecords: true,
  2110. height: "100%",
  2111. rowNum: 20,
  2112. pager: subgrid_pager_id,
  2113. });
  2114. }
  2115. //委外领料申请退料
  2116. function gridList14() {
  2117. var $gridList = $("#gridList");
  2118. var queryJson = {
  2119. POCode: $("#txt_POCode").val(),
  2120. InvCode: $("#txt_InvCode").val(),
  2121. InvName: $("#txt_InvName").val(),
  2122. BatchCode: $("#txt_BatchCode").val(),
  2123. }
  2124. $gridList.dataGrid({
  2125. url: "/WMS/WMSCreateItemLot/GetGridJsonWWLLTL" + "?" + Math.random(),
  2126. postData: { queryJson: JSON.stringify(queryJson) },
  2127. height: $(window).height() - 200,
  2128. width: $(window).width() - 300,
  2129. colModel: _Clos,
  2130. //colModel: [
  2131. // { label: "主键", name: "ID", hidden: true, key: true },
  2132. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2133. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2134. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2135. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2136. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2137. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2138. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2139. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2140. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2141. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2142. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2143. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2144. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2145. //],
  2146. //colModel: ColModelMain,
  2147. width: "100%",
  2148. autowidth: true,
  2149. //shrinkToFit: true,
  2150. gridComplete: function () {
  2151. },
  2152. pager: "#gridPager",
  2153. sortname: 'OApplyNegCode,Sequence',
  2154. sortorder: "asc",
  2155. viewrecords: true,
  2156. multiselect: true,
  2157. beforeSelectRow: function (rowid, e) {
  2158. $("#gridList").jqGrid('resetSelection');
  2159. return (true);
  2160. },
  2161. subGrid: true, // (1)开启子表格支持
  2162. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2163. $("#gridList").jqGrid("setSelection", rowid, false);
  2164. bindSubGrid14(subgrid_id, rowid)
  2165. }
  2166. });
  2167. $("#warehouse a.btn-default").click(function () {
  2168. $("#warehouse a.btn-default").removeClass("active");
  2169. $(this).addClass("active");
  2170. $('#btn_search').trigger("click");
  2171. });
  2172. $("#btn_search").click(function () {
  2173. var warehouse = $("#warehouse a.active").attr('data-value');
  2174. var queryJson = {
  2175. POCode: $("#txt_POCode").val(),
  2176. InvCode: $("#txt_InvCode").val(),
  2177. InvName: $("#txt_InvName").val(),
  2178. BatchCode: $("#txt_BatchCode").val(),
  2179. }
  2180. $gridList.jqGrid('setGridParam', {
  2181. postData: { queryJson: JSON.stringify(queryJson) },
  2182. }).trigger('reloadGrid');
  2183. });
  2184. }
  2185. function bindSubGrid14(subgrid_id, rowid) {
  2186. $("#gridList").jqGrid("setSelection", rowid, false);
  2187. var subgrid_table_id;
  2188. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2189. var subgrid_pager_id;
  2190. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2191. // (5)动态添加子报表的table和pager
  2192. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2193. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2194. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2195. // (6)创建jqGrid对象
  2196. $("#" + subgrid_table_id).dataGrid({
  2197. cellEdit: true,
  2198. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2199. //colModel: [
  2200. // { label: "主键", name: "ID", hidden: true, key: true },
  2201. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2202. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2203. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2204. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2205. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2206. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2207. //],
  2208. colModel: _Clos1,
  2209. //colModel: ColModelSub,
  2210. shrinkToFit: true,//宽度自适应
  2211. multiselect: true,
  2212. prmNames: { search: "search" },
  2213. viewrecords: true,
  2214. height: "100%",
  2215. rowNum: 20,
  2216. pager: subgrid_pager_id,
  2217. });
  2218. }
  2219. function gridList15() {
  2220. var $gridList = $("#gridList");
  2221. var queryJson = {
  2222. POCode: $("#txt_POCode").val(),
  2223. InvCode: $("#txt_InvCode").val(),
  2224. InvName: $("#txt_InvName").val(),
  2225. BatchCode: $("#txt_BatchCode").val(),
  2226. }
  2227. $gridList.dataGrid({
  2228. url: "/WMS/WMSCreateItemLot/GetGridJsonWWCLCK" + "?" + Math.random(),
  2229. postData: { queryJson: JSON.stringify(queryJson) },
  2230. height: $(window).height() - 200,
  2231. width: $(window).width() - 300,
  2232. colModel: _Clos,
  2233. //colModel: [
  2234. // { label: "主键", name: "ID", hidden: true, key: true },
  2235. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2236. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2237. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2238. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2239. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2240. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2241. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2242. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2243. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2244. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2245. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2246. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2247. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2248. //],
  2249. //colModel: ColModelMain,
  2250. width: "100%",
  2251. autowidth: true,
  2252. //shrinkToFit: true,
  2253. gridComplete: function () {
  2254. },
  2255. pager: "#gridPager",
  2256. sortname: 'OApplyNegCode,Sequence',
  2257. sortorder: "asc",
  2258. viewrecords: true,
  2259. multiselect: true,
  2260. beforeSelectRow: function (rowid, e) {
  2261. $("#gridList").jqGrid('resetSelection');
  2262. return (true);
  2263. },
  2264. subGrid: true, // (1)开启子表格支持
  2265. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2266. $("#gridList").jqGrid("setSelection", rowid, false);
  2267. bindSubGrid15(subgrid_id, rowid)
  2268. }
  2269. });
  2270. $("#warehouse a.btn-default").click(function () {
  2271. $("#warehouse a.btn-default").removeClass("active");
  2272. $(this).addClass("active");
  2273. $('#btn_search').trigger("click");
  2274. });
  2275. $("#btn_search").click(function () {
  2276. var warehouse = $("#warehouse a.active").attr('data-value');
  2277. var queryJson = {
  2278. POCode: $("#txt_POCode").val(),
  2279. InvCode: $("#txt_InvCode").val(),
  2280. InvName: $("#txt_InvName").val(),
  2281. BatchCode: $("#txt_BatchCode").val(),
  2282. }
  2283. $gridList.jqGrid('setGridParam', {
  2284. postData: { queryJson: JSON.stringify(queryJson) },
  2285. }).trigger('reloadGrid');
  2286. });
  2287. }
  2288. function bindSubGrid15(subgrid_id, rowid) {
  2289. $("#gridList").jqGrid("setSelection", rowid, false);
  2290. var subgrid_table_id;
  2291. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2292. var subgrid_pager_id;
  2293. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2294. // (5)动态添加子报表的table和pager
  2295. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2296. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2297. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2298. // (6)创建jqGrid对象
  2299. $("#" + subgrid_table_id).dataGrid({
  2300. cellEdit: true,
  2301. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2302. //colModel: [
  2303. // { label: "主键", name: "ID", hidden: true, key: true },
  2304. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2305. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2306. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2307. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2308. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2309. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2310. //],
  2311. colModel: _Clos1,
  2312. //colModel: ColModelSub,
  2313. shrinkToFit: true,//宽度自适应
  2314. //multiselect: true,
  2315. prmNames: { search: "search" },
  2316. viewrecords: true,
  2317. height: "100%",
  2318. rowNum: 20,
  2319. pager: subgrid_pager_id,
  2320. });
  2321. }
  2322. function gridList16() {
  2323. var $gridList = $("#gridList");
  2324. var queryJson = {
  2325. POCode: $("#txt_POCode").val(),
  2326. InvCode: $("#txt_InvCode").val(),
  2327. InvName: $("#txt_InvName").val(),
  2328. BatchCode: $("#txt_BatchCode").val(),
  2329. }
  2330. $gridList.dataGrid({
  2331. url: "/WMS/WMSCreateItemLot/GetGridJsonFGGD" + "?" + Math.random(),
  2332. postData: { queryJson: JSON.stringify(queryJson) },
  2333. height: $(window).height() - 200,
  2334. width: $(window).width() - 300,
  2335. colModel: _Clos,
  2336. //colModel: [
  2337. // { label: "主键", name: "ID", hidden: true, key: true },
  2338. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2339. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2340. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2341. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2342. // { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  2343. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2344. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2345. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2346. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2347. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2348. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2349. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2350. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2351. //],
  2352. //colModel: ColModelMain,
  2353. width: "100%",
  2354. autowidth: true,
  2355. //shrinkToFit: true,
  2356. gridComplete: function () {
  2357. },
  2358. pager: "#gridPager",
  2359. sortname: 'MOCode,Sequence',
  2360. sortorder: "asc",
  2361. viewrecords: true,
  2362. multiselect: true,
  2363. beforeSelectRow: function (rowid, e) {
  2364. $("#gridList").jqGrid('resetSelection');
  2365. return (true);
  2366. },
  2367. subGrid: true, // (1)开启子表格支持
  2368. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2369. $("#gridList").jqGrid("setSelection", rowid, false);
  2370. bindSubGrid16(subgrid_id, rowid)
  2371. }
  2372. });
  2373. $("#warehouse a.btn-default").click(function () {
  2374. $("#warehouse a.btn-default").removeClass("active");
  2375. $(this).addClass("active");
  2376. $('#btn_search').trigger("click");
  2377. });
  2378. $("#btn_search").click(function () {
  2379. var warehouse = $("#warehouse a.active").attr('data-value');
  2380. var queryJson = {
  2381. POCode: $("#txt_POCode").val(),
  2382. InvCode: $("#txt_InvCode").val(),
  2383. InvName: $("#txt_InvName").val(),
  2384. BatchCode: $("#txt_BatchCode").val(),
  2385. }
  2386. $gridList.jqGrid('setGridParam', {
  2387. postData: { queryJson: JSON.stringify(queryJson) },
  2388. }).trigger('reloadGrid');
  2389. });
  2390. }
  2391. function bindSubGrid16(subgrid_id, rowid) {
  2392. $("#gridList").jqGrid("setSelection", rowid, false);
  2393. var subgrid_table_id;
  2394. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2395. var subgrid_pager_id;
  2396. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2397. // (5)动态添加子报表的table和pager
  2398. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2399. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  2400. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2401. // (6)创建jqGrid对象
  2402. $("#" + subgrid_table_id).dataGrid({
  2403. cellEdit: true,
  2404. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2405. //colModel: [
  2406. // { label: "主键", name: "ID", hidden: true, key: true },
  2407. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2408. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2409. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2410. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2411. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2412. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2413. //],
  2414. colModel: _Clos1,
  2415. //colModel: ColModelSub,
  2416. shrinkToFit: true,//宽度自适应
  2417. //multiselect: true,
  2418. prmNames: { search: "search" },
  2419. viewrecords: true,
  2420. height: "100%",
  2421. rowNum: 20,
  2422. pager: subgrid_pager_id,
  2423. });
  2424. }
  2425. function btnDelete() {
  2426. var objArr = '';
  2427. var obj = $("#gridList").jqGrid("getRowData");
  2428. for (var i = 0; i < obj.length; i++) {
  2429. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  2430. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  2431. if (rowData != "undefined" && rowData != null) {
  2432. for (var j = 0; j < rowData.length; j++) {
  2433. objArr += "'" + rowData[j] + "',";
  2434. }
  2435. }
  2436. }
  2437. if (objArr == "") {
  2438. $.modalAlertNew("WMS00099");
  2439. return;
  2440. }
  2441. $.deleteForm({
  2442. url: "/WMS/WMSCreateItemLot/DeleteItemLot",
  2443. param: { keyValue: JSON.stringify(objArr) },
  2444. success: function () {
  2445. $.currentWindow().$("#gridList").trigger("reloadGrid");
  2446. }
  2447. })
  2448. }
  2449. function btnCreate() {
  2450. debugger;
  2451. var PoStatus;
  2452. var jsonData = '';
  2453. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  2454. if (ids.length != 1) {
  2455. $.modalAlertNew("WMS00100");
  2456. return;
  2457. }
  2458. var POCode = "";
  2459. var PORow = "";
  2460. if (Type == '1') {
  2461. for (var i in ids) {
  2462. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  2463. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2464. }
  2465. $.modalOpen({
  2466. id: "FormAddItemLot",
  2467. title: "生产退料条码生成",
  2468. url: "/WMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 1 + "&" + Math.random(),
  2469. width: "550px",
  2470. height: "1000px",
  2471. callBack: function (iframeId) {
  2472. top.frames[iframeId].submitForm();
  2473. }
  2474. });
  2475. } else if (Type == '2') {
  2476. for (var i in ids) {
  2477. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  2478. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2479. }
  2480. $.modalOpen({
  2481. id: "FormAddItemLot",
  2482. title: "委外退料条码生成",
  2483. url: "/WMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 2 + "&" + Math.random(),
  2484. width: "550px",
  2485. height: "1000px",
  2486. callBack: function (iframeId) {
  2487. top.frames[iframeId].submitForm();
  2488. }
  2489. });
  2490. } else if (Type == '3') {
  2491. for (var i in ids) {
  2492. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  2493. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2494. }
  2495. $.modalOpen({
  2496. id: "FormAddItemLot",
  2497. title: "成品条码产生",
  2498. url: "/WMS/WMSCreateItemLot/From?MOCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + 3 + "&" + Math.random(),
  2499. width: "550px",
  2500. height: "1000px",
  2501. callBack: function (iframeId) {
  2502. top.frames[iframeId].submitForm();
  2503. }
  2504. });
  2505. } else if (Type == '4') {
  2506. for (var i in ids) {
  2507. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  2508. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2509. }
  2510. $.modalOpen({
  2511. id: "FormAddItemLot",
  2512. title: "销售退货条码产生",
  2513. url: "/WMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + 4 + "&" + Math.random(),
  2514. width: "550px",
  2515. height: "1000px",
  2516. callBack: function (iframeId) {
  2517. top.frames[iframeId].submitForm();
  2518. }
  2519. });
  2520. } else if (Type == '5') {
  2521. for (var i in ids) {
  2522. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  2523. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2524. }
  2525. $.modalOpen({
  2526. id: "FormAddItemLot",
  2527. title: "其他入库条码产生",
  2528. url: "/WMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + 5 + "&" + Math.random(),
  2529. width: "550px",
  2530. height: "1000px",
  2531. callBack: function (iframeId) {
  2532. top.frames[iframeId].submitForm();
  2533. }
  2534. });
  2535. } else if (Type == '6') {
  2536. for (var i in ids) {
  2537. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  2538. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2539. }
  2540. $.modalOpen({
  2541. id: "FormAddItemLot",
  2542. title: "归还单条码产生",
  2543. url: "/WMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + 6 + "&" + Math.random(),
  2544. width: "550px",
  2545. height: "1000px",
  2546. callBack: function (iframeId) {
  2547. top.frames[iframeId].submitForm();
  2548. }
  2549. });
  2550. } else if (Type == '7') {
  2551. for (var i in ids) {
  2552. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  2553. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2554. }
  2555. $.modalOpen({
  2556. id: "FormAddItemLot",
  2557. title: "审核到货单生成条码",
  2558. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 7 + "&" + Math.random(),
  2559. width: "550px",
  2560. height: "1000px",
  2561. callBack: function (iframeId) {
  2562. top.frames[iframeId].submitForm();
  2563. }
  2564. });
  2565. } else if (Type == '8') {
  2566. for (var i in ids) {
  2567. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  2568. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2569. }
  2570. $.modalOpen({
  2571. id: "FormAddItemLot",
  2572. title: "审核委外到货单生成条码",
  2573. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 8 + "&" + Math.random(),
  2574. width: "550px",
  2575. height: "1000px",
  2576. callBack: function (iframeId) {
  2577. top.frames[iframeId].submitForm();
  2578. }
  2579. });
  2580. } else if (Type == '9') {
  2581. for (var i in ids) {
  2582. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  2583. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2584. }
  2585. $.modalOpen({
  2586. id: "FormAddItemLot",
  2587. title: "开立成品入库单生成条码",
  2588. url: "/WMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + 9 + "&" + Math.random(),
  2589. width: "550px",
  2590. height: "1000px",
  2591. callBack: function (iframeId) {
  2592. top.frames[iframeId].submitForm();
  2593. }
  2594. });
  2595. } else if (Type == '10') {
  2596. for (var i in ids) {
  2597. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  2598. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2599. }
  2600. $.modalOpen({
  2601. id: "FormAddItemLot",
  2602. title: "审核拒收单生成条码",
  2603. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 10 + "&" + Math.random(),
  2604. width: "550px",
  2605. height: "1000px",
  2606. callBack: function (iframeId) {
  2607. top.frames[iframeId].submitForm();
  2608. }
  2609. });
  2610. } else if (Type == '11') {
  2611. for (var i in ids) {
  2612. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  2613. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  2614. }
  2615. $.modalOpen({
  2616. id: "FormAddItemLot",
  2617. title: "审核委外拒收单生成条码",
  2618. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 11 + "&" + Math.random(),
  2619. width: "550px",
  2620. height: "1000px",
  2621. callBack: function (iframeId) {
  2622. top.frames[iframeId].submitForm();
  2623. }
  2624. });
  2625. } else if (Type == '12') {
  2626. for (var i in ids) {
  2627. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  2628. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2629. }
  2630. $.modalOpen({
  2631. id: "FormAddItemLot",
  2632. title: "审核领料申请退料生成条码",
  2633. url: "/WMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 12 + "&" + Math.random(),
  2634. width: "550px",
  2635. height: "1000px",
  2636. callBack: function (iframeId) {
  2637. top.frames[iframeId].submitForm();
  2638. }
  2639. });
  2640. } else if (Type == '13') {
  2641. for (var i in ids) {
  2642. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  2643. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2644. }
  2645. $.modalOpen({
  2646. id: "FormAddItemLot",
  2647. title: "材料出库退料生成条码",
  2648. url: "/WMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 13 + "&" + Math.random(),
  2649. width: "550px",
  2650. height: "1000px",
  2651. callBack: function (iframeId) {
  2652. top.frames[iframeId].submitForm();
  2653. }
  2654. });
  2655. } else if (Type == '14') {
  2656. for (var i in ids) {
  2657. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  2658. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2659. }
  2660. $.modalOpen({
  2661. id: "FormAddItemLot",
  2662. title: "委外领料退料条码生成",
  2663. url: "/WMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 14 + "&" + Math.random(),
  2664. width: "550px",
  2665. height: "1000px",
  2666. callBack: function (iframeId) {
  2667. top.frames[iframeId].submitForm();
  2668. }
  2669. });
  2670. }
  2671. else if (Type == '15') {
  2672. for (var i in ids) {
  2673. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  2674. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2675. }
  2676. $.modalOpen({
  2677. id: "FormAddItemLot",
  2678. title: "委外材料出库退料生成条码",
  2679. url: "/WMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 15 + "&" + Math.random(),
  2680. width: "550px",
  2681. height: "1000px",
  2682. callBack: function (iframeId) {
  2683. top.frames[iframeId].submitForm();
  2684. }
  2685. });
  2686. }
  2687. else if (Type == '16') {
  2688. for (var i in ids) {
  2689. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  2690. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2691. }
  2692. $.modalOpen({
  2693. id: "FormAddItemLot",
  2694. title: "返工工单生成条码",
  2695. url: "/WMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&Type=" + 16 + "&" + Math.random(),
  2696. width: "550px",
  2697. height: "1000px",
  2698. callBack: function (iframeId) {
  2699. top.frames[iframeId].submitForm();
  2700. }
  2701. });
  2702. }
  2703. }
  2704. function fullscreen() {
  2705. var docElm = document.documentElement;
  2706. if (docElm.requestFullscreen) {
  2707. docElm.requestFullscreen();
  2708. } else if (docElm.mozRequestFullScreen) {
  2709. docElm.mozRequestFullScreen();
  2710. } else if (docElm.webkitRequestFullScreen) {
  2711. docElm.webkitRequestFullScreen();
  2712. } else if (docElm.msRequestFullscreen) {
  2713. docElm.msRequestFullscreen();
  2714. }
  2715. $(window).bind('resize', function () {
  2716. $("#gridList").setGridWidth($(window).width());
  2717. }).trigger('resize');
  2718. $(window).bind('resize', function () {
  2719. $("#gridList").setGridHeight($(window).height());
  2720. }).trigger('resize');
  2721. }
  2722. function btnPrint() {
  2723. debugger;
  2724. var mold = '';
  2725. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  2726. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  2727. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  2728. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  2729. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  2730. if (Type == '6') { mold = '00006'; }//归还单生成条码
  2731. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  2732. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  2733. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  2734. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  2735. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  2736. if (Type == '12') { mold = '00012'; }//领料申请退料
  2737. if (Type == '13') { mold = '00013'; }//材料出库退料
  2738. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  2739. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  2740. if (Type == '16') { mold = '00016'; }//返工工单
  2741. var objArr = '';
  2742. var arr = [];
  2743. var obj = $("#gridList").jqGrid("getRowData");
  2744. for (var i = 0; i < obj.length; i++) {
  2745. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  2746. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  2747. if (rowData != "undefined" && rowData != null) {
  2748. for (var j = 0; j < rowData.length; j++) {
  2749. objArr += "'" + rowData[j] + "',";
  2750. }
  2751. objArr = objArr.slice(0, objArr.length - 1);
  2752. objArr = "" + objArr + "|";
  2753. arr.push(objArr);
  2754. }
  2755. }
  2756. if (objArr == "|") {
  2757. $.modalAlertNew("WMS00101");
  2758. return;
  2759. }
  2760. $.modalOpen({
  2761. id: "PrintLot",
  2762. title: "打印",
  2763. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  2764. width: "550px",
  2765. height: "1000px",
  2766. callBack: function (iframeId) {
  2767. top.frames[iframeId].submitForm();
  2768. }
  2769. });
  2770. }
  2771. function btnUploading() {
  2772. var PoStatus;
  2773. var jsonData = '';
  2774. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  2775. if (ids.length != 1) {
  2776. $.modalAlertNew("WMS00100");
  2777. return;
  2778. }
  2779. for (var i in ids) {
  2780. var Code = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  2781. var Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2782. }
  2783. $.modalConfirm("是否确认上传?", function (r) {
  2784. if (r) {
  2785. $.submitForm({
  2786. url: "/WMS/WMSCreateItemLot/CallU8ManufactureReceiveDoc?Code=" + Code + "&Sequence=" + Sequence + "&" + Math.random(),
  2787. // param: { keyValue: IDlist },
  2788. success: function () {
  2789. $.currentWindow().$("#gridList").trigger("reloadGrid");
  2790. }
  2791. })
  2792. }
  2793. });
  2794. }
  2795. </script>
  2796. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  2797. <div class="topPanel" style="height:100px;">
  2798. <div class="toolbar">
  2799. <div class="btn-group">
  2800. <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>
  2801. <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>
  2802. <a id="NF-Uploading" authorize="yes" style="margin-left:3px;display:none" class="btn btn-primary" onclick="btnUploading()" ><i class="fa fa-pencil-square-o"></i>上传</a>
  2803. <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>
  2804. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe">点击下载打印组件</a>
  2805. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  2806. </div>
  2807. <div class="btn-group" style="display:block;padding-left:2px;">
  2808. </div>
  2809. <script>$('.toolbar').authorizeButton()</script>
  2810. </div>
  2811. <div class="search">
  2812. <table>
  2813. <tr>
  2814. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  2815. <td>
  2816. <div class="input-group">
  2817. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  2818. </div>
  2819. </td>
  2820. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  2821. <td class="HideItems">
  2822. <div class="input-group HideItems">
  2823. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  2824. </div>
  2825. </td>
  2826. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  2827. <td class="HideItems">
  2828. <div class="input-group HideItems">
  2829. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  2830. </div>
  2831. </td>
  2832. </tr>
  2833. <tr>
  2834. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  2835. <td>
  2836. <div class="input-group">
  2837. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  2838. </div>
  2839. </td>
  2840. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  2841. <td>
  2842. <div class="input-group">
  2843. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  2844. </div>
  2845. </td>
  2846. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  2847. <td>
  2848. <div class="input-group">
  2849. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  2850. </div>
  2851. </td>
  2852. <td>
  2853. <span class="input-group-btn">
  2854. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  2855. </span>
  2856. </td>
  2857. </tr>
  2858. </table>
  2859. </div>
  2860. </div>
  2861. <div class="gridPanel">
  2862. <table id="gridList"></table>
  2863. <div id="gridPager"></div>
  2864. </div>