<template>
    <div>
        <el-table border v-loading="loading" :data="list" >
            <el-table-column label="ID" align="center" prop="logsId" />
            <el-table-column label="模板CODE" align="center" prop="tempCode" />
            <el-table-column label="手机号" align="center" prop="phone" />
            <el-table-column label="短信内容" show-overflow-tooltip align="center" prop="content" />
            <el-table-column label="提交时间" align="center" prop="createTime" width="180">
            </el-table-column>
            <el-table-column label="发送时间" align="center" prop="sendTime" width="180">
            </el-table-column>
            <el-table-column label="回复内容" align="center" prop="replyContent" />
            <el-table-column label="状态" align="center" prop="status" width="120" >
                <template slot-scope="scope">
                    <el-tag prop="status" v-for="(item, index) in statusOptions"  :type="scope.row.status==1?'success':'danger'"  v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
                </template>
            </el-table-column>
            <el-table-column label="MID" show-overflow-tooltip align="center" prop="mid" />
            <el-table-column label="状态码" show-overflow-tooltip align="center" prop="stat" />
            
        </el-table>
        <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
        />

    </div>
</template>
  
<script>
import { listCompanySmsLogs, getCompanySmsLogs, delCompanySmsLogs, addCompanySmsLogs, updateCompanySmsLogs, exportCompanySmsLogs } from "@/api/company/companySmsLogs";

    export default {
        name: "customerVisit",
        data() {
            return {
                statusOptions:[],
                // 遮罩层
                loading: true,
                // 总条数
                total: 0,
                list: [],
                // 查询参数
                queryParams: {
                    pageNum: 1,
                    pageSize: 10,
                    customerId: null,
                },
            };
        },
        created() {
            this.getDicts("sys_company_sms_logs_status").then((response) => {
                this.statusOptions = response.data;
            });
        },
        methods: {
            getData(customerId){
                this.queryParams.customerId=customerId;
                this.queryParams.pageNum=1;
                this.getList();
            },
            getList() {
                this.loading = true;
                listCompanySmsLogs(this.queryParams).then(response => {
                    this.list = response.rows;
                    this.total = response.total;
                    this.loading = false;
                });
            },
        }
    };
</script>
<style lang="scss" scoped> 
</style>
 