| | |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="productName" label="产品大类" min-width="160" /> |
| | | <el-table-column prop="model" label="型号名称" min-width="200" /> |
| | | <el-table-column prop="unit" label="单位" min-width="160" /> |
| | | <el-table-column prop="thickness" label="厚度" min-width="160" :formatter="formatThicknessTo15" /> |
| | | </el-table> |
| | | |
| | | <div class="mt-3 flex justify-end"> |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, onMounted, reactive, ref, watch, nextTick } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { productModelList } from '@/api/basicData/productModel' |
| | | import { productModelList } from '@/api/basicData/productModel.js' |
| | | |
| | | export type ProductRow = { |
| | | id: number; |
| | | productName: string; |
| | | model: string; |
| | | unit?: string; |
| | | thickness?: string; |
| | | }; |
| | | |
| | | const props = defineProps<{ |
| | |
| | | const multipleSelection = ref<ProductRow[]>([]); |
| | | const tableRef = ref(); |
| | | |
| | | // 表格展示时统一保留 15 位小数 |
| | | const formatThicknessTo15 = (_row: any, _column: any, cellValue: any) => { |
| | | if (cellValue === null || cellValue === undefined) return ""; |
| | | const s = String(cellValue).trim(); |
| | | if (s === "") return ""; |
| | | const n = Number(s); |
| | | if (Number.isNaN(n)) return s; |
| | | return n.toFixed(15); |
| | | }; |
| | | |
| | | function close() { |
| | | visible.value = false; |
| | | } |