<template>
    <el-dialog class="client-data-dialog" title="跟踪信息" width="60%" :visible.sync="visible" :before-close="handleClose">
        <el-table :data="loanCollectLog" stripe style="width: 100%">
            <el-table-column prop="gmtCreated" label="操作时间" :formatter="dateFormat"></el-table-column>
            <el-table-column prop="operater" label="跟踪人员" ></el-table-column>
            <el-table-column prop="operaterDesc" label="跟踪信息"></el-table-column>
        </el-table>
        <div slot="footer">
            <el-button type="primary" @click="handleClose">确 定</el-button>
        </div>
    </el-dialog>
</template>

<script>
    import * as moment from "moment";
    export default {
        name: "LoanCollectLogDailog",
        props: {
            dialogVisible: {
                type: Boolean
            },
            collNo:{
                type:String,
            },
        },
        data() {
            return {
                ui: {
                    submitLoading: false
                },
                visible: this.$props.dialogVisible,
                ruleForm: {
                    collNo: '',
                },
                loanCollectLog:[],
            }
        },

        created() {
            this.ruleForm = {
                collNo: this.collNo,
            }
        },

        mounted() {
            this.$$get(`/collect/getLogList/${this.ruleForm.collNo}`)
                .then(res => {
                    if (res.data.code < 1)
                        throw res.data.msg;
                    this.loanCollectLog = res.data.data;
                })
                .catch(err => this.$$msg.err(err));
        },

        methods: {
            /*日期*/
            dateFormat: function (row, column) {
                var date = row[column.property]
                if (date == undefined) {
                    return ''
                }
                return moment(date).format('YYYY-MM-DD hh:mm:ss')
            },

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

        }
    }
</script>

<style scoped>

</style>