<!--查看任务-->
<template>
  <div>
    <dialog-edit
      :visible.sync="dialogVisible"
      :autoSave="false"
      :autoClose="false"
      :editModel="editModel"
      :form="{}"
      center
      :title="$t('coordManageMain.viewTask')">
        <data-table  :sourceData.sync="sourceData"
                     :pageAll="true"
                     @handleFilter="handleFilter"
                     :loadCount.sync="loadCount"
                     :queryParas="queryParas"
                     :api="taskApi"
                     loadPage="getDefaultDetail"
                     :showPage="true"
                     :columns="columns"
                     :menuFlag="false"
                     ref="dataTable">
            <template slot="feedbackQuestionContent" slot-scope="scope">
              <span-plus :index="scope.data.$index" :text="scope.data.row.feedbackQuestionContent"></span-plus>
            </template>
        </data-table>
    </dialog-edit>
  </div>
</template>
<script>
import { DialogEdit, authButton, DataTable, SpanPlus } from 'newepoch-components'
import coordManageApi from '@/api/assetoutfeedback/coordManage/coordManageApi'
import * as format from '@/filters/index'
import BasePage from '@/pages/baseEditPage'
export default {
  name: 'traceUserTaskPop',
  extends: new BasePage(),
  components: {
    DialogEdit,
    authButton,
    DataTable,
    SpanPlus
  },
  props: {
    editModel: {
      type: [String],
      default () {
        return 'E'
      }
    },
    form: {
      type: [Object],
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      columns: [
        {
          // 项目
          prop: 'projectName',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.project
        },
        {
          // 期数
          prop: 'periods',
          align: 'center',
          width: '50px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.periods
        },
        {
          // 付款确认书编号
          prop: 'assetCode',
          align: 'left',
          width: '170px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.payCode
        },
        {
          // 律所问题
          prop: 'feedbackQuestionContent',
          align: 'left',
          width: '150px',
          slot: true,
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.lawFirmQuest
        },
        {
          // 当前状态
          prop: 'questionStatus',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.currentStatus,
          format: (row) => {
            return format.formatDict(row.questionStatus, 'AUDIT_OUT_QUST_FEEDBACK_STATUS')
          }
        }
      ],
      sourceData: [],
      loadCount: 0,
      queryParas: {
        pageIndex: 0,
        pageSize: 10
      }
    }
  },
  mounted () {
    Object.assign(this.queryParas, this.form)
    this.$nextTick(() => {
      this.handleFilter()
    })
  },
  methods: {
    handleFilter () {
      this.loadCount = this.loadCount + 1
    }
  },
  computed: {
    taskApi () {
      return coordManageApi.traceTaskAssign
    }
  }
}
</script>
