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.

755 lines
35 KiB

10 months ago
1 year ago
1 year ago
1 year 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 Name = "单据号";
  10. var ColModelMain = [];
  11. var ColModelSub = [];
  12. $(function () {
  13. SetCols();
  14. if (Type == '3' ) {
  15. $(".HideItems").css('display', 'none');
  16. }
  17. $("#POCodeShowLable").text(Name);
  18. if (Type != '3') {
  19. $("#GDLX").css('display', 'none');
  20. $("#GDLX2").css('display', 'none');
  21. }
  22. if (Type == '3') {
  23. $(".GDLX").css('display', 'block');
  24. Select_SelGDLX();
  25. gridList3();
  26. }
  27. //副产品
  28. if (Type == '18') {
  29. gridList18();
  30. }
  31. })
  32. function SetCols() {
  33. $.ajax({
  34. url: "/Print/SelectColumnName?" + Math.random(),
  35. dataType: "json",
  36. async: false,
  37. success: function (data) {
  38. var cols = new Array();
  39. var cols1 = new Array();
  40. if (Type == '3') {
  41. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  42. cols.push(collast);
  43. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  44. cols.push(collast);
  45. var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
  46. cols.push(collast);
  47. var collast = { label: '工单类型', name: 'MoType', width: 100, align: 'left' };
  48. cols.push(collast);
  49. var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true };
  50. cols.push(collast);
  51. var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
  52. cols.push(collast);
  53. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  54. cols.push(collast);
  55. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  56. cols.push(collast);
  57. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  58. cols.push(collast);
  59. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  60. cols.push(collast);
  61. var collast = {
  62. label: "状态", name: "MOStatus", width: 60, align: "left",
  63. formatter: function (cellvalue) {
  64. if (cellvalue == "1") {
  65. return "初始";
  66. } else if (cellvalue == "2") {
  67. return "下发";
  68. }
  69. else if (cellvalue == "3") {
  70. return "关单";
  71. }
  72. else { return ""; }
  73. }
  74. };
  75. cols.push(collast);
  76. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  77. cols.push(collast);
  78. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  79. cols.push(collast);
  80. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  81. //cols.push(collast);
  82. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  83. cols.push(collast);
  84. //var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' };
  85. //cols.push(collast);
  86. var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' };
  87. cols.push(collast);
  88. var collast = { label: '类型值', name: 'MoTypeValue', hidden: true };
  89. cols.push(collast);
  90. var collast = { label: '料品是否启用辅计量', name: 'AmountEnable', hidden: true };
  91. cols.push(collast);
  92. $.ajax({
  93. url: "/Print/SelectTableColumnName?" + Math.random(),
  94. dataType: "json",
  95. async: false,
  96. success: function (data) {
  97. if (data != null && data.length > 0) {
  98. DateList = data;
  99. for (var i = 0; i < data.length; i++) {
  100. var TableCode = data[i].TableCode;
  101. if (TableCode == "ICSMO") {
  102. var Code = data[i].Code;
  103. var Name = data[i].Name;
  104. var obj = new Array();
  105. obj = {
  106. label: Name,
  107. name: Code,
  108. width: 80,
  109. align: "left"
  110. }
  111. cols.push(obj);
  112. }
  113. if (TableCode == "ICSInventory") {
  114. var Code = data[i].Code;
  115. var Name = data[i].Name;
  116. var obj = new Array();
  117. obj = {
  118. label: Name,
  119. name: Code,
  120. width: 80,
  121. align: "left"
  122. }
  123. cols.push(obj);
  124. //cols1.push(obj);
  125. }
  126. }
  127. }
  128. _Clos = cols;
  129. //_Clos1 = cols1;
  130. }
  131. });
  132. }
  133. //副产品生成条码
  134. if (Type == '18') {
  135. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  136. cols.push(collast);
  137. var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
  138. cols.push(collast);
  139. var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
  140. cols.push(collast);
  141. var collast = { label: '工单类型', name: 'MoType', width: 100, align: 'left' };
  142. cols.push(collast);
  143. var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
  144. cols.push(collast);
  145. var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 100, align: 'left' };
  146. cols.push(collast);
  147. var collast = { label: '料品编码(母)', name: 'MInvCode', width: 100, align: 'left' };
  148. cols.push(collast);
  149. var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
  150. cols.push(collast);
  151. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  152. cols.push(collast);
  153. var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
  154. cols.push(collast);
  155. var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  156. cols.push(collast);
  157. var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
  158. cols.push(collast);
  159. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  160. cols.push(collast);
  161. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  162. //cols.push(collast);
  163. var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
  164. cols.push(collast);
  165. var collast = { label: '工单关联ID', name: 'MODetailID', hidden: true };
  166. cols.push(collast);
  167. var collast = { label: '类型值', name: 'MoTypeValue', hidden: true };
  168. cols.push(collast);
  169. var collast = { label: '料品是否启用辅计量', name: 'AmountEnable', hidden: true };
  170. cols.push(collast);
  171. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  172. //cols.push(collast);
  173. $.ajax({
  174. url: "/Print/SelectTableColumnName?" + Math.random(),
  175. dataType: "json",
  176. async: false,
  177. success: function (data) {
  178. if (data != null && data.length > 0) {
  179. DateList = data;
  180. for (var i = 0; i < data.length; i++) {
  181. var TableCode = data[i].TableCode;
  182. if (TableCode == "ICSMOPick") {
  183. var Code = data[i].Code;
  184. var Name = data[i].Name;
  185. var obj = new Array();
  186. obj = {
  187. label: Name,
  188. name: Code,
  189. width: 80,
  190. align: "left"
  191. }
  192. cols.push(obj);
  193. }
  194. if (TableCode == "ICSInventory") {
  195. var Code = data[i].Code;
  196. var Name = data[i].Name;
  197. var obj = new Array();
  198. obj = {
  199. label: Name,
  200. name: Code,
  201. width: 80,
  202. align: "left"
  203. }
  204. cols.push(obj);
  205. //cols1.push(obj);
  206. }
  207. }
  208. }
  209. _Clos = cols;
  210. //_Clos1 = cols1;
  211. }
  212. });
  213. }
  214. var cols1 = new Array();
  215. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  216. cols1.push(collast1);
  217. var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
  218. cols1.push(collast1);
  219. var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
  220. cols1.push(collast1);
  221. var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
  222. cols1.push(collast1);
  223. var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
  224. cols1.push(collast1);
  225. var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
  226. cols1.push(collast1);
  227. var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
  228. cols1.push(collast1);
  229. var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
  230. cols1.push(collast1);
  231. var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
  232. cols1.push(collast1);
  233. var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
  234. cols1.push(collast1);
  235. var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' };
  236. cols1.push(collast1);
  237. var collast1 = { label: '是否免检', name: 'isExemption', width: 100, align: 'left' };
  238. cols1.push(collast1);
  239. var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
  240. cols1.push(collast1);
  241. var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
  242. cols1.push(collast1);
  243. if (data != null && data.length > 0) {
  244. DateList = data;
  245. for (var i = 0; i < data.length; i++) {
  246. var ColName = data[i].ColName;
  247. var ColCode = data[i].ColCode;
  248. var obj = new Array();
  249. obj = {
  250. label: ColName,
  251. name: ColCode,
  252. width: 80,
  253. align: "left"
  254. }
  255. cols.push(obj);
  256. cols1.push(obj);
  257. }
  258. }
  259. _Clos = cols;
  260. _Clos1 = cols1;
  261. }
  262. });
  263. }
  264. //成品
  265. function gridList3() {
  266. var $gridList = $("#gridList");
  267. var queryJson = {
  268. POCode: $("#txt_POCode").val(),
  269. InvCode: $("#txt_InvCode").val(),
  270. InvName: $("#txt_InvName").val(),
  271. BatchCode: $("#txt_BatchCode").val(),
  272. POStatus: $("#selShow").val(),
  273. SelGDLX: $("#SelGDLX option:checked").val(),
  274. }
  275. $gridList.dataGrid({
  276. url: "/OMAY/ICSMoCreateLot/GetGridJsonChengPing" + "?" + Math.random(),
  277. postData: { queryJson: JSON.stringify(queryJson) },
  278. height: $(window).height() - 200,
  279. width: $(window).width() - 300,
  280. colModel: _Clos,
  281. width: "100%",
  282. autowidth: true,
  283. gridComplete: function () {
  284. },
  285. pager: "#gridPager",
  286. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  287. sortorder: "asc",
  288. viewrecords: true,
  289. multiselect: true,
  290. subGrid: true, // (1)开启子表格支持
  291. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  292. $("#gridList").jqGrid("setSelection", rowid, false);
  293. bindSubGrid3(subgrid_id, rowid)
  294. }
  295. });
  296. $("#warehouse a.btn-default").click(function () {
  297. $("#warehouse a.btn-default").removeClass("active");
  298. $(this).addClass("active");
  299. $('#btn_search').trigger("click");
  300. });
  301. $("#btn_search").click(function () {
  302. var warehouse = $("#warehouse a.active").attr('data-value');
  303. var queryJson = {
  304. POCode: $("#txt_POCode").val(),
  305. InvCode: $("#txt_InvCode").val(),
  306. InvName: $("#txt_InvName").val(),
  307. BatchCode: $("#txt_BatchCode").val(),
  308. POStatus: $("#selShow").val(),
  309. SelGDLX: $("#SelGDLX option:checked").val(),
  310. }
  311. $gridList.jqGrid('setGridParam', {
  312. postData: { queryJson: JSON.stringify(queryJson) },
  313. }).trigger('reloadGrid');
  314. });
  315. }
  316. function bindSubGrid3(subgrid_id, rowid) {
  317. $("#gridList").jqGrid("setSelection", rowid, false);
  318. var subgrid_table_id;
  319. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  320. var subgrid_pager_id;
  321. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  322. // (5)动态添加子报表的table和pager
  323. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  324. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  325. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  326. // (6)创建jqGrid对象
  327. $("#" + subgrid_table_id).dataGrid({
  328. cellEdit: true,
  329. url: "/OMAY/ICSMoCreateLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  330. colModel: _Clos1,
  331. //colModel: ColModelSub,
  332. shrinkToFit: true,//宽度自适应
  333. multiselect: true,
  334. prmNames: { search: "search" },
  335. viewrecords: true,
  336. height: "100%",
  337. rowNum: 20,
  338. pager: subgrid_pager_id,
  339. });
  340. }
  341. function gridList18() {
  342. var $gridList = $("#gridList");
  343. var queryJson = {
  344. POCode: $("#txt_POCode").val(),
  345. InvCode: $("#txt_InvCode").val(),
  346. InvName: $("#txt_InvName").val(),
  347. BatchCode: $("#txt_BatchCode").val(),
  348. POStatus: $("#selShow").val()
  349. }
  350. $gridList.dataGrid({
  351. url: "/OMAY/ICSMoCreateLot/GetGridJsonFCP" + "?" + Math.random(),
  352. postData: { queryJson: JSON.stringify(queryJson) },
  353. height: $(window).height() - 200,
  354. width: $(window).width() - 300,
  355. colModel: _Clos,
  356. width: "100%",
  357. autowidth: true,
  358. //shrinkToFit: true,
  359. gridComplete: function () {
  360. },
  361. pager: "#gridPager",
  362. // sortname: 'MOCode,cast(Sequence as int)',
  363. sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
  364. sortorder: "asc",
  365. viewrecords: true,
  366. multiselect: true,
  367. //beforeSelectRow: function (rowid, e) {
  368. // $("#gridList").jqGrid('resetSelection');
  369. // return (true);
  370. //},
  371. subGrid: true, // (1)开启子表格支持
  372. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  373. $("#gridList").jqGrid("setSelection", rowid, false);
  374. bindSubGrid18(subgrid_id, rowid)
  375. }
  376. });
  377. $("#warehouse a.btn-default").click(function () {
  378. $("#warehouse a.btn-default").removeClass("active");
  379. $(this).addClass("active");
  380. $('#btn_search').trigger("click");
  381. });
  382. $("#btn_search").click(function () {
  383. var warehouse = $("#warehouse a.active").attr('data-value');
  384. var queryJson = {
  385. POCode: $("#txt_POCode").val(),
  386. InvCode: $("#txt_InvCode").val(),
  387. InvName: $("#txt_InvName").val(),
  388. BatchCode: $("#txt_BatchCode").val(),
  389. POStatus: $("#selShow").val()
  390. }
  391. $gridList.jqGrid('setGridParam', {
  392. postData: { queryJson: JSON.stringify(queryJson) },
  393. }).trigger('reloadGrid');
  394. });
  395. }
  396. function bindSubGrid18(subgrid_id, rowid) {
  397. $("#gridList").jqGrid("setSelection", rowid, false);
  398. var subgrid_table_id;
  399. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  400. var subgrid_pager_id;
  401. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  402. // (5)动态添加子报表的table和pager
  403. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  404. var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
  405. var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  406. // (6)创建jqGrid对象
  407. $("#" + subgrid_table_id).dataGrid({
  408. cellEdit: true,
  409. url: "/OMAY/ICSMoCreateLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  410. colModel: _Clos1,
  411. //colModel: ColModelSub,
  412. shrinkToFit: true,//宽度自适应
  413. multiselect: true,
  414. prmNames: { search: "search" },
  415. viewrecords: true,
  416. height: "100%",
  417. rowNum: 20,
  418. pager: subgrid_pager_id,
  419. });
  420. }
  421. function btnDelete() {
  422. var objArr = '';
  423. var obj = $("#gridList").jqGrid("getRowData");
  424. for (var i = 0; i < obj.length; i++) {
  425. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  426. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  427. if (rowData != "undefined" && rowData != null) {
  428. for (var j = 0; j < rowData.length; j++) {
  429. objArr += "'" + rowData[j] + "',";
  430. }
  431. }
  432. }
  433. if (objArr == "") {
  434. $.modalAlertNew("WMS00099");
  435. return;
  436. }
  437. $.deleteForm({
  438. url: "/WMS/WMSCreateItemLot/DeleteItemLot",
  439. param: { keyValue: JSON.stringify(objArr) },
  440. success: function () {
  441. $.currentWindow().$("#gridList").trigger("reloadGrid");
  442. }
  443. })
  444. }
  445. function dateChange(num, date) {
  446. if (!date) {
  447. date = new Date();//没有传入值时,默认是当前日期
  448. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  449. }
  450. date += " 00:00:00";//设置为当天凌晨12点
  451. date = Date.parse(new Date(date)) / 1000;//转换为时间戳
  452. date += (86400) * num;//修改后的时间戳
  453. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  454. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  455. }
  456. function btnCreate() {
  457. debugger;
  458. var PoStatus;
  459. var jsonData = '';
  460. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  461. if (ids.length != 1) {
  462. $.modalAlertNew("WMS00100");
  463. return;
  464. }
  465. var POCode = "";
  466. var PORow = "";
  467. if (Type == '3') {
  468. for (var i in ids) {
  469. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  470. MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  471. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  472. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
  473. MoTypeValue = $("#gridList").jqGrid('getRowData', ids[i]).MoTypeValue;
  474. AmountEnable = $("#gridList").jqGrid('getRowData', ids[i]).AmountEnable;
  475. }
  476. $.modalOpen({
  477. id: "FormAddItemLot",
  478. title: "成品条码产生",
  479. url: "/OMAY/ICSMoCreateLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&MoTypeValue=" + MoTypeValue + "&AmountEnable=" + AmountEnable + "&" + Math.random(),
  480. width: "550px",
  481. height: "1000px",
  482. callBack: function (iframeId) {
  483. top.frames[iframeId].submitForm();
  484. }
  485. });
  486. }
  487. else if (Type == '18') {
  488. for (var i in ids) {
  489. FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
  490. Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
  491. MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
  492. InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
  493. MoTypeValue = $("#gridList").jqGrid('getRowData', ids[i]).MoTypeValue;
  494. AmountEnable = $("#gridList").jqGrid('getRowData', ids[i]).AmountEnable;
  495. }
  496. $.modalOpen({
  497. id: "FormAddItemLot",
  498. title: "副产品生成条码",
  499. url: "/OMAY/ICSMoCreateLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&MODetailID=" + MODetailID + "&MoTypeValue=" + MoTypeValue + "&AmountEnable=" + AmountEnable + "&" + Math.random(),
  500. width: "550px",
  501. height: "1000px",
  502. callBack: function (iframeId) {
  503. top.frames[iframeId].submitForm();
  504. }
  505. });
  506. }
  507. }
  508. function fullscreen() {
  509. var docElm = document.documentElement;
  510. if (docElm.requestFullscreen) {
  511. docElm.requestFullscreen();
  512. } else if (docElm.mozRequestFullScreen) {
  513. docElm.mozRequestFullScreen();
  514. } else if (docElm.webkitRequestFullScreen) {
  515. docElm.webkitRequestFullScreen();
  516. } else if (docElm.msRequestFullscreen) {
  517. docElm.msRequestFullscreen();
  518. }
  519. $(window).bind('resize', function () {
  520. $("#gridList").setGridWidth($(window).width());
  521. }).trigger('resize');
  522. $(window).bind('resize', function () {
  523. $("#gridList").setGridHeight($(window).height());
  524. }).trigger('resize');
  525. }
  526. function btnPrint() {
  527. debugger;
  528. var mold = '';
  529. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  530. if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
  531. var objArr = '';
  532. var arr = [];
  533. var obj = $("#gridList").jqGrid("getRowData");
  534. for (var i = 0; i < obj.length; i++) {
  535. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  536. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  537. if (rowData != "undefined" && rowData != null && rowData.length != 0) {
  538. for (var j = 0; j < rowData.length; j++) {
  539. objArr += "'" + rowData[j] + "',";
  540. }
  541. objArr = objArr.slice(0, objArr.length - 1);
  542. objArr = "" + objArr + "|";
  543. arr.push(objArr);
  544. }
  545. }
  546. if (objArr == "") {
  547. $.modalAlertNew("WMS00101");
  548. return;
  549. }
  550. $.modalOpen({
  551. id: "PrintLot",
  552. title: "打印",
  553. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  554. width: "550px",
  555. height: "1000px",
  556. callBack: function (iframeId) {
  557. top.frames[iframeId].submitForm();
  558. }
  559. });
  560. }
  561. function btn_ExportAll() {
  562. debugger;
  563. var objArr = '';
  564. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  565. for (var i in ids) {
  566. objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',";
  567. }
  568. if (objArr=="") {
  569. $.modalAlert("请选择单据后导出!");
  570. return;
  571. }
  572. var postData = "&Type=" + Type + "";
  573. //postData += "&ID=" + ID
  574. postData += "&ID=" + objArr;
  575. $.download("/WMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post');
  576. }
  577. function Select_SelGDLX() {
  578. $("#SelGDLX").find("option").remove();
  579. var DeptName = $("#SelGDLX option:checked").text();
  580. $("#SelGDLX").append("<option value=''>--请选择--</option>");
  581. $.ajax({
  582. url: "/WMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(),
  583. dataType: "json",
  584. async: false,
  585. success: function (data) {
  586. if (data != null && data.length > 0) {
  587. for (var i = 0; i < data.length; i++) {
  588. $("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
  589. }
  590. }
  591. }
  592. });
  593. $("#SelGDLX option:checked").val('');
  594. }
  595. </script>
  596. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  597. <script>
  598. </script>
  599. <div class="topPanel" style="height:100px;">
  600. <div class="toolbar">
  601. <div class="btn-group">
  602. <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>
  603. <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>
  604. <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>
  605. @*<a id="NF-ExportAll" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ExportAll()"><i class="fa fa-pencil-square-o"></i>导出</a>*@
  606. @*<a id="NF-ExportAll" authorize="yes" class="btn btn-default" onclick="btn_ExportAll()"><i class="fa fa-download"></i>导出</a>*@
  607. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  608. </div>
  609. <div class="btn-group" style="display:block;padding-left:2px;">
  610. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  611. </div>
  612. <script>$('.toolbar').authorizeButton()</script>
  613. </div>
  614. <div class="search">
  615. <table>
  616. <tr>
  617. <td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;</label>:</td>
  618. <td class="POCodeShow">
  619. <div class="input-group">
  620. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  621. </div>
  622. </td>
  623. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  624. <td class="HideItems">
  625. <div class="input-group HideItems">
  626. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  627. </div>
  628. </td>
  629. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  630. <td class="HideItems">
  631. <div class="input-group HideItems">
  632. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  633. </div>
  634. </td>
  635. </tr>
  636. <tr>
  637. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  638. <td>
  639. <div class="input-group">
  640. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  641. </div>
  642. </td>
  643. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  644. <td>
  645. <div class="input-group">
  646. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  647. </div>
  648. </td>
  649. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  650. <td>
  651. <div class="input-group">
  652. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  653. </div>
  654. </td>
  655. <td>
  656. <label>&nbsp;&nbsp;&nbsp;是否全部生成:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  657. </td>
  658. <td>
  659. <div class="input-group">
  660. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  661. <option value="0">显示全部</option>
  662. <option value="1">已全部生成</option>
  663. <option value="2" selected="selected">未全部生成</option>
  664. </select>
  665. </div>
  666. </td>
  667. <td id="GDLX">
  668. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  669. </td>
  670. <td id="GDLX2">
  671. <div class="input-group">
  672. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 100px;"></select>
  673. </div>
  674. </td>
  675. @*<td class="GDLX" style="display:none">
  676. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  677. </td>
  678. <td class="GDLX" style="display:none">
  679. <div class="input-group">
  680. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  681. <option value="0">显示全部</option>
  682. <option value="1">已全部生成</option>
  683. <option value="2" selected="selected">未全部生成</option>
  684. </select>
  685. </div>
  686. </td>*@
  687. <td>
  688. <span class="input-group-btn">
  689. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  690. </span>
  691. </td>
  692. </tr>
  693. </table>
  694. </div>
  695. </div>
  696. <div class="gridPanel">
  697. <table id="gridList"></table>
  698. <div id="gridPager"></div>
  699. </div>