纽威

3751 lines
187 KiB

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