<template>
    <el-dialog  title="绑卡记录" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">

        <div >
            <el-table :data="records" stripe style="width: 100%;">
                <el-table-column prop="gmtCreated" label="签约时间" :formatter="dateFormat" ></el-table-column>
                <el-table-column prop="operaterDesc" label="备注" ></el-table-column>
            </el-table>
        </div>
    </el-dialog>
</template>

<script>
    import * as moment from "moment";

    export default {
        name: "ByhContactDialog",
        props: {
            dialogVisible: {
                type: Boolean
            },
            cardLogList: {
                type: Array
            },
        },
        data () {
            return {
                records:[],
            }
        },
        created() {
          this.records  = this.reverse(this.cardLogList);
        },
        methods: {

            /** 关闭处理 */
            handleClose () {
                this.visible = false
                setTimeout(() => {
                    this.$emit('update:dialogVisible', false)
                }, 100)
            },

            /*日期*/
            dateFormat: function (row, column) {
                var date = row[column.property]
                if (date == undefined) {
                    return ''
                }
                return moment(date).format("YYYY-MM-DD HH:mm:ss")
            },
            reverse(array){
                var newArr = [];
                for(var i=array.length-1;i>=0;i--){
                    newArr[newArr.length] = array[i];
                }
                return newArr;
            },

            submitMarket() {
              
            },

        },
     

        mounted: function () {
            this.submitMarket();
        },
    }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">

</style>