<!-- 进度跟踪-批量反馈进度 -->
<template>
  <div class="trackScheduleConAndOtherPop" style="margin-top: 10px">
    <search-form :formValue.sync="queryParas" @handleFilter="handleFilter" @clearParam="clearParam" :componentList="componentList" :isShowFoldBtn="false"></search-form>
    <data-table :columns="columns" :sourceData="sourceData" :showPage="showPage" :loadCount="loadCount" class="conAndOtherTable"
                :queryParas.sync="queryParas" :api="trcApi" v-bind="{maxHeight:400}" @getTableData="getTableData" ref="sampleData" id="datatableheight">
      <template slot="headButton">
        <div class="flex-spaceB" style="padding-top: 10px">
        <div>
          <span class="effectoutfontStyle">{{form.projectName + form.periods}}期律所抽查资产反馈列表</span>
        </div>
        <div align="right">
          <i class="iconfont iconFlag kefangkuan iconfangkuan"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.lendable')}}</span></i>
          <i class="iconfont iconFlag ketuidan iconketuidan"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.returnableBill')}}</span></i>
          <i class="iconfont iconFlag yituidan iconyituidan"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.returnedOrder')}}</span></i>
          <i class="iconfont iconFlag jidan iconjidan"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.urgentSingleAssets')}}</span></i>
          <i class="iconfont iconFlag fengxian1 iconfengxian"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.riskOfCancellation')}}</span></i>
          <i class="iconfont iconFlag fengxian2 iconfengxian"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.supChargeback')}}</span></i>
          <i class="iconfont iconFlag yinanyuqi iconyinan"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.difficultAssets')}}</span></i>
          <i class="iconfont iconFlag yinanyuqi iconyuqi"><span class="fontClass iconSpace">{{$t('effectDealFeedBackMain.overdue')}}</span></i>
        </div>
        </div>
      </template>
      <template #operate="scope">
        <auth-button size="small" class="iconCircle"
                    :title="$t('effectDealFeedBackMain.sendEmail')" icon="iconfont iconfasongyoujian" @click="sendMail(scope.data.row)"></auth-button>
      </template>
      <template slot="append">
        <div class="graphic-table">
          <table width="1820px" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td rowspan="2" width="500px" class="graphic-td"><span>{{$t('effectDealFeedBackMain.summary')}}</span></td>
              <td rowspan="2" width="100px" class="graphic-td"><span>{{summaryCount.feedbackNumber}}</span></td>
              <td rowspan="2" width="100px" class="graphic-td"><span>{{summaryCount.feedbackQustionNumber}}</span></td>
              <td rowspan="2" width="120px" class="graphic-td"><span>{{summaryCount.resolvedNumber}}</span></td>
              <td rowspan="2" width="150px" class="graphic-td"><span>{{summaryCount.resolvedNumberPercent}}</span></td>
              <td rowspan="2" width="80px" class="graphic-td"><span>{{summaryCount.passed}}</span></td>
              <td rowspan="2" width="80px" class="graphic-td"><span>{{summaryCount.auditing}}</span></td>
              <td rowspan="2" width="80px" class="graphic-td"><span>{{summaryCount.resolving}}</span></td>
              <td rowspan="2" width="80px" class="graphic-td"><span>{{summaryCount.chargeBack}}</span></td>
              <td width="150px" class="graphic-td"><span v-show="!UtilJs.isEmpty(summaryCount)">{{summaryCount.numberOfCs + $t('effectDealFeedBackMain.bs') + summaryCount.supplementNoOfCs + $t('effectDealFeedBackMain.problems')}}</span></td>
              <td width="170px" class="graphic-td"><span v-show="!UtilJs.isEmpty(summaryCount)">{{summaryCount.numberOfArea + $t('effectDealFeedBackMain.bs') + summaryCount.supplementNoOfArea + $t('effectDealFeedBackMain.problems')}}</span></td>
              <td width="150px" class="graphic-td"><span v-show="!UtilJs.isEmpty(summaryCount)">{{summaryCount.numberOfDocuments + $t('effectDealFeedBackMain.bs') + summaryCount.supplementNoOfDocuments + $t('effectDealFeedBackMain.problems')}}</span></td>
              <td rowspan="2" width="60px" class="graphic-td lastTdCss" :style="{left:lastTdLeft}"></td>
            </tr>
            <tr>
              <td colspan="3" class="graphic-td"><span v-show="!UtilJs.isEmpty(summaryCount)">{{$t('effectDealFeedBackMain.total') + summaryCount.numberOfTotal + $t('effectDealFeedBackMain.bs') + summaryCount.supplementNoOfTotal + $t('effectDealFeedBackMain.problems')}}</span></td>
            </tr>
          </table>
        </div>
      </template>
    </data-table>
    <div v-for="item in list" :key="item.auditFileType">
      <external-transition  class="batchList" :title="item.auditFileType">
        <template slot="unfolded">
          <data-table :columns="batchColumns"
                      :sourceData="item.getFileInfoDetailConvertTempDTOList"
                      :showPage="showPage"
                      v-bind="{ spanMethod:e => objectSpanMethod(item,e)}">
            <!-- 资产标识 -->
            <template slot="sampleFlagDTO" slot-scope="scope">
              <div>
                  <i v-if="scope.data.row.sampleFlagDTO.ifsToLoan === '2'" class="iconfont iconFlag kefangkuan iconfangkuan"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.selectedChargebackFlag === '2'" class="iconfont iconFlag ketuidan iconketuidan"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.chargebackStatus === '2'" class="iconfont iconFlag yituidan iconyituidan"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.ifsUrgent === '2'"  class="iconfont iconFlag jidan iconjidan"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.chargebackRiskFlag === '2'" class="iconfont iconFlag fengxian1 iconfengxian"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.supplementPumpStatus === '2'"  class="iconfont iconFlag fengxian2 iconfengxian"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.difficultQustionFlag === '2'" class="iconfont iconFlag yinanyuqi iconyinan"></i>
                  <i v-if="scope.data.row.sampleFlagDTO.overdueFlag === '2'" class="iconfont iconFlag yinanyuqi iconyuqi"></i>
              </div>
            </template>
            <template slot="feedbackStatus" slot-scope="scope">
              <span>{{getTableFormat(scope.data.row.feedbackStatus, 'FEEDBACK_STATUS')}}</span>
              <span v-if="scope.data.row.feedbackStatus === '0' && scope.data.row.chargebackReason !== ''"><br/>{{$t('chargeback.chargeback_reason')}}<br/></span>
              <span v-if="scope.data.row.feedbackStatus === '0' && scope.data.row.chargebackReason !== ''">{{scope.data.row.chargebackReason}}</span>
            </template>
            <template slot="regionCode" slot-scope="scope">
              <div v-if="scope.data.row.regionCodeFlag==='1'&& scope.data.row.relationChargeUserNameOfArea !== ''">
                <span>{{scope.data.row.relationChargeUserNameOfArea}}</span><br/>
                <span><br/>{{$t('factorRateList.areaNumber')}}<br/></span>
                <span v-if="scope.data.row.regionCode !== ''">{{scope.data.row.regionCode}}</span>
              </div>
              <span v-else>{{'——'}}</span>
            </template>
            <template slot="operate" slot-scope="scope">
              <auth-button size="small" class="iconCircle marginLeft"
                          :title="$t('effectDealFeedBackMain.editorialRemarks')" icon="iconfont iconbianji" @click="editRemarks(scope.data.row)"></auth-button>
              <auth-button size="small" class="iconCircle"
                          :title="$t('effectDealFeedBackMain.proDetails')" icon="iconfont iconxiangqing" @click="trackClick(scope.data.row)" v-if="scope.data.row.extOrgAuditResult!=='1'"></auth-button>
              <auth-button size="small" class="iconCircle"
                          :title="$t('effectDealFeedBackMain.symManage')" icon="iconfont iconbiaozhiguanli" @click="editFlag(scope.data.row)"></auth-button>
            </template>
          </data-table>
        </template>
      </external-transition>
    </div>
    <!-- 编辑备注 -->
    <edit-memo v-if="editMemoVisible" :visible.sync="editMemoVisible" :form="changeForm" @close="closeMemo"></edit-memo>
    <track-schedule-qust-detail-pop v-if="trackVisible" :visible.sync="trackVisible" :form="changeForm"></track-schedule-qust-detail-pop>
    <!-- 标志管理 -->
    <asset-flag-mgr-pop :visible.sync="flagVisible" v-if="flagVisible" editModel="E" :form="flagForm"  @close="closeMemo"></asset-flag-mgr-pop>
    <send-email :visible.sync="emailVisible" editModel="E" :form="sendForm"></send-email>
  </div>
</template>

<script>
import * as format from '@/filters/index'
import editMemo from '@/pages/assetoutfeedback/effectDealFeedBack/editMemo'
import coordManageApi from '@/api/assetoutfeedback/coordManage/coordManageApi'
import effectDealFeedBackApi from '@/api/assetoutfeedback/effectDealFeedBack/effectDealFeedBackApi'
import trackScheduleQustDetailPop from '@/components/element/assetoutfeedback/trackScheduleQustDetailPop'
import sendEmail from '@/components/element/assetoutfeedback/sendEmail'
import externalTransition from '@/components/element/assetoutfeedback/externalTransition'
import fileApi from '@/api/fileApi.js'
import { downFile } from '@/utils/devUtils'
import { mapGetters } from 'vuex'
import assetFlagMgrPop from '@/pages/assetoutfeedback/coordManage/assetFlagMgrPop'
import { searchForm, DataTable, SelectDictionary, authButton, SelectProductName, BaseSelect } from 'newepoch-components'
export default {
  components: { DataTable, searchForm, SelectDictionary, authButton, externalTransition, SelectProductName, BaseSelect, editMemo, trackScheduleQustDetailPop, assetFlagMgrPop, sendEmail },
  computed: {
    ...mapGetters(['userId', 'nikeName']),
    trcApi () {
      return coordManageApi.getTrclistOther
    },
    // 编辑备注
    memoApi () {
      return effectDealFeedBackApi.getMemoInfo
    },
    // 处理单元格合并参数
    rowspan () {
      let list = this.batchData
      list.forEach((i, m) => {
        let spanArr = []
        let spanArr2 = []
        let spanArr3 = []
        let spanArr4 = []
        let qusetionNumber = []
        let traceUserName = []
        let position = 0
        let position1 = 0
        let position2 = 0
        let position3 = 0
        let position4 = 0
        let position5 = 0
        if (i.getFileInfoDetailConvertTempDTOList && i.getFileInfoDetailConvertTempDTOList.length > 0) {
          i.getFileInfoDetailConvertTempDTOList.forEach((item, index) => {
            if (index === 0) {
              item.index = 1
              spanArr.push(1)
              spanArr2.push(1)
              spanArr3.push(1)
              spanArr4.push(1)
              qusetionNumber.push(1)
              traceUserName.push(1)
              position = 0
              position1 = 0
              position2 = 0
              position3 = 0
              position4 = 0
              position5 = 0
            } else {
              // 合并客服
              if (item.feedbackQustionNo === i.getFileInfoDetailConvertTempDTOList[index - 1].feedbackQustionNo && item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode && (item.relationType === '1' && i.getFileInfoDetailConvertTempDTOList[index - 1].relationType === '1') && item.relationChargeUserName === i.getFileInfoDetailConvertTempDTOList[index - 1].relationChargeUserName) {
                spanArr[position] += 1
                spanArr.push(0)
              } else {
                spanArr.push(1)
                position = index
              }
              // 合并区域业务
              if (item.feedbackQustionNo === i.getFileInfoDetailConvertTempDTOList[index - 1].feedbackQustionNo && item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode && ((item.relationType === '2' && i.getFileInfoDetailConvertTempDTOList[index - 1].relationType === '2') || (item.relationType === '5' && i.getFileInfoDetailConvertTempDTOList[index - 1].relationType === '5' && item.regionCode === i.getFileInfoDetailConvertTempDTOList[index - 1].regionCode)) && item.relationChargeUserName === i.getFileInfoDetailConvertTempDTOList[index - 1].relationChargeUserName && item.relationChargeUserName === i.getFileInfoDetailConvertTempDTOList[index - 1].relationChargeUserName) {
                spanArr2[position2] += 1
                spanArr2.push(0)
              } else {
                spanArr2.push(1)
                position2 = index
              }
              // 合并中登
              // if (item.feedbackQustionNo === i.getFileInfoDetailConvertTempDTOList[index - 1].feedbackQustionNo && item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode && (item.relationType === '3' && i.getFileInfoDetailConvertTempDTOList[index - 1].relationType === '3') && item.relationChargeUserName === i.getFileInfoDetailConvertTempDTOList[index - 1].relationChargeUserName) {
              //   spanArr3[position] += 1
              //   spanArr3.push(0)
              // } else {
              //   spanArr3.push(1)
              //   position3 = index
              // }
              // 合并单证
              // if (item.feedbackQustionNo === i.getFileInfoDetailConvertTempDTOList[index - 1].feedbackQustionNo && item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode && (item.relationType === '4' && i.getFileInfoDetailConvertTempDTOList[index - 1].relationType === '4') && item.relationChargeUserName === i.getFileInfoDetailConvertTempDTOList[index - 1].relationChargeUserName) {
              //   spanArr4[position] += 1
              //   spanArr4.push(0)
              // } else {
              //   spanArr4.push(1)
              //   position4 = index
              // }
              // 合并序号和标志
              if (item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode) {
                item.index = i.getFileInfoDetailConvertTempDTOList[index - 1].index
                qusetionNumber[position1] += 1
                qusetionNumber.push(0)
              } else {
                item.index = i.getFileInfoDetailConvertTempDTOList[index - 1].index + 1
                qusetionNumber.push(1)
                position1 = index
              }
              // 合并跟进人
              if (item.feedbackQustionNo === i.getFileInfoDetailConvertTempDTOList[index - 1].feedbackQustionNo) {
                traceUserName[position1] += 1
                traceUserName.push(0)
              } else {
                traceUserName.push(1)
                position5 = index
              }
            }
          })
        }
        i.spanArr = spanArr
        i.spanArr2 = spanArr
        i.spanArr3 = spanArr
        i.spanArr4 = spanArr
        i.number = qusetionNumber
        i.traceUserName = traceUserName
        i.position = position
        i.position2 = position2
        i.position3 = position3
        i.position4 = position4
        i.position5 = position5
      })
      // 合并标志
      list = list.map((i, index) => {
        if (i.getFileInfoDetailConvertTempDTOList.length > 0) {
          i.getFileInfoDetailConvertTempDTOList.reverse()
          i.getFileInfoDetailConvertTempDTOList = i.getFileInfoDetailConvertTempDTOList.map((item, index) => {
            if (index !== 0 && item.assetCode === i.getFileInfoDetailConvertTempDTOList[index - 1].assetCode) {
              let combind = {}
              for (let e in i.getFileInfoDetailConvertTempDTOList[index - 1].sampleFlagDTO) {
                let t = i.getFileInfoDetailConvertTempDTOList[index - 1].sampleFlagDTO[e]
                if (t === '2') {
                  combind[e] = t
                }
              }
              item.sampleFlagDTO = Object.assign(item.sampleFlagDTO, combind)
            }
            return item
          })
          i.getFileInfoDetailConvertTempDTOList.reverse()
        }
        return i
      })
      return list
    },
    list () {
      return this.rowspan
    }
  },
  props: {
    form: {
      type: Object,
      default () {
        return {}
      }
    },
    editModel: {
      type: String,
      default () {
        return ''
      }
    },
    num: {
      type: Number,
      default () {
        return 0
      }
    },
    feedbackResource: {
      type: String,
      default () {
        return '1'
      }
    },
    userType: {
      type: String,
      default () {
        return '1'
      }
    },
    fileAll: {
      type: Array,
      default () {
        return []
      }
    },
    trackType: {
      type: String,
      default () {
        return ''
      }
    }
  },
  watch: {
    screenWidth (n) {
      this.lastTdLeft = -(this.$refs.sampleData.$el.children[1].children[2].scrollWidth - this.$refs.sampleData.$el.children[1].children[2].offsetWidth - this.$refs.sampleData.$el.children[1].children[2].scrollLeft) + 'px'
    }
  },
  activated () {
    setTimeout(() => {
      this.initWidth()
      this.tableHeightChange()
    }, 100)
    // this.loadCount++
  },
  data () {
    let $this = this
    return {
      screenWidth: document.body.clientWidth,
      trackVisible: false,
      editMemoVisible: false,
      flagVisible: false,
      showPage: false,
      changeForm: {},
      flagForm: {},
      sendForm: {
        projectId: this.form.projectId,
        periods: this.form.periods
      },
      emailVisible: false,
      queryParas: {
        traceUserName: '',
        extOrgAuditResult: '',
        pageIndex: 1,
        pageSize: 10
      },
      summaryCount: {},
      lastTdLeft: '0px',
      loadCount: 0,
      batchData: [],
      sourceData: [],
      componentList: [
        {
          // 跟进人
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.traceUserName,
          disabled: true,
          prop: 'traceUserName',
          value: 'traceUserName',
          maxlength: 50,
          placeholder: this.$i18n.messages[this.$i18n.locale].common.pleaseInput,
          labelWidth: '130px',
          clearable: true,
          componentName: 'el-input'
        },
        {
          // 资产标志
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.assetFlag,
          disabled: false,
          prop: 'sampleFlag',
          value: 'sampleFlag',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.pleaseSelect,
          labelWidth: '130px',
          dictTypeCode: 'AUDIT_OUT_ASSET_FLAG',
          clearable: true,
          componentName: SelectDictionary
        },
        {
          // 付款确认书编号
          label: this.$i18n.messages[this.$i18n.locale].common.payCode,
          disabled: false,
          prop: 'assetCode',
          value: 'assetCode',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.pleaseInput,
          labelWidth: '130px',
          clearable: true,
          componentName: 'el-input'
        },
        {
          // 是否后补
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.repair,
          disabled: false,
          prop: 'extOrgAuditResult',
          value: 'extOrgAuditResult',
          placeholder: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.pleaseChooseyn,
          labelWidth: '130px',
          clearable: true,
          options: [
            {
              id: '1',
              name: $this.$t('common.no')
            },
            {
              id: '2',
              name: $this.$t('common.yes')
            }
          ],
          componentName: BaseSelect
        }
      ],
      columns: [
        {
          // 文件类型
          prop: 'auditFileTypeName',
          align: 'center',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].knowledgeBaseIndex.fileType
        }, {
          // 最早反馈时间
          prop: 'earliestAddTime',
          align: 'center',
          width: '120px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.earliestAddTime,
          format (row) {
            return format.formatCheckDatetime(row.earliestAddTime, 'yyyy-MM-dd')
          }
        }, {
          // 是否已全部反馈
          prop: 'isAllFeedback',
          align: 'center',
          width: '120px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.isAllFeedback
        }, {
          // 未审查笔数
          prop: 'noCheckNumber',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.noCheckNumber
        }, {
          // 已反馈笔数
          prop: 'feedbackNumber',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.feedbackNumber
        }, {
          // 反馈问题数
          prop: 'feedbackQustionNumber',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.feedbackQustionNumber
        }, {
          // 合规已解决数量
          prop: 'resolvedNumber',
          align: 'center',
          width: '120px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.resolvedNumber
        }, {
          // 合规已解决占比(%)
          prop: 'resolvedNumberPercent',
          align: 'center',
          width: '150px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.resolvedNumberPercent,
          format: (row) => {
            if (row.resolvedNumberPercent === '0.00') {
              return '0'
            } else {
              return row.resolvedNumberPercent
            }
          }
        }, {
          // 总体状态（笔）
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.headStatus,
          child: [
            {
              // 已通过
              prop: 'passed',
              align: 'center',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.passed
            }, {
              // 审核中
              prop: 'auditing',
              align: 'center',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.auditing
            }, {
              // 解决中
              prop: 'resolving',
              align: 'center',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.resolving
            }, {
              // 已退单
              prop: 'chargeBack',
              align: 'center',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.chargeBack
            }
          ]
        }, {
          // 暂未补回
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.noRecovered,
          child: [
            {
              // 客服尚未补回情况
              prop: 'numberOfCs',
              align: 'center',
              width: '150px',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.numberOfCs,
              format (row) {
                return row.numberOfCs + '笔' + row.supplementNoOfCs + '问题'
              }
            }, {
              // 区域/业务尚未补回情况
              prop: 'numberOfArea',
              align: 'center',
              width: '170px',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.numberOfArea,
              format (row) {
                return row.numberOfArea + '笔' + row.supplementNoOfArea + '问题'
              }
            }, {
              // 单证尚未补回情况
              prop: 'numberOfDocuments',
              align: 'center',
              width: '150px',
              label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.numberOfDocuments,
              format (row) {
                return row.numberOfDocuments + '笔' + row.supplementNoOfDocuments + '问题'
              }
            }
          ]
        }, {
          // 操作
          prop: 'operate',
          align: 'center',
          slot: true,
          width: '60px',
          fixed: 'right',
          label: this.$i18n.messages[this.$i18n.locale].common.operate
        }
      ],
      batchColumns: [
        {
          // 序号
          prop: 'index',
          align: 'center',
          width: '60px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.No
        }, {
          // 付款确认书编号
          prop: 'assetCode',
          align: 'left',
          width: '240px',
          label: this.$i18n.messages[this.$i18n.locale].common.payCode
        }, {
          // 供应商名称
          prop: 'suppliersName',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].feedbackMaterialIndex.gys
        }, {
          // 项目公司名称
          prop: 'projectCompanyName',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].feedbackMaterialIndex.xmg
        }, {
          // 状态
          prop: 'feedbackStatus',
          align: 'center',
          width: '120px',
          slot: true,
          label: this.$i18n.messages[this.$i18n.locale].documentSealingTaskManage.status
        }, {
          // 客服
          prop: 'customerService',
          align: 'center',
          width: '60px',
          label: this.$i18n.messages[this.$i18n.locale].expressFileReceiveList.customerService,
          format (row) {
            if (row.relationChargeUserNameOfCs && row.relationChargeUserNameOfCs !== '') {
              return row.relationChargeUserNameOfCs
            } else {
              return '——'
            }
          }
        }, {
          // 客服需补资料
          prop: 'custSupplementNoFile',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.custSupplementNoFile,
          format (row) {
            if (row.supplementNoFileOfCs && row.supplementNoFileOfCs !== '') {
              let dateStr = ''
              dateStr = format.formatCheckDatetime(row.estimateSupplementTimeOfCs, 'yyyy-MM-dd')
              if (dateStr === '') {
                return row.supplementNoFileOfCs
              } else {
                return row.supplementNoFileOfCs + '（预计' + dateStr + '时间补回）'
              }
            } else {
              return '——'
            }
          }
        }, {
          // 区域/业务(区域业务)
          prop: 'regionCode',
          align: 'center',
          slot: true,
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.regionCode
        }, {
          // 区域/业务需补资料
          prop: 'regiSupplementNoFile',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.regiSupplementNoFile,
          format (row) {
            if (row.supplementNoFileOfArea && row.supplementNoFileOfArea !== '') {
              let dateStr = ''
              dateStr = format.formatCheckDatetime(row.estimateSupplementTimeOfArea, 'yyyy-MM-dd')
              if (dateStr === '') {
                return row.supplementNoFileOfArea
              } else {
                return row.supplementNoFileOfArea + '（预计' + dateStr + '时间补回）'
              }
            } else {
              return '——'
            }
          }
        }, {
          // 单证需补资料
          prop: 'docSupplementNoFile',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.docSupplementNoFile,
          format (row) {
            if (row.supplementNoFileOfDocuments && row.supplementNoFileOfDocuments !== '') {
              let dateStr = ''
              dateStr = format.formatCheckDatetime(row.estimateSupplementTimeOfDocuments, 'yyyy-MM-dd')
              if (dateStr === '') {
                return row.supplementNoFileOfDocuments
              } else {
                return row.supplementNoFileOfDocuments + '（预计' + dateStr + '时间补回）'
              }
            } else {
              return '——'
            }
          }
        }, {
          // 合规
          prop: 'traceUserName',
          align: 'left',
          width: '120px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.trace
        }, {
          // 统筹人备注
          prop: 'chargeUserMemo',
          align: 'left',
          width: '160px',
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.chargeUserMemo
        }, {
          // 资产标志
          prop: 'sampleFlagDTO',
          align: 'center',
          width: '160px',
          slot: true,
          label: this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.assetFlag
        }, {
          // 操作
          prop: 'operate',
          align: 'center',
          width: '160px',
          slot: true,
          fixed: 'right',
          label: this.$i18n.messages[this.$i18n.locale].common.operate
        }
      ]
    }
  },
  created () {
    if (this.userType === '2') {
      this.queryParas.traceUserName = this.nikeName
    } else {
      this.componentList[0].disabled = false
    }
    if (this.trackType === '1') { // 后补进度
      this.queryParas.extOrgAuditResult = '2'
    }
  },
  mounted () {
    // let x = document.getElementById('datatableheight').firstElementChild.nextElementSibling.firstElementChild.nextElementSibling.nextElementSibling
    // let height = x.style.maxHeight
    // document.getElementById('datatableheight').firstElementChild.nextElementSibling.firstElementChild.nextElementSibling.nextElementSibling.style.maxHeight = Number(height.substring(0, height.indexOf('px'))) - 83 + 'px'
    window.onresize = () => {
      return (() => {
        this.screenWidth = document.body.clientWidth
      })()
    }
    this.initWidth()
    // this.lastTdLeft = -(this.$refs.sampleData.$el.children[1].children[2].scrollWidth - this.$refs.sampleData.$el.children[1].children[2].offsetWidth - this.$refs.sampleData.$el.children[1].children[2].scrollLeft) + 'px'
    this.$refs.sampleData.$el.children[1].children[2].addEventListener('scroll', this.offsetWidth)
    // this.queryParas = this.form
    Object.assign(this.queryParas, this.form)
    this.queryParas.feedbackResource = this.feedbackResource
    this.$nextTick(() => {
      this.handleFilter()
    })
  },
  // 表格定长初始化
  // initWidth () {
  // this.lastTdLeft = -(this.$refs.sampleData.$el.children[1].children[2].scrollWidth - this.$refs.sampleData.$el.children[1].children[2].offsetWidth - this.$refs.sampleData.$el.children[1].children[2].scrollLeft) + 'px'
  //   this.lastTdLeft = '-505px'
  // },
  beforeDestroy () {
    this.$refs.sampleData.$el.children[1].children[2].removeEventListener('scroll', this.offsetWidth)
  },
  methods: {
    // 发送邮件
    sendMail (row) {
      this.sendForm.auditFileType = row.auditFileType
      this.sendForm.auditFileTypeName = row.auditFileTypeName
      // this.sendForm.feedbackFrequency = row.feedbackFrequency
      this.emailVisible = true
    },
    clearParam () {
      if (this.userType === '2') {
        this.queryParas = {
          pageIndex: 1,
          pageSize: 10,
          traceUserName: this.nikeName
        }
      } else {
        this.queryParas = {}
      }
      this.queryParas = Object.assign(this.queryParas, this.form)
    },
    formatType (data) {
      let fileType = this.fileAll
      let auditFileType = fileType.filter(item => {
        return data.auditFileType === item.fileType
      })
      return auditFileType.length > 0 ? auditFileType[0].fileName : ''
    },
    // 行合并
    objectSpanMethod (item, { row, column, rowIndex, columnIndex }) {
      if ((columnIndex > -1 && columnIndex < 5) || columnIndex === 10 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13) {
        return {
          rowspan: item.number ? item.number[rowIndex] : 1,
          colspan: 1
        }
      } else if (columnIndex === 5) {
        return {
          rowspan: item.spanArr ? item.spanArr[rowIndex] : 1,
          colspan: 1
        }
      } else if (columnIndex === 7) {
        return {
          rowspan: item.spanArr2 ? item.spanArr2[rowIndex] : 1,
          colspan: 1
        }
      // } else if (columnIndex === 10) {
      //   return {
      //     rowspan: item.traceUserName ? item.traceUserName[rowIndex] : 1,
      //     colspan: 1
      //   }
      }
      return {
        rowspan: 1,
        colspan: 1
      }
    },
    // 导出文件
    importData () {
      this.queryParas = Object.assign(this.queryParas, this.form)
      this.queryParas.feedbackResource = this.feedbackResource
      this.queryParas.isExportFlag = '1' // 导出标志
      let fileId = ''
      this.trcApi.getList(this.queryParas).then(res => {
        if (res.success && res.data.fileId) {
          fileId = res.data.fileId
          this.downloadSuccess(fileId)
        } else {
          this.warning('没有可下载的数据')
        }
      })
    },
    // 共通下载
    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)
          })
        }
      }
    },
    tableHeightChange () {
      if (document.getElementById('datatableheight').querySelector('.el-table__fixed-body-wrapper').style.maxHeight !== '235px') {
        document.getElementById('datatableheight').querySelector('.el-table__fixed-body-wrapper').style.maxHeight = '225px'
        document.getElementById('datatableheight').firstElementChild.nextElementSibling.firstElementChild.nextElementSibling.nextElementSibling.style.maxHeight = '235px'
      }
    },
    handleFilter () {
      this.tableHeightChange()
      // var x = document.getElementById('datatableheight').firstElementChild.nextElementSibling.firstElementChild.nextElementSibling.nextElementSibling
      // console.log(x)
      // let height = x.style.maxHeight
      // Number(height.substring(0, document.querySelector('.el-table__body-wrapper').style.maxHeight.indexOf('px')))
      // console.log(Number(height.substring(0, document.querySelector('.el-table__fixed-body-wrapper').style.maxHeight.indexOf('px'))) + 1)
      // console.log(height)
      this.queryParas.isExportFlag = '0'
      this.queryParas.feedbackResource = this.feedbackResource
      this.loadCount = this.loadCount + 1
    },
    // 表格定长初始化
    initWidth () {
      this.lastTdLeft = -(this.$refs.sampleData.$el.children[1].children[2].scrollWidth - this.$refs.sampleData.$el.children[1].children[2].offsetWidth - this.$refs.sampleData.$el.children[1].children[2].scrollLeft) + 'px'
      // this.lastTdLeft = '-497px'
    },
    getTableData (val) {
      this.sourceData = val.getConOtherInfoCountDTOList
      this.summaryCount = val.getFileInfoSummaryCountDTO
      this.batchData = val.getFileInfoDetailConvertDTOList
    },
    // 表格格式获取
    getTableFormat (row, name) {
      return format.formatDict(row, name)
    },
    // 获取表格相对宽度
    offsetWidth () {
      this.lastTdLeft = -(this.$refs.sampleData.$el.children[1].children[2].scrollWidth - this.$refs.sampleData.$el.children[1].children[2].offsetWidth - this.$refs.sampleData.$el.children[1].children[2].scrollLeft) - 8 + 'px'
    },
    // 编辑备注
    editRemarks (row) {
      // 获得编辑数据
      this.memoApi.getDefaultInfo({ identityFlag: '2', assetKeyId: row.assetKeyId, assetModifyTime: row.assetModifyTime }).then(res => {
        if (res.success) {
          this.changeForm = {
            identityFlag: '2',
            chargeUserMemo: res.data.chargeUserMemo,
            assetKeyId: res.data.assetKeyId,
            assetModifyTime: res.data.assetModifyTime
          }
          this.editMemoVisible = true
        }
      })
      // this.queryParas.feedbackResource = this.feedbackResource
      // let param = Object.assign(this.queryParas, { identityFlag: '2' })
      // param = Object.assign(param, this.form)
      // param = Object.assign(param, row)
      // this.memoApi.getDefaultInfo(param).then(res => {
      //   if (res.data && !res.data.errFlag) {
      //     this.changeForm = {}
      //     this.changeForm = Object.assign(this.changeForm, param)
      //     this.changeForm = Object.assign(this.changeForm, res.data)
      //     this.editMemoVisible = true
      //   } else {
      //     this.error('编辑备注失败')
      //   }
      // })
    },
    closeMemo () {
      this.handleFilter()
    },
    // 问题详情
    trackClick (row) {
      this.changeForm = row
      this.trackVisible = true
    },
    // 标志管理
    editFlag (data) {
      this.flagForm = Object.assign(data, this.form)
      this.flagForm.feedbackResource = this.feedbackResource
      this.flagVisible = true
    }
  }
}
</script>

<style lang="scss" scoped>
@import '~@/styles/assetoutfeedback/common.scss';
</style>

<style lang="scss">
.batchList{
  padding: 20px 0 0;
  .collapseTitle-header{
    margin: 0 !important;
  }
}
</style>
