InformationTable.vue 2.17 KB
<template>
  <div>
    <lb-table :column="InformationTable" border :key="key" :heightNum="390"  :pagination="false" heightNumSetting
    :data="tableData">
  </lb-table>
  </div>
</template>
<script>
export default {
  /**注册组件*/
  components: {},
  data () {
    return {
      key: 0,
      tableData:[{
          xm: '12',
          zjzl: '32',
          zjh: '123',
          fr: "213123",
        }],
      InformationTable:[
    {
          width: '60',
          renderHeader: (h, scope) => {
            return <i class="el-icon-plus pointer" onClick={() => { this.handleAdd() }} style="color:#409EFF"></i>
          },
          render: (h, scope) => {
            return (
              <i class="el-icon-minus pointer" onClick={() => { this.handleMinus(scope.$index, scope.row) }}></i>
            )
          }
        },
      {
        label: '身份证读卡器',
        align: 'center',
        render: (h, scope) => {
          return <el-button type="text" icon="el-icon-delete" onClick={() => { this.readClick(scope) }}>读取</el-button>
        }
      },
      {
        prop: "xm",
        label: "姓名/名称",
      },
      {
        prop: "zjzl",
        label: "证件种类",
      },
      {
        prop: "zjh",
        label: "证件号",
      },
      {
        prop: "fr",
        label: "法人",
      },
      {
        label: '操作',
        width: '80',
        align: 'center',
        fixed: 'right',
        render: (h, scope) => {
          return <el-button type="text" icon="el-icon-delete" onClick={() => { vm.editClick(scope) }}>修改</el-button>
        }
      }
    ]
    };
  },
  watch: {
    tableData: {
      handler (newValue, oldValue) {
        this.$emit('updateValue', newValue)
      },
      deep: true
    }
  },
  created(){},
  methods:{
    // 添加
    handleAdd () {
      this.tableData.push(
        {
          xm: '22',
          zjzl: '33',
          zjh: '44',
          fr: "55",
        }
      )
      this.key++
    },
    // 减
    handleMinus (index, row) {
      this.tableData.splice(index, 1)
    },
    // 身份证读取
    readClick(){},

    // 修改
    editClick(){},
  }
}
</script>
<style scoped lang='scss'>
</style>