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

1879 lines
88 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
3 years ago
3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. debugger;
  7. var Type = $.request("Type");
  8. var ColModelMain = [];
  9. var ColModelSub = [];
  10. $(function () {
  11. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9') {
  12. $(".HideItems").css('display', 'none');
  13. }
  14. if (Type=='1') {
  15. gridList();
  16. }
  17. if (Type=='2') {
  18. gridList2();
  19. }
  20. if (Type == '3') {
  21. gridList3();
  22. }
  23. if (Type == '4') {
  24. gridList4();
  25. }
  26. if (Type == '5') {
  27. gridList5();
  28. }
  29. if (Type == '6') {
  30. gridList6();
  31. }
  32. //审核到货单生成条码
  33. if (Type == '7') {
  34. gridList7();
  35. }
  36. //审核委外到货单生成条码
  37. if (Type == '8') {
  38. gridList8();
  39. }
  40. //开立成品入库单生成条码
  41. if (Type == '9') {
  42. gridList9();
  43. }
  44. //审核拒收单生成条码
  45. if (Type == '10') {
  46. gridList10();
  47. }
  48. //审核委外拒收单生成条码
  49. if (Type == '11') {
  50. gridList11();
  51. }
  52. })
  53. //生产退料
  54. function gridList() {
  55. var $gridList = $("#gridList");
  56. var queryJson = {
  57. POCode: $("#txt_POCode").val(),
  58. InvCode: $("#txt_InvCode").val(),
  59. InvName: $("#txt_InvName").val(),
  60. BatchCode: $("#txt_BatchCode").val(),
  61. }
  62. $gridList.dataGrid({
  63. url: "/WMS/WMSCreateItemLot/GetGridJson" + "?" + Math.random(),
  64. postData: { queryJson: JSON.stringify(queryJson) },
  65. height: $(window).height() - 200,
  66. width: $(window).width() - 300,
  67. colModel: [
  68. { label: "主键", name: "ID", hidden: true, key: true },
  69. { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  70. { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  71. { label: '工单子件', name: 'SourceDetailID', hidden: true, },
  72. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  73. { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  74. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  75. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  76. { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  77. { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  78. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  79. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  80. { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  81. ],
  82. //colModel: ColModelMain,
  83. width: "100%",
  84. autowidth: true,
  85. //shrinkToFit: true,
  86. gridComplete: function () {
  87. },
  88. pager: "#gridPager",
  89. sortname: 'ApplyNegCode',
  90. sortorder: "desc",
  91. viewrecords: true,
  92. multiselect: true,
  93. beforeSelectRow: function (rowid, e) {
  94. $("#gridList").jqGrid('resetSelection');
  95. return (true);
  96. },
  97. subGrid: true, // (1)开启子表格支持
  98. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  99. $("#gridList").jqGrid("setSelection", rowid, false);
  100. bindSubGrid(subgrid_id, rowid)
  101. }
  102. });
  103. $("#warehouse a.btn-default").click(function () {
  104. $("#warehouse a.btn-default").removeClass("active");
  105. $(this).addClass("active");
  106. $('#btn_search').trigger("click");
  107. });
  108. $("#btn_search").click(function () {
  109. var warehouse = $("#warehouse a.active").attr('data-value');
  110. var queryJson = {
  111. POCode: $("#txt_POCode").val(),
  112. InvCode: $("#txt_InvCode").val(),
  113. InvName: $("#txt_InvName").val(),
  114. BatchCode: $("#txt_BatchCode").val(),
  115. }
  116. $gridList.jqGrid('setGridParam', {
  117. postData: { queryJson: JSON.stringify(queryJson) },
  118. }).trigger('reloadGrid');
  119. });
  120. }
  121. function bindSubGrid(subgrid_id, rowid) {
  122. $("#gridList").jqGrid("setSelection", rowid, false);
  123. var subgrid_table_id;
  124. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  125. var subgrid_pager_id;
  126. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  127. // (5)动态添加子报表的table和pager
  128. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  129. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  130. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  131. // (6)创建jqGrid对象
  132. $("#" + subgrid_table_id).dataGrid({
  133. cellEdit: true,
  134. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  135. colModel: [
  136. { label: "主键", name: "ID", hidden: true, key: true },
  137. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  138. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  139. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  140. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  141. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  142. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  143. ],
  144. //colModel: ColModelSub,
  145. shrinkToFit: true,//宽度自适应
  146. multiselect: true,
  147. prmNames: { search: "search" },
  148. viewrecords: true,
  149. height: "100%",
  150. rowNum: 20,
  151. pager: subgrid_pager_id,
  152. });
  153. }
  154. //委外退料
  155. function gridList2() {
  156. var $gridList = $("#gridList");
  157. var queryJson = {
  158. POCode: $("#txt_POCode").val(),
  159. InvCode: $("#txt_InvCode").val(),
  160. InvName: $("#txt_InvName").val(),
  161. BatchCode: $("#txt_BatchCode").val(),
  162. }
  163. $gridList.dataGrid({
  164. url: "/WMS/WMSCreateItemLot/GetGridJsonWeiWai" + "?" + Math.random(),
  165. postData: { queryJson: JSON.stringify(queryJson) },
  166. height: $(window).height() - 200,
  167. width: $(window).width() - 300,
  168. colModel: [
  169. { label: "主键", name: "ID", hidden: true, key: true },
  170. { label: '退料单号', name: 'OApplyNegCode', width: 120, align: 'left' },
  171. { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  172. { label: '来源单据ID', name: 'SourceDetailID', hidden: true, },
  173. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  174. { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  175. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  176. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  177. { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  178. { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  179. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  180. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  181. { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  182. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  183. ],
  184. //colModel: ColModelMain,
  185. width: "100%",
  186. autowidth: true,
  187. //shrinkToFit: true,
  188. gridComplete: function () {
  189. },
  190. pager: "#gridPager",
  191. sortname: 'OApplyNegCode',
  192. sortorder: "desc",
  193. viewrecords: true,
  194. multiselect: true,
  195. beforeSelectRow: function (rowid, e) {
  196. $("#gridList").jqGrid('resetSelection');
  197. return (true);
  198. },
  199. subGrid: true, // (1)开启子表格支持
  200. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  201. $("#gridList").jqGrid("setSelection", rowid, false);
  202. bindSubGrid2(subgrid_id, rowid)
  203. }
  204. });
  205. $("#warehouse a.btn-default").click(function () {
  206. $("#warehouse a.btn-default").removeClass("active");
  207. $(this).addClass("active");
  208. $('#btn_search').trigger("click");
  209. });
  210. $("#btn_search").click(function () {
  211. var warehouse = $("#warehouse a.active").attr('data-value');
  212. var queryJson = {
  213. POCode: $("#txt_POCode").val(),
  214. InvCode: $("#txt_InvCode").val(),
  215. InvName: $("#txt_InvName").val(),
  216. BatchCode: $("#txt_BatchCode").val(),
  217. }
  218. $gridList.jqGrid('setGridParam', {
  219. postData: { queryJson: JSON.stringify(queryJson) },
  220. }).trigger('reloadGrid');
  221. });
  222. }
  223. function bindSubGrid2(subgrid_id, rowid) {
  224. $("#gridList").jqGrid("setSelection", rowid, false);
  225. var subgrid_table_id;
  226. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  227. var subgrid_pager_id;
  228. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  229. // (5)动态添加子报表的table和pager
  230. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  231. var OApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).OApplyNegCode;
  232. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  233. // (6)创建jqGrid对象
  234. $("#" + subgrid_table_id).dataGrid({
  235. cellEdit: true,
  236. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  237. colModel: [
  238. { label: "主键", name: "ID", hidden: true, key: true },
  239. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  240. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  241. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  242. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  243. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  244. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  245. ],
  246. //colModel: ColModelSub,
  247. shrinkToFit: true,//宽度自适应
  248. multiselect: true,
  249. prmNames: { search: "search" },
  250. viewrecords: true,
  251. height: "100%",
  252. rowNum: 20,
  253. pager: subgrid_pager_id,
  254. });
  255. }
  256. //成品
  257. function gridList3() {
  258. var $gridList = $("#gridList");
  259. var queryJson = {
  260. POCode: $("#txt_POCode").val(),
  261. InvCode: $("#txt_InvCode").val(),
  262. InvName: $("#txt_InvName").val(),
  263. BatchCode: $("#txt_BatchCode").val(),
  264. }
  265. $gridList.dataGrid({
  266. url: "/WMS/WMSCreateItemLot/GetGridJsonChengPing" + "?" + Math.random(),
  267. postData: { queryJson: JSON.stringify(queryJson) },
  268. height: $(window).height() - 200,
  269. width: $(window).width() - 300,
  270. colModel: [
  271. { label: "主键", name: "ID", hidden: true, key: true },
  272. { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  273. { label: '工单行号', name: 'Sequence', width: 50, align: 'left' },
  274. { label: '已入库数量', name: 'RCVQuantity', hidden: true, },
  275. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  276. { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  277. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  278. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  279. {
  280. label: "状态", name: "MOStatus", width: 60, align: "left",
  281. formatter: function (cellvalue) {
  282. if (cellvalue == "1") {
  283. return "初始";
  284. } else if (cellvalue == "2") {
  285. return "下发";
  286. }
  287. else if (cellvalue == "3") {
  288. return "关单";
  289. }
  290. else { return ""; }
  291. }
  292. },
  293. { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  294. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  295. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  296. { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  297. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  298. ],
  299. //colModel: ColModelMain,
  300. width: "100%",
  301. autowidth: true,
  302. //shrinkToFit: true,
  303. gridComplete: function () {
  304. },
  305. pager: "#gridPager",
  306. sortname: 'MOCode',
  307. sortorder: "desc",
  308. viewrecords: true,
  309. multiselect: true,
  310. beforeSelectRow: function (rowid, e) {
  311. $("#gridList").jqGrid('resetSelection');
  312. return (true);
  313. },
  314. subGrid: true, // (1)开启子表格支持
  315. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  316. $("#gridList").jqGrid("setSelection", rowid, false);
  317. bindSubGrid3(subgrid_id, rowid)
  318. }
  319. });
  320. $("#warehouse a.btn-default").click(function () {
  321. $("#warehouse a.btn-default").removeClass("active");
  322. $(this).addClass("active");
  323. $('#btn_search').trigger("click");
  324. });
  325. $("#btn_search").click(function () {
  326. var warehouse = $("#warehouse a.active").attr('data-value');
  327. var queryJson = {
  328. POCode: $("#txt_POCode").val(),
  329. InvCode: $("#txt_InvCode").val(),
  330. InvName: $("#txt_InvName").val(),
  331. BatchCode: $("#txt_BatchCode").val(),
  332. }
  333. $gridList.jqGrid('setGridParam', {
  334. postData: { queryJson: JSON.stringify(queryJson) },
  335. }).trigger('reloadGrid');
  336. });
  337. }
  338. function bindSubGrid3(subgrid_id, rowid) {
  339. $("#gridList").jqGrid("setSelection", rowid, false);
  340. var subgrid_table_id;
  341. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  342. var subgrid_pager_id;
  343. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  344. // (5)动态添加子报表的table和pager
  345. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  346. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  347. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  348. // (6)创建jqGrid对象
  349. $("#" + subgrid_table_id).dataGrid({
  350. cellEdit: true,
  351. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  352. colModel: [
  353. { label: "主键", name: "ID", hidden: true, key: true },
  354. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  355. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  356. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  357. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  358. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  359. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  360. ],
  361. //colModel: ColModelSub,
  362. shrinkToFit: true,//宽度自适应
  363. multiselect: true,
  364. prmNames: { search: "search" },
  365. viewrecords: true,
  366. height: "100%",
  367. rowNum: 20,
  368. pager: subgrid_pager_id,
  369. });
  370. }
  371. //销售退货
  372. function gridList4() {
  373. var $gridList = $("#gridList");
  374. var queryJson = {
  375. POCode: $("#txt_POCode").val(),
  376. InvCode: $("#txt_InvCode").val(),
  377. InvName: $("#txt_InvName").val(),
  378. BatchCode: $("#txt_BatchCode").val(),
  379. }
  380. $gridList.dataGrid({
  381. url: "/WMS/WMSCreateItemLot/GetGridJsonXiaoShou" + "?" + Math.random(),
  382. postData: { queryJson: JSON.stringify(queryJson) },
  383. height: $(window).height() - 200,
  384. width: $(window).width() - 300,
  385. colModel: [
  386. { label: "主键", name: "ID", hidden: true, key: true },
  387. { label: '单据号', name: 'SDNCode', width: 120, align: 'left' },
  388. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  389. { label: '销售订单号', name: 'SOCode', width: 120, align: 'left' },
  390. { label: '销售订单行号', name: 'SOSequence', width: 50, align: 'left' },
  391. { label: '客户代码', name: 'CusCode', width: 120, align: 'left' },
  392. { label: '客户名称', name: 'CusName', width: 50, align: 'left' },
  393. { label: '发货日期', name: 'ArriveDate', width: 150, align: 'left' },
  394. { label: '已发数量', name: 'SDNQuantity', width: 50, align: 'left' },
  395. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  396. { label: '料品名称', name: 'InvName', width: 60, align: 'left', },
  397. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  398. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  399. {
  400. label: "状态", name: "Status", width: 60, align: "left",
  401. formatter: function (cellvalue) {
  402. if (cellvalue == "1") {
  403. return "开立";
  404. } else if (cellvalue == "2") {
  405. return "审核";
  406. }
  407. else if (cellvalue == "3") {
  408. return "关闭";
  409. }
  410. else { return ""; }
  411. }
  412. },
  413. { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  414. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  415. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  416. { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  417. ],
  418. //colModel: ColModelMain,
  419. width: "100%",
  420. autowidth: true,
  421. //shrinkToFit: true,
  422. gridComplete: function () {
  423. },
  424. pager: "#gridPager",
  425. sortname: 'SDNCode',
  426. sortorder: "desc",
  427. viewrecords: true,
  428. multiselect: true,
  429. beforeSelectRow: function (rowid, e) {
  430. $("#gridList").jqGrid('resetSelection');
  431. return (true);
  432. },
  433. subGrid: true, // (1)开启子表格支持
  434. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  435. $("#gridList").jqGrid("setSelection", rowid, false);
  436. bindSubGrid4(subgrid_id, rowid)
  437. }
  438. });
  439. $("#warehouse a.btn-default").click(function () {
  440. $("#warehouse a.btn-default").removeClass("active");
  441. $(this).addClass("active");
  442. $('#btn_search').trigger("click");
  443. });
  444. $("#btn_search").click(function () {
  445. var warehouse = $("#warehouse a.active").attr('data-value');
  446. var queryJson = {
  447. POCode: $("#txt_POCode").val(),
  448. InvCode: $("#txt_InvCode").val(),
  449. InvName: $("#txt_InvName").val(),
  450. BatchCode: $("#txt_BatchCode").val(),
  451. }
  452. $gridList.jqGrid('setGridParam', {
  453. postData: { queryJson: JSON.stringify(queryJson) },
  454. }).trigger('reloadGrid');
  455. });
  456. }
  457. function bindSubGrid4(subgrid_id, rowid) {
  458. $("#gridList").jqGrid("setSelection", rowid, false);
  459. var subgrid_table_id;
  460. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  461. var subgrid_pager_id;
  462. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  463. // (5)动态添加子报表的table和pager
  464. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  465. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  466. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  467. // (6)创建jqGrid对象
  468. $("#" + subgrid_table_id).dataGrid({
  469. cellEdit: true,
  470. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + SDNCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  471. colModel: [
  472. { label: "主键", name: "ID", hidden: true, key: true },
  473. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  474. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  475. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  476. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  477. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  478. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  479. ],
  480. //colModel: ColModelSub,
  481. shrinkToFit: true,//宽度自适应
  482. multiselect: true,
  483. prmNames: { search: "search" },
  484. viewrecords: true,
  485. height: "100%",
  486. rowNum: 20,
  487. pager: subgrid_pager_id,
  488. });
  489. }
  490. //其它入库生成条码
  491. function gridList5() {
  492. var $gridList = $("#gridList");
  493. var queryJson = {
  494. POCode: $("#txt_POCode").val(),
  495. InvCode: $("#txt_InvCode").val(),
  496. InvName: $("#txt_InvName").val(),
  497. BatchCode: $("#txt_BatchCode").val(),
  498. }
  499. $gridList.dataGrid({
  500. url: "/WMS/WMSCreateItemLot/GetGridJsonQiTa" + "?" + Math.random(),
  501. postData: { queryJson: JSON.stringify(queryJson) },
  502. height: $(window).height() - 200,
  503. width: $(window).width() - 300,
  504. colModel: [
  505. { label: "主键", name: "ID", hidden: true, key: true },
  506. { label: '单据号', name: 'InCode', width: 120, align: 'left' },
  507. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  508. { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  509. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  510. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  511. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  512. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  513. { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  514. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  515. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  516. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  517. { label: '已入数量', name: 'InQuantity', width: 60, align: 'left', },
  518. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  519. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  520. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  521. ],
  522. //colModel: ColModelMain,
  523. width: "100%",
  524. autowidth: true,
  525. //shrinkToFit: true,
  526. gridComplete: function () {
  527. },
  528. pager: "#gridPager",
  529. sortname: 'InCode',
  530. sortorder: "desc",
  531. viewrecords: true,
  532. multiselect: true,
  533. beforeSelectRow: function (rowid, e) {
  534. $("#gridList").jqGrid('resetSelection');
  535. return (true);
  536. },
  537. subGrid: true, // (1)开启子表格支持
  538. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  539. $("#gridList").jqGrid("setSelection", rowid, false);
  540. bindSubGrid5(subgrid_id, rowid)
  541. }
  542. });
  543. $("#warehouse a.btn-default").click(function () {
  544. $("#warehouse a.btn-default").removeClass("active");
  545. $(this).addClass("active");
  546. $('#btn_search').trigger("click");
  547. });
  548. $("#btn_search").click(function () {
  549. var warehouse = $("#warehouse a.active").attr('data-value');
  550. var queryJson = {
  551. POCode: $("#txt_POCode").val(),
  552. InvCode: $("#txt_InvCode").val(),
  553. InvName: $("#txt_InvName").val(),
  554. BatchCode: $("#txt_BatchCode").val(),
  555. }
  556. $gridList.jqGrid('setGridParam', {
  557. postData: { queryJson: JSON.stringify(queryJson) },
  558. }).trigger('reloadGrid');
  559. });
  560. }
  561. function bindSubGrid5(subgrid_id, rowid) {
  562. $("#gridList").jqGrid("setSelection", rowid, false);
  563. var subgrid_table_id;
  564. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  565. var subgrid_pager_id;
  566. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  567. // (5)动态添加子报表的table和pager
  568. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  569. var InCode = $("#gridList").jqGrid('getRowData', rowid).InCode;
  570. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  571. // (6)创建jqGrid对象
  572. $("#" + subgrid_table_id).dataGrid({
  573. cellEdit: true,
  574. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + InCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  575. colModel: [
  576. { label: "主键", name: "ID", hidden: true, key: true },
  577. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  578. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  579. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  580. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  581. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  582. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  583. ],
  584. //colModel: ColModelSub,
  585. shrinkToFit: true,//宽度自适应
  586. multiselect: true,
  587. prmNames: { search: "search" },
  588. viewrecords: true,
  589. height: "100%",
  590. rowNum: 20,
  591. pager: subgrid_pager_id,
  592. });
  593. }
  594. //归还单生成条码
  595. function gridList6() {
  596. var $gridList = $("#gridList");
  597. var queryJson = {
  598. POCode: $("#txt_POCode").val(),
  599. InvCode: $("#txt_InvCode").val(),
  600. InvName: $("#txt_InvName").val(),
  601. BatchCode: $("#txt_BatchCode").val(),
  602. }
  603. $gridList.dataGrid({
  604. url: "/WMS/WMSCreateItemLot/GetGridJsonGuiHuan" + "?" + Math.random(),
  605. postData: { queryJson: JSON.stringify(queryJson) },
  606. height: $(window).height() - 200,
  607. width: $(window).width() - 300,
  608. colModel: [
  609. { label: "主键", name: "ID", hidden: true, key: true },
  610. { label: '单据号', name: 'ReturnCode', width: 120, align: 'left' },
  611. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  612. { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  613. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  614. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  615. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  616. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  617. { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  618. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  619. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  620. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  621. { label: '已归还数量', name: 'ReturnQuantity', width: 60, align: 'left', },
  622. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  623. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  624. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  625. ],
  626. //colModel: ColModelMain,
  627. width: "100%",
  628. autowidth: true,
  629. //shrinkToFit: true,
  630. gridComplete: function () {
  631. },
  632. pager: "#gridPager",
  633. sortname: 'ReturnCode',
  634. sortorder: "desc",
  635. viewrecords: true,
  636. multiselect: true,
  637. beforeSelectRow: function (rowid, e) {
  638. $("#gridList").jqGrid('resetSelection');
  639. return (true);
  640. },
  641. subGrid: true, // (1)开启子表格支持
  642. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  643. $("#gridList").jqGrid("setSelection", rowid, false);
  644. bindSubGrid6(subgrid_id, rowid)
  645. }
  646. });
  647. $("#warehouse a.btn-default").click(function () {
  648. $("#warehouse a.btn-default").removeClass("active");
  649. $(this).addClass("active");
  650. $('#btn_search').trigger("click");
  651. });
  652. $("#btn_search").click(function () {
  653. var warehouse = $("#warehouse a.active").attr('data-value');
  654. var queryJson = {
  655. POCode: $("#txt_POCode").val(),
  656. InvCode: $("#txt_InvCode").val(),
  657. InvName: $("#txt_InvName").val(),
  658. BatchCode: $("#txt_BatchCode").val(),
  659. }
  660. $gridList.jqGrid('setGridParam', {
  661. postData: { queryJson: JSON.stringify(queryJson) },
  662. }).trigger('reloadGrid');
  663. });
  664. }
  665. function bindSubGrid6(subgrid_id, rowid) {
  666. $("#gridList").jqGrid("setSelection", rowid, false);
  667. var subgrid_table_id;
  668. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  669. var subgrid_pager_id;
  670. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  671. // (5)动态添加子报表的table和pager
  672. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  673. var ReturnCode = $("#gridList").jqGrid('getRowData', rowid).ReturnCode;
  674. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  675. // (6)创建jqGrid对象
  676. $("#" + subgrid_table_id).dataGrid({
  677. cellEdit: true,
  678. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ReturnCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  679. colModel: [
  680. { label: "主键", name: "ID", hidden: true, key: true },
  681. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  682. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  683. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  684. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  685. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  686. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  687. ],
  688. //colModel: ColModelSub,
  689. shrinkToFit: true,//宽度自适应
  690. multiselect: true,
  691. prmNames: { search: "search" },
  692. viewrecords: true,
  693. height: "100%",
  694. rowNum: 20,
  695. pager: subgrid_pager_id,
  696. });
  697. }
  698. //*审核到货单生成条码
  699. function gridList7() {
  700. var $gridList = $("#gridList");
  701. var queryJson = {
  702. POCode: $("#txt_POCode").val(),
  703. VenCode: $("#txt_VenCode").val(),
  704. VenName: $("#txt_VenName").val(),
  705. InvCode: $("#txt_InvCode").val(),
  706. InvName: $("#txt_InvName").val(),
  707. BatchCode: $("#txt_BatchCode").val(),
  708. }
  709. $gridList.dataGrid({
  710. url: "/WMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  711. postData: { queryJson: JSON.stringify(queryJson) },
  712. height: $(window).height() - 200,
  713. width: $(window).width() - 300,
  714. colModel: [
  715. { label: "主键", name: "ID", hidden: true, key: true },
  716. { label: '单据号', name: 'DNCode', width: 120, align: 'left' },
  717. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  718. { label: '采购订单号', name: 'POCode', width: 50, align: 'left' },
  719. { label: '采购订单行号', name: 'POSequence', width: 50, align: 'left' },
  720. { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  721. { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  722. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  723. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  724. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  725. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  726. { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  727. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  728. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  729. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  730. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  731. { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  732. { label: '币种', name: 'Currency', width: 60, align: 'left', },
  733. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  734. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  735. ],
  736. //colModel: ColModelMain,
  737. width: "100%",
  738. autowidth: true,
  739. //shrinkToFit: true,
  740. gridComplete: function () {
  741. },
  742. pager: "#gridPager",
  743. sortname: 'DNCode',
  744. sortorder: "desc",
  745. viewrecords: true,
  746. multiselect: true,
  747. beforeSelectRow: function (rowid, e) {
  748. $("#gridList").jqGrid('resetSelection');
  749. return (true);
  750. },
  751. subGrid: true, // (1)开启子表格支持
  752. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  753. $("#gridList").jqGrid("setSelection", rowid, false);
  754. bindSubGrid7(subgrid_id, rowid)
  755. }
  756. });
  757. $("#warehouse a.btn-default").click(function () {
  758. $("#warehouse a.btn-default").removeClass("active");
  759. $(this).addClass("active");
  760. $('#btn_search').trigger("click");
  761. });
  762. $("#btn_search").click(function () {
  763. var warehouse = $("#warehouse a.active").attr('data-value');
  764. var queryJson = {
  765. POCode: $("#txt_POCode").val(),
  766. VenCode: $("#txt_VenCode").val(),
  767. VenName: $("#txt_VenName").val(),
  768. InvCode: $("#txt_InvCode").val(),
  769. InvName: $("#txt_InvName").val(),
  770. BatchCode: $("#txt_BatchCode").val(),
  771. }
  772. $gridList.jqGrid('setGridParam', {
  773. postData: { queryJson: JSON.stringify(queryJson) },
  774. }).trigger('reloadGrid');
  775. });
  776. }
  777. function bindSubGrid7(subgrid_id, rowid) {
  778. $("#gridList").jqGrid("setSelection", rowid, false);
  779. var subgrid_table_id;
  780. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  781. var subgrid_pager_id;
  782. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  783. // (5)动态添加子报表的table和pager
  784. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  785. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  786. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  787. // (6)创建jqGrid对象
  788. $("#" + subgrid_table_id).dataGrid({
  789. cellEdit: true,
  790. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  791. colModel: [
  792. { label: "主键", name: "ID", hidden: true, key: true },
  793. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  794. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  795. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  796. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  797. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  798. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  799. ],
  800. //colModel: ColModelSub,
  801. shrinkToFit: true,//宽度自适应
  802. multiselect: true,
  803. prmNames: { search: "search" },
  804. viewrecords: true,
  805. height: "100%",
  806. rowNum: 20,
  807. pager: subgrid_pager_id,
  808. });
  809. }
  810. //审核委外到货单生成条码
  811. function gridList8() {
  812. var $gridList = $("#gridList");
  813. var queryJson = {
  814. POCode: $("#txt_POCode").val(),
  815. VenCode: $("#txt_VenCode").val(),
  816. VenName: $("#txt_VenName").val(),
  817. InvCode: $("#txt_InvCode").val(),
  818. InvName: $("#txt_InvName").val(),
  819. BatchCode: $("#txt_BatchCode").val(),
  820. }
  821. $gridList.dataGrid({
  822. url: "/WMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(),
  823. postData: { queryJson: JSON.stringify(queryJson) },
  824. height: $(window).height() - 200,
  825. width: $(window).width() - 300,
  826. colModel: [
  827. { label: "主键", name: "ID", hidden: true, key: true },
  828. { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  829. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  830. { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' },
  831. { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' },
  832. { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  833. { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  834. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  835. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  836. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  837. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  838. { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  839. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  840. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  841. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  842. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  843. { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  844. { label: '币种', name: 'Currency', width: 60, align: 'left', },
  845. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  846. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  847. ],
  848. //colModel: ColModelMain,
  849. width: "100%",
  850. autowidth: true,
  851. //shrinkToFit: true,
  852. gridComplete: function () {
  853. },
  854. pager: "#gridPager",
  855. sortname: 'ODNCode',
  856. sortorder: "desc",
  857. viewrecords: true,
  858. multiselect: true,
  859. beforeSelectRow: function (rowid, e) {
  860. $("#gridList").jqGrid('resetSelection');
  861. return (true);
  862. },
  863. subGrid: true, // (1)开启子表格支持
  864. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  865. $("#gridList").jqGrid("setSelection", rowid, false);
  866. bindSubGrid8(subgrid_id, rowid)
  867. }
  868. });
  869. $("#warehouse a.btn-default").click(function () {
  870. $("#warehouse a.btn-default").removeClass("active");
  871. $(this).addClass("active");
  872. $('#btn_search').trigger("click");
  873. });
  874. $("#btn_search").click(function () {
  875. var warehouse = $("#warehouse a.active").attr('data-value');
  876. var queryJson = {
  877. POCode: $("#txt_POCode").val(),
  878. VenCode: $("#txt_VenCode").val(),
  879. VenName: $("#txt_VenName").val(),
  880. InvCode: $("#txt_InvCode").val(),
  881. InvName: $("#txt_InvName").val(),
  882. BatchCode: $("#txt_BatchCode").val(),
  883. }
  884. $gridList.jqGrid('setGridParam', {
  885. postData: { queryJson: JSON.stringify(queryJson) },
  886. }).trigger('reloadGrid');
  887. });
  888. }
  889. function bindSubGrid8(subgrid_id, rowid) {
  890. $("#gridList").jqGrid("setSelection", rowid, false);
  891. var subgrid_table_id;
  892. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  893. var subgrid_pager_id;
  894. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  895. // (5)动态添加子报表的table和pager
  896. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  897. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  898. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  899. // (6)创建jqGrid对象
  900. $("#" + subgrid_table_id).dataGrid({
  901. cellEdit: true,
  902. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  903. colModel: [
  904. { label: "主键", name: "ID", hidden: true, key: true },
  905. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  906. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  907. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  908. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  909. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  910. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  911. ],
  912. //colModel: ColModelSub,
  913. shrinkToFit: true,//宽度自适应
  914. multiselect: true,
  915. prmNames: { search: "search" },
  916. viewrecords: true,
  917. height: "100%",
  918. rowNum: 20,
  919. pager: subgrid_pager_id,
  920. });
  921. }
  922. //开立得成品入库单 生成条码
  923. function gridList9() {
  924. var $gridList = $("#gridList");
  925. var queryJson = {
  926. POCode: $("#txt_POCode").val(),
  927. InvCode: $("#txt_InvCode").val(),
  928. InvName: $("#txt_InvName").val(),
  929. BatchCode: $("#txt_BatchCode").val(),
  930. }
  931. $gridList.dataGrid({
  932. url: "/WMS/WMSCreateItemLot/GetGridJsonKLCPRK" + "?" + Math.random(),
  933. postData: { queryJson: JSON.stringify(queryJson) },
  934. height: $(window).height() - 200,
  935. width: $(window).width() - 300,
  936. colModel: [
  937. { label: "主键", name: "ID", hidden: true, key: true },
  938. { label: '单据号', name: 'RCVCode', width: 120, align: 'left' },
  939. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  940. { label: '仓库号', name: 'WHCode', width: 120, align: 'left' },
  941. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  942. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  943. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  944. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  945. { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  946. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  947. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  948. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  949. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  950. { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  951. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  952. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  953. ],
  954. //colModel: ColModelMain,
  955. width: "100%",
  956. autowidth: true,
  957. //shrinkToFit: true,
  958. gridComplete: function () {
  959. },
  960. pager: "#gridPager",
  961. sortname: 'RCVCode',
  962. sortorder: "desc",
  963. viewrecords: true,
  964. multiselect: true,
  965. beforeSelectRow: function (rowid, e) {
  966. $("#gridList").jqGrid('resetSelection');
  967. return (true);
  968. },
  969. subGrid: true, // (1)开启子表格支持
  970. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  971. $("#gridList").jqGrid("setSelection", rowid, false);
  972. bindSubGrid9(subgrid_id, rowid)
  973. }
  974. });
  975. $("#warehouse a.btn-default").click(function () {
  976. $("#warehouse a.btn-default").removeClass("active");
  977. $(this).addClass("active");
  978. $('#btn_search').trigger("click");
  979. });
  980. $("#btn_search").click(function () {
  981. var warehouse = $("#warehouse a.active").attr('data-value');
  982. var queryJson = {
  983. POCode: $("#txt_POCode").val(),
  984. InvCode: $("#txt_InvCode").val(),
  985. InvName: $("#txt_InvName").val(),
  986. BatchCode: $("#txt_BatchCode").val(),
  987. }
  988. $gridList.jqGrid('setGridParam', {
  989. postData: { queryJson: JSON.stringify(queryJson) },
  990. }).trigger('reloadGrid');
  991. });
  992. }
  993. function bindSubGrid9(subgrid_id, rowid) {
  994. $("#gridList").jqGrid("setSelection", rowid, false);
  995. var subgrid_table_id;
  996. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  997. var subgrid_pager_id;
  998. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  999. // (5)动态添加子报表的table和pager
  1000. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1001. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  1002. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1003. // (6)创建jqGrid对象
  1004. $("#" + subgrid_table_id).dataGrid({
  1005. cellEdit: true,
  1006. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + RCVCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1007. colModel: [
  1008. { label: "主键", name: "ID", hidden: true, key: true },
  1009. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1010. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1011. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1012. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1013. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1014. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1015. ],
  1016. //colModel: ColModelSub,
  1017. shrinkToFit: true,//宽度自适应
  1018. multiselect: true,
  1019. prmNames: { search: "search" },
  1020. viewrecords: true,
  1021. height: "100%",
  1022. rowNum: 20,
  1023. pager: subgrid_pager_id,
  1024. });
  1025. }
  1026. //采购拒收单
  1027. function gridList10() {
  1028. var $gridList = $("#gridList");
  1029. var queryJson = {
  1030. POCode: $("#txt_POCode").val(),
  1031. VenCode: $("#txt_VenCode").val(),
  1032. VenName: $("#txt_VenName").val(),
  1033. InvCode: $("#txt_InvCode").val(),
  1034. InvName: $("#txt_InvName").val(),
  1035. BatchCode: $("#txt_BatchCode").val(),
  1036. }
  1037. $gridList.dataGrid({
  1038. url: "/WMS/WMSCreateItemLot/GetGridJsonJSD" + "?" + Math.random(),
  1039. postData: { queryJson: JSON.stringify(queryJson) },
  1040. height: $(window).height() - 200,
  1041. width: $(window).width() - 300,
  1042. colModel: [
  1043. { label: "主键", name: "ID", hidden: true, key: true },
  1044. { label: '拒收单号', name: 'DNCode', width: 120, align: 'left' },
  1045. { label: '拒收单行号', name: 'Sequence', width: 50, align: 'left' },
  1046. { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1047. { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1048. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1049. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1050. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1051. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1052. { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' },
  1053. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1054. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1055. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1056. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1057. { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1058. { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1059. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1060. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1061. ],
  1062. //colModel: ColModelMain,
  1063. width: "100%",
  1064. autowidth: true,
  1065. //shrinkToFit: true,
  1066. gridComplete: function () {
  1067. },
  1068. pager: "#gridPager",
  1069. sortname: 'DNCode',
  1070. sortorder: "desc",
  1071. viewrecords: true,
  1072. multiselect: true,
  1073. beforeSelectRow: function (rowid, e) {
  1074. $("#gridList").jqGrid('resetSelection');
  1075. return (true);
  1076. },
  1077. subGrid: true, // (1)开启子表格支持
  1078. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1079. $("#gridList").jqGrid("setSelection", rowid, false);
  1080. bindSubGrid10(subgrid_id, rowid)
  1081. }
  1082. });
  1083. $("#warehouse a.btn-default").click(function () {
  1084. $("#warehouse a.btn-default").removeClass("active");
  1085. $(this).addClass("active");
  1086. $('#btn_search').trigger("click");
  1087. });
  1088. $("#btn_search").click(function () {
  1089. var warehouse = $("#warehouse a.active").attr('data-value');
  1090. var queryJson = {
  1091. POCode: $("#txt_POCode").val(),
  1092. VenCode: $("#txt_VenCode").val(),
  1093. VenName: $("#txt_VenName").val(),
  1094. InvCode: $("#txt_InvCode").val(),
  1095. InvName: $("#txt_InvName").val(),
  1096. BatchCode: $("#txt_BatchCode").val(),
  1097. }
  1098. $gridList.jqGrid('setGridParam', {
  1099. postData: { queryJson: JSON.stringify(queryJson) },
  1100. }).trigger('reloadGrid');
  1101. });
  1102. }
  1103. function bindSubGrid10(subgrid_id, rowid) {
  1104. $("#gridList").jqGrid("setSelection", rowid, false);
  1105. var subgrid_table_id;
  1106. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1107. var subgrid_pager_id;
  1108. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1109. // (5)动态添加子报表的table和pager
  1110. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1111. var DNCode = $("#gridList").jqGrid('getRowData', rowid).DNCode;
  1112. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1113. // (6)创建jqGrid对象
  1114. $("#" + subgrid_table_id).dataGrid({
  1115. cellEdit: true,
  1116. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + DNCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1117. colModel: [
  1118. { label: "主键", name: "ID", hidden: true, key: true },
  1119. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1120. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1121. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1122. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1123. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1124. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1125. ],
  1126. //colModel: ColModelSub,
  1127. shrinkToFit: true,//宽度自适应
  1128. multiselect: true,
  1129. prmNames: { search: "search" },
  1130. viewrecords: true,
  1131. height: "100%",
  1132. rowNum: 20,
  1133. pager: subgrid_pager_id,
  1134. });
  1135. }
  1136. //委外拒收单生成条码
  1137. function gridList11() {
  1138. var $gridList = $("#gridList");
  1139. var queryJson = {
  1140. POCode: $("#txt_POCode").val(),
  1141. VenCode: $("#txt_VenCode").val(),
  1142. VenName: $("#txt_VenName").val(),
  1143. InvCode: $("#txt_InvCode").val(),
  1144. InvName: $("#txt_InvName").val(),
  1145. BatchCode: $("#txt_BatchCode").val(),
  1146. }
  1147. $gridList.dataGrid({
  1148. url: "/WMS/WMSCreateItemLot/GetGridJsonWWJSD" + "?" + Math.random(),
  1149. postData: { queryJson: JSON.stringify(queryJson) },
  1150. height: $(window).height() - 200,
  1151. width: $(window).width() - 300,
  1152. colModel: [
  1153. { label: "主键", name: "ID", hidden: true, key: true },
  1154. { label: '单据号', name: 'ODNCode', width: 120, align: 'left' },
  1155. { label: '行号', name: 'Sequence', width: 50, align: 'left' },
  1156. { label: '委外拒收单号', name: 'OOCode', width: 120, align: 'left' },
  1157. { label: '委外拒收单行号', name: 'OOSequence', width: 50, align: 'left' },
  1158. { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' },
  1159. { label: '供应商名称', name: 'VenName', width: 120, align: 'left' },
  1160. { label: '料品编码', name: 'InvCode', width: 50, align: 'left' },
  1161. { label: '料品名称', name: 'InvName', width: 120, align: 'left' },
  1162. { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' },
  1163. { label: '料品型号', name: 'InvStd', width: 150, align: 'left' },
  1164. { label: '料品单位', name: 'InvStd', width: 50, align: 'left' },
  1165. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1166. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1167. { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' },
  1168. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1169. { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', },
  1170. { label: '币种', name: 'Currency', width: 60, align: 'left', },
  1171. { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', },
  1172. { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' },
  1173. ],
  1174. //colModel: ColModelMain,
  1175. width: "100%",
  1176. autowidth: true,
  1177. //shrinkToFit: true,
  1178. gridComplete: function () {
  1179. },
  1180. pager: "#gridPager",
  1181. sortname: 'ODNCode',
  1182. sortorder: "desc",
  1183. viewrecords: true,
  1184. multiselect: true,
  1185. beforeSelectRow: function (rowid, e) {
  1186. $("#gridList").jqGrid('resetSelection');
  1187. return (true);
  1188. },
  1189. subGrid: true, // (1)开启子表格支持
  1190. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1191. $("#gridList").jqGrid("setSelection", rowid, false);
  1192. bindSubGrid11(subgrid_id, rowid)
  1193. }
  1194. });
  1195. $("#warehouse a.btn-default").click(function () {
  1196. $("#warehouse a.btn-default").removeClass("active");
  1197. $(this).addClass("active");
  1198. $('#btn_search').trigger("click");
  1199. });
  1200. $("#btn_search").click(function () {
  1201. var warehouse = $("#warehouse a.active").attr('data-value');
  1202. var queryJson = {
  1203. POCode: $("#txt_POCode").val(),
  1204. VenCode: $("#txt_VenCode").val(),
  1205. VenName: $("#txt_VenName").val(),
  1206. InvCode: $("#txt_InvCode").val(),
  1207. InvName: $("#txt_InvName").val(),
  1208. BatchCode: $("#txt_BatchCode").val(),
  1209. }
  1210. $gridList.jqGrid('setGridParam', {
  1211. postData: { queryJson: JSON.stringify(queryJson) },
  1212. }).trigger('reloadGrid');
  1213. });
  1214. }
  1215. function bindSubGrid11(subgrid_id, rowid) {
  1216. $("#gridList").jqGrid("setSelection", rowid, false);
  1217. var subgrid_table_id;
  1218. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1219. var subgrid_pager_id;
  1220. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1221. // (5)动态添加子报表的table和pager
  1222. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1223. var ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode;
  1224. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1225. // (6)创建jqGrid对象
  1226. $("#" + subgrid_table_id).dataGrid({
  1227. cellEdit: true,
  1228. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1229. colModel: [
  1230. { label: "主键", name: "ID", hidden: true, key: true },
  1231. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1232. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1233. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1234. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1235. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1236. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1237. ],
  1238. //colModel: ColModelSub,
  1239. shrinkToFit: true,//宽度自适应
  1240. multiselect: true,
  1241. prmNames: { search: "search" },
  1242. viewrecords: true,
  1243. height: "100%",
  1244. rowNum: 20,
  1245. pager: subgrid_pager_id,
  1246. });
  1247. }
  1248. //领料申请退料生成条码
  1249. function gridList12() {
  1250. var $gridList = $("#gridList");
  1251. var queryJson = {
  1252. POCode: $("#txt_POCode").val(),
  1253. InvCode: $("#txt_InvCode").val(),
  1254. InvName: $("#txt_InvName").val(),
  1255. BatchCode: $("#txt_BatchCode").val(),
  1256. }
  1257. $gridList.dataGrid({
  1258. url: "/WMS/WMSCreateItemLot/GetGridJsonLLSQTL" + "?" + Math.random(),
  1259. postData: { queryJson: JSON.stringify(queryJson) },
  1260. height: $(window).height() - 200,
  1261. width: $(window).width() - 300,
  1262. colModel: [
  1263. { label: "主键", name: "ID", hidden: true, key: true },
  1264. { label: '退料单号', name: 'ApplyNegCode', width: 120, align: 'left' },
  1265. { label: '退料单行号', name: 'Sequence', width: 50, align: 'left' },
  1266. { label: 'ERP子ID', name: 'SourceDetailID', hidden: true, },
  1267. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  1268. { label: '料品编码', name: 'InvName', width: 60, align: 'left', },
  1269. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  1270. { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' },
  1271. { label: '已退数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  1272. { label: '规格型号', name: 'InvStd', width: 60, align: 'left', },
  1273. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  1274. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  1275. { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', },
  1276. ],
  1277. //colModel: ColModelMain,
  1278. width: "100%",
  1279. autowidth: true,
  1280. //shrinkToFit: true,
  1281. gridComplete: function () {
  1282. },
  1283. pager: "#gridPager",
  1284. sortname: 'ApplyNegCode',
  1285. sortorder: "desc",
  1286. viewrecords: true,
  1287. multiselect: true,
  1288. beforeSelectRow: function (rowid, e) {
  1289. $("#gridList").jqGrid('resetSelection');
  1290. return (true);
  1291. },
  1292. subGrid: true, // (1)开启子表格支持
  1293. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  1294. $("#gridList").jqGrid("setSelection", rowid, false);
  1295. bindSubGrid12(subgrid_id, rowid)
  1296. }
  1297. });
  1298. $("#warehouse a.btn-default").click(function () {
  1299. $("#warehouse a.btn-default").removeClass("active");
  1300. $(this).addClass("active");
  1301. $('#btn_search').trigger("click");
  1302. });
  1303. $("#btn_search").click(function () {
  1304. var warehouse = $("#warehouse a.active").attr('data-value');
  1305. var queryJson = {
  1306. POCode: $("#txt_POCode").val(),
  1307. InvCode: $("#txt_InvCode").val(),
  1308. InvName: $("#txt_InvName").val(),
  1309. BatchCode: $("#txt_BatchCode").val(),
  1310. }
  1311. $gridList.jqGrid('setGridParam', {
  1312. postData: { queryJson: JSON.stringify(queryJson) },
  1313. }).trigger('reloadGrid');
  1314. });
  1315. }
  1316. function bindSubGrid12(subgrid_id, rowid) {
  1317. $("#gridList").jqGrid("setSelection", rowid, false);
  1318. var subgrid_table_id;
  1319. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  1320. var subgrid_pager_id;
  1321. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  1322. // (5)动态添加子报表的table和pager
  1323. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  1324. var ApplyNegCode = $("#gridList").jqGrid('getRowData', rowid).ApplyNegCode;
  1325. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  1326. // (6)创建jqGrid对象
  1327. $("#" + subgrid_table_id).dataGrid({
  1328. cellEdit: true,
  1329. url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  1330. colModel: [
  1331. { label: "主键", name: "ID", hidden: true, key: true },
  1332. { label: "来源单据号", name: "TransCode", width: 200, align: 'left' },
  1333. { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' },
  1334. { label: '条码', name: 'LotNo', width: 200, align: 'left' },
  1335. { label: '条码数量', name: 'Quantity', width: 200, align: 'left' },
  1336. { label: '操作人', name: 'MUSERName', width: 200, align: 'left' },
  1337. { label: '操作时间', name: 'MTIME', width: 200, align: 'left' },
  1338. ],
  1339. //colModel: ColModelSub,
  1340. shrinkToFit: true,//宽度自适应
  1341. multiselect: true,
  1342. prmNames: { search: "search" },
  1343. viewrecords: true,
  1344. height: "100%",
  1345. rowNum: 20,
  1346. pager: subgrid_pager_id,
  1347. });
  1348. }
  1349. function btnDelete() {
  1350. var objArr = '';
  1351. var obj = $("#gridList").jqGrid("getRowData");
  1352. for (var i = 0; i < obj.length; i++) {
  1353. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  1354. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  1355. if (rowData != "undefined" && rowData != null) {
  1356. for (var j = 0; j < rowData.length; j++) {
  1357. objArr += "'" + rowData[j] + "',";
  1358. }
  1359. }
  1360. }
  1361. if (objArr == "") {
  1362. $.modalAlert("请选中条码删除!");
  1363. return;
  1364. }
  1365. $.deleteForm({
  1366. url: "/WMS/WMSCreateItemLot/DeleteItemLot",
  1367. param: { keyValue: JSON.stringify(objArr) },
  1368. success: function () {
  1369. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1370. }
  1371. })
  1372. }
  1373. function btnCreate() {
  1374. debugger;
  1375. var PoStatus;
  1376. var jsonData = '';
  1377. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  1378. if (ids.length != 1) {
  1379. $.modalAlert("请选择一条采购订单行数据生成条码!");
  1380. return;
  1381. }
  1382. var POCode = "";
  1383. var PORow = "";
  1384. if (Type=='1') {
  1385. for (var i in ids) {
  1386. ApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  1387. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1388. }
  1389. $.modalOpen({
  1390. id: "FormAddItemLot",
  1391. title: "生产退料条码生成",
  1392. url: "/WMS/WMSCreateItemLot/From?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 1 + "&" + Math.random(),
  1393. width: "550px",
  1394. height: "1000px",
  1395. callBack: function (iframeId) {
  1396. top.frames[iframeId].submitForm();
  1397. }
  1398. });
  1399. }
  1400. if (Type == '2') {
  1401. for (var i in ids) {
  1402. OApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).OApplyNegCode;
  1403. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1404. }
  1405. $.modalOpen({
  1406. id: "FormAddItemLot",
  1407. title: "委外退料条码生成",
  1408. url: "/WMS/WMSCreateItemLot/From?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 2 + "&" + Math.random(),
  1409. width: "550px",
  1410. height: "1000px",
  1411. callBack: function (iframeId) {
  1412. top.frames[iframeId].submitForm();
  1413. }
  1414. });
  1415. }
  1416. if (Type == '3') {
  1417. for (var i in ids) {
  1418. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  1419. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1420. }
  1421. $.modalOpen({
  1422. id: "FormAddItemLot",
  1423. title: "成品条码产生",
  1424. url: "/WMS/WMSCreateItemLot/From?MOCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + 3 + "&" + Math.random(),
  1425. width: "550px",
  1426. height: "1000px",
  1427. callBack: function (iframeId) {
  1428. top.frames[iframeId].submitForm();
  1429. }
  1430. });
  1431. }
  1432. if (Type == '4') {
  1433. for (var i in ids) {
  1434. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  1435. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1436. }
  1437. $.modalOpen({
  1438. id: "FormAddItemLot",
  1439. title: "销售退货条码产生",
  1440. url: "/WMS/WMSCreateItemLot/From?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&Type=" + 4 + "&" + Math.random(),
  1441. width: "550px",
  1442. height: "1000px",
  1443. callBack: function (iframeId) {
  1444. top.frames[iframeId].submitForm();
  1445. }
  1446. });
  1447. }
  1448. if (Type == '5') {
  1449. for (var i in ids) {
  1450. InCode = $("#gridList").jqGrid('getRowData', ids[i]).InCode;
  1451. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1452. }
  1453. $.modalOpen({
  1454. id: "FormAddItemLot",
  1455. title: "其他入库条码产生",
  1456. url: "/WMS/WMSCreateItemLot/From?InCode=" + InCode + "&Sequence=" + Sequence + "&Type=" + 5 + "&" + Math.random(),
  1457. width: "550px",
  1458. height: "1000px",
  1459. callBack: function (iframeId) {
  1460. top.frames[iframeId].submitForm();
  1461. }
  1462. });
  1463. }
  1464. if (Type == '6') {
  1465. for (var i in ids) {
  1466. ReturnCode = $("#gridList").jqGrid('getRowData', ids[i]).ReturnCode;
  1467. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1468. }
  1469. $.modalOpen({
  1470. id: "FormAddItemLot",
  1471. title: "归还单条码产生",
  1472. url: "/WMS/WMSCreateItemLot/From?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&Type=" + 6 + "&" + Math.random(),
  1473. width: "550px",
  1474. height: "1000px",
  1475. callBack: function (iframeId) {
  1476. top.frames[iframeId].submitForm();
  1477. }
  1478. });
  1479. }
  1480. if (Type == '7') {
  1481. for (var i in ids) {
  1482. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  1483. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1484. }
  1485. $.modalOpen({
  1486. id: "FormAddItemLot",
  1487. title: "审核到货单生成条码",
  1488. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 7 + "&" + Math.random(),
  1489. width: "550px",
  1490. height: "1000px",
  1491. callBack: function (iframeId) {
  1492. top.frames[iframeId].submitForm();
  1493. }
  1494. });
  1495. }
  1496. if (Type == '8') {
  1497. for (var i in ids) {
  1498. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  1499. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1500. }
  1501. $.modalOpen({
  1502. id: "FormAddItemLot",
  1503. title: "审核委外到货单生成条码",
  1504. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 8 + "&" + Math.random(),
  1505. width: "550px",
  1506. height: "1000px",
  1507. callBack: function (iframeId) {
  1508. top.frames[iframeId].submitForm();
  1509. }
  1510. });
  1511. }
  1512. if (Type == '9') {
  1513. for (var i in ids) {
  1514. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  1515. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1516. }
  1517. $.modalOpen({
  1518. id: "FormAddItemLot",
  1519. title: "开立成品入库单生成条码",
  1520. url: "/WMS/WMSCreateItemLot/From?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&Type=" + 9 + "&" + Math.random(),
  1521. width: "550px",
  1522. height: "1000px",
  1523. callBack: function (iframeId) {
  1524. top.frames[iframeId].submitForm();
  1525. }
  1526. });
  1527. }
  1528. if (Type == '10') {
  1529. for (var i in ids) {
  1530. DNCode = $("#gridList").jqGrid('getRowData', ids[i]).DNCode;
  1531. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1532. }
  1533. $.modalOpen({
  1534. id: "FormAddItemLot",
  1535. title: "审核拒收单生成条码",
  1536. url: "/WMS/WMSCreateItemLot/From?DNCode=" + DNCode + "&Sequence=" + Sequence + "&Type=" + 10 + "&" + Math.random(),
  1537. width: "550px",
  1538. height: "1000px",
  1539. callBack: function (iframeId) {
  1540. top.frames[iframeId].submitForm();
  1541. }
  1542. });
  1543. }
  1544. if (Type == '11') {
  1545. for (var i in ids) {
  1546. ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode;
  1547. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1548. }
  1549. $.modalOpen({
  1550. id: "FormAddItemLot",
  1551. title: "审核委外拒收单生成条码",
  1552. url: "/WMS/WMSCreateItemLot/From?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + 11 + "&" + Math.random(),
  1553. width: "550px",
  1554. height: "1000px",
  1555. callBack: function (iframeId) {
  1556. top.frames[iframeId].submitForm();
  1557. }
  1558. });
  1559. }
  1560. if (Type == '12') {
  1561. for (var i in ids) {
  1562. LLApplyNegCode = $("#gridList").jqGrid('getRowData', ids[i]).ApplyNegCode;
  1563. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  1564. }
  1565. $.modalOpen({
  1566. id: "FormAddItemLot",
  1567. title: "审核领料申请退料生成条码",
  1568. url: "/WMS/WMSCreateItemLot/From?LLApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&Type=" + 11 + "&" + Math.random(),
  1569. width: "550px",
  1570. height: "1000px",
  1571. callBack: function (iframeId) {
  1572. top.frames[iframeId].submitForm();
  1573. }
  1574. });
  1575. }
  1576. }
  1577. function fullscreen() {
  1578. var docElm = document.documentElement;
  1579. if (docElm.requestFullscreen) {
  1580. docElm.requestFullscreen();
  1581. } else if (docElm.mozRequestFullScreen) {
  1582. docElm.mozRequestFullScreen();
  1583. } else if (docElm.webkitRequestFullScreen) {
  1584. docElm.webkitRequestFullScreen();
  1585. } else if (docElm.msRequestFullscreen) {
  1586. docElm.msRequestFullscreen();
  1587. }
  1588. $(window).bind('resize', function () {
  1589. $("#gridList").setGridWidth($(window).width());
  1590. }).trigger('resize');
  1591. $(window).bind('resize', function () {
  1592. $("#gridList").setGridHeight($(window).height());
  1593. }).trigger('resize');
  1594. }
  1595. function btnPrint() {
  1596. debugger;
  1597. var mold = '';
  1598. if (Type == '1') { mold = '00001'; }
  1599. if (Type == '2') { mold = '00002'; }
  1600. if (Type == '3') { mold = '00003'; }
  1601. if (Type == '4') { mold = '00004'; }
  1602. if (Type == '5') { mold = '00005'; }
  1603. if (Type == '6') { mold = '00006'; }
  1604. if (Type == '7') { mold = '00007'; }
  1605. if (Type == '8') { mold = '00008'; }
  1606. if (Type == '9') { mold = '00009'; }
  1607. if (Type == '10') { mold = '00010'; }
  1608. if (Type == '11') { mold = '00011'; }
  1609. if (Type == '12') { mold = '00012'; }//领料申请退料
  1610. var objArr = '';
  1611. var arr = [];
  1612. var obj = $("#gridList").jqGrid("getRowData");
  1613. for (var i = 0; i < obj.length; i++) {
  1614. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  1615. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  1616. if (rowData != "undefined" && rowData != null) {
  1617. for (var j = 0; j < rowData.length; j++) {
  1618. objArr += "'" + rowData[j] + "',";
  1619. }
  1620. objArr = objArr.slice(0, objArr.length - 1);
  1621. objArr = ""+objArr+"|";
  1622. arr.push(objArr);
  1623. }
  1624. }
  1625. $.modalOpen({
  1626. id: "PrintLot",
  1627. title: "打印",
  1628. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  1629. width: "550px",
  1630. height: "1000px",
  1631. callBack: function (iframeId) {
  1632. top.frames[iframeId].submitForm();
  1633. }
  1634. });
  1635. }
  1636. </script>
  1637. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  1638. <script>
  1639. //function btnPrint() {
  1640. // var objArr = '';
  1641. // var obj = $("#gridList").jqGrid("getRowData");
  1642. // for (var i = 0; i < obj.length; i++) {
  1643. // var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  1644. // var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  1645. // if (rowData != "undefined" && rowData != null) {
  1646. // for (var j = 0; j < rowData.length; j++) {
  1647. // objArr += "'" + rowData[j] + "',";
  1648. // }
  1649. // }
  1650. // }
  1651. // if (objArr == "") {
  1652. // $.modalAlert("请选择子表数据打印!");
  1653. // return;
  1654. // }
  1655. // var strPrintData;
  1656. // var bIsInstallPrintControl;
  1657. // var strPrintControlCookie;
  1658. // $.ajax({
  1659. // url: "/WMS/WMSCreateItemLot/PrintItemLot?Type=" + Type,
  1660. // type: "post",
  1661. // data: { keyValue: JSON.stringify(objArr) },
  1662. // dataType: "json",
  1663. // async: false,
  1664. // success: function (data) {
  1665. // strPrintData = data.strPrintData_1;
  1666. // bIsInstallPrintControl = data.bIsInstallPrintControl_1;
  1667. // strPrintControlCookie = data.strPrintControlCookie_1;
  1668. // }
  1669. // });
  1670. // if (strPrintData != '') {
  1671. // var test = "ChuLinPrint:" + strPrintData;
  1672. // $("#ifrm")[0].src = "ChuLinPrint:" + strPrintData;
  1673. // }
  1674. // if (bIsInstallPrintControl == 'False') {
  1675. // if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  1676. // $("#downPrintControl").click();
  1677. // }
  1678. // }
  1679. // if (bIsInstallPrintControl == 'True') {
  1680. // var strPrintControlCookie = strPrintControlCookie;
  1681. // if (strPrintControlCookie != '') { //延时3秒后再次检测打印控件是否安装
  1682. // setTimeout("checkPrintControlInstall()", 8000);
  1683. // function checkPrintControlInstall() {
  1684. // $.ajax({
  1685. // url: "/WMS/WMSCreateItemLot/IsCheckInstall?checkInstall=" + strPrintControlCookie,
  1686. // dataType: "json",
  1687. // async: false,
  1688. // success: function (strResult) {
  1689. // if (strResult.indexOf("PrintControlInstall") == -1) {
  1690. // if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  1691. // $("#downPrintControl").click();
  1692. // }
  1693. // }
  1694. // }
  1695. // });
  1696. // }
  1697. // }
  1698. // }
  1699. // $("#btn_search").click();
  1700. //}
  1701. </script>
  1702. <div class="topPanel" style="height:100px;">
  1703. <div class="toolbar">
  1704. <div class="btn-group">
  1705. <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>
  1706. <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>
  1707. <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>
  1708. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  1709. </div>
  1710. <div class="btn-group" style="display:block;padding-left:2px;">
  1711. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  1712. </div>
  1713. <script>$('.toolbar').authorizeButton()</script>
  1714. </div>
  1715. <div class="search">
  1716. <table>
  1717. <tr>
  1718. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  1719. <td>
  1720. <div class="input-group">
  1721. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  1722. </div>
  1723. </td>
  1724. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  1725. <td class="HideItems">
  1726. <div class="input-group HideItems">
  1727. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  1728. </div>
  1729. </td>
  1730. <td class="HideItems" style="text-align:right;" ><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  1731. <td class="HideItems">
  1732. <div class="input-group HideItems">
  1733. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  1734. </div>
  1735. </td>
  1736. </tr>
  1737. <tr>
  1738. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  1739. <td>
  1740. <div class="input-group">
  1741. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  1742. </div>
  1743. </td>
  1744. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  1745. <td>
  1746. <div class="input-group">
  1747. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  1748. </div>
  1749. </td>
  1750. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  1751. <td>
  1752. <div class="input-group">
  1753. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  1754. </div>
  1755. </td>
  1756. <td>
  1757. <span class="input-group-btn">
  1758. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  1759. </span>
  1760. </td>
  1761. </tr>
  1762. </table>
  1763. </div>
  1764. </div>
  1765. <div class="gridPanel">
  1766. <table id="gridList"></table>
  1767. <div id="gridPager"></div>
  1768. </div>