<template>
  <div>
    <layout-card>
      <div id="printContent">
        <el-divider content-position="left">工程信息</el-divider>
        <el-descriptions border :column="2">
          <el-descriptions-item label="重点工程名称" :span="2">
            {{ data.info.OUTSOURCED_NAME }}
          </el-descriptions-item>
          <el-descriptions-item
            v-if="data.info.IS_CORP_TYPE === '0'"
            label="股份主管部门"
          >
            {{ data.info.MANAGER_DEPARTMENT_NAME }}
          </el-descriptions-item>
          <el-descriptions-item
            v-if="data.info.IS_CORP_TYPE === '0'"
            label="股份监管部门"
          >
            {{ data.info.DEPARTMENT_NAME }}
          </el-descriptions-item>
          <el-descriptions-item
            v-if="data.info.IS_CORP_TYPE === '0'"
            :span="2"
            label="辖区单位"
          >
            {{ data.info.JURISDICTION_UNIT_NAME }}
          </el-descriptions-item>
          <el-descriptions-item label="企业监督部门">
            <span v-if="data.info.Q_DEPARTMENT_NAME">
              {{ data.info.Q_DEPARTMENT_NAME }}
            </span>
            <span v-else>{{ data.info.Q_DEPARTMENT_NAME }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="企业辖区部门" :span="2">
            {{ data.info.INVOLVING_CORPS_DEPART_NAME }}
          </el-descriptions-item>
          <el-descriptions-item label="计划工期" :span="2">
            {{ data.info.STARTTIME }} 至 {{ data.info.ENDTIME }}
          </el-descriptions-item>
          <el-descriptions-item label="合同号" :span="2">
            {{ data.info.CONTRACT_NUM }}
          </el-descriptions-item>
          <el-descriptions-item label="施工相关方" :span="2">
            {{ data.info.UNITS_NAME }}
          </el-descriptions-item>
          <el-descriptions-item label="相关方单位工程负责人">
            {{ data.info.UNITS_PIC_NAME }}
          </el-descriptions-item>
          <el-descriptions-item label="相关方单位负责人手机">
            {{ data.info.UNITS_PHONE }}
          </el-descriptions-item>
          <el-descriptions-item label="状态">
            <span v-if="data.info.STATE === '0'">未开工</span>
            <span v-if="data.info.STATE === '1'">进行中</span>
            <span v-if="data.info.STATE === '2'">已结束</span>
            <span v-if="data.info.STATE === '-1'">开工申请中</span>
            <span v-if="data.info.STATE === '-2'">结束申请中</span>
          </el-descriptions-item>
        </el-descriptions>
        <el-divider content-position="left">处罚相关</el-divider>
        <el-descriptions border :column="2">
          <div v-for="(item, index) in data.punishThePerson" :key="index">
            <el-descriptions-item label="处罚人员部门">
              {{ item.punishname }}
            </el-descriptions-item>
            <el-descriptions-item label="处罚人员">
              {{ item.NAME }}
            </el-descriptions-item>
          </div>
        </el-descriptions>
      </div></layout-card
    >
  </div>
</template>

<script setup>
import { setOutsourcedGoEdit } from "@/request/keyprojects";
import { reactive } from "vue";
import { useRoute } from "vue-router";

const route = useRoute();
const data = reactive({
  info: {},
  punishThePerson: [],
  file: {},
});

const fnGetData = async () => {
  const resData = await setOutsourcedGoEdit({
    OUTSOURCED_ID: route.query.outsourcedId,
  });
  data.info = resData.pd;
  data.punishThePerson = resData.punishThePerson;
  data.file = resData.file9;
};
fnGetData();
</script>

<style scoped lang="scss"></style>
