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.

770 lines
35 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "";
  4. Layout = "~/Views/Shared/_Form.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. .redClass{
  14. color:red;
  15. }
  16. </style>
  17. <form id="form1">
  18. <div id="app">
  19. <template>
  20. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  21. @*<el-divider>主表信息</el-divider>*@
  22. <el-row :gutter="24">
  23. <el-col :span="4">
  24. <el-form-item label="物料编码" prop="InvCode">
  25. <el-input v-model="form.InvCode" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="4">
  29. <el-form-item label="物料名称" prop="InvName">
  30. <el-input v-model="form.InvName" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="4">
  34. <el-form-item label="批次" prop="InvBatcgNo">
  35. <el-input v-model="form.InvBatcgNo" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="4">
  39. <el-form-item label="仓库" prop="WHCode">
  40. <el-select v-model="form.WHCode" placeholder="请选择" size="mini" >
  41. <el-option v-for="item in WHCodeList"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value">
  45. </el-option>
  46. </el-select>
  47. </el-form-item>
  48. </el-col>
  49. </el-row>
  50. <el-row :gutter="24">
  51. <el-col :span="4">
  52. <el-form-item label="批次数量" prop="qty">
  53. <el-input v-model="qty" size="mini" :disabled="true"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="4">
  57. <el-form-item label="单位" prop="InvUnit">
  58. <el-input v-model="form.InvUnit" size="mini" :disabled="true"></el-input>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="4">
  62. <el-form-item label="外观抽检数量" prop="AqlCheckQty">
  63. <el-input v-model="form.AqlCheckQty" size="mini" :disabled="true"></el-input>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="4">
  67. <el-form-item label="总判定结果" prop="Result">
  68. <el-input v-model="form.Result" size="mini" :disabled="true"></el-input>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="4">
  72. <el-form-item label="异常文件" prop="WgNgFile">
  73. <el-input v-model="form.WgNgFile" size="mini" :disabled="true"></el-input>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="4">
  77. <a id="NF-Uploading" authorize="yes" class="btn btn-primary dropdown-text" onclick="UpLoadClick()"><i class="fa fa-file-excel-o"></i>上传</a>
  78. <input id='FileUp2' type='file' style="display: none" v-on:change="change4FileUp2"/>
  79. </el-col>
  80. </el-row>
  81. <el-row :gutter="24">
  82. <el-col :span="24">
  83. @*<el-button type="primary" size="mini" v-on:click="addLine()">新增</el-button>*@
  84. <a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="queryCheckRecord()"><i class="fa fa-pencil-square-o"></i>历史检验记录</a>
  85. <a id="NF-QualFile" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="viewFile()"><i class="fa fa-pencil-square-o"></i>质量文件查看</a>
  86. <a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="test()"><i class="fa fa-pencil-square-o"></i>破坏性实验</a>
  87. <a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="finalJudge()"><i class="fa fa-pencil-square-o"></i>总结果判定</a>
  88. </el-col>
  89. </el-row>
  90. <el-divider>尺寸检验</el-divider>
  91. <el-row :gutter="24">
  92. <el-col :span="24">
  93. <el-table ref="singleTable" highlight-current-row
  94. :data="dataSource4CC"
  95. style="width: 100%"
  96. stripe border
  97. size="mini"
  98. height="300"
  99. v-on:current-change="handleCurrentChange4CC">
  100. <el-table-column type="index" width="50"></el-table-column>
  101. <el-table-column prop="CheckAttrText" label="分类" width="60">
  102. </el-table-column>
  103. <el-table-column prop="CheckItemName" label="检验描述" width="140">
  104. </el-table-column>
  105. <el-table-column prop="CheckWay" label="检验方法" width="140">
  106. </el-table-column>
  107. <el-table-column prop="CheckAqlName" label="抽样标准" width="150">
  108. </el-table-column>
  109. <el-table-column prop="RulesType" label="检验类别" width="150">
  110. </el-table-column>
  111. <el-table-column prop="RulesDesc" label="Aql描述" width="100">
  112. </el-table-column>
  113. <el-table-column prop="SetValueMax" label="上限值" width="60">
  114. </el-table-column>
  115. <el-table-column prop="SetValueMin" label="下限值" width="60">
  116. </el-table-column>
  117. <el-table-column prop="Unit" label="单位" width="60">
  118. </el-table-column>
  119. <el-table-column prop="S1" label="S1" width="80">
  120. <template slot-scope="scope">
  121. <el-input-number v-model="scope.row.S1" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="S2" label="S2" width="80">
  125. <template slot-scope="scope">
  126. <el-input-number v-model="scope.row.S2" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  127. </template>
  128. </el-table-column>
  129. <el-table-column prop="S3" label="S3" width="80">
  130. <template slot-scope="scope">
  131. <el-input-number v-model="scope.row.S3" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="S4" label="S4" width="80">
  135. <template slot-scope="scope">
  136. <el-input-number v-model="scope.row.S4" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  137. </template>
  138. </el-table-column>
  139. <el-table-column prop="S5" label="S5" width="80">
  140. <template slot-scope="scope">
  141. <el-input-number v-model="scope.row.S5" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  142. </template>
  143. </el-table-column>
  144. <el-table-column prop="S6" label="S6" width="80">
  145. <template slot-scope="scope">
  146. <el-input-number v-model="scope.row.S6" :disabled='scope.row.RulesDesc!="加严检验"' :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="S7" label="S7" width="80">
  150. <template slot-scope="scope">
  151. <el-input-number v-model="scope.row.S7" :disabled='scope.row.RulesDesc!="加严检验"' :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  152. </template>
  153. </el-table-column>
  154. <el-table-column prop="S8" label="S8" width="80">
  155. <template slot-scope="scope">
  156. <el-input-number v-model="scope.row.S8" :disabled='scope.row.RulesDesc!="加严检验"' :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  157. </template>
  158. </el-table-column>
  159. <el-table-column prop="S9" label="S9" width="80">
  160. <template slot-scope="scope">
  161. <el-input-number v-model="scope.row.S9" :disabled='scope.row.RulesDesc!="加严检验"' :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="S10" label="S10" width="80">
  165. <template slot-scope="scope">
  166. <el-input-number v-model="scope.row.S10"
  167. :disabled='scope.row.RulesDesc!="加严检验"'
  168. :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4S1"></el-input-number>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="Result" label="判定结果" width="80">
  172. </el-table-column>
  173. <el-table-column prop="Remark" label="备注" width="300">
  174. <template slot-scope="scope">
  175. <el-input v-model="scope.row.Remark" size="mini"></el-input>
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. </el-col>
  180. </el-row>
  181. <el-row :gutter="24">
  182. <el-col :span="15">
  183. <el-divider>抽样检验</el-divider>
  184. <el-table ref="singleTable2" highlight-current-row
  185. :data="dataSource4WG"
  186. style="width: 100%"
  187. stripe border
  188. size="mini"
  189. height="500"
  190. v-on:current-change="handleCurrentChange4WG">
  191. <el-table-column type="index" width="50"></el-table-column>
  192. <el-table-column prop="CheckAttrText" label="分类" width="60">
  193. </el-table-column>
  194. <el-table-column prop="CheckItemName" label="检验描述" width="300">
  195. </el-table-column>
  196. <el-table-column prop="CheckWay" label="检验方法" width="100">
  197. </el-table-column>
  198. <el-table-column prop="CheckAqlName" label="抽样标准" width="100">
  199. </el-table-column>
  200. <el-table-column prop="RulesType" label="检验类别" width="100">
  201. </el-table-column>
  202. <el-table-column prop="AqlQty" label="抽检数量" width="100">
  203. </el-table-column>
  204. <el-table-column prop="GoodQty" label="合格数量" width="100">
  205. <template slot-scope="scope">
  206. <el-input-number v-model="scope.row.GoodQty" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4GoodQty"></el-input-number>
  207. </template>
  208. </el-table-column>
  209. <el-table-column prop="NgQty" label="不合格数量" width="100">
  210. <template slot-scope="scope">
  211. <el-input-number v-model="scope.row.NgQty" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4NgQty"></el-input-number>
  212. </template>
  213. </el-table-column>
  214. <el-table-column prop="Result" label="判定结果" width="80">
  215. </el-table-column>
  216. <el-table-column prop="Remark" label="备注" width="300">
  217. <template slot-scope="scope">
  218. <el-input v-model="scope.row.Remark" size="mini"></el-input>
  219. </template>
  220. </el-table-column>
  221. </el-table>
  222. </el-col>
  223. <el-col :span="9">
  224. <el-divider>性能检验</el-divider>
  225. <el-table ref="singleTable3" highlight-current-row
  226. :data="dataSource4XN"
  227. style="width: 100%"
  228. stripe border
  229. size="mini"
  230. height="500"
  231. v-on:current-change="handleCurrentChange4XN">
  232. <el-table-column type="index" width="50"></el-table-column>
  233. <el-table-column prop="CheckAttrText" label="分类" width="60">
  234. </el-table-column>
  235. <el-table-column prop="CheckItemName" label="检验描述" width="300">
  236. </el-table-column>
  237. <el-table-column prop="RulesType" label="检验类别" width="100">
  238. </el-table-column>
  239. <el-table-column prop="Result" label="检验结果" width="150">
  240. <template slot-scope="scope">
  241. <el-radio-group v-model="scope.row.Result">
  242. <el-radio-button label="OK"></el-radio-button>
  243. <el-radio-button label="NG"></el-radio-button>
  244. </el-radio-group>
  245. </template>
  246. </el-table-column>
  247. <el-table-column prop="Remark" label="备注" width="300">
  248. <template slot-scope="scope">
  249. <el-input v-model="scope.row.Remark" size="mini"></el-input>
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. </el-col>
  254. </el-row>
  255. </el-form>
  256. </template>
  257. </div>
  258. </form>
  259. <script type="text/javascript">
  260. //const { Console } = require("node:console");
  261. function UpLoadClick() {
  262. //var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  263. //if (ids.length != 1) {
  264. // $.modalAlertNew("WMS00050");
  265. // return;
  266. //}
  267. $("#FileUp2").click();
  268. }
  269. var vm = new Vue({
  270. el: '#app',
  271. data: {
  272. id:'',
  273. userCode: "",
  274. ssList: [],
  275. form: {},
  276. dataSource4CC: [],
  277. dataSource4WG: [],
  278. dataSource4XN: [],
  279. WHCodeList:[],
  280. currentRow4CC: null,
  281. currentRow4WG: null,
  282. currentRow4XN: null,
  283. rules: {
  284. },
  285. disabled4RulesCode: false,
  286. destroyExprementDataSource: [],
  287. qty: 0,
  288. docType:''
  289. },
  290. //挂在DOM 触发
  291. mounted() {
  292. //let reactiveObject = {
  293. //};
  294. //this.form = reactiveObject;
  295. // this.loadGrid();
  296. // this.show();
  297. this.id = '@ViewData["ids"]';
  298. this.qty = @ViewData["qty"];
  299. this.asnCode = '@ViewData["asnCode"]';
  300. this.initControl();
  301. // console.log(this.id);
  302. },
  303. beforeDestroy() {
  304. // this.autoScrol1(true);
  305. },
  306. methods: {
  307. change4FileUp2(e) {
  308. debugger;
  309. var files = e.target.files;
  310. var fileName = files[0].name;
  311. // vm.setExFileName(fileName);
  312. this.form.WgNgFile = fileName;
  313. if (fileName != null && fileName != "") {
  314. var data = new FormData();
  315. jQuery.each(jQuery('#FileUp2')[0].files, function (i, file) {
  316. data.append('file-' + i, file);
  317. });
  318. data.append("ID", '001');
  319. // data.append("LableName", LableName);
  320. $.modalConfirm("确定上传文件吗?", function (r) {
  321. if (r) {
  322. $.ajax({
  323. url: "/BBWMS/IQCQuality/UpLoadMaterialCheckExFile" + "?" + Math.random(),
  324. type: "post",
  325. data: data,
  326. contentType: false,
  327. processData: false,
  328. dataType: "json",
  329. success: function (data) {
  330. // console.log(data);
  331. if (data.message == "上传成功!") {
  332. $.modalMsg("操作成功", "success");
  333. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  334. }
  335. else {
  336. $.modalMsg(data.message, "warning");
  337. }
  338. },
  339. error: function (aa) {
  340. $.modalAlertNew("WMS00016", aa);
  341. }
  342. });
  343. }
  344. });
  345. }
  346. },
  347. setExFileName(val) {
  348. this.form.WgNgFile = val;
  349. },
  350. getAllWHCodeList() {
  351. axios
  352. .get('/BBWMS/IQCQuality/GetSelectItemList?keyValue=InspectionWH')
  353. .then(function (res) {
  354. //debugger;
  355. if (res.data) {
  356. res.data.forEach(function (el, i) {
  357. Vue.set(vm.WHCodeList, i, el)
  358. });
  359. }
  360. })
  361. .catch(function (error) { // 请求失败处理
  362. alert(error);
  363. });
  364. },
  365. change4S1(currentValue, oldValue) {
  366. //debugger;
  367. // console.log('S1数改变');
  368. //debugger;
  369. let currentRow = this.dataSource4CC.filter((x) => x.ID == this.currentRow4CC.ID)[0];
  370. if (!currentRow) {
  371. return;
  372. }
  373. let upper = currentRow.SetValueMax;
  374. let lower = currentRow.SetValueMin;
  375. let result = this.checkResult(currentRow.S1, upper, lower)
  376. && this.checkResult(currentRow.S2, upper, lower)
  377. && this.checkResult(currentRow.S3, upper, lower)
  378. && this.checkResult(currentRow.S4, upper, lower)
  379. && this.checkResult(currentRow.S5, upper, lower);
  380. if (result && currentRow.RulesDesc == "加严检验")
  381. result = result
  382. && this.checkResult(currentRow.S6, upper, lower)
  383. && this.checkResult(currentRow.S7, upper, lower)
  384. && this.checkResult(currentRow.S8, upper, lower)
  385. && this.checkResult(currentRow.S9, upper, lower)
  386. && this.checkResult(currentRow.S10, upper, lower);
  387. if (result)
  388. currentRow.Result = "OK";
  389. else
  390. currentRow.Result = "NG";
  391. },
  392. checkResult(value, upper, lower) {
  393. return value >= lower && value <= upper;
  394. },
  395. change4GoodQty(currentValue, oldValue) {
  396. //console.log('OK数改变');
  397. //debugger;
  398. let currentRow = this.dataSource4WG.filter((x) => x.ID == this.currentRow4WG.ID)[0];
  399. if (currentRow) {
  400. currentRow.NgQty = currentRow.AqlQty - currentValue;
  401. if (currentRow.NgQty < 0) {
  402. currentRow.GoodQty = 0;
  403. currentRow.NgQty = 0;
  404. }
  405. else {
  406. this.judgeWGRowResult(currentRow);
  407. }
  408. }
  409. },
  410. change4NgQty(currentValue, oldValue) {
  411. //console.log('NG数改变');
  412. let currentRow = this.dataSource4WG.filter((x) => x.ID == this.currentRow4WG.ID)[0];
  413. if (currentRow) {
  414. currentRow.GoodQty = currentRow.AqlQty - currentValue;
  415. if (currentRow.GoodQty < 0) {
  416. currentRow.GoodQty = 0;
  417. currentRow.NgQty = 0;
  418. }
  419. else {
  420. this.judgeWGRowResult(currentRow);
  421. }
  422. }
  423. },
  424. judgeCCRowResult() {
  425. },
  426. judgeWGRowResult(currentRow) {
  427. //debugger;
  428. if (!currentRow) {
  429. return;
  430. }
  431. if (currentRow.NgQty <= this.form.AllowNgQty) {
  432. currentRow.Result = "OK";
  433. }
  434. else {
  435. currentRow.Result = "NG";
  436. }
  437. },
  438. initControl: function () {
  439. let that = this;
  440. let orgName = '';
  441. this.disabled4RulesCode = this.id ? true : false;
  442. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  443. // console.log(userName);
  444. this.getAllWHCodeList();
  445. this.getData();
  446. },
  447. finalJudge() {
  448. for (var i = 0; i < this.dataSource4CC.length; i++) {
  449. let item = this.dataSource4CC[i];
  450. if (!item.Result) {
  451. $.modalMsg("当前行没有检验结果" + " 尺寸检验,第" + (i + 1) + "行", "warning");
  452. return false;
  453. }
  454. }
  455. for (var i = 0; i < this.dataSource4WG.length; i++) {
  456. let item = this.dataSource4WG[i];
  457. if (!item.Result) {
  458. $.modalMsg("当前行没有检验结果" + " 外观检验,第" + (i + 1) + "行", "warning");
  459. return false;
  460. }
  461. }
  462. for (var i = 0; i < this.dataSource4XN.length; i++) {
  463. let item = this.dataSource4XN[i];
  464. if (!item.Result) {
  465. $.modalMsg("当前行没有检验结果" + " 性能检验,第" + (i + 1) + "行", "warning");
  466. return false;
  467. }
  468. }
  469. this.form.Result = "OK";
  470. this.dataSource4CC.forEach((item) => {
  471. if (item.Result == 'NG') {
  472. this.form.Result = "NG";
  473. }
  474. })
  475. this.dataSource4WG.forEach((item) => {
  476. if (item.Result == 'NG') {
  477. this.form.Result = "NG";
  478. }
  479. })
  480. this.dataSource4XN.forEach((item) => {
  481. if (item.Result == 'NG') {
  482. this.form.Result = "NG";
  483. }
  484. })
  485. //if (!this.form.Result) {
  486. // this.form.Result = "OK";
  487. //}
  488. },
  489. queryCheckRecord() {
  490. $.modalOpen({
  491. id: "Formdd",
  492. title: "历史检验记录",
  493. url: "/BBWMS/IQCQuality/MaterialCheckLog?ids=" + this.form.InvCode + "",
  494. width: "1600px",
  495. height: "400px",
  496. callBack: function (iframeId) {
  497. //let data=top.frames[iframeId].submitForm();
  498. }
  499. });
  500. },
  501. viewFile() {
  502. $.modalOpen({
  503. id: "Formdd",
  504. title: "质量履历文件查看",
  505. url: "/BBWMS/IQCQuality/Item2AqlFileView?ids=" + this.form.InvCode + "",
  506. width: "1200px",
  507. height: "400px",
  508. callBack: function (iframeId) {
  509. //let data=top.frames[iframeId].submitForm();
  510. }
  511. });
  512. },
  513. test() {
  514. let _this = this;
  515. $.modalOpen({
  516. id: "Formdd",
  517. title: "破坏性实验抽选结果",
  518. url: "/BBWMS/IQCQuality/MaterialDestoryExperimentEdit?ids=" + _this.id+ "",
  519. width: "1200px",
  520. height: "400px",
  521. callBack: function (iframeId) {
  522. //debugger;
  523. let data = top.frames[iframeId].submitForm();//破坏性结果
  524. top.frames[iframeId].Close();
  525. _this.destroyExprementDataSource = data;
  526. // console.log(data);
  527. }
  528. });
  529. },
  530. getData() {
  531. if (!this.id) return;
  532. let _this = this;
  533. axios
  534. .get('/BBWMS/IQCQuality/GetCPMaterialCheckMain2?keyValue=' + _this.id + '&qty=' + _this.qty )
  535. .then(function (res) {
  536. // debugger;
  537. if (res.data) {
  538. if (res.data[0]) {
  539. for (var i in res.data[0]) {
  540. Vue.set(vm.form, i, res.data[0][i]);
  541. }
  542. }
  543. }
  544. })
  545. .then(function () {
  546. axios
  547. .get('/BBWMS/IQCQuality/GetCPMaterialCheckMain4CC?keyValue=' + _this.form.InvCode)
  548. .then(function (res2) {
  549. //console.log(res2);
  550. if (res2.data) {
  551. res2.data.forEach(function (el, i) {
  552. Vue.set(vm.dataSource4CC, i, el)
  553. });
  554. }
  555. });
  556. })
  557. .then(function () {
  558. axios
  559. .get('/BBWMS/IQCQuality/GetMaterialCheckMain4WG?keyValue=' + _this.form.InvCode)
  560. .then(function (res2) {
  561. //console.log(res2);
  562. if (res2.data) {
  563. //debugger;
  564. res2.data.forEach(function (el, i) {
  565. el.AqlQty = _this.form.AqlCheckQty > _this.qty ? _this.qty : _this.form.AqlCheckQty;
  566. Vue.set(vm.dataSource4WG, i, el)
  567. });
  568. }
  569. });
  570. })
  571. .then(function () {
  572. axios
  573. .get('/BBWMS/IQCQuality/GetMaterialCheckMain4XN?keyValue=' + _this.form.InvCode)
  574. .then(function (res2) {
  575. //console.log(res2);
  576. if (res2.data) {
  577. res2.data.forEach(function (el, i) {
  578. // el.AqlQty = _this.form.AqlCheckQty;
  579. Vue.set(vm.dataSource4XN, i, el)
  580. });
  581. }
  582. });
  583. })
  584. .then(function () {
  585. axios
  586. .get('/BBWMS/IQCQuality/GetItem2AqlFileList?keyValue=' + _this.form.InvCode)
  587. .then(function (res) {
  588. if (res.data) {
  589. if (res.data.length > 0) {
  590. $("#NF-QualFile").addClass("redClass");
  591. }
  592. }
  593. })
  594. })
  595. .catch(function (error) { // 请求失败处理
  596. alert(error);
  597. });
  598. },
  599. //选中行变化
  600. handleCurrentChange4CC(val) {
  601. this.currentRow4CC = val;
  602. // console.log('尺寸行变化');
  603. },
  604. handleCurrentChange4WG(val) {
  605. this.currentRow4WG = val;
  606. // console.log('外观行变化');
  607. },
  608. handleCurrentChange4XN(val) {
  609. this.currentRow4XN = val;
  610. },
  611. submitCheck() {
  612. debugger;
  613. if (!this.form.Result) {
  614. $.modalMsg("必须存在最终检验结果", "warning");
  615. return false;
  616. }
  617. //if (this.dataSource4CC.length == 0 || this.dataSource4WG.length == 0 || this.dataSource4XN.length == 0) {
  618. // $.modalMsg("必须存在检验项目", "warning");
  619. // return false;
  620. //}
  621. for (var i = 0; i < this.dataSource4CC.length; i++) {
  622. let item = this.dataSource4CC[i];
  623. if (!item.Result) {
  624. $.modalMsg("当前行没有检验结果"+ " 尺寸检验,第"+(i+1)+"行", "warning");
  625. return false;
  626. }
  627. if (item.RulesDesc.includes("正常")) {
  628. if (!item.S1 || !item.S2 || !item.S3 || !item.S4 || !item.S5) {
  629. $.modalMsg("当前行为正常检验,必须填写5个检测值,第" + (i + 1) + "行", "warning");
  630. return false;
  631. }
  632. }
  633. if (item.RulesDesc.includes("加严")) {
  634. if (!item.S1 || !item.S2 || !item.S3 || !item.S4 || !item.S5
  635. || !item.S6 || !item.S7 || !item.S8 || !item.S9 || !item.S10) {
  636. $.modalMsg("当前行为加严检验,必须填写10个检测值,第" + (i + 1) + "行", "warning");
  637. return false;
  638. }
  639. }
  640. }
  641. for (var i = 0; i < this.dataSource4WG.length; i++) {
  642. let item = this.dataSource4WG[i];
  643. if (!item.Result) {
  644. $.modalMsg("当前行没有检验结果" + " 外观检验,第" + (i + 1) + "行", "warning");
  645. return false;
  646. }
  647. }
  648. for (var i = 0; i < this.dataSource4XN.length; i++) {
  649. let item = this.dataSource4XN[i];
  650. if (!item.Result) {
  651. $.modalMsg("当前行没有检验结果" + " 性能检验,第" + (i + 1) + "行", "warning");
  652. return false;
  653. }
  654. }
  655. //this.dataSource4CC.forEach((item) => {
  656. // if (!item.Result) {
  657. // }
  658. //})
  659. this.form.InvBatcgQty = this.qty;
  660. this.form.AsNCode = this.asnCode;
  661. this.form.EATTRIBUTE2 = this.docType;
  662. this.form.FinalItemLotList = this.destroyExprementDataSource;
  663. this.form.CCList = this.dataSource4CC;
  664. this.form.WGList = this.dataSource4WG;
  665. this.form.XNList = this.dataSource4XN;
  666. this.$refs['form'].validate((valid) => {
  667. if (valid) {
  668. //alert('submit!');
  669. $.submitForm({
  670. url: "/BBWMS/IQCQuality/SaveCPMaterialCheckResult",
  671. param: { keyValue: JSON.stringify(this.form) },
  672. success: function () {
  673. $.currentWindow().$("#gridList").trigger("reloadGrid");
  674. }
  675. })
  676. } else {
  677. console.log('error submit!!');
  678. return false;
  679. }
  680. });
  681. // console.log(result);
  682. },
  683. },
  684. });
  685. function submitForm() {
  686. //debugger;
  687. vm.submitCheck();
  688. }
  689. </script>