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.

979 lines
46 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-IQC1" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_IQC1()"><i class="fa fa-pencil-square-o"></i>IQC组长判定</a>*@
  21. @*<a id="NF-SQE" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_SQE()"><i class="fa fa-pencil-square-o"></i>SQE工程师</a>*@
  22. @*<a id="NF-IQC2" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_IQC2()"><i class="fa fa-pencil-square-o"></i>IQC主管判定</a>*@
  23. <a id="NF-FinalJudge" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_FinalJudge()"><i class="fa fa-pencil-square-o"></i>最终判定</a>
  24. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  25. </div>
  26. <div class="btn-group" style="display:block;padding-left:2px;">
  27. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  28. <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>
  29. <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>
  30. <a id="NF-WareOKReturnItem" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_WareOKReturnItem()"><i class="fa fa-pencil-square-o"></i>仓库已退实物</a>
  31. <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>
  32. <a id="NF-ExportAll" authorize="no" class="btn btn-primary"><i class="fa fa-download"></i>导出</a>
  33. </div>
  34. <div class="btn-group">
  35. @*<a id="NF-IQC1Back" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_IQC1Back()"><i class="fa fa-pencil-square-o"></i>IQC组长撤销</a>*@
  36. <a id="NF-SQEBack" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_SQEBack()"><i class="fa fa-pencil-square-o"></i>SQE工程师撤销</a>
  37. @*<a id="NF-IQC2Back" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_IQC2Back()"><i class="fa fa-pencil-square-o"></i>IQC主管撤销</a>*@
  38. <a id="NF-FinalJudgeBack" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_FinalJudgeBack()"><i class="fa fa-pencil-square-o"></i>最终撤销</a>
  39. </div>
  40. <script>$('.toolbar').authorizeButton()</script>
  41. </div>
  42. <div class="search">
  43. <table>
  44. <tr>
  45. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;物料编码</label>:</td>
  46. <td class="HideItems">
  47. <div class="input-group HideItems">
  48. <input id="txt_InvCode" type="text" class="form-control HideItems" style="width: 200px;">
  49. </div>
  50. </td>
  51. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料名称</label>:</td>
  52. <td class="HideItems">
  53. <div class="input-group HideItems">
  54. <input id="txt_InvName" type="text" class="form-control HideItems" style="width: 200px;">
  55. </div>
  56. </td>
  57. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_StartDate">&nbsp;&nbsp;&nbsp;&nbsp;开始时间</label>:</td>
  58. <td class="HideItems">
  59. <div class="input-group HideItems">
  60. <input id="txt_StartDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  61. </div>
  62. </td>
  63. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_EndDate">&nbsp;&nbsp;&nbsp;&nbsp;结束时间</label>:</td>
  64. <td class="HideItems">
  65. <div class="input-group HideItems">
  66. <input id="txt_EndDate" type="text" class="form-control HideItems" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  67. </div>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_ASNCode">&nbsp;&nbsp;&nbsp;&nbsp;送检单号</label>:</td>
  72. <td class="HideItems">
  73. <div class="input-group HideItems">
  74. <input id="txt_ASNCode" type="text" class="form-control HideItems" style="width: 200px;">
  75. </div>
  76. </td>
  77. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvBatcgNo">&nbsp;&nbsp;&nbsp;&nbsp;批次</label>:</td>
  78. <td class="HideItems">
  79. <div class="input-group HideItems">
  80. <input id="txt_InvBatcgNo" type="text" class="form-control HideItems" style="width: 200px;">
  81. </div>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_IsCheckComplete">&nbsp;&nbsp;是否完结</label>:</td>
  86. <td class="HideItems">
  87. <div class="input-group HideItems">
  88. <select id="txt_IsCheckComplete" class="form-control select2" style="width: 135px; height: 20px;">
  89. <option value="">全部</option>
  90. <option value="是">是</option>
  91. <option value="否" selected>否</option>
  92. </select>
  93. </div>
  94. </td>
  95. @*<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_JuegeProgess">&nbsp;&nbsp;判定进程</label>:</td>
  96. <td class="HideItems">
  97. <div class="input-group HideItems">
  98. <select id="txt_JuegeProgess" class="form-control select2" style="width: 135px; height: 20px;">
  99. <option value="" selected>全部</option>
  100. <option value="1">IQC组长未判</option>
  101. <option value="2">IQC组长已判</option>
  102. <option value="3">SQE工程师未判</option>
  103. <option value="4">SQE工程师已判</option>
  104. <option value="5">IQC主管未判</option>
  105. <option value="6">IQC主管已判</option>
  106. <option value="7">最终判定未判</option>
  107. </select>
  108. </div>
  109. </td>*@
  110. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_BcgCode">&nbsp;&nbsp;&nbsp;&nbsp;不良分类</label>:</td>
  111. <td class="HideItems">
  112. <div class="input-group HideItems">
  113. <input id="txt_BcgCode" type="text" class="form-control HideItems" style="width: 200px;">
  114. </div>
  115. </td>
  116. <td>
  117. <span class="input-group-btn">
  118. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  119. </span>
  120. </td>
  121. </tr>
  122. </table>
  123. </div>
  124. </div>
  125. <div class="gridPanel">
  126. <table id="gridList"></table>
  127. <div id="gridPager"></div>
  128. </div>
  129. </div>
  130. </form>
  131. <script type="text/javascript">
  132. $(function () {
  133. var service = {
  134. isCanEditDate: false,
  135. Init: function () {
  136. var that = this;
  137. //$("#txt_CheckFixtureNo").val('');
  138. that.initControl();
  139. that.loadGrid();
  140. that.loadEvent();
  141. //that.loadViewGrid();
  142. },
  143. initControl: function () {
  144. let that = this;
  145. let orgName = '';
  146. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  147. },
  148. loadGrid: function () {
  149. var that = this;
  150. var queryJson = {
  151. InvCode: $("#txt_InvCode").val(),
  152. InvName: $("#txt_InvName").val(),
  153. StartDate: $("#txt_StartDate").val(),
  154. EndDate: $("#txt_EndDate").val(),
  155. ASNCode: $("#txt_ASNCode").val(),
  156. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  157. IsCheckComplete: $("#txt_IsCheckComplete").val(),
  158. JuegeProgess: $("#txt_JuegeProgess").val(),
  159. BcgCode: $("#txt_BcgCode").val(),
  160. }
  161. var $gridList = $("#gridList");
  162. $gridList.dataGrid({
  163. url: "/BBWMS/IQCQuality/GetCPMaterialInStorageFinalPageList" + "?" + Math.random(),
  164. postData: { queryJson: JSON.stringify(queryJson) },
  165. mtype: "POST",
  166. height: $(window).height() - 200,
  167. width: $(window).width()-50,
  168. cellEdit: true,
  169. cellsubmit: "clientArray",
  170. colModel: [
  171. { label: "主键", name: "ID", hidden: true, key: true },
  172. { label: '检验单号', name: 'CheckNo', width: 120, align: 'left', frozen: true },
  173. { label: '送检单号', name: 'CheckCode', width: 150, align: 'left' },
  174. { label: '送检时间', name: 'DHDate', width: 120, align: 'left' },
  175. { label: '物料编码', name: 'InvCode', width: 100, align: 'left' },
  176. { label: '物料名称', name: 'InvName', width: 100, align: 'left' },
  177. { label: '批次', name: 'InvBatcgNo', width: 100, align: 'left' },
  178. { label: '批次数量', name: 'InvBatcgQty', width: 80, align: 'left' },
  179. //{ label: '供应商编码', name: 'VenCode', width: 100, hidden: true, align: 'left' },
  180. //{ label: '供应商名称', name: 'VenName', width: 150, align: 'left' },
  181. { label: '初检时间', name: 'FirstCheckTime', width: 120, align: 'left' },
  182. { label: '初检人员', name: 'FirstCheckUser', width: 80, align: 'left' },
  183. {
  184. label: '不良文件', name: 'WgNgFile', width: 120, align: 'left',
  185. formatter: function (cellvalue, options, rowObject) {
  186. if (cellvalue) {
  187. return "<a class=\"btn btn-info dropdown-text\" onclick=\"btn_viewExReport('" + cellvalue + "')\">" + cellvalue + "</ a>";
  188. }
  189. else {
  190. return "";
  191. }
  192. }
  193. },
  194. //{
  195. // label: 'SQE复判文件', name: 'SQEFile', width: 120, align: 'left',
  196. // formatter: function (cellvalue, options, rowObject) {
  197. // if (cellvalue) {
  198. // return "<a class=\"btn btn-info dropdown-text\" onclick=\"btn_viewExReport('" + cellvalue+ "')\">" + cellvalue + "</ a>";
  199. // }
  200. // else {
  201. // return "";
  202. // }
  203. // }
  204. //},
  205. //{ label: '异常文件路径', name: 'WgNgFilePath', width: 100, hidden: true, align: 'left' },
  206. //{ label: '加急', name: 'Urgent', width: 100, align: 'left' },
  207. { label: '文件路径', name: 'FilePath', width: 100, hidden: true, align: 'left' },
  208. {
  209. label: '出货报告', name: 'OutReport', width: 100, align: 'left',
  210. formatter: function (cellvalue, options, rowObject) {
  211. if (cellvalue) {
  212. return "<a class=\"btn btn-info dropdown-text\" onclick=\"btn_viewOutReport('" + rowObject.ID + "')\">" + cellvalue + "</ a>";
  213. }
  214. else {
  215. return "";
  216. }
  217. }
  218. },
  219. //{ label: 'IQC组长判定', name: 'IQCGroupHeaderResult', width: 100, align: 'left' },
  220. //{ label: 'IQC组长判定人员', name: 'IQCGroupHeaderUser', width: 100, align: 'left' },
  221. //{ label: 'IQC组长判定时间', name: 'IQCGroupHeaderTime', width: 120, align: 'left' },
  222. { label: '不良分类', name: 'BcgDesc', width: 100, align: 'left' },
  223. //{ label: 'SQE工程师判定', name: 'SQEEngineerResult', width: 100, align: 'left' },
  224. //{ label: 'SQE工程师判定人员', name: 'SQEEngineerUser', width: 100, align: 'left' },
  225. //{ label: 'SQE工程师判定时间', name: 'SQEEngineerTime', width: 120, align: 'left' },
  226. //{ label: 'SQE处理方案', name: 'EATTRIBUTE1', width: 100, align: 'left' },
  227. //{ label: 'IQC主管判定', name: 'IQCHeaderResult', width: 100, align: 'left' },
  228. //{ label: 'IQC主管判定人员', name: 'IQCHeaderUser', width: 100, align: 'left' },
  229. //{ label: 'IQC主管判定时间', name: 'IQCHeaderTime', width: 120, align: 'left' },
  230. { label: '最终判定', name: 'FinalResult', width: 100, align: 'left' },
  231. { label: '最终判定人员', name: 'FinalUser', width: 100, align: 'left' },
  232. { label: '最终判定时间', name: 'FinalTime', width: 120, align: 'left' },
  233. { label: '合格数量', name: 'GoodQty', width: 80, align: 'left' },
  234. { label: '不良数量', name: 'NgQty', width: 80, align: 'left' },
  235. { label: '仓库已退实物', name: 'HasReturnItem', width: 100, align: 'left' },
  236. { label: '退货时间', name: 'HasReturnTime', width: 150, align: 'left' },
  237. { label: '仓库备注', name: 'WHRemark', width: 150, align: 'left' },
  238. ],
  239. autoScroll: false,
  240. shrinkToFit: false,//宽度自适应
  241. // width: "100%",
  242. //autowidth: true,
  243. gridComplete: function () {
  244. //if (!that.isCanEditDate) {
  245. // var obj_Item1 = $("#gridList");
  246. // var rowIds_Item1 = obj_Item1.getDataIDs();
  247. // for (var i = 0; i < rowIds_Item1.length; i++) {
  248. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanStartDate", '', 'not-editable-cell');
  249. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanEndDate", '', 'not-editable-cell');
  250. // $("#gridList").jqGrid('setCell', rowIds_Item1[i], "ApsOrderDate", '', 'not-editable-cell');
  251. // }
  252. //}
  253. },
  254. pager: "#gridPager",
  255. sortname: 'CheckNo desc',
  256. sortorder: "",
  257. viewrecords: true,
  258. multiselect: true,
  259. subGrid: false, // (1)开启子表格支持
  260. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  261. // console.log(subgrid_id, rowid);
  262. //
  263. //$("#gridList").jqGrid("setSelection", rowid, false);
  264. //that.bindSubGrid3(subgrid_id, rowid);
  265. }
  266. });
  267. $("#gridList").jqGrid('setFrozenColumns');
  268. },
  269. query: function () {
  270. //console.log("点击查询");
  271. var queryJson = {
  272. InvCode: $("#txt_InvCode").val(),
  273. InvName: $("#txt_InvName").val(),
  274. StartDate: $("#txt_StartDate").val(),
  275. EndDate: $("#txt_EndDate").val(),
  276. ASNCode: $("#txt_ASNCode").val(),
  277. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  278. IsCheckComplete: $("#txt_IsCheckComplete").val(),
  279. JuegeProgess: $("#txt_JuegeProgess").val(),
  280. BcgCode: $("#txt_BcgCode").val(),
  281. }
  282. // that.loadGrid(queryJson);
  283. $("#gridList").jqGrid('setGridParam', {
  284. postData: { queryJson: JSON.stringify(queryJson) },
  285. }).trigger('reloadGrid');
  286. },
  287. loadEvent: function () {
  288. var that = this;
  289. $("#btn_search").click(function () {
  290. that.query();
  291. });
  292. $("#NF-Add").click(function () {
  293. // debugger;
  294. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  295. $.modalOpen({
  296. id: "Form",
  297. title: "新增Aql",
  298. url: "/BBWMS/IQCQuality/AqlEdit?ids=",
  299. width: "1200px",
  300. height: "800px",
  301. callBack: function (iframeId) {
  302. top.frames[iframeId].submitForm();
  303. }
  304. });
  305. });
  306. $("#NF-Print").click(function () {
  307. console.log("打印条码");
  308. // debugger;
  309. var objArr = '';
  310. var arr = [];
  311. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  312. for (var i = 0; i < objList.length; i++) {
  313. var rowId = objList[i];
  314. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  315. objArr += "'" + rowData.CheckFixtureNo + "',";
  316. }
  317. objArr = objArr.slice(0, objArr.length - 1);
  318. if (objArr == "") {
  319. $.modalAlertNew("WMS00003");
  320. return;
  321. }
  322. objArr = "" + objArr + "|";
  323. arr.push(objArr);
  324. $.modalOpen({
  325. id: "PrintLot",
  326. title: "打印",
  327. url: "/BBWMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=JY0001&" + Math.random(),
  328. width: "550px",
  329. height: "1000px",
  330. callBack: function (iframeId) {
  331. top.frames[iframeId].submitForm();
  332. }
  333. });
  334. });
  335. //$("#NF-IQC1").click(function () {
  336. // debugger;
  337. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  338. // if (ids.length != 1) {
  339. // $.modalMsg("请选择一条数据", "warning");
  340. // return;
  341. // }
  342. // let obj = {
  343. // ids: ids[0],
  344. // };
  345. // for (var i = 0; i < ids.length; i++) {
  346. // var rowId = ids[i];
  347. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  348. // //objArr += "'" + rowData.CheckFixtureNo + "',";
  349. // if (rowData.IQCGroupHeaderResult) {
  350. // $.modalMsg("已经判定,不能重复操作", "warning");
  351. // return;
  352. // }
  353. // if (rowData.SQEEngineerResult || rowData.IQCHeaderResult || rowData.FinalResult) {
  354. // $.modalMsg("已经进行后续判定,不能重复操作", "warning");
  355. // return;
  356. // }
  357. // }
  358. // //debugger;
  359. // //if (!obj.orderDate) {
  360. // // obj.orderDate = new Date().toLocaleDateString();
  361. // //}
  362. // // consol.log();
  363. // $.modalOpen({
  364. // id: "Form",
  365. // title: "IQC组长判定",
  366. // url: "/BBWMS/IQCQuality/MaterialReJudgeEdit?ids=" + ids[0] +"&judgeRole=IQCGroupHeader",
  367. // width: "1900px",
  368. // height: "1000px",
  369. // callBack: function (iframeId) {
  370. // top.frames[iframeId].submitForm();
  371. // }
  372. // });
  373. //});
  374. //$("#NF-IQC2").click(function () {
  375. // debugger;
  376. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  377. // if (ids.length != 1) {
  378. // $.modalMsg("请选择一条数据", "warning");
  379. // return;
  380. // }
  381. // let obj = {
  382. // ids: ids[0],
  383. // };
  384. // for (var i = 0; i < ids.length; i++) {
  385. // var rowId = ids[i];
  386. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  387. // //objArr += "'" + rowData.CheckFixtureNo + "',";
  388. // if (rowData.IQCHeaderResult) {
  389. // $.modalMsg("已经判定,不能重复操作", "warning");
  390. // return;
  391. // }
  392. // if (rowData.SQEEngineerResult != "OK") {
  393. // $.modalMsg("只有SQE判定合格的数据可以判定", "warning");
  394. // return;
  395. // }
  396. // }
  397. // //debugger;
  398. // //if (!obj.orderDate) {
  399. // // obj.orderDate = new Date().toLocaleDateString();
  400. // //}
  401. // // consol.log();
  402. // $.modalOpen({
  403. // id: "Form",
  404. // title: "IQC主管判定",
  405. // url: "/BBWMS/IQCQuality/MaterialReJudgeEdit?ids=" + ids[0] + "&judgeRole=IQCHeader",
  406. // width: "1900px",
  407. // height: "1000px",
  408. // callBack: function (iframeId) {
  409. // top.frames[iframeId].submitForm();
  410. // }
  411. // });
  412. //});
  413. //$("#NF-SQE").click(function () {
  414. // debugger;
  415. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  416. // if (ids.length != 1) {
  417. // $.modalMsg("请选择一条数据", "warning");
  418. // return;
  419. // }
  420. // let obj = {
  421. // ids: ids[0],
  422. // };
  423. // for (var i = 0; i < ids.length; i++) {
  424. // var rowId = ids[i];
  425. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  426. // //objArr += "'" + rowData.CheckFixtureNo + "',";
  427. // if (rowData.SQEEngineerResult) {
  428. // $.modalMsg("已经判定,不能重复操作", "warning");
  429. // return;
  430. // }
  431. // //if (rowData.IQCGroupHeaderResult!="NG") {
  432. // // $.modalMsg("只有IQC组长判定不合格的数据可以判定", "warning");
  433. // // return;
  434. // //}
  435. // }
  436. // //debugger;
  437. // //if (!obj.orderDate) {
  438. // // obj.orderDate = new Date().toLocaleDateString();
  439. // //}
  440. // // consol.log();
  441. // $.modalOpen({
  442. // id: "Form",
  443. // title: "SQE工程师判定",
  444. // url: "/BBWMS/IQCQuality/MaterialReJudgeEdit?ids=" + ids[0] + "&judgeRole=SQEEngineer",
  445. // width: "1900px",
  446. // height: "1000px",
  447. // callBack: function (iframeId) {
  448. // top.frames[iframeId].submitForm();
  449. // }
  450. // });
  451. //});
  452. $("#NF-FinalJudge").click(function () {
  453. debugger;
  454. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  455. if (ids.length != 1) {
  456. $.modalMsg("请选择一条数据", "warning");
  457. return;
  458. }
  459. let obj = {
  460. ids: ids[0],
  461. };
  462. for (var i = 0; i < ids.length; i++) {
  463. var rowId = ids[i];
  464. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  465. //objArr += "'" + rowData.CheckFixtureNo + "',";
  466. if (rowData.FinalResult) {
  467. $.modalMsg("已经判定,不能重复操作", "warning");
  468. return;
  469. }
  470. //if (rowData.SQEEngineerResult == "NG" ) {
  471. //}
  472. //else {
  473. // $.modalMsg("只有SQE工程师判定不合格的数据可以最终判定", "warning");
  474. // return;
  475. //}
  476. }
  477. //debugger;
  478. //if (!obj.orderDate) {
  479. // obj.orderDate = new Date().toLocaleDateString();
  480. //}
  481. // consol.log();
  482. $.modalOpen({
  483. id: "Form",
  484. title: "最终判定",
  485. url: "/BBWMS/IQCQuality/CPMaterialFinalJudgeEdit?ids=" + ids[0] + "",
  486. width: "1900px",
  487. height: "1000px",
  488. callBack: function (iframeId) {
  489. top.frames[iframeId].submitForm();
  490. }
  491. });
  492. });
  493. $("#NF-ViewCheckDetail").click(function () {
  494. debugger;
  495. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  496. if (ids.length != 1) {
  497. $.modalMsg("请选择一条数据", "warning");
  498. return;
  499. }
  500. let obj = {
  501. ids: ids[0],
  502. };
  503. $.modalOpen({
  504. id: "Form",
  505. title: "检验明细查看",
  506. url: "/BBWMS/IQCQuality/MaterialReJudgeView?ids=" + ids[0] + "&judgeRole=IQCGroupHeader",
  507. width: "1900px",
  508. height: "1000px",
  509. callBack: function (iframeId) {
  510. // top.frames[iframeId].submitForm();
  511. }
  512. });
  513. });
  514. $("#NF-ExportAll").click(function () {
  515. let queryJson = {
  516. InvCode: $("#txt_InvCode").val(),
  517. InvName: $("#txt_InvName").val(),
  518. StartDate: $("#txt_StartDate").val(),
  519. EndDate: $("#txt_EndDate").val(),
  520. ASNCode: $("#txt_ASNCode").val(),
  521. InvBatcgNo: $("#txt_InvBatcgNo").val(),
  522. IsCheckComplete: $("#txt_IsCheckComplete").val(),
  523. JuegeProgess: $("#txt_JuegeProgess").val(),
  524. BcgCode: $("#txt_BcgCode").val(),
  525. };
  526. var postData = "&InvCode=" + queryJson.InvCode + "";
  527. postData += "&InvName=" + queryJson.InvName;
  528. postData += "&StartDate=" + queryJson.StartDate;
  529. postData += "&EndDate=" + queryJson.EndDate;
  530. postData += "&ASNCode=" + queryJson.ASNCode;
  531. postData += "&VenCode=" + queryJson.VenCode;
  532. postData += "&VenName=" + queryJson.VenName;
  533. postData += "&InvBatcgNo=" + queryJson.InvBatcgNo;
  534. postData += "&IsCheckComplete=" + queryJson.IsCheckComplete;
  535. postData += "&JuegeProgess=" + queryJson.JuegeProgess;
  536. postData += "&BcgCode=" + queryJson.BcgCode;
  537. $.download("/BBWMS/IQCQuality/ExportMaterialInStorageFinalList" + "?" + Math.random(), postData, 'post');
  538. });
  539. $("#NF-DoJudge").click(function () {
  540. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  541. if (ids.length != 1) {
  542. $.modalMsg("请选择一条数据", "warning");
  543. return;
  544. }
  545. let obj = {
  546. ids: ids[0],
  547. };
  548. for (var i = 0; i < ids.length; i++) {
  549. var rowId = ids[i];
  550. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  551. //objArr += "'" + rowData.CheckFixtureNo + "',";
  552. if (rowData.FinalResult) {
  553. $.modalMsg("已经判定,不能重复操作", "warning");
  554. return;
  555. }
  556. //if (rowData.SQEEngineerResult == "NG" || rowData.IQCHeaderResult == "NG") {
  557. //}
  558. //else {
  559. // $.modalMsg("只有IQC主管,SQE工程师判定不合格的数据可以最终判定", "warning");
  560. // return;
  561. //}
  562. }
  563. $.modalOpen({
  564. id: "Form",
  565. title: "直接判定",
  566. url: "/BBWMS/IQCQuality/MaterialDoJudge?ids=" + ids[0] + "",
  567. width: "600px",
  568. height: "300px",
  569. callBack: function (iframeId) {
  570. top.frames[iframeId].submitForm();
  571. }
  572. });
  573. });
  574. $("#NF-WareOKReturnItem").click(function () {
  575. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  576. if (ids.length < 1) {
  577. $.modalMsg("请选择一条数据", "warning");
  578. return;
  579. }
  580. let input = [];
  581. for (var i = 0; i < ids.length; i++) {
  582. var rowId = ids[i];
  583. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  584. }
  585. $.modalOpen({
  586. id: "Form",
  587. title: "仓库备注",
  588. url: "/BBWMS/IQCQuality/MaterialHasReturnItemEdit?ids=" + ids[0] + "",
  589. width: "600px",
  590. height: "300px",
  591. callBack: function (iframeId) {
  592. top.frames[iframeId].submitForm();
  593. }
  594. });
  595. //var rowId = ids[0];
  596. //var rowData = $("#gridList").jqGrid('getRowData', rowId);
  597. //$.ajax({
  598. // url: "/BBWMS/IQCQuality/UpdateMaterialHasReturnItem",
  599. // type: "POST",
  600. // dataType: "json",
  601. // async: false,
  602. // data: {
  603. // keyValue: JSON.stringify(ids)
  604. // },
  605. // success: function (data) {
  606. // //
  607. // // console.log(data);
  608. // if (data.state == "success") {
  609. // $.modalMsg("操作成功", "success");
  610. // that.query();
  611. // }
  612. // else
  613. // $.modalMsg(data.message, "warning");
  614. // }
  615. //});
  616. });
  617. $("#NF-Urgent").click(function () {
  618. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  619. if (ids.length < 1) {
  620. $.modalMsg("请选择一条数据", "warning");
  621. return;
  622. }
  623. let input = [];
  624. for (var i = 0; i < ids.length; i++) {
  625. var rowId = ids[i];
  626. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  627. }
  628. //var rowId = ids[0];
  629. //var rowData = $("#gridList").jqGrid('getRowData', rowId);
  630. $.ajax({
  631. url: "/BBWMS/IQCQuality/UpdateMaterialReUrgent",
  632. type: "POST",
  633. dataType: "json",
  634. async: false,
  635. data: {
  636. keyValue: JSON.stringify(ids)
  637. },
  638. success: function (data) {
  639. //
  640. // console.log(data);
  641. if (data.state == "success") {
  642. $.modalMsg("操作成功", "success");
  643. that.query();
  644. }
  645. else
  646. $.modalMsg(data.message, "warning");
  647. }
  648. });
  649. });
  650. //$("#NF-IQC1Back").click(function () {
  651. // $.modalConfirm("确定撤销吗?", function (r) {
  652. // if (!r) {
  653. // return;
  654. // }
  655. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  656. // if (ids.length != 1) {
  657. // $.modalMsg("请选择一条数据", "warning");
  658. // return;
  659. // }
  660. // let input = [];
  661. // for (var i = 0; i < ids.length; i++) {
  662. // var rowId = ids[i];
  663. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  664. // }
  665. // let obj = {
  666. // ID: ids[0],
  667. // BackType: 'IQC1Back'
  668. // };
  669. // //var rowId = ids[0];
  670. // //var rowData = $("#gridList").jqGrid('getRowData', rowId);
  671. // $.ajax({
  672. // url: "/BBWMS/IQCQuality/IQC1Back",
  673. // type: "POST",
  674. // dataType: "json",
  675. // async: false,
  676. // data: {
  677. // keyValue: JSON.stringify(obj)
  678. // },
  679. // success: function (data) {
  680. // //
  681. // // console.log(data);
  682. // if (data.state == "success") {
  683. // $.modalMsg("操作成功", "success");
  684. // that.query();
  685. // }
  686. // else
  687. // $.modalMsg(data.message, "warning");
  688. // }
  689. // });
  690. // });
  691. // // $.modalMsg("操作成功", "success");
  692. //});
  693. $("#NF-SQEBack").click(function () {
  694. $.modalConfirm("确定撤销吗?", function (r) {
  695. if (!r) {
  696. return;
  697. }
  698. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  699. if (ids.length != 1) {
  700. $.modalMsg("请选择一条数据", "warning");
  701. return;
  702. }
  703. let input = [];
  704. for (var i = 0; i < ids.length; i++) {
  705. var rowId = ids[i];
  706. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  707. }
  708. let obj = {
  709. ID: ids[0],
  710. BackType: 'SQEBack'
  711. };
  712. $.ajax({
  713. url: "/BBWMS/IQCQuality/IQC1Back",
  714. type: "POST",
  715. dataType: "json",
  716. async: false,
  717. data: {
  718. keyValue: JSON.stringify(obj)
  719. },
  720. success: function (data) {
  721. //
  722. // console.log(data);
  723. if (data.state == "success") {
  724. $.modalMsg("操作成功", "success");
  725. that.query();
  726. }
  727. else
  728. $.modalMsg(data.message, "warning");
  729. }
  730. });
  731. });
  732. });
  733. //$("#NF-IQC2Back").click(function () {
  734. // $.modalConfirm("确定撤销吗?", function (r) {
  735. // if (!r) {
  736. // return;
  737. // }
  738. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  739. // if (ids.length != 1) {
  740. // $.modalMsg("请选择一条数据", "warning");
  741. // return;
  742. // }
  743. // let input = [];
  744. // for (var i = 0; i < ids.length; i++) {
  745. // var rowId = ids[i];
  746. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  747. // }
  748. // let obj = {
  749. // ID: ids[0],
  750. // BackType: 'IQC2Back'
  751. // };
  752. // $.ajax({
  753. // url: "/BBWMS/IQCQuality/IQC1Back",
  754. // type: "POST",
  755. // dataType: "json",
  756. // async: false,
  757. // data: {
  758. // keyValue: JSON.stringify(obj)
  759. // },
  760. // success: function (data) {
  761. // //
  762. // // console.log(data);
  763. // if (data.state == "success") {
  764. // $.modalMsg("操作成功", "success");
  765. // that.query();
  766. // }
  767. // else
  768. // $.modalMsg(data.message, "warning");
  769. // }
  770. // });
  771. // });
  772. //});
  773. $("#NF-FinalJudgeBack").click(function () {
  774. $.modalConfirm("确定撤销吗?", function (r) {
  775. if (!r) {
  776. return;
  777. }
  778. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  779. if (ids.length != 1) {
  780. $.modalMsg("请选择一条数据", "warning");
  781. return;
  782. }
  783. let input = [];
  784. for (var i = 0; i < ids.length; i++) {
  785. var rowId = ids[i];
  786. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  787. }
  788. let obj = {
  789. ID: ids[0],
  790. BackType: 'FinalJudgeBack'
  791. };
  792. $.ajax({
  793. url: "/BBWMS/IQCQuality/IQC1Back",
  794. type: "POST",
  795. dataType: "json",
  796. async: false,
  797. data: {
  798. keyValue: JSON.stringify(obj)
  799. },
  800. success: function (data) {
  801. //
  802. // console.log(data);
  803. if (data.state == "success") {
  804. $.modalMsg("操作成功", "success");
  805. that.query();
  806. }
  807. else
  808. $.modalMsg(data.message, "warning");
  809. }
  810. });
  811. });
  812. });
  813. }
  814. }
  815. service.Init();
  816. })
  817. function btn_viewOutReport(rowId) {
  818. debugger;
  819. let fileName = '';
  820. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  821. fileName = rowData.FilePath;
  822. if (!fileName) {
  823. return;
  824. }
  825. // debugger;
  826. axios
  827. .get('/BBWMS/IQCQuality/GetOutReportFilePath?fileName=' + fileName)
  828. .then(function (res) {
  829. if (res.data) {
  830. console.log(res.data.message);
  831. window.open(res.data.message);
  832. }
  833. })
  834. .catch(function (error) { // 请求失败处理
  835. alert(error);
  836. });
  837. }
  838. function btn_viewExReport(fileName) {
  839. debugger;
  840. //let fileName = '';
  841. //var rowData = $("#gridList").jqGrid('getRowData', rowId);
  842. //fileName = rowData.WgNgFile;
  843. if (!fileName) {
  844. return;
  845. }
  846. // debugger;
  847. axios
  848. .get('/BBWMS/IQCQuality/GetMaterialExFilePath?fileName=' + fileName)
  849. .then(function (res) {
  850. if (res.data) {
  851. console.log(res.data.message);
  852. window.open(res.data.message);
  853. }
  854. })
  855. .catch(function (error) { // 请求失败处理
  856. alert(error);
  857. });
  858. }
  859. </script>