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

1047 lines
46 KiB

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