gaoluyang
昨天 2e77330d87341624c88301562fd137b58f9a101a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
  <div>
    <el-dialog
        v-model="dialogVisible"
        title="过程检验详情"
        width="70%"
        @close="closeDialog"
    >
      <el-descriptions :column="2" border>
        <el-descriptions-item label="检测日期">{{ detailData.checkTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="工序">{{ detailData.process || '-' }}</el-descriptions-item>
        <el-descriptions-item label="产品名称">{{ detailData.productName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="规格型号">{{ detailData.model || '-' }}</el-descriptions-item>
        <el-descriptions-item label="单位">{{ detailData.unit || '-' }}</el-descriptions-item>
        <el-descriptions-item label="数量">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
        <el-descriptions-item label="检测结果">{{ detailData.checkResult || '-' }}</el-descriptions-item>
        <el-descriptions-item label="检验员">{{ detailData.checkName || '-' }}</el-descriptions-item>
      </el-descriptions>
 
      <div style="margin-top: 20px">
        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
          <el-table-column label="指标" prop="parameterItem" />
          <el-table-column label="单位" prop="unit" />
          <el-table-column label="标准值" prop="standardValue" />
          <el-table-column label="内控值" prop="controlValue" />
          <el-table-column label="检验值" prop="testValue" />
        </el-table>
      </div>
 
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDialog">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
 
<script setup>
import {ref} from "vue";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
 
const emit = defineEmits(["close"]);
const dialogVisible = ref(false);
const detailData = ref({});
const tableData = ref([]);
const tableLoading = ref(false);
 
const openDialog = (row) => {
  detailData.value = row || {};
  dialogVisible.value = true;
  loadParams(row?.id);
};
 
const loadParams = (id) => {
  if (!id) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  qualityInspectParamInfo(id)
      .then((res) => {
        tableData.value = res.data || [];
      })
      .finally(() => {
        tableLoading.value = false;
      });
};
 
const closeDialog = () => {
  dialogVisible.value = false;
  tableData.value = [];
  emit("close");
};
 
defineExpose({
  openDialog,
});
</script>
 
<style scoped>
 
</style>