<template>
  <div class="edu-training-edit">
    <DialogCom title="审核情况" @close="onHide" :visible.sync="isShow" width="960px">
      <div class="page-body">
        <el-form ref="form" :model="formData"  label-width="150px">
          <el-table  :data="formData">
            <el-table-column label="接待机构" align="center" prop="orgName" />
            <el-table-column label="审核状态" align="center" prop="status" width="80" >
              <template slot-scope="r">
                <dict-tag :options="dict.type.letter_status" :value="r.row.status"/>
              </template>
            </el-table-column>
            <el-table-column label="审核结果" align="center" prop="checkStatus" width="80">
              <template slot-scope="r">
                <span>{{r.row.checkStatus==null?"待审批":r.row.checkStatus===1?"通过":"不通过"}}</span>
              </template>
            </el-table-column>
            <el-table-column label="审核人" align="center" prop="checkUser" width="100"/>
            <el-table-column label="审核时间" align="center" prop="checkTime"/>
            <el-table-column label="审核意见" align="center" prop="checkRemark">
            <template slot-scope="r">
              <span class="text-style" :title="r.row.checkRemark">{{ r.row.checkRemark }}</span>
            </template>
            </el-table-column>
          </el-table>
        </el-form>
      </div>

      <div slot="footer" class="dialog-footer">
        <el-button @click="onHide">取 消</el-button>
<!--        <el-button type="primary" @click="submitForm" v-if="showAudit">确 定</el-button>-->
      </div>
    </DialogCom>
  </div>

</template>
<script>
import {mapState, mapMutations} from "vuex";
import {auditAllList} from "@/api/core/letter";
export default {
  components: {},
  data() {
    const params = this.$route.params;
    return {
      id: params ? params.id : null,
      isShow: false,
      formData: this.reset(),
    };
  },
  dicts: ['letter_status'],
  props: {},
  watch: {},
  created() {
  },
  computed: {
    ...mapState(["loginUser", "org",]),

  },
  methods: {
    ...mapMutations([]),
    reset(other = {}) {
      return {
        id: null,
        checkUser:null,
        checkTime:null,
        checkStatus:null,
        checkRemark:null,
        letterId:null,
        orgId:null,
        status:null,
        ...other,
      };
    },


    async show(id, other = {}) {
      this.isShow = true;
       auditAllList(id).then(response => {
          this.formData = response.data;
        });


    },
    onHide() {
      this.isShow = false;
      this.formData = this.reset();
      this.$emit('closed')
    },
  },
  mounted() {
  },
};
</script>
<style lang="scss">
.title {
  clear: both;
  margin: auto;
  text-align: center;
  color: black;
  font-size: xx-large;
  letter-spacing: 3px;
}
.text-style{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>


