check.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="collapseStyle">
  3. <el-scrollbar style="border: 1px solid #ebeef5" :height="tableHeight">
  4. <el-collapse accordion v-model="activeNames">
  5. <el-collapse-item v-for="(item, index) in materialsData" :key="index" :title="item.opName" :name="index">
  6. <el-table :data="item.children" border>
  7. <el-table-column prop="checkName" label="点检项名称" />
  8. <el-table-column prop="checkCode" label="点检项编码" />
  9. <el-table-column prop="content" label="内容" />
  10. <el-table-column prop="result" label="结果">
  11. <template #default="scope">
  12. {{
  13. dictS.getLableByValue(
  14. "process_check_result",
  15. scope.row.disposalMeasures
  16. )
  17. }}
  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 position="right" :page="page" :limit="limit" :total="total" @pagination="getPagination" />
  30. </div>
  31. </template>
  32. <script lang="ts" setup>
  33. import { useProcessStore } from "@/store";
  34. import { checkRecordInfo } from "@/api/process/traceability";
  35. import { useDictionaryStore } from "@/store";
  36. const dictS = useDictionaryStore();
  37. const activeNames = ref([0]);
  38. const store = useProcessStore();
  39. const page = ref(1);
  40. const limit = ref(10);
  41. const total = ref(10);
  42. const materialsData = ref([]);
  43. const tableHeight = ref(null);
  44. const getPagination = async () => {
  45. const { data } = await checkRecordInfo({
  46. pageNo: page.value,
  47. pageSize: limit.value,
  48. seqNo: store.useSeqNo,
  49. workOrderCode: store.odersData.workOrderCode,
  50. });
  51. total.value = data.totalCount;
  52. materialsData.value = data.records;
  53. };
  54. //动态控制高度
  55. const setTableHeight = () => {
  56. tableHeight.value =
  57. Number(document.getElementById("tabBox").offsetHeight) - 70;
  58. };
  59. onMounted(() => {
  60. getPagination();
  61. setTableHeight();
  62. });
  63. </script>
  64. <style lang="scss" scoped></style>