check.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <el-scrollbar class="collapseStyle" :height="tableHeight + 100">
  3. <el-scrollbar style="border: 1px solid #ebeef5" :height="tableHeight">
  4. <el-collapse accordion v-model="activeNames">
  5. <el-collapse-item
  6. v-for="(item, index) in materialsData"
  7. :key="index"
  8. :title="item.opName"
  9. :name="index"
  10. >
  11. <el-table :data="item.children" border>
  12. <el-table-column prop="checkName" label="点检项名称" />
  13. <el-table-column prop="checkCode" label="点检项编码" />
  14. <el-table-column prop="content" label="内容" />
  15. <el-table-column prop="result" label="结果">
  16. <template #default="scope">
  17. {{ scope.row.result == "1" ? "合格" : "不合格" }}
  18. </template>
  19. </el-table-column>
  20. <el-table-column prop="standard" label="标准值" />
  21. <el-table-column prop="upper" label="上限值" />
  22. <el-table-column prop="lower" label="下限值" />
  23. <el-table-column prop="created" label="录入时间" />
  24. </el-table>
  25. </el-collapse-item>
  26. </el-collapse>
  27. <Empty v-if="materialsData.length < 1" />
  28. </el-scrollbar>
  29. <Pagination
  30. position="right"
  31. :page="page"
  32. :limit="limit"
  33. :total="total"
  34. @pagination="getPagination"
  35. />
  36. </el-scrollbar>
  37. </template>
  38. <script lang="ts" setup>
  39. import { useProcessStore } from "@/store";
  40. import { checkRecordInfo } from "@/api/process/traceability";
  41. import { useDictionaryStore } from "@/store";
  42. const dictS = useDictionaryStore();
  43. const activeNames = ref([0]);
  44. const store = useProcessStore();
  45. const page = ref(1);
  46. const limit = ref(10);
  47. const total = ref(10);
  48. const materialsData = ref([]);
  49. const tableHeight = ref(null);
  50. const getPagination = async () => {
  51. const { data } = await checkRecordInfo({
  52. pageNo: page.value,
  53. pageSize: limit.value,
  54. seqNo: store.useSeqNo,
  55. workOrderCode: store.odersData.workOrderCode,
  56. });
  57. total.value = data.totalCount;
  58. materialsData.value = data.records;
  59. };
  60. //动态控制高度
  61. const setTableHeight = () => {
  62. tableHeight.value =
  63. Number(document.getElementById("tabBox").offsetHeight) - 110;
  64. };
  65. onMounted(() => {
  66. getPagination();
  67. setTableHeight();
  68. window.addEventListener("resize", setTableHeight);
  69. });
  70. onUnmounted(() => {
  71. window.removeEventListener("resize", setTableHeight);
  72. });
  73. </script>
  74. <style lang="scss" scoped></style>