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

1061 lines
47 KiB

3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  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 _Clos = new Array();
  9. var _Clos1 = new Array();
  10. var flag = '1';
  11. var mark = '拣料';
  12. var Arguments = '';
  13. $.ajaxSettings.async = false;//设置全局同步
  14. //var PickID = '';
  15. $(function () {
  16. SetCols();
  17. gridList();
  18. gridList2(flag);
  19. });
  20. function Seach() {
  21. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  22. SetCols();
  23. gridList();
  24. }
  25. function SetCols() {
  26. var Type = $("#selShow").val();
  27. var ct = document.getElementById("type7");
  28. var ct1 = document.getElementById("type8");
  29. var ct2 = document.getElementById("type9");
  30. var ct3 = document.getElementById("type10");
  31. var ct4 = document.getElementById("status1")
  32. var ct5 = document.getElementById("status2")
  33. var ct6 = document.getElementById("order1")
  34. var ct7 = document.getElementById("order2")
  35. var ct8 = document.getElementById("date1");
  36. var ct9 = document.getElementById("date2");
  37. var ct10 = document.getElementById("date3");
  38. var ct11 = document.getElementById("date4");
  39. var cols = new Array();
  40. var collast = { label: "主键", name: "ID", hidden: true , key: true };
  41. cols.push(collast);
  42. var collast = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  43. cols.push(collast);
  44. var collast = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
  45. cols.push(collast);
  46. if (Type == 2 || Type == 12) {
  47. var collast = { label: '物料号(父项生产订单物料)', name: 'OrderInvCode', width: 150, align: 'left' };
  48. cols.push(collast);
  49. var collast = { label: '物料描述(父项生产订单主物料)', name: 'OrderInvDescribe', width: 200, align: 'left' };
  50. cols.push(collast);
  51. //var collast = { label: '调度工号', name: 'DispatchNumber', width: 120, align: 'left', };
  52. //cols.push(collast);
  53. var collast = { label: '拣料人姓名', name: 'PickName', width: 100, align: 'left' };
  54. cols.push(collast);
  55. var collast = { label: '收料人姓名', name: 'ReceiverName', width: 150, align: 'left' };
  56. cols.push(collast);
  57. var collast = { label: '需求日期', name: 'NeedDate', width: 120, align: 'left' };
  58. cols.push(collast);
  59. var collast = { label: '需求时间', name: 'NeedTime', width: 120, align: 'left', };
  60. cols.push(collast);
  61. //var collast = { label: '收料人工号', name: 'ReceiverNumber', width: 150, align: 'left' };
  62. //cols.push(collast);
  63. var collast = { label: '紧急程度', name: 'Urgency', width: 120, align: 'left', };
  64. cols.push(collast);
  65. var collast = { label: '调度人姓名', name: 'DispatcherName', width: 120, align: 'left' };
  66. cols.push(collast);
  67. var collast = { label: '工位', name: 'Desks', width: 100, align: 'left' };
  68. cols.push(collast);
  69. var collast = { label: '状态', name: 'Status', width: 150, align: 'center' };
  70. cols.push(collast);
  71. ct4.style.display = "";
  72. ct5.style.display = "";
  73. ct6.style.display = "";
  74. ct7.style.display = "";
  75. ct8.style.display = "";
  76. ct9.style.display = "";
  77. ct10.style.display = "";
  78. ct11.style.display = "";
  79. }
  80. else {
  81. ct4.style.display = "none";
  82. ct5.style.display = "none";
  83. ct6.style.display = "none";
  84. ct7.style.display = "none";
  85. ct8.style.display = "none";
  86. ct9.style.display = "none";
  87. ct10.style.display = "none";
  88. ct11.style.display = "none";
  89. }
  90. //var collast = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
  91. //cols.push(collast);
  92. //var collast = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
  93. //cols.push(collast);
  94. //var collast = { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' };
  95. //cols.push(collast);
  96. var collast = { label: '占料状态', name: 'IsOccupy', width: 80, align: 'left' };
  97. cols.push(collast);
  98. var cols1 = new Array();
  99. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  100. cols1.push(collast1);
  101. var collast1 = { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' };
  102. cols1.push(collast1);
  103. var collast1 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  104. cols1.push(collast1);
  105. var collast1 = { label: '单据行号', name: 'Sequence', hidden: true };
  106. cols1.push(collast1);
  107. var collast1 = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' };
  108. cols1.push(collast1);
  109. var collast1 = { label: '物料描述', name: 'InvName', width: 150, align: 'left' };
  110. cols1.push(collast1);
  111. var collast1 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  112. cols1.push(collast1);
  113. var collast1 = { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' };
  114. cols1.push(collast1);
  115. var collast1 = { label: '单位', name: 'InvUnit', width: 150, align: 'left' };
  116. cols1.push(collast1);
  117. var collast1 = { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' };
  118. cols1.push(collast1);
  119. var collast1 = { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' };
  120. cols1.push(collast1);
  121. var collast1 = { label: '条码库存', name: 'QTY', width: 100, align: 'left' };
  122. cols1.push(collast1);
  123. var collast1 = { label: '条码', name: 'LotNO', width: 100, align: 'left' };
  124. cols1.push(collast1);
  125. var collast1 = { label: '占料数量', name: 'SendQTY', hidden: true };
  126. cols1.push(collast1);
  127. if (Type != 7) {
  128. var collast = { label: '销售凭证', name: 'ProjectCode', width: 100, align: 'left' };
  129. cols.push(collast);
  130. var collast = { label: '销售凭证项号', name: 'Brand', width: 100, align: 'left' };
  131. cols.push(collast);
  132. ct.style.display = "none";
  133. ct1.style.display = "none";
  134. ct2.style.display = "none";
  135. ct3.style.display = "none";
  136. }
  137. else
  138. {
  139. var collast = { label: '客户编码', name: 'CusCode', width: 150, align: 'left' };
  140. cols.push(collast);
  141. var collast = { label: '客户名称', name: 'CusName', width: 150, align: 'left' };
  142. cols.push(collast);
  143. ct.style.display = "";
  144. ct1.style.display = "";
  145. ct2.style.display = "";
  146. ct3.style.display = "";
  147. }
  148. $.ajax({
  149. url: "/Print/SelectColumnName?" + Math.random(),
  150. dataType: "json",
  151. async: false,
  152. success: function (data) {
  153. if (data != null && data.length > 0) {
  154. DateList = data;
  155. for (var i = 0; i < data.length; i++) {
  156. var ColName = data[i].ColName;
  157. var ColCode = data[i].ColCode;
  158. var obj = new Array();
  159. obj = {
  160. label: ColName,
  161. name: ColCode,
  162. width: 80,
  163. align: "left"
  164. }
  165. if (ColCode != "BatchCode" && ColCode != "Brand" && ColCode != "ProjectCode")
  166. {
  167. cols.push(obj);
  168. cols1.push(obj);
  169. }
  170. }
  171. }
  172. _Clos = cols;
  173. _Clos1 = cols1;
  174. }
  175. });
  176. }
  177. function gridList() {
  178. var Type = $("#selShow").val();
  179. var $gridList = $("#gridList");
  180. var queryJson = {
  181. POCode: $("#txt_POCode").val(),
  182. InvCode: $("#txt_InvCode").val(),
  183. Area: $("#txt_Area").val(),
  184. WHCode: $("#txt_WHCode").val(),
  185. CusCode: $("#txt_CusCode").val(),
  186. CusName: $("#txt_CusName").val(),
  187. Status: $("#selShow2").val(),
  188. Order: $("#txt_Order").val(),
  189. Container: $('input[name="container"]:checked').val(),
  190. CreateDate: $("#txt_CreateDate").val(),
  191. NeedDate: $("#txt_NeedDate").val()
  192. }
  193. $gridList.dataGrid({
  194. //url: "/WMS/PickMaterial/GetGridJson?Type=" + Type + "&" + Math.random(),
  195. //postData: { queryJson: JSON.stringify(queryJson) },
  196. url: "/WMS/PickMaterial/GetGridJson?" + Math.random(),
  197. postData: { queryJson: JSON.stringify(queryJson),Type:Type },
  198. height: 280,
  199. width: $(window).width() - 500,
  200. colModel: _Clos,
  201. //colModel: [
  202. // { label: "主键", name: "ID", hidden: true, key: true },
  203. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  204. // { label: '操作日期', name: 'MTIME', width: 150, align: 'left' },
  205. // { label: '维护人', name: 'MUSER', width: 80, align: 'left' },
  206. // { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' },
  207. // { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' },
  208. //],
  209. shrinkToFit: false,//宽度自适应
  210. autowidth: true,
  211. gridComplete: function () {
  212. var strIds = $("#gridList").jqGrid("getDataIDs");
  213. for (var i = 0; i < strIds.length; i++) {
  214. var strValue = $("#gridList").jqGrid("getCell", strIds[i], "IsOccupy");//得到单元格数据
  215. if (strValue == "已占料") {
  216. $("#" + strIds[i]).find("td").css("background-color", "yellow");
  217. }
  218. }
  219. },
  220. //onLoadComplete: function(data) {
  221. // // 设置行选中
  222. // var PickID = $("#PickID").val();
  223. // if (PickID != '') {
  224. // var PickID = PickID.split(',');
  225. // for (var i = 0; i < PickID.length; i++) {
  226. // //$("#gridList").jqGrid('setSelection', PickID[i]);
  227. // // $("#gridList").jqGrid('setSelection', PickID[i]);
  228. // $('#gridList').jqGrid('setSelectionState', PickID[i], true);
  229. // // $('#gridList').jqGrid('setSelectionState', '17140e8d-5c4d-4f29-9913-5efc256f6e7f', true);
  230. // }
  231. // }
  232. //},
  233. rowNum: 10000,
  234. autoScroll: true,
  235. sortname: 'Code',
  236. sortorder: "desc",
  237. viewrecords: true,
  238. multiselect: true,
  239. subGrid: true, // (1)开启子表格支持
  240. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  241. $("#gridList").jqGrid("setSelection", rowid, false);
  242. bindSubGrid(subgrid_id, rowid)
  243. },
  244. //loadComplete: function () {
  245. // var ids = $gridList.getDataIDs();
  246. // for (var i = 0; i < ids.length; i++) {
  247. // var rowData = $gridList.getRowData(ids[i]);
  248. // if (rowData['Status'] == '未配料')
  249. // $('#' + ids[i]).css("color", "red");
  250. // }
  251. //}
  252. });
  253. function bindSubGrid(subgrid_id, rowid) {
  254. var Type = $("#selShow").val();
  255. $("#gridList").jqGrid("setSelection", rowid, false);
  256. var subgrid_table_id;
  257. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  258. var queryJson = {
  259. POCode: $("#txt_POCode").val(),
  260. InvCode: $("#txt_InvCode").val(),
  261. Area: $("#txt_Area").val(),
  262. WHCode: $("#txt_WHCode").val(),
  263. CusCode: $("#txt_CusCode").val(),
  264. CusName: $("#txt_CusName").val(),
  265. Order: $("#txt_Order").val(),
  266. Container: $("#txt_Container :checked").val(),
  267. CreateDate: $("#txt_CreateDate").val(),
  268. NeedDate: $("#txt_NeedDate").val()
  269. }
  270. var subgrid_pager_id;
  271. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  272. // (5)动态添加子报表的table和pager
  273. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  274. var Code = $("#gridList").jqGrid('getRowData', rowid).Code;
  275. //var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
  276. // (6)创建jqGrid对象
  277. var cols = [{ label: '单据号', name: 'Code', width: 120, align: 'left' },
  278. { label: '单据行号', name: 'Sequence', width: 120, align: 'left' },
  279. { label: '操作日期', name: 'MTIME', width: 120, align: 'left' },
  280. { label: '料品编码', name: 'InvCode', width: 120, align: 'left' },
  281. { label: '物料描述', name: 'InvName', width: 120, align: 'left' },
  282. { label: '辅助描述', name: 'InvDes', width: 120, align: 'left' },
  283. { label: '规格型号', name: 'InvStd', width: 120, align: 'left' },
  284. { label: '批次', name: 'BatchCode', width: 100, align: 'left' },
  285. { label: '区域', name: 'Area', width: 100, align: 'left' },
  286. { label: '仓库', name: 'WHCode', width: 100, align: 'left' },
  287. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  288. { label: '已发数量', name: 'IssueQuantity', width: 120, align: 'left' },
  289. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  290. { label: '维护人', name: 'MUSER', width: 120, align: 'left' },
  291. { label: '维护人名称', name: 'MUSERName', width: 150, align: 'left' },
  292. { label: '仓库编码', name: 'WHCode', width: 120, align: 'left' },
  293. { label: '仓库名称', name: 'WarehouseName', width: 120, align: 'left' },
  294. ];
  295. if (Type == '2' || Type == '12') {
  296. var collast = { label: "生产订单", name: "OrderNumber", width: 120, align: 'left' };
  297. cols.push(collast);
  298. var collast = { label: "单据类型", name: "EATTRIBUTE", width: 120, align: 'left' };
  299. cols.push(collast);
  300. var collast = { label: '套数', name: 'Sets', width: 50, align: 'left' };
  301. cols.push(collast);
  302. var collast = { label: '物料号(父项生产订单物料)', name: 'OrderInvCode', width: 150, align: 'left' };
  303. cols.push(collast);
  304. var collast = { label: '物料描述(父项生产订单主物料)', name: 'OrderInvDescribe', width: 150, align: 'left' };
  305. cols.push(collast);
  306. var collast = { label: '出入库', name: 'BillType', width: 100, align: 'left' };
  307. cols.push(collast);
  308. var collast = { label: '备注', name: 'Remarks', width: 150, align: 'left' };
  309. cols.push(collast);
  310. var collast = { label: '工位', name: 'Desks', width: 100, align: 'left' };
  311. cols.push(collast);
  312. var collast = { label: '调度工号', name: 'DispatchNumber', width: 120, align: 'left', };
  313. cols.push(collast);
  314. var collast = { label: '调度姓名', name: 'DispatcherName', width: 120, align: 'left' };
  315. cols.push(collast);
  316. var collast = { label: '收料人工号', name: 'ReceiverNumber', width: 150, align: 'left' };
  317. cols.push(collast);
  318. var collast = { label: '收料人姓名', name: 'ReceiverName', width: 150, align: 'left' };
  319. cols.push(collast);
  320. var collast = { label: '紧急程度', name: 'Urgency', width: 120, align: 'left', };
  321. cols.push(collast);
  322. var collast = { label: '需求日期', name: 'NeedDate', width: 120, align: 'left' };
  323. cols.push(collast);
  324. var collast = { label: '需求时间', name: 'NeedTime', width: 120, align: 'left', };
  325. cols.push(collast);
  326. var collast = { label: '备注项', name: 'RemarksTerm', width: 120, align: 'left' };
  327. cols.push(collast);
  328. var collast = { label: '工艺文本码', name: 'TextNumber', width: 150, align: 'left' };
  329. cols.push(collast);
  330. var collast = { label: '基本剂量单位', name: 'Unit', width: 150, align: 'left', };
  331. cols.push(collast);
  332. var collast = { label: '特殊库存标识', name: 'StockIndicator', width: 150, align: 'left' };
  333. cols.push(collast);
  334. }
  335. if (Type == '5') {
  336. var collast = { label: '采购订单', name: 'SourceCode', width: 120, align: 'left' };
  337. cols.push(collast);
  338. var collast = { label: '采购订单行号', name: 'SourceSequence', width: 120, align: 'left' };
  339. cols.push(collast);
  340. var collast = { label: '供应商编码', name: 'VenCode', width: 150, align: 'left' };
  341. cols.push(collast);
  342. var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' };
  343. cols.push(collast);
  344. }
  345. if (Type == '7') {
  346. var collast = { label: '站点', name: 'WorkPoint', width: 120, align: 'left' };
  347. cols.push(collast);
  348. var collast = { label: '装运点', name: 'Points', width: 120, align: 'left' };
  349. cols.push(collast);
  350. var collast = { label: '交货类型', name: 'DeliveryType', width: 150, align: 'left' };
  351. cols.push(collast);
  352. var collast = { label: '交货描述', name: 'DeliveryDescribe', width: 150, align: 'left' };
  353. cols.push(collast);
  354. var collast = { label: '辅助描述', name: 'OtherDescribe', width: 120, align: 'left' };
  355. cols.push(collast);
  356. var collast = { label: '销售单位', name: 'SalesUnit', width: 120, align: 'left' };
  357. cols.push(collast);
  358. var collast = { label: '序列号参数', name: 'IsSerialNumber', width: 150, align: 'left' };
  359. cols.push(collast);
  360. var collast = { label: '特殊库存标识', name: 'StockIndicator', width: 150, align: 'left' };
  361. cols.push(collast);
  362. var collast = { label: '销售凭证', name: 'ProjectCode', width: 100, align: 'left' };
  363. cols.push(collast);
  364. var collast = { label: '销售凭证项号', name: 'Brand', width: 100, align: 'left' };
  365. cols.push(collast);
  366. }
  367. if (Type == '8') {
  368. var collast = { label: '单据类型', name: 'OrderType', width: 120, align: 'left' };
  369. cols.push(collast);
  370. var collast = { label: '类型描述', name: 'TypeDescribe', width: 120, align: 'left' };
  371. cols.push(collast);
  372. var collast = { label: '成本中心', name: 'CostCenter', width: 150, align: 'left' };
  373. cols.push(collast);
  374. var collast = { label: '备注', name: 'Remarks', width: 150, align: 'left' };
  375. cols.push(collast);
  376. var collast = { label: '人员号', name: 'PersonNumber', width: 120, align: 'left' };
  377. cols.push(collast);
  378. var collast = { label: '物料描述', name: 'InvDescribe', width: 120, align: 'left' };
  379. cols.push(collast);
  380. var collast = { label: '基本计量单位', name: 'Unit', width: 150, align: 'left' };
  381. cols.push(collast);
  382. var collast = { label: '特殊库存标识', name: 'StockIndicator', width: 150, align: 'left' };
  383. cols.push(collast);
  384. }
  385. if (Type == '10') {
  386. var collast = { label: '目标仓库', name: 'ToWarehouseCode', width: 120, align: 'left' };
  387. cols.push(collast);
  388. var collast = { label: '目标工厂', name: 'ReceiveWork', width: 120, align: 'left' };
  389. cols.push(collast);
  390. var collast = { label: "单据类型", name: "OrderType", width: 120, align: 'left' };
  391. cols.push(collast);
  392. var collast = { label: '站点', name: 'WorkPoint', width: 100, align: 'left' };
  393. cols.push(collast);
  394. var collast = { label: '类型描述', name: 'TypeDescribe', width: 120, align: 'left' };
  395. cols.push(collast);
  396. var collast = { label: '备注', name: 'Remarks', width: 120, align: 'left' };
  397. cols.push(collast);
  398. var collast = { label: '人员号', name: 'PersonNumber', width: 100, align: 'left' };
  399. cols.push(collast);
  400. var collast = { label: '基本计量单位', name: 'Unit', width: 150, align: 'left' };
  401. cols.push(collast);
  402. var collast = { label: '特殊库存标识', name: 'StockIndicator', width: 150, align: 'left', };
  403. cols.push(collast);
  404. var collast = { label: '接收物料', name: 'ReceiveInvCode', width: 120, align: 'left' };
  405. cols.push(collast);
  406. var collast = { label: '接收物料描述', name: 'ReceiveInvDescribe', width: 150, align: 'left' };
  407. cols.push(collast);
  408. var collast = { label: '接受特殊库存标识', name: 'ReceiveStock', width: 150, align: 'left' };
  409. cols.push(collast);
  410. var collast = { label: '接受销售订单', name: 'ReceiveSales', width: 150, align: 'left', };
  411. cols.push(collast);
  412. var collast = { label: '接受行号', name: 'ReceiveSequence', width: 120, align: 'left' };
  413. cols.push(collast);
  414. var collast = { label: '备注2', name: 'Remark2', width: 100, align: 'left', };
  415. cols.push(collast);
  416. }
  417. $("#" + subgrid_table_id).dataGrid({
  418. cellEdit: true,
  419. url: "/WMS/PickMaterial/GetSubGridJson?Code=" + Code + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  420. colModel: cols,
  421. postData: { queryJson: JSON.stringify(queryJson) },
  422. //colModel: ColModelSub,
  423. //shrinkToFit: true,//宽度自适应
  424. //multiselect: true,
  425. prmNames: { search: "search" },
  426. viewrecords: true,
  427. height: "100%",
  428. rowNum: 20,
  429. pager: subgrid_pager_id,
  430. });
  431. }
  432. }
  433. function gridList2(flag) {
  434. debugger;
  435. document.getElementById("gridPanel2").innerHTML = ' <span><strong>合并信息</strong></span> <table id="gridList2"></table>';//重置grid
  436. var Type = $("#selShow").val();
  437. var $gridList = $("#gridList2");
  438. var objArr = '';
  439. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  440. for (var i = 0; i < objList.length; i++) {
  441. var rowId = objList[i];
  442. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  443. if (flag == '1') {
  444. objArr += "'" + rowData.Code + "',";
  445. } else {
  446. objArr += "'" + rowData.Code + "',";
  447. }
  448. }
  449. $gridList.dataGrid({
  450. url: "/WMS/PickMaterial/GetICSMOPickMergeTemp?ID=" + objArr + "&Type=" + Type + "&flag=" + flag + "&" + Math.random(),
  451. height: 500,
  452. width: $(window).width() - 500,
  453. colModel: _Clos1,
  454. //colModel: [
  455. // { label: "主键", name: "ID", hidden: true, key: true },
  456. // { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' },
  457. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  458. // { label: '料品编码', name: 'InvCode', width: 150, align: 'left' },
  459. // { label: '物料描述', name: 'InvName', width: 150, align: 'left' },
  460. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  461. // { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' },
  462. // { label: '单位', name: 'InvUnit', width: 150, align: 'left' },
  463. // { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' },
  464. // { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' },
  465. // { label: '条码库存', name: 'QTY', width: 100, align: 'left' },
  466. // { label: '条码', name: 'LotNO', width: 100, align: 'left' },
  467. //],
  468. shrinkToFit: false,//宽度自适应
  469. autowidth: true,
  470. gridComplete: function () {
  471. },
  472. rowNum: 10000,
  473. sortorder: "desc",
  474. viewrecords: true,
  475. //multiselect: true,
  476. });
  477. }
  478. function gridList3() {
  479. debugger;
  480. document.getElementById("gridPanel2").innerHTML = ' <span><strong>合并信息</strong></span> <table id="gridList2"></table>';//重置grid
  481. var Type = $("#selShow").val();
  482. var $gridList = $("#gridList2");
  483. var objArr = '';
  484. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  485. for (var i = 0; i < objList.length; i++) {
  486. var rowId = objList[i];
  487. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  488. //if (flag == '1') {
  489. objArr += "'" + rowData.Code + "',";
  490. //} else {
  491. // objArr += "'" + rowData.Code + "',";
  492. //}
  493. }
  494. $gridList.dataGrid({
  495. url: "/WMS/PickMaterial/GetPickLogInfo?ID=" + objArr + "&" + Math.random(),
  496. height: 500,
  497. width: $(window).width() - 500,
  498. colModel: _Clos1,
  499. //colModel: [
  500. // { label: "主键", name: "ID", hidden: true, key: true },
  501. // { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' },
  502. // { label: '单据号', name: 'Code', width: 120, align: 'left' },
  503. // { label: '料品编码', name: 'InvCode', width: 150, align: 'left' },
  504. // { label: '物料描述', name: 'InvName', width: 150, align: 'left' },
  505. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  506. // { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' },
  507. // { label: '单位', name: 'InvUnit', width: 150, align: 'left' },
  508. // { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' },
  509. // { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' },
  510. // { label: '条码库存', name: 'QTY', width: 100, align: 'left' },
  511. // { label: '条码', name: 'LotNO', width: 100, align: 'left' },
  512. //],
  513. shrinkToFit: false,//宽度自适应
  514. autowidth: true,
  515. gridComplete: function () {
  516. },
  517. rowNum: 10000,
  518. sortorder: "desc",
  519. viewrecords: true,
  520. //multiselect: true,
  521. });
  522. }
  523. //function btnMaterial() {
  524. // debugger;
  525. // var arr = [];
  526. // mark = '拣料';
  527. // flag = '1';
  528. // var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  529. // for (var i = 0; i < objList.length; i++) {
  530. // var objArr = '';
  531. // var rowId = objList[i];
  532. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  533. // if (rowData.IsNew == "已合并") {
  534. // $.modalAlertNew("WMS00091");
  535. // return;
  536. // }
  537. // objArr += "'" + rowData.Code + "',";
  538. // objArr = objArr.slice(0, objArr.length - 1);
  539. // objArr = "" + objArr + "|";
  540. // arr.push(objArr);
  541. // }
  542. // Arguments = arr;
  543. // gridList2(flag);
  544. //}
  545. function btnMaterial() {
  546. debugger;
  547. //var ISFlag = false;
  548. $("#PickID").val('');
  549. var sign = '';
  550. var objCode = '';
  551. var PickIDs = '';
  552. var arr = [];
  553. mark = '拣料';
  554. flag = '1';
  555. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  556. if (objList.length<=0) {
  557. $.modalAlert("请先选择单据!", "warning");
  558. return;
  559. }
  560. for (var i = 0; i < objList.length; i++) {
  561. var objArr = '';
  562. var rowId = objList[i];
  563. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  564. if (rowData.IsNew == "已合并") {
  565. $.modalAlertNew("WMS00091");
  566. return;
  567. }
  568. PickIDs += "'" + rowId + "',";
  569. if (rowData.Code!=undefined) {
  570. objCode += "'" + rowData.Code + "',";
  571. objArr += "'" + rowData.Code + "',";
  572. }
  573. objArr = objArr.slice(0, objArr.length - 1);
  574. objArr = "" + objArr + "|";
  575. arr.push(objArr);
  576. }
  577. $.ajax({
  578. url: "/WMS/PickMaterial/SeachPickLog" + "?" + Math.random() + "&objCode=" + objCode,
  579. dataType: "json",
  580. type: "post",
  581. async: false,
  582. success: function (data) {
  583. sign = data.count;
  584. }
  585. });
  586. if (sign == '0') {
  587. // PickID = PickIDs;
  588. $("#PickID").val(PickIDs);
  589. gridList2(flag);
  590. }
  591. if (sign == '1') {
  592. $.modalAlert("所选单据占料状态不一致!", "warning");
  593. return;
  594. }
  595. if (sign == '2') {
  596. $("#PickID").val(PickIDs);
  597. // $.modalAlert("所选单据已占料,可直接打印!", "warning");
  598. $.modalMsg("所选单据已占料,可直接打印!", "warning");
  599. gridList3();
  600. }
  601. Seach();
  602. }
  603. function btnMergeMaterial() {
  604. debugger;
  605. mark = '合并拣料';
  606. var sign = '';
  607. flag = '2';
  608. var Type = $("#selShow").val();
  609. var obj = '';
  610. var objArr = '';
  611. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  612. if (objList.length < 2) {
  613. $.modalAlertNew("WMS00092");
  614. return;
  615. }
  616. for (var i = 0; i < objList.length; i++) {
  617. var rowId = objList[i];
  618. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  619. obj += rowData.Code + ",";
  620. objArr += "'" + rowData.Code + "',";
  621. }
  622. $.ajax({
  623. url: "/WMS/PickMaterial/CheckQty" + "?" + Math.random() + "&objArr=" + objArr,
  624. dataType: "json",
  625. type: "post",
  626. async: false,
  627. success: function (data) {
  628. sign = data.count;
  629. }
  630. });
  631. if (sign == '1') {
  632. $.modalAlertNew("WMS00091");
  633. return;
  634. }
  635. $.submitForm({
  636. url: "/WMS/PickMaterial/MergeMaterial?Type=" + Type + "&" + Math.random(),
  637. param: {
  638. keyValue: obj
  639. },
  640. success: function () {
  641. //$.currentWindow().$("#gridList").trigger("reloadGrid");
  642. gridList2(flag);
  643. }
  644. })
  645. }
  646. function btnCancelMergeMaterial() {
  647. debugger;
  648. mark = '取消合并拣料';
  649. var sign = '';
  650. flag = '2';
  651. var Type = $("#selShow").val();
  652. var obj = '';
  653. var objArr = '';
  654. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  655. if (objList.length < 1) {
  656. $.modalAlertNew("WMS00109");
  657. return;
  658. }
  659. for (var i = 0; i < objList.length; i++) {
  660. var rowId = objList[i];
  661. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  662. obj += rowData.Code + ",";
  663. objArr += "'" + rowData.Code + "',";
  664. }
  665. $.submitForm({
  666. url: "/WMS/PickMaterial/CancelMergeMaterial?Type=" + Type + "&" + Math.random(),
  667. param: {
  668. keyValue: obj
  669. },
  670. success: function () {
  671. //$.currentWindow().$("#gridList").trigger("reloadGrid");
  672. gridList();
  673. }
  674. })
  675. }
  676. function btnPrint() {
  677. debugger;
  678. var mold = '';
  679. if (mark == '') {
  680. $.modalAlertNew("WMS00093");
  681. return;
  682. }
  683. if (mark == '合并拣料') {
  684. var arr = [];
  685. var obj_Item1 = $("#gridList2");
  686. var rowIds_Item1 = obj_Item1.getDataIDs();
  687. var arrayData_Item1 = new Array();
  688. var Enables = '';
  689. if (rowIds_Item1.length > 0) {
  690. debugger;
  691. for (var i = 0; i < rowIds_Item1.length; i++) {
  692. var objArr = '';
  693. var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
  694. if (RowData_Item1.IsOccupy!='已占料') {
  695. $.modalAlert("所选单据未拣料,无法打印!", "warning");
  696. return;
  697. }
  698. objArr += "'" + RowData_Item1.MergeID + "',";
  699. objArr = objArr.slice(0, objArr.length - 1);
  700. objArr = "" + objArr + "|";
  701. arr.push(objArr);
  702. }
  703. //var arr = [];
  704. //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  705. //for (var i = 0; i < objList.length; i++) {
  706. // var objArr = '';
  707. // var rowId = objList[i];
  708. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  709. // objArr += "'" + rowData.Code + "',";
  710. // objArr = objArr.slice(0, objArr.length - 1);
  711. // objArr = "" + objArr + "|";
  712. // arr.push(objArr);
  713. //}
  714. Arguments = arr;
  715. mold = 'HBJL00001';
  716. }
  717. }
  718. if (mark == '拣料') {
  719. var arr = [];
  720. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  721. for (var i = 0; i < objList.length; i++) {
  722. var objArr = '';
  723. var rowId = objList[i];
  724. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  725. if (rowData.IsOccupy == '未占料') {
  726. $.modalAlert("所选单据未拣料,无法打印!", "warning");
  727. return;
  728. }
  729. objArr += "'" + rowData.Code + "',";
  730. objArr = objArr.slice(0, objArr.length - 1);
  731. objArr = "" + objArr + "|";
  732. arr.push(objArr);
  733. }
  734. //var arr = [];
  735. //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  736. //for (var i = 0; i < objList.length; i++) {
  737. // var objArr = '';
  738. // var rowId = objList[i];
  739. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  740. // objArr += "'" + rowData.Code + "',";
  741. // objArr = objArr.slice(0, objArr.length - 1);
  742. // objArr = "" + objArr + "|";
  743. // arr.push(objArr);
  744. //}
  745. Arguments = arr;
  746. mold = 'JL00001';
  747. }
  748. $.modalOpen({
  749. id: "PrintLot",
  750. title: "打印",
  751. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(Arguments)) + "&mold=" + mold + "&" + Math.random(),
  752. width: "550px",
  753. height: "1000px",
  754. callBack: function (iframeId) {
  755. top.frames[iframeId].submitForm();
  756. }
  757. });
  758. }
  759. function btnCancel() {
  760. var ISFlag = 0;
  761. var objCode = '';
  762. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  763. for (var i = 0; i < objList.length; i++) {
  764. var objArr = '';
  765. var rowId = objList[i];
  766. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  767. //if (rowData.IsOccupy == "已占料") {
  768. if (rowData.Code!=undefined) {
  769. objCode += "'" + rowData.Code + "',";
  770. }
  771. // ISFlag = ISFlag + 1;
  772. //}
  773. }
  774. $.ajax({
  775. url: "/WMS/PickMaterial/SeachPickLog" + "?" + Math.random() + "&objCode=" + objCode,
  776. dataType: "json",
  777. type: "post",
  778. async: false,
  779. success: function (data) {
  780. sign = data.count;
  781. }
  782. });
  783. if (sign == '0') {
  784. $.modalAlert("所选单据无需取消占料!", "warning");
  785. return;
  786. }
  787. if (sign == '1') {
  788. $.modalAlert("所选单据占料状态不一致!", "warning");
  789. return;
  790. }
  791. if (sign == '2') {
  792. $.submitForm({
  793. url: "/WMS/PickMaterial/DelPickLog?" + Math.random(),
  794. param: { objCode: JSON.stringify(objCode) },
  795. success: function () {
  796. $.currentWindow().$("#gridList").trigger("reloadGrid");
  797. }
  798. })
  799. }
  800. }
  801. function fullscreen() {
  802. var docElm = document.documentElement;
  803. if (docElm.requestFullscreen) {
  804. docElm.requestFullscreen();
  805. } else if (docElm.mozRequestFullScreen) {
  806. docElm.mozRequestFullScreen();
  807. } else if (docElm.webkitRequestFullScreen) {
  808. docElm.webkitRequestFullScreen();
  809. } else if (docElm.msRequestFullscreen) {
  810. docElm.msRequestFullscreen();
  811. }
  812. $(window).bind('resize', function () {
  813. $("#gridList").setGridWidth($(window).width());
  814. }).trigger('resize');
  815. $(window).bind('resize', function () {
  816. $("#gridList").setGridHeight($(window).height());
  817. }).trigger('resize');
  818. }
  819. </script>
  820. <div class="topPanel" style="height:150px;" >
  821. <div class="toolbar">
  822. <div class="btn-group">
  823. <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>
  824. <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>
  825. <a id="NF-CancelMergeMaterial" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCancelMergeMaterial()"><i class="fa fa-pencil-square-o"></i>取消合并拣料</a>
  826. <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>
  827. <a id="NF-Cancel" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCancel()"><i class="fa fa-pencil-square-o"></i>取消占料</a>
  828. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  829. </div>
  830. <script>$('.toolbar').authorizeButton()</script>
  831. </div>
  832. <div class="search">
  833. <table>
  834. <tr>
  835. <td>
  836. <label>&nbsp;&nbsp;&nbsp;类型:</label>
  837. </td>
  838. <td>
  839. <div class="input-group">
  840. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;" onchange="Seach()">
  841. @*<option value="1" selected="selected">工单备料</option>*@
  842. <option value="2" selected="selected" spellcheck="true">工单领料</option>
  843. <option value="12" selected="selected">售后领料</option>
  844. @*<option value="3" selected="selected">工单材料出库</option>*@
  845. @*<option value="4" selected="selected">委外备料</option>*@
  846. <option value="5" selected="selected">委外领料</option>
  847. @*<option value="6" selected="selected">委外材料出库</option>*@
  848. <option value="7" selected="selected">销售发货</option>
  849. <option value="8" selected="selected">其它出库</option>
  850. @*<option value="9" selected="selected">借用</option>*@
  851. <option value="10" selected="selected">物料调拨</option>
  852. @*<option value="11" selected="selected">两步调出</option>*@
  853. </select>
  854. </div>
  855. </td>
  856. <td id="status1">
  857. <label>&nbsp;&nbsp;&nbsp;状态:</label>
  858. </td>
  859. <td id="status2">
  860. <div class="input-group">
  861. <select id="selShow2" name="F_Target" class="form-control" style="width: 100px;">
  862. <option value="2" selected="selected">已配料</option>
  863. <option value="3" selected="selected">已过账</option>
  864. @*<option value="4" selected="selected">已取消</option>*@
  865. @*<option value="5" selected="selected">全部</option>*@
  866. <option value="1" selected="selected">未配料</option>
  867. </select>
  868. </div>
  869. </td>
  870. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  871. <td>
  872. <div class="input-group">
  873. <input id="txt_POCode" type="text" class="form-control" style="width: 120px;">
  874. <input id="PickID" type="text" class="form-control" style="width: 120px; display:none">
  875. </div>
  876. </td>
  877. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;区域</label>:</td>
  878. <td>
  879. <div class="input-group">
  880. <input id="txt_Area" type="text" class="form-control" style="width: 120px;">
  881. </div>
  882. </td>
  883. <td style="text-align:right;" id="order1"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;生产订单</label>:</td>
  884. <td id="order2">
  885. <div class="input-group">
  886. <input id="txt_Order" type="text" class="form-control" style="width: 120px;">
  887. </div>
  888. </td>
  889. </tr>
  890. <tr>
  891. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;仓库</label>:</td>
  892. <td>
  893. <div class="input-group">
  894. <input id="txt_WHCode" type="text" class="form-control" style="width: 120px;">
  895. </div>
  896. </td>
  897. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  898. <td>
  899. <div class="input-group">
  900. <input id="txt_InvCode" type="text" class="form-control" style="width: 120px;">
  901. </div>
  902. </td>
  903. <td style="text-align:left; " id="type7"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;客户编码</label>:</td>
  904. <td id="type8">
  905. <div class="input-group">
  906. <input id="txt_CusCode" type="text" class="form-control" style="width: 150px; ">
  907. </div>
  908. </td>
  909. <td style="text-align: right; " id="type9"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;客户名称</label>:</td>
  910. <td id="type10">
  911. <div class="input-group">
  912. <input id="txt_CusName" type="text" class="form-control" style="width: 120px;">
  913. </div>
  914. </td>
  915. <td style="text-align: right; " id="date1"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;创建日期</label>:</td>
  916. <td id="date2">
  917. <div class="input-group">
  918. <input type="text" name="PRODUCTDATE" id="txt_CreateDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
  919. </div>
  920. </td>
  921. <td style="text-align: right; " id="date3"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;需求日期</label>:</td>
  922. <td id="date4">
  923. <div class="input-group">
  924. <input type="text" name="PRODUCTDATE" id="txt_NeedDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
  925. </div>
  926. </td>
  927. <td>
  928. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否显示货柜单据:</label>
  929. </td>
  930. <td>
  931. <div class="input-group" id="txt_Container">
  932. <input type="radio" name="container" value="1" />&nbsp;是
  933. <input type="radio" name="container" checked="checked" value="2" />&nbsp;否
  934. </div>
  935. </td>
  936. <td>
  937. <span class="input-group-btn">
  938. <button id="btn_search" type="button" class="btn btn-primary" onclick="Seach()"><i class="fa fa-search"></i></button>
  939. </span>
  940. </td>
  941. </tr>
  942. @*<tr>
  943. </tr>*@
  944. </table>
  945. </div>
  946. </div>
  947. <div class="gridPanel" id="gridPanel">
  948. <span><strong>详细信息</strong></span>
  949. <table id="gridList"></table>
  950. </div>
  951. <div class="gridPanel" id="gridPanel2">
  952. <span><strong>合并信息</strong></span>
  953. <table id="gridList2"></table>
  954. </div>