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

980 lines
44 KiB

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