huminmin
2026-06-01 a563ea879ef5fb6897e76d2df661e465dce2ab9b
src/views/equipmentManagement/measurementEquipment/components/rowClickData.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
<template>
  <div>
    <el-dialog
        v-model="dialogFormVisible"
        title="检定校准记录"
        width="50%"
        @close="closeDia"
    >
      <PIMTable
          rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          @selection-change="handleSelectionChange"
          height="500"
          :isPagination="false"
      >
      </PIMTable>
      <pagination
          style="margin: 10px 0"
          v-show="total > 0"
          @pagination="paginationSearch"
          :total="total"
          :page="page.current"
          :limit="page.size"
      />
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
    <filePreview ref="filePreviewRef" />
  </div>
</template>
<script setup>
import {ref} from "vue";
import filePreview from '@/components/filePreview/index.vue'
import {ledgerRecordListPage} from "@/api/equipmentManagement/calibration.js";
import Pagination from "@/components/PIMTable/Pagination.vue";
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const currentId = ref('')
const selectedRows = ref([]);
const filePreviewRef = ref()
const tableColumn = ref([
  {
    label: "检定日期",
    prop: "recordDate",
    width: 130,
  },
  {
    label: "计量器具编号",
    prop: "code",
    width: 150,
  },
  {
    label: "计量器具名称",
    prop: "name",
    width: 200,
  },
  {
    label: "规格型号",
    prop: "model",
    width:200
  },
  {
    label: "有效期",
    prop: "valid",
    width: 100,
  },
  {
    label: "录入人",
    prop: "userName",
  },
  {
    label: "录入日期",
    prop: "entryDate",
    width: 130,
  },
]);
const page = reactive({
  current: 1,
  size: 100,
});
const total = ref(0);
const tableData = ref([]);
const tableLoading = ref(false);
// æ‰“开弹框
const openDialog = (row,type) => {
  dialogFormVisible.value = true;
  currentId.value = row.id;
  getList()
}
const paginationSearch = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
const getList = () => {
  let query = {
    measuringInstrumentLedgerId:currentId.value,
    current : page.current,
    size : page.size
  }
  ledgerRecordListPage(query).then(res => {
    tableData.value = res?.data?.records || [];
    total.value = res?.data?.total;
  })
}
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  selectedRows.value = selection;
};
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
};
defineExpose({
  openDialog,
});
</script>