<!-- 区域专员履历 -->
<template>
  <div>
    <dialog-edit :visible.sync="dialogVisible" :api="{}" :editModel="editModel" :form="form" :width="'30%'" :formRules="formRules"
                 :title="$t('cyjg.businessRegionInfo.commissionerEdit')" :autoSave="autoSave" @onSaved="onSaved"
                 labelWidth="100px">
      <el-form>
        <div v-for="(item, index) in areaCommissioners" :key="index">
          <div class="timeHead">
            <i class="el-icon-time"></i><span>{{item.assignedTime}}</span>
            <span style="float: right">{{$t('cyjg.businessRegionInfo.weihuren')}}{{item.modifyName}}</span>
          </div>
          <el-divider class="divider"></el-divider>
          <div class="textBody">
            <el-row v-for="(issue, ind) in item.commissionerDtoList" :key="ind" class="rowClass">
              <span>{{$t('cyjg.businessRegionInfo.areaCommissionerName')}}</span>{{issue.areaCommissionerName}}
            </el-row>
          </div>
        </div>
      </el-form>
    </dialog-edit>
  </div>
</template>
<script>
import { DialogEdit } from 'newepoch-components'
import BaseEdit from '@/pages/baseEditPage'
import businessRegionInfoApi from '@/api/cyjg/businessRegionInfoApi.js'
import * as format from '@/filters/index'
export default {
  extends: new BaseEdit(),
  name: 'commissionerEdit',
  components: {
    DialogEdit
  },
  props: {},
  data () {
    return {
      autoSave: false,
      areaCommissioners: []
    }
  },
  methods: {
    onSaved (data) {}
  },
  watch: {
    dialogVisible (val) {
      if (val) {
        businessRegionInfoApi.areaCommissionerRecordsApi.getList({ areaId: this.form.littleAreaKeyId }).then(res => {
          if (res && res.data) {
            this.areaCommissioners = res.data
            this.areaCommissioners.forEach(item => {
              item.assignedTime = format.formatDatetime(item.assignedTime)
              item.commissionerDtoList = item.commissionerDtoList
            })
          }
        })
      }
    }
  },
  computed: {
  }
}
</script>

<style scoped lang="scss" src="@/styles/cyjg/businessRegionInfo/commissionerEdit.scss">
</style>
