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

3757 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. Container: $("#txt_Container :checked").val(),
  1842. }
  1843. $gridList.dataGrid({
  1844. url: "/WMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  1845. postData: { queryJson: JSON.stringify(queryJson) },
  1846. height: $(window).height() - 200,
  1847. width: $(window).width() - 300,
  1848. colModel: _Clos,
  1849. //colModel: [
  1850. // { label: "主键", name: "ID", hidden: true, key: true },
  1851. // { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  1852. // { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1853. // { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  1854. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1855. // { label: '物料描述', name: 'InvName', width: 120, align: 'left' },
  1856. // { label: '辅助描述', name: 'InvDesc', width: 50, align: 'left' },
  1857. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1858. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1859. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1860. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1861. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1862. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1863. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1864. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1865. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1866. //],
  1867. //colModel: ColModelMain,
  1868. width: "100%",
  1869. autowidth: true,
  1870. //shrinkToFit: true,
  1871. gridComplete: function () {
  1872. var strIds = $("#gridList").jqGrid("getDataIDs");
  1873. for (var i = 0; i < strIds.length; i++) {
  1874. var strValue = $("#gridList").jqGrid("getCell", strIds[i], "LOTQTY");//得到单元格数据
  1875. var strValue1 = $("#gridList").jqGrid("getCell", strIds[i], "Quantity");//得到单元格数据
  1876. if (strValue == strValue1) {
  1877. $("#" + strIds[i]).find("td").css("background-color", "yellow");
  1878. }
  1879. }
  1880. if (ChosenList != "") {
  1881. var Chosen = ChosenList.split(',');
  1882. for (var i = 0; i < Chosen.length; i++) {
  1883. $("#gridList").jqGrid('setSelection', Chosen[i]);
  1884. }
  1885. }
  1886. },
  1887. pager: "#gridPager",
  1888. sortname: 'RCVCode',
  1889. sortorder: "desc",
  1890. viewrecords: true,
  1891. multiselect: true,
  1892. beforeSelectRow: function (rowid, e) {
  1893. },
  1894. subGrid: true, // (1)开启子表格支持
  1895. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1896. $("#gridList").jqGrid("setSelection", rowid, false);
  1897. bindSubGrid9(subgrid_id, rowid)
  1898. }
  1899. });
  1900. $("#warehouse a.btn-default").click(function () {
  1901. $("#warehouse a.btn-default").removeClass("active");
  1902. $(this).addClass("active");
  1903. $('#btn_search').trigger("click");
  1904. });
  1905. $("#btn_search").click(function () {
  1906. var warehouse = $("#warehouse a.active").attr('data-value');
  1907. var queryJson = {
  1908. POCode: $("#txt_POCode").val(),
  1909. OrderNumber: $("#txt_OrderNumber").val(),
  1910. Area: $("#txt_Area").val(),
  1911. InvCode: $("#txt_InvCode").val(),
  1912. InvName: $("#txt_InvName").val(),
  1913. BatchCode: $("#txt_BatchCode").val(),
  1914. Container: $("#txt_Container :checked").val(),
  1915. }
  1916. $gridList.jqGrid('setGridParam', {
  1917. page: 1,
  1918. postData: { queryJson: JSON.stringify(queryJson) },
  1919. }).trigger('reloadGrid');
  1920. });
  1921. }
  1922. function bindSubGrid9(subgrid_id, rowid) {
  1923. $("#gridList").jqGrid("setSelection", rowid, false);
  1924. var subgrid_table_id;
  1925. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1926. var subgrid_pager_id;
  1927. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1928. // (5)动态添加子报表的table和pager
  1929. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1930. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  1931. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1932. // (6)创建jqGrid对象
  1933. $("#" + subgrid_table_id).dataGrid({
  1934. cellEdit: true,
  1935. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1936. //colModel: [
  1937. // { label: "主键", name: "ID", hidden: true, key: true },
  1938. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1939. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1940. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1941. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1942. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1943. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1944. //],
  1945. colModel: _Clos1,
  1946. //colModel: ColModelSub,
  1947. shrinkToFit: true,//宽度自适应
  1948. multiselect: true,
  1949. prmNames: { search: "search" },
  1950. viewrecords: true,
  1951. height: "100%",
  1952. rowNum: 20,
  1953. pager: subgrid_pager_id,
  1954. });
  1955. }
  1956. //采购拒收单
  1957. function gridList10() {
  1958. var $gridList = $("#gridList");
  1959. var queryJson = {
  1960. POCode: $("#txt_POCode").val(),
  1961. VenCode: $("#txt_VenCode").val(),
  1962. VenName: $("#txt_VenName").val(),
  1963. InvCode: $("#txt_InvCode").val(),
  1964. InvName: $("#txt_InvName").val(),
  1965. BatchCode: $("#txt_BatchCode").val(),
  1966. Area: $("#txt_Area").val(),
  1967. }
  1968. $gridList.dataGrid({
  1969. url: "/WMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  1970. postData: { queryJson: JSON.stringify(queryJson) },
  1971. height: $(window).height() - 200,
  1972. width: $(window).width() - 300,
  1973. colModel: _Clos,
  1974. //colModel: [
  1975. // { label: "主键", name: "ID", hidden: true, key: true },
  1976. // { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  1977. // { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  1978. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1979. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1980. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1981. // { label: '物料描述', name: 'InvName', width: 120, align: 'left' },
  1982. // { label: '辅助描述', name: 'InvDesc', width: 50, align: 'left' },
  1983. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1984. // { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  1985. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1986. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1987. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1988. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1989. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1990. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1991. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1992. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1993. //],
  1994. //colModel: ColModelMain,
  1995. width: "100%",
  1996. autowidth: true,
  1997. //shrinkToFit: true,
  1998. gridComplete: function () {
  1999. if (ChosenList != "") {
  2000. var Chosen = ChosenList.split(',');
  2001. for (var i = 0; i < Chosen.length; i++) {
  2002. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2003. }
  2004. }
  2005. },
  2006. pager: "#gridPager",
  2007. sortname: 'DNCode',
  2008. sortorder: "desc",
  2009. viewrecords: true,
  2010. multiselect: true,
  2011. beforeSelectRow: function (rowid, e) {
  2012. },
  2013. subGrid: true, // (1)开启子表格支持
  2014. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2015. $("#gridList").jqGrid("setSelection", rowid, false);
  2016. bindSubGrid10(subgrid_id, rowid)
  2017. }
  2018. });
  2019. $("#warehouse a.btn-default").click(function () {
  2020. $("#warehouse a.btn-default").removeClass("active");
  2021. $(this).addClass("active");
  2022. $('#btn_search').trigger("click");
  2023. });
  2024. $("#btn_search").click(function () {
  2025. var warehouse = $("#warehouse a.active").attr('data-value');
  2026. var queryJson = {
  2027. POCode: $("#txt_POCode").val(),
  2028. VenCode: $("#txt_VenCode").val(),
  2029. VenName: $("#txt_VenName").val(),
  2030. InvCode: $("#txt_InvCode").val(),
  2031. InvName: $("#txt_InvName").val(),
  2032. BatchCode: $("#txt_BatchCode").val(),
  2033. Area: $("#txt_Area").val(),
  2034. }
  2035. $gridList.jqGrid('setGridParam', {
  2036. page: 1,
  2037. postData: { queryJson: JSON.stringify(queryJson) },
  2038. }).trigger('reloadGrid');
  2039. });
  2040. }
  2041. function bindSubGrid10(subgrid_id, rowid) {
  2042. $("#gridList").jqGrid("setSelection", rowid, false);
  2043. var subgrid_table_id;
  2044. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2045. var subgrid_pager_id;
  2046. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2047. // (5)动态添加子报表的table和pager
  2048. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2049. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  2050. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2051. // (6)创建jqGrid对象
  2052. $("#" + subgrid_table_id).dataGrid({
  2053. cellEdit: true,
  2054. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2055. //colModel: [
  2056. // { label: "主键", name: "ID", hidden: true, key: true },
  2057. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2058. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2059. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2060. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2061. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2062. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2063. //],
  2064. colModel: _Clos1,
  2065. //colModel: ColModelSub,
  2066. shrinkToFit: true,//宽度自适应
  2067. multiselect: true,
  2068. prmNames: { search: "search" },
  2069. viewrecords: true,
  2070. height: "100%",
  2071. rowNum: 20,
  2072. pager: subgrid_pager_id,
  2073. });
  2074. }
  2075. //委外拒收单生成条码
  2076. function gridList11() {
  2077. var $gridList = $("#gridList");
  2078. var queryJson = {
  2079. POCode: $("#txt_POCode").val(),
  2080. VenCode: $("#txt_VenCode").val(),
  2081. VenName: $("#txt_VenName").val(),
  2082. InvCode: $("#txt_InvCode").val(),
  2083. InvName: $("#txt_InvName").val(),
  2084. BatchCode: $("#txt_BatchCode").val(),
  2085. Area: $("#txt_Area").val(),
  2086. }
  2087. $gridList.dataGrid({
  2088. url: "/WMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  2089. postData: { queryJson: JSON.stringify(queryJson) },
  2090. height: $(window).height() - 200,
  2091. width: $(window).width() - 300,
  2092. colModel: _Clos,
  2093. //colModel: [
  2094. // { label: "主键", name: "ID", hidden: true, key: true },
  2095. // { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  2096. // { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  2097. // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  2098. // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  2099. // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  2100. // { label: '物料描述', name: 'InvName', width: 120, align: 'left' },
  2101. // { label: '辅助描述', name: 'InvDesc', width: 50, align: 'left' },
  2102. // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  2103. // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  2104. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2105. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2106. // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  2107. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2108. // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  2109. // { label: '币种', name: 'Currency', width: 60, align: 'left', },
  2110. // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  2111. // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  2112. //],
  2113. //colModel: ColModelMain,
  2114. width: "100%",
  2115. autowidth: true,
  2116. //shrinkToFit: true,
  2117. gridComplete: function () {
  2118. if (ChosenList != "") {
  2119. var Chosen = ChosenList.split(',');
  2120. for (var i = 0; i < Chosen.length; i++) {
  2121. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2122. }
  2123. }
  2124. },
  2125. pager: "#gridPager",
  2126. sortname: 'OOCode',
  2127. sortorder: "desc",
  2128. viewrecords: true,
  2129. multiselect: true,
  2130. beforeSelectRow: function (rowid, e) {
  2131. },
  2132. subGrid: true, // (1)开启子表格支持
  2133. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2134. $("#gridList").jqGrid("setSelection", rowid, false);
  2135. bindSubGrid11(subgrid_id, rowid)
  2136. }
  2137. });
  2138. $("#warehouse a.btn-default").click(function () {
  2139. $("#warehouse a.btn-default").removeClass("active");
  2140. $(this).addClass("active");
  2141. $('#btn_search').trigger("click");
  2142. });
  2143. $("#btn_search").click(function () {
  2144. var warehouse = $("#warehouse a.active").attr('data-value');
  2145. var queryJson = {
  2146. POCode: $("#txt_POCode").val(),
  2147. VenCode: $("#txt_VenCode").val(),
  2148. VenName: $("#txt_VenName").val(),
  2149. InvCode: $("#txt_InvCode").val(),
  2150. InvName: $("#txt_InvName").val(),
  2151. BatchCode: $("#txt_BatchCode").val(),
  2152. Area: $("#txt_Area").val(),
  2153. }
  2154. $gridList.jqGrid('setGridParam', {
  2155. page: 1,
  2156. postData: { queryJson: JSON.stringify(queryJson) },
  2157. }).trigger('reloadGrid');
  2158. });
  2159. }
  2160. function bindSubGrid11(subgrid_id, rowid) {
  2161. $("#gridList").jqGrid("setSelection", rowid, false);
  2162. var subgrid_table_id;
  2163. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2164. var subgrid_pager_id;
  2165. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2166. // (5)动态添加子报表的table和pager
  2167. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2168. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).OOCode;
  2169. var Sequence = $("#gridList").jqGrid('getRowData', rowid).OOSequence;
  2170. // (6)创建jqGrid对象
  2171. $("#" + subgrid_table_id).dataGrid({
  2172. cellEdit: true,
  2173. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2174. //colModel: [
  2175. // { label: "主键", name: "ID", hidden: true, key: true },
  2176. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2177. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2178. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2179. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2180. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2181. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2182. //],
  2183. colModel: _Clos1,
  2184. //colModel: ColModelSub,
  2185. shrinkToFit: true,//宽度自适应
  2186. multiselect: true,
  2187. prmNames: { search: "search" },
  2188. viewrecords: true,
  2189. height: "100%",
  2190. rowNum: 20,
  2191. pager: subgrid_pager_id,
  2192. });
  2193. }
  2194. //领料申请退料生成条码
  2195. function gridList12() {
  2196. var $gridList = $("#gridList");
  2197. var queryJson = {
  2198. POCode: $("#txt_POCode").val(),
  2199. InvCode: $("#txt_InvCode").val(),
  2200. InvName: $("#txt_InvName").val(),
  2201. BatchCode: $("#txt_BatchCode").val(),
  2202. Area: $("#txt_Area").val(),
  2203. Location: $("#txt_Location").val(),
  2204. Container: $("#txt_Container :checked").val(),
  2205. }
  2206. $gridList.dataGrid({
  2207. url: "/WMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  2208. postData: { queryJson: JSON.stringify(queryJson) },
  2209. height: $(window).height() - 200,
  2210. width: $(window).width() - 300,
  2211. colModel: _Clos,
  2212. //colModel: [
  2213. // { label: "主键", name: "ID", hidden: true, key: true },
  2214. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2215. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2216. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  2217. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2218. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2219. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2220. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2221. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2222. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2223. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2224. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2225. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2226. //],
  2227. //colModel: ColModelMain,
  2228. width: "100%",
  2229. autowidth: true,
  2230. //shrinkToFit: true,
  2231. gridComplete: function () {
  2232. var strIds = $("#gridList").jqGrid("getDataIDs");
  2233. for (var i = 0; i < strIds.length; i++) {
  2234. var strValue = $("#gridList").jqGrid("getCell", strIds[i], "LOTQTY");//得到单元格数据
  2235. var strValue1 = $("#gridList").jqGrid("getCell", strIds[i], "Quantity");//得到单元格数据
  2236. var check = $("#gridList").jqGrid("getCell", strIds[i], "EATTRIBUTE");//得到单元格数据
  2237. if (strValue == strValue1 || check=='1') {
  2238. $("#" + strIds[i]).find("td").css("background-color", "yellow");
  2239. }
  2240. }
  2241. if (ChosenList != "") {
  2242. var Chosen = ChosenList.split(',');
  2243. for (var i = 0; i < Chosen.length; i++) {
  2244. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2245. }
  2246. }
  2247. },
  2248. pager: "#gridPager",
  2249. sortname: 'ApplyNegCode',
  2250. sortorder: "desc",
  2251. viewrecords: true,
  2252. multiselect: true,
  2253. beforeSelectRow: function (rowid, e) {
  2254. },
  2255. subGrid: true, // (1)开启子表格支持
  2256. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2257. $("#gridList").jqGrid("setSelection", rowid, false);
  2258. bindSubGrid12(subgrid_id, rowid)
  2259. }
  2260. });
  2261. $("#warehouse a.btn-default").click(function () {
  2262. $("#warehouse a.btn-default").removeClass("active");
  2263. $(this).addClass("active");
  2264. $('#btn_search').trigger("click");
  2265. });
  2266. $("#btn_search").click(function () {
  2267. var warehouse = $("#warehouse a.active").attr('data-value');
  2268. var queryJson = {
  2269. POCode: $("#txt_POCode").val(),
  2270. InvCode: $("#txt_InvCode").val(),
  2271. InvName: $("#txt_InvName").val(),
  2272. BatchCode: $("#txt_BatchCode").val(),
  2273. Area: $("#txt_Area").val(),
  2274. Location: $("#txt_Location").val(),
  2275. Container: $("#txt_Container :checked").val(),
  2276. }
  2277. $gridList.jqGrid('setGridParam', {
  2278. page: 1,
  2279. postData: { queryJson: JSON.stringify(queryJson) },
  2280. }).trigger('reloadGrid');
  2281. });
  2282. }
  2283. function bindSubGrid12(subgrid_id, rowid) {
  2284. $("#gridList").jqGrid("setSelection", rowid, false);
  2285. var subgrid_table_id;
  2286. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2287. var subgrid_pager_id;
  2288. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2289. // (5)动态添加子报表的table和pager
  2290. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2291. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2292. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2293. // (6)创建jqGrid对象
  2294. $("#" + subgrid_table_id).dataGrid({
  2295. cellEdit: true,
  2296. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2297. //colModel: [
  2298. // { label: "主键", name: "ID", hidden: true, key: true },
  2299. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2300. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2301. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2302. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2303. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2304. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2305. //],
  2306. colModel: _Clos1,
  2307. //colModel: ColModelSub,
  2308. shrinkToFit: true,//宽度自适应
  2309. multiselect: true,
  2310. prmNames: { search: "search" },
  2311. viewrecords: true,
  2312. height: "100%",
  2313. rowNum: 20,
  2314. pager: subgrid_pager_id,
  2315. });
  2316. }
  2317. //材料出库退料
  2318. function gridList13() {
  2319. var $gridList = $("#gridList");
  2320. var queryJson = {
  2321. POCode: $("#txt_POCode").val(),
  2322. InvCode: $("#txt_InvCode").val(),
  2323. InvName: $("#txt_InvName").val(),
  2324. BatchCode: $("#txt_BatchCode").val(),
  2325. Area: $("#txt_Area").val(),
  2326. Container: $("#txt_Container :checked").val(),
  2327. }
  2328. $gridList.dataGrid({
  2329. url: "/WMS/WMSCreateItemLot/GetGridJsonCLCK" + "?" + Math.random(),
  2330. postData: { queryJson: JSON.stringify(queryJson) },
  2331. height: $(window).height() - 200,
  2332. width: $(window).width() - 300,
  2333. colModel: _Clos,
  2334. //colModel: [
  2335. // { label: "主键", name: "ID", hidden: true, key: true },
  2336. // { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  2337. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2338. // { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  2339. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2340. // { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  2341. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2342. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2343. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2344. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2345. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2346. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2347. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2348. //],
  2349. //colModel: ColModelMain,
  2350. width: "100%",
  2351. autowidth: true,
  2352. //shrinkToFit: true,
  2353. gridComplete: function () {
  2354. if (ChosenList != "") {
  2355. var Chosen = ChosenList.split(',');
  2356. for (var i = 0; i < Chosen.length; i++) {
  2357. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2358. }
  2359. }
  2360. },
  2361. pager: "#gridPager",
  2362. sortname: 'ApplyNegCode',
  2363. sortorder: "desc",
  2364. viewrecords: true,
  2365. multiselect: true,
  2366. beforeSelectRow: function (rowid, e) {
  2367. },
  2368. subGrid: true, // (1)开启子表格支持
  2369. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2370. $("#gridList").jqGrid("setSelection", rowid, false);
  2371. bindSubGrid13(subgrid_id, rowid)
  2372. }
  2373. });
  2374. $("#warehouse a.btn-default").click(function () {
  2375. $("#warehouse a.btn-default").removeClass("active");
  2376. $(this).addClass("active");
  2377. $('#btn_search').trigger("click");
  2378. });
  2379. $("#btn_search").click(function () {
  2380. var warehouse = $("#warehouse a.active").attr('data-value');
  2381. var queryJson = {
  2382. POCode: $("#txt_POCode").val(),
  2383. InvCode: $("#txt_InvCode").val(),
  2384. InvName: $("#txt_InvName").val(),
  2385. BatchCode: $("#txt_BatchCode").val(),
  2386. Area: $("#txt_Area").val(),
  2387. Container: $("#txt_Container :checked").val(),
  2388. }
  2389. $gridList.jqGrid('setGridParam', {
  2390. page: 1,
  2391. postData: { queryJson: JSON.stringify(queryJson) },
  2392. }).trigger('reloadGrid');
  2393. });
  2394. }
  2395. function bindSubGrid13(subgrid_id, rowid) {
  2396. $("#gridList").jqGrid("setSelection", rowid, false);
  2397. var subgrid_table_id;
  2398. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2399. var subgrid_pager_id;
  2400. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2401. // (5)动态添加子报表的table和pager
  2402. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2403. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  2404. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2405. // (6)创建jqGrid对象
  2406. $("#" + subgrid_table_id).dataGrid({
  2407. cellEdit: true,
  2408. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2409. //colModel: [
  2410. // { label: "主键", name: "ID", hidden: true, key: true },
  2411. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2412. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2413. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2414. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2415. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2416. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2417. //],
  2418. colModel: _Clos1,
  2419. //colModel: ColModelSub,
  2420. shrinkToFit: true,//宽度自适应
  2421. multiselect: true,
  2422. prmNames: { search: "search" },
  2423. viewrecords: true,
  2424. height: "100%",
  2425. rowNum: 20,
  2426. pager: subgrid_pager_id,
  2427. });
  2428. }
  2429. //委外领料申请退料
  2430. function gridList14() {
  2431. var $gridList = $("#gridList");
  2432. var queryJson = {
  2433. POCode: $("#txt_POCode").val(),
  2434. InvCode: $("#txt_InvCode").val(),
  2435. InvName: $("#txt_InvName").val(),
  2436. BatchCode: $("#txt_BatchCode").val(),
  2437. Area: $("#txt_Area").val(),
  2438. }
  2439. $gridList.dataGrid({
  2440. url: "/WMS/WMSCreateItemLot/GetGridJsonWWLLTL" + "?" + Math.random(),
  2441. postData: { queryJson: JSON.stringify(queryJson) },
  2442. height: $(window).height() - 200,
  2443. width: $(window).width() - 300,
  2444. colModel: _Clos,
  2445. //colModel: [
  2446. // { label: "主键", name: "ID", hidden: true, key: true },
  2447. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2448. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2449. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2450. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2451. // { label: '物料描述', name: 'InvName', width: 60, align: 'left', },
  2452. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2453. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2454. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2455. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2456. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2457. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2458. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2459. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2460. //],
  2461. //colModel: ColModelMain,
  2462. width: "100%",
  2463. autowidth: true,
  2464. //shrinkToFit: true,
  2465. gridComplete: function () {
  2466. if (ChosenList != "") {
  2467. var Chosen = ChosenList.split(',');
  2468. for (var i = 0; i < Chosen.length; i++) {
  2469. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2470. }
  2471. }
  2472. },
  2473. pager: "#gridPager",
  2474. sortname: 'OApplyNegCode',
  2475. sortorder: "desc",
  2476. viewrecords: true,
  2477. multiselect: true,
  2478. beforeSelectRow: function (rowid, e) {
  2479. },
  2480. subGrid: true, // (1)开启子表格支持
  2481. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2482. $("#gridList").jqGrid("setSelection", rowid, false);
  2483. bindSubGrid14(subgrid_id, rowid)
  2484. }
  2485. });
  2486. $("#warehouse a.btn-default").click(function () {
  2487. $("#warehouse a.btn-default").removeClass("active");
  2488. $(this).addClass("active");
  2489. $('#btn_search').trigger("click");
  2490. });
  2491. $("#btn_search").click(function () {
  2492. var warehouse = $("#warehouse a.active").attr('data-value');
  2493. var queryJson = {
  2494. POCode: $("#txt_POCode").val(),
  2495. InvCode: $("#txt_InvCode").val(),
  2496. InvName: $("#txt_InvName").val(),
  2497. BatchCode: $("#txt_BatchCode").val(),
  2498. Area: $("#txt_Area").val(),
  2499. }
  2500. $gridList.jqGrid('setGridParam', {
  2501. page: 1,
  2502. postData: { queryJson: JSON.stringify(queryJson) },
  2503. }).trigger('reloadGrid');
  2504. });
  2505. }
  2506. function bindSubGrid14(subgrid_id, rowid) {
  2507. $("#gridList").jqGrid("setSelection", rowid, false);
  2508. var subgrid_table_id;
  2509. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2510. var subgrid_pager_id;
  2511. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2512. // (5)动态添加子报表的table和pager
  2513. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2514. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2515. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2516. // (6)创建jqGrid对象
  2517. $("#" + subgrid_table_id).dataGrid({
  2518. cellEdit: true,
  2519. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2520. //colModel: [
  2521. // { label: "主键", name: "ID", hidden: true, key: true },
  2522. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2523. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2524. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2525. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2526. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2527. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2528. //],
  2529. colModel: _Clos1,
  2530. //colModel: ColModelSub,
  2531. shrinkToFit: true,//宽度自适应
  2532. multiselect: true,
  2533. prmNames: { search: "search" },
  2534. viewrecords: true,
  2535. height: "100%",
  2536. rowNum: 20,
  2537. pager: subgrid_pager_id,
  2538. });
  2539. }
  2540. function gridList15() {
  2541. var $gridList = $("#gridList");
  2542. var queryJson = {
  2543. POCode: $("#txt_POCode").val(),
  2544. InvCode: $("#txt_InvCode").val(),
  2545. InvName: $("#txt_InvName").val(),
  2546. BatchCode: $("#txt_BatchCode").val(),
  2547. Area: $("#txt_Area").val(),
  2548. Container: $("#txt_Container :checked").val(),
  2549. }
  2550. $gridList.dataGrid({
  2551. url: "/WMS/WMSCreateItemLot/GetGridJsonWWCLCK" + "?" + Math.random(),
  2552. postData: { queryJson: JSON.stringify(queryJson) },
  2553. height: $(window).height() - 200,
  2554. width: $(window).width() - 300,
  2555. colModel: _Clos,
  2556. //colModel: [
  2557. // { label: "主键", name: "ID", hidden: true, key: true },
  2558. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2559. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2560. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2561. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2562. // { label: '物料描述', name: 'InvName', width: 60, align: 'left', },
  2563. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2564. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2565. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2566. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2567. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2568. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2569. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2570. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2571. //],
  2572. //colModel: ColModelMain,
  2573. width: "100%",
  2574. autowidth: true,
  2575. //shrinkToFit: true,
  2576. gridComplete: function () {
  2577. if (ChosenList != "") {
  2578. var Chosen = ChosenList.split(',');
  2579. for (var i = 0; i < Chosen.length; i++) {
  2580. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2581. }
  2582. }
  2583. },
  2584. pager: "#gridPager",
  2585. sortname: 'OApplyNegCode',
  2586. sortorder: "desc",
  2587. viewrecords: true,
  2588. multiselect: true,
  2589. beforeSelectRow: function (rowid, e) {
  2590. },
  2591. subGrid: true, // (1)开启子表格支持
  2592. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2593. $("#gridList").jqGrid("setSelection", rowid, false);
  2594. bindSubGrid15(subgrid_id, rowid)
  2595. }
  2596. });
  2597. $("#warehouse a.btn-default").click(function () {
  2598. $("#warehouse a.btn-default").removeClass("active");
  2599. $(this).addClass("active");
  2600. $('#btn_search').trigger("click");
  2601. });
  2602. $("#btn_search").click(function () {
  2603. var warehouse = $("#warehouse a.active").attr('data-value');
  2604. var queryJson = {
  2605. POCode: $("#txt_POCode").val(),
  2606. InvCode: $("#txt_InvCode").val(),
  2607. InvName: $("#txt_InvName").val(),
  2608. BatchCode: $("#txt_BatchCode").val(),
  2609. Area: $("#txt_Area").val(),
  2610. Container: $("#txt_Container :checked").val(),
  2611. }
  2612. $gridList.jqGrid('setGridParam', {
  2613. page: 1,
  2614. postData: { queryJson: JSON.stringify(queryJson) },
  2615. }).trigger('reloadGrid');
  2616. });
  2617. }
  2618. function bindSubGrid15(subgrid_id, rowid) {
  2619. $("#gridList").jqGrid("setSelection", rowid, false);
  2620. var subgrid_table_id;
  2621. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2622. var subgrid_pager_id;
  2623. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2624. // (5)动态添加子报表的table和pager
  2625. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2626. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  2627. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2628. // (6)创建jqGrid对象
  2629. $("#" + subgrid_table_id).dataGrid({
  2630. cellEdit: true,
  2631. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2632. //colModel: [
  2633. // { label: "主键", name: "ID", hidden: true, key: true },
  2634. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2635. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2636. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2637. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2638. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2639. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2640. //],
  2641. colModel: _Clos1,
  2642. //colModel: ColModelSub,
  2643. shrinkToFit: true,//宽度自适应
  2644. //multiselect: true,
  2645. prmNames: { search: "search" },
  2646. viewrecords: true,
  2647. height: "100%",
  2648. rowNum: 20,
  2649. pager: subgrid_pager_id,
  2650. });
  2651. }
  2652. function gridList16() {
  2653. var $gridList = $("#gridList");
  2654. var queryJson = {
  2655. POCode: $("#txt_POCode").val(),
  2656. InvCode: $("#txt_InvCode").val(),
  2657. InvName: $("#txt_InvName").val(),
  2658. BatchCode: $("#txt_BatchCode").val(),
  2659. Area: $("#txt_Area").val(),
  2660. Container: $("#txt_Container :checked").val(),
  2661. }
  2662. $gridList.dataGrid({
  2663. url: "/WMS/WMSCreateItemLot/GetGridJsonFGGD" + "?" + Math.random(),
  2664. postData: { queryJson: JSON.stringify(queryJson) },
  2665. height: $(window).height() - 200,
  2666. width: $(window).width() - 300,
  2667. colModel: _Clos,
  2668. //colModel: [
  2669. // { label: "主键", name: "ID", hidden: true, key: true },
  2670. // { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  2671. // { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  2672. // { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  2673. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  2674. // { label: '物料描述', name: 'InvName', width: 60, align: 'left', },
  2675. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  2676. // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  2677. // { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  2678. // { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  2679. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  2680. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2681. // { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  2682. // { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  2683. //],
  2684. //colModel: ColModelMain,
  2685. width: "100%",
  2686. autowidth: true,
  2687. //shrinkToFit: true,
  2688. gridComplete: function () {
  2689. if (ChosenList != "") {
  2690. var Chosen = ChosenList.split(',');
  2691. for (var i = 0; i < Chosen.length; i++) {
  2692. $("#gridList").jqGrid('setSelection', Chosen[i]);
  2693. }
  2694. }
  2695. },
  2696. pager: "#gridPager",
  2697. sortname: 'MOCode',
  2698. sortorder: "desc",
  2699. viewrecords: true,
  2700. multiselect: true,
  2701. beforeSelectRow: function (rowid, e) {
  2702. },
  2703. subGrid: true, // (1)开启子表格支持
  2704. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  2705. $("#gridList").jqGrid("setSelection", rowid, false);
  2706. bindSubGrid16(subgrid_id, rowid)
  2707. }
  2708. });
  2709. $("#warehouse a.btn-default").click(function () {
  2710. $("#warehouse a.btn-default").removeClass("active");
  2711. $(this).addClass("active");
  2712. $('#btn_search').trigger("click");
  2713. });
  2714. $("#btn_search").click(function () {
  2715. var warehouse = $("#warehouse a.active").attr('data-value');
  2716. var queryJson = {
  2717. POCode: $("#txt_POCode").val(),
  2718. InvCode: $("#txt_InvCode").val(),
  2719. InvName: $("#txt_InvName").val(),
  2720. BatchCode: $("#txt_BatchCode").val(),
  2721. Area: $("#txt_Area").val(),
  2722. Container: $("#txt_Container :checked").val(),
  2723. }
  2724. $gridList.jqGrid('setGridParam', {
  2725. page: 1,
  2726. postData: { queryJson: JSON.stringify(queryJson) },
  2727. }).trigger('reloadGrid');
  2728. });
  2729. }
  2730. function bindSubGrid16(subgrid_id, rowid) {
  2731. $("#gridList").jqGrid("setSelection", rowid, false);
  2732. var subgrid_table_id;
  2733. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  2734. var subgrid_pager_id;
  2735. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  2736. // (5)动态添加子报表的table和pager
  2737. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  2738. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  2739. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  2740. // (6)创建jqGrid对象
  2741. $("#" + subgrid_table_id).dataGrid({
  2742. cellEdit: true,
  2743. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  2744. //colModel: [
  2745. // { label: "主键", name: "ID", hidden: true, key: true },
  2746. // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  2747. // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  2748. // { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  2749. // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  2750. // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  2751. // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  2752. //],
  2753. colModel: _Clos1,
  2754. //colModel: ColModelSub,
  2755. shrinkToFit: true,//宽度自适应
  2756. //multiselect: true,
  2757. prmNames: { search: "search" },
  2758. viewrecords: true,
  2759. height: "100%",
  2760. rowNum: 20,
  2761. pager: subgrid_pager_id,
  2762. });
  2763. }
  2764. function btnDelete() {
  2765. var objArr = '';
  2766. var obj = $("#gridList").jqGrid("getRowData");
  2767. for (var i = 0; i < obj.length; i++) {
  2768. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  2769. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  2770. if (rowData != "undefined" && rowData != null) {
  2771. for (var j = 0; j < rowData.length; j++) {
  2772. objArr += "'" + rowData[j] + "',";
  2773. }
  2774. }
  2775. }
  2776. if (objArr == "") {
  2777. $.modalAlertNew("WMS00099");
  2778. return;
  2779. }
  2780. $.deleteForm({
  2781. url: "/WMS/WMSCreateItemLot/DeleteItemLot",
  2782. param: { keyValue: JSON.stringify(objArr) },
  2783. success: function () {
  2784. $.currentWindow().$("#gridList").trigger("reloadGrid");
  2785. }
  2786. })
  2787. }
  2788. function btnCreate() {
  2789. debugger;
  2790. var PoStatus;
  2791. var jsonData = '';
  2792. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  2793. if (ids.length != 1) {
  2794. $.modalAlertNew("WMS00111");
  2795. return;
  2796. }
  2797. var POCode = "";
  2798. var PORow = "";
  2799. ChosenList = "";
  2800. for (var i in ids) {
  2801. if (ChosenList == "") {
  2802. ChosenList = $("#gridList").jqGrid('getRowData', ids[i]).ID;
  2803. }
  2804. else {
  2805. ChosenList += "," + $("#gridList").jqGrid('getRowData', ids[i]).ID;
  2806. }
  2807. }
  2808. if (Type == '1') {
  2809. for (var i in ids) {
  2810. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  2811. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2812. }
  2813. $.modalOpen({
  2814. id: "FormAddItemLot",
  2815. title: "生产退料条码生成",
  2816. url: "/WMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 1 + "&" + Math.random(),
  2817. width: "550px",
  2818. height: "1000px",
  2819. callBack: function (iframeId) {
  2820. top.frames[iframeId].submitForm();
  2821. }
  2822. });
  2823. } else if (Type == '2') {
  2824. for (var i in ids) {
  2825. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  2826. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2827. }
  2828. $.modalOpen({
  2829. id: "FormAddItemLot",
  2830. title: "委外退料条码生成",
  2831. url: "/WMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 2 + "&" + Math.random(),
  2832. width: "550px",
  2833. height: "1000px",
  2834. callBack: function (iframeId) {
  2835. top.frames[iframeId].submitForm();
  2836. }
  2837. });
  2838. } else if (Type == '3') {
  2839. for (var i in ids) {
  2840. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  2841. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  2842. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2843. }
  2844. $.modalOpen({
  2845. id: "FormAddItemLot",
  2846. title: "成品条码产生",
  2847. url: "/WMS/WMSCreateItemLot/From?MOCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&" + Math.random(),
  2848. width: "550px",
  2849. height: "1000px",
  2850. callBack: function (iframeId) {
  2851. top.frames[iframeId].submitForm();
  2852. }
  2853. });
  2854. } else if (Type == '4') {
  2855. for (var i in ids) {
  2856. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  2857. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2858. }
  2859. $.modalOpen({
  2860. id: "FormAddItemLot",
  2861. title: "销售退货条码产生",
  2862. url: "/WMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + 4 + "&" + Math.random(),
  2863. width: "550px",
  2864. height: "1000px",
  2865. callBack: function (iframeId) {
  2866. top.frames[iframeId].submitForm();
  2867. }
  2868. });
  2869. } else if (Type == '5') {
  2870. for (var i in ids) {
  2871. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  2872. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2873. }
  2874. $.modalOpen({
  2875. id: "FormAddItemLot",
  2876. title: "其他入库条码产生",
  2877. url: "/WMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + 5 + "&" + Math.random(),
  2878. width: "550px",
  2879. height: "1000px",
  2880. callBack: function (iframeId) {
  2881. top.frames[iframeId].submitForm();
  2882. }
  2883. });
  2884. } else if (Type == '6') {
  2885. for (var i in ids) {
  2886. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  2887. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2888. }
  2889. $.modalOpen({
  2890. id: "FormAddItemLot",
  2891. title: "归还单条码产生",
  2892. url: "/WMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + 6 + "&" + Math.random(),
  2893. width: "550px",
  2894. height: "1000px",
  2895. callBack: function (iframeId) {
  2896. top.frames[iframeId].submitForm();
  2897. }
  2898. });
  2899. } else if (Type == '7') {
  2900. for (var i in ids) {
  2901. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  2902. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2903. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  2904. if (AreaType == "货柜") {
  2905. $.modalAlertNew("WMS00112");
  2906. return;
  2907. }
  2908. }
  2909. $.modalOpen({
  2910. id: "FormAddItemLot",
  2911. title: "审核到货单生成条码",
  2912. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 7 + "&" + Math.random(),
  2913. width: "550px",
  2914. height: "1000px",
  2915. callBack: function (iframeId) {
  2916. top.frames[iframeId].submitForm();
  2917. }
  2918. });
  2919. } else if (Type == '8') {
  2920. for (var i in ids) {
  2921. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  2922. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2923. }
  2924. $.modalOpen({
  2925. id: "FormAddItemLot",
  2926. title: "审核委外到货单生成条码",
  2927. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 8 + "&" + Math.random(),
  2928. width: "550px",
  2929. height: "1000px",
  2930. callBack: function (iframeId) {
  2931. top.frames[iframeId].submitForm();
  2932. }
  2933. });
  2934. } else if (Type == '9') {
  2935. for (var i in ids) {
  2936. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  2937. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2938. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  2939. if (AreaType == "货柜") {
  2940. $.modalAlertNew("WMS00112");
  2941. return;
  2942. }
  2943. }
  2944. $.modalOpen({
  2945. id: "FormAddItemLot",
  2946. title: "开立成品入库单生成条码",
  2947. url: "/WMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + 9 + "&" + Math.random(),
  2948. width: "550px",
  2949. height: "1000px",
  2950. callBack: function (iframeId) {
  2951. top.frames[iframeId].submitForm();
  2952. }
  2953. });
  2954. } else if (Type == '10') {
  2955. for (var i in ids) {
  2956. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  2957. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2958. }
  2959. $.modalOpen({
  2960. id: "FormAddItemLot",
  2961. title: "审核拒收单生成条码",
  2962. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 10 + "&" + Math.random(),
  2963. width: "550px",
  2964. height: "1000px",
  2965. callBack: function (iframeId) {
  2966. top.frames[iframeId].submitForm();
  2967. }
  2968. });
  2969. } else if (Type == '11') {
  2970. for (var i in ids) {
  2971. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).OOCode;
  2972. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).OOSequence;
  2973. }
  2974. $.modalOpen({
  2975. id: "FormAddItemLot",
  2976. title: "审核委外拒收单生成条码",
  2977. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 11 + "&" + Math.random(),
  2978. width: "550px",
  2979. height: "1000px",
  2980. callBack: function (iframeId) {
  2981. top.frames[iframeId].submitForm();
  2982. }
  2983. });
  2984. } else if (Type == '12') {
  2985. for (var i in ids) {
  2986. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  2987. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  2988. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  2989. if (AreaType == "货柜") {
  2990. $.modalAlertNew("WMS00112");
  2991. return;
  2992. }
  2993. }
  2994. $.modalOpen({
  2995. id: "FormAddItemLot",
  2996. title: "审核领料申请退料生成条码",
  2997. url: "/WMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 12 + "&" + Math.random(),
  2998. width: "550px",
  2999. height: "1000px",
  3000. callBack: function (iframeId) {
  3001. top.frames[iframeId].submitForm();
  3002. }
  3003. });
  3004. } else if (Type == '13') {
  3005. for (var i in ids) {
  3006. CLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  3007. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3008. }
  3009. $.modalOpen({
  3010. id: "FormAddItemLot",
  3011. title: "材料出库退料生成条码",
  3012. url: "/WMS/WMSCreateItemLot/From?CLApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 13 + "&" + Math.random(),
  3013. width: "550px",
  3014. height: "1000px",
  3015. callBack: function (iframeId) {
  3016. top.frames[iframeId].submitForm();
  3017. }
  3018. });
  3019. } else if (Type == '14') {
  3020. for (var i in ids) {
  3021. WWLLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  3022. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3023. }
  3024. $.modalOpen({
  3025. id: "FormAddItemLot",
  3026. title: "委外领料退料条码生成",
  3027. url: "/WMS/WMSCreateItemLot/From?WWLLOApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 14 + "&" + Math.random(),
  3028. width: "550px",
  3029. height: "1000px",
  3030. callBack: function (iframeId) {
  3031. top.frames[iframeId].submitForm();
  3032. }
  3033. });
  3034. }
  3035. else if (Type == '15') {
  3036. for (var i in ids) {
  3037. WWCLOApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  3038. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3039. }
  3040. $.modalOpen({
  3041. id: "FormAddItemLot",
  3042. title: "委外材料出库退料生成条码",
  3043. url: "/WMS/WMSCreateItemLot/From?WWCLOApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 15 + "&" + Math.random(),
  3044. width: "550px",
  3045. height: "1000px",
  3046. callBack: function (iframeId) {
  3047. top.frames[iframeId].submitForm();
  3048. }
  3049. });
  3050. }
  3051. else if (Type == '16') {
  3052. for (var i in ids) {
  3053. FGGDMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  3054. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  3055. }
  3056. $.modalOpen({
  3057. id: "FormAddItemLot",
  3058. title: "返工工单生成条码",
  3059. url: "/WMS/WMSCreateItemLot/From?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&Type=" + 16 + "&" + Math.random(),
  3060. width: "550px",
  3061. height: "1000px",
  3062. callBack: function (iframeId) {
  3063. top.frames[iframeId].submitForm();
  3064. }
  3065. });
  3066. }
  3067. }
  3068. function fullscreen() {
  3069. var docElm = document.documentElement;
  3070. if (docElm.requestFullscreen) {
  3071. docElm.requestFullscreen();
  3072. } else if (docElm.mozRequestFullScreen) {
  3073. docElm.mozRequestFullScreen();
  3074. } else if (docElm.webkitRequestFullScreen) {
  3075. docElm.webkitRequestFullScreen();
  3076. } else if (docElm.msRequestFullscreen) {
  3077. docElm.msRequestFullscreen();
  3078. }
  3079. $(window).bind('resize', function () {
  3080. $("#gridList").setGridWidth($(window).width());
  3081. }).trigger('resize');
  3082. $(window).bind('resize', function () {
  3083. $("#gridList").setGridHeight($(window).height());
  3084. }).trigger('resize');
  3085. }
  3086. function btnPrint() {
  3087. debugger;
  3088. var mold = '';
  3089. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  3090. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  3091. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  3092. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  3093. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  3094. if (Type == '6') { mold = '00006'; }//归还单生成条码
  3095. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  3096. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  3097. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  3098. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  3099. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  3100. if (Type == '12') { mold = '00012'; }//领料申请退料
  3101. if (Type == '13') { mold = '00013'; }//材料出库退料
  3102. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  3103. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  3104. if (Type == '16') { mold = '00016'; }//返工工单
  3105. var objArr = '';
  3106. var arr = [];
  3107. var obj = $("#gridList").jqGrid("getRowData");
  3108. for (var i = 0; i < obj.length; i++) {
  3109. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  3110. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  3111. if (rowData != "undefined" && rowData != null) {
  3112. for (var j = 0; j < rowData.length; j++) {
  3113. objArr += "'" + rowData[j] + "',";
  3114. }
  3115. objArr = objArr.slice(0, objArr.length - 1);
  3116. objArr = "" + objArr + "|";
  3117. arr.push(objArr);
  3118. }
  3119. }
  3120. if (objArr == "") {
  3121. $.modalAlertNew("WMS00101");
  3122. return;
  3123. }
  3124. $.modalOpen({
  3125. id: "PrintLot",
  3126. title: "打印",
  3127. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  3128. width: "550px",
  3129. height: "1000px",
  3130. callBack: function (iframeId) {
  3131. top.frames[iframeId].submitForm();
  3132. }
  3133. });
  3134. }
  3135. function btnBatchPrint() {
  3136. debugger;
  3137. var mold = '';
  3138. var objArr = '';
  3139. var arr = [];
  3140. var obj = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  3141. mold = '00016';
  3142. for (var i = 0; i < obj.length; i++) {
  3143. var rowId = obj[i];
  3144. if (rowId != "undefined" && rowId != null) {
  3145. //if (i == obj.length - 1 || i==0) {
  3146. objArr = "'" + rowId + "'|";
  3147. //}
  3148. //else
  3149. //{
  3150. /* objArr = "'" + rowId + "',|";*/
  3151. //}
  3152. arr.push(objArr);
  3153. }
  3154. }
  3155. if (objArr == "") {
  3156. $.modalAlertNew("WMS00101");
  3157. return;
  3158. }
  3159. $.modalOpen({
  3160. id: "PrintLot",
  3161. title: "打印",
  3162. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  3163. width: "550px",
  3164. height: "1000px",
  3165. callBack: function (iframeId) {
  3166. top.frames[iframeId].submitForm();
  3167. }
  3168. });
  3169. }
  3170. function btnCallHG() {
  3171. var DocNOList = "";
  3172. if ($("#txt_Container :checked").val() == '1') {
  3173. $.modalAlertNew("WMS00114");
  3174. return;
  3175. }
  3176. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  3177. if (ids.length == 0) {
  3178. $.modalAlertNew("WMS00110");
  3179. return;
  3180. }
  3181. if (Type == '7') {
  3182. for (var i in ids) {
  3183. DocNOList += $("#gridList").jqGrid('getRowData', ids[i]).DNCode + ',';
  3184. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  3185. if (AreaType == "平库") {
  3186. $.modalAlertNew("WMS00113");
  3187. return;
  3188. }
  3189. }
  3190. }
  3191. else if (Type == '9') {
  3192. for (var i in ids) {
  3193. DocNOList += $("#gridList").jqGrid('getRowData', ids[i]).RCVCode + ',';
  3194. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  3195. if (AreaType == "平库") {
  3196. $.modalAlertNew("WMS00113");
  3197. return;
  3198. }
  3199. }
  3200. }
  3201. else if (Type == '12') {
  3202. for (var i in ids) {
  3203. DocNOList += $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode + ',';
  3204. var AreaType = $("#gridList").jqGrid('getRowData', ids[i]).AreaType;
  3205. if (AreaType == "平库") {
  3206. $.modalAlertNew("WMS00113");
  3207. return;
  3208. }
  3209. }
  3210. }
  3211. if (DocNOList != "") {
  3212. $.modalConfirm("确定上传货柜吗?", function (r) {
  3213. if (r) {
  3214. $.submitForm({
  3215. url: "/WMS/WMSCreateItemLot/DocUpLoadToHG?DocNoList=" + DocNOList + "&Type=" + Type,
  3216. async: false,
  3217. success: function () {
  3218. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3219. }
  3220. })
  3221. }
  3222. });
  3223. }
  3224. }
  3225. function btnBatchCreate() {
  3226. debugger;
  3227. $("#PickID").val('');
  3228. var sign = '';
  3229. var objID = '';
  3230. var status = '';
  3231. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  3232. if (objList.length <= 0) {
  3233. $.modalAlert("请先选择单据!", "warning");
  3234. return;
  3235. }
  3236. for (var i = 0; i < objList.length; i++) {
  3237. var AreaType = $("#gridList").jqGrid('getRowData', objList[i]).AreaType;
  3238. if (AreaType == "货柜") {
  3239. $.modalAlertNew("WMS00112");
  3240. return;
  3241. }
  3242. /*var rowData = $("#gridList").jqGrid('getRowData', rowId);获取数据*/
  3243. if (objList[i] != undefined) {
  3244. objID += "'" + objList[i] + "',";
  3245. }
  3246. //objArr = "" + objArr + "|";
  3247. //arr.push(objArr);
  3248. }
  3249. objID = objID.substring(0, objID.length - 1);
  3250. if (Type == '7') {
  3251. $.ajax({
  3252. url: "/WMS/WMSCreateItemLot/SubmitSHDH?ids=" + objID,
  3253. dataType: "json",
  3254. type: "post",
  3255. async: false,
  3256. param: {
  3257. keyValue: JSON.stringify(objID)
  3258. },
  3259. success: function (data) {
  3260. if (data.state == "success") {
  3261. $.modalMsg(data.message, data.state);
  3262. } else {
  3263. $.modalAlert(data.message, data.state);
  3264. }
  3265. $.currentwindow().$("#gridlist").trigger("reloadgrid");
  3266. }
  3267. });
  3268. }
  3269. if (Type == '9') {
  3270. $.ajax({
  3271. url: "/WMS/WMSCreateItemLot/SubmitKLCPRK?ids=" + objID,
  3272. dataType: "json",
  3273. type: "post",
  3274. async: false,
  3275. param: {
  3276. keyValue: JSON.stringify(objID)
  3277. },
  3278. success: function (data) {
  3279. if (data.state == "success") {
  3280. $.modalMsg(data.message, data.state);
  3281. } else {
  3282. $.modalAlert(data.message, data.state);
  3283. }
  3284. $.currentWindow().$("#gridList").trigger("reloadGrid");
  3285. }
  3286. });
  3287. }
  3288. if (sign != '') {
  3289. $.modalAlertNew('', sign,);
  3290. return;
  3291. }
  3292. }
  3293. function GetBatchStockInLocation() {
  3294. $.ajax({
  3295. url: "/WMS/WMSCreateItemLot/GetBatchStockInLocation",
  3296. dataType: "json",
  3297. type: "post",
  3298. async: false,
  3299. success: function (data) {
  3300. if (data.state == "success") {
  3301. BatchStockInArea = data.message;
  3302. } else {
  3303. BatchStockInArea = "";
  3304. }
  3305. }
  3306. });
  3307. }
  3308. function btnBatchStockIN() {
  3309. debugger;
  3310. $("#PickID").val('');
  3311. var sign = '';
  3312. var objID = '';
  3313. var status = '';
  3314. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  3315. if (objList.length <= 0) {
  3316. $.modalAlert("请先选择单据!", "warning");
  3317. return;
  3318. }
  3319. if (BatchStockInArea == "") {
  3320. $.modalAlert("尚未维护可以使用批量入库的区域范围,无法使用批量入库功能!", "warning");
  3321. return;
  3322. }
  3323. for (var i = 0; i < objList.length; i++) {
  3324. var ChosenLocation = $("#gridList").jqGrid('getRowData', objList[i]).Area;
  3325. if (!BatchStockInArea.includes(ChosenLocation)) {
  3326. $.modalAlert("选择的单据不满足批量入库的区域条件,无法使用批量入库!", "warning");
  3327. return;
  3328. }
  3329. if ($("#gridList").jqGrid('getRowData', objList[i]).LOTQTY != '0' && $("#gridList").jqGrid('getRowData', objList[i]).LOTQTY != '') {
  3330. $.modalAlert("单据:" + $("#gridList").jqGrid('getRowData', objList[i]).DNCode + "已生成条码,无法使用批量入库!", "warning");
  3331. return;
  3332. }
  3333. /*var rowData = $("#gridList").jqGrid('getRowData', rowId);获取数据*/
  3334. if (objList[i] != undefined) {
  3335. objID += "'" + objList[i] + "',";
  3336. }
  3337. }
  3338. objID = objID.substring(0, objID.length - 1);
  3339. var InBinCode = "";
  3340. if (Type == '7') {
  3341. $.modalOpen({
  3342. id: "FormAddItemLot",
  3343. title: "请输入批量入库库位",
  3344. url: "/WMS/WMSCreateItemLot/BinFrom?ids=" + objID + "&" + Math.random(),
  3345. width: "350px",
  3346. height: "200px",
  3347. callBack: function (iframeId) {
  3348. top.frames[iframeId].submitForm();
  3349. }
  3350. });
  3351. //$.ajax({
  3352. // url: "/WMS/WMSCreateItemLot/BatchStockIN?ids=" + objID,
  3353. // dataType: "json",
  3354. // type: "post",
  3355. // async: false,
  3356. // param: {
  3357. // keyValue: JSON.stringify(objID)
  3358. // },
  3359. // success: function (data) {
  3360. // if (data.state == "success") {
  3361. // $.modalMsg(data.message, data.state);
  3362. // } else {
  3363. // $.modalAlert(data.message, data.state);
  3364. // }
  3365. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  3366. // }
  3367. //});
  3368. }
  3369. if (sign != '') {
  3370. $.modalAlertNew('', sign,);
  3371. return;
  3372. }
  3373. }
  3374. </script>
  3375. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  3376. <script>
  3377. //function btnPrint() {
  3378. // var objArr = '';
  3379. // var obj = $("#gridList").jqGrid("getRowData");
  3380. // for (var i = 0; i < obj.length; i++) {
  3381. // var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  3382. // var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  3383. // if (rowData != "undefined" && rowData != null) {
  3384. // for (var j = 0; j < rowData.length; j++) {
  3385. // objArr += "'" + /rowData[j] + "',";
  3386. // }
  3387. // }
  3388. // }
  3389. // if (objArr == "") {
  3390. // $.modalAlert("请选择子表数据打印!");
  3391. // return;
  3392. // }
  3393. // var strPrintData;
  3394. // var bIsInstallPrintControl;
  3395. // var strPrintControlCookie;
  3396. // $.ajax({
  3397. // url: "/WMS/WMSCreateItemLot/PrintItemLot?Type=" + Type,
  3398. // type: "post",
  3399. // data: { keyValue: JSON.stringify(objArr) },
  3400. // dataType: "json",
  3401. // async: false,
  3402. // success: function (data) {
  3403. // strPrintData = data.strPrintData_1;
  3404. // bIsInstallPrintControl = data.bIsInstallPrintControl_1;
  3405. // strPrintControlCookie = data.strPrintControlCookie_1;
  3406. // }
  3407. // });
  3408. // if (strPrintData != '') {
  3409. // var test = "ChuLinPrint:" + strPrintData;
  3410. // $("#ifrm")[0].src = "ChuLinPrint:" + strPrintData;
  3411. // }
  3412. // if (bIsInstallPrintControl == 'False') {
  3413. // if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  3414. // $("#downPrintControl").click();
  3415. // }
  3416. // }
  3417. // if (bIsInstallPrintControl == 'True') {
  3418. // var strPrintControlCookie = strPrintControlCookie;
  3419. // if (strPrintControlCookie != '') { //延时3秒后再次检测打印控件是否安装
  3420. // setTimeout("checkPrintControlInstall()", 8000);
  3421. // function checkPrintControlInstall() {
  3422. // $.ajax({
  3423. // url: "/WMS/WMSCreateItemLot/IsCheckInstall?checkInstall=" + strPrintControlCookie,
  3424. // dataType: "json",
  3425. // async: false,
  3426. // success: function (strResult) {
  3427. // if (strResult.indexOf("PrintControlInstall") == -1) {
  3428. // if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  3429. // $("#downPrintControl").click();
  3430. // }
  3431. // }
  3432. // }
  3433. // });
  3434. // }
  3435. // }
  3436. // }
  3437. // $("#btn_search").click();
  3438. //}
  3439. </script>
  3440. <div class="topPanel" style="height:150px;">
  3441. <div class="toolbar">
  3442. <div class="btn-group">
  3443. <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>
  3444. <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>
  3445. <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>
  3446. <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>
  3447. <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>
  3448. <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>
  3449. <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>
  3450. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  3451. </div>
  3452. <div class="btn-group" style="display:block;padding-left:2px;">
  3453. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  3454. </div>
  3455. <script>$('.toolbar').authorizeButton()</script>
  3456. </div>
  3457. <div class="search">
  3458. <table>
  3459. <tr>
  3460. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  3461. <td>
  3462. <div class="input-group">
  3463. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  3464. </div>
  3465. </td>
  3466. <td style="text-align:right;" class=" txt_DNID1"><label class="lglabel" for="txt_DNID">&nbsp;&nbsp;&nbsp;&nbsp;采购订单号</label>:</td>
  3467. <td class=" txt_DNID1">
  3468. <div class="input-group">
  3469. <input id="txt_DNID" type="text" class="form-control" style="width: 100px;">
  3470. </div>
  3471. </td>
  3472. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  3473. <td class="HideItems">
  3474. <div class="input-group HideItems">
  3475. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  3476. </div>
  3477. </td>
  3478. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  3479. <td class="HideItems">
  3480. <div class="input-group HideItems">
  3481. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  3482. </div>
  3483. </td>
  3484. <td style="text-align:right;"><label class="lglabel " for="txt_Area">&nbsp;&nbsp;&nbsp;&nbsp;区域</label>:</td>
  3485. <td>
  3486. <div class="input-group ">
  3487. <input id="txt_Area" type="text" class="form-control " style="width: 100px;">
  3488. </div>
  3489. </td>
  3490. <td class="Workorder" style="text-align:right;"><label class="lglabel " for="txt_OrderNumber">&nbsp;&nbsp;&nbsp;&nbsp;生产订单</label>:</td>
  3491. <td class="Workorder">
  3492. <div class="input-group ">
  3493. <input id="txt_OrderNumber" type="text" class="form-control " style="width: 100px;">
  3494. </div>
  3495. </td>
  3496. @*<td class="Workorder" style="text-align:right;"><label class="lglabel " for="txt_Area9">&nbsp;&nbsp;&nbsp;&nbsp;存储区域</label>:</td>
  3497. <td class="Workorder" >
  3498. <div class="input-group ">
  3499. <input id="txt_Area9" type="text" class="form-control " style="width: 100px;">
  3500. </div>
  3501. </td>*@
  3502. </tr>
  3503. <tr>
  3504. <td style="text-align:right;"><label class="lglabel " for="txt_Location">&nbsp;&nbsp;&nbsp;&nbsp;仓库</label>:</td>
  3505. <td>
  3506. <div class="input-group ">
  3507. <input id="txt_Location" type="text" class="form-control " style="width: 100px;">
  3508. </div>
  3509. </td>
  3510. @*<td style="text-align:right;"><label class="lglabel" for="txt_Location">&nbsp;&nbsp;&nbsp;&nbsp;库存地点</label>:</td>
  3511. <td>
  3512. <div class="input-group">
  3513. <input id="txt_Location" type="text" class="form-control" style="width: 100px;">
  3514. </div>
  3515. </td>*@
  3516. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  3517. <td>
  3518. <div class="input-group">
  3519. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  3520. </div>
  3521. </td>
  3522. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料描述</label>:</td>
  3523. <td>
  3524. <div class="input-group">
  3525. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  3526. </div>
  3527. </td>
  3528. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  3529. <td>
  3530. <div class="input-group">
  3531. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  3532. </div>
  3533. </td>
  3534. <td>
  3535. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否入库:</label>
  3536. </td>
  3537. <td>
  3538. <div class="input-group" id="txt_Container">
  3539. <input type="radio" name="container" value="1" />&nbsp;是
  3540. <input type="radio" name="container" checked="checked" value="2" />&nbsp;否
  3541. </div>
  3542. </td>
  3543. <td>
  3544. <span class="input-group-btn">
  3545. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  3546. </span>
  3547. </td>
  3548. </tr>
  3549. </table>
  3550. </div>
  3551. </div>
  3552. <div class="gridPanel">
  3553. <table id="gridList"></table>
  3554. <div id="gridPager"></div>
  3555. </div>