1
0

detectionRecord.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <el-dialog width="50%" top="10vh" custom-class="modal" title="检测记录" :close-on-click-modal="false"
  3. @opened="opened()">
  4. <div style="height: 70vh; overflow-y: auto">
  5. <div class="titleBar">
  6. <div class="titleName">测试级</div>
  7. </div>
  8. <el-table ref="multipleTable" empty-text="暂无数据" :data="allData" :header-cell-style="{ height: '40px', background: 'rgba(83, 98, 104, 0.2)', color: '#b2bdc0', 'border-bottom': '0px solid red', }" :cell-style="{ height: '40px', 'border-bottom': 'solid 0px #242424', }" stripe style="width: 100%; margin-bottom: 10px">
  9. <el-table-column prop="starttime" label="故障时间" width="160" align="center"></el-table-column>
  10. <el-table-column prop="stationen" label="风场" width="80" align="center"></el-table-column>
  11. <el-table-column prop="stationcn" label="场站名称" width="120" align="center"></el-table-column>
  12. <el-table-column prop="windturbineid" label="风机编号" width="100" align="center"></el-table-column>
  13. <el-table-column prop="model" label="风机型号" width="80" align="center"></el-table-column>
  14. <el-table-column width="200" label="故障标签">
  15. <template #default="scope">
  16. <span>
  17. <el-select v-model="scope.row.faultcode" @change="selectChange(scope.row)" clearable
  18. placeholder="请选择" popper-class="select" style="width: 130px; margin-left: 30px">
  19. <el-option v-for="item in faultLists" :key="item.faultcode" :label="item.faulttype"
  20. :value="item.faultcode">
  21. </el-option>
  22. </el-select>
  23. </span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column width="120" label="操作">
  27. <template #default="btn">
  28. <button class="btn" @click="getReports(btn.row.faultid)">查看检测报告</button>
  29. </template>
  30. </el-table-column>
  31. </el-table>
  32. </div>
  33. <TestReport v-model="reportDisplay" :faultid='faultid'
  34. ></TestReport>
  35. </el-dialog>
  36. </template>
  37. <script>
  38. import TestReport from "./testReport.vue";
  39. import axios from "axios";
  40. export default {
  41. components: {
  42. TestReport,
  43. },
  44. props: {
  45. myData: {},
  46. },
  47. data() {
  48. return {
  49. faultLists: [],
  50. allData: [],
  51. reportDisplay: false,
  52. faultid:''
  53. };
  54. },
  55. created() {
  56. this.getfaultLables();
  57. },
  58. methods: {
  59. opened() {
  60. this.getData();
  61. },
  62. getData() {
  63. let that = this;
  64. that.API.requestData({
  65. method: "GET",
  66. subUrl: "http://192.168.1.18:9002/case/fault/list",
  67. data: {
  68. station: that.myData.station,
  69. model: that.myData.model,
  70. st: that.myData.st,
  71. et: that.myData.et,
  72. category: 3
  73. },
  74. success(res) {
  75. if (res) {
  76. that.allData = res.data;
  77. }
  78. },
  79. });
  80. },
  81. getfaultLables() {
  82. let that = this;
  83. this.API.requestData({
  84. method: "GET",
  85. subUrl: "http://192.168.1.18:9002/know/fault/type/all",
  86. success(res) {
  87. if (res) {
  88. that.faultLists = res.data;
  89. }
  90. },
  91. });
  92. },
  93. selectChange(data) {
  94. let params = [];
  95. (data.faulttype = this.faultLists.filter(
  96. (item) => item.faultcode === data.faultcode
  97. )[0]?.faulttype),
  98. params.push(data);
  99. axios({
  100. method: "post",
  101. url: "http://192.168.10.19:9002/case/fault/insert",
  102. data: params,
  103. header: {
  104. "Content-Type": "application/json",
  105. },
  106. }).then((res) => {
  107. if (res.data.code !== 200) {
  108. this.BASE.showMsg({
  109. type: "error",
  110. msg: "标签修改失败",
  111. });
  112. }
  113. });
  114. },
  115. getReports(id) {
  116. this.faultid = id;
  117. this.reportDisplay = true;
  118. },
  119. },
  120. };
  121. </script>
  122. <style lang="less" scoped>
  123. .btn {
  124. width: 106px !important;
  125. }
  126. </style>