<template>
  <el-dialog
    title="服务商合规体系查阅"
    :visible.sync="dialogVisible"
    width="60%"
    center
  >
    <div class="form-wrapper">
      <el-form ref="formRef" :model="formData" label-width="200px">
        <el-form-item label="员工规范手册：" prop="employeeCodeHandbook">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'employeeCodeHandbook')"
            :info="formData.employeeCodeHandbook"
            key="employeeCodeHandbook"
          />
        </el-form-item>
        <el-form-item label="内部控制制度手册：" prop="controlSystemManual">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'controlSystemManual')"
            :info="formData.controlSystemManual"
            key="controlSystemManual"
          />
        </el-form-item>
        <el-form-item label="内部审计文件：" prop="internalAuditDocuments">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'internalAuditDocuments')"
            :info="formData.internalAuditDocuments"
            key="internalAuditDocuments"
          />
        </el-form-item>
        <el-form-item label="合规管理制度：" prop="complianceMantSystem">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'complianceMantSystem')"
            :info="formData.complianceMantSystem"
            key="complianceMantSystem"
          />
        </el-form-item>
        <el-form-item
          label="反腐败及反贿赂管理制度："
          prop="antiCorrAndAntiBriManSys"
        >
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'antiCorrAndAntiBriManSys')"
            :info="formData.antiCorrAndAntiBriManSys"
            key="antiCorrAndAntiBriManSys"
          />
        </el-form-item>
        <el-form-item label="员工招待管理制度：" prop="employeeEntertainManSys">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'employeeEntertainManSys')"
            :info="formData.employeeEntertainManSys"
            key="employeeEntertainManSys"
          />
        </el-form-item>
        <el-form-item label="合规承诺函：" prop="complianceCommitLet">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'complianceCommitLet')"
            :info="formData.complianceCommitLet"
            key="complianceCommitLet"
          />
        </el-form-item>
        <el-form-item label="内部合规培训材料：" prop="internalComTrainMater">
          <uploadCom
            disabled
            @updateInfo="list => updateInfo(list, 'internalComTrainMater')"
            :info="formData.internalComTrainMater"
            key="internalComTrainMater"
          />
        </el-form-item>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import { getCompDocApi } from "@/api/servicePackageMonitoring/compliantUploads/index.js";
import uploadCom from "@/views/servicePackageMonitoring/components/uploadCom.vue";
export default {
  components: { ElImageViewer, uploadCom },
  data() {
    return {
      dialogVisible: false,
      formData: {
        deptId: "",
        documentId: "",
        employeeCodeHandbook: [],
        controlSystemManual: [],
        internalAuditDocuments: [],
        complianceMantSystem: [],
        antiCorrAndAntiBriManSys: [],
        employeeEntertainManSys: [],
        complianceCommitLet: [],
        internalComTrainMater: []
      }
    };
  },
  methods: {
    async getInfo(id) {
      const res = await getCompDocApi(id);
      if (res.data.data) {
        this.formData = res.data.data;
      }
      this.dialogVisible = true;
    }
  }
};
</script>

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