<template>
  <div class="app-container">
    <div style="width:100%">
      <task-info ref="taskInfo"></task-info>
      <el-divider  v-if="task.processStatus==0 || task.processStatus==1" content-position="left"><h3>任务提醒</h3></el-divider>
      <el-form label-width="150px" class="demo-ruleForm" label-position="left">
        <el-row v-if="task.processStatus==0">
          <el-col :span="24">
            <el-form-item label="发布有效期截止">
              {{task.expireTime}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="task.processStatus==1">
          <el-col :span="24">
            <el-form-item label="工期截止">
              {{task.deadline}}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-divider content-position="left"><h3>发布者信息</h3></el-divider>
      <el-form>
        <el-form-item label="公司名称" v-if="company.name !=null">
          {{company.name}}
        </el-form-item>
        <el-form-item label="公司简介" v-if="company.companyDesc !=null">
          {{company.companyDesc}}
        </el-form-item>
        <el-form-item label="公司联系人">
          {{company.contactName}}
        </el-form-item>
        <el-form-item label="联系电话">
          {{company.contactTel}}
        </el-form-item>
      </el-form>
    </div>
    <el-button type="warning"  class="btn-blue" @click="back" style="margin-right: 50%;margin-left: 50%; margin-top: 10px;">返回</el-button>
  </div>
</template>
<script>
  import {getById} from "@/api/crowdsource/crowdsource";
  import ProcessStatus from "@/views/components/enum/ProcessStatus";
  import TaskStatus from "@/views/components/enum/TaskStatus";
  import TesterType from "@/views/components/enum/TesterType";
  import TaskInfo from "../../../components/TaskInfo";

  export default {
    name: "crowdsourceClaimDetail",
    components: {TaskInfo, TesterType, ProcessStatus,TaskStatus, TaskInfo},
    data() {
      return {
        loading: false,
        task: {},
        publisher: {},
        company:{}
      }
    },
    methods: {
      back(){
          this.$store.dispatch("tagsView/delView", this.$route);
          this.$router.push({ path: "/crowdsource/myCrowdsource" });
        }
    },
    created() {
      this.id = this.$route.params && this.$route.params.id;
      getById(this.id).then(response => {
        if (response.task != null)
          this.task = response.task;
          this.$refs.taskInfo.setTask(this.task);
        if (response.company != null)
            this.company = response.company;
          if (response.publisher != null)
            this.publisher = response.publisher;
      })
    }
  }
</script>

<style scoped>
</style>
