<!-- 落实结果 -->
<template>
  <div class="effectFeedBackContentLawSub">
    <el-form ref="effectForm" :model="effectForm">
      <el-row v-if="code ==='SH' || code === 'SLS'">
        <el-form-item :label="$t('effectDealFeedBackMain.implementResult')" label-width="90px">
          <el-checkbox-group
            v-model="effectForm.checkedAudit"
            @change="checkboxChange"
            :min="0"
            :max="chanageMaxAudit()">
            <el-checkbox v-for="item in implementationResult" :label="item.id" :key="item.id" :disabled="item.disabled">
              <span class="effectoutfontStyle">{{item.name}}</span>
                <el-tag v-if="item.xgfName && item.xgfName !== '' && effectForm.checkedAudit.includes(item.id)" type="info" effect="dark" class="submitter-tag">{{item.xgfName}}</el-tag>
            </el-checkbox>
            <span></span>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <el-row v-else>
        <el-form-item :label="$t('effectDealFeedBackMain.implementResult')" label-width="90px">
          <el-checkbox-group
            v-model="effectForm.checked"
            @change="checkboxChange"
            :min="0"
            :max="chanageMax()">
            <el-checkbox v-for="item in implementationResult" :label="item.id" :key="item.id" :disabled="item.disabled">
              <span class="effectoutfontStyle">{{item.name}}</span>
              <el-tag v-if="item.xgfName && item.xgfName !== '' && effectForm.checked.includes(item.id)" type="info" effect="dark" class="submitter-tag">{{item.xgfName}}</el-tag>
            </el-checkbox>
            <span></span>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <!-- 律所数据数据 -->
      <div v-if="code === 'LS'">
        <el-row v-if="effectForm.checked[0] === '1'">
          <el-col :span='16'>
            <el-form-item :label="$t('effectDealFeedBackMain.lawBack')" label-width="90px" :prop="`notImplementAssetInfoDto.questionList.`+ effectForm.index + `.replyOutPostDto.replyLawContent`"
            :rules="[{ required: true, message: $t('effectDealFeedBackMain.lawBack') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
              <el-input :placeholder="$t('effectDealFeedBackMain.input500')" :maxlength="500" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.replyLawContent" type="textarea" :autosize="{ minRows: 4, maxRows: 4}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('common.attachment')" label-width="90px">
              <el-popover
                placement="right"
                width="400"
                trigger="click"
                @show="showToFile">
                <el-row v-for="(item, index) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList" :key="index" class="box-column-margin-bottom">
                  <el-col :span="14" class="box-column-margin-right">
                    <el-input v-model="item.fileName" :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(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length)"
                                v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length > 1 || item.fileName !== ''"></auth-button>
                    <!-- 上传 -->
                    <btn-upload :uploadApi="s_uploadApi"
                                :title="$t('common.upload')"
                                fileType=".pdf"
                                :classType="true"
                                @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index)"></btn-upload>
                    <!-- 增加 -->
                    <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                class="iconCircle"
                                icon="iconfont iconzengjia"
                                :size="'medium'"
                                @click="fileAddItem(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index)"
                                v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length === index+1"></auth-button>
              </el-row>
              <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
            </el-popover>
              <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" @uploadSuccess="lsuploadSuccess" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton"></btn-batch-upload> -->
              <el-checkbox class="box-column-margin-left" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyOutPostDto.chapterFlag" true-label="2" false-label="1"><span class="effectoutfontStyle">{{$t('effectDealFeedBackMain.uploadComElec')}}</span></el-checkbox>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 相关方数据 -->
        <div class="xgfStyle" v-for="(item, index) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList" :key="item.id">
          <el-row>
            <el-form-item :label="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].title" label-width="50%"  class="xgfbackground" prop="custService">
              <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" v-if="(item.relationType ==='1' && effectForm.notImplementAssetInfoDto.suppliersStampWay === $t('effectDealFeedBackMain.elecSeal')) || (item.relationType ==='5' && effectForm.notImplementAssetInfoDto.projectCompanyStampWay === $t('effectDealFeedBackMain.elecSeal'))" @click="elecSup(item)"></auth-button>
              <!-- <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" @click="elecSup(item)"></auth-button> -->
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 合规落实 -->
              <el-form-item :label="$t('effectDealFeedBackMain.practicableSuggeste')" label-width="110px" :prop="`notImplementAssetInfoDto.questionList.` + effectForm.index + '.replyRelationPostDtoList.' + index + '.practicableSuggestion'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.practicableSuggeste') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input500')" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].practicableSuggestion" :maxlength="500" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
            <el-col  :span="8">
              <!-- 情况说明模板 -->
              <el-form-item :label="$t('effectDealFeedBackMain.scenTemplate')" label-width="160px" prop="situation" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList">
                <template>
                    <el-popover
                      placement="right"
                      width="400"
                      trigger="click"
                       @show="showToRelFile(index)">
                      <el-row v-for="(fileItem, num) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList" :key="num" class="box-column-margin-bottom">
                        <el-col :span="14" class="box-column-margin-right">
                          <el-input v-model="fileItem.fileName" :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(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length)"
                                      v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length > 1 || fileItem.fileName !== ''"></auth-button>
                          <!-- 上传 -->
                          <btn-upload :uploadApi="s_uploadApi"
                                      :title="$t('common.upload')"
                                      :classType="true"
                                      @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"></btn-upload>
                          <!-- 增加 -->
                          <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                      class="iconCircle"
                                      icon="iconfont iconzengjia"
                                      :size="'medium'"
                                      :disabled="effectForm.situation && effectForm.situation === true"
                                      @click="fileAddItem(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"
                                      v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length === num+1"></auth-button>
                    </el-row>
                    <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
                  </el-popover>
                  <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" :btnDisplay="true" :batchUploadName="$t('common.upload')" style="margin-left: 0px;margin-right: 10px" @uploadSuccess="uploadSuccess(arguments, item, index)"></btn-batch-upload> -->
                  <auth-button class="box-column-margin-left" size="medium"  type="primary" :label="$t('effectDealFeedBackMain.selExisttem')" @click="selectExisTemplate(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].id)"></auth-button>
                </template>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 未补回资料 -->
              <el-form-item :label="$t('effectDealFeedBackMain.supplementNoFile')" label-width="110px" :prop="`notImplementAssetInfoDto.questionList.` + effectForm.index + '.replyRelationPostDtoList.' + index + '.supplementNoFile'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.supplementNoFile') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input200')" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].replyRelationPostDtoList[index].supplementNoFile" :maxlength="200" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 律所数据数据 -->
      <div v-if="code === 'XGF'">
        <el-row v-if="effectForm.checked[0] === '1'">
          <el-col :span='16'>
            <el-form-item :label="$t('effectDealFeedBackMain.lawBack')" label-width="90px" :prop="`relationHandlingQuestionDtoList.`+ effectForm.index + `.replyOutPostDto.replyLawContent`"
            :rules="[{ required: true, message: $t('effectDealFeedBackMain.lawBack') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
              <el-input :placeholder="$t('effectDealFeedBackMain.input500')" :maxlength="500" v-model="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.replyLawContent" type="textarea" :autosize="{ minRows: 4, maxRows: 4}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('common.attachment')" label-width="90px">
              <el-popover
                placement="right"
                width="400"
                trigger="click"
                @show="showToFile">
                <el-row v-for="(item, index) in effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList" :key="index">
                  <el-col :span="14">
                    <el-input class="box-column-margin-right" v-model="item.fileName" :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(effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index, effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length)"
                                v-show="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length > 1 || item.fileName !== ''"></auth-button>
                    <!-- 上传 -->
                    <btn-upload :uploadApi="s_uploadApi"
                                :title="$t('common.upload')"
                                :classType="true"
                                @uploadSuccess="uploaduploadSuccess(arguments, effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index)"></btn-upload>
                    <!-- 增加 -->
                    <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                class="iconCircle"
                                icon="iconfont iconzengjia"
                                :size="'medium'"
                                @click="fileAddItem(effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList, index)"
                                v-show="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.uploadFilePostDtoList.length === index+1"></auth-button>
              </el-row>
              <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
            </el-popover>
              <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" @uploadSuccess="lsuploadSuccess" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton"></btn-batch-upload> -->
              <el-checkbox class="box-column-margin-left" v-model="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyOutPostDto.chapterFlag" true-label="2" false-label="1"><span class="effectoutfontStyle">{{$t('effectDealFeedBackMain.uploadComElec')}}</span></el-checkbox>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 相关方数据 -->
        <div class="xgfStyle" v-for="(item, index) in effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList" :key="item.id">
          <el-row>
            <el-form-item :label="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].title" label-width="50%" class="xgfbackground" prop="custService">
              <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" v-if="(item.relationType ==='1' && effectForm.notImplementAssetInfoDto.suppliersStampWay === $t('effectDealFeedBackMain.elecSeal')) || (item.relationType ==='5' && effectForm.notImplementAssetInfoDto.projectCompanyStampWay === $t('effectDealFeedBackMain.elecSeal'))" @click="elecSup(item)"></auth-button>
              <!-- <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" @click="elecSup(item)"></auth-button> -->
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 合规落实 -->
              <el-form-item :label="$t('effectDealFeedBackMain.practicableSuggeste')" label-width="110px" :prop="`relationHandlingQuestionDtoList.` + effectForm.index + '.replyRelationPostDtoList.' + index + '.practicableSuggestion'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.practicableSuggeste') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input500')" v-model="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].practicableSuggestion" :maxlength="500" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
            <el-col  :span="8">
              <!-- 情况说明模板 -->
              <el-form-item :label="$t('effectDealFeedBackMain.scenTemplate')" label-width="160px" prop="situation" v-model="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList">
                <template>
                  <el-popover
                    placement="right"
                    width="400"
                    trigger="click"
                    @show="showToRelFile(index)">
                    <el-row v-for="(fileItem, num) in effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList" :key="num" class="box-column-margin-bottom">
                        <el-col :span="14" class="box-column-margin-right">
                          <el-input v-model="fileItem.fileName" :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(effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num, effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length)"
                                    v-show="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length > 1 || fileItem.fileName !== ''"></auth-button>
                        <!-- 上传 -->
                        <btn-upload :uploadApi="s_uploadApi"
                                    :title="$t('common.upload')"
                                    :classType="true"
                                    @uploadSuccess="uploaduploadSuccess(arguments, effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"></btn-upload>
                        <!-- 增加 -->
                        <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                    class="iconCircle"
                                    icon="iconfont iconzengjia"
                                    :size="'medium'"
                                    :disabled="effectForm.situation && effectForm.situation === true"
                                    @click="fileAddItem(effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"
                                    v-show="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length === num+1"></auth-button>
                    </el-row>
                    <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
                  </el-popover>
                  <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" :btnDisplay="true" :batchUploadName="'上传'" style="margin-left: 0px;margin-right: 10px" @uploadSuccess="uploadSuccess(arguments,item, index)"></btn-batch-upload> -->
                  <auth-button class="box-column-margin-left" size="medium"  type="primary" :label="$t('effectDealFeedBackMain.selExisttem')" @click="selectExisTemplate(effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].id)"></auth-button>
                </template>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 未补回资料 -->
              <el-form-item :label="$t('effectDealFeedBackMain.supplementNoFile')" label-width="110px" :prop="`relationHandlingQuestionDtoList.` + effectForm.index + '.replyRelationPostDtoList.' + index + '.supplementNoFile'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.supplementNoFile') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input200')" v-model="effectForm.relationHandlingQuestionDtoList[effectForm.index].replyRelationPostDtoList[index].supplementNoFile" :maxlength="200" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 律所数据数据 -->
      <div v-if="code === 'SH'">
        <el-row v-if="effectForm.checkedAudit[0] === '1'">
          <el-col :span='16'>
            <el-form-item :label="$t('effectDealFeedBackMain.lawBack')" label-width="90px" :prop="`notHandleQuestionDtoList.`+ effectForm.cindex + `.checkButtonPostDtoList.`+ 0 + `.replyOutPostDto.replyLawContent`"
            :rules="[{ required: true, message: $t('effectDealFeedBackMain.lawBack') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
              <el-input :placeholder="$t('effectDealFeedBackMain.input500')" :maxlength="500" v-model="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.replyLawContent" type="textarea" :autosize="{ minRows: 4, maxRows: 4}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('common.attachment')" label-width="90px">
              <el-popover
                placement="right"
                width="400"
                trigger="click"
                @show="showToFile">
                <el-row v-for="(item, index) in effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList" :key="index">
                  <el-col :span="14">
                    <el-input class="box-column-margin-right" v-model="item.fileName" :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(effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList, index, effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.length)"
                                v-show="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.length > 1 || item.fileName !== ''"></auth-button>
                    <!-- 上传 -->
                    <btn-upload :uploadApi="s_uploadApi"
                                :title="$t('common.upload')"
                                :classType="true"
                                @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList, index)"></btn-upload>
                    <!-- 增加 -->
                    <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                class="iconCircle"
                                icon="iconfont iconzengjia"
                                :size="'medium'"
                                @click="fileAddItem(effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList, index)"
                                v-show="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.length === index+1"></auth-button>
              </el-row>
              <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
            </el-popover>
              <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" @uploadSuccess="lsuploadSuccess" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton"></btn-batch-upload> -->
              <el-checkbox class="box-column-margin-left" v-model="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.chapterFlag" true-label="2" false-label="1"><span class="effectoutfontStyle">{{$t('effectDealFeedBackMain.uploadComElec')}}</span></el-checkbox>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 相关方数据 -->
        <div class="xgfStyle" v-for="(item, index) in effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList" :key="item.id">
          <el-row>
            <el-form-item :label="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].title" label-width="50%" class="xgfbackground" prop="custService">
              <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" v-if="(item.relationType ==='1' && effectForm.notImplementAssetInfoDto.suppliersStampWay === $t('effectDealFeedBackMain.elecSeal')) || (item.relationType ==='5' && effectForm.notImplementAssetInfoDto.projectCompanyStampWay === $t('effectDealFeedBackMain.elecSeal'))" @click="elecSup(item)"></auth-button>
              <!-- <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" @click="elecSup(item)"></auth-button> -->
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 合规落实 -->
              <el-form-item :label="$t('effectDealFeedBackMain.practicableSuggeste')" label-width="110px" :prop="`notHandleQuestionDtoList.` + effectForm.cindex + `.checkButtonPostDtoList.`+ 0 + '.replyRelationPostDtoList.' + index + '.practicableSuggestion'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.practicableSuggeste') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input500')" v-model="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].practicableSuggestion" :maxlength="500" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
            <el-col  :span="8">
              <!-- 情况说明模板 -->
              <el-form-item :label="$t('effectDealFeedBackMain.scenTemplate')" label-width="160px" prop="situation" v-model="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList">
                <template>
                  <el-popover
                    placement="right"
                    width="400"
                    trigger="click"
                    @show="showToRelFile(index)">
                    <el-row v-for="(fileItem, num) in effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList" :key="num" class="box-column-margin-bottom">
                        <el-col :span="14" class="box-column-margin-right">
                          <el-input v-model="fileItem.fileName" :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(effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList, num, effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList.length)"
                                    v-show="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList.length > 1 || fileItem.fileName !== ''"></auth-button>
                        <!-- 上传 -->
                        <btn-upload :uploadApi="s_uploadApi"
                                    :title="$t('common.upload')"
                                    :classType="true"
                                    @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"></btn-upload>
                        <!-- 增加 -->
                        <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                    class="iconCircle"
                                    icon="iconfont iconzengjia"
                                    :size="'medium'"
                                    :disabled="effectForm.situation && effectForm.situation === true"
                                    @click="fileAddItem(effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"
                                    v-show="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList.length === num+1"></auth-button>
                    </el-row>
                    <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
                  </el-popover>
                  <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton" @uploadSuccess="uploadSuccess(arguments,item, index)"></btn-batch-upload> -->
                  <auth-button class="box-column-margin-left" size="medium"  type="primary" :label="$t('effectDealFeedBackMain.selExisttem')" @click="selectExisTemplate(effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].id)"></auth-button>
                </template>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 未补回资料 -->
              <el-form-item :label="$t('effectDealFeedBackMain.supplementNoFile')" label-width="110px" :prop="`notHandleQuestionDtoList.` + effectForm.cindex + `.checkButtonPostDtoList.`+ 0 + '.replyRelationPostDtoList.' + index + '.supplementNoFile'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.supplementNoFile') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input200')" v-model="effectForm.notHandleQuestionDtoList[effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].supplementNoFile" :maxlength="200" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 律所数据数据 -->
      <div v-if="code === 'SLS'">
        <el-row v-if="effectForm.checkedAudit[0] === '1'">
          <el-col :span='16'>
            <el-form-item :label="$t('effectDealFeedBackMain.lawBack')" label-width="90px" :prop="`notImplementAssetInfoDto.questionList.`+ effectForm.index + `.relationHandlingDtoList.` + effectForm.aindex + `.replyOutPostDto.replyLawContent`"
            :rules="[{ required: true, message: $t('effectDealFeedBackMain.lawBack') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
              <el-input :placeholder="$t('effectDealFeedBackMain.input500')" :maxlength="500" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.replyLawContent" type="textarea" :autosize="{ minRows: 4, maxRows: 4}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('common.attachment')" label-width="90px">
              <el-popover
                placement="right"
                width="400"
                trigger="click"
                @show="showToFile">
                <el-row v-for="(item, index) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList" :key="index">
                  <el-col :span="14">
                    <el-input class="box-column-margin-right" v-model="item.fileName" :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(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList, index, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList.length)"
                                v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList.length > 1 || item.fileName !== ''"></auth-button>
                    <!-- 上传 -->
                    <btn-upload :uploadApi="s_uploadApi"
                                :title="$t('common.upload')"
                                :classType="true"
                                @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList, index)"></btn-upload>
                    <!-- 增加 -->
                    <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                class="iconCircle"
                                icon="iconfont iconzengjia"
                                :size="'medium'"
                                @click="fileAddItem(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList, index)"
                                v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.uploadFilePostDtoList.length === index+1"></auth-button>
              </el-row>
              <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
            </el-popover>
              <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" @uploadSuccess="lsuploadSuccess" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton"></btn-batch-upload> -->
              <el-checkbox class="box-column-margin-left" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyOutPostDto.chapterFlag" true-label="2" false-label="1"><span class="effectoutfontStyle">{{$t('effectDealFeedBackMain.uploadComElec')}}</span></el-checkbox>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 相关方数据 -->
        <div class="xgfStyle" v-for="(item, index) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList" :key="item.id">
          <el-row>
            <el-form-item :label="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].title" label-width="50%" class="xgfbackground" prop="custService">
              <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" v-if="!(item.relationType ==='1' && effectForm.notImplementAssetInfoDto.suppliersStampWay === $t('effectDealFeedBackMain.elecSeal')) || (item.relationType ==='5' && effectForm.notImplementAssetInfoDto.projectCompanyStampWay === $t('effectDealFeedBackMain.elecSeal'))" @click="elecSup(item)"></auth-button>
              <!-- <auth-button size="medium"  type="primary" :label="$t('effectDealFeedBackMain.elecImplement')" @click="elecSup(item)"></auth-button> -->
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 合规落实 -->
              <el-form-item :label="$t('effectDealFeedBackMain.practicableSuggeste')" label-width="110px" :prop="`notImplementAssetInfoDto.questionList.` + effectForm.index + `.relationHandlingDtoList.` + effectForm.aindex + '.replyRelationPostDtoList.' + index + '.practicableSuggestion'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.practicableSuggeste') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input500')" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].practicableSuggestion" :maxlength="500" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
            <el-col  :span="8">
              <!-- 情况说明模板 -->
              <el-form-item :label="$t('effectDealFeedBackMain.scenTemplate')" label-width="160px" prop="situation" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList">
                <template>
                  <el-popover
                    placement="right"
                    width="400"
                    trigger="click"
                    @show="showToRelFile(index)">
                    <el-row v-for="(fileItem, num) in effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList" :key="num" class="box-column-margin-bottom">
                        <el-col :span="14" class="box-column-margin-right">
                          <el-input v-model="fileItem.fileName" :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(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList, num, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList.length)"
                                    v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList.length > 1 || fileItem.fileName !== ''"></auth-button>
                        <!-- 上传 -->
                        <btn-upload :uploadApi="s_uploadApi"
                                    :title="$t('common.upload')"
                                    :classType="true"
                                    @uploadSuccess="uploaduploadSuccess(arguments, effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"></btn-upload>
                        <!-- 增加 -->
                        <auth-button :title="$t('feedbackMaterialIndex.addT')"
                                    class="iconCircle"
                                    icon="iconfont iconzengjia"
                                    :size="'medium'"
                                    :disabled="effectForm.situation && effectForm.situation === true"
                                    @click="fileAddItem(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList, num)"
                                    v-show="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList.length === num+1"></auth-button>
                    </el-row>
                    <auth-button icon="iconfont iconshangchuan" slot="reference" size="medium"  type="primary" :label="$t('common.upload')"></auth-button>
                  </el-popover>
                  <!-- <btn-batch-upload :uploadApi="uploadApi" type="primary" :btnDisplay="true" :batchUploadName="$t('common.upload')" class="xgfStyleButton" @uploadSuccess="uploadSuccess(arguments, item, index)"></btn-batch-upload> -->
                  <auth-button class="box-column-margin-left" size="medium"  type="primary" :label="$t('effectDealFeedBackMain.selExisttem')" @click="selectExisTemplate(effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].id)"></auth-button>
                </template>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="16">
              <!-- 未补回资料 -->
              <el-form-item :label="$t('effectDealFeedBackMain.supplementNoFile')" label-width="110px" :prop="`notImplementAssetInfoDto.questionList.` + effectForm.index + `.relationHandlingDtoList.` + effectForm.aindex + '.replyRelationPostDtoList.' + index + '.supplementNoFile'"
              :rules="[{ required: true, message: $t('effectDealFeedBackMain.supplementNoFile') + $t('feedbackMaterialIndex.null'),trigger: ['change']}]">
                <el-input :placeholder="$t('effectDealFeedBackMain.input200')" v-model="effectForm.notImplementAssetInfoDto.questionList[effectForm.index].relationHandlingDtoList[effectForm.aindex].replyRelationPostDtoList[index].supplementNoFile" :maxlength="200" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-form>
    <overView-template-pop v-if="overViewVisible" :visible.sync="overViewVisible" :form.sync="effectForm" :editModel="lawEditModel" :id="id" :code="code"></overView-template-pop>
    <!-- 发补寄 -->
    <supple-doc-batch-pop v-if="suppleDocVisible" :visible.sync="suppleDocVisible" :form.sync="effectForm" :editModel="editModel" :rowData="rowData"></supple-doc-batch-pop>
  </div>
</template>

<script>
import suppleDocBatchPop from '@/pages/assetoutfeedback/effectDealFeedBack/suppleDocBatchPop'
import { dymForm, btnBatchUpload, authButton, btnUpload } from 'newepoch-components'
import { mapGetters } from 'vuex'
import effectDealFeedBackApi from '@/api/assetoutfeedback/effectDealFeedBack/effectDealFeedBackApi'
import { BATCH_UPLOAD_API, UPLOAD_API } from '@/constant'
import overViewTemplatePop from '@/pages/assetoutfeedback/effectDealFeedBack/overViewTemplatePop'
export default {
  components: { dymForm, btnBatchUpload, overViewTemplatePop, authButton, suppleDocBatchPop, btnUpload },
  props: {
    form: {
      type: Object,
      default () {
        return {}
      }
    },
    effApi: {
      type: Object,
      default () {
        return {}
      }
    },
    lawEditModel: {
      type: String,
      default () {
        return ''
      }
    },
    code: {
      type: String,
      default () {
        return ''
      }
    }
  },
  data () {
    let $this = this
    return {
      id: '',
      s_uploadApi: UPLOAD_API,
      rowData: {},
      oldCheck: [],
      xgfData: {},
      oldCheckcheckedAudit: [],
      editModel: '',
      suppleDocVisible: false,
      overViewVisible: false,
      uploadApi: BATCH_UPLOAD_API,
      checkbox: '',
      implementationResult: [
        {
          id: '1',
          // 提交律所
          name: $this.$t('effectDealFeedBackMain.commitLs'),
          disabled: false
        }, {
          id: '2',
          // 提交客服
          xgfName: '',
          name: $this.$t('effectDealFeedBackMain.commitKf')
        }, {
          id: '3',
          // 提交业务
          xgfName: '',
          name: $this.$t('effectDealFeedBackMain.commitYw')
        }, {
          id: '4',
          // 提交中登
          name: $this.$t('effectDealFeedBackMain.commitZd')
        }, {
          id: '5',
          // 提交单证
          name: $this.$t('effectDealFeedBackMain.commitDz')
        }, {
          id: '6',
          // 提交区域专员
          xgfName: '',
          name: $this.$t('effectDealFeedBackMain.commitQyzy')
        }]
    }
  },
  computed: {
    effectForm: {
      get: function () {
        return this.form
      },
      set: function (value) {
        this.$emit('update:form', value)
      }
    },
    editCode: {
      get: function () {
        return this.code
      }
    },
    xgfApi () {
      return effectDealFeedBackApi.getRelationName
    },
    dzApi () {
      return effectDealFeedBackApi.getDzList
    },
    ...mapGetters(['userId'])
  },
  mounted () {
    this.oldCheckcheckedAudit = this.effectForm.checkedAudit
    this.oldCheck = this.effectForm.checked
    this.checkboxDisabled()
    this.getXgfObject()
  },
  methods: {
    xgfDataChoose (id) {
      let obj = {
        relationChargeUserId: '',
        relationChargeUserName: ''
      }
      // 若相关方数据为空的时候就返回空串
      if (this.UtilJs.isEmpty(this.xgfData)) {
        return obj
      }
      // 若相关方数据不为空时，分别赋值
      // 客服
      if (id === '2') {
        obj.relationChargeUserId = this.xgfData.customerAccountId
        obj.relationChargeUserName = this.xgfData.customerAccountName
        // 业务
      } else if (id === '3') {
        obj.relationChargeUserId = this.xgfData.coreAreaBussUserId
        obj.relationChargeUserName = this.xgfData.coreAreaBussUserName
        // 区域专员
      } else if (id === '6') {
        obj.relationChargeUserId = this.xgfData.coreAreaAttache
        obj.relationChargeUserName = this.xgfData.coreAreaAttacheName
        // 单证
      } else if (id === '5') {
        obj.relationChargeUserId = this.xgfData.areaCoordinatorId ? this.xgfData.areaCoordinatorId : ''
        obj.relationChargeUserName = this.xgfData.areaCoordinatorName ? this.xgfData.areaCoordinatorName : ''
      }
      return obj
    },
    // 相关方人员配置
    getXgfObject () {
      let param = {}
      // 单证入参对象
      let dzparam = {
        specialPlanPeriodsId: '',
        // coordinatorType: '3',
        productId: ''
      }
      // 为批量审核的时候
      if (this.code === 'LS' && this.lawEditModel === 'A') {
        param.assetInfoId = this.effectForm.assetInfoId
      } else {
        param.assetInfoId = this.effectForm.notImplementAssetInfoDto.assetInfoId
      }
      // 为批量审核/待处理/相关方正在处理中任务
      // 单证条件赋值
      if ((this.code === 'LS' && this.lawEditModel === 'A') || this.code === 'SH' || this.code === 'SLS') {
        dzparam.specialPlanPeriodsId = this.effectForm.notHandleQuestionDtoList[0].periods
        dzparam.productId = this.effectForm.notHandleQuestionDtoList[0].projectId
      } else if (this.code === 'LS' && this.lawEditModel !== 'A') {
        dzparam.specialPlanPeriodsId = this.effectForm.notImplementAssetInfoDto.questionList[0].periods
        dzparam.productId = this.effectForm.notImplementAssetInfoDto.questionList[0].projectId
      } else if (this.code === 'XGF') {
        dzparam.specialPlanPeriodsId = this.effectForm.relationHandlingQuestionDtoList[0].periods
        dzparam.productId = this.effectForm.relationHandlingQuestionDtoList[0].projectId
      }
      // 获取单证人员信息
      this.dzApi.getList(dzparam).then(res => {
        if (res.code === '0' && res.data.coordinators) {
          Object.assign(this.xgfData, res.data.coordinators[0])
          // 展示部分
          this.implementationResult[1].xgfName = res.data.coordinators[0].areaCoordinatorName
        }
      })
      // 获取客服，业务，区域专员信息
      this.xgfApi.getXgfInfo(param).then(res => {
        if (res.code === '0' && res.data && res.data.length > 0) {
          Object.assign(this.xgfData, res.data[0])
          // 展示部分
          this.implementationResult[1].xgfName = res.data[0].customerAccountName
          this.implementationResult[2].xgfName = res.data[0].coreAreaBussUserName
          this.implementationResult[5].xgfName = res.data[0].coreAreaAttacheName
        }
      })
    },
    // 初始化化律所相关方活性非活性化
    checkboxDisabled () {
      // 待落实/批量审核/相关方处理中问题
      if (this.code === 'LS' || this.code === 'XGF') {
        // 判定是否为提供律所
        if (this.effectForm.checked[0] !== '1' && this.effectForm.checked.length > 0) {
          this.implementationResult[0].disabled = true
          // 判定是否未选择提供对象
        } else if (this.effectForm.checked.length === 0) {
          this.implementationResult[0].disabled = false
        }
        // 待处理/相关方正在处理中任务
      } else {
        // 判定是否为提供律所
        if (this.effectForm.checkedAudit[0] !== '1' && this.effectForm.checkedAudit.length > 0) {
          this.implementationResult[0].disabled = true
          // 判定是否未选择提供对象
        } else if (this.effectForm.checkedAudit.length === 0) {
          this.implementationResult[0].disabled = false
        }
      }
    },
    // 选择事件
    checkboxChange () {
      // 待落实/批量审核
      if (this.code === 'LS') {
        // 將check的值置于内部数据中
        Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index], { 'checked': this.effectForm.checked })
        if (this.effectForm.checked[0] !== '1' && this.effectForm.checked.length > 0) {
          // 在不为律所的时候且选择了相关方，律所不能被选择
          this.implementationResult[0].disabled = true
          // 不为关联问题的时候
          Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index], { 'practicableResult': '2' })
        } else if (this.effectForm.checked.length === 0) {
          // 为关联问题得时候，清空律所或者相关方数据
          this.implementationResult[0].disabled = false
          Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index], { 'practicableResult': '1' })
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyOutPostDto.replyLawContent = ''
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyOutPostDto.chapterFlag = '1'
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList = []
        }
        // oldCheck: 已选box(可能为前画面记录，也可能上一次的选择) ； effectForm.checked: 双向绑定画面选择当前的情况
        let newArr = this.oldCheck.filter(x => this.effectForm.checked.every(y => y !== x))
        // 相反情况
        let offNewArr = this.effectForm.checked.filter(x => this.oldCheck.every(y => y !== x))
        if (newArr.length > 0 && newArr[0] !== '1') {
          // 拿到当前取消的下标
          let index = this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyRelationPostDtoList.findIndex(item => item.id === newArr[0])
          // 删除下标为index的数据
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyRelationPostDtoList.splice(index, 1)
        } else if (offNewArr.length > 0 && offNewArr[0] !== '1') {
          // 新增所选项内容
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyRelationPostDtoList.push({
            id: offNewArr[0],
            relationType: Number(offNewArr[0] - 1).toString(),
            title: this.implementationResult[offNewArr[0] - 1].name,
            supplementNoFile: '',
            relationChargeUserId: this.xgfDataChoose(offNewArr[0]).relationChargeUserId,
            relationChargeUserName: this.xgfDataChoose(offNewArr[0]).relationChargeUserName,
            practicableSuggestion: '',
            uploadFilePostDtoList: []
          })
        }
        // 相关方处理中问题
      } else if (this.code === 'XGF') {
        Object.assign(this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index], { 'checked': this.effectForm.checked })
        if (this.effectForm.checked[0] !== '1' && this.effectForm.checked.length > 0) {
          this.implementationResult[0].disabled = true
          Object.assign(this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index], { 'practicableResult': '2' })
        } else if (this.effectForm.checked.length === 0) {
          this.implementationResult[0].disabled = false
          Object.assign(this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index], { 'practicableResult': '1' })
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyOutPostDto.replyLawContent = ''
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyOutPostDto.chapterFlag = '1'
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList = []
        }
        let newArr = this.oldCheck.filter(x => this.effectForm.checked.every(y => y !== x))
        let offNewArr = this.effectForm.checked.filter(x => this.oldCheck.every(y => y !== x))
        if (newArr.length > 0 && newArr[0] !== '1') {
          let index = this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyRelationPostDtoList.findIndex(item => item.id === newArr[0])
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyRelationPostDtoList.splice(index, 1)
        } else if (offNewArr.length > 0 && offNewArr[0] !== '1') {
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyRelationPostDtoList.push({
            id: offNewArr[0],
            relationType: Number(offNewArr[0] - 1).toString(),
            title: this.implementationResult[offNewArr[0] - 1].name,
            relationChargeUserId: this.xgfDataChoose(offNewArr[0]).relationChargeUserId,
            relationChargeUserName: this.xgfDataChoose(offNewArr[0]).relationChargeUserName,
            supplementNoFile: '',
            practicableSuggestion: '',
            uploadFilePostDtoList: []
          })
        }
        // 待处理问题
      } else if (this.code === 'SH') {
        Object.assign(this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0], { 'checkedAudit': this.effectForm.checkedAudit })
        if (this.effectForm.checkedAudit[0] !== '1' && this.effectForm.checkedAudit.length > 0) {
          this.implementationResult[0].disabled = true
          Object.assign(this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0], { 'practicableResult': '2' })
        } else if (this.effectForm.checkedAudit.length === 0) {
          this.implementationResult[0].disabled = false
          Object.assign(this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex], { 'practicableResult': '1' })
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.replyLawContent = ''
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.chapterFlag = '1'
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList = []
        }
        let newArr = this.oldCheckcheckedAudit.filter(x => this.effectForm.checkedAudit.every(y => y !== x))
        let offNewArr = this.effectForm.checkedAudit.filter(x => this.oldCheckcheckedAudit.every(y => y !== x))
        if (newArr.length > 0 && newArr[0] !== '1') {
          let index = this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList.findIndex(item => item.id === newArr[0])
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList.splice(index, 1)
        } else if (offNewArr.length > 0 && offNewArr[0] !== '1') {
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList.push({
            id: offNewArr[0],
            relationType: Number(offNewArr[0] - 1).toString(),
            title: this.implementationResult[offNewArr[0] - 1].name,
            relationChargeUserId: this.xgfDataChoose(offNewArr[0]).relationChargeUserId,
            relationChargeUserName: this.xgfDataChoose(offNewArr[0]).relationChargeUserName,
            supplementNoFile: '',
            practicableSuggestion: '',
            uploadFilePostDtoList: []
          })
        }
        // 相关方正在处理中问题
      } else if (this.code === 'SLS') {
        Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex], { 'checkedAudit': this.effectForm.checkedAudit })
        if (this.effectForm.checkedAudit[0] !== '1' && this.effectForm.checkedAudit.length > 0) {
          this.implementationResult[0].disabled = true
          Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex], { 'practicableResult': '2' })
        } else if (this.effectForm.checkedAudit.length === 0) {
          this.implementationResult[0].disabled = false
          Object.assign(this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex], { 'practicableResult': '1' })
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyOutPostDto.replyLawContent = ''
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyOutPostDto.chapterFlag = '1'
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyOutPostDto.uploadFilePostDtoList = []
        }
        let newArr = this.oldCheckcheckedAudit.filter(x => this.effectForm.checkedAudit.every(y => y !== x))
        let offNewArr = this.effectForm.checkedAudit.filter(x => this.oldCheckcheckedAudit.every(y => y !== x))
        if (newArr.length > 0 && newArr[0] !== '1') {
          let index = this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyRelationPostDtoList.findIndex(item => item.id === newArr[0])
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyRelationPostDtoList.splice(index, 1)
        } else if (offNewArr.length > 0 && offNewArr[0] !== '1') {
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyRelationPostDtoList.push({
            id: offNewArr[0],
            relationType: Number(offNewArr[0] - 1).toString(),
            title: this.implementationResult[offNewArr[0] - 1].name,
            relationChargeUserId: this.xgfDataChoose(offNewArr[0]).relationChargeUserId,
            relationChargeUserName: this.xgfDataChoose(offNewArr[0]).relationChargeUserName,
            supplementNoFile: '',
            practicableSuggestion: '',
            uploadFilePostDtoList: []
          })
        }
      }
      this.$forceUpdate()
      // 原选择checkbox赋值
      this.oldCheckcheckedAudit = this.effectForm.checkedAudit
      this.oldCheck = this.effectForm.checked
    },
    // 文件行新增
    fileAddItem (item, index) {
      if (item[index].fileId !== '') {
        item.push({
          fileName: '',
          fileId: ''
        })
      } else {
        this.warning('请先上传文件')
      }
    },
    // 相关方上传窗口表示时处理
    showToRelFile (index) {
      // 批量审核/待落实
      if (this.code === 'LS') {
        // 画面文件新增处理
        if (this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length === 0) {
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 相关方处理中问题
      } else if (this.code === 'XGF') {
        // 画面文件新增处理
        if (this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.length === 0) {
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyRelationPostDtoList[index].uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 待处理问题
      } else if (this.code === 'SH') {
        // 画面文件新增处理
        if (this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList.length === 0) {
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyRelationPostDtoList[index].uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 相关方正在处理中问题
      } else if (this.code === 'SLS') {
        // 画面文件新增处理
        if (this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList.length === 0) {
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyRelationPostDtoList[index].uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
      }
    },
    // 选择的最大值
    chanageMax () {
      // 批量审核，待落实,相关方处理中问题
      // 当为选择律所时，checkboxgroup最大选择项为一项
      if (this.effectForm.checked[0] === '1') {
        return 1
      }
    },
    // 选择的最大值
    chanageMaxAudit () {
      // 待处理，相关方正在处理中问题
      // 当为选择律所时，checkboxgroup最大选择项为一项
      if (this.effectForm.checkedAudit[0] === '1') {
        return 1
      }
    },
    // 选择已有模板弹窗
    selectExisTemplate (id) {
      // 确认当前相关方类型id
      this.id = id
      this.overViewVisible = true
    },
    // 发起电子章补寄
    elecSup (row) {
      this.editModel = 'EIS'
      // 发起类型 (如：单笔落实、批量落实、批量落实)
      row.lawEditModel = this.lawEditModel
      // 发起code (如：待落实、待处理、相关方处理中问题、相关方正在处理中问题、批量审核)
      row.code = this.code
      this.rowData = row
      this.suppleDocVisible = true
    },
    // 弹出框显示时触发（提交律所上传附件）
    showToFile () {
      // 待落实/批量审核
      if (this.code === 'LS') {
        if (this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList.length === 0) {
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 相关方处理中问题
      } else if (this.code === 'XGF') {
        if (this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList.length === 0) {
          this.effectForm.relationHandlingQuestionDtoList[this.effectForm.index].replyOutPostDto.uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 待处理
      } else if (this.code === 'SH') {
        if (this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.length === 0) {
          this.effectForm.notHandleQuestionDtoList[this.effectForm.cindex].checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
        // 相关方正在处理中问题
      } else if (this.code === 'SLS') {
        if (this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyOutPostDto.uploadFilePostDtoList.length === 0) {
          this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationHandlingDtoList[this.effectForm.aindex].replyOutPostDto.uploadFilePostDtoList.push({
            fileId: '',
            fileName: ''
          })
        }
      }
    },
    // 律所上传
    uploaduploadSuccess () {
      arguments[1][arguments[2]].fileName = arguments[0][0].fileName
      arguments[1][arguments[2]].fileId = arguments[0][0].fileID
      this.effectForm.situation = false
    },
    // 律所文件行删除
    fileDeleteItem (item, index, length) {
      if (length > 1) {
        item.splice(index, 1)
      } else {
        item[0].fileName = ''
        item[0].fileId = ''
      }
    },
    // 上传文件成功回调事件
    uploadSuccess () {
      arguments[1].uploadFilePostDtoList.push({
        fileId: arguments[0][0].fileID,
        fileName: arguments[0][0].fileName
      })
    },
    checkBoxDisable () {
      this.implementationResult[0].disabled = false
    },
    // 校验
    checkData (val, callback) {
      // 校验是否选择checkbox
      if (this.code === 'SH' || this.code === 'SLS') {
        if (this.effectForm.checkedAudit.length < 1 && val === '2') {
          this.warning('请选择律所或者相关方')
          return
        }
      } else {
        if (this.effectForm.checked.length < 1 && val === '2') {
          this.warning('请选择律所或者相关方')
          return
        }
      }
      this.$refs.effectForm.validate((valid) => {
        if (valid) {
          if (this.code === 'LS') {
            this.effectForm.notImplementAssetInfoDto.questionList[this.effectForm.index].relationQustionFlag =
            this.effectForm.notHandleQuestionDtoList[this.effectForm.index].relationQustionFlag
          }
          callback && callback(valid)
        }
      })
    },
    // 保存改表单的数据
    save (val, callback) {
      let flag = true
      // 校验是否选择checkbox
      if (this.code === 'SH' || this.code === 'SLS') {
        if (this.effectForm.checkedAudit.length < 1 && val === '2') {
          this.warning('请选择律所或者相关方')
          return
        }
      } else {
        if (val === '2') {
          this.effectForm.notImplementAssetInfoDto.questionList.every((res, i) => {
            if (res.checked && res.checked.length === 0 && res.relationQustionFlag === '1') {
              if (res.relationHandlingDtoList && res.relationHandlingDtoList.length > 0) {
                let obj = res.relationHandlingDtoList.filter(resq =>
                  resq.relationFeedbackQustionNoFlag === '1'
                )
                if (obj.length > 0) {
                  res.practicableResult = '0'
                } else {
                  this.warning('请选择律所或者相关方或选择本次落实方案')
                  flag = false
                  return flag
                }
              } else {
                this.warning('请选择律所或者相关方')
                flag = false
                return flag
              }
            }
          })
        }
      }
      if (!flag) {
        return
      }
      if (val === '2') {
        this.$refs.effectForm.validate((valid) => {
          if (valid) {
            let param = {}
            let params = {}
            if (this.lawEditModel !== 'IS') {
              param = this.effectForm
              Object.assign(param, { 'chargebackRiskFlag': this.effectForm.notImplementAssetInfoDto.chargebackRiskFlag })
              param.questionList = []
              this.effectForm.notImplementAssetInfoDto.questionList.forEach(res => {
                let arr = []
                // 筛选不为空的文件
                // 相关方
                if (res.replyRelationPostDtoList && res.replyRelationPostDtoList.length > 0) {
                  res.replyRelationPostDtoList.forEach(resq => {
                    if (resq.practicableSuggestion !== '' && resq.supplementNoFile !== '') {
                      let arrfile = []
                      resq.uploadFilePostDtoList.forEach(resf => {
                        if (resf.fileId !== '') {
                          arrfile.push(resf)
                        }
                      })
                      resq.uploadFilePostDtoList = arrfile
                      arr.push(resq)
                    }
                  })
                  res.replyRelationPostDtoList = arr
                }
                // 律所
                if (res.replyOutPostDto && res.replyOutPostDto.replyLawContent !== '') {
                  let reparrfile = []
                  res.replyOutPostDto.uploadFilePostDtoList.forEach(resf => {
                    if (resf.fileId !== '') {
                      reparrfile.push(resf)
                    }
                  })
                  res.replyOutPostDto.uploadFilePostDtoList = reparrfile
                }
              })
              // 统合批量落实数据
              this.effectForm.notImplementAssetInfoDto.questionList.forEach(res => {
                if ((res.practicableResult === '1' && res.replyOutPostDto.replyLawContent !== '' && res.relationQustionFlag === '1') ||
                (res.practicableResult === '2' && res.replyRelationPostDtoList.length > 0 && res.relationQustionFlag === '1') ||
                  (res.relationQuestionType && res.relationQustionNo && res.relationQustionNo !== '' && res.relationQustionFlag === '2') ||
                  (res.relationHandlingDtoList && res.relationHandlingDtoList.length > 0)) {
                  if (res.relationHandlingDtoList && res.relationHandlingDtoList.length > 0) {
                    res.relationHandlingTaskDto = {}
                    res.relationHandlingTaskDto.questionKeyId = res.relationHandlingDtoList[0].questionKeyId
                    res.relationHandlingTaskDto.relationHandlingDetailTaskDtoList = res.relationHandlingDtoList
                    res.relationHandlingTaskDto.relationHandlingDetailTaskDtoList.forEach(qres => { qres.keyId = qres.relationKeyId })
                  }
                  delete res.historyDealingsSuggestionDtoList
                  delete res.repulseSuggestionDtoList
                  param.questionList.push(res)
                }
              })
              if (param.questionList.length < 1) {
                this.warning('请先选择关联问题、落实或审核数据')
                // eslint-disable-next-line no-useless-return
                return
              }
            } else {
              Object.assign(params, { 'chargebackRiskFlag': this.effectForm.notImplementAssetInfoDto.chargebackRiskFlag })
              Object.assign(params, { 'traceUserId': this.effectForm.traceUserId })
              Object.assign(params, { 'keyId': this.effectForm.keyId })
              params.daiImplQuestionPostDtoList = []
              params.daiCheckQuestionPostDtoList = []
              params.relationHandlingQuestionPostDtoList = []
              // 待落实
              this.effectForm.notImplementAssetInfoDto.questionList.forEach(res => {
                let arr = []
                // 筛选不为空的文件
                // 相关方
                if (res.replyRelationPostDtoList && res.replyRelationPostDtoList.length > 0) {
                  res.replyRelationPostDtoList.forEach(resq => {
                    if (resq.practicableSuggestion !== '' && resq.supplementNoFile !== '') {
                      let arrfile = []
                      resq.uploadFilePostDtoList.forEach(resf => {
                        if (resf.fileId !== '') {
                          arrfile.push(resf)
                        }
                      })
                      arr.push(resq)
                    }
                  })
                  res.replyRelationPostDtoList = arr
                }
                // 律所
                if (res.replyOutPostDto && res.replyOutPostDto.replyLawContent !== '') {
                  let reparrfile = []
                  res.replyOutPostDto.uploadFilePostDtoList.forEach(resf => {
                    if (resf.fileId !== '') {
                      reparrfile.push(resf)
                    }
                  })
                  res.replyOutPostDto.uploadFilePostDtoList = reparrfile
                }
              })
              // 统合待落实问题
              this.effectForm.notImplementAssetInfoDto.questionList.forEach(res => {
                if ((res.practicableResult === '1' && res.replyOutPostDto.replyLawContent !== '' && res.relationQustionFlag === '1') ||
                (res.practicableResult === '2' && res.replyRelationPostDtoList.length > 0 && res.relationQustionFlag === '1') ||
                  (res.relationQuestionType && res.relationQustionNo && res.relationQustionNo !== '' && res.relationQustionFlag === '2') ||
                  (res.relationHandlingDtoList && res.relationHandlingDtoList.length > 0 && (res.relationHandlingDtoList.filter(resf => resf.relationFeedbackQustionNoFlag === '1').length !== 0 || res.relationHandlingDtoList.filter(resf => resf.status === '已审核').length !== 0))) {
                  if (res.relationHandlingDtoList && res.relationHandlingDtoList.length > 0) {
                    res.relationHandlingTaskDto = {}
                    res.relationHandlingTaskDto.questionKeyId = res.relationHandlingDtoList[0].questionKeyId
                    res.relationHandlingTaskDto.relationHandlingDetailTaskDtoList = res.relationHandlingDtoList
                    res.relationHandlingTaskDto.relationHandlingDetailTaskDtoList.forEach(qres => { qres.keyId = qres.relationKeyId })
                  }
                  delete res.historyDealingsSuggestionDtoList
                  delete res.repulseSuggestionDtoList
                  params.daiImplQuestionPostDtoList.push(res)
                }
              })
              // 待处理
              this.effectForm.notHandleQuestionDtoList.forEach(res => {
                let arr = []
                // 筛选不为空的文件
                // 相关方
                if (res.checkButtonPostDtoList && res.checkButtonPostDtoList[0].replyRelationPostDtoList && res.checkButtonPostDtoList[0].replyRelationPostDtoList.length > 0) {
                  res.checkButtonPostDtoList[0].replyRelationPostDtoList.forEach(resq => {
                    if (resq.practicableSuggestion !== '' && resq.supplementNoFile !== '') {
                      let arrfile = []
                      resq.uploadFilePostDtoList.forEach(resf => {
                        if (resf.fileId !== '') {
                          arrfile.push(resf)
                        }
                      })
                      arr.push(resq)
                    }
                  })
                  res.checkButtonPostDtoList[0].replyRelationPostDtoList = arr
                }
                // 律所
                if (res.checkButtonPostDtoList && res.checkButtonPostDtoList[0].replyOutPostDto && res.checkButtonPostDtoList[0].replyOutPostDto.replyLawContent !== '') {
                  let reparrfile = []
                  res.checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList.forEach(resf => {
                    if (resf.fileId !== '') {
                      reparrfile.push(resf)
                    }
                  })
                  res.checkButtonPostDtoList[0].replyOutPostDto.uploadFilePostDtoList = reparrfile
                }
              })
              // 统合待处理问题
              let i = 0
              this.effectForm.notHandleQuestionDtoList.forEach(res => {
                if ((res.checkButtonPostDtoList && res.checkButtonPostDtoList[0].practicableResult === '1' && res.checkButtonPostDtoList[0].replyOutPostDto.replyLawContent !== '' && res.relationQustionFlag === '1') ||
                (res.checkButtonPostDtoList && res.checkButtonPostDtoList[0].practicableResult === '2' && res.checkButtonPostDtoList[0].replyRelationPostDtoList.length > 0 && res.relationQustionFlag === '1') ||
                  (res.relationQuestionType && res.relationQustionNo && res.relationQustionNo !== '' && res.relationQustionFlag === '2') || (res.relationDealStatus === '1' && res.status === '已终止')) {
                  // 判断是否为同一问题
                  if (params.daiCheckQuestionPostDtoList.length === 0 || res.qstDetailKeyId !== params.daiCheckQuestionPostDtoList[i - 1].qstDetailKeyId) {
                    res.keyId = res.qstDetailKeyId
                    res.checkButtonPostDtoList[0].keyId = res.handleInfoKeyId
                    params.daiCheckQuestionPostDtoList.push(res)
                    i++
                  } else {
                    res.checkButtonPostDtoList[0].keyId = res.handleInfoKeyId
                    params.daiCheckQuestionPostDtoList[i - 1].checkButtonPostDtoList.push(res.checkButtonPostDtoList[0])
                  }
                }
              })
              // 相关方处理
              this.effectForm.relationHandlingQuestionDtoList.forEach(res => {
                let arr = []
                // 筛选不为空的文件
                // 相关方
                if (res.replyRelationPostDtoList && res.replyRelationPostDtoList.length > 0) {
                  res.replyRelationPostDtoList.forEach(resq => {
                    if (resq.practicableSuggestion !== '' && resq.supplementNoFile !== '') {
                      let arrfile = []
                      resq.uploadFilePostDtoList.forEach(resf => {
                        if (resf.fileId !== '') {
                          arrfile.push(resf)
                        }
                      })
                      arr.push(resq)
                    }
                  })
                  res.replyRelationPostDtoList = arr
                }
                // 律所
                if (res.replyOutPostDto && res.replyOutPostDto.replyLawContent !== '') {
                  let reparrfile = []
                  res.replyOutPostDto.uploadFilePostDtoList.forEach(resf => {
                    if (resf.fileId !== '') {
                      reparrfile.push(resf)
                    }
                  })
                  res.replyOutPostDto.uploadFilePostDtoList = reparrfile
                }
              })
              this.effectForm.relationHandlingQuestionDtoList.forEach(res => {
                if ((res.replyOutPostDto && res.practicableResult === '1' && res.replyOutPostDto.replyLawContent !== '' && res.relationQustionFlag === '1') ||
                (res.replyRelationPostDtoList && res.practicableResult === '2' && res.replyRelationPostDtoList.length > 0 && res.relationQustionFlag === '1') ||
                  (res.relationQuestionType && res.relationQustionNo && res.relationQustionNo !== '' && res.relationQustionFlag === '2')) {
                  res.keyId = res.qstDetailKeyId
                  res.keyIds = []
                  let check = []
                  // 判断是否为是否关联问题
                  if (res.relationQustionFlag === '2') {
                    // 判定是否为同一问题
                    check = this.effectForm.relationHandlingQuestionDtoList.filter(resq => resq.qstDetailKeyId === res.qstDetailKeyId)
                  } else {
                    // 判定是否为同一问题且有为被选项
                    check = this.effectForm.relationHandlingQuestionDtoList.filter(resq => resq.qstDetailKeyId === res.qstDetailKeyId).filter(rest => rest.checkboxFlag)
                  }
                  if (check.length > 0) {
                    check.forEach(resck => {
                      if (res.relationQustionFlag === '2') {
                        res.keyIds.push(resck.handleInfoKeyId)
                      } else {
                        if (resck.fdcheckbox && resck.fdcheckbox === '1') {
                          res.keyIds.push(resck.handleInfoKeyId)
                        }
                      }
                    })
                    if (res.keyIds.length > 0) {
                      params.relationHandlingQuestionPostDtoList.push(res)
                    }
                  } else {
                    res.keyIds.push(res.handleInfoKeyId)
                    params.relationHandlingQuestionPostDtoList.push(res)
                  }
                }
              })
              if (params.daiImplQuestionPostDtoList.length === 0 && params.daiCheckQuestionPostDtoList.length === 0 && params.relationHandlingQuestionPostDtoList.length === 0) {
                this.warning('请确认数据是否填写正确')
                return
              }
              param = params
            }
            let loading = this.$loading({
              lock: true,
              text: '加载中',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.7)'
            })
            this.effApi.putDefaultUpdate(param).then(res => {
              loading.close()
              if (res.data) {
                callback && callback(res.data)
                this.success('更新落实结果成功')
                this.$emit('saveStatus', true)
              } else {
                this.error('更新落实结果失败')
                this.$emit('saveStatus', false)
              }
            }).catch(res => {
              loading.close()
            })
          }
        })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
 .submitter-tag{
  margin-left: 10px !important;
  line-height: 23px !important;
  display: inline !important;
}
@import '~@/styles/assetoutfeedback/common.scss'
</style>
