<template>
    <div>
        <el-table border v-loading="loading" :data="list" >
            <el-table-column label="ID" align="center" prop="logId" />
            <el-table-column label="公司名" align="center" prop="companyName" />
            <el-table-column label="客户名称" align="center" prop="wxClientName" />
            <el-table-column label="加微微信" align="center" prop="wxAccountName" />
            <el-table-column label="加微时间" align="center" prop="runTime" ></el-table-column>
            <el-table-column label="状态" align="center" prop="status" >
                <template slot-scope="scope">
                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
                </template>
            </el-table-column>
            <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
        </el-table>
        <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
        />

    </div>
</template>
  
<script>
import { listAddwx } from "@/api/company/addwx.js";

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