yyb
6 天以前 90459eef4842501cbb2f14f715b737f071016997
src/views/basicData/product/ProductSelectDialog.vue
@@ -22,7 +22,7 @@
      <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">
@@ -43,13 +43,13 @@
<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<{
@@ -80,6 +80,16 @@
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;
}