index.vue 3.41 KB
<template>
<div>
  <el-table :data="tableData" style="width: 100%" border height="220px">
    <el-table-column prop="index" label="序号" width="80"></el-table-column>
    <el-table-column prop="productNumber" label="企业商品编号" width="150"></el-table-column>
    <el-table-column prop="productName" label="商品企业商品名称" width="180"></el-table-column>
    <el-table-column prop="description" label="企业商品描述" width="150"></el-table-column>
    <el-table-column prop="code" label="条码" width="150"></el-table-column>
    <el-table-column prop="unit" label="计量单位" width="100">
      <template slot-scope="scope">
        <span>{{ scope.row.unit }}</span>
        <i class="el-icon-top" style="margin-left: 5px;"></i>
      </template>
    </el-table-column>
    <el-table-column prop="currency" label="币制" width="80"></el-table-column>
    <el-table-column prop="quantity" label="数量" width="80"></el-table-column>
    <el-table-column prop="unitPrice" label="单价" width="100"></el-table-column>
    <el-table-column prop="totalPrice" label="总价" width="100"></el-table-column>
    <el-table-column prop="notes" label="备注" width="300"></el-table-column>
    <el-table-column label="操作" width="100" fixed="right">
      <template slot-scope="scope">
        <el-link type="primary" @click="handleExpand(scope.$index)">展开</el-link>
      </template>
    </el-table-column>
  </el-table>
</div>
</template>

<script>
export default {
  name: "ProductDetailTable",
  data() {
    return {
      tableData: [
        {
          index: 1,
          productNumber: "6704200000",
          productName: "真人发发夹",
          description: "测试内容",
          code: "485607096",
          unit: "↑",
          currency: "美元",
          quantity: 1,
          unitPrice: "645.78",
          totalPrice: "645.78",
          notes: "山东电子口岸已写,加签后上传"
        },
        {
          index: 2,
          productNumber: "6704200000",
          productName: "真人发发夹",
          description: "测试内容",
          code: "2145860720",
          unit: "↑",
          currency: "美元",
          quantity: 2,
          unitPrice: "645.78",
          totalPrice: "645.78",
          notes: "山东电子口岸已写,加签后上传"
        },
        {
          index: 3,
          productNumber: "6704200000",
          productName: "真人发发夹",
          description: "测试内容",
          code: "2145860720",
          unit: "↑",
          currency: "美元",
          quantity: 3,
          unitPrice: "645.78",
          totalPrice: "645.78",
          notes: "山东电子口岸已写,加签后上传"
        },
        {
          index: 4,
          productNumber: "6704200000",
          productName: "真人发发夹",
          description: "测试内容",
          code: "2145860720",
          unit: "↑",
          currency: "美元",
          quantity: 1,
          unitPrice: "635.78",
          totalPrice: "635.78",
          notes: "山东电子口岸已写,加签后上传"
        }
        // 更多数据项...
      ]
    };
  },
  methods: {
    handleExpand(index) {
      console.log(`展开第 ${index + 1} 行数据`);
    }
  }
}
</script>

<style scoped lang="scss">
.el-table {
  font-size: 14px;
  //border: 1px solid red;
  //height: 180px;
  overflow: auto;
}
.el-icon-top {
  color: #409eff;
  font-size: 12px;
}
</style>