<!--尽调反馈子组件-->
<template>
  <div class="outsideManageSub tab-margin">
    <el-row :gutter="8">
      <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" body-style="height:100px;padding-top: 10px;padding-left: 10px;">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.baseAssetFeedback')}}</span>
            </div>
            <div>
              <el-col :span="11">
                <div class="div-align">
                  <span class="text-large show-cursor" @click="toFeedBackMain('0')">{{$t('outsideManageMain.newFeedback')}}</span>
                </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="11">
                <span class="body-ul">{{$t('outsideManageMain.supplementAudit')}}</span>
                    <div class="div-align">
                        <span class="num-large show-cursor" @click="batchDeal">{{feedbackInfo.sampleSupplement?feedbackInfo.sampleSupplement:0}}</span>
                        <span class="num-text">{{$t('outsideManageMain.count')}}</span>
                    </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" body-style="height:100px;padding-top: 10px;padding-left: 10px;">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title show-cursor">{{$t('outsideManageMain.confirmFeedback')}}</span>
            </div>
            <div>
              <el-col :span="11">
                <span class="body-ul">{{$t('outsideManageMain.originAudit')}}</span>
                    <div class="div-align">
                        <span class="num-large  show-cursor" @click="toFeedBackMain('1')">{{feedbackInfo.confirmOriginal?feedbackInfo.confirmOriginal:0}}</span>
                        <span class="num-text">{{$t('outsideManageMain.count')}}</span>
                    </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="11">
                <span class="body-ul">{{$t('outsideManageMain.supplementAudit')}}</span>
                    <div class="div-align">
                        <span class="num-large show-cursor" @click="showConfirmationFile">{{feedbackInfo.confirmSupplement?feedbackInfo.confirmSupplement:0}}</span>
                        <span class="num-text">{{$t('outsideManageMain.count')}}</span>
                    </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" body-style="height:100px;padding-top: 10px;padding-left: 10px;">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.otherFeedback')}}</span>
            </div>
            <div>
              <el-col :span="11">
                <span class="body-ul">{{$t('outsideManageMain.originAudit')}}</span>
                    <div class="div-align">
                        <span class="num-large  show-cursor" @click="toFeedBackMain('2')">{{feedbackInfo.otherOriginal?feedbackInfo.otherOriginal:0}}</span>
                        <span class="num-text">{{$t('outsideManageMain.count')}}</span>
                    </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="11">
                <span class="body-ul">{{$t('outsideManageMain.supplementAudit')}}</span>
                    <div class="div-align">
                        <span class="num-large show-cursor" @click="showOtherFile">{{feedbackInfo.otherSupplement?feedbackInfo.otherSupplement:0}}</span>
                        <span class="num-text">{{$t('outsideManageMain.count')}}</span>
                    </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" body-style="height:100px;padding-top: 10px;padding-left: 10px;">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.importListDown')}}</span>
            </div>
            <div>
              <el-col :span="11">
                <div class="div-align text-large show-cursor" @click="urgentDownload">
                  <el-col :span="24">
                    <span >{{$t('outsideManageMain.urgentList')}}</span>
                    <span class="iconfont iconxiazai2 icon-size"></span>
                  </el-col>
                </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="11">
                <div class="div-align text-large show-cursor" @click="replenishDownload">
                  <el-col :span="24">
                    <span >{{$t('outsideManageMain.replenishList')}}</span>
                    <span class="iconfont iconxiazai2 icon-size"></span>
                  </el-col>
                </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" class="show-cursor" body-style="height:120px" @click.native="showSampleDownload">
            <div>
              <el-col :span="13">
                <div class="div-align">
                  <span class="text-large1">{{$t('outsideManageMain.baseData')}}<br>{{$t('outsideManageMain.batchDownload')}}
                  </span>
                </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="9">
                <div class="div-align flex-md">
                  <i class="text-large1 iconfont iconcaozuo icon-large"></i>
                </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" class="show-cursor" body-style="height:120px" @click.native="showConfirmationDownload">
              <div>
              <el-col :span="13">
                <div class="div-align">
                  <span class="text-large1">{{$t('outsideManageMain.confirmData')}}<br>{{$t('outsideManageMain.batchDownload')}}
                  </span>
                </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="9">
                <div class="div-align flex-md">
                  <i class="text-large1 iconfont iconcaozuo icon-large"></i>
                </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="el-col-margin">
        <el-card shadow="never" class="show-cursor" body-style="height:120px" @click.native="showOtherDownload">
              <div>
              <el-col :span="13">
                <div class="div-align">
                  <span class="text-large1">{{$t('outsideManageMain.otherData')}}<br>{{$t('outsideManageMain.batchDownload')}}
                  </span>
                </div>
              </el-col>
              <el-col :span="2">
                <div class="body-devide-line"></div>
              </el-col>
              <el-col :span="9">
                <div class="div-align flex-md">
                  <i class="text-large1 iconfont iconcaozuo icon-large"></i>
                </div>
              </el-col>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8" class="el-col-margin">
        <el-card shadow="never" body-style="height:210px;">
            <div slot="header" class="card-btn">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.sampleListProgress')}}</span>
                <auth-button type="primary"
                            :label="$t('outsideManageMain.sampleListDown')"
                            class="header-btn1 iconfont iconxiazai1"
                            size="medium"
                            @click="sampleDownload"></auth-button>
            </div>
            <div>
              <ul class="body-ul">
                <li>
                  <span>{{$t('outsideManageMain.thisPeriodsTotal')}}</span>
                  <span class="body-num-float">{{feedbackInfo.thisPeriodsTotal?feedbackInfo.thisPeriodsTotal:0}}</span>
                </li>
                <li>
                  <span>{{$t('outsideManageMain.auditedTotal')}}</span>
                  <span class="body-num-float">{{feedbackInfo.auditedTotal?feedbackInfo.auditedTotal:0}}</span>
                </li>
                <li class="body-li-margin">
                  <span>{{$t('outsideManageMain.receivedTotal')}}</span>
                  <span class="body-num-float">{{feedbackInfo.receivedTotal?feedbackInfo.receivedTotal:0}}</span>
                </li>
                <div class="divide-div"></div>
                <li class="body-li-margin audited-total-text">
                  <span style="font-size:20px">{{$t('outsideManageMain.canAuditedTotal')}}</span>
                  <span class="body-num-float">{{feedbackInfo.canAuditedTotal?feedbackInfo.canAuditedTotal:0}}</span>
                </li>
              </ul>
            </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="16" :lg="16" class="el-col-margin">
        <el-card shadow="never" body-style="height:210px">
          <div slot="header">
            <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
            <span class="header-title">{{$t('outsideManageMain.confirmAndOtherProgress')}}</span>
          </div>
          <data-table :sourceData="sourceData1"
                      class="table-margin1"
                      :columns="columns1"
                      :showPage="false"
                      height="192px">
          </data-table>
        </el-card>
      </el-col>
      <el-col :span="24" class="el-col-margin">
        <el-card shadow="never" body-style="height:210px">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.baseAssetProgress')}}</span>
            </div>
            <data-table :sourceData="sourceData2"
                        class="table-margin"
                        :columns="columns2"
                        :showPage="false"
                        height="192px">
                <template slot="generatedMail" slot-scope="scope">
                  <auth-button :title="$t('outsideManageMain.generatedMail')" class="iconCircle marginLeft" icon="iconfont iconxiazai2" v-if="scope.data.$index!==sourceData2.length-1" @click="generatedMail(scope.data.row,'1001')"></auth-button>
                </template>
            </data-table>
        </el-card>
      </el-col>
      <el-col :span="24" class="el-col-margin">
        <el-card shadow="never" body-style="height:210px">
            <div slot="header">
                <span class="iconfont iconcompanylist header-icon-color header-icon-font"/>
                <span class="header-title">{{$t('outsideManageMain.batchProgress')}}</span>
            </div>
            <data-table :sourceData="sourceData3"
                        class="table-margin"
                        :columns="columns3"
                        :showPage="false"
                        height="192px">
              <template slot="classification" slot-scope="scope">
                {{formatType(scope.data.row.classification)}}
              </template>
                <template slot="generatedMail">
                  <auth-button :title="$t('outsideManageMain.generatedMail')" class="iconCircle marginLeft" icon="iconfont iconxiazai2"  @click="generatedMail(scope.data.row)"></auth-button>
                </template>
            </data-table>
        </el-card>
      </el-col>
    </el-row>
    <!--抽样文件批量处理页面-->
    <sample-file-audit-batch-pop :visible.sync="sampleFileVisible" :form="Object.assign({auditFileType: '1001'}, projectParam)" editModel="E" :headerTitle="$t('outsideManageMain.batchOperate')" feedbackType="1" @handleFilter="handleFilter"></sample-file-audit-batch-pop>
    <!--确权文件批量处理页面-->
    <sample-file-audit-batch-pop :visible.sync="confirmFileVisible" :form="projectParam" editModel="E" :headerTitle="$t('feedBackMain.confirmFileAuditBatchPop')" feedbackType="2" @handleFilter="handleFilter"></sample-file-audit-batch-pop>
    <!--其他文件批量处理页面-->
    <sample-file-audit-batch-pop :visible.sync="otherFileVisible" :form="projectParam" editModel="E" :headerTitle="$t('feedBackMain.otherFileAuditBatchPop')" feedbackType="3" @handleFilter="handleFilter"></sample-file-audit-batch-pop>
    <!--抽样文件批量下载页面-->
    <sample-file-down-batch-pop :visible.sync="sampleDownVisible" :form="projectParam" :headerTitle="$t('feedBackMain.batchDownload')" editModel="E"></sample-file-down-batch-pop>
    <!--确权文件批量下载页面-->
    <confirm-file-down-batch-pop :visible.sync="confirmDownVisible" :form="projectParam" editModel="E" feedbackType="2"></confirm-file-down-batch-pop>
    <!--其他文件批量下载页面-->
    <confirm-file-down-batch-pop :visible.sync="otherDownVisible" :form="projectParam" editModel="E" :headerTitle="$t('common.batchDownload')" feedbackType="3"></confirm-file-down-batch-pop>
    <!--生成邮件-->
    <send-email :visible.sync="emailVisible" editModel="E" :form="mailForm" emailType="1"></send-email>
  </div>
</template>
<script>
import { authButton, DataTable, btnDownload } from 'newepoch-components'
// import * as format from '@/filters/index'
import fileApi from '@/api/fileApi.js'
import { downFile } from '@/utils/devUtils'
import outsideManageApi from '@/api/assetoutfeedback/outsideManage/outsideManageApi'
import sampleFileAuditBatchPop from '@/pages/assetoutfeedback/feedBackMain/sampleFileAuditBatchPop'
import sampleFileDownBatchPop from '@/pages/assetoutfeedback/feedBackMain/sampleFileDownBatchPop'
import confirmFileDownBatchPop from '@/pages/assetoutfeedback/feedBackMain/confirmFileDownBatchPop'
import sendEmail from '@/components/element/assetoutfeedback/sendEmail'
import componentsApi from '@/api/assetoutfeedback/componentsApi'
export default {
  name: 'outsideManageSub',
  components: {
    authButton,
    DataTable,
    btnDownload,
    sampleFileAuditBatchPop,
    sampleFileDownBatchPop,
    confirmFileDownBatchPop,
    sendEmail
  },
  props: {
    projectParam: {
      type: [Object],
      default: function () {
        return {}
      }
    },
    activeName: {
      type: [String],
      default: function () {
        return ''
      }
    }
  },
  watch: {
    projectParam: function () {
      this.loadInfo(this.projectParam)
    }
  },
  data () {
    return {
      sampleFileVisible: false,
      confirmFileVisible: false,
      otherFileVisible: false,
      sampleDownVisible: false,
      confirmDownVisible: false,
      otherDownVisible: false,
      emailVisible: false,
      fileType: [], // 所有文件类型
      mailForm: {}, // 发送邮件传值
      columns1: [
        {
          // 文件名
          prop: 'sampleSupplement',
          align: 'left',
          width: '200px',
          label: ''
        },
        {
          // 本期总笔数
          prop: 'thisPeriodsTotal',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.thisPeriodsTotal,
          format: row => {
            if (row.thisPeriodsTotal) {
              return row.thisPeriodsTotal + this.$t('coordManageMain.count')
            }
            return '0' + this.$t('coordManageMain.count')
          }
        },
        {
          // ·保理商已完成审核笔数
          prop: 'auditedTotal',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.auditedTotal,
          format: row => {
            if (row.auditedTotal) {
              return row.auditedTotal + this.$t('coordManageMain.count')
            }
            return '0' + this.$t('coordManageMain.count')
          }
        },
        {
          // ·累计已收到笔数
          prop: 'receivedTotal',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.receivedTotal,
          format: row => {
            if (row.receivedTotal) {
              return row.receivedTotal + this.$t('coordManageMain.count')
            }
            return '0' + this.$t('coordManageMain.count')
          }
        },
        {
          // 新增可审查笔数
          prop: 'canAuditedTotal',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.canAuditedTotal,
          format: row => {
            if (row.canAuditedTotal) {
              return row.canAuditedTotal + this.$t('coordManageMain.count')
            }
            return '0' + this.$t('coordManageMain.count')
          }
        }
      ],
      columns2: [
        {
          // 分类
          prop: 'classification',
          align: 'left',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.classification
        },
        {
          // 已反馈
          prop: 'feedbacked',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.feedbacked
        },
        {
          // 已通过
          prop: 'passed',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.passed
        },
        {
          // 已退单
          prop: 'returnAsset',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.returnAsset
        },
        {
          // 外部机构审核中
          prop: 'auditing',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.auditing
        },
        {
          // 保理商解决中
          prop: 'solving',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.solving
        },
        {
          // 后补情况
          prop: 'repair',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.repair
        },
        {
          // 生成邮件
          prop: 'generatedMail',
          align: 'center',
          slot: true,
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.generatedMail
        }
      ],
      columns3: [
        {
          // 分类
          prop: 'classification',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.classification
        },
        {
          // 已反馈
          prop: 'feedbacked',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.feedbacked
        },
        {
          // 已通过
          prop: 'passed',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.passed
        },
        {
          // 已退单
          prop: 'returnAsset',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.returnAsset
        },
        {
          // 外部机构审核中
          prop: 'auditing',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.auditing
        },
        {
          // 保理商解决中
          prop: 'solving',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.solving
        },
        {
          // 后补情况
          prop: 'repair',
          align: 'center',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.repair
        },
        {
          // 生成邮件
          prop: 'generatedMail',
          align: 'center',
          slot: true,
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].outsideManageMain.generatedMail
        }
      ],
      noDownloadFileMsg: this.$t('common.noDownloadFileMsg'),
      feedbackInfo: {},
      uuidSwitch: false,
      sourceData1: [],
      sourceData2: [],
      sourceData3: []
    }
  },
  computed: {
    replenishDownApi () {
      return outsideManageApi.replenishDown
    },
    urgentDownApi () {
      return outsideManageApi.urgentDown
    },
    sampleDownApi () {
      return outsideManageApi.sampleDown
    },
    outsideManageInfoApi () {
      return outsideManageApi.getOutsideInfo
    },
    fileListApi () {
      return componentsApi.fileList
    }
  },
  mounted () {
    this.loadInfo(this.projectParam)
    this.getFileType()
  },
  methods: {
    // 获取产品尽调反馈信息
    loadInfo (data) {
      if (JSON.stringify(data) !== '{}') {
        this.outsideManageInfoApi.getDefaultInfo(data).then(res => {
          if (res.success) {
            this.feedbackInfo = res.data
            this.sourceData1 = this.feedbackInfo.confirmAndOtherFileScheduleDtoList
            this.sourceData2 = this.feedbackInfo.sampleFileOrBatchScheduleDtoList
            this.sourceData3 = this.feedbackInfo.batchScheduleDtoList
          }
        })
      }
    },
    handleFilter (data) {
      if (data) {
        this.loadInfo(this.projectParam)
      }
    },
    // 新增反馈/确权文件反馈/其他文件反馈笔数
    toFeedBackMain (type) {
      let param = {}
      if (type === '0') {
        param = { 'pointSampleFlag': '1' }
      } else if (type === '1' || type === '2') {
        param = { 'pointSampleFlag': '2' }
      }
      Object.assign(param, this.projectParam)
      this.$router.push({ name: 'feedBackMainIndex', params: { 'type': type, 'form': param } })
    },
    // 下载可补抽清单
    replenishDownload () {
      this.assetpkgmgrFullScreenLoading()
      this.replenishDownApi.getList(this.projectParam).then(res => {
        this.assetpkgmgrFullScreenLoading().close()
        if (res.success && res.data && res.data !== '') {
          this.downloadSuccess(res.data)
        } else {
          this.warning(this.noDownloadFileMsg)
        }
      }).catch(res => this.assetpkgmgrFullScreenLoading().close())
    },
    // 下载急单清单
    urgentDownload () {
      this.assetpkgmgrFullScreenLoading()
      this.urgentDownApi.getList(this.projectParam).then(res => {
        this.assetpkgmgrFullScreenLoading().close()
        if (res.success && res.data && res.data !== '') {
          this.downloadSuccess(res.data)
        } else {
          this.warning(this.noDownloadFileMsg)
        }
      }).catch(res => this.assetpkgmgrFullScreenLoading().close())
    },
    // 下载可抽查清单
    sampleDownload () {
      if (JSON.stringify(this.projectParam) !== '{}') {
        let downloadSpotCheckableAssetsDTO = {
          acquiringAssets: '1',
          periods: this.projectParam.periods,
          projectId: this.projectParam.projectId,
          projectName: this.projectParam.projectName
        }
        this.assetpkgmgrFullScreenLoading()
        this.sampleDownApi.defaultDownload(downloadSpotCheckableAssetsDTO).then(res => {
          this.assetpkgmgrFullScreenLoading().close()
          if (res.success && res.data && res.data !== '没有可下载的数据') {
            this.downloadSuccess(res.data)
            this.handleFilter()
          } else {
            this.warning(this.noDownloadFileMsg)
          }
        }).catch(res => this.assetpkgmgrFullScreenLoading().close())
      } else {
        this.warning(this.noDownloadFileMsg)
      }
    },
    // 共通下载
    downloadSuccess (fileID) {
      if (this.UtilJs.isEmpty(fileID)) {
        this.warning(this.noDownloadFileMsg)
      } else {
        if (this.uuidSwitch) {
          fileApi.file.downloadByUUID(this.$xhr, { uuid: fileID }).then(res => {
            downFile(res)
          })
        } else {
          fileApi.file.download({ keyId: fileID }).then(res => {
            downFile(res)
          })
        }
      }
    },
    // 基础抽样资产补充资料待审核操作
    batchDeal () {
      if (this.feedbackInfo.sampleSupplement && this.feedbackInfo.sampleSupplement !== '0') {
        this.sampleFileVisible = true
      } else {
        this.warning(this.$t('common.noAuditFile'))
      }
    },
    // 确权文件补充资料待审核操作
    showConfirmationFile () {
      if (this.feedbackInfo.confirmSupplement && this.feedbackInfo.confirmSupplement !== '0') {
        this.confirmFileVisible = true
      } else {
        this.warning(this.$t('common.noAuditFile'))
      }
    },
    // 其他文件补充资料待审核操作
    showOtherFile () {
      if (this.feedbackInfo.otherSupplement && this.feedbackInfo.otherSupplement !== '0') {
        this.otherFileVisible = true
      } else {
        this.warning(this.$t('common.noAuditFile'))
      }
    },
    // 基础资料批量下载
    showSampleDownload () {
      this.sampleDownVisible = true
    },
    // 确权文件下载
    showConfirmationDownload () {
      this.confirmDownVisible = true
    },
    // 其他资料批量下载
    showOtherDownload () {
      this.otherDownVisible = true
    },
    // 获取所有文件类型
    getFileType () {
      this.fileListApi.getList({ fileQueryType: '4', stampWay: '3' }).then(res => {
        if (res.success) {
          this.fileType = res.data
        }
      })
    },
    // 格式化文件类型
    formatType (data) {
      let fileType = this.fileType
      let auditFileType = fileType.filter(item => {
        return data === item.fileType
      })
      return auditFileType.length > 0 ? auditFileType[0].fileName : ''
    },
    // 生成邮件
    generatedMail (data, type) {
      let fileName = ''
      let fileType = ''
      let feedbackFrequency = ''
      if (type && type === '1001') { // 基础资产反馈进度
        fileType = type
        fileName = this.$t('coordManageMain.sampleFile')
        feedbackFrequency = data.classification.slice(1, -1)
      } else {
        fileType = data.classification
        fileName = this.formatType(data.classification)
        feedbackFrequency = ''
      }
      this.mailForm = { // 批量反馈进度
        projectId: this.projectParam.projectId,
        periods: this.projectParam.periods,
        auditFileType: fileType,
        auditFileTypeName: fileName,
        feedbackFrequency: feedbackFrequency
      }
      this.emailVisible = true
    }
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/assetoutfeedback/common.scss'
</style>
