<template>
    <div class="table">
        <el-table v-if="tableData.length > 0" :data="tableData" max-height="363px" height="363px">
            <el-table-column label="序号" type="index" width="80" />
            <el-table-column label="不满意事项类型" prop="scope" width="190" />
            <el-table-column label="不满意事项描述" prop="problemDesc" width="" />
            <el-table-column label="办理状态" prop="completeFlag" width="120" />
            <el-table-column label="是否回访" prop="isReturn" width="120" />
            <el-table-column label="操作" width="90" align="center">
                <template slot-scope="data">
                    <el-button type="text" @click="handleView(data.row)">查看</el-button>
                </template>
            </el-table-column>
        </el-table>

        <div v-else style="width: 100%; height: 363px; text-align: center; padding-top: 120px">
            <img width="268px" height="128px" src="~@/assets/images/overview/zanwu.png" />
            <div style="color: #fff">暂无数据</div>
        </div>
       
    </div>
</template>
  
<script>
export default {
    name: "community",
    components: {
    },
    data() {
        return {
            queryParams: {
                residList: [],
            },
            list: [],
            total: 0,
            rowId: null,
            showDialog: false,
            pageNo: 1,
            pageSize: 20
        };
    },
    activated() {
    },
    watch: {
       
    },
    mounted() { },
    props: {
     
        tableData: {
            type: Array,
            default: []
        }
    },
    methods: {
        getList() {
            let parm = {
                residList: [this.resiId],
                pageNo: this.pageNo,
                pageSize: this.pageSize
            }
            this.list = [];
            this.total = 0;
            // this.$emit("changeTotal", { name: 2, total: 0 });
            // 办理状态(-2：未知，-1：不接受回访，0：接受回访/待回访，1已回访)
            const completeFlags = {
                "-2": "未知",
                "-1": "不接受回访",
                0: "接受回访/待回访",
                1: "已回访",
            };
            // 省满意度列表
            this.$http.post("/actual/base/peopleRoomOverview/communitySatisfactionPageList", parm).then(({ data: res }) => {
                this.list = [{
                    scope: "服务态度",
                    problemDesc: "服务人员态度不好",
                    completeFlag: "未办理",
                    isReturn: "否"
                },
                {
                    scope: "处理速度",
                    problemDesc: "等待时间过长",
                    completeFlag: "已办理",
                    isReturn: "是"
                },
                {
                    scope: "设备问题",
                    problemDesc: "使用的机器经常故障",
                    completeFlag: "办理中",
                    isReturn: "否"
                },
                {
                    scope: "其他",
                    problemDesc: "场地不够干净",
                    completeFlag: "已办理",
                    isReturn: "是"
                }, {
                    scope: "服务态度",
                    problemDesc: "服务人员态度不好",
                    completeFlag: "未办理",
                    isReturn: "否"
                },
                {
                    scope: "处理速度",
                    problemDesc: "等待时间过长",
                    completeFlag: "已办理",
                    isReturn: "是"
                },
                {
                    scope: "设备问题",
                    problemDesc: "使用的机器经常故障",
                    completeFlag: "办理中",
                    isReturn: "否"
                },
                {
                    scope: "其他",
                    problemDesc: "场地不够干净",
                    completeFlag: "已办理",
                    isReturn: "是"
                }]
        //         this.list = res.data.list.map((item) => {
        //     return {
        //       ...item,
        //       status: item.status ? statusArr[item.status] : null,
        //       marktype: marktypes[item.marktype],
        //     };
        //   });
                this.total = this.list.length;
                  this.$emit("changeTotal", { name: 2, total: this.total });
            });
        },
        handleView(item) {
            this.rowId = item.id;
            this.showDialog = true;
        },
        close() {
            this.showDialog = false;
        },
        handleSizeChange(val) {
            this.pageSize = val;
            this.pageNo = 1;
            this.getList();
        },
        handleCurrentChange(val) {
            this.pageNo = val;
            this.getList();
        },
    },
};
</script>
  
<style scoped lang="scss"></style>
  