Newer
Older
dcms_front / src / views / assessPost / components / caseList.vue
StephanieGitHub on 7 Nov 2019 3 KB MOD:监督员评价页面
<template>
  <div>
    <case-list
      v-loading="listLoading"
      :case-list="caseList"
      :total="total"
      :list-query="listQuery"
      :table-columns="tableColumns"
      @changeQuery="changeQuery"
      @addDetail="showDetail"/>
  </div>
</template>

<script>
import CaseList from '@/components/CaseCommon/caseList'
import CaseDetailRead from '@/components/CaseCommon/caseDetailRead'
import { seoSearch } from '@/api/seo/seo'
import SearchDiv from '@/views/seo/components/searchDiv'

export default {
  name: 'CaseList',
  components: { SearchDiv, CaseList, CaseDetailRead },
  data() {
    return {
      props: [], // 存储列表页传递的row
      type: '', // 查询类型
      editableTabsValue: 'listTab',
      editableTabs: [], // tab
      caseList: [], // 案卷列表// ,传递给子组件
      tableColumns: [
        {
          text: '案卷编号',
          value: 'caseid'
        },
        {
          text: '监督员',
          value: 'user'
        },
        {
          text: '发生地点',
          value: 'position'
        },
        {
          text: '所剩时间',
          value: 'remainingTime'
        },
        {
          text: '信息来源',
          value: 'sourceName'
        },
        {
          text: '案卷类别',
          value: 'eorcName'
        },
        {
          text: '节点名称',
          value: 'caseStateName'
        },
        {
          text: '问题描述',
          value: 'description'
        },
        {
          text: '业务单位',
          value: 'onedeptName'
        },
        {
          text: '大类',
          value: 'casetypeName'
        },
        {
          text: '小类',
          value: 'casetypeDetailName'
        }],
      listQuery: {
        personId: '',
        beginDate: '',
        endDate: '',
        offset: 1,
        limit: 10,
        sort: '',
        order: ''
      }, // 筛选条件
      total: 0,
      listLoading: true // 加载动画
    }
  },
  mounted() {
    this.listQuery = this.$route.query
    this.fetchData()
  },
  activated() {
    this.listQuery.personId = this.$route.query.personId
    this.listQuery.beginDate = this.$route.query.beginDate
    this.listQuery.endDate = this.$route.query.endDate
    this.type = this.$route.query.type
    this.fetchData()
  },
  methods: {
    // 获取数据
    fetchData() {
      this.listLoading = true
      seoSearch(this.listQuery).then(res => {
        this.caseList = res.data.rows
        this.total = parseInt(res.data.total)
        this.listLoading = false
      })
    },
    // 来自caselist组件的查询条件(分页)更改后的查询
    changeQuery(listQuery) {
      this.listQuery = listQuery
      this.fetchData()
    },
    // 来自业务查询条件更改后的查询
    searchForm(listQuery) {
      this.listQuery = listQuery
      this.fetchData()
    },
    // 查看详情
    showDetail(tabPane, row) {
      this.$router.push({ path: '/caseDetailRead/' + row.id })
    },
    // 业务提交后的刷新
    submitProcess(caseid) {
      this.fetchData()
    }
  }
}
</script>

<style>

</style>