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

3258 lines
166 KiB

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