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.

563 lines
22 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. </style>
  14. <form id="form1">
  15. <div id="app">
  16. <template>
  17. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  18. @*<el-divider>主表信息</el-divider>*@
  19. <el-row :gutter="24">
  20. <el-col :span="4">
  21. <el-form-item label="物料编码" prop="InvCode">
  22. <el-input v-model="form.InvCode" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="4">
  26. <el-form-item label="物料名称" prop="InvName">
  27. <el-input v-model="form.InvName" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="4">
  31. <el-form-item label="批次" prop="InvBatcgNo">
  32. <el-input v-model="form.InvBatcgNo" placeholder="请输入内容" size="mini" :disabled="true"></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="4">
  36. </el-col>
  37. </el-row>
  38. <el-row :gutter="24">
  39. <el-col :span="4">
  40. <el-form-item label="批次数量" prop="InvBatcgQty">
  41. <el-input v-model="form.InvBatcgQty" size="mini" :disabled="true"></el-input>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="4">
  45. <el-form-item label="单位" prop="InvUnit">
  46. <el-input v-model="form.InvUnit" size="mini" :disabled="true"></el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="4">
  50. <el-form-item label="抽检数量" prop="AqlCheckQty">
  51. <el-input v-model="form.AqlCheckQty" size="mini" :disabled="true"></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="4">
  55. <el-form-item label="检验结果" prop="Result">
  56. <el-input v-model="form.Result" size="mini" :disabled="true"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. <el-row :gutter="24">
  61. <el-col :span="6">
  62. <el-form-item label="IQC组长判定结果" prop="IQCGroupHeaderResult">
  63. <el-input v-model="form.IQCGroupHeaderResult" size="mini" :disabled="true"></el-input>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="6">
  67. <el-form-item label="IQC组长判定结论" prop="IQCGroupHeaderRemark">
  68. <el-input v-model="form.IQCGroupHeaderRemark" size="mini" :disabled="true"></el-input>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-row :gutter="24">
  73. <el-col :span="6">
  74. <el-form-item label="IQC主管判定结果" prop="IQCHeaderResult">
  75. <el-input v-model="form.IQCHeaderResult" size="mini" :disabled="true"></el-input>
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="6">
  79. <el-form-item label="IQC主管判定结论" prop="IQCHeaderRemark">
  80. <el-input v-model="form.IQCHeaderRemark" size="mini" :disabled="true"></el-input>
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. <el-row :gutter="24">
  85. <el-col :span="6">
  86. <el-form-item label="SQE工程师判定" prop="SQEEngineerResult">
  87. <el-input v-model="form.SQEEngineerResult" size="mini" :disabled="true"></el-input>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6">
  91. <el-form-item label="SQE工程师结论" prop="SQEEngineerRemark">
  92. <el-input v-model="form.SQEEngineerRemark" size="mini" :disabled="true"></el-input>
  93. </el-form-item>
  94. </el-col>
  95. </el-row>
  96. <el-row :gutter="24">
  97. <el-col :span="6">
  98. <el-form-item label="最终判定结果" prop="FinalResult">
  99. <el-input v-model="form.FinalResult" size="mini" :disabled="true"></el-input>
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. <el-divider>尺寸检验</el-divider>
  104. <el-row :gutter="24">
  105. <el-col :span="24">
  106. <el-table ref="singleTable" highlight-current-row
  107. :data="dataSource4CC"
  108. style="width: 100%"
  109. stripe border
  110. size="mini"
  111. height="300"
  112. v-on:current-change="handleCurrentChange4CC">
  113. <el-table-column type="index" width="50"></el-table-column>
  114. <el-table-column prop="CheckAttrText" label="分类" width="60">
  115. </el-table-column>
  116. <el-table-column prop="CheckItemName" label="检验描述" width="300">
  117. </el-table-column>
  118. <el-table-column prop="CheckWay" label="检验方法" width="140">
  119. </el-table-column>
  120. <el-table-column prop="CheckAqlName" label="抽样标准" width="150">
  121. </el-table-column>
  122. <el-table-column prop="SetValueMax" label="上限值" width="60">
  123. </el-table-column>
  124. <el-table-column prop="SetValueMin" label="下限值" width="60">
  125. </el-table-column>
  126. <el-table-column prop="Unit" label="单位" width="60">
  127. </el-table-column>
  128. <el-table-column prop="S1" label="S1" width="80">
  129. </el-table-column>
  130. <el-table-column prop="S2" label="S2" width="80">
  131. </el-table-column>
  132. <el-table-column prop="S3" label="S3" width="80">
  133. </el-table-column>
  134. <el-table-column prop="S4" label="S4" width="80">
  135. </el-table-column>
  136. <el-table-column prop="S5" label="S5" width="80">
  137. </el-table-column>
  138. <el-table-column prop="S6" label="S6" width="80">
  139. </el-table-column>
  140. <el-table-column prop="S7" label="S7" width="80">
  141. </el-table-column>
  142. <el-table-column prop="S8" label="S8" width="80">
  143. </el-table-column>
  144. <el-table-column prop="S9" label="S9" width="80">
  145. </el-table-column>
  146. <el-table-column prop="S10" label="S10" width="80">
  147. </el-table-column>
  148. <el-table-column prop="Result" label="判定结果" width="80">
  149. </el-table-column>
  150. <el-table-column prop="Remark" label="备注" width="150">
  151. </el-table-column>
  152. </el-table>
  153. </el-col>
  154. </el-row>
  155. <el-row :gutter="24">
  156. <el-col :span="15">
  157. <el-divider>抽样检验</el-divider>
  158. <el-table ref="singleTable2" highlight-current-row
  159. :data="dataSource4WG"
  160. style="width: 100%"
  161. stripe border
  162. size="mini"
  163. height="200"
  164. v-on:current-change="handleCurrentChange4WG">
  165. <el-table-column type="index" width="50"></el-table-column>
  166. <el-table-column prop="CheckAttrText" label="分类" width="60">
  167. </el-table-column>
  168. <el-table-column prop="CheckItemName" label="检验描述" width="300">
  169. </el-table-column>
  170. <el-table-column prop="CheckWay" label="检验方法" width="140">
  171. </el-table-column>
  172. <el-table-column prop="CheckAqlName" label="抽样标准" width="150">
  173. </el-table-column>
  174. <el-table-column prop="AqlQty" label="抽检数量" width="150">
  175. </el-table-column>
  176. <el-table-column prop="GoodQty" label="合格数量" width="100">
  177. </el-table-column>
  178. <el-table-column prop="NgQty" label="不合格数量" width="100">
  179. </el-table-column>
  180. <el-table-column prop="Result" label="判定结果" width="150">
  181. </el-table-column>
  182. <el-table-column prop="Remark" label="备注" width="150">
  183. </el-table-column>
  184. </el-table>
  185. </el-col>
  186. <el-col :span="9">
  187. <el-divider>性能检验</el-divider>
  188. <el-table ref="singleTable3" highlight-current-row
  189. :data="dataSource4XN"
  190. style="width: 100%"
  191. stripe border
  192. size="mini"
  193. height="200"
  194. v-on:current-change="handleCurrentChange4XN">
  195. <el-table-column type="index" width="50"></el-table-column>
  196. <el-table-column prop="CheckAttrText" label="分类" width="60">
  197. </el-table-column>
  198. <el-table-column prop="CheckItemName" label="检验描述" width="300">
  199. </el-table-column>
  200. <el-table-column prop="Result" label="检验结果" width="100">
  201. </el-table-column>
  202. <el-table-column prop="Remark" label="备注" width="100">
  203. </el-table-column>
  204. </el-table>
  205. </el-col>
  206. </el-row>
  207. </el-form>
  208. </template>
  209. </div>
  210. </form>
  211. <script type="text/javascript">
  212. //const { Console } = require("node:console");
  213. var vm = new Vue({
  214. el: '#app',
  215. data: {
  216. id:'',
  217. userCode: "",
  218. ssList: [],
  219. form: {},
  220. dataSource4CC: [],
  221. dataSource4WG: [],
  222. dataSource4XN: [],
  223. currentRow4CC: null,
  224. currentRow4WG: null,
  225. currentRow4XN: null,
  226. rules: {
  227. },
  228. disabled4RulesCode: false,
  229. dataSource4BRGCode: [],//
  230. dataSource4BCGCode: [],//
  231. dataSource4BadReasonCode: [],//
  232. dataSource4HandleWay:[],
  233. judgeRole: '',
  234. showIQCGroupHeader: false,
  235. showIQCHeader: false,
  236. showSQEEngineer: false,
  237. },
  238. //挂在DOM 触发
  239. mounted() {
  240. //let reactiveObject = {
  241. //};
  242. //this.form = reactiveObject;
  243. // this.loadGrid();
  244. // this.show();
  245. this.id = '@ViewData["ids"]';
  246. this.judgeRole = '@ViewData["judgeRole"]';
  247. console.log(this.id);
  248. console.log(this.judgeRole);
  249. this.initControl();
  250. // console.log(this.id);
  251. },
  252. beforeDestroy() {
  253. // this.autoScrol1(true);
  254. },
  255. methods: {
  256. getAllHandleWay() {
  257. axios
  258. .get('/BBWMS/IQCQuality/GetSelectItemList?keyValue=Decision')
  259. .then(function (res) {
  260. //debugger;
  261. if (res.data) {
  262. res.data.forEach(function (el, i) {
  263. Vue.set(vm.dataSource4HandleWay, i, el)
  264. });
  265. }
  266. })
  267. .catch(function (error) { // 请求失败处理
  268. alert(error);
  269. });
  270. },
  271. getAllBRGCode() {
  272. axios
  273. .get('/BBWMS/IQCQuality/GetSelectBadCodeGroupList')
  274. .then(function (res) {
  275. //debugger;
  276. if (res.data) {
  277. res.data.forEach(function (el, i) {
  278. Vue.set(vm.dataSource4BRGCode, i, el)
  279. });
  280. }
  281. })
  282. .catch(function (error) { // 请求失败处理
  283. alert(error);
  284. });
  285. },
  286. getAllBCGCode() {
  287. axios
  288. .get('/BBWMS/IQCQuality/GetSelectBadReasonGroupList')
  289. .then(function (res) {
  290. //debugger;
  291. if (res.data) {
  292. res.data.forEach(function (el, i) {
  293. Vue.set(vm.dataSource4BCGCode, i, el)
  294. });
  295. }
  296. })
  297. .catch(function (error) { // 请求失败处理
  298. alert(error);
  299. });
  300. },
  301. getAllBCGCodeDetail(code) {
  302. axios
  303. .get('/BBWMS/IQCQuality/GetSelectBadReasonList?keyValue=' + code+'')
  304. .then(function (res) {
  305. //debugger;
  306. if (res.data) {
  307. res.data.forEach(function (el, i) {
  308. Vue.set(vm.dataSource4BadReasonCode, i, el)
  309. });
  310. }
  311. })
  312. .catch(function (error) { // 请求失败处理
  313. alert(error);
  314. });
  315. },
  316. change4BCGCode(val) {
  317. if (!val) {
  318. return;
  319. }
  320. this.getAllBCGCodeDetail(val);
  321. },
  322. change4S1(currentValue, oldValue) {
  323. console.log('S1数改变');
  324. //debugger;
  325. let currentRow = this.dataSource4CC.filter((x) => x.ID == this.currentRow4CC.ID)[0];
  326. if (!currentRow) {
  327. return;
  328. }
  329. if (currentValue >= currentRow.SetValueMin && currentValue <= currentRow.SetValueMax) {
  330. currentRow.Result = "OK";
  331. }
  332. else {
  333. currentRow.Result = "NG";
  334. }
  335. },
  336. change4GoodQty(currentValue, oldValue) {
  337. console.log('OK数改变');
  338. //debugger;
  339. let currentRow = this.dataSource4WG.filter((x) => x.ID == this.currentRow4WG.ID)[0];
  340. if (currentRow) {
  341. currentRow.NgQty = currentRow.AqlQty - currentValue;
  342. if (currentRow.NgQty < 0) {
  343. currentRow.GoodQty = 0;
  344. currentRow.NgQty = 0;
  345. }
  346. else {
  347. this.judgeWGRowResult(currentRow);
  348. }
  349. }
  350. },
  351. change4NgQty(currentValue, oldValue) {
  352. console.log('NG数改变');
  353. let currentRow = this.dataSource4WG.filter((x) => x.ID == this.currentRow4WG.ID)[0];
  354. if (currentRow) {
  355. currentRow.GoodQty = currentRow.AqlQty - currentValue;
  356. if (currentRow.GoodQty < 0) {
  357. currentRow.GoodQty = 0;
  358. currentRow.NgQty = 0;
  359. }
  360. else {
  361. this.judgeWGRowResult(currentRow);
  362. }
  363. }
  364. },
  365. judgeCCRowResult() {
  366. },
  367. judgeWGRowResult(currentRow) {
  368. if (!currentRow) {
  369. return;
  370. }
  371. if (currentRow.NgQty <= this.form.AllowNgQty) {
  372. currentRow.Result = "OK";
  373. }
  374. else {
  375. currentRow.Result = "NG";
  376. }
  377. },
  378. initControl: function () {
  379. let that = this;
  380. let orgName = '';
  381. this.disabled4RulesCode = this.id ? true : false;
  382. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  383. // console.log(userName);
  384. this.getAllBRGCode();
  385. this.getAllBCGCode();
  386. this.getAllHandleWay();
  387. this.getData();
  388. },
  389. finalJudge() {
  390. if (this.dataSource4CC.length == 0 || this.dataSource4WG.length == 0) {
  391. $.modalMsg("必须存在检验项目", "warning");
  392. return false;
  393. }
  394. this.dataSource4CC.forEach((item) => {
  395. if (item.Result == 'NG') {
  396. this.form.Result = "NG";
  397. }
  398. })
  399. this.dataSource4WG.forEach((item) => {
  400. if (item.Result == 'NG') {
  401. this.form.Result = "NG";
  402. }
  403. })
  404. if (!this.form.Result) {
  405. this.form.Result = "OK";
  406. }
  407. },
  408. queryCheckRecord() {
  409. },
  410. getData() {
  411. if (!this.id) return;
  412. let _this = this;
  413. axios
  414. .get('/BBWMS/IQCQuality/GetMaterialReJudgeMain?keyValue=' + _this.id)
  415. .then(function (res) {
  416. // debugger;
  417. if (res.data) {
  418. for (var i in res.data) {
  419. Vue.set(vm.form, i, res.data[i]);
  420. }
  421. _this.form.JudgeRole = _this.judgeRole;
  422. res.data.CCList.forEach(function (el, i) {
  423. Vue.set(vm.dataSource4CC, i, el)
  424. });
  425. res.data.WGList.forEach(function (el, i) {
  426. Vue.set(vm.dataSource4WG, i, el)
  427. });
  428. res.data.XNList.forEach(function (el, i) {
  429. Vue.set(vm.dataSource4XN, i, el)
  430. });
  431. if (_this.judgeRole == 'IQCGroupHeader') {
  432. _this.showIQCGroupHeader = true;
  433. _this.showIQCHeader = false;
  434. _this.showSQEEngineer = false;
  435. if (!_this.form.IQCGroupHeaderResult) {
  436. _this.form.IQCGroupHeaderResult = 'OK';
  437. }
  438. }
  439. else if (_this.judgeRole == 'IQCHeader') {
  440. _this.showIQCGroupHeader = false;
  441. _this.showIQCHeader = true;
  442. _this.showSQEEngineer = false;
  443. if (!_this.form.IQCHeaderResult) {
  444. _this.form.IQCHeaderResult = 'OK';
  445. }
  446. }
  447. else if (_this.judgeRole == 'SQEEngineer') {
  448. _this.showIQCGroupHeader = false;
  449. _this.showIQCHeader = false;
  450. _this.showSQEEngineer = true;
  451. if (!_this.form.SQEEngineerResult) {
  452. _this.form.SQEEngineerResult = 'OK';
  453. }
  454. }
  455. else if (_this.judgeRole == '') {
  456. }
  457. else {
  458. }
  459. }
  460. })
  461. .catch(function (error) { // 请求失败处理
  462. alert(error);
  463. });
  464. },
  465. //选中行变化
  466. handleCurrentChange4CC(val) {
  467. this.currentRow4CC = val;
  468. console.log('尺寸行变化');
  469. },
  470. handleCurrentChange4WG(val) {
  471. this.currentRow4WG = val;
  472. console.log('外观行变化');
  473. },
  474. handleCurrentChange4XN(val) {
  475. this.currentRow4XN = val;
  476. //console.log('外观行变化');
  477. },
  478. submitCheck() {
  479. //this.form.CCList = this.dataSource4CC;
  480. //this.form.WGList = this.dataSource4WG;
  481. $.currentWindow().$("#gridList").trigger("reloadGrid");
  482. // console.log(result);
  483. },
  484. },
  485. });
  486. function submitForm() {
  487. //debugger;
  488. vm.submitCheck();
  489. }
  490. </script>