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