纽威
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.

3182 lines
161 KiB

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