selectedShowTable.vue 2.06 KB
<!-- 被选中门店展示 -->
<template>
  <div>
    <el-table :data="tableData" style="width: 690px" border class="store-table">
      <el-table-column label="序号" align="center" type="index" width="64px" />
      <el-table-column prop="yqMerchantName" label="园区店名称" align="center" />
      <el-table-column prop="merchantName" label="4S店名称" align="center" />
      <el-table-column prop="merchantId" label="商户编号" align="center" />
      <el-table-column prop="userType" label="商户类型" align="center">
        <template slot-scope="scope">
          <span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span>
        </template>
      </el-table-column>
      <el-table-column label="删除" align="center">
        <template slot-scope="scope">
          <el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
        </template>
      </el-table-column>
      <el-table-column label="券码数量(张)" align="center" width="160px">
        <template slot-scope="scope">
          <slot name="num" :scope="{ row: scope.row, index: scope.$index }" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { userType, ghUserType } from '@/common/constants.js'
export default {
  name: 'SelectedShowTable',
  data() {
    return {
      // 基本数据
      baseData: {
        userTypeList: userType,
        ghUserTypeList: ghUserType
      }
    }
  },

  props: {
    tableData: {
      type: Array,
      default: () => []
    }
  },

  components: {},

  computed: {},

  mounted() { },

  methods: {
    handleDelete(row) {
      this.$confirm('是否确认删除该门店?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$emit('handleTableStoreDelete', row)
      }).catch(err => {
        console.log(err)
      })
    }
  }
}

</script>
<style scoped></style>