<template>
  <a-card :bordered="false" title="稽核业务" style="margin-top: 10px;">
    <a-form-model
      ref="ruleForm"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
    >
      <a-card :bordered="false" >
        <a-descriptions  bordered>
          <a-descriptions-item label="业务名称"><a @click="showCheckCheck">{{taskCheckInfo.taskName}}</a></a-descriptions-item>
          <a-descriptions-item label="开始时间">{{taskCheckInfo.taskStartTime}}</a-descriptions-item>
          <a-descriptions-item label="结束时间">{{taskCheckInfo.taskEndTime}}</a-descriptions-item>
          <a-descriptions-item label="业务状态">{{taskCheckInfo.taskStateText}}</a-descriptions-item>
          <a-descriptions-item label="业务描述" :span="2">{{taskCheckInfo.description}}</a-descriptions-item>
        </a-descriptions>
      </a-card>
    </a-form-model>
  </a-card>
</template>
<script>
import {JeecgListMixin} from "@/mixins/JeecgListMixin";
import {getAction} from "@api/manage";
export default {
  name: 'CompanyCheckList',
  props: {
    taskInfo: {
      type: Object,
      require: true
    }
  },
  data(){
    return{
      description: '稽核业务列表',
      labelCol: { span: 1 },
      wrapperCol: { span: 23 },
      url: {
        list: "/smsCheck/task/list",
      },
      taskCheckInfo:{},
      showType:'checktask'
    }
  },
  created() {

    this.init();
  },
  methods:{
    showTaskList(){
      let taskInfo = Object.assign({}, this.task);
      this.$emit("goCompany",taskInfo)
    },
    showCheckCheck(){
      this.taskInfo.checkinfo=this.taskCheckInfo
      this.$emit("goCheckCheck", this.taskInfo)

    },
    init(){
      let queryParam={
        id:this.taskInfo.info.taskId
      }
      getAction("/smsCheck/task/queryById",queryParam).then(resp=>{
        if(resp.success){
          this.taskCheckInfo=resp.result;
          this.taskCheckInfo.taskStateText=this.taskState_Text(this.taskCheckInfo.taskState)
        }
      })
    },
    taskState_Text(taskState){
      if (taskState===0){
        return "未开始"
      }else if (taskState===1){
        return "进行中"
      }else if (taskState===2){
        return "已结束"
      }
    }
  }
}

</script>