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

1115 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
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
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. //$.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. document.getElementById("page").innerHTML = ' <table id="gridList"></table> <div id = "gridPager" ></div > ';
  23. SetCols();
  24. gridList();
  25. }
  26. function SetCols() {
  27. var Type = $("#selShow").val();
  28. var ct = document.getElementById("type7");
  29. var ct1 = document.getElementById("type8");
  30. var ct2 = document.getElementById("type9");
  31. var ct3 = document.getElementById("type10");
  32. var ct4 = document.getElementById("status1")
  33. var ct5 = document.getElementById("status2")
  34. var ct6 = document.getElementById("order1")
  35. var ct7 = document.getElementById("order2")
  36. var ct8 = document.getElementById("date1");
  37. var ct9 = document.getElementById("date2");
  38. var ct10 = document.getElementById("date3");
  39. var ct11 = document.getElementById("date4");
  40. var ct12 = document.getElementById("status3")
  41. var ct13 = document.getElementById("status4")
  42. var cols = new Array();
  43. var collast = { label: "主键", name: "ID", hidden: true , key: true };
  44. cols.push(collast);
  45. var collast = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  46. cols.push(collast);
  47. var collast = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
  48. cols.push(collast);
  49. if (Type == 2 || Type == 12) {
  50. var collast = { label: '物料号(父项生产订单物料)', name: 'OrderInvCode', width: 150, align: 'left' };
  51. cols.push(collast);
  52. var collast = { label: '物料描述(父项生产订单主物料)', name: 'OrderInvDescribe', width: 200, align: 'left' };
  53. cols.push(collast);
  54. //var collast = { label: '调度工号', name: 'DispatchNumber', width: 120, align: 'left', };
  55. //cols.push(collast);
  56. var collast = { label: '拣料人姓名', name: 'PickName', width: 100, align: 'left' };
  57. cols.push(collast);
  58. var collast = { label: '收料人姓名', name: 'ReceiverName', width: 150, align: 'left' };
  59. cols.push(collast);
  60. var collast = { label: '需求日期', name: 'NeedDate', width: 120, align: 'left' };
  61. cols.push(collast);
  62. var collast = { label: '需求时间', name: 'NeedTime', width: 120, align: 'left', };
  63. cols.push(collast);
  64. //var collast = { label: '收料人工号', name: 'ReceiverNumber', width: 150, align: 'left' };
  65. //cols.push(collast);
  66. var collast = { label: '紧急程度', name: 'Urgency', width: 120, align: 'left', };
  67. cols.push(collast);
  68. var collast = { label: '调度人姓名', name: 'DispatcherName', width: 120, align: 'left' };
  69. cols.push(collast);
  70. var collast = { label: '工位', name: 'Desks', width: 100, align: 'left' };
  71. cols.push(collast);
  72. var collast = { label: '状态', name: 'Status', width: 150, align: 'center' };
  73. cols.push(collast);
  74. ct4.style.display = "";
  75. ct5.style.display = "";
  76. ct6.style.display = "";
  77. ct7.style.display = "";
  78. ct8.style.display = "";
  79. ct9.style.display = "";
  80. ct10.style.display = "";
  81. ct11.style.display = "";
  82. ct12.style.display = "none";
  83. ct13.style.display = "none";
  84. }
  85. else {
  86. ct4.style.display = "none";
  87. ct5.style.display = "none";
  88. ct6.style.display = "none";
  89. ct7.style.display = "none";
  90. ct8.style.display = "none";
  91. ct9.style.display = "none";
  92. ct10.style.display = "none";
  93. ct11.style.display = "none";
  94. ct12.style.display = "";
  95. ct13.style.display = "";
  96. }
  97. //var collast = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
  98. //cols.push(collast);
  99. //var collast = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
  100. //cols.push(collast);
  101. //var collast = { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' };
  102. //cols.push(collast);
  103. var collast = { label: '占料状态', name: 'IsOccupy', width: 80, align: 'left' };
  104. cols.push(collast);
  105. var collast = { label: '单据状态', hidden: true, };
  106. cols.push(collast);
  107. var cols1 = new Array();
  108. var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
  109. cols1.push(collast1);
  110. var collast1 = { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' };
  111. cols1.push(collast1);
  112. var collast1 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
  113. cols1.push(collast1);
  114. var collast1 = { label: '单据行号', name: 'Sequence', hidden: true };
  115. cols1.push(collast1);
  116. var collast1 = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' };
  117. cols1.push(collast1);
  118. var collast1 = { label: '物料描述', name: 'InvName', width: 150, align: 'left' };
  119. cols1.push(collast1);
  120. var collast1 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  121. cols1.push(collast1);
  122. var collast1 = { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' };
  123. cols1.push(collast1);
  124. var collast1 = { label: '单位', name: 'InvUnit', width: 150, align: 'left' };
  125. cols1.push(collast1);
  126. var collast1 = { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' };
  127. cols1.push(collast1);
  128. var collast1 = { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' };
  129. cols1.push(collast1);
  130. var collast1 = { label: '条码库存', name: 'QTY', width: 100, align: 'left' };
  131. cols1.push(collast1);
  132. var collast1 = { label: '条码', name: 'LotNO', width: 100, align: 'left' };
  133. cols1.push(collast1);
  134. var collast1 = { label: '占料数量', name: 'SendQTY', hidden: true };
  135. cols1.push(collast1);
  136. if (Type != 7) {
  137. var collast = { label: '销售凭证', name: 'ProjectCode', width: 100, align: 'left' };
  138. cols.push(collast);
  139. var collast = { label: '销售凭证项号', name: 'Brand', width: 100, align: 'left' };
  140. cols.push(collast);
  141. ct.style.display = "none";
  142. ct1.style.display = "none";
  143. ct2.style.display = "none";
  144. ct3.style.display = "none";
  145. }
  146. else
  147. {
  148. var collast = { label: '客户编码', name: 'CusCode', width: 150, align: 'left' };
  149. cols.push(collast);
  150. var collast = { label: '客户名称', name: 'CusName', width: 150, align: 'left' };
  151. cols.push(collast);
  152. ct.style.display = "";
  153. ct1.style.display = "";
  154. ct2.style.display = "";
  155. ct3.style.display = "";
  156. }
  157. $.ajax({
  158. url: "/Print/SelectColumnName?" + Math.random(),
  159. dataType: "json",
  160. async: false,
  161. success: function (data) {
  162. if (data != null && data.length > 0) {
  163. DateList = data;
  164. for (var i = 0; i < data.length; i++) {
  165. var ColName = data[i].ColName;
  166. var ColCode = data[i].ColCode;
  167. var obj = new Array();
  168. obj = {
  169. label: ColName,
  170. name: ColCode,
  171. width: 80,
  172. align: "left"
  173. }
  174. if (ColCode != "BatchCode" && ColCode != "Brand" && ColCode != "ProjectCode")
  175. {
  176. cols.push(obj);
  177. cols1.push(obj);
  178. }
  179. }
  180. }
  181. _Clos = cols;
  182. _Clos1 = cols1;
  183. }
  184. });
  185. }
  186. function gridList() {
  187. var Type = $("#selShow").val();
  188. var $gridList = $("#gridList");
  189. var queryJson = {
  190. POCode: $("#txt_POCode").val(),
  191. InvCode: $("#txt_InvCode").val(),
  192. Area: $("#txt_Area").val(),
  193. WHCode: $("#txt_WHCode").val(),
  194. CusCode: $("#txt_CusCode").val(),
  195. CusName: $("#txt_CusName").val(),
  196. Status: $("#selShow2").val(),
  197. Status1: $("#selShow3").val(),
  198. Order: $("#txt_Order").val(),
  199. Container: $('input[name="container"]:checked').val(),
  200. CreateDate: $("#txt_CreateDate").val(),
  201. NeedDate: $("#txt_NeedDate").val()
  202. }
  203. $gridList.dataGrid({
  204. //url: "/WMS/PickMaterial/GetGridJson?Type=" + Type + "&" + Math.random(),
  205. //postData: { queryJson: JSON.stringify(queryJson) },
  206. url: "/WMS/PickMaterial/GetGridJson?" + Math.random(),
  207. postData: { queryJson: JSON.stringify(queryJson),Type:Type },
  208. height: 280,
  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. for (var i = 0; i < objList.length; i++) {
  573. var objArr = '';
  574. var rowId = objList[i];
  575. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  576. if (rowData.IsNew == "已合并") {
  577. $.modalAlertNew("WMS00091");
  578. return;
  579. }
  580. if (Type != "2") {
  581. if (rowData.Status == "已过帐") {
  582. $.modalAlert("单据已过账,无法拣料!", "warning");
  583. return;
  584. }
  585. }
  586. if (Type == "2") {
  587. if (rowData.Status != "未配料") {
  588. $.modalAlert("该单据未配料,无法拣料!", "warning");
  589. return;
  590. }
  591. }
  592. PickIDs += "'" + rowId + "',";
  593. if (rowData.Code!=undefined) {
  594. objCode += "'" + rowData.Code + "',";
  595. objArr += "'" + rowData.Code + "',";
  596. }
  597. objArr = objArr.slice(0, objArr.length - 1);
  598. objArr = "" + objArr + "|";
  599. arr.push(objArr);
  600. }
  601. $.ajax({
  602. url: "/WMS/PickMaterial/SeachPickLog" + "?" + Math.random() + "&objCode=" + objCode,
  603. dataType: "json",
  604. type: "post",
  605. async: false,
  606. success: function (data) {
  607. sign = data.count;
  608. $.currentWindow().$("#gridList").trigger("reloadGrid");
  609. }
  610. });
  611. if (sign == '0') {
  612. // PickID = PickIDs;
  613. $("#PickID").val(PickIDs);
  614. gridList2(flag);
  615. }
  616. if (sign == '1') {
  617. $.modalAlert("所选单据占料状态不一致!", "warning");
  618. return;
  619. }
  620. if (sign == '2') {
  621. $("#PickID").val(PickIDs);
  622. // $.modalAlert("所选单据已占料,可直接打印!", "warning");
  623. $.modalMsg("所选单据已占料,可直接打印!", "warning");
  624. gridList3();
  625. }
  626. Seach();
  627. }
  628. function btnMergeMaterial() {
  629. debugger;
  630. mark = '合并拣料';
  631. var sign = '';
  632. flag = '2';
  633. var Type = $("#selShow").val();
  634. var obj = '';
  635. var objArr = '';
  636. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  637. if (objList.length < 2) {
  638. $.modalAlertNew("WMS00092");
  639. return;
  640. }
  641. for (var i = 0; i < objList.length; i++) {
  642. var rowId = objList[i];
  643. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  644. obj += rowData.Code + ",";
  645. objArr += "'" + rowData.Code + "',";
  646. }
  647. $.ajax({
  648. url: "/WMS/PickMaterial/CheckQty" + "?" + Math.random() + "&objArr=" + objArr,
  649. dataType: "json",
  650. type: "post",
  651. async: false,
  652. success: function (data) {
  653. sign = data.count;
  654. }
  655. });
  656. if (sign == '1') {
  657. $.modalAlertNew("WMS00091");
  658. return;
  659. }
  660. $.submitForm({
  661. url: "/WMS/PickMaterial/MergeMaterial?Type=" + Type + "&" + Math.random(),
  662. param: {
  663. keyValue: obj
  664. },
  665. success: function () {
  666. //$.currentWindow().$("#gridList").trigger("reloadGrid");
  667. gridList2(flag);
  668. }
  669. })
  670. }
  671. function btnCancelMergeMaterial() {
  672. debugger;
  673. mark = '取消合并拣料';
  674. var sign = '';
  675. flag = '2';
  676. var Type = $("#selShow").val();
  677. var obj = '';
  678. var objArr = '';
  679. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  680. if (objList.length < 1) {
  681. $.modalAlertNew("WMS00109");
  682. return;
  683. }
  684. for (var i = 0; i < objList.length; i++) {
  685. var rowId = objList[i];
  686. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  687. obj += rowData.Code + ",";
  688. objArr += "'" + rowData.Code + "',";
  689. }
  690. $.submitForm({
  691. url: "/WMS/PickMaterial/CancelMergeMaterial?Type=" + Type + "&" + Math.random(),
  692. param: {
  693. keyValue: obj
  694. },
  695. success: function () {
  696. //$.currentWindow().$("#gridList").trigger("reloadGrid");
  697. gridList();
  698. }
  699. })
  700. }
  701. function btnPrint() {
  702. debugger;
  703. var mold = '';
  704. if (mark == '') {
  705. $.modalAlertNew("WMS00093");
  706. return;
  707. }
  708. if (mark == '合并拣料') {
  709. var arr = [];
  710. var obj_Item1 = $("#gridList2");
  711. var rowIds_Item1 = obj_Item1.getDataIDs();
  712. var arrayData_Item1 = new Array();
  713. var Enables = '';
  714. if (rowIds_Item1.length > 0) {
  715. debugger;
  716. for (var i = 0; i < rowIds_Item1.length; i++) {
  717. var objArr = '';
  718. var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
  719. if (RowData_Item1.IsOccupy!='已占料') {
  720. $.modalAlert("所选单据未拣料,无法打印!", "warning");
  721. return;
  722. }
  723. objArr += "'" + RowData_Item1.MergeID + "',";
  724. objArr = objArr.slice(0, objArr.length - 1);
  725. objArr = "" + objArr + "|";
  726. arr.push(objArr);
  727. }
  728. //var arr = [];
  729. //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  730. //for (var i = 0; i < objList.length; i++) {
  731. // var objArr = '';
  732. // var rowId = objList[i];
  733. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  734. // objArr += "'" + rowData.Code + "',";
  735. // objArr = objArr.slice(0, objArr.length - 1);
  736. // objArr = "" + objArr + "|";
  737. // arr.push(objArr);
  738. //}
  739. Arguments = arr;
  740. mold = 'HBJL00001';
  741. }
  742. }
  743. if (mark == '拣料') {
  744. var arr = [];
  745. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  746. for (var i = 0; i < objList.length; i++) {
  747. var objArr = '';
  748. var rowId = objList[i];
  749. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  750. if (rowData.IsOccupy == '未占料') {
  751. $.modalAlert("所选单据未拣料,无法打印!", "warning");
  752. return;
  753. }
  754. objArr += "'" + rowData.Code + "',";
  755. objArr = objArr.slice(0, objArr.length - 1);
  756. objArr = "" + objArr + "|";
  757. arr.push(objArr);
  758. }
  759. //var arr = [];
  760. //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  761. //for (var i = 0; i < objList.length; i++) {
  762. // var objArr = '';
  763. // var rowId = objList[i];
  764. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  765. // objArr += "'" + rowData.Code + "',";
  766. // objArr = objArr.slice(0, objArr.length - 1);
  767. // objArr = "" + objArr + "|";
  768. // arr.push(objArr);
  769. //}
  770. Arguments = arr;
  771. mold = 'JL00001';
  772. }
  773. $.modalOpen({
  774. id: "PrintLot",
  775. title: "打印",
  776. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(Arguments)) + "&mold=" + mold + "&" + Math.random(),
  777. width: "550px",
  778. height: "1000px",
  779. callBack: function (iframeId) {
  780. top.frames[iframeId].submitForm();
  781. }
  782. });
  783. }
  784. function btnCancel() {
  785. var ISFlag = 0;
  786. var objCode = '';
  787. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  788. for (var i = 0; i < objList.length; i++) {
  789. var objArr = '';
  790. var rowId = objList[i];
  791. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  792. //if (rowData.IsOccupy == "已占料") {
  793. if (rowData.Code!=undefined) {
  794. objCode += "'" + rowData.Code + "',";
  795. }
  796. // ISFlag = ISFlag + 1;
  797. //}
  798. }
  799. $.ajax({
  800. url: "/WMS/PickMaterial/SeachPickLog" + "?" + Math.random() + "&objCode=" + objCode,
  801. dataType: "json",
  802. type: "post",
  803. async: false,
  804. success: function (data) {
  805. sign = data.count;
  806. }
  807. });
  808. if (sign == '0') {
  809. $.modalAlert("所选单据无需取消占料!", "warning");
  810. return;
  811. }
  812. if (sign == '1') {
  813. $.modalAlert("所选单据占料状态不一致!", "warning");
  814. return;
  815. }
  816. if (sign == '2') {
  817. $.submitForm({
  818. url: "/WMS/PickMaterial/DelPickLog?" + Math.random(),
  819. param: { objCode: JSON.stringify(objCode) },
  820. success: function () {
  821. $.currentWindow().$("#gridList").trigger("reloadGrid");
  822. }
  823. })
  824. }
  825. }
  826. function fullscreen() {
  827. var docElm = document.documentElement;
  828. if (docElm.requestFullscreen) {
  829. docElm.requestFullscreen();
  830. } else if (docElm.mozRequestFullScreen) {
  831. docElm.mozRequestFullScreen();
  832. } else if (docElm.webkitRequestFullScreen) {
  833. docElm.webkitRequestFullScreen();
  834. } else if (docElm.msRequestFullscreen) {
  835. docElm.msRequestFullscreen();
  836. }
  837. $(window).bind('resize', function () {
  838. $("#gridList").setGridWidth($(window).width());
  839. }).trigger('resize');
  840. $(window).bind('resize', function () {
  841. $("#gridList").setGridHeight($(window).height());
  842. }).trigger('resize');
  843. }
  844. </script>
  845. <div class="topPanel" style="height:150px;" >
  846. <div class="toolbar">
  847. <div class="btn-group">
  848. <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>
  849. <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>
  850. <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>
  851. <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>
  852. <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>
  853. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  854. </div>
  855. <script>$('.toolbar').authorizeButton()</script>
  856. </div>
  857. <div class="search">
  858. <table>
  859. <tr>
  860. <td>
  861. <label>&nbsp;&nbsp;&nbsp;类型:</label>
  862. </td>
  863. <td>
  864. <div class="input-group">
  865. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;" onchange="Seach()">
  866. @*
  867. <option value="1" selected="selected">工单备料</option>*@
  868. <option value="2" selected="selected" spellcheck="true">工单领料</option>
  869. <option value="12" selected="selected">售后领料</option>
  870. @*
  871. <option value="3" selected="selected">工单材料出库</option>*@
  872. @*
  873. <option value="4" selected="selected">委外备料</option>*@
  874. <option value="5" selected="selected">委外领料</option>
  875. @*
  876. <option value="6" selected="selected">委外材料出库</option>*@
  877. <option value="7" selected="selected">销售发货</option>
  878. <option value="8" selected="selected">其它出库</option>
  879. @*
  880. <option value="9" selected="selected">借用</option>*@
  881. <option value="10" selected="selected">物料调拨</option>
  882. @*
  883. <option value="11" selected="selected">两步调出</option>*@
  884. </select>
  885. </div>
  886. </td>
  887. <td id="status1">
  888. <label>&nbsp;&nbsp;&nbsp;状态:</label>
  889. </td>
  890. <td id="status2">
  891. <div class="input-group">
  892. <select id="selShow2" name="F_Target" class="form-control" style="width: 100px;">
  893. <option value="2" selected="selected">已配料</option>
  894. <option value="3" selected="selected">已过账</option>
  895. @*
  896. <option value="4" selected="selected">已取消</option>*@
  897. @*
  898. <option value="5" selected="selected">全部</option>*@
  899. <option value="1" selected="selected">未配料</option>
  900. </select>
  901. </div>
  902. </td>
  903. <td id="status3">
  904. <label>&nbsp;&nbsp;&nbsp;状态:</label>
  905. </td>
  906. <td id="status4">
  907. <div class="input-group">
  908. <select id="selShow3" name="F_Target" class="form-control" style="width: 100px;">
  909. <option value="1" selected="selected">已过账</option>
  910. <option value="2" selected="selected">未过账</option>
  911. </select>
  912. </div>
  913. </td>
  914. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  915. <td>
  916. <div class="input-group">
  917. <input id="txt_POCode" type="text" class="form-control" style="width: 120px;">
  918. <input id="PickID" type="text" class="form-control" style="width: 120px; display:none">
  919. </div>
  920. </td>
  921. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;区域</label>:</td>
  922. <td>
  923. <div class="input-group">
  924. <input id="txt_Area" type="text" class="form-control" style="width: 120px;">
  925. </div>
  926. </td>
  927. <td style="text-align:right;" id="order1"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;生产订单</label>:</td>
  928. <td id="order2">
  929. <div class="input-group">
  930. <input id="txt_Order" type="text" class="form-control" style="width: 120px;">
  931. </div>
  932. </td>
  933. </tr>
  934. <tr>
  935. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;仓库</label>:</td>
  936. <td>
  937. <div class="input-group">
  938. <input id="txt_WHCode" type="text" class="form-control" style="width: 120px;">
  939. </div>
  940. </td>
  941. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  942. <td>
  943. <div class="input-group">
  944. <input id="txt_InvCode" type="text" class="form-control" style="width: 120px;">
  945. </div>
  946. </td>
  947. <td style="text-align:left; " id="type7"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;客户编码</label>:</td>
  948. <td id="type8">
  949. <div class="input-group">
  950. <input id="txt_CusCode" type="text" class="form-control" style="width: 150px; ">
  951. </div>
  952. </td>
  953. <td style="text-align: right; " id="type9"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;客户名称</label>:</td>
  954. <td id="type10">
  955. <div class="input-group">
  956. <input id="txt_CusName" type="text" class="form-control" style="width: 120px;">
  957. </div>
  958. </td>
  959. <td style="text-align: right; " id="date1"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;创建日期</label>:</td>
  960. <td id="date2">
  961. <div class="input-group">
  962. <input type="text" name="PRODUCTDATE" id="txt_CreateDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
  963. </div>
  964. </td>
  965. <td style="text-align: right; " id="date3"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;需求日期</label>:</td>
  966. <td id="date4">
  967. <div class="input-group">
  968. <input type="text" name="PRODUCTDATE" id="txt_NeedDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
  969. </div>
  970. </td>
  971. <td>
  972. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否显示货柜单据:</label>
  973. </td>
  974. <td>
  975. <div class="input-group" id="txt_Container">
  976. <input type="radio" name="container" value="1" />&nbsp;是
  977. <input type="radio" name="container" checked="checked" value="2" />&nbsp;否
  978. </div>
  979. </td>
  980. <td>
  981. <span class="input-group-btn">
  982. <button id="btn_search" type="button" class="btn btn-primary" onclick="Seach()"><i class="fa fa-search"></i></button>
  983. </span>
  984. </td>
  985. </tr>
  986. @*<tr>
  987. </tr>*@
  988. </table>
  989. </div>
  990. </div>
  991. <div class="gridPanel" id="gridPanel">
  992. <span><strong>详细信息</strong></span>
  993. <table id="gridList"></table>
  994. </div>
  995. <div class="gridPanel" id="page">
  996. <table id="gridList"></table>
  997. <div id="gridPager"></div>
  998. </div>
  999. <div class="gridPanel" id="gridPanel2">
  1000. <span><strong>合并信息</strong></span>
  1001. <table id="gridList2"></table>
  1002. </div>