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.

739 lines
35 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "原料来料检验";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  7. <!--引入 element-ui 的样式,-->
  8. <link rel="stylesheet" href="~/Content/element-ui/lib/theme-chalk/index.css">
  9. <script src="~/Content/vue/dist/vue.js"></script>
  10. <script src="~/Content/element-ui/lib/index.js"></script>
  11. <script src="~/Content/axios.min.js"></script>
  12. <style>
  13. </style>
  14. <form id="form1">
  15. <div id="app">
  16. <div class="topPanel" style="height:160px;">
  17. <div class="toolbar">
  18. <div class="btn-group">
  19. <input id="FileUp" name="FileUp" type="file" style="display:none;" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
  20. @*<a id="NF-Urgent" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Urgent()"><i class="fa fa-pencil-square-o"></i>加急</a>*@
  21. <a id="NF-SendCheck" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_SendCheck()"><i class="fa fa-pencil-square-o"></i>开始检验</a>
  22. <a id="NF-ExportAll" authorize="yes" class="btn btn-primary"><i class="fa fa-download"></i>导出</a>
  23. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  24. </div>
  25. <div class="btn-group" style="display:block;padding-left:2px;">
  26. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  27. <a id="NF-ViewCheckDetail" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ViewCheckDetail()"><i class="fa fa-pencil-square-o"></i>检验明细</a>
  28. <a id="NF-DoJudge" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_DoJudge()"><i class="fa fa-pencil-square-o"></i>直接判定</a>
  29. <a id="NF-RemoveCheckResult" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_RemoveCheck()"><i class="fa fa-pencil-square-o"></i>删除检验</a>
  30. </div>
  31. <script>$('.toolbar').authorizeButton()</script>
  32. </div>
  33. <div class="search">
  34. <table>
  35. <tr>
  36. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;物料编码</label>:</td>
  37. <td class="HideItems">
  38. <div class="input-group HideItems">
  39. <input id="txt_InvCode" type="text" class="form-control HideItems" style="width: 200px;">
  40. </div>
  41. </td>
  42. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料名称</label>:</td>
  43. <td class="HideItems">
  44. <div class="input-group HideItems">
  45. <input id="txt_InvName" type="text" class="form-control HideItems" style="width: 200px;">
  46. </div>
  47. </td>
  48. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_StartDate">&nbsp;&nbsp;&nbsp;&nbsp;开始时间</label>:</td>
  49. <td class="HideItems">
  50. <div class="input-group HideItems">
  51. <input id="txt_StartDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  52. </div>
  53. </td>
  54. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_EndDate">&nbsp;&nbsp;&nbsp;&nbsp;结束时间</label>:</td>
  55. <td class="HideItems">
  56. <div class="input-group HideItems">
  57. <input id="txt_EndDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  58. </div>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_ASNCode">&nbsp;&nbsp;&nbsp;&nbsp;送货单号</label>:</td>
  63. <td class="HideItems">
  64. <div class="input-group HideItems">
  65. <input id="txt_ASNCode" type="text" class="form-control HideItems" style="width: 200px;">
  66. </div>
  67. </td>
  68. @*<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商编码</label>:</td>
  69. <td class="HideItems">
  70. <div class="input-group HideItems">
  71. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 200px;">
  72. </div>
  73. </td>
  74. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  75. <td class="HideItems">
  76. <div class="input-group HideItems">
  77. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 200px;">
  78. </div>
  79. </td>*@
  80. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvBatcgNo">&nbsp;&nbsp;&nbsp;&nbsp;批次</label>:</td>
  81. <td class="HideItems">
  82. <div class="input-group HideItems">
  83. <input id="txt_InvBatcgNo" type="text" class="form-control HideItems" style="width: 200px;">
  84. </div>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_IsCheck">&nbsp;&nbsp;是否检验</label>:</td>
  89. <td class="HideItems">
  90. <div class="input-group HideItems">
  91. <select id="txt_IsCheck" class="form-control select2" style="width: 135px; height: 20px;">
  92. <option value="">全部</option>
  93. <option value="是">是</option>
  94. <option value="否" selected>否</option>
  95. </select>
  96. </div>
  97. </td>
  98. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_CheckStartDate">&nbsp;&nbsp;&nbsp;&nbsp;初检开始</label>:</td>
  99. <td class="HideItems">
  100. <div class="input-group HideItems">
  101. <input id="txt_CheckStartDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  102. </div>
  103. </td>
  104. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_CheckEndDate">&nbsp;&nbsp;&nbsp;&nbsp;初检结束</label>:</td>
  105. <td class="HideItems">
  106. <div class="input-group HideItems">
  107. <input id="txt_CheckEndDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  108. </div>
  109. </td>
  110. <td>
  111. <span class="input-group-btn">
  112. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  113. </span>
  114. </td>
  115. </tr>
  116. <tr>
  117. </tr>
  118. </table>
  119. </div>
  120. </div>
  121. <div class="gridPanel">
  122. <table id="gridList"></table>
  123. <div id="gridPager"></div>
  124. </div>
  125. </div>
  126. </form>
  127. <script type="text/javascript">
  128. $(function () {
  129. var service = {
  130. isCanEditDate: false,
  131. Init: function () {
  132. var that = this;
  133. $("#txt_CheckFixtureNo").val('');
  134. that.initControl();
  135. that.loadGrid();
  136. that.loadEvent();
  137. //that.loadViewGrid();
  138. },
  139. initControl: function () {
  140. let that = this;
  141. let orgName = '';
  142. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  143. },
  144. loadGrid: function () {
  145. var that = this;
  146. var queryJson = {
  147. InvCode: $("#txt_InvCode").val(),
  148. InvName: $("#txt_InvName").val(),
  149. StartDate: $("#txt_StartDate").val(),
  150. EndDate: $("#txt_EndDate").val(),
  151. CheckStartDate: $("#txt_CheckStartDate").val(),
  152. CheckEndDate: $("#txt_CheckEndDate").val(),
  153. CheckCode: $("#txt_ASNCode").val(),
  154. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  155. IsCheck: $("#txt_IsCheck").val(),
  156. }
  157. var $gridList = $("#gridList");
  158. $gridList.dataGrid({
  159. url: "/BBWMS/IQCQuality/GetCPMaterialInStorageCheckPageList" + "?" + Math.random(),
  160. postData: { queryJson: JSON.stringify(queryJson) },
  161. mtype: "POST",
  162. height: $(window).height() - 200,
  163. width: $(window).width() - 300,
  164. cellEdit: true,
  165. cellsubmit: "clientArray",
  166. colModel: [
  167. { label: "主键", name: "DetailId", hidden: true, key: true },
  168. { label: '单据类型', name: 'DocType', width: 100, hidden: true, align: 'left' },
  169. { label: '检验ID', name: 'CheckID', width: 100, hidden: true, align: 'left' },
  170. { label: '物料编码', name: 'InvCode', width: 100, align: 'left', frozen: true },
  171. { label: '物料名称', name: 'InvName', width: 150, align: 'left' },
  172. { label: '批次', name: 'InvBatcgNo', width: 100, align: 'left' },
  173. { label: '数量', name: 'Quantity', width: 100, align: 'left' },
  174. { label: '送检单号', name: 'CheckCode', width: 150, align: 'left' },
  175. { label: '初检时间', name: 'CheckDate', width: 120, align: 'left' },
  176. { label: '是否检验', name: 'IsCheck', width: 100, align: 'left' },
  177. { label: '初判结果', name: 'Result', width: 100, align: 'left' },
  178. { label: '文件路径', name: 'FilePath', width: 100, hidden: true, align: 'left' },
  179. {
  180. label: '出货报告', name: 'OutReport', width: 100, align: 'left',
  181. formatter: function (cellvalue, options, rowObject) {
  182. if (cellvalue) {
  183. // console.log(rowObject.FilePath);
  184. // let filaPath = rowObject.FilePath;
  185. // return "<button id='btn_viewOutReport' type='button' class='btn btn-primary' onclick=\"btn_viewOutReport()\">" + cellvalue + "</button>";
  186. return "<a class=\"btn btn-info dropdown-text\" onclick=\"btn_viewOutReport('" + rowObject.DetailId+"')\">" + cellvalue+"</ a>";
  187. }
  188. else {
  189. return "";
  190. }
  191. }
  192. },
  193. { label: 'IQC判入仓库', name: 'WHCode', width: 150, align: 'left' },
  194. ],
  195. shrinkToFit: true,//宽度自适应
  196. width: "100%",
  197. autowidth: true,
  198. gridComplete: function () {
  199. //if (!that.isCanEditDate) {
  200. // var obj_Item1 = $("#gridList");
  201. // var rowIds_Item1 = obj_Item1.getDataIDs();
  202. // for (var i = 0; i < rowIds_Item1.length; i++) {
  203. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanStartDate", '', 'not-editable-cell');
  204. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanEndDate", '', 'not-editable-cell');
  205. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "ApsOrderDate", '', 'not-editable-cell');
  206. // }
  207. //}
  208. },
  209. pager: "#gridPager",
  210. sortname: 'CheckCode',
  211. sortorder: "",
  212. viewrecords: true,
  213. multiselect: true,
  214. subGrid: true, // (1)开启子表格支持
  215. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  216. // console.log(subgrid_id, rowid);
  217. //
  218. $("#gridList").jqGrid("setSelection", rowid, false);
  219. that.bindSubGrid3(subgrid_id, rowid);
  220. }
  221. });
  222. },
  223. query: function () {
  224. //console.log("点击查询");
  225. var queryJson = {
  226. InvCode: $("#txt_InvCode").val(),
  227. InvName: $("#txt_InvName").val(),
  228. StartDate: $("#txt_StartDate").val(),
  229. EndDate: $("#txt_EndDate").val(),
  230. CheckStartDate: $("#txt_CheckStartDate").val(),
  231. CheckEndDate: $("#txt_CheckEndDate").val(),
  232. CheckCode: $("#txt_ASNCode").val(),
  233. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  234. IsCheck: $("#txt_IsCheck").val(),
  235. }
  236. // that.loadGrid(queryJson);
  237. $("#gridList").jqGrid('setGridParam', {
  238. postData: { queryJson: JSON.stringify(queryJson) },
  239. }).trigger('reloadGrid');
  240. },
  241. bindSubGrid3: function (subgrid_id, rowid) {
  242. //
  243. $("#gridList").jqGrid("setSelection", rowid, false);
  244. var subgrid_table_id;
  245. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  246. var subgrid_pager_id;
  247. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  248. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  249. var code = $("#gridList").jqGrid('getRowData', rowid).CheckCode;
  250. var invBatcgNo = $("#gridList").jqGrid('getRowData', rowid).InvBatcgNo;
  251. var InvCode = $("#gridList").jqGrid('getRowData', rowid).InvCode;
  252. // (6)创建jqGrid对象
  253. $("#" + subgrid_table_id).dataGrid({
  254. cellEdit: true,
  255. mtype: "GET",
  256. url: "/BBWMS/IQCQuality/GetCPMaterialInStorageCheckDetailList?code=" + code + "&invBatcgNo=" + invBatcgNo + "&invCode=" + InvCode+ "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  257. colModel: [
  258. { label: "主键", name: "ID", hidden: true, key: true },
  259. { label: '送检单号', name: 'CheckCode', width: 150, align: 'left' },
  260. { label: '物料编码', name: 'InvCode', width: 150, align: 'left' },
  261. { label: '物料名称', name: 'InvName', width: 150, align: 'left' },
  262. { label: '批次', name: 'InvBatcgNo', width: 150, align: 'left' },
  263. { label: '物料条码', name: 'LotNo', width: 150, align: 'left' },
  264. { label: '条码数量', name: 'Quantity', width: 100, align: 'left' },
  265. { label: '箱号条码', name: 'XiangCode', width: 100, align: 'left' },
  266. { label: '栈板条码', name: 'ZhanCode', width: 100, align: 'left' },
  267. ],
  268. //colModel: ColModelSub,
  269. shrinkToFit: true,//宽度自适应
  270. multiselect: true,
  271. prmNames: { search: "search" },
  272. viewrecords: true,
  273. height: "100%",
  274. //rowNum: 20,
  275. //pager: subgrid_pager_id,
  276. });
  277. },
  278. loadEvent: function () {
  279. var that = this;
  280. $("#btn_search").click(function () {
  281. that.query();
  282. });
  283. $("#NF-Add").click(function () {
  284. // debugger;
  285. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  286. $.modalOpen({
  287. id: "Form",
  288. title: "新增Aql",
  289. url: "/BBWMS/IQCQuality/AqlEdit?ids=",
  290. width: "1200px",
  291. height: "800px",
  292. callBack: function (iframeId) {
  293. top.frames[iframeId].submitForm();
  294. }
  295. });
  296. });
  297. $("#NF-Print").click(function () {
  298. console.log("打印条码");
  299. // debugger;
  300. var objArr = '';
  301. var arr = [];
  302. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  303. for (var i = 0; i < objList.length; i++) {
  304. var rowId = objList[i];
  305. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  306. objArr += "'" + rowData.CheckFixtureNo + "',";
  307. }
  308. objArr = objArr.slice(0, objArr.length - 1);
  309. if (objArr == "") {
  310. $.modalAlertNew("WMS00003");
  311. return;
  312. }
  313. objArr = "" + objArr + "|";
  314. arr.push(objArr);
  315. $.modalOpen({
  316. id: "PrintLot",
  317. title: "打印",
  318. url: "/BBWMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=JY0002&" + Math.random(),
  319. width: "550px",
  320. height: "1000px",
  321. callBack: function (iframeId) {
  322. top.frames[iframeId].submitForm();
  323. }
  324. });
  325. });
  326. $("#NF-SendCheck").click(function () {
  327. //window.open('C:\项目\智和诚\52ABP环境配置\5分钟快速启动框架.pdf')
  328. //return;
  329. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  330. if (ids.length != 1) {
  331. $.modalMsg("请选择一条数据", "warning");
  332. return;
  333. }
  334. let qty = 0;
  335. let asnCode = '';
  336. debugger;
  337. for (var i = 0; i < ids.length; i++) {
  338. var rowId = ids[i];
  339. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  340. // objArr += "'" + rowData.DNQuantity + "',";
  341. qty = rowData.Quantity;
  342. asnCode = rowData.CheckCode;
  343. //docType = rowData.DocType;
  344. let isCheck = rowData.IsCheck;
  345. if (isCheck == '是') {
  346. $.modalMsg("当前物料批号已经生成检验报告", "warning");
  347. return;
  348. }
  349. }
  350. let obj = {
  351. ids: ids[0],
  352. };
  353. //debugger;
  354. //if (!obj.orderDate) {
  355. // obj.orderDate = new Date().toLocaleDateString();
  356. //}
  357. // consol.log();
  358. $.modalOpen({
  359. id: "Form",
  360. title: "来料检验",
  361. url: "/BBWMS/IQCQuality/CPMaterialInStorageCheckEdit?ids=" + ids[0] + "&qty=" + qty + "&asnCode=" + asnCode,
  362. width: "1920px",
  363. height: "1000px",
  364. callBack: function (iframeId) {
  365. top.frames[iframeId].submitForm();
  366. }
  367. });
  368. });
  369. $("#NF-Urgent").click(function () {
  370. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  371. if (ids.length < 1) {
  372. $.modalMsg("请选择一条数据", "warning");
  373. return;
  374. }
  375. let input = [];
  376. for (var i = 0; i < ids.length; i++) {
  377. var rowId = ids[i];
  378. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  379. /* objArr += "'" + rowData.CheckFixtureNo + "',";*/
  380. let obj = {
  381. InvCode: rowData.InvCode,
  382. InvBatcgNo: rowData.InvBatcgNo,
  383. AsnCode: rowData.ASNCode,
  384. };
  385. input.push(obj);
  386. }
  387. //var rowId = ids[0];
  388. //var rowData = $("#gridList").jqGrid('getRowData', rowId);
  389. debugger;
  390. $.ajax({
  391. url: "/BBWMS/IQCQuality/UpdateUrgent",
  392. type: "POST",
  393. dataType: "json",
  394. async: false,
  395. data: {
  396. keyValue: JSON.stringify(input)
  397. },
  398. success: function (data) {
  399. //
  400. // console.log(data);
  401. if (data.state == "success") {
  402. $.modalMsg("操作成功", "success");
  403. that.query();
  404. }
  405. else
  406. $.modalMsg(data.message, "warning");
  407. }
  408. });
  409. });
  410. $("#NF-DoJudge").click(function () {
  411. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  412. if (ids.length != 1) {
  413. $.modalMsg("请选择一条数据", "warning");
  414. return;
  415. }
  416. let obj = {
  417. ids: ids[0],
  418. };
  419. for (var i = 0; i < ids.length; i++) {
  420. var rowId = ids[i];
  421. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  422. //objArr += "'" + rowData.CheckFixtureNo + "',";
  423. qty = rowData.DNQuantity;
  424. docType = rowData.DocType;
  425. let isCheck = rowData.IsCheck;
  426. if (isCheck == '是') {
  427. $.modalMsg("当前物料批号已经生成检验报告", "warning");
  428. return;
  429. }
  430. }
  431. $.modalOpen({
  432. id: "Form",
  433. title: "直接判定",
  434. url: "/BBWMS/IQCQuality/MaterialCheckDoJudge?ids=" + ids[0] + "&qty=" + qty + "&docType=" + docType,
  435. width: "600px",
  436. height: "300px",
  437. callBack: function (iframeId) {
  438. top.frames[iframeId].submitForm();
  439. }
  440. });
  441. });
  442. $("#NF-RemoveCheckResult").click(function () {
  443. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  444. if (ids.length != 1) {
  445. $.modalMsg("请选择一条数据", "warning");
  446. return;
  447. }
  448. let obj = {
  449. InvCode: '',
  450. AsnCode: '',
  451. InvBatcgNo: '',
  452. };
  453. for (var i = 0; i < ids.length; i++) {
  454. var rowId = ids[i];
  455. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  456. obj.InvCode = rowData.InvCode;
  457. obj.AsnCode = rowData.ASNCode;
  458. obj.InvBatcgNo = rowData.InvBatcgNo;
  459. }
  460. $.ajax({
  461. url: "/BBWMS/IQCQuality/DeleteMatCheck",
  462. type: "POST",
  463. dataType: "json",
  464. async: false,
  465. data: {
  466. keyValue: JSON.stringify(obj)
  467. },
  468. success: function (data) {
  469. //
  470. // console.log(data);
  471. if (data.state == "success") {
  472. $.modalMsg("操作成功", "success");
  473. that.query();
  474. }
  475. else
  476. $.modalMsg(data.message, "warning");
  477. }
  478. });
  479. });
  480. $("#NF-Remove").click(function () {
  481. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  482. if (ids.length < 1) {
  483. $.modalMsg("请选择数据", "warning");
  484. return;
  485. }
  486. let keyList = [];
  487. for (var i = 0; i < ids.length; i++) {
  488. keyList.push(ids[i]);
  489. }
  490. //let obj = {
  491. // ids: ids[0],
  492. //};
  493. $.ajax({
  494. url: "/BBWMS/IQCQuality/DeleteAql",
  495. type: "POST",
  496. dataType: "json",
  497. async: false,
  498. data: {
  499. keyValue: JSON.stringify(keyList)
  500. },
  501. success: function (data) {
  502. //
  503. // console.log(data);
  504. if (data.state == "success") {
  505. $.modalMsg("操作成功", "success");
  506. that.query();
  507. }
  508. else
  509. $.modalMsg(data.message, "warning");
  510. }
  511. });
  512. });
  513. $("#NF-ExportAll").click(function () {
  514. let queryJson = {
  515. InvCode: $("#txt_InvCode").val(),
  516. InvName: $("#txt_InvName").val(),
  517. StartDate: $("#txt_StartDate").val(),
  518. EndDate: $("#txt_EndDate").val(),
  519. CheckStartDate: $("#txt_CheckStartDate").val(),
  520. CheckEndDate: $("#txt_CheckEndDate").val(),
  521. CheckCode: $("#txt_ASNCode").val(),
  522. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  523. IsCheck: $("#txt_IsCheck").val(),
  524. };
  525. var postData = "&InvCode=" + queryJson.InvCode + "";
  526. postData += "&InvName=" + queryJson.InvName;
  527. postData += "&StartDate=" + queryJson.StartDate;
  528. postData += "&EndDate=" + queryJson.EndDate;
  529. postData += "&CheckStartDate=" + queryJson.CheckStartDate;
  530. postData += "&CheckEndDate=" + queryJson.CheckEndDate;
  531. postData += "&VenCode=" + queryJson.VenCode;
  532. postData += "&VenName=" + queryJson.VenName;
  533. postData += "&InvBatcgNo=" + queryJson.InvBatcgNo;
  534. postData += "&IsCheck=" + queryJson.IsCheck;
  535. postData += "&CheckCode=" + queryJson.CheckCode;
  536. postData += "&InvBatcgNo=" + queryJson.InvBatcgNo;
  537. $.download("/BBWMS/IQCQuality/ExportAllCPMaterialInStorageCheck" + "?" + Math.random(), postData, 'post');
  538. });
  539. $("#FileUp").on("change", function (up) {
  540. // let that = this;
  541. var form = new FormData(document.getElementById("form1"));
  542. $.ajax({
  543. url: "/BBWMS/CheckingFixture/UploadFile?" + Math.random(),
  544. type: "post",
  545. data: form,
  546. contentType: false,
  547. processData: false,
  548. success: function (data) {
  549. if (data == "true" || data == true) {
  550. alert("导入成功");
  551. that.query();
  552. }
  553. else {
  554. alert(data);
  555. }
  556. },
  557. error: function (aa) {
  558. alert("导入失败:" + aa);
  559. }
  560. });
  561. });
  562. $("#btn_viewOutReport").click(function () {
  563. debugger;
  564. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  565. if (ids.length != 1) {
  566. $.modalMsg("请选择一条数据", "warning");
  567. return;
  568. }
  569. let obj = {
  570. ids: ids[0],
  571. };
  572. let fileName = '';
  573. for (var i = 0; i < ids.length; i++) {
  574. var rowId = ids[i];
  575. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  576. fileName = rowData.OutReport;
  577. //objArr += "'" + rowData.CheckFixtureNo + "',";
  578. //if (rowData.IQCHeaderResult) {
  579. // $.modalMsg("已经判定,不能重复操作", "warning");
  580. // return;
  581. //}
  582. //if (rowData.SQEEngineerResult != "OK") {
  583. // $.modalMsg("只有SQE判定合格的数据可以判定", "warning");
  584. // return;
  585. //}
  586. }
  587. debugger;
  588. axios
  589. .get('/BBWMS/IQCQuality/GetOutReportFilePath?fileName=' + fileName)
  590. .then(function (res) {
  591. if (res.data) {
  592. console.log(res.data.message);
  593. window.open(res.data.message);
  594. }
  595. })
  596. .catch(function (error) { // 请求失败处理
  597. alert(error);
  598. });
  599. });
  600. $("#NF-ViewCheckDetail").click(function () {
  601. debugger;
  602. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  603. if (ids.length != 1) {
  604. $.modalMsg("请选择一条数据", "warning");
  605. return;
  606. }
  607. //let obj = {
  608. // ids: ids[0],
  609. //};
  610. let checkId = '';
  611. for (var i = 0; i < ids.length; i++) {
  612. var rowId = ids[i];
  613. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  614. checkId = rowData.CheckID;
  615. //objArr += "'" + rowData.CheckFixtureNo + "',";
  616. //if (rowData.IQCHeaderResult) {
  617. // $.modalMsg("已经判定,不能重复操作", "warning");
  618. // return;
  619. //}
  620. //if (rowData.SQEEngineerResult != "OK") {
  621. // $.modalMsg("只有SQE判定合格的数据可以判定", "warning");
  622. // return;
  623. //}
  624. }
  625. $.modalOpen({
  626. id: "Form",
  627. title: "检验明细查看",
  628. url: "/BBWMS/IQCQuality/MaterialReJudgeView?ids=" + checkId + "&judgeRole=IQCGroupHeader",
  629. width: "1900px",
  630. height: "1000px",
  631. callBack: function (iframeId) {
  632. // top.frames[iframeId].submitForm();
  633. }
  634. });
  635. });
  636. }
  637. }
  638. service.Init();
  639. })
  640. function btn_viewOutReport(rowId) {
  641. debugger;
  642. let fileName = '';
  643. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  644. fileName = rowData.FilePath;
  645. if (!fileName) {
  646. return;
  647. }
  648. // debugger;
  649. axios
  650. .get('/BBWMS/IQCQuality/GetOutReportFilePath?fileName=' + fileName)
  651. .then(function (res) {
  652. if (res.data) {
  653. console.log(res.data.message);
  654. window.open(res.data.message);
  655. }
  656. })
  657. .catch(function (error) { // 请求失败处理
  658. alert(error);
  659. });
  660. }
  661. </script>