<template>
  <div>
    <header v-loading="loading">
      <div class="flex title">
        <h3>流程名称: {{ detailMsg.lc_name }}</h3>
        <div>
          <span v-if="detailMsg.status == 1">未开始</span>
          <span v-if="detailMsg.status == 2">进行中</span>
          <span v-if="detailMsg.status == 3">已结束</span>
        </div>
      </div>
      <p>
        <span class="blank">应用对象:</span>
        {{ detailMsg.lc_yydx_name == "" ? "全部" : detailMsg.lc_yydx_name }}
      </p>
      <p><span class="blank">创建人:</span> {{ detailMsg.user_name }}</p>
      <p><span class="blank">创建时间:</span> {{ detailMsg.create_dateline }}</p>
      <p>
        <span class="blank">是否启用:</span>
        <el-switch :disabled="true" v-model="lc_status"></el-switch>
      </p>
    </header>
    <nav>
      <h3>审核步骤</h3>
      <el-table
        :data="lc_splc"
        style="width: 100%; min-height: 700px"
      >
        <el-table-column type="selection" align="center" width="55">
        </el-table-column>
        <el-table-column label="序号" type="index" width="80"></el-table-column>
        <el-table-column prop="dept_name" label="审核部门" width="200" />
        <el-table-column prop="user_name" label="审核人" width="150" />
      </el-table>   
    </nav>
  </div>
</template>
<script>
import { lcgl_detail } from "./api";
export default {
  data() {
    return {
      detailMsg: {},
      loading: false,
      lc_splc:[],
      lc_status: false,
    };
  },
  methods: {
    getDetail() {
      this.loading = true;
      let data = {
        site: "jnmf",
        lc_id: this.$route.params.id,
      };
      lcgl_detail(data).then((res) => {
        if (res.code == "1") {
          this.detailMsg = res.data.one_info;
          this.lc_status = res.data.one_info.lc_status === "1" ? true : false;
          this.lc_splc = JSON.parse(res.data.one_info.lc_splc);
          this.loading = false;
        }
      });
    },
  },
  mounted() {
    this.getDetail();
  },
};
</script>
<style lang="scss" scoped>
.flex {
  display: flex;
}
header {
  padding: 15px 20px;
  font-family: PingFangSC-Regular;
  box-sizing: border-box;
  color: #969696;
  border-bottom: 1px solid #ccc;
  font-size: 14px;
  .title {
    justify-content: space-between;
    h3 {
      color: #000;
      font-size: 16px;
    }
  }
}
nav {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}
.blank {
  display: inline-block;
  color: #000;
  width: 70px;
}
.imgs {
  img {
    width: 160px;
    height: 90px;
    background: rgba(0, 0, 0, 0);
    margin-right: 23px;
  }
}
</style>