<template>
  <div>
    <el-form :inline="true" class="border">
      <el-divider content-position="left" style="font-weight: bolder; font-size: 18px">基本信息</el-divider>
      <el-form-item label="所属单位:">
        <el-input v-model="addData.orgNo" clearable placeholder="请输入" disabled></el-input>
      </el-form-item>
      <el-form-item label="干扰源类型:">
        <el-select v-model="addData.loadType" clearable collapse-tags placeholder="请选择" disabled>
          <el-option
              v-for="item in interferenceType"
              :key="item.id"
              :label="item.name"
              :value="item.id"
          ></el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="干扰源用户名称:">
        <el-input v-model="addData.userName" clearable placeholder="请输入关键字" disabled></el-input>
      </el-form-item>

      <el-form-item label="建档时间">
        <el-date-picker
            value-format="yyyy-MM-dd HH:mm:ss"
            v-model="addData.recordTime"
            disabled
            type="datetime"
            placeholder="选择日期时间"
        ></el-date-picker>
      </el-form-item>

      <el-divider content-position="left" style="font-weight: bolder; font-size: 18px">
        入网评估报告上传
      </el-divider>
      <el-form-item class="item" label="文件名称:">
        <el-input v-model="documentName1" clearable placeholder="请输入填报名称" disabled></el-input>
      </el-form-item>

      <el-form-item>
        <el-button size="small" type="primary" icon="el-icon-download" @click="xz">下载</el-button>
      </el-form-item>
      <el-divider content-position="left" style="font-weight: bolder; font-size: 18px">
        入网评估结论填报
      </el-divider>

      <el-row>
        <el-form-item label="是否超标:" style="margin-top: 20px">
          <el-radio v-model="radio" label="0" disabled>是</el-radio>
          <el-radio v-model="radio" label="1" disabled>否</el-radio>
        </el-form-item>
      </el-row>

      <el-row>
        <el-form-item label="超标指标:" style="margin-top: 20px">
          <el-checkbox-group v-model="checkedCities"  disabled>
            <el-checkbox :disabled="eventDis" v-for="(city, ind) in cities" :label="city.id" :key="ind">
              {{ city.name }}
            </el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-row>

      <el-form-item label="计划采取措施:" style="margin-top: 20px">
        <el-select v-model="addData.measures" placeholder="请选择" disabled>
          <el-option
              v-for="item in takeMeasures"
              :key="item.id"
              :label="item.name"
              :value="item.id"
          ></el-option>
        </el-select>
      </el-form-item>
      <br/>
      <el-form-item label="入网详情:" style="margin-top: 20px">
        <el-input
            v-model="addData.rwxq"
            placeholder="请输入入网详情"
            type="textarea"
            style="width: 500px"
            disabled
        ></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {dicData} from "@/assets/commjs/dictypeData";
import {getLoadTypeUserById} from "@/api/Process-supervision/interferencemanagement/interferencemanagement";

export default {
  name: "loadTypeInit",

  props:{
    planId: {
      type: String, //类型
      required: true, //是否必须传入
    },
  },
  data() {
    return {
      checkedCities: [],
      cities: [],
      headers: {
        Authorization: window.sessionStorage.getItem('cntoken')
      },

      WordColor: JSON.parse(window.localStorage.echartsColor).WordColor,
      url: '',
      total: 0,
      pageSize: 20,
      pageNum: 1,
      vh: '',
      height: null,
      chooseAudit:false,
      auditUser:'',
      radio: '0',
      textarea: '评估入网报告缺少XX指标,请整改后提交。',

      //表单
      addData: {
        orgNo: JSON.parse(window.sessionStorage.getItem('Info')).deptId,
        loadType: '',
        userName: '',
        recordTime: '',
        measures:'',
        rwxq:''
      },

      documentName: '',
      documentName1: '',
      userNumber: '',

      //干扰源类型
      interferenceType: [],
      //计划采取措施
      takeMeasures: [],
      undocumentednonlinearData: [],
      multipleSelection: [],
      loadTypeId:[],
      multipleSelection1: [],
      fileList: [],
      fileList1: [],

      rwzt: [],
      auditUserList:[],//审核人下拉
      eventDis: false
    }
  },
  created() {

    this.rwzt = dicData('On-network_Status', [], 1)
    this.cities = dicData('Steady_Statis', [])

    this.takeMeasures = dicData('Plan_Take', [], 1)
    this.takeMeasures.shift()

    this.cities.shift()
    this.interferenceType = dicData('Interference_Source', [], 0)

    this.init()
  },
  mounted() {

  },

  methods: {

    init() {
      getLoadTypeUserById({
        id: this.planId
      }).then(res => {
        this.url = res.data.ifile == null ? '' : res.data.ifile
        this.addData.orgNo = res.data.orgName == null ? '' : res.data.orgName
        this.addData.loadType = res.data.loadType == null ? '' : res.data.loadType
        this.addData.userName = res.data.userName == null ? '' : res.data.userName
        this.addData.recordTime = res.data.recordTime == null ? '' : res.data.recordTime
        this.addData.measures = res.data.iplanStep == null ? '' : res.data.iplanStep
        this.addData.rwxq = res.data.idescription == null ? '' : res.data.idescription
        this.documentName1 = res.data.ifilePath == null ? '' : res.data.ifilePath
        this.radio = res.data.iisOverLimit == null ? '' : res.data.iisOverLimit.toString()
        this.checkedCities = res.data.ioverLimitTarget == null ? '' : res.data.ioverLimitTarget.split(',')
      })
    },
    xz() {
      window.open(this.url)
    },

  }
}
</script>

<style scoped>
.border {
  padding: 10px;
  margin: 10px;
  border: 1px solid black;
}
</style>
