纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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