<template>

  <div>
    <a-page-header
      style="background-color: #FFFFFF;margin-bottom:10px"
      title="上传资料"
      sub-title=""
      @back="goBack"
    ></a-page-header>

    <a-card style="margin-bottom:10px;color: #000000d9;font-size: 15px;line-height: 2.5;">
      <div>
        <span>1.请选择所上传资料的卡类型</span>
      </div>
      <a-radio-group style="position: relative;left: 30px"
                     @change="controlChange" v-model:value="lotData.blockType" :disabled="rectificationIs">
        <a-radio :value="'model'">正式卡</a-radio>
        <a-radio :value="'test'">测试卡</a-radio>
      </a-radio-group>
      <div v-if="lotData.blockType != 'test'">
        <span style="display: block">2.是否突破价格管控</span>
        <a-radio-group style="position: relative;left: 30px;" :disabled="rectificationIs"
                       @change="controlChange" v-model:value="lotData.control">
          <a-radio :value="'controlY'">是</a-radio>
          <a-radio :value="'controlN'">否</a-radio>
        </a-radio-group>
      </div>
    </a-card>

    <!--    步骤条-->
    <a-card style="margin-bottom:10px">
      <!--      v-model:current="current"-->
      <a-steps :current="current" size="small">
        <a-step v-for="item in steps" :key="item.title" :title="item.title" :status="item.status"/>
      </a-steps>
    </a-card>
    <!--    测试卡申请单-->
    <a-card v-if="current == 0 && lotData.blockType == 'test'" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">测试卡申请单</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            type="primary"
            @click="submitLot"
          >提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）测试卡申请单是否加盖公章</li>
            <li>2）测试卡申请单中经办人、责任人身份证是否一致</li>
            <li style="color: red"
                v-if="lotNote.testCardApplicationNote != null && lotNote.testCardApplicationNote.length > 0">
              稽核结果备注：{{ lotNote.testCardApplicationNote }}
            </li>
          </ul>
        </div>
      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">

            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.testCardApplicationState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>

              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.testCardApplicationState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>
    </a-card>
    <!--    合同要求-->
    <a-card v-if="current == 0 && lotData.blockType == 'model'" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">合同要求</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            type="primary"
            @click="submitLot"
          >提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）是否在有效期</li>
            <li>2）是否明确场景，如车联网，水表等，且与风险评估表一致</li>
            <li>3）是否明确开通功能，如语音，短信，流量等</li>
            <li>4）是否明确功能限制，如定向、机卡绑定、卡片限定、限额管控、黑名单限制等</li>
            <li>5）是否明确白名单数量，具体号码，地址等</li>
            <li>6）是否明确禁止二次销售</li>
            <li>7）是否明确防范垃圾短信和骚扰电话条款</li>
            <li>8）是否无低级错误，如缺少签字，日期等</li>
            <li>9）合同签署是否是法人，是否有授权书</li>
            <li style="color: red" v-if="lotNote.contractNote != null && lotNote.contractNote.length > 0">
              稽核结果备注：{{ lotNote.contractNote }}
            </li>
          </ul>
        </div>
      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">

            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.contractState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>

              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.contractState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>
    </a-card>
    <!--    责任人和经办人授权书-->
    <a-card v-if="current == 1" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">责任人和经办人授权书</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            type="primary"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）经办人和责任人授权书齐全并且加盖公章</li>
            <li>2）经办人和责任人与授权书一致</li>
            <li style="color: red" v-if="lotNote.empowerNote != null && lotNote.empowerNote.length > 0">
              稽核结果备注：{{ lotNote.empowerNote }}
            </li>
          </ul>
        </div>


      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">

            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.empowerState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>
              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.empowerState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>


    </a-card>
    <!--    责任人和经办人身份证-->
    <a-card v-if="current == 2" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">责任人和经办人身份证</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            type="primary"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）经办人和责任人身份证复印件加盖公章</li>
            <li style="color: red" v-if="lotNote.idCardNote != null && lotNote.idCardNote.length > 0">
              稽核结果备注：{{ lotNote.idCardNote }}
            </li>
          </ul>
        </div>


      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">

            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.idCardState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>
              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">


              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.idCardState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>


    </a-card>
    <!--    客户证件扫描-->
    <a-card v-if="current == 3" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">客户证件扫描</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1" @click="handSubmit"
            type="primary"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）客户证件复印件加盖公章</li>
            <li style="color: red" v-if="lotNote.customerIdNote != null && lotNote.customerIdNote.length > 0">
              稽核结果备注：{{ lotNote.customerIdNote }}
            </li>
          </ul>
        </div>


      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">

            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.customerIdState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>
              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.customerIdState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>


    </a-card>
    <!--    风险评估表-->
    <a-card v-if="current == 4 && lotData.blockType == 'model'" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">风险评估表</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            type="primary"
            @click="submitLot"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）是否进行入网风险评估</li>
            <li>2）安全管理能力是否填写最小必要数据</li>
            <li>3）是否明确使用场景（与产品形态表一致），如车联网、水表等</li>
            <li>4）是否明确开通功能，如语音，短信，流量等</li>
            <li>5）是否明确功能限制情况，如定向，机卡绑定，卡片绑定，限额管控，黑名单限制等</li>
            <li>6）是否无低级错误，如缺少签字、日期等</li>
            <li>7）风险评估表中卡类型需写清三要素：网络制式、商业级或消费级、贴片机或插卡机</li>
            <li>8）现场考察部分截图是否清晰</li>
            <li>9）合同、入网评估表、系统受理是否一致</li>
            <li style="color: red" v-if="lotNote.riskNote != null && lotNote.riskNote.length > 0">
              稽核结果备注：{{ lotNote.riskNote }}
            </li>
          </ul>
        </div>
      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">
            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.riskState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>
              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.riskState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>


    </a-card>
    <!--    省/集团价格审批表-->
    <a-card v-if="current == 5 && lotData.control == 'controlY'" style="margin-bottom:10px">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">风险评估表</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            @click="submitLot"
            type="primary"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）最终审批价格不低于1元/户/月（对2020年1月1日前签署合同的存量客户，若存量价格审批表中只约定了保底流量无功能费的，按存量审批表执行）</li>
            <li>2）不参与打折，最低优惠至1元/户/月（2020年1月1日前签署合同的存量客户，池功能费可以按照池成员流量价格授权同步享受折扣）</li>
            <li>3）同客户同项目测试卡数量不得超100张，最高不得超500张。</li>
            <li>4）物联网开卡时提供公免卡审批表，开卡张数和公免额度与审批表一致。物联网公免卡的审批人员和流程同大网公免卡一致。</li>
            <li>5）累计限免有效期原则上不得大于15个月</li>
            <li style="color: red" v-if="lotNote.priceApprovalNote != null && lotNote.priceApprovalNote.length > 0">
              稽核结果备注：{{ lotNote.priceApprovalNote }}
            </li>
          </ul>
        </div>
      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">
            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.priceApprovalState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>

              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">


              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.priceApprovalState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传合同</div>
                  </div>
                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>
    </a-card>
    <!--承诺涵-其他材料-非必填-->
    <a-card v-if="lotData.isShow.commitmentShow">
      <div slot="title">
        <span style="float: left;position: relative;top: 4px">其他材料</span>
        <!--        操作按钮-->
        <div style="position: relative;left: 10px">
          <a-button v-if="current < steps.length - 1" type="primary" @click="nextSteps">下一步</a-button>
          <a-button
            v-if="current == steps.length - 1"
            @click="submitLot"
            type="primary"
          >
            提交
          </a-button>
          <a-button v-if="current > 0" style="margin-left: 8px" @click="prevSteps">上一步</a-button>
        </div>
      </div>
      <div style="float: left;width: 43%">
        <div class="markdown" style="position: relative;top:30px">
          <ul>
            <li>1）如有其他材料请进行上传</li>
            <li style="color: red" v-if="lotNote.commitmentNote != null && lotNote.commitmentNote.length > 0">
              稽核结果备注：{{ lotNote.commitmentNote }}
            </li>
          </ul>
        </div>
      </div>
      <div style="width: 50%;float:left;">
        <div style="height: 70%">
          <div class="thumb-example">
            <!-- swiper1 -->
            <swiper
              class="swiper gallery-top"
              :options="swiperOptionTop"
              ref="swiperTop"
            >
              <swiper-slide class="slide-1" v-for="(item, index) in swiperImg" :key="item.id">
                <iframe
                  v-if="item.urlBase"
                  frameborder="1"
                  :src="item.urlBase"
                  ref="ifr"
                  width="604px"
                  height="445px"
                  scrolling="auto">
                </iframe>
                <img style="width: 70%;height: 70%;border: 1px solid;"
                     v-if="!item.urlBase" :src="noDataPng" border="1">
                <a-button v-if="item.urlBase && lotState.commitmentState != 1"
                          style="display: block;margin-top: 10px;border-color: red;color: red"
                          danger @click="removeFile(item)">移除
                </a-button>
              </swiper-slide>
              <div
                class="swiper-button-next swiper-button-white"
                slot="button-next"
              ></div>
              <div
                class="swiper-button-prev swiper-button-white"
                slot="button-prev"
              ></div>
            </swiper>
            <!-- swiper2 Thumbs -->
            <swiper
              class="swiper gallery-thumbs"
              :options="swiperOptionThumbs"
              ref="swiperThumbs"
            >
              <swiper-slide
                class="slide"
                style="width:100px;height:100px;"
                v-for="(item, index) in swiperImg"
                :key="item.id"
              >
                <div v-if="item.urlBase" style="width: 100%;height: 96px;background: rgb(68,142,247);color: white">
                  <span style="white-space:normal; word-break:break-all;overflow:hidden;">{{ item.fileName }}</span>
                </div>

                <img style="width: 100%;height: 96px"
                     v-if="!item.urlBase" :src="noDataPng" border="1">

              </swiper-slide>
              <!--              点我上传文件按钮-->
              <div v-if="lotState.commitmentState != 1" class="clearfix">
                <a-upload
                  listType="picture-card"
                  name="file"
                  :multiple="false"
                  :action="importMinioUploadAction"
                  :customRequest="selfUploadContract"
                  :headers="tokenHeader"
                  :showUploadList="false"
                  :beforeUpload="importBeforeUpload"
                  @change="importHandleChange"
                >
                  <div v-if="lotData.contractFiles.length < 10">
                    <a-icon type="plus"/>
                    <div class="ant-upload-text">点我上传其它材料</div>
                  </div>

                </a-upload>

              </div>

              <div class="swiper-button-next swiper-button-white" slot="button-next">
                <div>
                  <!--                  <img src="../../../../assets/images/nextImg.png" alt=""/>-->
                </div>
              </div>
              <div class="swiper-button-prev swiper-button-white" slot="button-prev">
                <div>
                  <!--                  <img src="../../../../assets/images/prevImg.png" alt=""/>-->
                </div>
              </div>
            </swiper>
          </div>
        </div>
      </div>
    </a-card>
  </div>

</template>

<script>

import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {httpAction, postAction} from '@api/manage'
import {snippetsOutlined, StarFilled, StarTwoTone} from '@ant-design/icons-vue';
/*无数据图片*/
import noDataPng from '@/assets/nodata.png'
let Base64 = require('js-base64').Base64

export default {
  name: "TaskUploadData",
  mixins: [JeecgListMixin],
  inject: ['closeCurrent'],
  components: {noDataPng},
  data() {
    return {
      //是否整改
      rectificationIs: false,
      noDataPng: noDataPng,
      //加载状态
      loading: false,
      //弹窗
      previewImage: "",
      previewVisible: false,
      url: {
        updateFile: "/smsCheck/customerData/updateFile",
        minioUpload: "/smsCheck/customerData/uploadMinio",
        list: "/smsCheck/customerData/list",
        addOrEdit: "/smsLot/customerData/edit/info",
        lotInfo: "/smsLot/customerData/query/infoId",
        checkDataId: "/smsLot/customerData/query/check/dataId",
      },
      //步骤条数据
      current: 0,
      steps: "",
      stepsControlY: [
        {
          title: '合同',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人授权书',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人身份证',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '客户证件扫描',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '风险评估表',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '省/集团价格审批表',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '承诺涵（其他材料-非必填）',
          content: 'First-content',
          id: "commitment",
          status: "wait"
        }

      ],
      stepsControlN: [
        {
          title: '合同',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人授权书',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人身份证',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '客户证件扫描',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '风险评估表',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '承诺涵（其他材料-非必填）',
          content: 'First-content',
          id: "commitment",
          status: "wait"
        }

      ],
      //测试卡步骤条
      stepsTest: [
        {
          title: '测试卡申请单',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人授权书',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '责任人和经办人身份证',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '客户证件扫描',
          content: 'First-content',
          status: "wait"
        },
        {
          title: '承诺涵（其他材料-非必填）',
          id: "commitment",
          content: 'First-content',
          status: "wait"
        }
      ],
      next: "",
      prev: "",
      //客户信息ID
      infoId: "",
      lotData: {
        //卡片是否展示
        isShow: {
          commitmentShow: false,
        },
        //正式卡/测试卡
        blockType: "model",
        //价格管控
        control: "controlN",
        //合同文件
        contractFiles: [],
        //责任人和经办人授权书
        empowerFiles: [],
        //责任人和经办人身份证
        idCardFiles: [],
        //客户证件扫描
        scanningFiles: [],
        //风险评估表
        riskFiles: [],
        //价格审批表
        priceFiles: [],
        //测试卡申请单
        testCardApplication: [],
        //其他材料
        commitmentFiles: [],
      },
      //整改稽核备注
      lotNote: {
        //合同
        contractNote: null,
        //测试卡申请单
        testCardApplicationNote: null,
        //责任人经办人授权书
        empowerNote: null,
        //责任人经办人身份证
        idCardNote: null,
        //客户证件
        customerIdNote: null,
        //风险评估表稽核结果
        riskNote: null,
        //省/集团价格审批表
        priceApprovalNote: null,
        //其他材料
        commitmentNote: null,
      },
      //整改稽核结果
      lotState: {
        //合同
        contractState: null,
        //测试卡申请单
        testCardApplicationState: null,
        //责任人经办人授权书
        empowerState: null,
        //责任人经办人身份证
        idCardState: null,
        //客户证件
        customerIdState: null,
        //风险评估表稽核结果
        riskState: null,
        //省/集团价格审批表
        priceApprovalState: null,
        //其他材料
        commitmentState: null,
      },
      //缩略与大图数据源
      swiperId: 0 + 1,
      swiperImg: [{}],
      //轮播配置
      swiperOptionTop: {
        zoom: true,
        loop: false,
        loopedSlides: 5, // looped slides should be the same
        spaceBetween: 10,
        observer: true, //修改swiper自己或子元素时，自动初始化swiper
        observeParents: true, //修改swiper的父元素时，自动初始化swiper
        // autoplay: {  //自动轮播
        //   delay: 2000,
        //   disableOnInteraction: false
        // },
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev'
        }
      },
      swiperOptionThumbs: {
        loop: false,
        loopedSlides: 5, // looped slides should be the same
        spaceBetween: 10,
        centeredSlides: true,
        slidesPerView: 'auto',
        touchRatio: 0.2,
        slideToClickedSlide: true,
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev'
        }
      }
    };
  },
  created() {
    this.infoId = this.$route.query.id;
    //是否需要整改
    this.lotInfoById(this.infoId)
  },
  computed: {
    importMinioUploadAction() {
      return window._CONFIG['domianURL'] + this.url.minioUpload;
    },
  },
  props: {
    poster: {
      type: String,
      required: false,
      default: ""
    },
    controls: {
      type: Boolean,
      required: false,
      default: true
    },
    control: {
      type: Boolean,
      required: false,
      default: false
    },
  },
  watch: {
    // 监听操作
    videoData(val, oldVal) {
      const {currentTime, duration} = val;
      if (currentTime && duration && currentTime < duration) {
        this.hintOperate();
      }
    }
  },
  mounted() {
    // 实现swiper双向控制
    this.$nextTick(() => {
      const swiperTop = this.$refs.swiperTop.swiper
      const swiperThumbs = this.$refs.swiperThumbs.swiper
      swiperTop.controller.control = swiperThumbs
      swiperThumbs.controller.control = swiperTop
    })
    let control = this.lotData.control;
    //是否突破价格管控
    if (control == "controlN") {
      this.steps = this.stepsControlN;
    } else {
      this.steps = this.stepsControlY;
    }
  },
  methods: {
    /**获取物联网稽核结果*/
    lotCheckById(id) {
      let that = this;
      let url = this.url.checkDataId;
      let params = {
        infoId: id
      }
      postAction(url, params).then(res => {
        if (res.success) {
          let data = res.result;
          if (data != null) {
            for (var i in that.steps) {
              that.stepsStatus(i, data);
            }
          }
        }
      }).finally(() => {

      })
    },
    stepsStatus(current, data) {
      let that = this;
      //卡类型
      let blockType = that.lotData.blockType;
      switch (current) {
        case '0':
          if (blockType == 0) {
            //测试卡
            that.steps[current].status = data.testCardApplicationState == '0' ? "error" : "finish";
            //备注
            that.lotNote.testCardApplicationNote = data.testCardApplicationNote;
            //稽核结果
            that.lotState.testCardApplicationState = data.testCardApplicationState;
          } else {
            //正式卡
            that.steps[current].status = data.contractState == '0' ? "error" : "finish";
            that.lotNote.contractNote = data.contractNote
            that.lotState.contractState = data.contractState;
          }
          break;
        case '1':
          that.steps[current].status = data.empowerState == '0' ? "error" : "finish";
          that.lotNote.empowerNote = data.empowerNote
          that.lotState.empowerState = data.empowerState;
          break;
        case '2':
          that.steps[current].status = data.idCardState == '0' ? "error" : "finish";
          that.lotNote.idCardNote = data.idCardNote
          that.lotState.idCardState = data.idCardState
          break;
        case '3':
          that.steps[current].status = data.customerIdState == '0' ? "error" : "finish";
          that.lotNote.customerIdNote = data.customerIdNote
          that.lotState.customerIdState = data.customerIdState
          break;
        case '4':
          that.steps[current].status = data.riskState == '0' ? "error" : "finish";
          that.lotNote.riskNote = data.riskNote
          that.lotState.riskState = data.riskState
          break;
        case '5' && that.steps[current].id != "commitment":
          that.steps[current].status = data.priceApprovalState == '0' ? "error" : "finish";
          that.lotNote.priceApprovalNote = data.priceApprovalNote
          that.lotState.priceApprovalState = data.priceApprovalState
        default:
          if (that.steps[current].id == "commitment") {
            that.steps[current].status = data.commitmentState == '0' ? "error" : "finish";
            that.lotNote.commitmentNote = data.commitmentNote;
            that.lotState.commitmentState = data.commitmentState;
          }
          break;
      }
    },
    /**获取物联网文件数据*/
    lotInfoById(id) {
      let that = this;
      let url = this.url.lotInfo;
      let params = {
        infoId: id
      }
      postAction(url, params).then(res => {
        if (res.success) {
          let data = res.result;
          if (data == null || !data) {
            return;
          }
          that.lotDataValue(data);
        }
      }).finally(() => {

      })
    },
    lotDataValue(data) {
      let that = this;
      //为整改
      that.rectificationIs = true;
      //是否突破价格管控 0:未突破；1:突破
      that.lotData.control = data.control == 0 ? "controlN" : "controlY";
      //卡类型 0测试卡；1正式卡,
      that.lotData.blockType = data.blockType == 0 ? "test" : "model";
      //判断步骤类型
      let control = data.control;
      let blockType = data.blockType;
      if (control == 0 && blockType == 1) {
        this.steps = this.stepsControlN;
      } else if (control == 1 && blockType == 1) {
        this.steps = this.stepsControlY;
      } else if (blockType == 0) {
        this.steps = this.stepsTest;
      } else {
        this.steps = this.stepsControlN;
      }
      //材料覆值
      //ID
      that.lotData.id = data.id
      //合同
      that.lotData.contractFiles = that.packageArr(data.contract);
      //责任人经办人授权书
      that.lotData.empowerFiles = that.packageArr(data.empower)
      //责任人经办人身份证
      that.lotData.idCardFiles = that.packageArr(data.idCard)
      //客户证件
      that.lotData.scanningFiles = that.packageArr(data.customerId)
      //风险评估表
      that.lotData.riskFiles = that.packageArr(data.risk)
      //省集团价格审批表
      that.lotData.priceFiles = that.packageArr(data.priceApproval)
      //测试卡申请单
      that.lotData.testCardApplication = that.packageArr(data.testCardApplication)
      //承诺函/其它材料
      that.lotData.commitmentFiles = that.packageArr(data.commitment);

      if (that.lotData.blockType == "model") {
        that.swiperImg = that.lotData.contractFiles
      } else if (that.lotData.blockType == 'test') {
        that.swiperImg = that.lotData.testCardApplication
      }
      //稽核结果
      that.lotCheckById(that.infoId);
    },
    /**包装轮播数据*/
    packageArr(data) {
      let id = 0;
      let newArr = []
      if (data == null) {
        newArr.push({})
        return newArr;
      }
      let splice = data.split(",");
      for (var i in splice) {
        id = id + 1;
        let filePath = splice[i];
        if (filePath == "") {
          break;
        }
        let fileName = filePath.split("/");
        fileName = fileName[fileName.length - 1];
        let swipData = {
          id: id,
          urlBase: window._CONFIG['onlinePreviewDomainURL'] + '?url='
            + encodeURIComponent(
              Base64.encode(
                (filePath)
              )),
          url: filePath,
          fileName: fileName
        }
        newArr.push(swipData);
      }
      return newArr;
    },
    /**卡类型及价格管控监听事件*/
    controlChange(a, event) {
      let blockType = this.lotData.blockType;
      let control = this.lotData.control;
      //是否突破价格管控
      if (control == "controlN" && blockType == "model") {
        this.steps = this.stepsControlN;
      } else if (control == "controlY" && blockType == "model") {
        this.steps = this.stepsControlY;
      } else if (blockType == "test") {
        this.steps = this.stepsTest;
      }
      this.current = 0;
      this.currentFileType(this.current);
    },
    /**移除文件*/
    removeFile(fileData) {
      let that = this;
      //卡类型
      let blockType = this.lotData.blockType;
      //处理轮播数据
      let swiperImg = this.swiperImg;
      let number = swiperImg.indexOf(fileData);
      swiperImg.splice(number, 1)
      if (swiperImg.length == 0) {
        swiperImg.push({})
      }
      this.swiperImg = swiperImg;
      if (that.lotData.isShow.commitmentShow) {
        this.lotData.commitmentFiles = that.swiperImg;
      } else {
        //当前步骤
        let current = this.current;
        switch (current) {
          //合同
          case 0:
            if (blockType == "test") {
              this.lotData.testCardApplication = that.swiperImg;
            } else {
              this.lotData.contractFiles = that.swiperImg;
            }
            break;
          //责任人和经办人授权书
          case 1:
            this.lotData.empowerFiles = that.swiperImg;
            break;
          //责任人和经办人身份证
          case 2:
            this.lotData.idCardFiles = that.swiperImg;
            break;
          //客户证件扫描
          case 3:
            this.lotData.scanningFiles = that.swiperImg;
            break;
          //风险评估表
          case 4:
            this.lotData.riskFiles = that.swiperImg;
            break;
          //价格审批表
          case 5:
            this.lotData.priceFiles = that.swiperImg;
            break;
        }
      }


    },
    /**分割数组*/
    spliceArr(data, fileData) {
      let indexOf = data.indexOf(fileData);
      return data.splice(indexOf, 1)
    },
    /**自定义的上传文件方法*/
    selfUploadContract(data) {
      let that = this;
      if (data.file) {
        let formData = new FormData();
        formData.append('file', data.file)
        postAction(this.url.minioUpload, formData).then((res) => {
          if (res.success) {
            that.swiperId = that.swiperId + 1;
            //文件链接
            let filePath = res.message;
            let swipData = {
              id: that.swiperId,
              urlBase: window._CONFIG['onlinePreviewDomainURL'] + '?url='
                + encodeURIComponent(
                  Base64.encode(
                    (filePath)
                  )),
              url: filePath,
              fileName: data.file.name
            }
            if (that.swiperImg[0].urlBase) {
              that.swiperImg.push(swipData)
            } else {
              //数据发生变化
              that.swiperImg = []
              that.swiperImg[0] = swipData;
            }
            //其他材料-流程最后一步
            if (that.lotData.isShow.commitmentShow) {
              that.lotData.commitmentFiles = that.swiperImg;
              return
            }
            //当前步骤
            let current = this.current;
            switch (current) {
              //合同
              case 0:
                if (that.lotData.blockType == "test") {
                  that.lotData.testCardApplication = that.swiperImg;
                } else {
                  that.lotData.contractFiles = that.swiperImg;
                }
                break;
              //责任人和经办人授权书
              case 1:
                that.lotData.empowerFiles = that.swiperImg;
                break;
              //责任人和经办人身份证
              case 2:
                that.lotData.idCardFiles = that.swiperImg;
                break;
              //客户证件扫描
              case 3:
                that.lotData.scanningFiles = that.swiperImg;
                break;
              //风险评估表
              case 4:
                that.lotData.riskFiles = that.swiperImg;
                break;
              //价格审批表
              case 5:
                that.lotData.priceFiles = that.swiperImg;
                break;
            }


          }
        })
      }
    },
    /**文件上传成功后回调*/
    importHandleChange(info) {
    },
    /**文件格式限制*/
    importBeforeUpload(file) {
      var fileType = file.type;
      if (fileType === 'image') {
        if (fileType.indexOf('image') < 0) {
          this.$message.warning('请上传图片');
          return false;
        }
      } else if (fileType === 'file') {
        if (fileType.indexOf('image') >= 0) {
          this.$message.warning('请上传文件');
          return false;
        }
      }
      return true
    },
    /**返回上一菜单*/
    goBack() {
      this.$router.go(-1);
      this.closeCurrent();
    },
    /**下一步点击事件*/
    nextSteps() {
      if (this.swiperImg.length == 0) {
        this.$message.warn("请先上传文件！")
        return;
      }
      if (this.swiperImg.length == 1) {
        if (!this.swiperImg[0].urlBase) {
          this.$message.warn("请先上传文件！")
          return;
        }
      }
      if (this.current < this.steps.length) {
        this.current = this.current + 1;
        //其他材料
        if (this.steps[this.current].id == "commitment") {
          this.lotData.isShow.commitmentShow = true;
        } else {
          this.lotData.isShow.commitmentShow = false;
        }
        this.currentFileType(this.current);
      }
    },
    /**上一步骤*/
    prevSteps() {
      if (this.current != 0) {
        this.current = this.current - 1;
        //其他材料
        if (this.steps[this.current].id == "commitment") {
          this.lotData.isShow.commitmentShow = true;
        } else {
          this.lotData.isShow.commitmentShow = false;
        }
        this.currentFileType(this.current);
      }
    },
    /**步骤文件类型对应*/
    currentFileType(current) {
      let that = this;
      this.swiperImg = {}
      //卡类型
      let blockType = that.lotData.blockType;
      //其他材料-承诺涵
      if (that.lotData.isShow.commitmentShow) {
        that.swiperImg = that.lotData.commitmentFiles;
      } else {
        switch (current) {
          case 0:
            if (blockType == "test") {
              that.swiperImg = that.lotData.testCardApplication
            } else {
              that.swiperImg = that.lotData.contractFiles
            }
            break;
          case 1:
            that.swiperImg = that.lotData.empowerFiles
            break;
          case 2:
            that.swiperImg = that.lotData.idCardFiles
            break;
          case 3:
            that.swiperImg = that.lotData.scanningFiles
            break;
          case 4:
            that.swiperImg = that.lotData.riskFiles
            break;
          case 5:
            that.swiperImg = that.lotData.priceFiles
            break;
        }
      }
      //拒绝下标为空 影响轮播样式
      if (that.swiperImg.length == 0) {
        that.swiperImg.push({})
      }
    },
    /**提交稽核*/
    submitLot() {
      //卡类型
      let blockType = this.lotData.blockType;
      //价格突破
      let control = this.lotData.control;
      let data = {};
      //测试卡
      if (blockType == "test") {
        data = {
          //测试卡申请单
          "testCardApplication": this.urlBaseJoin(this.lotData.testCardApplication, "url"),
          //责任人经办人授权书
          "empower": this.urlBaseJoin(this.lotData.empowerFiles, "url"),
          //责任人经办人身份证
          "idCard": this.urlBaseJoin(this.lotData.idCardFiles, "url"),
          //客户证件扫描
          "customerId": this.urlBaseJoin(this.lotData.scanningFiles, "url"),
          //风险评估表
          "risk": this.urlBaseJoin(this.lotData.riskFiles, "url"),
        }
      } else {
        //突破价格管控
        if (control == "controlY") {
          data = {
            //合同文件
            "contract": this.urlBaseJoin(this.lotData.contractFiles, "url"),
            //责任人经办人授权书
            "empower": this.urlBaseJoin(this.lotData.empowerFiles, "url"),
            //责任人经办人身份证
            "idCard": this.urlBaseJoin(this.lotData.idCardFiles, "url"),
            //客户证件扫描
            "customerId": this.urlBaseJoin(this.lotData.scanningFiles, "url"),
            //风险评估表
            "risk": this.urlBaseJoin(this.lotData.riskFiles, "url"),
            //省/集团价格审批
            "priceApproval": this.urlBaseJoin(this.lotData.priceFiles, "url")
          }
        } else {
          data = {
            //合同文件
            "contract": this.urlBaseJoin(this.lotData.contractFiles, "url"),
            //责任人经办人授权书
            "empower": this.urlBaseJoin(this.lotData.empowerFiles, "url"),
            //责任人经办人身份证
            "idCard": this.urlBaseJoin(this.lotData.idCardFiles, "url"),
            //客户证件扫描
            "customerId": this.urlBaseJoin(this.lotData.scanningFiles, "url"),
            //风险评估表
            "risk": this.urlBaseJoin(this.lotData.riskFiles, "url"),
          }
        }
      }
      //其他资料

      this.postLotInfo(data);
    },
    postLotInfo(data) {
      //任务Id
      data["infoId"] = this.infoId;
      //卡类型
      data["blockType"] = this.lotData.blockType == "model" ? 1 : 0;
      //是否突破价格管控
      data["control"] = this.lotData.control == "controlY" ? 1 : 0;
      //其他材料
      data['commitment'] = this.urlBaseJoin(this.lotData.commitmentFiles, "url");
      postAction(this.url.addOrEdit, data).then((res) => {
        if (res.success) {
          this.$message.success("提交成功");
          this.$router.go(-1);
          this.closeCurrent();
          //this.$router.push({path: '/lot/check/task/check', query: {id: record.id}});
        } else {
          this.$message.error(res.message);
        }
      });
    },
    urlBaseJoin(dataArray, name) {
      let newDataArr = [];
      for (var i in dataArray) {
        let dataArrayElementElement = dataArray[i][name];
        newDataArr.push(dataArrayElementElement);
      }
      return newDataArr.toString();
    }

  }
}
;
</script>

<style lang="less" scoped>
h3 {
  margin: 20px 0 0 10px;
}

.thumb-example {
  width: 864px;
  margin-top: 20px;
  // background: #000;
}

.swiper-slide {
  background-size: cover;
  background-position: center;
}

.gallery-top {
  // height: 80% !important;
  /*height: 600px;*/
  width: 100%;
  left: 15%;
  margin-bottom: 50px
}

.gallery-thumbs {
  height: 20% !important;
  box-sizing: border-box;
  padding: 10px 0px;
  /*  width: 864px;*/
  margin-left: 2px;

  .swiper-button-next {
    right: 0px;
  }

  .swiper-button-prev {
    left: 0px;
  }

  .swiper-button-next,
  .swiper-button-prev {
    background: #fff;
    width: 45px;
    text-align: center;
    height: 101px;
    top: 26%;

    div {
      margin-top: 30px;
      background: rgb(207, 205, 205);
      height: 45px;
      border-radius: 50%;

      img {
        margin: 7px 0 0 2px;
        width: 30px;
      }
    }
  }

  .swiper-button-next:hover div {
    background: rgb(189, 186, 186);
  }

  .swiper-button-prev:hover div {
    background: rgb(189, 186, 186);
  }
}

.gallery-thumbs .swiper-slide {
  width: 20%;
  height: 80px;
  // opacity: 0.4;
}

.gallery-thumbs .swiper-slide-active {
  border: 2px solid red;
}

.markdown ul > li {
  color: #000000d9;
  font-size: 15px;
  line-height: 3;
  margin-left: 20px;
  padding-left: 4px;
  list-style-type: circle;
}
</style>





