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.

2457 lines
124 KiB

  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <style>
  6. .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
  7. overflow: inherit;
  8. word-wrap: break-word;
  9. }
  10. .ui-jqgrid tr.jqgrow td {
  11. white-space: normal !important;
  12. height: auto;
  13. }
  14. </style>
  15. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  16. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  17. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  18. <script src="~/Content/js/bootstrap/bootstrap-select.js"></script>
  19. <script src="~/Content/js/select2/select2.min.js"></script>
  20. <script src="~/Content/js/layer/layer.js"></script>
  21. <script>
  22. debugger;
  23. var Type = $.request("Type");
  24. var _Clos = new Array();
  25. $(function () {
  26. SetCols(Type);
  27. //来料检验
  28. if (Type == '1') {
  29. gridList();
  30. }
  31. //委外来料检验
  32. if (Type == '3') {
  33. gridList2();
  34. }
  35. //产成品检验
  36. if (Type == '2') {
  37. $(".HideTxt").css('display', 'none');
  38. $("#NF-update").css('display', 'none');
  39. gridList3();
  40. }
  41. //其他入库
  42. if (Type == '4') {
  43. $(".HideTxt").css('display', 'none');
  44. $("#NF-update").css('display', 'none');
  45. gridList4();
  46. }
  47. //生产退料
  48. if (Type == '5') {
  49. $(".HideTxt").css('display', 'none');
  50. $("#NF-update").css('display', 'none');
  51. gridList5();
  52. }
  53. //委外退料
  54. if (Type == '6') {
  55. $(".HideTxt").css('display', 'none');
  56. $("#NF-update").css('display', 'none');
  57. gridList6();
  58. }
  59. //销售退货
  60. if (Type == '7') {
  61. $(".HideTxt").css('display', 'none');
  62. $("#NF-update").css('display', 'none');
  63. gridList7();
  64. }
  65. //采购到货单检验
  66. if (Type == '8') {
  67. $(".HideTxt").css('display', 'none');
  68. gridList8();
  69. }
  70. //委外采购到货单检验
  71. if (Type == '9') {
  72. $(".HideTxt").css('display', 'none');
  73. gridList9();
  74. }
  75. })
  76. function SetCols(Type) {
  77. $.ajax({
  78. url: "/Print/SelectColumnName?" + Math.random(),
  79. dataType: "json",
  80. async: false,
  81. success: function (data) {
  82. var cols = new Array();
  83. //来料检验
  84. if (Type == '1') {
  85. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  86. cols.push(collast);
  87. var collast = { label: 'ID', name: 'ID', hidden: true };
  88. cols.push(collast);
  89. var collast = { label: '到货ID', name: 'DHID', hidden: true };
  90. cols.push(collast);
  91. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  92. cols.push(collast);
  93. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  94. cols.push(collast);
  95. var collast = { label: '到货单号', name: 'DNCode', width: 120, align: 'left' };
  96. cols.push(collast);
  97. var collast = { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' };
  98. cols.push(collast);
  99. var collast = { label: '采购订单号', name: 'POCode', width: 120, align: 'left' };
  100. cols.push(collast);
  101. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  102. cols.push(collast);
  103. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  104. cols.push(collast);
  105. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  106. cols.push(collast);
  107. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  108. cols.push(collast);
  109. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  110. //cols.push(collast);
  111. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  112. cols.push(collast);
  113. var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' };
  114. cols.push(collast);
  115. var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' };
  116. cols.push(collast);
  117. var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' };
  118. cols.push(collast);
  119. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  120. cols.push(collast);
  121. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  122. cols.push(collast);
  123. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  124. cols.push(collast);
  125. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  126. cols.push(collast);
  127. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  128. cols.push(collast);
  129. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  130. cols.push(collast);
  131. var collast = {
  132. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  133. formatter: function (cellvalue, options, rowObject) {
  134. var html = "";
  135. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px" onchange=\"ChangeA('+"'" + rowObject.ID.toString() + "'"+')\" >';
  136. html += ' </select>';
  137. return cellvalue = html;
  138. }
  139. };
  140. cols.push(collast);
  141. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  142. cols.push(collast);
  143. var collast = {
  144. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  145. formatter: function (cellvalue, options, rowObject) {
  146. var html = "";
  147. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px" onchange=\"ChangeB(' + "'" + rowObject.ID.toString() + "'" + ')\" >';
  148. html += ' </select>';
  149. return cellvalue = html;
  150. }
  151. };
  152. cols.push(collast);
  153. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  154. cols.push(collast);
  155. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  156. cols.push(collast);
  157. //var collast = {
  158. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  159. // formatter: function (cellvalue, options, rowObject) {
  160. // var html = "";
  161. // if (cellvalue != "" && cellvalue != null) {
  162. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  163. // }
  164. // return html;
  165. // }
  166. //};
  167. //cols.push(collast);
  168. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  169. cols.push(collast);
  170. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  171. cols.push(collast);
  172. $.ajax({
  173. url: "/Print/SelectTableColumnName?" + Math.random(),
  174. dataType: "json",
  175. async: false,
  176. success: function (data) {
  177. if (data != null && data.length > 0) {
  178. DateList = data;
  179. for (var i = 0; i < data.length; i++) {
  180. var TableCode = data[i].TableCode;
  181. if (TableCode == "ICSInspection") {
  182. var Code = data[i].Code;
  183. var Name = data[i].Name;
  184. var obj = new Array();
  185. obj = {
  186. label: Name,
  187. name: Code,
  188. width: 80,
  189. align: "left"
  190. }
  191. cols.push(obj);
  192. }
  193. if (TableCode == "ICSInventory") {
  194. var Code = data[i].Code;
  195. var Name = data[i].Name;
  196. var obj = new Array();
  197. obj = {
  198. label: Name,
  199. name: Code,
  200. width: 80,
  201. align: "left"
  202. }
  203. cols.push(obj);
  204. //cols1.push(obj);
  205. }
  206. }
  207. }
  208. _Closs = cols;
  209. //_Clos1 = cols1;
  210. }
  211. });
  212. }
  213. //委外来料检验
  214. if (Type == '3') {
  215. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  216. cols.push(collast);
  217. var collast = { label: 'ID', name: 'ID', hidden: true };
  218. cols.push(collast);
  219. var collast = { label: '到货ID', name: 'DHID', hidden: true };
  220. cols.push(collast);
  221. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  222. cols.push(collast);
  223. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  224. cols.push(collast);
  225. var collast = { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' };
  226. cols.push(collast);
  227. var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' };
  228. cols.push(collast);
  229. var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  230. cols.push(collast);
  231. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  232. cols.push(collast);
  233. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  234. cols.push(collast);
  235. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  236. cols.push(collast);
  237. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  238. cols.push(collast);
  239. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  240. //cols.push(collast);
  241. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  242. cols.push(collast);
  243. var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' };
  244. cols.push(collast);
  245. var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' };
  246. cols.push(collast);
  247. var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' };
  248. cols.push(collast);
  249. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  250. cols.push(collast);
  251. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  252. cols.push(collast);
  253. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  254. cols.push(collast);
  255. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  256. cols.push(collast);
  257. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  258. cols.push(collast);
  259. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  260. cols.push(collast);
  261. var collast = {
  262. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  263. formatter: function (cellvalue, options, rowObject) {
  264. debugger;
  265. var html = "";
  266. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  267. html += ' </select>';
  268. return cellvalue = html;
  269. }
  270. };
  271. cols.push(collast);
  272. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  273. cols.push(collast);
  274. var collast = {
  275. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  276. formatter: function (cellvalue, options, rowObject) {
  277. var html = "";
  278. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  279. html += ' </select>';
  280. return cellvalue = html;
  281. }
  282. };
  283. cols.push(collast);
  284. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  285. cols.push(collast);
  286. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  287. cols.push(collast);
  288. //var collast = {
  289. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  290. // formatter: function (cellvalue, options, rowObject) {
  291. // var html = "";
  292. // if (cellvalue != "" && cellvalue != null) {
  293. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  294. // }
  295. // return html;
  296. // }
  297. //};
  298. //cols.push(collast);
  299. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  300. cols.push(collast);
  301. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  302. cols.push(collast);
  303. $.ajax({
  304. url: "/Print/SelectTableColumnName?" + Math.random(),
  305. dataType: "json",
  306. async: false,
  307. success: function (data) {
  308. if (data != null && data.length > 0) {
  309. DateList = data;
  310. for (var i = 0; i < data.length; i++) {
  311. var TableCode = data[i].TableCode;
  312. if (TableCode == "ICSODeliveryNotice") {
  313. var Code = data[i].Code;
  314. var Name = data[i].Name;
  315. var obj = new Array();
  316. obj = {
  317. label: Name,
  318. name: Code,
  319. width: 80,
  320. align: "left"
  321. }
  322. cols.push(obj);
  323. }
  324. if (TableCode == "ICSInventory") {
  325. var Code = data[i].Code;
  326. var Name = data[i].Name;
  327. var obj = new Array();
  328. obj = {
  329. label: Name,
  330. name: Code,
  331. width: 80,
  332. align: "left"
  333. }
  334. cols.push(obj);
  335. //cols1.push(obj);
  336. }
  337. }
  338. }
  339. _Closs = cols;
  340. //_Clos1 = cols1;
  341. }
  342. });
  343. }
  344. //产成品检验
  345. if (Type == '2') {
  346. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  347. cols.push(collast);
  348. var collast = { label: 'ID', name: 'ID', hidden: true };
  349. cols.push(collast);
  350. var collast = { label: '工单ID', name: 'GDID', hidden: true };
  351. cols.push(collast);
  352. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  353. cols.push(collast);
  354. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  355. cols.push(collast);
  356. var collast = { label: '工单单号', name: 'DNCode', width: 120, align: 'left' };
  357. cols.push(collast);
  358. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  359. cols.push(collast);
  360. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  361. cols.push(collast);
  362. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  363. cols.push(collast);
  364. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  365. cols.push(collast);
  366. var collast = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' };
  367. cols.push(collast);
  368. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  369. //cols.push(collast);
  370. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  371. cols.push(collast);
  372. var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' };
  373. cols.push(collast);
  374. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  375. cols.push(collast);
  376. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  377. cols.push(collast);
  378. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  379. cols.push(collast);
  380. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  381. cols.push(collast);
  382. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  383. cols.push(collast);
  384. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  385. cols.push(collast);
  386. var collast = {
  387. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  388. formatter: function (cellvalue, options, rowObject) {
  389. debugger;
  390. var html = "";
  391. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  392. html += ' </select>';
  393. return cellvalue = html;
  394. }
  395. };
  396. cols.push(collast);
  397. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  398. cols.push(collast);
  399. var collast = {
  400. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  401. formatter: function (cellvalue, options, rowObject) {
  402. var html = "";
  403. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  404. html += ' </select>';
  405. return cellvalue = html;
  406. }
  407. };
  408. cols.push(collast);
  409. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  410. cols.push(collast);
  411. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  412. cols.push(collast);
  413. //var collast = {
  414. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  415. // formatter: function (cellvalue, options, rowObject) {
  416. // var html = "";
  417. // if (cellvalue != "" && cellvalue != null) {
  418. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  419. // }
  420. // return html;
  421. // }
  422. //};
  423. //cols.push(collast);
  424. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  425. cols.push(collast);
  426. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  427. cols.push(collast);
  428. $.ajax({
  429. url: "/Print/SelectTableColumnName?" + Math.random(),
  430. dataType: "json",
  431. async: false,
  432. success: function (data) {
  433. if (data != null && data.length > 0) {
  434. DateList = data;
  435. for (var i = 0; i < data.length; i++) {
  436. var TableCode = data[i].TableCode;
  437. if (TableCode == "ICSMO") {
  438. var Code = data[i].Code;
  439. var Name = data[i].Name;
  440. var obj = new Array();
  441. obj = {
  442. label: Name,
  443. name: Code,
  444. width: 80,
  445. align: "left"
  446. }
  447. cols.push(obj);
  448. }
  449. if (TableCode == "ICSInventory") {
  450. var Code = data[i].Code;
  451. var Name = data[i].Name;
  452. var obj = new Array();
  453. obj = {
  454. label: Name,
  455. name: Code,
  456. width: 80,
  457. align: "left"
  458. }
  459. cols.push(obj);
  460. //cols1.push(obj);
  461. }
  462. }
  463. }
  464. _Closs = cols;
  465. //_Clos1 = cols1;
  466. }
  467. });
  468. }
  469. //其他入库
  470. if (Type == '4') {
  471. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  472. cols.push(collast);
  473. var collast = { label: 'ID', name: 'ID', hidden: true };
  474. cols.push(collast);
  475. var collast = { label: '工单ID', name: 'GDID', hidden: true };
  476. cols.push(collast);
  477. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  478. cols.push(collast);
  479. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  480. cols.push(collast);
  481. var collast = { label: '杂收单号', name: 'DNCode', width: 120, align: 'left' };
  482. cols.push(collast);
  483. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  484. cols.push(collast);
  485. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  486. cols.push(collast);
  487. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  488. cols.push(collast);
  489. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  490. cols.push(collast);
  491. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  492. //cols.push(collast);
  493. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  494. cols.push(collast);
  495. var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' };
  496. cols.push(collast);
  497. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  498. cols.push(collast);
  499. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  500. cols.push(collast);
  501. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  502. cols.push(collast);
  503. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  504. cols.push(collast);
  505. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  506. cols.push(collast);
  507. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  508. cols.push(collast);
  509. var collast = {
  510. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  511. formatter: function (cellvalue, options, rowObject) {
  512. debugger;
  513. var html = "";
  514. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  515. html += ' </select>';
  516. return cellvalue = html;
  517. }
  518. };
  519. cols.push(collast);
  520. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  521. cols.push(collast);
  522. var collast = {
  523. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  524. formatter: function (cellvalue, options, rowObject) {
  525. var html = "";
  526. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  527. html += ' </select>';
  528. return cellvalue = html;
  529. }
  530. };
  531. cols.push(collast);
  532. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  533. cols.push(collast);
  534. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  535. cols.push(collast);
  536. //var collast = {
  537. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  538. // formatter: function (cellvalue, options, rowObject) {
  539. // var html = "";
  540. // if (cellvalue != "" && cellvalue != null) {
  541. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  542. // }
  543. // return html;
  544. // }
  545. //};
  546. //cols.push(collast);
  547. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  548. cols.push(collast);
  549. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  550. cols.push(collast);
  551. $.ajax({
  552. url: "/Print/SelectTableColumnName?" + Math.random(),
  553. dataType: "json",
  554. async: false,
  555. success: function (data) {
  556. if (data != null && data.length > 0) {
  557. DateList = data;
  558. for (var i = 0; i < data.length; i++) {
  559. var TableCode = data[i].TableCode;
  560. if (TableCode == "ICSOtherIn") {
  561. var Code = data[i].Code;
  562. var Name = data[i].Name;
  563. var obj = new Array();
  564. obj = {
  565. label: Name,
  566. name: Code,
  567. width: 80,
  568. align: "left"
  569. }
  570. cols.push(obj);
  571. }
  572. if (TableCode == "ICSInventory") {
  573. var Code = data[i].Code;
  574. var Name = data[i].Name;
  575. var obj = new Array();
  576. obj = {
  577. label: Name,
  578. name: Code,
  579. width: 80,
  580. align: "left"
  581. }
  582. cols.push(obj);
  583. //cols1.push(obj);
  584. }
  585. }
  586. }
  587. _Closs = cols;
  588. //_Clos1 = cols1;
  589. }
  590. });
  591. }
  592. //生产退料
  593. if (Type == '5') {
  594. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  595. cols.push(collast);
  596. var collast = { label: 'ID', name: 'ID', hidden: true };
  597. cols.push(collast);
  598. var collast = { label: '工单ID', name: 'GDID', hidden: true };
  599. cols.push(collast);
  600. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  601. cols.push(collast);
  602. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  603. cols.push(collast);
  604. var collast = { label: '退料申请单号', name: 'DNCode', width: 120, align: 'left' };
  605. cols.push(collast);
  606. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  607. cols.push(collast);
  608. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  609. cols.push(collast);
  610. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  611. cols.push(collast);
  612. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  613. cols.push(collast);
  614. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  615. //cols.push(collast);
  616. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  617. cols.push(collast);
  618. var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' };
  619. cols.push(collast);
  620. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  621. cols.push(collast);
  622. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  623. cols.push(collast);
  624. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  625. cols.push(collast);
  626. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  627. cols.push(collast);
  628. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  629. cols.push(collast);
  630. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  631. cols.push(collast);
  632. var collast = {
  633. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  634. formatter: function (cellvalue, options, rowObject) {
  635. debugger;
  636. var html = "";
  637. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  638. html += ' </select>';
  639. return cellvalue = html;
  640. }
  641. };
  642. cols.push(collast);
  643. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  644. cols.push(collast);
  645. var collast = {
  646. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  647. formatter: function (cellvalue, options, rowObject) {
  648. var html = "";
  649. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  650. html += ' </select>';
  651. return cellvalue = html;
  652. }
  653. };
  654. cols.push(collast);
  655. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  656. cols.push(collast);
  657. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  658. cols.push(collast);
  659. //var collast = {
  660. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  661. // formatter: function (cellvalue, options, rowObject) {
  662. // var html = "";
  663. // if (cellvalue != "" && cellvalue != null) {
  664. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  665. // }
  666. // return html;
  667. // }
  668. //};
  669. //cols.push(collast);
  670. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  671. cols.push(collast);
  672. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  673. cols.push(collast);
  674. $.ajax({
  675. url: "/Print/SelectTableColumnName?" + Math.random(),
  676. dataType: "json",
  677. async: false,
  678. success: function (data) {
  679. if (data != null && data.length > 0) {
  680. DateList = data;
  681. for (var i = 0; i < data.length; i++) {
  682. var TableCode = data[i].TableCode;
  683. if (TableCode == "ICSMOApplyNeg") {
  684. var Code = data[i].Code;
  685. var Name = data[i].Name;
  686. var obj = new Array();
  687. obj = {
  688. label: Name,
  689. name: Code,
  690. width: 80,
  691. align: "left"
  692. }
  693. cols.push(obj);
  694. }
  695. if (TableCode == "ICSInventory") {
  696. var Code = data[i].Code;
  697. var Name = data[i].Name;
  698. var obj = new Array();
  699. obj = {
  700. label: Name,
  701. name: Code,
  702. width: 80,
  703. align: "left"
  704. }
  705. cols.push(obj);
  706. //cols1.push(obj);
  707. }
  708. }
  709. }
  710. _Closs = cols;
  711. //_Clos1 = cols1;
  712. }
  713. });
  714. }
  715. //委外退料
  716. if (Type == '6') {
  717. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  718. cols.push(collast);
  719. var collast = { label: 'ID', name: 'ID', hidden: true };
  720. cols.push(collast);
  721. var collast = { label: '工单ID', name: 'GDID', hidden: true };
  722. cols.push(collast);
  723. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  724. cols.push(collast);
  725. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  726. cols.push(collast);
  727. var collast = { label: '委外退料申请单号', name: 'DNCode', width: 120, align: 'left' };
  728. cols.push(collast);
  729. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  730. cols.push(collast);
  731. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  732. cols.push(collast);
  733. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  734. cols.push(collast);
  735. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  736. cols.push(collast);
  737. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  738. //cols.push(collast);
  739. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  740. cols.push(collast);
  741. var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' };
  742. cols.push(collast);
  743. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  744. cols.push(collast);
  745. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  746. cols.push(collast);
  747. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  748. cols.push(collast);
  749. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  750. cols.push(collast);
  751. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  752. cols.push(collast);
  753. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  754. cols.push(collast);
  755. var collast = {
  756. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  757. formatter: function (cellvalue, options, rowObject) {
  758. debugger;
  759. var html = "";
  760. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  761. html += ' </select>';
  762. return cellvalue = html;
  763. }
  764. };
  765. cols.push(collast);
  766. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  767. cols.push(collast);
  768. var collast = {
  769. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  770. formatter: function (cellvalue, options, rowObject) {
  771. var html = "";
  772. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  773. html += ' </select>';
  774. return cellvalue = html;
  775. }
  776. };
  777. cols.push(collast);
  778. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  779. cols.push(collast);
  780. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  781. cols.push(collast);
  782. //var collast = {
  783. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  784. // formatter: function (cellvalue, options, rowObject) {
  785. // var html = "";
  786. // if (cellvalue != "" && cellvalue != null) {
  787. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  788. // }
  789. // return html;
  790. // }
  791. //};
  792. //cols.push(collast);
  793. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  794. cols.push(collast);
  795. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  796. cols.push(collast);
  797. $.ajax({
  798. url: "/Print/SelectTableColumnName?" + Math.random(),
  799. dataType: "json",
  800. async: false,
  801. success: function (data) {
  802. if (data != null && data.length > 0) {
  803. DateList = data;
  804. for (var i = 0; i < data.length; i++) {
  805. var TableCode = data[i].TableCode;
  806. if (TableCode == "ICSOApplyNeg") {
  807. var Code = data[i].Code;
  808. var Name = data[i].Name;
  809. var obj = new Array();
  810. obj = {
  811. label: Name,
  812. name: Code,
  813. width: 80,
  814. align: "left"
  815. }
  816. cols.push(obj);
  817. }
  818. if (TableCode == "ICSInventory") {
  819. var Code = data[i].Code;
  820. var Name = data[i].Name;
  821. var obj = new Array();
  822. obj = {
  823. label: Name,
  824. name: Code,
  825. width: 80,
  826. align: "left"
  827. }
  828. cols.push(obj);
  829. //cols1.push(obj);
  830. }
  831. }
  832. }
  833. _Closs = cols;
  834. //_Clos1 = cols1;
  835. }
  836. });
  837. }
  838. //销售退货
  839. if (Type == '7') {
  840. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  841. cols.push(collast);
  842. var collast = { label: 'ID', name: 'ID', hidden: true };
  843. cols.push(collast);
  844. var collast = { label: '工单ID', name: 'GDID', hidden: true };
  845. cols.push(collast);
  846. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  847. cols.push(collast);
  848. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  849. cols.push(collast);
  850. var collast = { label: '销售退货单号', name: 'DNCode', width: 120, align: 'left' };
  851. cols.push(collast);
  852. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  853. cols.push(collast);
  854. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  855. cols.push(collast);
  856. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  857. cols.push(collast);
  858. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  859. cols.push(collast);
  860. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  861. //cols.push(collast);
  862. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  863. cols.push(collast);
  864. var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' };
  865. cols.push(collast);
  866. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  867. cols.push(collast);
  868. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  869. cols.push(collast);
  870. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  871. cols.push(collast);
  872. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  873. cols.push(collast);
  874. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  875. cols.push(collast);
  876. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  877. cols.push(collast);
  878. var collast = {
  879. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  880. formatter: function (cellvalue, options, rowObject) {
  881. debugger;
  882. var html = "";
  883. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  884. html += ' </select>';
  885. return cellvalue = html;
  886. }
  887. };
  888. cols.push(collast);
  889. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  890. cols.push(collast);
  891. var collast = {
  892. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  893. formatter: function (cellvalue, options, rowObject) {
  894. var html = "";
  895. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  896. html += ' </select>';
  897. return cellvalue = html;
  898. }
  899. };
  900. cols.push(collast);
  901. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  902. cols.push(collast);
  903. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  904. cols.push(collast);
  905. //var collast = {
  906. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  907. // formatter: function (cellvalue, options, rowObject) {
  908. // var html = "";
  909. // if (cellvalue != "" && cellvalue != null) {
  910. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  911. // }
  912. // return html;
  913. // }
  914. //};
  915. //cols.push(collast);
  916. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  917. cols.push(collast);
  918. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  919. cols.push(collast);
  920. $.ajax({
  921. url: "/Print/SelectTableColumnName?" + Math.random(),
  922. dataType: "json",
  923. async: false,
  924. success: function (data) {
  925. if (data != null && data.length > 0) {
  926. DateList = data;
  927. for (var i = 0; i < data.length; i++) {
  928. var TableCode = data[i].TableCode;
  929. if (TableCode == "ICSSDN") {
  930. var Code = data[i].Code;
  931. var Name = data[i].Name;
  932. var obj = new Array();
  933. obj = {
  934. label: Name,
  935. name: Code,
  936. width: 80,
  937. align: "left"
  938. }
  939. cols.push(obj);
  940. }
  941. if (TableCode == "ICSInventory") {
  942. var Code = data[i].Code;
  943. var Name = data[i].Name;
  944. var obj = new Array();
  945. obj = {
  946. label: Name,
  947. name: Code,
  948. width: 80,
  949. align: "left"
  950. }
  951. cols.push(obj);
  952. //cols1.push(obj);
  953. }
  954. }
  955. }
  956. _Closs = cols;
  957. //_Clos1 = cols1;
  958. }
  959. });
  960. }
  961. if (Type == '8') {
  962. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  963. cols.push(collast);
  964. var collast = { label: 'ID', name: 'ID', hidden: true };
  965. cols.push(collast);
  966. var collast = { label: '到货ID', name: 'DHID', hidden: true };
  967. cols.push(collast);
  968. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  969. cols.push(collast);
  970. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  971. cols.push(collast);
  972. var collast = { label: '到货单号', name: 'DNCode', width: 120, align: 'left' };
  973. cols.push(collast);
  974. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  975. cols.push(collast);
  976. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  977. cols.push(collast);
  978. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  979. cols.push(collast);
  980. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  981. cols.push(collast);
  982. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  983. //cols.push(collast);
  984. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  985. cols.push(collast);
  986. var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' };
  987. cols.push(collast);
  988. var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' };
  989. cols.push(collast);
  990. var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' };
  991. cols.push(collast);
  992. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  993. cols.push(collast);
  994. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  995. cols.push(collast);
  996. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  997. cols.push(collast);
  998. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  999. cols.push(collast);
  1000. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1001. cols.push(collast);
  1002. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  1003. cols.push(collast);
  1004. var collast = {
  1005. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  1006. formatter: function (cellvalue, options, rowObject) {
  1007. debugger;
  1008. var html = "";
  1009. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  1010. html += ' </select>';
  1011. return cellvalue = html;
  1012. }
  1013. };
  1014. cols.push(collast);
  1015. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  1016. cols.push(collast);
  1017. var collast = {
  1018. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  1019. formatter: function (cellvalue, options, rowObject) {
  1020. var html = "";
  1021. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  1022. html += ' </select>';
  1023. return cellvalue = html;
  1024. }
  1025. };
  1026. cols.push(collast);
  1027. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  1028. cols.push(collast);
  1029. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  1030. cols.push(collast);
  1031. //var collast = {
  1032. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  1033. // formatter: function (cellvalue, options, rowObject) {
  1034. // var html = "";
  1035. // if (cellvalue != "" && cellvalue != null) {
  1036. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  1037. // }
  1038. // return html;
  1039. // }
  1040. //};
  1041. //cols.push(collast);
  1042. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  1043. cols.push(collast);
  1044. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  1045. cols.push(collast);
  1046. $.ajax({
  1047. url: "/Print/SelectTableColumnName?" + Math.random(),
  1048. dataType: "json",
  1049. async: false,
  1050. success: function (data) {
  1051. if (data != null && data.length > 0) {
  1052. DateList = data;
  1053. for (var i = 0; i < data.length; i++) {
  1054. var TableCode = data[i].TableCode;
  1055. if (TableCode == "ICSInspection") {
  1056. var Code = data[i].Code;
  1057. var Name = data[i].Name;
  1058. var obj = new Array();
  1059. obj = {
  1060. label: Name,
  1061. name: Code,
  1062. width: 80,
  1063. align: "left"
  1064. }
  1065. cols.push(obj);
  1066. }
  1067. if (TableCode == "ICSInventory") {
  1068. var Code = data[i].Code;
  1069. var Name = data[i].Name;
  1070. var obj = new Array();
  1071. obj = {
  1072. label: Name,
  1073. name: Code,
  1074. width: 80,
  1075. align: "left"
  1076. }
  1077. cols.push(obj);
  1078. //cols1.push(obj);
  1079. }
  1080. }
  1081. }
  1082. _Closs = cols;
  1083. //_Clos1 = cols1;
  1084. }
  1085. });
  1086. }
  1087. if (Type == '9') {
  1088. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  1089. cols.push(collast);
  1090. var collast = { label: 'ID', name: 'ID', hidden: true };
  1091. cols.push(collast);
  1092. var collast = { label: '到货ID', name: 'DHID', hidden: true };
  1093. cols.push(collast);
  1094. var collast = { label: '检验ID', name: 'JYID', hidden: true };
  1095. cols.push(collast);
  1096. var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook };
  1097. cols.push(collast);
  1098. var collast = { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' };
  1099. cols.push(collast);
  1100. //var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' };
  1101. //cols.push(collast);
  1102. //var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' };
  1103. //cols.push(collast);
  1104. var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
  1105. cols.push(collast);
  1106. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  1107. cols.push(collast);
  1108. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  1109. cols.push(collast);
  1110. var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' };
  1111. cols.push(collast);
  1112. //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
  1113. //cols.push(collast);
  1114. var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' };
  1115. cols.push(collast);
  1116. var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' };
  1117. cols.push(collast);
  1118. var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' };
  1119. cols.push(collast);
  1120. var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' };
  1121. cols.push(collast);
  1122. var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' };
  1123. cols.push(collast);
  1124. var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1125. cols.push(collast);
  1126. var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1127. cols.push(collast);
  1128. var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1129. cols.push(collast);
  1130. var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } };
  1131. cols.push(collast);
  1132. var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true };
  1133. cols.push(collast);
  1134. var collast = {
  1135. label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false,
  1136. formatter: function (cellvalue, options, rowObject) {
  1137. debugger;
  1138. var html = "";
  1139. html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  1140. html += ' </select>';
  1141. return cellvalue = html;
  1142. }
  1143. };
  1144. cols.push(collast);
  1145. var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true };
  1146. cols.push(collast);
  1147. var collast = {
  1148. label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false,
  1149. formatter: function (cellvalue, options, rowObject) {
  1150. var html = "";
  1151. html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">';
  1152. html += ' </select>';
  1153. return cellvalue = html;
  1154. }
  1155. };
  1156. cols.push(collast);
  1157. var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' };
  1158. cols.push(collast);
  1159. var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' };
  1160. cols.push(collast);
  1161. //var collast = {
  1162. // label: '检验文件', name: 'FileName', width: 150, align: 'left',
  1163. // formatter: function (cellvalue, options, rowObject) {
  1164. // var html = "";
  1165. // if (cellvalue != "" && cellvalue != null) {
  1166. // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>";
  1167. // }
  1168. // return html;
  1169. // }
  1170. //};
  1171. //cols.push(collast);
  1172. var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' };
  1173. cols.push(collast);
  1174. var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' };
  1175. cols.push(collast);
  1176. $.ajax({
  1177. url: "/Print/SelectTableColumnName?" + Math.random(),
  1178. dataType: "json",
  1179. async: false,
  1180. success: function (data) {
  1181. if (data != null && data.length > 0) {
  1182. DateList = data;
  1183. for (var i = 0; i < data.length; i++) {
  1184. var TableCode = data[i].TableCode;
  1185. if (TableCode == "ICSODeliveryNotice") {
  1186. var Code = data[i].Code;
  1187. var Name = data[i].Name;
  1188. var obj = new Array();
  1189. obj = {
  1190. label: Name,
  1191. name: Code,
  1192. width: 80,
  1193. align: "left"
  1194. }
  1195. cols.push(obj);
  1196. }
  1197. if (TableCode == "ICSInventory") {
  1198. var Code = data[i].Code;
  1199. var Name = data[i].Name;
  1200. var obj = new Array();
  1201. obj = {
  1202. label: Name,
  1203. name: Code,
  1204. width: 80,
  1205. align: "left"
  1206. }
  1207. cols.push(obj);
  1208. //cols1.push(obj);
  1209. }
  1210. }
  1211. }
  1212. _Closs = cols;
  1213. //_Clos1 = cols1;
  1214. }
  1215. });
  1216. }
  1217. if (data != null && data.length > 0) {
  1218. DateList = data;
  1219. for (var i = 0; i < data.length; i++) {
  1220. var ColName = data[i].ColName;
  1221. var ColCode = data[i].ColCode;
  1222. var obj = new Array();
  1223. obj = {
  1224. label: ColName,
  1225. name: ColCode,
  1226. width: 80,
  1227. align: "left"
  1228. }
  1229. cols.push(obj);
  1230. }
  1231. }
  1232. _Clos = cols;
  1233. }
  1234. });
  1235. }
  1236. function gridList() {
  1237. var $gridList = $("#gridList");
  1238. var queryJson = {
  1239. POCode: $("#txt_POCode").val(),
  1240. ASNCode: $("#txt_ASNCode").val(),
  1241. CaiGouCode: $("#txt_CaiGouCode").val(),
  1242. VenCode: $("#txt_VenCode").val(),
  1243. VenName: $("#txt_VenName").val(),
  1244. InvCode: $("#txt_InvCode").val(),
  1245. InvName: $("#txt_InvName").val(),
  1246. BatchCode: $("#txt_BatchCode").val(),
  1247. ReleaseState: $("#selShow").val(),
  1248. TimeFrom: $("#TimeFrom").val(),
  1249. TimeArrive: $("#TimeArrive").val(),
  1250. selEnableShow: $("#selEnableShow").val(),
  1251. }
  1252. $gridList.dataGrid({
  1253. url: "/WMS/ICSRCVIQCs/GetICSInspection" + "?" + Math.random(),
  1254. postData: { queryJson: JSON.stringify(queryJson) },
  1255. height: $(window).height() - 200,
  1256. width: $(window).width() - 300,
  1257. cellEdit: true,
  1258. colModel: _Clos,
  1259. cellsubmit: "clientArray",
  1260. shrinkToFit: false,//宽度自适应
  1261. autoWidth: true,
  1262. gridComplete: function () {
  1263. debugger;
  1264. //设置select
  1265. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1266. for (var j = 0; j < RowDatas.length; j++) {
  1267. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1268. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1269. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1270. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1271. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1272. GetSelectPerson(InvCode, ID, BRCodeValue);
  1273. }
  1274. },
  1275. pager: "#gridPager",
  1276. sortorder: "desc",
  1277. sortname: 'DNCode ',
  1278. viewrecords: true,
  1279. multiselect: true,
  1280. subGrid: false, // (1)开启子表格支持
  1281. afterSaveCell: function (rowid, cellname, value) {
  1282. debugger;
  1283. //总扣分数加其他扣分数
  1284. if (cellname === 'YLOTQTY') {
  1285. var YLOTQTY = value;
  1286. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1287. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1288. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1289. }
  1290. if (cellname === 'NLOTQTY') {
  1291. var NLOTQTY = value;
  1292. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1293. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1294. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1295. }
  1296. },
  1297. });
  1298. $("#btn_search").click(function () {
  1299. var warehouse = $("#warehouse a.active").attr('data-value');
  1300. var queryJson = {
  1301. POCode: $("#txt_POCode").val(),
  1302. ASNCode: $("#txt_ASNCode").val(),
  1303. CaiGouCode: $("#txt_CaiGouCode").val(),
  1304. VenCode: $("#txt_VenCode").val(),
  1305. VenName: $("#txt_VenName").val(),
  1306. InvCode: $("#txt_InvCode").val(),
  1307. InvName: $("#txt_InvName").val(),
  1308. BatchCode: $("#txt_BatchCode").val(),
  1309. ReleaseState: $("#selShow").val(),
  1310. TimeFrom: $("#TimeFrom").val(),
  1311. TimeArrive: $("#TimeArrive").val(),
  1312. selEnableShow: $("#selEnableShow").val(),
  1313. }
  1314. $gridList.jqGrid('setGridParam', {
  1315. postData: { queryJson: JSON.stringify(queryJson) },
  1316. }).trigger('reloadGrid');
  1317. });
  1318. }
  1319. function gridList2() {
  1320. var $gridList = $("#gridList");
  1321. var queryJson = {
  1322. POCode: $("#txt_POCode").val(),
  1323. ASNCode: $("#txt_ASNCode").val(),
  1324. CaiGouCode: $("#txt_CaiGouCode").val(),
  1325. VenCode: $("#txt_VenCode").val(),
  1326. VenName: $("#txt_VenName").val(),
  1327. InvCode: $("#txt_InvCode").val(),
  1328. InvName: $("#txt_InvName").val(),
  1329. BatchCode: $("#txt_BatchCode").val(),
  1330. ReleaseState: $("#selShow").val(),
  1331. TimeFrom: $("#TimeFrom").val(),
  1332. TimeArrive: $("#TimeArrive").val(),
  1333. ReleaseState: $("#selShow").val(),
  1334. selEnableShow: $("#selEnableShow").val(),
  1335. }
  1336. $gridList.dataGrid({
  1337. url: "/WMS/ICSRCVIQCs/GetICSInspection2" + "?" + Math.random(),
  1338. postData: { queryJson: JSON.stringify(queryJson) },
  1339. height: $(window).height() - 200,
  1340. width: $(window).width() - 300,
  1341. cellEdit: true,
  1342. colModel: _Clos,
  1343. cellsubmit: "clientArray",
  1344. shrinkToFit: false,//宽度自适应
  1345. autoWidth: true,
  1346. gridComplete: function () {
  1347. debugger;
  1348. //设置select
  1349. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1350. for (var j = 0; j < RowDatas.length; j++) {
  1351. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1352. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1353. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1354. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1355. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1356. GetSelectPerson(InvCode, ID, BRCodeValue);
  1357. }
  1358. },
  1359. pager: "#gridPager",
  1360. sortorder: "desc",
  1361. sortname: 'DNCode ',
  1362. viewrecords: true,
  1363. multiselect: true,
  1364. subGrid: false, // (1)开启子表格支持
  1365. afterSaveCell: function (rowid, cellname, value) {
  1366. debugger;
  1367. //总扣分数加其他扣分数
  1368. if (cellname === 'YLOTQTY') {
  1369. var YLOTQTY = value;
  1370. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1371. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1372. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1373. }
  1374. if (cellname === 'NLOTQTY') {
  1375. var NLOTQTY = value;
  1376. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1377. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1378. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1379. }
  1380. if (cellname === 'BadReasonDesc') {
  1381. $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value);
  1382. }
  1383. if (cellname === 'BadDesc') {
  1384. $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value);
  1385. }
  1386. },
  1387. });
  1388. $("#btn_search").click(function () {
  1389. var warehouse = $("#warehouse a.active").attr('data-value');
  1390. var queryJson = {
  1391. POCode: $("#txt_POCode").val(),
  1392. ASNCode: $("#txt_ASNCode").val(),
  1393. CaiGouCode: $("#txt_CaiGouCode").val(),
  1394. VenCode: $("#txt_VenCode").val(),
  1395. VenName: $("#txt_VenName").val(),
  1396. InvCode: $("#txt_InvCode").val(),
  1397. InvName: $("#txt_InvName").val(),
  1398. BatchCode: $("#txt_BatchCode").val(),
  1399. ReleaseState: $("#selShow").val(),
  1400. TimeFrom: $("#TimeFrom").val(),
  1401. TimeArrive: $("#TimeArrive").val(),
  1402. selEnableShow: $("#selEnableShow").val(),
  1403. }
  1404. $gridList.jqGrid('setGridParam', {
  1405. postData: { queryJson: JSON.stringify(queryJson) },
  1406. }).trigger('reloadGrid');
  1407. });
  1408. }
  1409. function gridList3() {
  1410. var $gridList = $("#gridList");
  1411. var queryJson = {
  1412. POCode: $("#txt_POCode").val(),
  1413. InvCode: $("#txt_InvCode").val(),
  1414. InvName: $("#txt_InvName").val(),
  1415. BatchCode: $("#txt_BatchCode").val(),
  1416. ReleaseState: $("#selShow").val(),
  1417. selEnableShow: $("#selEnableShow").val(),
  1418. }
  1419. $gridList.dataGrid({
  1420. url: "/WMS/ICSRCVIQCs/GetICSInspection3" + "?" + Math.random(),
  1421. postData: { queryJson: JSON.stringify(queryJson) },
  1422. height: $(window).height() - 200,
  1423. width: $(window).width() - 300,
  1424. cellEdit: true,
  1425. colModel: _Clos,
  1426. cellsubmit: "clientArray",
  1427. shrinkToFit: false,//宽度自适应
  1428. autoWidth: true,
  1429. gridComplete: function () {
  1430. debugger;
  1431. //设置select
  1432. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1433. for (var j = 0; j < RowDatas.length; j++) {
  1434. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1435. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1436. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1437. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1438. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1439. GetSelectPerson(InvCode, ID, BRCodeValue);
  1440. }
  1441. },
  1442. pager: "#gridPager",
  1443. sortorder: "desc",
  1444. sortname: 'DNCode ',
  1445. viewrecords: true,
  1446. multiselect: true,
  1447. afterSaveCell: function (rowid, cellname, value) {
  1448. debugger;
  1449. //总扣分数加其他扣分数
  1450. if (cellname === 'YLOTQTY') {
  1451. var YLOTQTY = value;
  1452. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1453. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1454. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1455. }
  1456. if (cellname === 'NLOTQTY') {
  1457. var NLOTQTY = value;
  1458. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1459. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1460. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1461. }
  1462. if (cellname === 'BadReasonDesc') {
  1463. $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value);
  1464. }
  1465. if (cellname === 'BadDesc') {
  1466. $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value);
  1467. }
  1468. },
  1469. });
  1470. $("#btn_search").click(function () {
  1471. var warehouse = $("#warehouse a.active").attr('data-value');
  1472. var queryJson = {
  1473. POCode: $("#txt_POCode").val(),
  1474. InvCode: $("#txt_InvCode").val(),
  1475. InvName: $("#txt_InvName").val(),
  1476. BatchCode: $("#txt_BatchCode").val(),
  1477. ReleaseState: $("#selShow").val(),
  1478. selEnableShow: $("#selEnableShow").val(),
  1479. }
  1480. $gridList.jqGrid('setGridParam', {
  1481. postData: { queryJson: JSON.stringify(queryJson) },
  1482. }).trigger('reloadGrid');
  1483. });
  1484. }
  1485. function gridList4() {
  1486. var $gridList = $("#gridList");
  1487. var queryJson = {
  1488. POCode: $("#txt_POCode").val(),
  1489. ASNCode: $("#txt_ASNCode").val(),
  1490. CaiGouCode: $("#txt_CaiGouCode").val(),
  1491. VenCode: $("#txt_VenCode").val(),
  1492. VenName: $("#txt_VenName").val(),
  1493. InvCode: $("#txt_InvCode").val(),
  1494. InvName: $("#txt_InvName").val(),
  1495. BatchCode: $("#txt_BatchCode").val(),
  1496. ReleaseState: $("#selShow").val(),
  1497. selEnableShow: $("#selEnableShow").val(),
  1498. }
  1499. $gridList.dataGrid({
  1500. url: "/WMS/ICSRCVIQCs/GetICSInspection4" + "?" + Math.random(),
  1501. postData: { queryJson: JSON.stringify(queryJson) },
  1502. height: $(window).height() - 200,
  1503. width: $(window).width() - 300,
  1504. cellEdit: true,
  1505. colModel: _Clos,
  1506. cellsubmit: "clientArray",
  1507. shrinkToFit: false,//宽度自适应
  1508. autoWidth: true,
  1509. gridComplete: function () {
  1510. debugger;
  1511. //设置select
  1512. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1513. for (var j = 0; j < RowDatas.length; j++) {
  1514. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1515. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1516. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1517. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1518. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1519. GetSelectPerson(InvCode, ID, BRCodeValue);
  1520. }
  1521. },
  1522. pager: "#gridPager",
  1523. sortorder: "desc",
  1524. sortname: 'DNCode ',
  1525. viewrecords: true,
  1526. multiselect: true,
  1527. subGrid: false, // (1)开启子表格支持
  1528. afterSaveCell: function (rowid, cellname, value) {
  1529. debugger;
  1530. //总扣分数加其他扣分数
  1531. if (cellname === 'YLOTQTY') {
  1532. var YLOTQTY = value;
  1533. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1534. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1535. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1536. }
  1537. if (cellname === 'NLOTQTY') {
  1538. var NLOTQTY = value;
  1539. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1540. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1541. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1542. }
  1543. },
  1544. });
  1545. $("#btn_search").click(function () {
  1546. var warehouse = $("#warehouse a.active").attr('data-value');
  1547. var queryJson = {
  1548. POCode: $("#txt_POCode").val(),
  1549. ASNCode: $("#txt_ASNCode").val(),
  1550. CaiGouCode: $("#txt_CaiGouCode").val(),
  1551. VenCode: $("#txt_VenCode").val(),
  1552. VenName: $("#txt_VenName").val(),
  1553. InvCode: $("#txt_InvCode").val(),
  1554. InvName: $("#txt_InvName").val(),
  1555. BatchCode: $("#txt_BatchCode").val(),
  1556. ReleaseState: $("#selShow").val(),
  1557. selEnableShow: $("#selEnableShow").val(),
  1558. }
  1559. $gridList.jqGrid('setGridParam', {
  1560. postData: { queryJson: JSON.stringify(queryJson) },
  1561. }).trigger('reloadGrid');
  1562. });
  1563. }
  1564. function gridList5() {
  1565. var $gridList = $("#gridList");
  1566. var queryJson = {
  1567. POCode: $("#txt_POCode").val(),
  1568. ASNCode: $("#txt_ASNCode").val(),
  1569. CaiGouCode: $("#txt_CaiGouCode").val(),
  1570. VenCode: $("#txt_VenCode").val(),
  1571. VenName: $("#txt_VenName").val(),
  1572. InvCode: $("#txt_InvCode").val(),
  1573. InvName: $("#txt_InvName").val(),
  1574. BatchCode: $("#txt_BatchCode").val(),
  1575. ReleaseState: $("#selShow").val(),
  1576. selEnableShow: $("#selEnableShow").val(),
  1577. }
  1578. $gridList.dataGrid({
  1579. url: "/WMS/ICSRCVIQCs/GetICSInspection5" + "?" + Math.random(),
  1580. postData: { queryJson: JSON.stringify(queryJson) },
  1581. height: $(window).height() - 200,
  1582. width: $(window).width() - 300,
  1583. cellEdit: true,
  1584. colModel: _Clos,
  1585. cellsubmit: "clientArray",
  1586. shrinkToFit: false,//宽度自适应
  1587. autoWidth: true,
  1588. gridComplete: function () {
  1589. debugger;
  1590. //设置select
  1591. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1592. for (var j = 0; j < RowDatas.length; j++) {
  1593. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1594. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1595. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1596. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1597. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1598. GetSelectPerson(InvCode, ID, BRCodeValue);
  1599. }
  1600. },
  1601. pager: "#gridPager",
  1602. sortorder: "desc",
  1603. sortname: 'DNCode ',
  1604. viewrecords: true,
  1605. multiselect: true,
  1606. subGrid: false, // (1)开启子表格支持
  1607. afterSaveCell: function (rowid, cellname, value) {
  1608. debugger;
  1609. //总扣分数加其他扣分数
  1610. if (cellname === 'YLOTQTY') {
  1611. var YLOTQTY = value;
  1612. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1613. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1614. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1615. }
  1616. if (cellname === 'NLOTQTY') {
  1617. var NLOTQTY = value;
  1618. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1619. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1620. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1621. }
  1622. },
  1623. });
  1624. $("#btn_search").click(function () {
  1625. var warehouse = $("#warehouse a.active").attr('data-value');
  1626. var queryJson = {
  1627. POCode: $("#txt_POCode").val(),
  1628. ASNCode: $("#txt_ASNCode").val(),
  1629. CaiGouCode: $("#txt_CaiGouCode").val(),
  1630. VenCode: $("#txt_VenCode").val(),
  1631. VenName: $("#txt_VenName").val(),
  1632. InvCode: $("#txt_InvCode").val(),
  1633. InvName: $("#txt_InvName").val(),
  1634. BatchCode: $("#txt_BatchCode").val(),
  1635. ReleaseState: $("#selShow").val(),
  1636. selEnableShow: $("#selEnableShow").val(),
  1637. }
  1638. $gridList.jqGrid('setGridParam', {
  1639. postData: { queryJson: JSON.stringify(queryJson) },
  1640. }).trigger('reloadGrid');
  1641. });
  1642. }
  1643. function gridList6() {
  1644. var $gridList = $("#gridList");
  1645. var queryJson = {
  1646. POCode: $("#txt_POCode").val(),
  1647. ASNCode: $("#txt_ASNCode").val(),
  1648. CaiGouCode: $("#txt_CaiGouCode").val(),
  1649. VenCode: $("#txt_VenCode").val(),
  1650. VenName: $("#txt_VenName").val(),
  1651. InvCode: $("#txt_InvCode").val(),
  1652. InvName: $("#txt_InvName").val(),
  1653. BatchCode: $("#txt_BatchCode").val(),
  1654. ReleaseState: $("#selShow").val(),
  1655. selEnableShow: $("#selEnableShow").val(),
  1656. }
  1657. $gridList.dataGrid({
  1658. url: "/WMS/ICSRCVIQCs/GetICSInspection6" + "?" + Math.random(),
  1659. postData: { queryJson: JSON.stringify(queryJson) },
  1660. height: $(window).height() - 200,
  1661. width: $(window).width() - 300,
  1662. cellEdit: true,
  1663. colModel: _Clos,
  1664. cellsubmit: "clientArray",
  1665. shrinkToFit: false,//宽度自适应
  1666. autoWidth: true,
  1667. gridComplete: function () {
  1668. debugger;
  1669. //设置select
  1670. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1671. for (var j = 0; j < RowDatas.length; j++) {
  1672. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1673. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1674. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1675. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1676. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1677. GetSelectPerson(InvCode, ID, BRCodeValue);
  1678. }
  1679. },
  1680. pager: "#gridPager",
  1681. sortorder: "desc",
  1682. sortname: 'DNCode ',
  1683. viewrecords: true,
  1684. multiselect: true,
  1685. subGrid: false, // (1)开启子表格支持
  1686. afterSaveCell: function (rowid, cellname, value) {
  1687. debugger;
  1688. //总扣分数加其他扣分数
  1689. if (cellname === 'YLOTQTY') {
  1690. var YLOTQTY = value;
  1691. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1692. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1693. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1694. }
  1695. if (cellname === 'NLOTQTY') {
  1696. var NLOTQTY = value;
  1697. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1698. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1699. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1700. }
  1701. },
  1702. });
  1703. $("#btn_search").click(function () {
  1704. var warehouse = $("#warehouse a.active").attr('data-value');
  1705. var queryJson = {
  1706. POCode: $("#txt_POCode").val(),
  1707. ASNCode: $("#txt_ASNCode").val(),
  1708. CaiGouCode: $("#txt_CaiGouCode").val(),
  1709. VenCode: $("#txt_VenCode").val(),
  1710. VenName: $("#txt_VenName").val(),
  1711. InvCode: $("#txt_InvCode").val(),
  1712. InvName: $("#txt_InvName").val(),
  1713. BatchCode: $("#txt_BatchCode").val(),
  1714. ReleaseState: $("#selShow").val(),
  1715. selEnableShow: $("#selEnableShow").val(),
  1716. }
  1717. $gridList.jqGrid('setGridParam', {
  1718. postData: { queryJson: JSON.stringify(queryJson) },
  1719. }).trigger('reloadGrid');
  1720. });
  1721. }
  1722. function gridList7() {
  1723. var $gridList = $("#gridList");
  1724. var queryJson = {
  1725. POCode: $("#txt_POCode").val(),
  1726. ASNCode: $("#txt_ASNCode").val(),
  1727. CaiGouCode: $("#txt_CaiGouCode").val(),
  1728. VenCode: $("#txt_VenCode").val(),
  1729. VenName: $("#txt_VenName").val(),
  1730. InvCode: $("#txt_InvCode").val(),
  1731. InvName: $("#txt_InvName").val(),
  1732. BatchCode: $("#txt_BatchCode").val(),
  1733. ReleaseState: $("#selShow").val(),
  1734. selEnableShow: $("#selEnableShow").val(),
  1735. }
  1736. $gridList.dataGrid({
  1737. url: "/WMS/ICSRCVIQCs/GetICSInspection7" + "?" + Math.random(),
  1738. postData: { queryJson: JSON.stringify(queryJson) },
  1739. height: $(window).height() - 200,
  1740. width: $(window).width() - 300,
  1741. cellEdit: true,
  1742. colModel: _Clos,
  1743. cellsubmit: "clientArray",
  1744. shrinkToFit: false,//宽度自适应
  1745. autoWidth: true,
  1746. gridComplete: function () {
  1747. debugger;
  1748. //设置select
  1749. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1750. for (var j = 0; j < RowDatas.length; j++) {
  1751. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1752. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1753. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1754. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1755. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1756. GetSelectPerson(InvCode, ID, BRCodeValue);
  1757. }
  1758. },
  1759. pager: "#gridPager",
  1760. sortorder: "desc",
  1761. sortname: 'DNCode ',
  1762. viewrecords: true,
  1763. multiselect: true,
  1764. subGrid: false, // (1)开启子表格支持
  1765. afterSaveCell: function (rowid, cellname, value) {
  1766. debugger;
  1767. //总扣分数加其他扣分数
  1768. if (cellname === 'YLOTQTY') {
  1769. var YLOTQTY = value;
  1770. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1771. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1772. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1773. }
  1774. if (cellname === 'NLOTQTY') {
  1775. var NLOTQTY = value;
  1776. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1777. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1778. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1779. }
  1780. },
  1781. });
  1782. $("#btn_search").click(function () {
  1783. var warehouse = $("#warehouse a.active").attr('data-value');
  1784. var queryJson = {
  1785. POCode: $("#txt_POCode").val(),
  1786. ASNCode: $("#txt_ASNCode").val(),
  1787. CaiGouCode: $("#txt_CaiGouCode").val(),
  1788. VenCode: $("#txt_VenCode").val(),
  1789. VenName: $("#txt_VenName").val(),
  1790. InvCode: $("#txt_InvCode").val(),
  1791. InvName: $("#txt_InvName").val(),
  1792. BatchCode: $("#txt_BatchCode").val(),
  1793. ReleaseState: $("#selShow").val(),
  1794. selEnableShow: $("#selEnableShow").val(),
  1795. }
  1796. $gridList.jqGrid('setGridParam', {
  1797. postData: { queryJson: JSON.stringify(queryJson) },
  1798. }).trigger('reloadGrid');
  1799. });
  1800. }
  1801. function gridList8() {
  1802. var $gridList = $("#gridList");
  1803. var queryJson = {
  1804. POCode: $("#txt_POCode").val(),
  1805. //ASNCode: $("#txt_ASNCode").val(),
  1806. //CaiGouCode: $("#txt_CaiGouCode").val(),
  1807. VenCode: $("#txt_VenCode").val(),
  1808. VenName: $("#txt_VenName").val(),
  1809. InvCode: $("#txt_InvCode").val(),
  1810. InvName: $("#txt_InvName").val(),
  1811. BatchCode: $("#txt_BatchCode").val(),
  1812. ReleaseState: $("#selShow").val(),
  1813. selEnableShow: $("#selEnableShow").val(),
  1814. }
  1815. $gridList.dataGrid({
  1816. url: "/WMS/ICSRCVIQCs/GetICSInspection8" + "?" + Math.random(),
  1817. postData: { queryJson: JSON.stringify(queryJson) },
  1818. height: $(window).height() - 200,
  1819. width: $(window).width() - 300,
  1820. cellEdit: true,
  1821. colModel: _Clos,
  1822. cellsubmit: "clientArray",
  1823. shrinkToFit: false,//宽度自适应
  1824. autoWidth: true,
  1825. gridComplete: function () {
  1826. debugger;
  1827. //设置select
  1828. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1829. for (var j = 0; j < RowDatas.length; j++) {
  1830. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1831. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1832. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1833. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1834. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1835. GetSelectPerson(InvCode, ID, BRCodeValue);
  1836. }
  1837. },
  1838. pager: "#gridPager",
  1839. sortorder: "desc",
  1840. sortname: 'DNCode ',
  1841. viewrecords: true,
  1842. multiselect: true,
  1843. subGrid: false, // (1)开启子表格支持
  1844. afterSaveCell: function (rowid, cellname, value) {
  1845. debugger;
  1846. //总扣分数加其他扣分数
  1847. if (cellname === 'YLOTQTY') {
  1848. var YLOTQTY = value;
  1849. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1850. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1851. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1852. }
  1853. if (cellname === 'NLOTQTY') {
  1854. var NLOTQTY = value;
  1855. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1856. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1857. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1858. }
  1859. },
  1860. });
  1861. $("#btn_search").click(function () {
  1862. var warehouse = $("#warehouse a.active").attr('data-value');
  1863. var queryJson = {
  1864. POCode: $("#txt_POCode").val(),
  1865. //ASNCode: $("#txt_ASNCode").val(),
  1866. //CaiGouCode: $("#txt_CaiGouCode").val(),
  1867. VenCode: $("#txt_VenCode").val(),
  1868. VenName: $("#txt_VenName").val(),
  1869. InvCode: $("#txt_InvCode").val(),
  1870. InvName: $("#txt_InvName").val(),
  1871. BatchCode: $("#txt_BatchCode").val(),
  1872. ReleaseState: $("#selShow").val(),
  1873. selEnableShow: $("#selEnableShow").val(),
  1874. }
  1875. $gridList.jqGrid('setGridParam', {
  1876. postData: { queryJson: JSON.stringify(queryJson) },
  1877. }).trigger('reloadGrid');
  1878. });
  1879. }
  1880. function gridList9() {
  1881. var $gridList = $("#gridList");
  1882. var queryJson = {
  1883. POCode: $("#txt_POCode").val(),
  1884. //ASNCode: $("#txt_ASNCode").val(),
  1885. //CaiGouCode: $("#txt_CaiGouCode").val(),
  1886. VenCode: $("#txt_VenCode").val(),
  1887. VenName: $("#txt_VenName").val(),
  1888. InvCode: $("#txt_InvCode").val(),
  1889. InvName: $("#txt_InvName").val(),
  1890. BatchCode: $("#txt_BatchCode").val(),
  1891. ReleaseState: $("#selShow").val(),
  1892. selEnableShow: $("#selEnableShow").val(),
  1893. }
  1894. $gridList.dataGrid({
  1895. url: "/WMS/ICSRCVIQCs/GetICSInspection9" + "?" + Math.random(),
  1896. postData: { queryJson: JSON.stringify(queryJson) },
  1897. height: $(window).height() - 200,
  1898. width: $(window).width() - 300,
  1899. cellEdit: true,
  1900. colModel: _Clos,
  1901. cellsubmit: "clientArray",
  1902. shrinkToFit: false,//宽度自适应
  1903. autoWidth: true,
  1904. gridComplete: function () {
  1905. debugger;
  1906. //设置select
  1907. var RowDatas = $("#gridList").jqGrid('getDataIDs');
  1908. for (var j = 0; j < RowDatas.length; j++) {
  1909. var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode");
  1910. var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID");
  1911. var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue");
  1912. var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue");
  1913. GetSelectICSBadCode(InvCode, ID, BCCodeValue);
  1914. GetSelectPerson(InvCode, ID, BRCodeValue);
  1915. }
  1916. },
  1917. pager: "#gridPager",
  1918. sortorder: "desc",
  1919. sortname: 'DNCode ',
  1920. viewrecords: true,
  1921. multiselect: true,
  1922. subGrid: false, // (1)开启子表格支持
  1923. afterSaveCell: function (rowid, cellname, value) {
  1924. debugger;
  1925. //总扣分数加其他扣分数
  1926. if (cellname === 'YLOTQTY') {
  1927. var YLOTQTY = value;
  1928. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1929. var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10;
  1930. $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str);
  1931. }
  1932. if (cellname === 'NLOTQTY') {
  1933. var NLOTQTY = value;
  1934. var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber');
  1935. var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10;
  1936. $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str);
  1937. }
  1938. if (cellname === 'BadReasonDesc') {
  1939. $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value);
  1940. }
  1941. if (cellname === 'BadDesc') {
  1942. $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value);
  1943. }
  1944. },
  1945. });
  1946. $("#btn_search").click(function () {
  1947. var warehouse = $("#warehouse a.active").attr('data-value');
  1948. var queryJson = {
  1949. POCode: $("#txt_POCode").val(),
  1950. //ASNCode: $("#txt_ASNCode").val(),
  1951. //CaiGouCode: $("#txt_CaiGouCode").val(),
  1952. VenCode: $("#txt_VenCode").val(),
  1953. VenName: $("#txt_VenName").val(),
  1954. InvCode: $("#txt_InvCode").val(),
  1955. InvName: $("#txt_InvName").val(),
  1956. BatchCode: $("#txt_BatchCode").val(),
  1957. ReleaseState: $("#selShow").val(),
  1958. selEnableShow: $("#selEnableShow").val(),
  1959. }
  1960. $gridList.jqGrid('setGridParam', {
  1961. postData: { queryJson: JSON.stringify(queryJson) },
  1962. }).trigger('reloadGrid');
  1963. });
  1964. }
  1965. //不良组改变事件
  1966. function ChangeA(ID) {
  1967. debugger;
  1968. var str = "";
  1969. var BCCode = $("#SelBC_" + ID + "").val();
  1970. $.ajax({
  1971. url: "/WMS/ICSRCVIQCs/Select_ChangeA?BCCode=" + BCCode + "&" + Math.random(),
  1972. dataType: "json",
  1973. async: false,
  1974. async: false,
  1975. success: function (data) {
  1976. if (data != null && data.length > 0) {
  1977. $("#SelBR_" + ID + "").selectpicker('destroy');
  1978. $("#SelBR_" + ID + "").find("option").remove();
  1979. for (var i = 0; i < data.length; i++) {
  1980. $("#SelBR_" + ID + "").append("<option value='" + data[i].BadReasonCode + "'>" + data[i].BadReasonDesc + "</option>");
  1981. }
  1982. $("#SelBR_" + ID + "").selectpicker();
  1983. }
  1984. }
  1985. });
  1986. }
  1987. //不良原因改变事件
  1988. function ChangeB(ID) {
  1989. var str = "";
  1990. var BRCode = $("#SelBR_" + ID + "").val();
  1991. var aaa = '';
  1992. $.ajax({
  1993. url: "/WMS/ICSRCVIQCs/Select_ChangeB?BRCode=" + BRCode + "&" + Math.random(),
  1994. dataType: "json",
  1995. async: false,
  1996. async: false,
  1997. success: function (data) {
  1998. aaa = data[0].BRGCode;
  1999. }
  2000. });
  2001. $("#SelBC_" + ID + "").selectpicker('refresh');
  2002. $("#SelBC_" + ID + "").selectpicker('val', aaa);
  2003. }
  2004. //获取不良原因
  2005. function GetSelectPerson(InvCode, ID, BRCodeValue) {
  2006. var str = "";
  2007. var BCCode= $("#SelBC_" + ID + "").val();
  2008. $.ajax({
  2009. url: "/WMS/ICSRCVIQCs/Select_ICSBadReason?BCCode=" + BCCode + "&" + Math.random(),
  2010. dataType: "json",
  2011. async: false,
  2012. async: false,
  2013. success: function (data) {
  2014. if (data != null && data.length > 0) {
  2015. $("#SelBR_" + ID + "").find("option").remove();
  2016. for (var i = 0; i < data.length; i++) {
  2017. $("#SelBR_" + ID + "").append("<option value='" + data[i].BadReasonCode + "'>" + data[i].BadReasonDesc + "</option>");
  2018. }
  2019. }
  2020. }
  2021. });
  2022. $("#SelBR_" + ID + "").selectpicker('refresh');
  2023. $("#SelBR_" + ID + "").selectpicker('val', BRCodeValue);
  2024. }
  2025. function GetSelectICSBadCode(InvCode, ID, BCCodeValue) {
  2026. var str = "";
  2027. var BRCode = $("#SelBR_" + ID + "").val();
  2028. $.ajax({
  2029. url: "/WMS/ICSRCVIQCs/GetSelectICSBadCode?BRCode=" + BRCode + "&" + Math.random(),
  2030. dataType: "json",
  2031. async: false,
  2032. async: false,
  2033. success: function (data) {
  2034. if (data != null && data.length > 0) {
  2035. $("#SelBC_" + ID + "").find("option").remove();
  2036. for (var i = 0; i < data.length; i++) {
  2037. $("#SelBC_" + ID + "").append("<option value='" + data[i].BRGCode + "'>" + data[i].BRGDesc + "</option>");
  2038. }
  2039. }
  2040. }
  2041. });
  2042. $("#SelBC_" + ID + "").selectpicker('refresh');
  2043. $("#SelBC_" + ID + "").selectpicker('val', BCCodeValue);
  2044. }
  2045. function btnSave() {
  2046. debugger;
  2047. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  2048. if (ids.length == 0) {
  2049. $.modalAlertNew("WMS00004");
  2050. return;
  2051. }
  2052. var IDlist = "";
  2053. var ICSInspection = [];
  2054. var flag = '';
  2055. for (var i = 0; i < ids.length; i++) {
  2056. var rowData = $("#gridList").jqGrid('getRowData', ids[i]);
  2057. IDlist += "'" + rowData.ID + "',";
  2058. if (rowData.NLOTQTY > 0) {
  2059. if ($("#SelBC_" + rowData.ID + "").val() == '' || $("#SelBR_" + rowData.ID + "").val() == '') {
  2060. $.modalAlertNew("WMS00081");
  2061. return;
  2062. }
  2063. }
  2064. if (rowData.TestState=='已检验') {
  2065. $.modalAlert("该条码已检验,请勿重复检验!");
  2066. return;
  2067. }
  2068. if (rowData.YLOTQTY < 0 || rowData.NLOTQTY < 0) {
  2069. $.modalAlertNew("WMS00082");
  2070. return;
  2071. }
  2072. if (rowData.SpecialQTY > rowData.NLOTQTY) {
  2073. $.modalAlertNew("WMS00083");
  2074. return;
  2075. }
  2076. var obj = {
  2077. AllNumber: rowData.AllNumber,//总数量
  2078. YLOTQTY: rowData.YLOTQTY,//合格数量
  2079. NLOTQTY: rowData.NLOTQTY,//不合格数量
  2080. SpecialQTY: rowData.SpecialQTY,//特采数量
  2081. SampleQuantity: rowData.SampleQuantity,//特采数量
  2082. LotNo: rowData.LotNo,//条码
  2083. InvCode: rowData.InvCode,//物料编码
  2084. BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码
  2085. BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因
  2086. Type: Type,
  2087. TestState: rowData.TestState,
  2088. JYID: rowData.JYID
  2089. }
  2090. ICSInspection.push(obj);
  2091. }
  2092. $.modalConfirm("确定保存吗?", function (r) {
  2093. if (r) {
  2094. $.submitForm({
  2095. url: "/WMS/ICSRCVIQCs/CreateICSInspection" + "?" + Math.random(),
  2096. param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) },
  2097. success: function () {
  2098. $.currentWindow().$("#gridList").trigger("reloadGrid");
  2099. }
  2100. })
  2101. }
  2102. });
  2103. }
  2104. function btnLook(cellvalue, options, rowObject) {
  2105. return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"SeachClick('" + rowObject.InvCode + "','" + rowObject.JYID + "','" + rowObject.SampleQuantity + "','" + rowObject.Result + "')\">查看</ a><a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadFiles('" + rowObject.JYID + "','" + rowObject.DNCode + "')\">上传</ a><a class=\"btn btn-info dropdown-text\" onclick=\"LookFiles('" + rowObject.JYID + "','" + rowObject.DNCode + "')\">文件查看</ a>";
  2106. }
  2107. //查看
  2108. function SeachClick(InvCode, JYID, SampleQuantity, Result) {
  2109. debugger;
  2110. if (JYID == '') {
  2111. $.modalAlertNew("WMS00104");
  2112. return;
  2113. }
  2114. if (Result == "") {
  2115. $.modalOpen({
  2116. id: "CheckInfo",
  2117. title: "查看信息",
  2118. url: "/WMS/ICSRCVIQCs/ICSInspectionDetail?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&Result=" + encodeURI(encodeURI(Result)),
  2119. width: "1000px",
  2120. height: "400px",
  2121. callBack: function (iframeId) {
  2122. top.frames[iframeId].submitForm();
  2123. }
  2124. });
  2125. } else {
  2126. $.modalOpenClean({
  2127. id: "CheckInfo",
  2128. title: "查看信息",
  2129. url: "/WMS/ICSRCVIQCs/ICSInspectionDetail?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&Result=" + encodeURI(encodeURI(Result)),
  2130. width: "1000px",
  2131. height: "400px",
  2132. callBack: function (iframeId) {
  2133. top.frames[iframeId].submitForm();
  2134. }
  2135. });
  2136. }
  2137. }
  2138. function LookFiles(JYID) {
  2139. debugger;
  2140. $.modalOpenClean({
  2141. id: "CheckInfo",
  2142. title: "查看信息",
  2143. url: "/WMS/ICSRCVIQCs/ICSLookFiles?JYID=" + encodeURI(encodeURI(JYID)),
  2144. width: "1000px",
  2145. height: "400px",
  2146. callBack: function (iframeId) {
  2147. top.frames[iframeId].submitForm();
  2148. }
  2149. });
  2150. }
  2151. //触发上传文件控件
  2152. function UpLoadFiles(JYID, DNCode) {
  2153. $("#FileUpBYRZ").click();
  2154. $("#FileUpBYRZID").val(JYID);
  2155. $("#FileUpBYRZDNCode").val(DNCode);
  2156. }
  2157. //上传文件
  2158. function UpLoadFile(fileinfo) {
  2159. debugger;
  2160. var fileName = '';
  2161. var files = fileinfo.files;
  2162. var ID = $("#FileUpBYRZID").val();
  2163. var DNCode = $("#FileUpBYRZDNCode").val();
  2164. for (var i = 0; i < files.length; i++) {
  2165. fileName += "" + files[i].name + "";
  2166. if (fileName != null && fileName != "") {
  2167. var data = new FormData();
  2168. jQuery.each(jQuery('#FileUpBYRZ')[0].files, function (i, file) {
  2169. data.append('file-' + i, file);
  2170. });
  2171. $.ajax({
  2172. url: "/WMS/ICSRCVIQCs/UpLoadFileImport" + "?" + Math.random() + "&ID=" + ID + "&DNCode=" + DNCode,
  2173. type: "post",
  2174. data: data,
  2175. dataType: "json",
  2176. contentType: false,
  2177. processData: false,
  2178. success: function (data) {
  2179. if (data.state == "success") {
  2180. $.currentWindow().$("#gridListVENDORCERTIFICATE").trigger("reloadGrid");
  2181. $.modalMsg(data.message, data.state);
  2182. } else {
  2183. $.modalAlert(data.message, data.state);
  2184. }
  2185. }
  2186. });
  2187. }
  2188. debugger;
  2189. document.getElementById("FileUpBYRZ").value = "";
  2190. }
  2191. }
  2192. //退回
  2193. function btnSendBack() {
  2194. debugger;
  2195. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  2196. if (ids.length == 0) {
  2197. $.modalAlertNew("WMS00004");
  2198. return;
  2199. }
  2200. var IDlist = "";
  2201. var selShow = $("#selShow").val();
  2202. if (selShow != '1') {
  2203. $.modalAlertNew("WMS00084");
  2204. return;
  2205. }
  2206. for (var i = 0; i < ids.length; i++) {
  2207. var rowData = $("#gridList").jqGrid('getRowData', ids[i]);
  2208. if (rowData.AllNumber == rowData.YLOTQTY) {
  2209. $.modalAlertNew("WMS00085", rowData.LotNo);
  2210. return;
  2211. }
  2212. IDlist += "'" + rowData.LotNo + "',";
  2213. }
  2214. $.modalConfirm("确定退回吗?", function (r) {
  2215. if (r) {
  2216. $.submitForm({
  2217. url: "/WMS/ICSRCVIQCs/CreateRejection?Type=" + Type + "&" + Math.random(),
  2218. param: { keyValue: IDlist },
  2219. success: function () {
  2220. $.currentWindow().$("#gridList").trigger("reloadGrid");
  2221. }
  2222. })
  2223. }
  2224. });
  2225. }
  2226. </script>
  2227. <div class="topPanel" style="height:100px">
  2228. <div class="toolbar">
  2229. <div class="btn-group">
  2230. <a id="NF-Create" authorize="yes" class="btn btn-primary" onclick="btnSave()"><i class="fa fa-pencil-square-o"></i>保存检验结果</a>
  2231. <a id="NF-update" authorize="yes" class="btn btn-primary" onclick="btnSendBack()"><i class="fa fa-pencil-square-o"></i>生成拒收单</a>
  2232. @*<a id="NF-Delete" authorize="yes" class="btn btn-primary" onclick="btn_Delete()"><i class="fa fa-trash-o"></i>删除</a>*@
  2233. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  2234. <input id='FileUpBYRZ' type='file' style="display: none" onchange="UpLoadFile(this)" multiple="multiple" />
  2235. <input id="FileUpBYRZID" hidden="hidden">
  2236. <input id="FileUpBYRZDNCode" hidden="hidden">
  2237. </div>
  2238. </div>
  2239. <div class="search">
  2240. <table>
  2241. <tr>
  2242. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  2243. <td>
  2244. <div class="input-group">
  2245. <input id="txt_POCode" type="text" class="form-control" style="width: 105px;">
  2246. </div>
  2247. </td>
  2248. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_ASNCode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送货单号</label>:</td>
  2249. <td>
  2250. <div class="input-group HideTxt">
  2251. <input id="txt_ASNCode" type="text" class="form-control HideTxt" style="width: 105px;">
  2252. </div>
  2253. </td>
  2254. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_CaiGouCode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;采购订单号</label>:</td>
  2255. <td>
  2256. <div class="input-group">
  2257. <input id="txt_CaiGouCode" type="text" class="form-control HideTxt" style="width: 105px;">
  2258. </div>
  2259. </td>
  2260. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_VenCode ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  2261. <td>
  2262. <div class="input-group HideTxt">
  2263. <input id="txt_VenCode" type="text" class="form-control HideTxt" style="width: 105px;">
  2264. </div>
  2265. </td>
  2266. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  2267. <td>
  2268. <div class="input-group HideTxt">
  2269. <input id="txt_VenName" type="text" class="form-control HideTxt" style="width: 105px;">
  2270. </div>
  2271. </td>
  2272. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="TimeFrom ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;到货日期(从)</label>:</td>
  2273. <td>
  2274. <div class="input-group HideTxt">
  2275. <input id="TimeFrom" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" placeholder="日期(从)" />
  2276. </div>
  2277. </td>
  2278. <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="TimeArrive">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;到货日期(到)</label>:</td>
  2279. <td>
  2280. <div class="input-group HideTxt">
  2281. <input id="TimeArrive" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" placeholder="日期(到)" />
  2282. </div>
  2283. </td>
  2284. </tr>
  2285. <tr>
  2286. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  2287. <td>
  2288. <div class="input-group">
  2289. <input id="txt_InvCode" type="text" class="form-control" style="width: 105px;">
  2290. </div>
  2291. </td>
  2292. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;料品名称</label>:</td>
  2293. <td>
  2294. <div class="input-group">
  2295. <input id="txt_InvName" type="text" class="form-control" style="width: 105px;">
  2296. </div>
  2297. </td>
  2298. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  2299. <td>
  2300. <div class="input-group">
  2301. <input id="txt_BatchCode" type="text" class="form-control" style="width: 105px;">
  2302. </div>
  2303. </td>
  2304. <td>
  2305. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单据状态:</label>
  2306. </td>
  2307. <td>
  2308. <div class="input-group">
  2309. <select id="selShow" name="F_Target" class="form-control" style="width: 105px;">
  2310. <option value="2">显示全部</option>
  2311. <option value="1">已检验</option>
  2312. <option value="0" selected="selected">未检验</option>
  2313. </select>
  2314. </div>
  2315. </td>
  2316. <td>
  2317. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否合格:</label>
  2318. </td>
  2319. <td>
  2320. <div class="input-group">
  2321. <select id="selEnableShow" name="F_Enable" class="form-control" style="width: 105px;">
  2322. <option value="1" selected="selected">是</option>
  2323. <option value="0" >否</option>
  2324. </select>
  2325. </div>
  2326. </td>
  2327. <td>
  2328. <span class="input-group-btn">
  2329. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  2330. </span>
  2331. </td>
  2332. </tr>
  2333. </table>
  2334. </div>
  2335. </div>
  2336. <div class="gridPanel" id="gridPanel">
  2337. <table id="gridList"></table>
  2338. <div id="gridPager"></div>
  2339. </div>