<template>
  <div class="app-container">
    <div class="title-container">
      <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
    </div>
    <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
      <template slot="left">
        <el-input v-model="listQuery.name" placeholder="项目名称" clearable
          style="margin-left: 20px;width: 270px;float: left;">
        </el-input>
        <el-input v-model="listQuery.orderId" placeholder="项目编号" clearable
          style="margin-left: 20px;width: 200px;float: left;">
        </el-input>
        <el-input v-model="listQuery.clientManager" placeholder="客户经理" clearable
          style="margin-left: 20px;width: 100px;float: left;">
        </el-input>
        <el-input v-model="listQuery.principal" placeholder="项目负责人" clearable
          style="margin-left: 20px;width: 150px;float: left;">
        </el-input>
        <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索
        </el-button>
        <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
        </el-button>
      </template>
      <parentTable  :data="pageData.records" slot="table" style="width: 100%;">
        <el-table-column label="业务类型" align="center">
          <template slot-scope="{row}">
            <span>{{ businessTypeAlias(row.businessType) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="订单名称" align="center" width='300' show-overflow-tooltip >
          <template slot-scope="{row}">
            <span>{{ row.majorName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="订单号" align="center">
          <template slot-scope="{row}">
            <span>{{ row.orderId }}</span>
          </template>
        </el-table-column>
        <el-table-column label="处理人" align="center">
          <template slot-scope="{row}">
            <span>{{ row.handler }}</span>
          </template>
        </el-table-column>
        <el-table-column label="处理节点" align="center">
          <template slot-scope="{row}">
            <span>{{ row.nodeName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="处理时间" align="center">
          <template slot-scope="{row}">
            <span>{{ row.finishTime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="处理时长" align="center">
          <template slot-scope="{row}">
            <span>{{ row.handingTime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="节点状态" align="center">
          <template slot-scope="{row}">
            <span>{{ nodeStateAlias(row.state)}}</span>
          </template>
        </el-table-column>
        <el-table-column label="处理意见" align="center" show-overflow-tooltip>
          <template slot-scope="{row}">
            <span>{{ row.comments==null?'-':row.comments}}</span>
          </template>
        </el-table-column>
      </parentTable>
    </y-page-list-layout>
  </div>
</template>
<script>
import YPageListLayout from '@/components/YPageListLayout'
import Breadcrumb from '@/components/Breadcrumb'

export default {
  name: 'doneList',
  components: {
    Breadcrumb,
    YPageListLayout,
  },
  filters: {
    
  },
  data() {
    return {
      pageData: { records: [] },
      listQuery: {
        page: 1,
        size: 10,
        descs: 'id',
      },
    }
  },
  created() {
    this.getList();
  },
  methods: {
  
    resetSearch() {
      this.$router.push({ query: {} });
      this.listQuery = {
        current: 1,
        size: 10,
        descs: 'id',
      }
      this.getList()
    },
   
    searchList() {
      // 重置分页
      this.listQuery.page = 1
      this.listQuery.size = 10
      this.getList()
    },
    getList() {
      this.$api.workNodeTaskRecord.majorTaskDoneList(Object.assign({}, this.listQuery)).then(res=>{
        if (res.code ===200){
            this.pageData = res.data;
        }
      })
    },
    aliasProductionType(code){
        if (code === 'STATEMENT'){
            return '价值意见书';
        }
        if (code === 'LETTER'){
            return '复评函';
        }
        return '报告';
    },
    businessTypeAlias(code){
      return '大中型'
    },
    nodeStateAlias(code){
      if (code === 'PASS'){
          return '提交';
      }
      if (code === 'REVERSE'){
        return '退回';
      }
      return '-'
    }
  },
  
}
</script>
<style lang="scss" scoped>

</style>
