detection.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true" :model="filters">
  6. <el-col :span="2">
  7. <el-form-item>
  8. <el-select v-model="filters.value" placeholder="请选择">
  9. <el-option label="编号" value="0"></el-option>
  10. <el-option label="名称" value="1"></el-option>
  11. </el-select>
  12. </el-form-item>
  13. </el-col>
  14. <el-form-item>
  15. <el-input v-model="filters.name" placeholder="请输入关键字进行搜索" style="width: 300px;" clearable></el-input>
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button type="primary" @click="getMoulds(filters.name)">查询</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-col>
  22. <!--列表-->
  23. <el-table
  24. :data="moulds"
  25. :height="tableHeight"
  26. highlight-current-row
  27. v-loading="listLoading"
  28. style="width: 100%;"
  29. >
  30. <el-table-column type="index" width="60"></el-table-column>
  31. <el-table-column prop="modelNo" label="模具编号" width="100" sortable></el-table-column>
  32. <el-table-column prop="modelName" label="模具名称" width="200" sortable></el-table-column>
  33. <el-table-column prop="equipmentNo" label="云模盒编号" width="200" sortable></el-table-column>
  34. <el-table-column prop="projectName" label="所属项目" width="200" sortable></el-table-column>
  35. <el-table-column prop="factoryName" label="制造工厂" width="140" sortable></el-table-column>
  36. <el-table-column prop="area" label="位置" width="200" sortable></el-table-column>
  37. <el-table-column prop="runTimes" label="运行次数" width="100" sortable></el-table-column>
  38. <el-table-column prop="ocCycle" label="每模平均周期" width="140" sortable></el-table-column>
  39. <el-table-column prop="hillNumber" label="电量" width="80" sortable></el-table-column>
  40. <el-table-column prop="state" label="当前状态" width="100" sortable></el-table-column>
  41. <el-table-column label="模具保养" width="100">
  42. <template slot-scope="scope">
  43. <a style="color: #409EFF; cursor: pointer" @click="toMaintenance(scope.row.id)">不需要</a>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <!--工具条-->
  48. <el-col :span="24" class="toolbar">
  49. <el-pagination
  50. @size-change="handleSizeChange"
  51. @current-change="handleCurrentChange"
  52. :page-sizes="[20 , 50 , 80 , 100 , 200]"
  53. :page-size="20"
  54. layout="total, sizes, prev, pager, next"
  55. :total="total"
  56. style="float:right;"
  57. ></el-pagination>
  58. </el-col>
  59. </section>
  60. </template>
  61. <script>
  62. import util from "../../common/js/util";
  63. export default {
  64. data() {
  65. return {
  66. moulds: [],
  67. filters: {
  68. name: "",
  69. value: "0"
  70. },
  71. listLoading: false,
  72. total: 0,
  73. tableHeight: 0,
  74. page: 1,
  75. size: 20
  76. };
  77. },
  78. methods: {
  79. //分页
  80. handleCurrentChange(val) {
  81. this.page = val;
  82. this.getMoulds();
  83. },
  84. handleSizeChange(val) {
  85. this.size = val;
  86. this.getMoulds();
  87. },
  88. toMaintenance(id) {
  89. this.$router.push({
  90. path: '/detectionDetail',
  91. query: {
  92. id: row.id
  93. }
  94. });
  95. //this.$router.push("/detection/" + id);
  96. },
  97. getMoulds(keyWord) {
  98. this.listLoading = true;
  99. if (keyWord == null) {
  100. var type = 0;
  101. } else {
  102. var type = this.filters.value;
  103. }
  104. var params = {
  105. pageNum: this.page,
  106. pageSize: this.size,
  107. projectId: -1,
  108. searchType: type,
  109. keyName: keyWord
  110. };
  111. this.http.post(
  112. this.port.mold.molds,
  113. params,
  114. res => {
  115. this.listLoading = false;
  116. if (res.code == "ok") {
  117. this.moulds = res.data.list;
  118. this.total = res.data.total;
  119. } else {
  120. this.$message({
  121. message: res.msg,
  122. type: "error"
  123. });
  124. }
  125. },
  126. error => {
  127. this.listLoading = false;
  128. this.$message({
  129. message: error,
  130. type: "error"
  131. });
  132. }
  133. );
  134. }
  135. },
  136. created() {
  137. let height = window.innerHeight;
  138. this.tableHeight = height - 210;
  139. },
  140. mounted() {
  141. this.getMoulds();
  142. }
  143. };
  144. </script>
  145. <style scoped>
  146. </style>