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.

759 lines
32 KiB

  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  6. <script>
  7. debugger;
  8. var myDate = new Date;
  9. var year = myDate.getFullYear(); //获取当前年
  10. var mon = myDate.getMonth() + 1 < 10 ? "0" + (myDate.getMonth() + 1) : myDate.getMonth() + 1; //获取当前月
  11. var date = myDate.getDate() + 1 < 10 ? "0" + myDate.getDate() : myDate.getDate(); //获取当前日
  12. var MtimeFrom = year + "-" + mon + "-" + date;
  13. var MtimeArrive = year + "-" + mon + "-" + date;
  14. var _Clos = new Array();
  15. var _Clos1 = new Array();
  16. var flag = '1';
  17. var mark = '';
  18. var Arguments = '';
  19. $(function () {
  20. $("#TimeFrom").val(MtimeFrom);
  21. $("#TimeArrive").val(MtimeArrive);
  22. SetCols();
  23. GetPickingListType();
  24. gridList();
  25. gridList2(flag);
  26. });
  27. function Selchange() {
  28. //$("#txt_Mechanism").val("");
  29. var Type = $("#selShow").val();
  30. if (Type=='1') {
  31. $(".Mechanism").css('display', 'table-cell');
  32. }
  33. else {
  34. $(".Mechanism").css('display', 'none');
  35. }
  36. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  37. gridList();
  38. }
  39. function SetCols() {
  40. $.ajax({
  41. url: "/Print/SelectColumnName?" + Math.random(),
  42. dataType: "json",
  43. async: false,
  44. success: function (data) {
  45. var cols = new Array();
  46. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  47. cols.push(collast);
  48. var collast = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  49. cols.push(collast);
  50. var collast = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
  51. cols.push(collast);
  52. var collast = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
  53. cols.push(collast);
  54. var collast = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
  55. cols.push(collast);
  56. var collast = { label: '拣料ID', name: 'IsNew', width: 80, align: 'left' };
  57. cols.push(collast);
  58. var collast = { label: '是否占料', name: 'IsOccupy', width: 80, align: 'left' };
  59. cols.push(collast);
  60. var cols1 = new Array();
  61. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  62. cols1.push(collast1);
  63. var collast1 = { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' };
  64. cols1.push(collast1);
  65. var collast1 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  66. cols1.push(collast1);
  67. var collast1 = { label: '单据行号', name: 'Sequence', width: 120, align: 'left' };
  68. cols1.push(collast1);
  69. var collast1 = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' };
  70. cols1.push(collast1);
  71. var collast1 = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
  72. cols1.push(collast1);
  73. var collast1 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  74. cols1.push(collast1);
  75. var collast1 = { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' };
  76. cols1.push(collast1);
  77. var collast1 = { label: 'SendQTY', name: 'SendQTY', width: 100, align: 'left', hidden: true };
  78. cols1.push(collast1);
  79. var collast1 = { label: '单位', name: 'InvUnit', width: 150, align: 'left' };
  80. cols1.push(collast1);
  81. var collast1 = { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' };
  82. cols1.push(collast1);
  83. var collast1 = { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' };
  84. cols1.push(collast1);
  85. var collast1 = { label: '条码库存', name: 'QTY', width: 100, align: 'left' };
  86. cols1.push(collast1);
  87. var collast1 = { label: '条码', name: 'LotNO', width: 100, align: 'left' };
  88. cols1.push(collast1);
  89. var cols2 = new Array();
  90. var collast2 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  91. cols2.push(collast2);
  92. var collast2 = { label: '单据行号', name: 'Sequence', width: 100, align: 'left' };
  93. cols2.push(collast2);
  94. var collast2 = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
  95. cols2.push(collast2);
  96. var collast2 = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  97. cols2.push(collast2);
  98. var collast2 = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  99. cols2.push(collast2);
  100. var collast2 = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' };
  101. cols2.push(collast2);
  102. var collast2 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  103. cols2.push(collast2);
  104. var collast2 = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  105. cols2.push(collast2);
  106. var collast2 = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
  107. cols2.push(collast2);
  108. var collast2 = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  109. cols2.push(collast2);
  110. var collast2 = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
  111. cols2.push(collast2);
  112. var collast2 = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
  113. cols2.push(collast2);
  114. var collast2 = { label: '仓库编码', name: 'WHCode', width: 80, align: 'left' };
  115. cols2.push(collast2);
  116. var collast2 = { label: '仓库名称', name: 'WarehouseName', width: 80, align: 'left' };
  117. cols2.push(collast2);
  118. if (data != null && data.length > 0) {
  119. DateList = data;
  120. for (var i = 0; i < data.length; i++) {
  121. var ColName = data[i].ColName;
  122. var ColCode = data[i].ColCode;
  123. var obj = new Array();
  124. obj = {
  125. label: ColName,
  126. name: ColCode,
  127. width: 80,
  128. align: "left"
  129. }
  130. //cols.push(obj);
  131. //cols1.push(obj);
  132. cols2.push(obj);
  133. }
  134. }
  135. _Clos = cols;
  136. _Clos1 = cols1;
  137. _Clos2 = cols2;
  138. }
  139. });
  140. }
  141. function gridList() {
  142. var Type = $("#selShow").val();
  143. var $gridList = $("#gridList");
  144. var queryJson = {
  145. POCode: $("#txt_POCode").val(),
  146. InvCode: $("#txt_InvCode").val(),
  147. TimeFrom: $("#TimeFrom").val(),
  148. TimeArrive: $("#TimeArrive").val(),
  149. }
  150. $gridList.dataGrid({
  151. url: "/WMS/PickMaterial/GetGridJson? " + Math.random(),
  152. postData: { queryJson: JSON.stringify(queryJson), Type: Type },
  153. //height: 280,
  154. //width: 300,
  155. height: $(window).height() - 550,
  156. width: $(window).width() - 500,
  157. colModel: _Clos,
  158. //colModel: [
  159. // { label: "主键", name: "ID", hidden: true, key: true },
  160. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  161. // { label: '操作日期', name: 'MTIME', width: 150, align: 'left' },
  162. // { label: '维护人', name: 'MUSER', width: 80, align: 'left' },
  163. // { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' },
  164. // { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' },
  165. //],
  166. shrinkToFit: false,//宽度自适应
  167. autowidth: true,
  168. gridComplete: function () {
  169. },
  170. rowNum: 10000,
  171. autoScroll: true,
  172. sortname: 'Code',
  173. sortorder: "desc",
  174. viewrecords: true,
  175. multiselect: true,
  176. subGrid: true, // (1)开启子表格支持
  177. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  178. $("#gridList").jqGrid("setSelection", rowid, false);
  179. bindSubGrid(subgrid_id, rowid)
  180. },
  181. gridComplete: function () {
  182. debugger;
  183. var strIds = $("#gridList").jqGrid("getDataIDs");
  184. }
  185. });
  186. }
  187. function bindSubGrid(subgrid_id, rowid) {
  188. var Type = $("#selShow").val();
  189. var InvCode = $("#txt_InvCode").val();
  190. var Mechanism = $("#txt_Mechanism").val();
  191. $("#gridList").jqGrid("setSelection", rowid, false);
  192. var subgrid_table_id;
  193. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  194. var subgrid_pager_id;
  195. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  196. // (5)动态添加子报表的table和pager
  197. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  198. var Code = $("#gridList").jqGrid('getRowData', rowid).Code;
  199. //var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  200. // (6)创建jqGrid对象
  201. $("#" + subgrid_table_id).dataGrid({
  202. cellEdit: true,
  203. url: "/WMS/PickMaterial/GetSubGridJson?Code=" + Code + "&Type=" + Type + "&Mechanism=" + Mechanism + "&InvCode=" + InvCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  204. //colModel: [
  205. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  206. // { label: '单据行号', name: 'Sequence', width: 100, align: 'left' },
  207. // { label: '操作日期', name: 'MTIME', width: 150, align: 'left' },
  208. // { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' },
  209. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  210. // { label: '料品名称', name: 'InvName', width: 100, align: 'left' },
  211. // { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' },
  212. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  213. // { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  214. // { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' },
  215. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  216. // { label: '维护人', name: 'MUSER', width: 80, align: 'left' },
  217. // { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' },
  218. // { label: '仓库编码', name: 'WHCode', width: 80, align: 'left' },
  219. // { label: '仓库名称', name: 'WarehouseName', width: 80, align: 'left' },
  220. //],
  221. colModel: _Clos2,
  222. //colModel: ColModelSub,
  223. shrinkToFit: true,//宽度自适应
  224. sortname: 'Sequence',
  225. sortorder: "desc",
  226. //multiselect: true,
  227. prmNames: { search: "search" },
  228. viewrecords: true,
  229. height: "100%",
  230. rowNum: 20,
  231. pager: subgrid_pager_id,
  232. });
  233. }
  234. function gridList2(flag) {
  235. debugger;
  236. document.getElementById("gridPanel2").innerHTML = ' <span><strong>合并信息</strong></span> <table id="gridList2"></table>';//重置grid
  237. var Mechanism = $("#txt_Mechanism").val();
  238. var InvCode = $("#txt_InvCode").val();
  239. var Type = $("#selShow").val();
  240. var $gridList = $("#gridList2");
  241. var objArr = '';
  242. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  243. for (var i = 0; i < objList.length; i++) {
  244. var rowId = objList[i];
  245. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  246. if (flag == '1') {
  247. objArr += "'" + rowData.Code + "',";
  248. } else {
  249. objArr += "'" + rowData.Code + "',";
  250. }
  251. }
  252. $gridList.dataGrid({
  253. url: "/WMS/PickMaterial/GetICSMOPickMergeTemp?ID=" + objArr + "&Type=" + Type + "&flag=" + flag + "&Mechanism=" + Mechanism + "&InvCode=" + InvCode + "&" + Math.random(),
  254. height: 500,
  255. width: $(window).width() - 500,
  256. colModel: _Clos1,
  257. //colModel: [
  258. // { label: "主键", name: "ID", hidden: true, key: true },
  259. // { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' },
  260. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  261. // { label: '料品编码', name: 'InvCode', width: 150, align: 'left' },
  262. // { label: '料品名称', name: 'InvName', width: 150, align: 'left' },
  263. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  264. // { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' },
  265. // { label: '单位', name: 'InvUnit', width: 150, align: 'left' },
  266. // { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' },
  267. // { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' },
  268. // { label: '条码库存', name: 'QTY', width: 100, align: 'left' },
  269. // { label: '条码', name: 'LotNO', width: 100, align: 'left' },
  270. //],
  271. shrinkToFit: false,//宽度自适应
  272. autowidth: true,
  273. gridComplete: function () {
  274. },
  275. rowNum: 10000,
  276. sortorder: "desc",
  277. viewrecords: true,
  278. //multiselect: true,
  279. });
  280. }
  281. function btnMaterial() {
  282. debugger;
  283. var objArr = '';
  284. var arr = [];
  285. mark = '拣料';
  286. flag = '1';
  287. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  288. for (var i = 0; i < objList.length; i++) {
  289. var rowId = objList[i];
  290. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  291. if (rowData.IsNew != "") {
  292. $.modalAlertNew("WMS00091");
  293. return;
  294. }
  295. objArr += "'" + rowData.Code + "',";
  296. objArr = objArr.slice(0, objArr.length - 1);
  297. objArr = "" + objArr + "|";
  298. arr.push(objArr);
  299. }
  300. Arguments = arr;
  301. gridList2(flag);
  302. }
  303. function btnBackMaterial() {
  304. debugger;
  305. var objArr = '';
  306. var arr = [];
  307. var ICSASN = [];
  308. mark = '回撤拣料';
  309. flag = '1';
  310. //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  311. //for (var i = 0; i < objList.length; i++) {
  312. // var rowId = objList[i];
  313. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  314. // if (rowData.IsNew == "") {
  315. // $.modalAlertNew("WMS00091");//该单据未检料,请确认!
  316. // return;
  317. // }
  318. // objArr += "'" + rowData.Code + "',";
  319. // objArr = objArr.slice(0, objArr.length - 1);
  320. // objArr = "" + objArr + "|";
  321. // arr.push(objArr);
  322. //}
  323. //Arguments = arr;
  324. //gridList2(flag);
  325. debugger;
  326. mark = '回撤拣料';
  327. var sign = '';
  328. flag = '2';
  329. var Type = $("#selShow").val();
  330. var obj = '';
  331. var objArr = '';
  332. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  333. //if (objList.length < 2) {
  334. // $.modalAlertNew("WMS00092");
  335. // return;
  336. //}
  337. for (var i = 0; i < objList.length; i++) {
  338. var rowId = objList[i];
  339. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  340. if (rowData.IsOccupy == '已占料') {
  341. $.modalAlert("该单据已被占料,请至拣配查询页面查看!", "warning");
  342. return;
  343. }
  344. obj += rowData.Code + ",";
  345. objArr += "'" + rowData.Code + "',";
  346. var obj = {
  347. Code: rowData.Code
  348. };
  349. ICSASN.push(obj);
  350. }
  351. //var MergeID = rowData.Code;1 2
  352. //if (MergeID != '') {
  353. // $.modalAlertNew("WMS00091");
  354. // return;
  355. //}
  356. $.submitForm({
  357. url: "/WMS/PickMaterial/BackMergeMaterial?Type=" + Type + "&" + Math.random(),
  358. //param: {
  359. // keyValue: obj
  360. //},
  361. param: { keyValue: JSON.stringify(ICSASN) },
  362. success: function () {
  363. gridList2(flag);
  364. $.currentWindow().$("#gridList").trigger("reloadGrid");
  365. }
  366. })
  367. }
  368. function btnMergeMaterial() {
  369. debugger;
  370. mark = '合并拣料';
  371. var sign = '';
  372. flag = '2';
  373. var Type = $("#selShow").val();
  374. var Mechanism = $("#txt_Mechanism").val();
  375. if (Mechanism != "") {
  376. $.modalAlert("单据已开启部分拣料功能,无法合并拣料!", "warning");
  377. return;
  378. }
  379. var obj = '';
  380. var objArr = '';
  381. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  382. if (objList.length < 2) {
  383. $.modalAlertNew("WMS00092");
  384. return;
  385. }
  386. var aa = '';
  387. for (var i = 0; i < objList.length; i++) {
  388. var rowId = objList[i];
  389. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  390. if (rowData.IsOccupy=='已占料') {
  391. $.modalAlert("该单据已被占料,请至拣配查询页面查看!", "warning");
  392. return;
  393. }
  394. if (i == 0) {
  395. aa = rowData.IsNew;
  396. } else if (aa != rowData.IsNew && aa != '') {
  397. $.modalAlertNew("WMS00091");
  398. return;
  399. }
  400. obj += rowData.Code + ",";
  401. objArr += "'" + rowData.Code + "',";
  402. }
  403. if (aa != '') {
  404. gridList2(flag);
  405. $.currentWindow().$("#gridList").trigger("reloadGrid");
  406. } else {
  407. $.submitForm({
  408. url: "/WMS/PickMaterial/MergeMaterial?Type=" + Type + "&" + Math.random(),
  409. param: {
  410. keyValue: obj
  411. },
  412. success: function () {
  413. gridList2(flag);
  414. $.currentWindow().$("#gridList").trigger("reloadGrid");
  415. }
  416. })
  417. }
  418. }
  419. function btnPrint() {
  420. debugger;
  421. var Type = $("#selShow").val();
  422. var Mechanism = $("#txt_Mechanism").val();
  423. var InvCode = $("#txt_InvCode").val();
  424. var mold = '';
  425. if (mark == '') {
  426. $.modalAlertNew("WMS00093");
  427. return;
  428. }
  429. if (mark == '合并拣料') {
  430. var objArr = '';
  431. var arr = [];
  432. var obj_Item1 = $("#gridList2");
  433. var rowIds_Item1 = obj_Item1.getDataIDs();
  434. var arrayData_Item1 = new Array();
  435. var Enables = '';
  436. if (rowIds_Item1.length > 0) {
  437. debugger;
  438. for (var i = 0; i < rowIds_Item1.length; i++) {
  439. var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[0]);
  440. objArr += "'" + RowData_Item1.MergeID + "',";
  441. objArr = objArr.slice(0, objArr.length - 1);
  442. objArr = "" + objArr + "|";
  443. arr.push(objArr);
  444. }
  445. Arguments = arr;
  446. mold = 'HBJL00001';
  447. }
  448. }
  449. if (mark == '拣料') {
  450. var objArr = '';
  451. var arr = [];
  452. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  453. for (var i = 0; i < objList.length; i++) {
  454. var objArr = '';
  455. var rowId = objList[i];
  456. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  457. //if (Type = '1' && Mechanism != '') {
  458. // objArr += "'" + rowData.Code + Mechanism + "',";
  459. //} else if (Type = '1' && InvCode != '') {
  460. // objArr += "'" + rowData.Code + InvCode + "',";
  461. //} else if (Type = '1' && InvCode != '' && Mechanism != '') {
  462. // objArr += "'" + rowData.Code + Mechanism + InvCode + "',";
  463. //} else if (Type = '1'&& InvCode == '' && Mechanism == '') {
  464. // objArr += "'" + rowData.Code + "',";
  465. //}
  466. //else {
  467. objArr += "'" + rowData.Code + "',";
  468. //}
  469. objArr = objArr.slice(0, objArr.length - 1);
  470. objArr = "" + objArr + "|";
  471. arr.push(objArr);
  472. }
  473. Arguments = arr;
  474. mold = 'JL00001';
  475. }
  476. // sessionStorage.setItem("Arguments", Arguments); // 存储参数
  477. $.modalOpen({
  478. id: "PrintLot",
  479. title: "打印",
  480. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(Arguments)) + "&mold=" + mold + "&" + Math.random(),
  481. // url: "/WMS/Print/PrintView?&mold=" + mold + "&" + Math.random(),
  482. width: "550px",
  483. height: "1000px",
  484. callBack: function (iframeId) {
  485. top.frames[iframeId].submitForm();
  486. }
  487. });
  488. }
  489. function GetPickingListType() {
  490. $.ajax({
  491. url: "/WMS/PickMaterial/GetPickingListType",
  492. dataType: "json",
  493. async: false,
  494. success: function (data) {
  495. if (data != false && data != null && data.length > 0) {
  496. $("#selShow").find("option").remove();
  497. //$("#selShow").append("<option value=''>==请选择站点==</option>");
  498. for (var i = 0; i < data.length; i++) {
  499. $("#selShow").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
  500. }
  501. $("#selShow").val([data[0].Code]).trigger("change");
  502. }
  503. }
  504. });
  505. }
  506. function btnSave() {
  507. debugger;
  508. var sign = '';
  509. var Type = $("#selShow").val();
  510. var Mechanism = $("#txt_Mechanism").val();
  511. var array=[];
  512. if (Mechanism!="") {
  513. $.modalAlert("单据已开启部分拣料功能,无法保存!", "warning");
  514. return;
  515. }
  516. $.ajax({
  517. url: "/WMS/PickMaterial/SeachPickingListType" + "?" + Math.random() + "&Type=" + Type,
  518. dataType: "json",
  519. type: "post",
  520. async: false,
  521. success: function (data) {
  522. sign = data.count;
  523. }
  524. });
  525. if (sign!=true) {
  526. $.modalAlert("该类型单据暂未开启占料保存功能!", "warning");
  527. return;
  528. }
  529. var objLotNo='';
  530. var objArr = '';
  531. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  532. for (var i = 0; i < objList.length; i++) {
  533. var rowId = objList[i];
  534. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  535. //if (Number(rowData.iQuantity) > Number(rowData.QTY) && rowData.LotNO=="") {
  536. // $.modalAlert("单据:" + rowData.Code + ",行号:" + rowData.Sequence + "条码库存数量不足!", "warning");
  537. // return;
  538. //}
  539. objArr += "'" + rowData.Code + "',";
  540. }
  541. var obj_Item1 = $("#gridList2");
  542. var rowIds_Item1 = obj_Item1.getDataIDs();
  543. var arrayData_Item1 = new Array();
  544. if (rowIds_Item1.length > 0) {
  545. for (var i = 0; i < rowIds_Item1.length; i++) {
  546. var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
  547. /* if (RowData_Item1.LotNO != "") {*/
  548. var obj = {
  549. Code: RowData_Item1.Code,
  550. Sequence: RowData_Item1.Sequence,
  551. InvCode: RowData_Item1.InvCode,
  552. InvName: RowData_Item1.InvName,
  553. InvStd: RowData_Item1.InvStd,
  554. iQuantity: RowData_Item1.iQuantity,
  555. InvUnit: RowData_Item1.InvUnit,
  556. WarehouseCode: RowData_Item1.WarehouseCode,
  557. LocationCode: RowData_Item1.LocationCode,
  558. QTY: RowData_Item1.QTY,
  559. LotNO: RowData_Item1.LotNO,
  560. SendQTY: RowData_Item1.SendQTY
  561. };
  562. /* }*/
  563. array.push(obj)
  564. }
  565. }
  566. $.modalConfirm("确定占料保存吗?", function (r) {
  567. if (r) {
  568. $.submitForm({
  569. url: "/WMS/PickMaterial/SaveSeizeMaterial?flag=" + flag + "&Type=" + Type + "&ID=" + objArr + "&LotNoInfo=" + objLotNo + "&" + Math.random(),
  570. param: { keyValue: JSON.stringify(objArr), obj: JSON.stringify(array) },
  571. success: function () {
  572. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  573. }
  574. })
  575. }
  576. });
  577. }
  578. function fullscreen() {
  579. var docElm = document.documentElement;
  580. if (docElm.requestFullscreen) {
  581. docElm.requestFullscreen();
  582. } else if (docElm.mozRequestFullScreen) {
  583. docElm.mozRequestFullScreen();
  584. } else if (docElm.webkitRequestFullScreen) {
  585. docElm.webkitRequestFullScreen();
  586. } else if (docElm.msRequestFullscreen) {
  587. docElm.msRequestFullscreen();
  588. }
  589. $(window).bind('resize', function () {
  590. $("#gridList").setGridWidth($(window).width());
  591. }).trigger('resize');
  592. $(window).bind('resize', function () {
  593. $("#gridList").setGridHeight($(window).height());
  594. }).trigger('resize');
  595. }
  596. </script>
  597. <div class="topPanel" style="height:60px;">
  598. <div class="toolbar">
  599. <div class="btn-group">
  600. <a id="NF-Material" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnMaterial()"><i class="fa fa-pencil-square-o"></i>拣配</a>
  601. <a id="NF-MergeMaterial" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnMergeMaterial()"><i class="fa fa-pencil-square-o"></i>合并拣配</a>
  602. <a id="NF-BackMaterial" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBackMaterial()"><i class="fa fa-pencil-square-o"></i>回撤拣配</a>
  603. <a id="NF-Save" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnSave()"><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 class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  606. </div>
  607. <script>$('.toolbar').authorizeButton()</script>
  608. </div>
  609. <div class="search">
  610. <table>
  611. <tr>
  612. <td>
  613. <label>&nbsp;&nbsp;&nbsp;类型:</label>
  614. </td>
  615. <td>
  616. <div class="input-group">
  617. <select id="selShow" name="F_Target" class="form-control" style="width: 80px;" onchange="Selchange()">
  618. @*<option value="1" selected="selected">工单备料</option>
  619. <option value="2" selected="selected">工单领料</option>
  620. <option value="3" selected="selected">工单材料出库</option>
  621. <option value="4" selected="selected">委外备料</option>
  622. <option value="5" selected="selected">委外领料</option>
  623. <option value="6" selected="selected">委外材料出库</option>
  624. <option value="7" selected="selected">销售发货</option>
  625. <option value="8" selected="selected">其它出库</option>
  626. <option value="9" selected="selected">借用</option>
  627. <option value="10" selected="selected">物料调拨</option>
  628. <option value="11" selected="selected">两步调出</option>
  629. <option value="12" selected="selected">补料</option>*@
  630. </select>
  631. </div>
  632. </td>
  633. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  634. <td>
  635. <div class="input-group">
  636. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  637. </div>
  638. </td>
  639. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  640. <td>
  641. <div class="input-group">
  642. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  643. </div>
  644. </td>
  645. <td style="text-align:right;" class="Mechanism"><label class="lglabel" for="txt_Mechanism">&nbsp;&nbsp;&nbsp;机构</label>:</td>
  646. <td class="Mechanism">
  647. <div class="input-group">
  648. <input id="txt_Mechanism" type="text" class="form-control" style="width: 100px;">
  649. </div>
  650. </td>
  651. <td style="text-align:right;"><label class="lglabel" for="txt_TimeFrom">&nbsp;&nbsp;&nbsp;日期(从)</label>:</td>
  652. <td>
  653. <div class="input-group">
  654. <input id="TimeFrom" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" placeholder="日期(从)" />
  655. </div>
  656. </td>
  657. <td style="text-align:right;"><label class="lglabel" for="txt_TimeArrive">&nbsp;&nbsp;&nbsp;日期(到)</label>:</td>
  658. <td>
  659. <div class="input-group">
  660. <input id="TimeArrive" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" />
  661. </div>
  662. </td>
  663. <td>
  664. <span class="input-group-btn">
  665. <button id="btn_search" type="button" class="btn btn-primary" onclick="Selchange()"><i class="fa fa-search"></i></button>
  666. </span>
  667. </td>
  668. </tr>
  669. </table>
  670. </div>
  671. </div>
  672. <div class="gridPanel" id="gridPanel" style="width:99%">
  673. <span><strong>详细信息</strong></span>
  674. <table id="gridList"></table>
  675. </div>
  676. <div class="gridPanel" id="gridPanel2" style="width:99%">
  677. <span><strong>合并信息</strong></span>
  678. <table id="gridList2"></table>
  679. </div>