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.

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