<template>
  <div>
    <Breadcrumb :list="breadcrumbList" />
    <div class="table">
      <el-table :data="list">
        <el-table-column label="序号" type="index" width="80" />

        <el-table-column prop="name" label="上报人" />

        <el-table-column prop="mobile" label="上报人电话">
          <template slot-scope="scope">
            {{ $sensitive(scope.row.mobile, 3, 7) }}
          </template>
        </el-table-column>

        <el-table-column prop="agencyName" label="所属组织"> </el-table-column>

        <el-table-column prop="categoryName" label="事件类型" />

        <el-table-column prop="eventContent" show-overflow-tooltip label="事件描述" />

        <el-table-column prop="latestProcessingStatus" label="最新办理状态" />

        <el-table-column prop="latestProcessingTime" sortable label="最近办理时间" />
        <el-table-column prop="happenTime" sortable label="事件上报时间" />
        <el-table-column sortable label="详情">
          <template slot-scope="{ row }">
            <el-button type="text" @click="handleView(row)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <Pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
    <sjwjj :showDialog="showDialog" :id="rowId" @close="close" />
  </div>
</template>

<script>
import Breadcrumb from "@/views/dataBoard/satisfactionEval/components/Breadcrumb";
import Pagination from "@/views/dataBoard/satisfactionEval/components/Pagination";
import Title from "@/views/dataBoard/satisfactionEval/components/Title";
import sjwjj from "@/views/dataBoard/satisfactionEval/potentialPeople/details/sjwjj.vue";

export default {
  name: "dissatisfied",
  components: { Breadcrumb, Pagination, Title, sjwjj },
  data() {
    return {
      queryParams: {
        reportUserId: this.$route.query.reportUserId,
        pageNo: 1,
        pageSize: 10,
      },
      total: 0,
      breadcrumbList: [
        {
          path: "/dataBoard/satisfactionEval/index",
          name: "满意度评价",
        },
        {
          path: "/dataBoard/satisfactionEval/potentialPeople",
          name: "潜在不满意数",
        },
        {
          path: "",
          name: "事件未解决数",
        },
      ],
      list: [],
      showDialog: false,
      rowId: "",
    };
  },
  activated() {
    this.queryParams.reportUserId = this.$route.query.reportUserId;
    this.queryParams.pageNo = 1;
    this.getList();
  },
  methods: {
    search() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    getList() {
      this.$http.get("/governance/satisfactionDetailList/getEventUnSolvedByUserId?" + this.$paramsFormat(this.queryParams)).then(({ data: { data } }) => {
        this.list = data.list;
        this.total = data.total;
      });
    },
    handleView({ id }) {
      this.showDialog = true;
      this.rowId = id;
    },
    close() {
      this.showDialog = false;
    },
  },
};
</script>

<style scoped lang="scss">
@import "@/assets/scss/dataBoard/table.scss";

.table {
  margin-top: 40px;
}
</style>
