Blame view

src/views/ywbl/fqsq/components/InformationTable.vue 3.05 KB
liangyifan committed
1 2
<template>
  <div>
任超 committed
3 4
    <lb-table :column="InformationTable" :maxHeight="300" heightNumSetting :pagination="false" :data="tableData">
    </lb-table>
liangyifan committed
5 6 7
  </div>
</template>
<script>
任超 committed
8
import { mapGetters } from 'vuex'
1  
liangyifan committed
9
export default {
任超 committed
10 11 12
  computed: {
    ...mapGetters(["dictData"]),
  },
1  
liangyifan committed
13 14
  data () {
    return {
任超 committed
15
      tableData: [],
任超 committed
16 17
      InformationTable: [
        {
liangyifan committed
18 19 20 21 22 23 24 25 26 27
          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>
            )
          }
        },
任超 committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
        {
          label: '身份证读卡器',
          align: 'center',
          render: (h, scope) => {
            return <el-button type="text" icon="el-icon-tickets" onClick={() => { this.readClick(scope) }}>读取</el-button>
          }
        },
        {
          prop: "xm",
          label: "姓名/名称",
          render: (h, scope) => {
            return (
              <el-input placeholder="姓名/名称" value={scope.row[scope.column.property]}
                onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
            )
          }
        },
        {
          prop: "zjzl",
          label: "证件种类",
          render: (h, scope) => {
            return (
              <el-select value={scope.row[scope.column.property]}>
                {
任超 committed
52
                  this.dictData && this.dictData['A30'].map(option => {
任超 committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
                    return (
                      <el-option label={option.label} value={option.value}></el-option>
                    )
                  })
                }
              </el-select>
            )
          }
        },
        {
          prop: "zjh",
          label: "证件号",
          render: (h, scope) => {
            return (
              <el-input placeholder="证件号" value={scope.row[scope.column.property]}
                onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
            )
          }
        },
        {
          prop: "fr",
          label: "法人",
          render: (h, scope) => {
            return (
              <el-input placeholder="法人" value={scope.row[scope.column.property]}
                onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
            )
          }
liangyifan committed
81
        }
任超 committed
82 83
      ]
    }
liangyifan committed
84
  },
liangyifan committed
85 86 87 88 89 90 91 92
  watch: {
    tableData: {
      handler (newValue, oldValue) {
        this.$emit('updateValue', newValue)
      },
      deep: true
    }
  },
任超 committed
93
  methods: {
liangyifan committed
94 95 96 97
    // 添加
    handleAdd () {
      this.tableData.push(
        {
任超 committed
98 99 100 101
          xm: '',
          zjzl: '',
          zjh: '',
          fr: ''
liangyifan committed
102 103 104 105 106 107 108 109 110
        }
      )
      this.key++
    },
    // 减
    handleMinus (index, row) {
      this.tableData.splice(index, 1)
    },
    // 身份证读取
任超 committed
111
    readClick () { },
liangyifan committed
112 113

    // 修改
任超 committed
114
    editClick () { },
liangyifan committed
115
  }
liangyifan committed
116 117 118
}
</script>
<style scoped lang='scss'>
任超 committed
119

liangyifan committed
120
</style>