relateStoreTable.vue 1.79 KB
<template>
  <div class="store-table">
    <el-table :data="merchantGoodsRefList" style="width: 100%" :header-row-style="headerRowStyle"
      header-cell-class-name="header-cell-class-name" border>
      <el-table-column align="center" width="60px" label="序号" type="index" />
      <el-table-column prop="merchantName" label="商户名称" align="center" />
      <el-table-column prop="merchantId" label="商户号" align="center" />
      <el-table-column prop="yqMerchantName" label="商户类型" align="center">
        <template slot-scope="scope">
          <span>{{merchantClassifyList.find(item => item.confId == scope.row.merchantType).confLabel}}</span>
        </template>
      </el-table-column>
      </el-table-column>
      <el-table-column label="操作" align="center" v-if="!isDetail" width="90">
        <template slot-scope="scope">
          <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { merchantClassifyList } from '@/common/constants.js'
export default {
  name: 'RelateProTable',
  props: {
    merchantGoodsRefList: {
      type: Array,
      default: () => { }
    },
    isDetail: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      merchantClassifyList
    }
  },
  methods: {
    handleDelete(item) {
      this.$emit('handleDelete', item)
    },
    headerRowStyle() {
      return {
        height: '40px',
        background: '#F2F4F7'
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.store-table {
  margin-top: 15px;
}

::v-deep .header-cell-class-name {
  height: 30px;
  background: #F2F4F7;
}

::v-deep .el-table th {
  padding: 0;
}

::v-deep .el-table__body-wrapper tr td {
  padding: 8px 0 !important;
}
</style>