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

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