<!--资产编号别反馈意见子组件-->
<template>
  <div class="dealAuditReviewContentSub formTop">
    <external-transition :isCollapse="true" :title="title">
         <template slot="transition">
            <dym-form :componentList="componentList" :formValue="formValue"></dym-form>
            <!--落实意见复核列表-->
            <data-table :sourceData.sync="tableData"
                        :pageAll="true"
                        :showPage="false"
                        :toolMenuFlag="true"
                        :columns="columns1"
                        :menuFlag="false"
                        :showSelection="true"
                        @selectRowChange="selectRowChange"
                        @getTableData="getTableData"
                        v-if="reviewType==='1'"
                        max-height="400"
                        ref="dataTable">
                <template slot="headButton">
                   <auth-button :label="$t('coordManageMain.assetFlagTitle')" type="primary" size="medium" icon="iconfont iconzichanbiaozhiguanlianniu"  @click="showAssetMark(formValue)"></auth-button>
                   <auth-button :label="$t('coordManageMain.baseInfo')" type="primary" size="medium" icon="iconfont iconjichuxinxi" @click="showPop('2')"></auth-button>
                   <auth-button :label="$t('coordManageMain.dataDownload')" type="primary" size="medium" icon="iconfont iconycxiazai" @click="showPop('3')"></auth-button>
                   <auth-button :label="$t('coordManageMain.batchAgree')" type="primary" size="medium" icon="iconfont iconzancheng" class="rightBtn" @click="batchApprove"></auth-button>
                </template>
                <!--外部机构意见-->
                <template slot="feedbackQuestionContent" slot-scope="scope">
                  <span-plus :index="scope.data.row.index" :text="scope.data.row.feedbackQuestionContent"></span-plus>
                </template>
                <!--合规落实意见-->
                <template slot="effectReviewFlag" slot-scope="scope">
                  <div v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                    <el-input v-for="index in ['0','1','4','5','2','3']"
                              :key="index"
                              class="wbhzl"
                              :disabled="checkHg(scope.data.row.tempInfo.relatedType,index)"
                              v-model="scope.data.row.tempInfo.effectReview['practicableSuggestion'+index]"
                              placeholder="字符串<=500"
                              maxlength='500'></el-input>
                  </div>
                  <div v-else>
                    <div v-for="index in scope.data.row.oldInfo.relatedType" :key="index">
                      <el-popover placement="top-start"
                                  width="100%"
                                  trigger="hover"
                                  v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)"
                                  :content="scope.data.row.oldInfo.effectReview['practicableSuggestion'+index]">
                        <div v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)"  class="hglsResultText" slot="reference">
                          {{scope.data.row.oldInfo.effectReview['practicableSuggestion'+index] | ellipsis}}
                        </div>
                      </el-popover>
                    </div>
                  </div>
                </template>
                 <!--合规落实结果-->
                <template slot="practicableResult" slot-scope="scope">
                    <el-checkbox-group @change="e => handleChange(e,scope.data.row.tempInfo)" v-model="scope.data.row.tempInfo.relatedType" v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                      <el-checkbox label="0" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'0')">
                        {{$t('coordManageMain.commitLs')}}
                      </el-checkbox>
                      <el-checkbox label="1" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">
                        {{$t('coordManageMain.commitKf')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.customerAccountName">{{scope.data.row.tempInfo.xgfName.customerAccountName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="4" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">
                        {{$t('coordManageMain.commitDz')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.dzName&&scope.data.row.tempInfo.dzName.length>0">{{scope.data.row.tempInfo.tempInfo.dzName[0].areaCoordinatorName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="5" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">
                        {{$t('coordManageMain.commitQy')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.coreAreaAttacheName">{{scope.data.row.tempInfo.xgfName.coreAreaAttacheName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="2" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">
                        {{$t('coordManageMain.commitYw')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.coreAreaBussUserName">{{scope.data.row.tempInfo.xgfName.coreAreaBussUserName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="3" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">
                        {{$t('coordManageMain.commitZd')}}
                      </el-checkbox>
                    </el-checkbox-group>
                  <div v-else>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('0')">{{$t('coordManageMain.commitLs')}}
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('1')">{{$t('coordManageMain.commitKf')}}
                      <el-tag type="info" effect="dark" class="submitter-tag"  v-if="scope.data.row.oldInfo.relationChargeUser1.relationChargeUserName">{{scope.data.row.oldInfo.relationChargeUser1.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('4')">{{$t('coordManageMain.commitDz')}}
                      <el-tag type="info" effect="dark" class="submitter-tag"  v-if="scope.data.row.oldInfo.relationChargeUser4.relationChargeUserName">{{scope.data.row.oldInfo.relationChargeUser4.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('5')">{{$t('coordManageMain.commitQy')}}
                      <el-tag type="info" effect="dark" class="submitter-tag"  v-if="scope.data.row.oldInfo.relationChargeUser5.relationChargeUserName">{{scope.data.row.oldInfo.relationChargeUser5.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('2')">{{$t('coordManageMain.commitYw')}}
                      <el-tag type="info" effect="dark" class="submitter-tag"  v-if="scope.data.row.oldInfo.relationChargeUser2.relationChargeUserName">{{scope.data.row.oldInfo.relationChargeUser2.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('3')">{{$t('coordManageMain.commitZd')}}
                    </div>
                  </div>
                </template>
                <!--未补回资料-->
                <template slot="supplementNoFile" slot-scope="scope">
                  <div v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                    <el-input v-for="index in ['0','1','4','5','2','3']"
                              :key="index"
                              :disabled="checkUnFile(scope.data.row.tempInfo.relatedType,index)"
                              v-model="scope.data.row.tempInfo.supplementNoFile['supplementNoFile'+index]"
                              :placeholder="index==='0'?'':'字符串<=200'"
                              class="wbhzl"
                              maxlength='200'></el-input>
                  </div>
                  <div v-else>
                    <div v-for="index in scope.data.row.oldInfo.relatedType" :key="index">
                      <el-popover placement="top-start"
                                  width="100%"
                                  trigger="hover"
                                  v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)&&index!=='0'"
                                  :content="scope.data.row.oldInfo.supplementNoFile['supplementNoFile'+index]">
                        <div v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)" class="hglsResultText" slot="reference">
                          {{scope.data.row.oldInfo.supplementNoFile['supplementNoFile'+index] | ellipsis}}
                        </div>
                      </el-popover>
                    </div>
                  </div>
                </template>
                <!--跟进人附件-->
                <template slot="traceAttachment" slot-scope="scope">
                  <div class="vertical-button" v-for="index in ['0','1','4','5','2','3']" :key="index">
                    <div v-if="checkButton(scope.data.row.oldInfo.relatedType,index,scope.data.row.coordReviewDTO.reviewResult)">
                      <btn-batch-download :classType="false"
                                          :title="$t('common.downLoad')"
                                          :disabled="scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index].length===0:scope.data.row.oldInfo['traceAttach'+index].length===0"
                                          :fileID="fileForm(scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index]:scope.data.row.oldInfo['traceAttach'+index])"></btn-batch-download>
                      <el-popover
                        class="box-column-margin-left"
                        placement="right"
                        width="200"
                        trigger="hover">
                        <div v-for="(item,i) in scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index]:scope.data.row.oldInfo['traceAttach'+index]" :key="i">
                          <el-link type="primary" @click="showPreview(getFile(item.fileName),item.fileId)">{{item.fileName}}</el-link>
                        </div>
                        <auth-button :disabled="scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index].length===0:scope.data.row.oldInfo['traceAttach'+index].length===0" slot="reference" size="small" :title="$t('common.preview')" icon="iconfont iconyulan" class="iconCircle marginLeft"></auth-button>
                      </el-popover>
                      <el-popover placement="right" width="400" trigger="click" @show="showToFile(scope.data.row.tempInfo['uploadTraceAttach'+index],index)">
                          <el-row v-for="(item, idx) in scope.data.row.tempInfo['uploadTraceAttach'+index]" :key="idx" class="box-column-margin-bottom">
                            <el-col :span="14" class="box-column-margin-right">
                              <el-input v-if="index==='0'" v-model="item.relationType" :disabled="true"></el-input>
                              <el-input v-if="index!=='0'" v-model="item.instructionFileName" :disabled="true"></el-input>
                            </el-col>
                              <auth-button type="danger"
                                          :title="$t('common.del')"
                                          class="iconCircle pssc-css feedbackmarginRight"
                                          icon="iconfont iconycjian"
                                          :size="'medium'"
                                          @click="fileDeleteItem(scope.data.row.tempInfo['uploadTraceAttach'+index], idx, scope.data.row.tempInfo['uploadTraceAttach'+index].length,index)"
                                          v-show="showDelete(scope.data.row.tempInfo['uploadTraceAttach'+index],index)"></auth-button>
                              <btn-upload :uploadApi="uploadApi"
                                          :title="$t('common.upload')"
                                          :classType="true"
                                          @uploadSuccess="uploadSuccess(arguments, scope.data.row,scope.data.row.tempInfo['uploadTraceAttach'+index][idx], index)"></btn-upload>
                              <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                          class="iconCircle"
                                          icon="iconfont iconzengjia"
                                          :size="'medium'"
                                          @click="fileAddItem(scope.data.row.tempInfo['uploadTraceAttach'+index], idx,index)"
                                          v-show="scope.data.row.tempInfo['uploadTraceAttach'+index].length === idx+1"></auth-button>
                          </el-row>
                          <auth-button icon="iconfont iconshangchuan" class="iconCircle marginLeft" slot="reference" size="small" style="margin-left:10px"
                            v-show="checkReview(scope.data.row.coordReviewDTO.reviewResult,scope.data.row.tempInfo.relatedType,index)"
                            :title="$t('common.upload')"></auth-button>
                        </el-popover>
                    <!-- <btn-upload :classType="true"
                                  :title="$t('common.upload')"
                                  class="traceUpBtn"
                                  :uploadApi="uploadApi"
                                  @uploadSuccess="uploadSuccess(arguments,scope.data.row, scope.data.$index,index)"
                                  v-if="checkReview(scope.data.row.coordReviewDTO.reviewResult,scope.data.row.relatedType1,index)"></btn-upload> -->
                    </div>
                  </div>
                </template>
                <!--复核-->
                <template slot="review" slot-scope="scope">
                   <el-radio-group v-model="scope.data.row.coordReviewDTO.reviewResult">
                    <el-radio label="1" class="radio-margin">{{$t('coordManageMain.agreeTracer')}}</el-radio>
                    <el-radio label="2" class="radio-margin">{{$t('coordManageMain.returnTracer')}}</el-radio>
                    <el-radio label="3" class="radio-margin">{{$t('coordManageMain.modify')}}</el-radio>
                  </el-radio-group>
                </template>
                <!--退回修改原因-->
                 <template slot="backTraceReason" slot-scope="scope">
                  <el-input v-if="scope.data.row.coordReviewDTO.reviewResult==='3'"
                            type="textarea"
                            v-model="scope.data.row.tempInfo.backTraceReason"
                            placeholder="字符串<=500"
                            maxlength='500'></el-input>
                  <el-input v-else-if="scope.data.row.coordReviewDTO.reviewResult==='2'"
                            type="textarea"
                            v-model="scope.data.row.oldInfo.backTraceReason"
                            placeholder="字符串<=500"
                            maxlength='500'></el-input>
                </template>
            </data-table>
            <!--反馈意见复核列表-->
            <data-table :sourceData.sync="tableData"
                        :pageAll="true"
                        :showPage="false"
                        :toolMenuFlag="true"
                        :columns="columns2"
                        :menuFlag="false"
                        max-height="400"
                        :showSelection="true"
                        @selectRowChange="selectRowChange"
                        v-if="reviewType==='2'"
                        ref="dataTable">
                <template slot="headButton">
                   <auth-button :label="$t('coordManageMain.assetFlagTitle')" type="primary" size="medium" icon="iconfont iconyifangkuanzichanguanli" @click="showAssetMark(formValue)"></auth-button>
                   <auth-button :label="$t('coordManageMain.baseInfo')" type="primary" size="medium" icon="iconfont iconpiliangshezhichanpinxinxi" @click="showPop('2')"></auth-button>
                   <auth-button :label="$t('coordManageMain.dataDownload')" type="primary" size="medium" icon="iconfont iconycxiazai" @click="showPop('3')"></auth-button>
                   <auth-button :label="$t('coordManageMain.batchAgree')" type="primary" size="medium" icon="iconfont iconpiliangqueren" class="rightBtn" @click="batchApprove"></auth-button>
                </template>
                <!--外部机构意见-->
                <template slot="feedbackQuestionContent" slot-scope="scope">
                  <span-plus :index="scope.data.row.index" :text="scope.data.row.feedbackQuestionContent"></span-plus>
                </template>
                <!--合规意见-->
                <template slot="effectReviewFlag" slot-scope="scope">
                  <div v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                    <el-input v-for="index in ['0','1','4','5','2','3']"
                              :key="index"
                              class="wbhzl"
                              :disabled="checkHg(scope.data.row.tempInfo.relatedType,index)"
                              v-model="scope.data.row.tempInfo.effectReview['practicableSuggestion'+index]"
                              placeholder="字符串<=500"
                              maxlength='500'>
                    </el-input>
                  </div>
                  <div v-else>
                   <div v-for="index in scope.data.row.oldInfo.relatedType" :key="index">
                      <el-popover placement="top-start"
                                  width="100%"
                                  trigger="hover"
                                  v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)"
                                  :content="scope.data.row.oldInfo.effectReview['practicableSuggestion'+index]">
                        <div v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)" class="hglsResultText" slot="reference">
                          {{scope.data.row.oldInfo.effectReview['practicableSuggestion'+index] | ellipsis}}
                        </div>
                      </el-popover>
                    </div>
                  </div>
                </template>
                <!--合规落实结果-->
                <template slot="practicableResult" slot-scope="scope">
                    <el-checkbox-group v-model="scope.data.row.tempInfo.relatedType" v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                      <el-checkbox label="0" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'0')">{{$t('coordManageMain.commitLs')}}</el-checkbox>
                      <el-checkbox label="1" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">{{$t('coordManageMain.commitKf')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.customerAccountName">{{scope.data.row.tempInfo.xgfName.customerAccountName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="4" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">{{$t('coordManageMain.commitDz')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.dzName&&scope.data.row.tempInfo.dzName.length>0">{{scope.data.row.tempInfo.dzName[0].areaCoordinatorName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="5" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">{{$t('coordManageMain.commitQy')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.coreAreaAttacheName">{{scope.data.row.tempInfo.xgfName.coreAreaAttacheName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="2" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">{{$t('coordManageMain.commitYw')}}
                        <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.data.row.tempInfo.xgfName&&scope.data.row.tempInfo.xgfName.coreAreaBussUserName">{{scope.data.row.tempInfo.xgfName.coreAreaBussUserName}}</el-tag>
                      </el-checkbox>
                      <el-checkbox label="3" class="vertical-check" :disabled="checkLawyer(scope.data.row.tempInfo.relatedType,'1')">{{$t('coordManageMain.commitZd')}}
                      </el-checkbox>
                    </el-checkbox-group>
                  <div v-else>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('0')">{{$t('coordManageMain.commitLs')}}
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('1')">{{$t('coordManageMain.commitKf')}}
                      <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.row.data.oldInfo.relationChargeUser1.relationChargeUserName">{{scope.row.data.oldInfo.relationChargeUser1.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('4')">{{$t('coordManageMain.commitDz')}}
                      <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.row.data.oldInfo.relationChargeUser4.relationChargeUserName">{{scope.row.data.oldInfo.relationChargeUser4.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('5')">{{$t('coordManageMain.commitQy')}}
                      <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.row.data.oldInfo.relationChargeUser5.relationChargeUserName">{{scope.row.data.oldInfo.relationChargeUser5.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('2')">{{$t('coordManageMain.commitYw')}}
                      <el-tag type="info" effect="dark" class="submitter-tag" v-if="scope.row.data.oldInfo.relationChargeUser2.relationChargeUserName">{{scope.row.data.oldInfo.relationChargeUser2.relationChargeUserName}}</el-tag>
                    </div>
                    <div class="hglsResultText" v-if="scope.data.row.oldInfo.relatedType.includes('3')">{{$t('coordManageMain.commitZd')}}
                    </div>
                  </div>
                </template>
                <!--未补回资料-->
                <template slot="supplementNoFile" slot-scope="scope">
                  <div v-if="scope.data.row.coordReviewDTO.reviewResult==='3'">
                    <el-input v-for="index in ['0','1','4','5','2','3']"
                              :key="index"
                              :disabled="checkUnFile(scope.data.row.tempInfo.relatedType,index)"
                              v-model="scope.data.row.tempInfo.supplementNoFile['supplementNoFile'+index]"
                              :placeholder="index==='0'?'':'字符串<=200'"
                              class="wbhzl"
                              maxlength='200'></el-input>
                  </div>
                  <div v-else>
                    <div v-for="index in scope.data.row.oldInfo.relatedType" :key="index">
                      <el-popover placement="top-start"
                                  width="100%"
                                  trigger="hover"
                                  v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)&&index!=='0'"
                                  :content="scope.data.row.oldInfo.supplementNoFile['supplementNoFile'+index]">
                        <div v-if="!checkHg(scope.data.row.oldInfo.relatedType,index)"  class="hglsResultText" slot="reference">
                          {{scope.data.row.oldInfo.supplementNoFile['supplementNoFile'+index] | ellipsis}}
                        </div>
                      </el-popover>
                    </div>
                  </div>
                </template>
                <!--相关附件-->
                <template slot="traceAttachment" slot-scope="scope">
                 <div class="vertical-button" v-for="index in ['0','1','4','5','2','3']" :key="index">
                   <div v-if="checkButton(scope.data.row.oldInfo.relatedType,index,scope.data.row.coordReviewDTO.reviewResult)">
                      <btn-batch-download :classType="false"
                                          :title="$t('common.downLoad')"
                                          :disabled="scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index].length===0:scope.data.row.oldInfo['traceAttach'+index].length===0"
                                          :fileID="fileForm(scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index]:scope.data.row.oldInfo['traceAttach'+index])"></btn-batch-download>
                        <el-popover class="box-column-margin-left" placement="right"  width="200" trigger="click">
                          <div v-for="(item,i) in scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index]:scope.data.row.oldInfo['traceAttach'+index]" :key="i">
                            <el-link type="primary" @click="showPreview(getFile(item.fileName),item.fileId)">{{item.fileName}}</el-link>
                          </div>
                          <auth-button :disabled="scope.data.row.coordReviewDTO.reviewResult==='3'?scope.data.row.tempInfo['traceAttach'+index].length===0:scope.data.row.oldInfo['traceAttach'+index].length===0" slot="reference" size="small" :title="$t('common.preview')" icon="iconfont iconyulan" class="iconCircle marginLeft"></auth-button>
                        </el-popover>
                        <el-popover placement="right" width="400" trigger="click" @show="showToFile(scope.data.row.tempInfo['uploadTraceAttach'+index],index)">
                          <el-row v-for="(item, idx) in scope.data.row.tempInfo['uploadTraceAttach'+index]" :key="idx" class="box-column-margin-bottom">
                            <el-col :span="14" class="box-column-margin-right">
                              <el-input v-if="index==='0'" v-model="item.relationType" :disabled="true"></el-input>
                              <el-input v-if="index!=='0'" v-model="item.instructionFileName" :disabled="true"></el-input>
                            </el-col>
                              <auth-button type="danger"
                                          :title="$t('common.del')"
                                          class="iconCircle pssc-css feedbackmarginRight"
                                          icon="iconfont iconycjian"
                                          :size="'medium'"
                                          @click="fileDeleteItem(scope.data.row.tempInfo['uploadTraceAttach'+index], idx, scope.data.row.tempInfo['uploadTraceAttach'+index].length,index)"
                                          v-show="showDelete(scope.data.row.tempInfo['uploadTraceAttach'+index],index)"></auth-button>
                              <btn-upload :uploadApi="uploadApi"
                                          :title="$t('common.upload')"
                                          :classType="true"
                                          @uploadSuccess="uploadSuccess(arguments, scope.data.row,scope.data.row.tempInfo['uploadTraceAttach'+index][idx], index)"></btn-upload>
                              <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                          class="iconCircle"
                                          icon="iconfont iconzengjia"
                                          :size="'medium'"
                                          @click="fileAddItem(scope.data.row.tempInfo['uploadTraceAttach'+index], idx,index)"
                                          v-show="scope.data.row.tempInfo['uploadTraceAttach'+index].length === idx+1"></auth-button>
                          </el-row>
                          <auth-button icon="iconfont iconshangchuan" class="iconCircle marginLeft" slot="reference" size="small" style="margin-left:10px"
                            v-show="checkReview(scope.data.row.coordReviewDTO.reviewResult,scope.data.row.tempInfo.relatedType,index)"
                            :title="$t('common.upload')"></auth-button>
                        </el-popover>
                      <!-- <btn-upload :classType="true" :title="$t('common.upload')" class="traceUpBtn" :uploadApi="uploadApi"
                                  @uploadSuccess="uploadSuccess(arguments,scope.data.row, scope.data.$index,index)"
                                  v-if="checkReview(scope.data.row.coordReviewDTO.reviewResult,scope.data.row.relatedType1,index)"></btn-upload> -->
                   </div>
                  </div>
                </template>
                <!--复核-->
                <template slot="review" slot-scope="scope">
                   <el-radio-group v-model="scope.data.row.coordReviewDTO.reviewResult">
                    <el-radio label="1" class="radio-margin">{{$t('coordManageMain.agreeTracer')}}</el-radio>
                    <el-radio label="2" class="radio-margin">{{$t('coordManageMain.returnTracer')}}</el-radio>
                    <el-radio label="3" class="radio-margin">{{$t('coordManageMain.modify')}}</el-radio>
                  </el-radio-group>
                </template>
                <!--退回修改原因-->
                <template slot="backTraceReason" slot-scope="scope">
                  <el-input v-if="scope.data.row.coordReviewDTO.reviewResult==='3'"
                            type="textarea"
                            v-model="scope.data.row.tempInfo.backTraceReason"
                            placeholder="字符串<=500"
                            maxlength='500'></el-input>
                  <el-input v-else-if="scope.data.row.coordReviewDTO.reviewResult==='2'"
                            type="textarea"
                            v-model="scope.data.row.oldInfo.backTraceReason"
                            placeholder="字符串<=500"
                            maxlength='500'></el-input>
                </template>
                <!--查看履历-->
                 <template slot="viewHistory" slot-scope="scope">
                  <auth-button :title="$t('common.view')" icon="iconfont iconlvli" class="iconCircle marginLeft" @click="showHistory(scope.data.row)"></auth-button>
                </template>
            </data-table>
         </template>
    </external-transition>
    <pre-view ref="preView" :oosUrl="config.VUE_APP_OSS_URL" :fileUrl="config.VUE_APP_BASE_URL" :dialogAttrs="dialogAttrs"></pre-view>
    <!-- 批量落实/审核 -->
    <effectBatchPop v-if="effectBatchVisible"
                      :visible.sync="effectBatchVisible"
                      :editModel="newEditModel"
                      :form="queryParas"
                      :popTitle="popTitle"
                      :keyIdArray="keyIdArray"
                      :assetInfoId="assetInfoId"
                      ref="effectBatchPop"
                      :effApi="effApi"></effectBatchPop>
  </div>
</template>
<script>
import { dymForm, authButton, btnBatchDownload, DataTable, btnUpload, preView, btnBatchUpload, SpanPlus } from 'newepoch-components'
import externalTransition from '@/components/element/assetoutfeedback/externalTransition'
import effectBatchPop from '@/pages/assetoutfeedback/effectDealFeedBack/effectBatchPop'
import effectDealFeedBackApi from '@/api/assetoutfeedback/effectDealFeedBack/effectDealFeedBackApi'
import { UPLOAD_API } from '@/constant'
// import * as format from '@/filters/index'
export default {
  name: 'dealAuditReviewContentSub',
  components: {
    dymForm,
    authButton,
    btnBatchDownload,
    DataTable,
    btnUpload,
    externalTransition,
    preView,
    effectBatchPop,
    btnBatchUpload,
    SpanPlus
  },
  props: {
    // 标题
    title: {
      type: String,
      require: false,
      default () {
        return ''
      }
    },
    tableData: {
      type: Array,
      require: false,
      default () {
        return []
      }
    },
    formValue: {
      type: Object,
      require: false,
      default () {
        return []
      }
    },
    reviewType: {
      type: [String],
      default () {
        return ''
      }
    },
    form: {
      type: Object,
      require: false,
      default () {
        return []
      }
    },
    queryParas: {
      type: Object,
      require: false,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      config: process.env,
      checkList: [],
      assetVisible: false,
      effectBatchVisible: false, // 基础信息，资料下载弹窗
      popTitle: '',
      keyIdArray: [],
      assetInfoId: '', // 资产Id
      selectedRows: [], // 选中数据
      slectedKeyIds: [], // 选中ID
      uploadApi: UPLOAD_API, // 文件上传
      radio: {},
      xgfName: [], // 相关方人员
      dzName: {}, // 单证人员
      slectedData: [],
      effApi: '',
      flag: '0',
      componentList: [
        {
          // 合同名称
          label: this.$t('coordManageMain.contractName'),
          disabled: true,
          cols: [8, 8, 8],
          value: 'baseContractName',
          labelWidth: '130px',
          componentName: 'el-input'
        },
        {
          // 保理金额
          label: this.$t('coordManageMain.blje'),
          disabled: true,
          cols: [8, 8, 8],
          value: 'accountsReceivable',
          labelWidth: '130px',
          componentName: 'el-input'
        },
        {
          // 合规跟进人
          label: this.$t('coordManageMain.hgTraceUserName'),
          disabled: true,
          cols: [8, 8, 8],
          value: 'traceUserName',
          labelWidth: '130px',
          componentName: 'el-input'
        },
        {
          // 供应商名称
          label: this.$t('coordManageMain.gysmc'),
          disabled: true,
          cols: [8, 8, 8],
          value: 'suppliersName',
          labelWidth: '130px',
          componentName: 'el-input'
        },
        {
          // 项目公司名称
          label: this.$t('coordManageMain.xmgsName'),
          disabled: true,
          cols: [8, 8, 8],
          value: 'projectCompanyName',
          labelWidth: '130px',
          componentName: 'el-input'
        }
      ],
      columns1: [ // 落实
        {
          // 问题序号
          prop: 'qusetionNumber',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.qusetionIndex
        },
        {
          // 外部机构意见
          prop: 'feedbackQuestionContent',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.extOrgOpinionContent
        },
        {
          // 合规落实意见
          prop: 'effectReviewFlag',
          headalign: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.effectReview
        },
        {
          // 合规落实结果
          prop: 'practicableResult',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.practicableResult
        },
        {
          // 未补回资料
          prop: 'supplementNoFile',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.supplementNoFile
        },
        {
          // 跟进人附件
          prop: 'traceAttachment',
          align: 'center',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.traceAttachment
        },
        {
          // 复核
          prop: 'review',
          align: 'center',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.review
        },
        {
          // 退回/修改原因
          prop: 'backTraceReason',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.backTraceReason
        }
      ],
      columns2: [ // 反馈
        {
          // 反馈属性
          prop: 'feedbackTimes',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.feedbackAttr,
          format: row => {
            if (row.feedbackTimes === '1') {
              return this.$t('coordManageMain.firstFeedback')
            } else if (row.feedbackTimes > '1') {
              return this.$t('coordManageMain.secondFeedback')
            }
          }
        },
        {
          // 问题序号
          prop: 'qusetionNumber',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.qusetionIndex
        },
        {
          // 外部机构意见
          prop: 'feedbackQuestionContent',
          align: 'left',
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.extOrgOpinionContent
        },
        {
          // 合规意见
          prop: 'effectReviewFlag',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.hgOpnion
        },
        {
          // 合规落实结果
          prop: 'practicableResult',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.practicableResult
        },
        {
          // 未补回资料
          prop: 'supplementNoFile',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.supplementNoFile
        },
        {
          // 相关附件
          prop: 'traceAttachment',
          align: 'center',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.relatedAttachment
        },
        {
          // 复核
          prop: 'review',
          align: 'center',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.review
        },
        {
          // 退回/修改原因
          prop: 'backTraceReason',
          align: 'left',
          slot: true,
          width: '200px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.backTraceReason
        },
        {
          // 查看履历
          prop: 'viewHistory',
          align: 'center',
          fixed: 'right',
          slot: true,
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].coordManageMain.viewHistory
        }
      ],
      dialogAttrs: {
        'top': '30px',
        'width': '80%',
        'append-to-body': true,
        'center': true,
        'title': this.$t('common.preview')
      }
    }
  },
  computed: {
    SingleImApi () {
      return effectDealFeedBackApi.getBatchInfo
    }
  },
  methods: {
    inputChange (e) {
      this.$forceUpdate()
    },
    // 提交律所与相关方
    checkLawyer (data, type) {
      if (data.length > 0) {
        if (data.includes('0') && type === '1') {
          return true
        } else if (!data.includes('0') && type === '0') {
          return true
        } else {
          return false
        }
      }
    },
    // 合规落实结果点击取消时清空合规落实意见数据
    handleChange (a, b) {
      let list = ['0', '1', '4', '5', '2', '3'].filter(item => {
        return !a.includes(item)
      })
      list.forEach(item => {
        this.$set(b.effectReview, 'practicableSuggestion' + item, '')
        delete b.effectReview['practicableSuggestion' + item]
      })
    },
    // fileId数组
    fileForm (data) {
      let fileId = []
      if (data) {
        fileId = data.map(item => {
          return item.fileId
        })
      }
      return fileId
    },
    // 附件上传按钮权限
    checkReview (arg1, arg2, index) {
      if (arg1 === '3' && arg2.includes(index.toString())) {
        return true
      }
      return false
    },
    // 合规落实意见输入权限
    checkHg (arg, index) {
      if (arg.includes(index.toString())) {
        return false
      }
      return true
    },
    // 按钮权限
    checkButton (arg1, index, arg2) {
      if (arg2 === '3') {
        return true
      } else {
        if (arg1.includes(index.toString())) {
          return true
        } else {
          return false
        }
      }
    },
    // 未补回资料输入权限
    checkUnFile (arg, index) {
      if (index > 0 && arg.includes(index.toString())) {
        return false
      }
      return true
    },
    // 行选中
    selectRowChange (selection) {
      this.selectedRows = selection
      let data = JSON.parse(JSON.stringify(this.slectedData.concat(selection)))
      let obj = {}
      this.slectedData = data.reduce((cur, next) => { // 去重
        // eslint-disable-next-line no-unused-expressions
        obj[next.keyId] ? '' : obj[next.keyId] = true && cur.push(next)
        return cur
      }, [])
    },
    getTableData (data) {
      // console.log(aaa)
    },
    // 预览
    showPreview (type, id) {
      this.$refs.preView.show(type, id)
    },
    // 获取文件类型
    getFile (e) {
      let name = ''
      let test = e.indexOf('.')
      if (test !== -1) {
        name = e.slice(test + 1)
      }
      return name
    },
    // 批量赞成
    batchApprove () {
      if (this.selectedRows.length === 0) {
        this.warning(this.$t('common.alarmDel'))
      } else {
        this.selectedRows.forEach(element => {
          element.coordReviewDTO.reviewResult = '1'
        })
      }
    },
    // 履历查看
    showHistory (val) {
      this.$emit('showHistoryDialog', val)
    },
    // 资产管理标志
    showAssetMark () {
      this.$emit('showMarkDialog', this.formValue)
    },
    // 基础信息资料下载
    showPop (type) {
      this.popTitle = this.$i18n.messages[this.$i18n.locale].effectDealFeedBackMain.singleImplement
      this.keyIdArray = [{ keyId: this.formValue.keyId }]
      this.assetInfoId = this.formValue.assetInfoId
      this.newEditModel = 'I'
      this.effectBatchVisible = true
      this.effApi = this.SingleImApi
      this.$nextTick(() => {
        this.$refs.effectBatchPop.tabNumChange(type)
      })
    },
    uploadSuccess () {
      if (arguments[3] === '0') { // 提交律所
        arguments[2].fileOssid = arguments[0][0].fileID
        arguments[2].relationType = arguments[0][0].fileName
        // arguments[1]['uploadTraceAttach' + arguments[3]].push({
        //   fileOssid: arguments[0][0].fileID,
        //   relationType: arguments[0][0].fileName
        // })
      } else { // 提交相关方
        arguments[2].instructionFileId = arguments[0][0].fileID
        arguments[2].instructionFileName = arguments[0][0].fileName
        // arguments[1]['uploadTraceAttach' + arguments[3]].push({
        //   instructionFileId: arguments[0][0].fileID,
        //   instructionFileName: arguments[0][0].fileName
        // })
      }
    },
    // 上传文件行删除
    fileDeleteItem (item, idx, length, index) {
      if (length > 1) {
        item.splice(idx, 1)
      } else {
        if (index === '0') {
          item[0].fileOssid = ''
          item[0].relationType = ''
        } else {
          item[0].instructionFileId = ''
          item[0].instructionFileName = ''
        }
      }
    },
    // 文件行新增
    fileAddItem (item, idx, index) {
      if (index === '0' && item[idx].fileOssid !== '') {
        item.push({
          fileOssid: '',
          relationType: ''
        })
      } else if (index !== '0' && item[idx].instructionFileId !== '') {
        item.push({
          instructionFileId: '',
          instructionFileName: ''
        })
      } else {
        this.warning('请先上传文件')
      }
    },
    showToFile (data, index) {
      if (data.length === 0 && index === '0') {
        data.push({
          fileOssid: '',
          relationType: ''
        })
      } else if (data.length === 0 && index !== '0') {
        data.push({
          instructionFileId: '',
          instructionFileName: ''
        })
      }
    },
    showDelete (data, index) {
      let fileName = ''
      if (index === '0') {
        fileName = data.relationType
      } else {
        fileName = data.instructionFileName
      }
      return data.length > 1 || (fileName && fileName !== '')
    },
    formatFile (row) {
      if (row.relationHandleDTO) {
        row.relationHandleDTO.forEach(item => {
          if (!this.UtilJs.isEmpty(item.supplementNoFile)) {
            return row.relationHandleDTO.supplementNoFile
          }
        })
      } else {
        return '——————'
      }
    }
  },
  filters: {
    ellipsis (value) {
      if (!value) return ''
      if (value.length > 10) {
        return value.slice(0, 10) + '...'
      }
      return value
    }
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/assetoutfeedback/common.scss'
</style>
