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

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