companyShareholderTable.vue 2.54 KB
<template>
  <div>
    <a-card title="企业股东信息" :bordered="false">
      <a-table ref="table" size="middle" bordered  :columns="shareholderInfoData" :dataSource="stockholderList" :pagination="false" :loading="loading" :rowKey="record => record.id" @change="handleTableChange">
      </a-table>
    </a-card>
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { deleteStockholders } from '@/api/configApi'

export default {
  name: 'companyShareholderTable',
  mixins: [JeecgListMixin],
  props: {
    userType: {
      type: Number,
      default: null,
    },
    stockholderList:{
      type:Array,
      default:()=>{
        return [];
      }
    },
    customerNo:{
      type:String,
      default:''
    }
  },
  data () {
    return {
      shareholderInfoData: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          width: 60,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '股东名称',
          align: 'center',
          width: '100px',
          dataIndex: 'stockholderName'
        },
        {
          title: '持股比例',
          align: 'center',
          dataIndex: 'shareholdingRatio'
        },
        {
          title: '认缴出资额(万元)',
          align: 'center',
          dataIndex: 'capitalContributions'
        },
        {
          title: '认缴日期',
          align: 'center',
          dataIndex: 'subscriptionDate'
        },
      ],
      disableMixinCreated:true,
    }
  },
  methods: {
    handleAddModal (title) {
      this.$refs.companyShareholderModal.add(this.customerNo)
      this.$refs.companyShareholderModal.title = title ? title : '新增'
      this.$refs.companyShareholderModal.disableSubmit = false
    },
    handleEditModal (title,record) {
      this.$refs.companyShareholderModal.edit(record)
      this.$refs.companyShareholderModal.title = title ? title : '修改'
      this.$refs.companyShareholderModal.disableSubmit = false
    },
    companyShareholderModalOk () {
      this.$emit('editReload');
    },
    handleDelete(record){
      console.log(record)
      let _p = {'id':record.id}
      deleteStockholders(_p).then(res=>{
        if (res.status.statusCode == 0) {
          this.$emit('editReload');
          this.$message.success(res.status.statusReason)
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    },
  }
}
</script>
<style>
</style>