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

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