<template>
  <el-table v-loading="loading" :data="partList" :stripe="true" :show-overflow-tooltip="true">
    <el-table-column label="序号" align="center">
      <template scope="scope">
        <span>{{ scope.$index + 1 }}</span>
      </template>
    </el-table-column>
    <el-table-column label="商品名称" align="center" prop="name" width="200"/>
    <el-table-column label="规格" align="center" width="180"/>
    <el-table-column label="单位" align="center" width="150"/>
    <el-table-column label="原库位" align="center" width="150"/>
    <el-table-column label="账上数量" align="center" width="150"/>
    <el-table-column label="调拨数量" align="center" width="150"/>
    <el-table-column label="参考成本" align="center" width="150"/>
    <el-table-column label="结算单价" align="center" width="150"/>
    <el-table-column label="结算金额" align="center" width="150"/>
    <el-table-column label="备注" align="center" width="180"/>
    <el-table-column label="操作" fixed="right" align="center" width="150">
      <template v-slot="scope">
        <el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
        >删除
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  name: "StTable",
  props:{
    partList:{
      type: Array,
      defaultValue: false,
      required: true
    }
  },
  data() {
    return {
      loading: false,
      list: [],
    }
  },
  methods: {
    // 通知父组件，删除元素
    deleteItem(index){
      this.$emit("deleteItem", index)
    }
  }
}
</script>

<style scoped lang="scss">

</style>
