<template>
  <div class="app-container">
    <div class="level-title">
      <h1>清单信息</h1>
    </div>
    <div>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="清单名称：" prop="NAME">
              <el-input v-model="form.NAME" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item prop="DEPARTMENT_ID" label="部门：">
              <SelectTree
                ref="deptTree"
                :clearable="false"
                :options="treeData"
                :props="defaultProps"
                v-model="form.DEPARTMENT_ID"
                placeholder="请选择整改部门"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="岗位：" prop="POST_ID">
              <el-select v-model="form.POST_ID" placeholder="请选择">
                <el-option v-for="item in postList" :key="item.POST_ID" :label="item.NAME" :value="item.POST_ID" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="负责人" prop="USER_IDS">
              <el-select v-model="form.USER_IDS" multiple placeholder="请选择">
                <el-option v-for="item in userList" :key="item.USER_ID" :label="item.NAME" :value="item.USER_ID" />
              </el-select>
            </el-form-item>

          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="排查类型：" prop="SCREENTYPE">
              <el-select v-model="form.SCREENTYPE" placeholder="请选择">
                <el-option v-for="item in screenTypeList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="排查周期：" prop="PERIOD">
              <el-select v-model="form.PERIOD" placeholder="请选择">
                <el-option v-for="item in periodList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="清单类型：" prop="TYPE">
              <el-select v-model="form.TYPE" placeholder="请选择">
                <el-option v-for="item in typeList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="form.TYPE=='listType0005'">
          <el-col :span="8">
            <el-form-item label="排查日期：" prop="CheckTime">

              <el-date-picker
                v-model="dates"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                class="filter-item"/>
            </el-form-item>
          </el-col>

        </el-row>
      </el-form>
    </div>
    <div class="level-line" />
    <div class="level-title">
      <h1>检查内容</h1>
      <div class="level-search">
        <el-input v-model="KEYWORDS" placeholder="请输入关键字" style="width:160px;margin-right:10px" size="mini" />
        <el-button type="primary" icon="el-icon-search" size="mini" @click="getRiskcheckitem">
          搜索
        </el-button>
      </div>
      <div class="level-btns">
        <el-button type="primary" size="mini" @click="showRisk">
          选择其他存在风险
        </el-button>
        <el-button type="success" size="mini" @click="dialogFormVisible = true">
          添加存在风险
        </el-button>
      </div>
    </div>
    <div>
      <el-table ref="multipleTable" :data="varList" border style="width: 100%">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column type="index" label="NO" width="55" align="center" />
        <el-table-column prop="RISKUNITNAME" label="风险点（单元）" width="180" />
        <el-table-column prop="PARTSNAME" label="辨识部位" width="180" />
        <el-table-column prop="RISK_DESCR" label="存在风险" width="300" />
        <el-table-column prop="DNAME5" label="风险分级" width="180" />
        <el-table-column prop="USERNAME" label="管控负责人" width="180" />
        <el-table-column prop="CHECK_CONTENT" label="检查内容" />
      </el-table>
    </div>
    <div class="ui-height" />
    <div class="ui-foot">
      <el-button type="success" @click="save">保 存</el-button>
      <el-button plain type="info" @click="back">返 回</el-button>
    </div>

    <!--选择其他存在风险-->

    <el-dialog :visible.sync="dialogTableVisible" title="选择其他存在风险">
      <div class="filter-container">
        <el-input v-model="OTHERKEYWORDS" placeholder="请输入关键字" class="filter-item" style="width: 150px;" />
        <div class="filter-group">
          <div class="filter-lable">
            部门：
          </div>
          <div class="filter-width">
            <SelectTree
              ref="deptTree_Select"
              :clearable="false"
              :options="treeData"
              :props="defaultProps"
              v-model="OTHERDEPARTMENT_ID"
              placeholder="请选择部门"
            />
          </div>
        </div>
        <div class="filter-group">
          <div class="filter-lable">
            类型：
          </div>
          <div class="filter-width">
            <el-select v-model="OTHERLEVELID" clearable placeholder="请选择">
              <el-option v-for="item in levelList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
            </el-select>
          </div>
        </div>
        <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="goRiskList">
          搜索
        </el-button>
        <el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="getReset">
          重置
        </el-button>
      </div>
      <el-table
        ref="multipleTableRisk"
        :data="riskList"
        :row-key="getRiskRowKey"
        border
        tooltip-effect="dark"
        style="width: 100%;">
        <el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
        <el-table-column type="index" label="NO" width="55" align="center" />
        <el-table-column prop="RISKUNITNAME" label="风险点（单元）" width="180" />
        <el-table-column prop="PARTSNAME" label="辨识部位" width="180" />
        <el-table-column prop="RISK_DESCR" label="存在风险" width="300" />
        <el-table-column prop="DNAME5" label="风险分级" width="180" />
        <el-table-column prop="USERNAME" label="管控负责人" width="180" />
        <el-table-column prop="CHECK_CONTENT" label="检查内容" />
      </el-table>
      <div class="page-btn-group">
        <div>
          <el-button type="success" @click="checkRisk">保 存</el-button>
          <el-button plain type="info" @click="closAddOtherPoint">返 回</el-button>
        </div>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="goRiskList" />
      </div>
    </el-dialog>

    <!--添加存在风险-->

    <el-dialog :visible.sync="dialogFormVisible" title="添加存在风险">
      <el-form ref="riskForm" :rules="riskRules" :model="riskForm" label-width="140px" style="padding:0 20px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="风险点（单元）" prop="RISK_UNIT_ID">
              <el-select v-model="riskForm.RISK_UNIT_ID" clearable placeholder="请选择">
                <el-option v-for="item in unitList" :key="item.RISKUNIT_ID" :label="item.DEPT_NAME + '-' + item.RISKUNITNAME" :value="item.RISKUNIT_ID" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="辨识部位" prop="IDENTIFICATION_ID">
              <el-select v-model="riskForm.IDENTIFICATION_ID" clearable placeholder="请选择">
                <el-option v-for="item in partsList" :key="item.IDENTIFICATIONPARTS_ID" :label="item.PARTSNAME" :value="item.IDENTIFICATIONPARTS_ID" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="存在风险：" prop="RISK_DESCR">
              <el-input id="RISK_DESCR" ref="RISK_DESCR" :rows="3" v-model="riskForm.RISK_DESCR" type="textarea" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="风险分级：" prop="LEVELID">
              <el-select v-model="riskForm.LEVELID" clearable placeholder="请选择">
                <el-option v-for="item in levelList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="管控措施" prop="MEASURES">
              <el-input id="MEASURES" ref="MEASURES" :rows="3" v-model="riskForm.MEASURES" type="textarea" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="管控部门：" prop="DEPARTMENT_ID">
              <SelectTree ref="deptTree" :clearable="false" :options="treeData" :props="defaultProps" v-model="riskForm.DEPARTMENT_ID" placeholder="请选择部门" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="管控责任人：" prop="USER_ID">
              <el-input v-model="riskForm.USER_ID" placeholder="请输入管控责任人" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="事故类型" prop="ACCIDENTS">
              <el-select v-model="riskForm.ACCIDENTS" multiple placeholder="请选择" @change="accidentsChange">
                <el-option v-for="item in accidentList" :key="item.BIANMA" :label="item.NAME" :value="item.BIANMA" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="应急处置措施" prop="EME_MEASURES">
              <el-input id="EME_MEASURES" ref="EME_MEASURES" :rows="3" v-model="riskForm.EME_MEASURES" type="textarea" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="检查内容：" prop="CHECK_CONTENT">
              <el-input id="CHECK_CONTENT" ref="CHECK_CONTENT" :rows="3" v-model="riskForm.CHECK_CONTENT" type="textarea" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="closEditRiskPoint">取 消</el-button>
        <el-button type="primary" @click="saveRiskPoint">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves' // waves directive
export default {

  components: { Pagination, SelectTree },
  directives: { waves },
  data() { // 验证时间非空
    var createCheckTime = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请选择排查日期')) // 回调函数
      } else {
        console.info(this.dates)
        if (this.dates == null || this.dates.length < 1) {
          callback(new Error('请选择排查日期'))
        }
      }
    }
    return {
      dialogFormVisible: false,
      dialogTableVisible: false,
      form: {
        LISTMANAGER_ID: '',
        NAME: '',
        PERIOD: '',
        TYPE: '',
        DEPARTMENT_ID: '',
        SCREENTYPE: '',
        POST_ID: '',
        USER_IDS: [],
        USER_ID: ''
      },
      riskForm: {
        RISKPOINT_ID: '',
        DEPARTMENT_ID: '',
        USER_ID: '',
        RISK_UNIT_ID: '',
        IDENTIFICATION_ID: '',
        RISK_DESCR: '',
        LEVELID: '',
        MEASURES: '',
        ACCIDENTS: '',
        ACCIDENTS_NAME: '',
        CHECK_CONTENT: '',
        EME_MEASURES: ''
      },
      riskRules: {
        DEPARTMENT_ID: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
        USER_ID: [{ required: true, message: '管控责任人不能为空', trigger: 'blur' }],
        RISK_UNIT_ID: [{ required: true, message: '风险点（单元）不能为空', trigger: 'blur' }],
        IDENTIFICATION_ID: [{ required: true, message: '辨识部位不能为空', trigger: 'blur' }],
        RISK_DESCR: [{ required: true, message: '存在风险不能为空', trigger: 'blur' }],
        LEVELID: [{ required: true, message: '风险分级不能为空', trigger: 'blur' }],
        MEASURES: [{ required: true, message: '管控措施不能为空', trigger: 'blur' }],
        EME_MEASURES: [{ required: true, message: '应急处置措施不能为空', trigger: 'blur' }],
        ACCIDENTS: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
        CHECK_CONTENT: [{ required: true, message: '检查内容不能为空', trigger: 'blur' }]
      },
      unitList: [],
      LISTMANAGER_ID: '',	// 主键ID
      KEYWORDS: '',
      msg: 'add',
      periodList: [],
      typeList: [],
      postList: [],
      userList: [],
      screenTypeList: [],
      defaultNodes: {},
      DEPARTMENT_ID: '',
      varList: [],
      otherIds: [],
      listItem: [],
      START_DATE: '',
      END_DATE: '',
      USER_IDS: '', // 负责人合集
      checked: false, // 全选框
      checkList: [], // 选中的检查项集合
      otherItemList: [], // 选中的其他存在风险集合
      treeData: [],

      partsList: [],
      dates: [], // 时间
      defaultProps: {
        value: 'id',
        children: 'nodes',
        label: 'name'
      },
      rules: {
        NAME: [{ required: true, message: '清单名称不能为空', trigger: 'blur' }],
        DEPARTMENT_ID: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
        POST_ID: [{ required: true, message: '岗位不能为空', trigger: 'blur' }],
        USER_IDS: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
        USER_ID: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
        SCREENTYPE: [{ required: true, message: '排查类型不能为空', trigger: 'blur' }],
        PERIOD: [{ required: true, message: '排查周期不能为空', trigger: 'blur' }],
        TYPE: [{ required: true, message: '清单类型不能为空', trigger: 'blur' }],
        CheckTime: [{ required: true, validator: createCheckTime, trigger: 'blur' }]
      },
      formLabelWidth: '120px',
      OTHERLEVELID: '',
      OTHERDEPARTMENT_ID: '',
      OTHERKEYWORDS: '',
      levelList: [],
      riskList: [],

      total: 0,
      listQuery: {
        page: 1,
        limit: 20
      },
      multipleSelection: [],
      accidentList: []
    }
  },
  watch: {

    'form.DEPARTMENT_ID': {
      handler(newVal, oldVal) {
        if (oldVal != null && oldVal != '') { // 编辑初始化时，不监听
          this.form.POST_ID = ''
          this.form.USER_IDS = []
          this.form.USER_ID = ''

          this.getPostList()
          this.getRiskcheckitem()
        }
      },
      immediate: false
    },
    'form.POST_ID': {
      handler(newVal, oldVal) {
        if (oldVal != null && oldVal != '') { // 编辑初始化时，不监听
          this.form.USER_IDS = []
          this.form.USER_ID = ''
          this.getRiskcheckitem()
        }
        this.getUserList()
      },
      immediate: false
    },
    'riskForm.RISK_UNIT_ID': {
      handler() {
        this.riskForm.IDENTIFICATION_ID = ''
        this.getPartList()
      }
    }

  },
  async created() {
    console.info(this.$parent.LISTMANAGER_ID)
    await this.getTreeList()
    this.getDict()
    if (this.$parent.LISTMANAGER_ID) {
      this.form.LISTMANAGER_ID = this.$parent.LISTMANAGER_ID
      this.getData()
    }
    // this.getList()
    // this.getUnitList()
  },
  methods: {

    save() {
      const _selectData = this.$refs.multipleTable.selection
      if (_selectData == null || _selectData.length == 0) {
        this.$message({
          message: '请选择检查内容...',
          type: 'error'
        })
        return false
      }
      this.$refs.form.validate(valid => {
        if (valid) {
          this.listLoading = true
          requestFN(
            '/listmanager/' + this.msg,
            {
              LISTMANAGER_ID: this.form.LISTMANAGER_ID,
              NAME: this.form.NAME,
              PERIOD: this.form.PERIOD,
              TYPE: this.form.TYPE,
              DEPARTMENT_ID: this.form.DEPARTMENT_ID,
              SCREENTYPE: this.form.SCREENTYPE,
              POST_ID: this.form.POST_ID,
              USER_IDS: this.form.USER_IDS ? this.form.USER_IDS.join(',') : '',
              USER_ID: this.form.USER_ID,
              LISTITEM: JSON.stringify(_selectData),
              START_DATE: this.dates != null ? this.dates[0] : null,
              END_DATE: this.dates != null ? this.dates[1] : null
            }
          ).then((data) => {
            this.listLoading = false
            this.dialogFormEdit = false
            this.$parent.activeName = 'List'
          }).catch((e) => {
            this.listLoading = false
          })
        } else {
          return false
        }
      })
    },
    // 编辑初始化
    getData() {
      requestFN(
        '/listmanager/goEdit',
        {
          LISTMANAGER_ID: this.form.LISTMANAGER_ID
        }
      ).then((data) => {
        this.form = Object.assign(this.form, data.pd) // copy obj
        const node = {}
        node.id = this.form.DEPARTMENT_ID
        this.$refs.deptTree.clearHandle()
        this.$nextTick(() => { // 此处使用这个可以等节点渲染后再获取节点
          this.$refs.deptTree.handleNodeClick(node)
        })
        console.info(this.form)
        this.dates.push(this.form.START_DATE ? this.form.START_DATE : '')
        this.dates.push(this.form.END_DATE ? this.form.END_DATE : '')
        this.varList = data.varList
      }).then((data) => {
        this.getPostList()
      }).catch((e) => {

      })
    },
    // 部门
    getTreeList() {
      return new Promise((resolve) => {
        requestFN(
          '/department/listTree',
          {}
        ).then((data) => {
          this.treeData = JSON.parse(data.zTreeNodes)
          resolve()
        }).catch((e) => {
        })
      })
    },
    getRiskRowKey(row) {
      return row.RISKCHECKITEM_ID
    },
    /*    handleSelectionChange(val) {
      // 这个val是所有已选中的json的数组
      this.multipleSelection = val
    },*/
    // 岗位
    getPostList() {
      requestFN(
        '/post/listAll',
        { DEPARTMENT_ID: this.form.DEPARTMENT_ID }
      ).then((data) => {
        this.postList = data.postList
      }).catch((e) => {
      })
    },
    // 用户
    getUserList() {
      requestFN(
        '/user/listAll',
        {
          DEPARTMENT_ID: this.form.DEPARTMENT_ID,
          POST_ID: this.form.POST_ID
        }
      ).then((data) => {
        this.userList = data.userList
      }).catch((e) => {
      })
    },

    // 获取辨识部位
    getPartList() {
      requestFN(
        '/identificationparts/listAll',
        {
          RISK_UNIT_ID: this.riskForm.RISK_UNIT_ID
        }
      ).then((data) => {
        this.partsList = data.partsList
      }).catch((e) => {
      })
    },
    // 获取部门/岗位检查项
    getRiskcheckitem() {
      console.info(3)
      if (this.form.DEPARTMENT_ID || this.form.POST_ID) {
        requestFN(
          '/riskcheckitem/itemlistAll',
          {
            KEYWORDS: this.KEYWORDS,
            otherIds: this.otherIds.join(','),
            DEPARTMENT_ID: this.form.DEPARTMENT_ID,
            POST_ID: this.form.POST_ID
          }
        ).then((data) => {
          // eslint-disable-next-line no-empty
          if (this.form.DEPARTMENT_ID != '') {
            for (const list of this.varList) {
              for (const list1 of data.varList) {
                if (list.RECORDITEM_ID === list1.RECORDITEM_ID) {
                  // eslint-disable-next-line no-undef
                  console.log('list', key)
                  // eslint-disable-next-line no-undef
                  console.log('list1', key)
                }
              }
            }
            console.log('这是this,varList' + [...this.varList])
            console.log('这是data,varList' + [...data.varList])
            this.varList = [...this.varList, ...data.varList]
          } else {
            this.varList = data.varList
          }
        }).catch((e) => {
        })
      }
    },
    // 添加存在风险
    saveRiskPoint() {
      this.$refs.riskForm.validate(valid => {
        if (valid) {
          this.listLoading = true
          requestFN(
            '/riskpoint/add',
            {
              RISKPOINT_ID: this.riskForm.RISKPOINT_ID,
              RISK_UNIT_ID: this.riskForm.RISK_UNIT_ID,
              IDENTIFICATION_ID: this.riskForm.IDENTIFICATION_ID,
              RISK_DESCR: this.riskForm.RISK_DESCR,
              LEVELID: this.riskForm.LEVELID,
              MEASURES: this.riskForm.MEASURES,
              CHECK_CONTENT: this.riskForm.CHECK_CONTENT,
              ACCIDENTS: this.riskForm.ACCIDENTS.join(','),
              ACCIDENTS_NAME: this.riskForm.ACCIDENTS_NAME.join(','),
              EME_MEASURES: this.riskForm.EME_MEASURES,
              DEPARTMENT_ID: this.riskForm.DEPARTMENT_ID,
              USER_ID: this.riskForm.USER_ID
            }
          ).then((data) => {
            this.listLoading = false
            this.closEditRiskPoint()
          }).catch((e) => {
            this.listLoading = false
          })
        } else {
          return false
        }
      })
    },
    // 关闭添加存在风险
    closEditRiskPoint() {
      this.dialogFormVisible = false
      this.riskForm = {
        RISKPOINT_ID: '',
        DEPARTMENT_ID: '',
        USER_ID: '',
        RISK_UNIT_ID: '',
        IDENTIFICATION_ID: '',
        RISK_DESCR: '',
        LEVELID: '',
        MEASURES: '',
        ACCIDENTS: '',
        ACCIDENTS_NAME: '',
        CHECK_CONTENT: '',
        EME_MEASURES: ''
      }
    },
    // 事故类型

    accidentsChange(val) {
      this.riskForm.ACCIDENTS_NAME = this.accidentList.filter((ele, index, arr) => {
        return val.some(item => { return item === ele.BIANMA })
      }).map(item => { return item.NAME })
    },
    // 选择其他存在风险（初始化列表）
    goRiskList() {
      requestFN(
        '/riskcheckitem/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
        {
          KEYWORDS: this.OTHERKEYWORDS,
          DEPARTMENT_ID: this.OTHERDEPARTMENT_ID,
          LEVELID: this.OTHERLEVELID
        }
      ).then((data) => {
        this.listLoading = false
        this.riskList = data.varList
        this.total = data.page.totalResult
      }).catch((e) => {
        this.listLoading = false
      })
    },
    // 风险项搜索条件重置
    getReset() {
      this.OTHERKEYWORDS = ''
      this.OTHERDEPARTMENT_ID = ''
      this.$refs.deptTree_Select.clearHandle()
      this.OTHERLEVELID = ''
      this.goRiskList()
    },
    // 选择其他风险
    checkRisk() {
      const _selectData = this.$refs.multipleTableRisk.selection
      // 检查内容添加 及 记录其他ID
      if (_selectData && _selectData.length) {
        _selectData.forEach(el => {
          var isContain = false
          for (var i = 0; i < this.varList.length; i++) {
            if (el.RISKCHECKITEM_ID == this.varList[i].RISKCHECKITEM_ID) {
              isContain = true
              break
            } else {
              isContain = false
            }
          }
          if (!isContain) {
            this.varList.push(el)
            this.otherIds.push(el.RISKCHECKITEM_ID)
          }
        })
      }

      this.$refs.multipleTableRisk.clearSelection()
      this.closAddOtherPoint()
    },
    // 展示其他存在风险
    showRisk() {
      this.dialogTableVisible = true
      this.goRiskList()
    },

    // 关闭选择其他风险
    closAddOtherPoint() {
      this.dialogTableVisible = false
      this.OTHERKEYWORDS = ''
      this.OTHERDEPARTMENT_ID = ''
      this.$refs.deptTree_Select.clearHandle()
      this.OTHERLEVELID = ''
    },
    // 返回列表
    back() {
      this.$parent.activeName = 'List'
      this.$parent.LISTMANAGER_ID = ''
    },
    // 数据字典
    getDict() {
      requestFN(
        '/dictionaries/getLevels',
        {
          DICTIONARIES_ID: '5a81e63ec0e94d919b3138bc01dbef6b'
        }
      ).then((data) => {
        this.levelList = data.list
      })
      requestFN(
        '/dictionaries/getLevels',
        {
          DICTIONARIES_ID: 'f60cf0e8315b4993b6d6049dd29f2ba5'
        }
      ).then((data) => {
        this.periodList = data.list
      })
      requestFN(
        '/dictionaries/getLevels',
        {
          DICTIONARIES_ID: '4a3d0d99b0ea4e268c11dd0b18866917'
        }
      ).then((data) => {
        this.typeList = data.list
      })
      requestFN(
        '/dictionaries/getLevels',
        {
          DICTIONARIES_ID: 'dc92de8a375c4b638b1b9f8d374e6426'
        }
      ).then((data) => {
        this.screenTypeList = data.list
      })

      requestFN(
        '/riskpoint/getPointSelect',
        {
        }
      ).then((data) => {
        this.unitList = data.unitList
      }).catch((e) => {
      })
      requestFN(
        '/dictionaries/getLevels',
        {
          DICTIONARIES_ID: 'cee1190ea96a4ca9b7bca81e11f0d0f8'
        }
      ).then((data) => {
        this.accidentList = data.list
      })
    }
  }
}
</script>

<style>
</style>
