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

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