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

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