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

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