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

911 lines
41 KiB

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