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.

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