<script name="purchaseInfo" setup>
import { ref, watch } from 'vue'
import { fileFormatVerification, handleFileError, handleFileSuccess, handleFilePreview, reviewFileParam, fileTypes, fileDesc } from '@/utils/uploadAction'
import store from '@/store'

const props = defineProps({
    detail: {
      type: Object
    },
    basicInfoData: {
      type: Object
    },
    baseProjSetYear: {
      type: String,
      default: ''
    },
    dictionaryList: {
      type: Array,
      default: () => []
    }
  }),
  uploadUrl = store.dictStore.uploadUrl,
  formRef = ref(),
  formData = ref({
    sections: [{
      purchaseFile: [],
      biddingFile: [],
      purchaseContract: []
    }]
  }),
  currentRules = {},
  add = () => {
    formData.value.sections.push({})
  },
  del = (index) => {
    formData.value.sections.splice(index, 1)
  }
defineExpose({ formRef, formData })
watch(() => props.basicInfoData, val => {
  if (val?.baseProjIsConfidentiality === '02' || val?.baseProjSetProg === '00') {
    currentRules.value = {}
  } else {
    currentRules.value = {
      sections: [{ required: true, message: '请至少添加一个标段' }]
    }
  }
  formRef.value?.clearValidate()
}, { deep: true, immediate: true })
watch(() => props.detail, val => {
  if (val) {
    if (props.detail?.procures?.length) {
      formData.value = {
        sections: props.detail?.procures?.map(i => {
          return {
            ...i,
            purchaseFile: i.purchaseFile ? reviewFileParam(JSON.parse(i.purchaseFile)) : [],
            biddingFile: i.biddingFile ? reviewFileParam(JSON.parse(i.biddingFile)) : [],
            purchaseContract: i.purchaseContract ? reviewFileParam(JSON.parse(i.purchaseContract)) : []
          }
        }) || [{
          purchaseFile: [],
          biddingFile: [],
          purchaseContract: []
        }]
      }
    }
  }
})
</script>

<template>
  <el-form
    ref="formRef"
    :model="formData"
    :rules="currentRules"
    label-position="top"
    label-suffix=":"
    scroll-to-error
  >
    <template v-for="(item,index) in formData.sections" :key="index">
      <el-button
        v-if="formData.sections?.length>1"
        type="danger"
        icon="Delete"
        link
        class="float-right"
        @click="del(index)"
      >删除</el-button>
      <template v-if="basicInfoData?.baseProjIsConfidentiality!=='02'&&basicInfoData?.baseProjSetProg!=='00'">
        <el-row :gutter="40">
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="24">
              <el-form-item label="标段名称" :prop="`sections[${index}].baseBidName`" :rules="[{required:true,message:'请填写'}]">
                <el-input v-model="formData.sections[index].baseBidName" placeholder="请填写" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="采购方式" :prop="`sections[${index}].baseProjPurchaseWay`" :rules="[{required:true,message:'请选择'}]">
                <el-select v-model="formData.sections[index].baseProjPurchaseWay" class="w-full">
                  <el-option
                    v-for="(row,key) in dictionaryList?.filter(i => i.type === 'PURCHASE_METHOD')"
                    :key="key"
                    :label="row.label"
                    :value="row.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算执行确认书编号" :prop="`sections[${index}].basePurchaseCode`">
                <el-input
                  v-model="formData.sections[index].basePurchaseCode"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023">
            <template v-if="['01','02','03','04','06'].includes(item.baseProjPurchaseWay)&&baseProjSetYear*1>=2023">
              <el-col :span="8">
                <el-form-item label="采购代理机构" :prop="`sections[${index}].basePurchasingAgencies`" :rules="[{required:true,message:'请填写'}]">
                  <el-input
                    v-model="formData.sections[index].basePurchasingAgencies"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="采购代理机构统一社会信用代码" :prop="`sections[${index}].baseUnifiedCreditCode`" :rules="[{required:true,message:'请填写'}]">
                  <el-input
                    v-model="formData.sections[index].baseUnifiedCreditCode"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
            </template>
            <template v-else>
              <el-col :span="8">
                <el-form-item label="采购代理机构" :prop="`sections[${index}].basePurchaseCode`">
                  <el-input
                    v-model="formData.sections[index].basePurchasingAgencies"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="采购代理机构统一社会信用代码" :prop="`sections[${index}].baseUnifiedCreditCode`">
                  <el-input
                    v-model="formData.sections[index].baseUnifiedCreditCode"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
            </template>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="8">
              <el-form-item
                label="中标（成交）时间"
                :prop="`sections[${index}].baseWinningBidTime`"
                :rules="[{ required: true, message: '请选择' }]"
              >
                <el-date-picker
                  v-model="formData.sections[index].baseWinningBidTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="中标（成交）金额"
                :prop="`sections[${index}].baseProjPurchaseAmount`"
                :rules="[{ required: true, message: '请输入' }]"
              >
                <el-input-number
                  v-model="formData.sections[index].baseProjPurchaseAmount"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="中标（成交）供应商名称"
                :prop="`sections[${index}].baseConsDeprt`"
                :rules="[{ required: true, message: '请输入' }]"
              >
                <el-input
                  v-model="formData.sections[index].baseConsDeprt"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="中标（成交）供应商统一社会信用代码" :prop="`sections[${index}].baseConsDeprtUsci`" :rules="[{ required: true, message: '请输入' }]">
                <el-input
                  v-model="formData.sections[index].baseConsDeprtUsci"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023">
            <el-col :span="8">
              <el-form-item
                v-if="basicInfoData?.baseProjSetProg==='05'||baseProjSetYear*1<2023"
                label="项目款支付时间"
                :prop="`sections[${index}].basePaymentTime`"
              >
                <el-date-picker
                  v-model="formData.sections[index].basePaymentTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
              <el-form-item
                v-else
                label="项目款支付时间"
                :prop="`sections[${index}].basePaymentTime`"
                :rules="[{ required: true, message: '请选择' }]"
              >
                <el-date-picker
                  v-model="formData.sections[index].basePaymentTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item v-if="basicInfoData?.baseProjSetProg==='05'||baseProjSetYear*1<2023" label="项目款支付金额" :prop="`sections[${index}].paymentProgress`">
                <el-input-number
                  v-model="formData.sections[index].paymentProgress"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
              <el-form-item
                v-else
                label="项目款支付金额"
                :prop="`sections[${index}].paymentProgress`"
                :rules="[{ required: true, message: '请选择' }]"
              >
                <el-input-number
                  v-model="formData.sections[index].paymentProgress"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
            </el-col>
          </template>
        </el-row>
        <el-row>
          <template v-if="['05','06','07','00']?.includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="8">
              <el-form-item
                v-if="item.baseProjPurchaseWay==='00'"
                label="招标（采购）文件"
                :prop="`sections[${index}].purchaseFile`"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                  :on-preview="handleFilePreview"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
              <el-form-item
                v-else
                label="招标（采购）文件"
                :prop="`sections[${index}].purchaseFile`"
                :rules="[{required:true,message:'请上传'}]"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                  :on-preview="handleFilePreview"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                v-if="item.baseProjPurchaseWay==='00'||item.baseProjPurchaseWay==='05'"
                label="中标（成交）通知"
                :prop="`sections[${index}].biddingFile`"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].biddingFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].biddingFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                  :on-preview="handleFilePreview"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
              <el-form-item
                v-else
                label="中标（成交）通知"
                :prop="`sections[${index}].biddingFile`"
                :rules="[{required:true,message:'请上传'}]"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].biddingFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].biddingFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :on-preview="handleFilePreview"
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="采购合同"
                :prop="`sections[${index}].purchaseContract`"
                :rules="[{required:true,message:'请上传'}]"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseContract"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseContract)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
          </template>
        </el-row>
      </template>
      <template v-else>
        <el-row :gutter="40">
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="24">
              <el-form-item label="标段名称" :prop="`sections[${index}].baseBidName`">
                <el-input v-model="formData.sections[index].baseBidName" placeholder="请填写" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="采购方式" :prop="`sections[${index}].baseProjPurchaseWay`" :rules="[{required:false,message:'请选择'}]">
                <el-select v-model="formData.sections[index].baseProjPurchaseWay" class="w-full">
                  <el-option
                    v-for="(row,key) in dictionaryList?.filter(i => i.type === 'PURCHASE_METHOD')"
                    :key="key"
                    :label="row.label"
                    :value="row.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算执行确认书编号" :prop="`sections[${index}].basePurchaseCode`">
                <el-input
                  v-model="formData.sections[index].basePurchaseCode"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023">
            <template v-if="['01','02','03','04','06'].includes(item.baseProjPurchaseWay)&&baseProjSetYear*1>=2023">
              <el-col :span="8">
                <el-form-item label="采购代理机构" :prop="`sections[${index}].basePurchaseCode`" :rules="[{required:false,message:'请填写'}]">
                  <el-input
                    v-model="formData.sections[index].basePurchasingAgencies"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="采购代理机构统一社会信用代码" :prop="`sections[${index}].baseUnifiedCreditCode`" :rules="[{required:false,message:'请填写'}]">
                  <el-input
                    v-model="formData.sections[index].baseUnifiedCreditCode"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
            </template>
            <template v-else>
              <el-col :span="8">
                <el-form-item label="采购代理机构" :prop="`sections[${index}].basePurchaseCode`">
                  <el-input
                    v-model="formData.sections[index].basePurchasingAgencies"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="采购代理机构统一社会信用代码" :prop="`sections[${index}].baseUnifiedCreditCode`">
                  <el-input
                    v-model="formData.sections[index].baseUnifiedCreditCode"
                    placeholder="请填写"
                  />
                </el-form-item>
              </el-col>
            </template>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="8">
              <el-form-item
                label="中标（成交）时间"
                :prop="`sections[${index}].baseWinningBidTime`"
                :rules="[{ required: false, message: '请选择' }]"
              >
                <el-date-picker
                  v-model="formData.sections[index].baseWinningBidTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="中标（成交）金额"
                :prop="`sections[${index}].baseProjPurchaseAmount`"
                :rules="[{ required: false, message: '请输入' }]"
              >
                <el-input-number
                  v-model="formData.sections[index].baseProjPurchaseAmount"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="中标（成交）供应商名称"
                :prop="`sections[${index}].baseConsDeprt`"
                :rules="[{ required: false, message: '请输入' }]"
              >
                <el-input
                  v-model="formData.sections[index].baseConsDeprt"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="中标（成交）供应商统一社会信用代码" :prop="`sections[${index}].baseConsDeprtUsci`" :rules="[{ required: false, message: '请输入' }]">
                <el-input
                  v-model="formData.sections[index].baseConsDeprtUsci"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
          </template>
          <template v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023">
            <el-col :span="8">
              <el-form-item
                v-if="basicInfoData?.baseProjSetProg==='05'||baseProjSetYear*1<2023"
                label="项目款支付时间"
                :prop="`sections[${index}].basePaymentTime`"
              >
                <el-date-picker
                  v-model="formData.sections[index].basePaymentTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
              <el-form-item
                v-else
                label="项目款支付时间"
                :prop="`sections[${index}].basePaymentTime`"
                :rules="[{ required: false, message: '请选择' }]"
              >
                <el-date-picker
                  v-model="formData.sections[index].basePaymentTime"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item v-if="basicInfoData?.baseProjSetProg==='05'||baseProjSetYear*1<2023" label="项目款支付金额" :prop="`sections[${index}].paymentProgress`">
                <el-input-number
                  v-model="formData.sections[index].paymentProgress"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
              <el-form-item
                v-else
                label="项目款支付金额"
                :prop="`sections[${index}].paymentProgress`"
                :rules="[{ required: false, message: '请选择' }]"
              >
                <el-input-number
                  v-model="formData.sections[index].paymentProgress"
                  class="input-amount"
                  placeholder="请填写"
                  :min="0.000001"
                  :controls="false"
                  @mousewheel.prevent
                >
                  <template #suffix>万元</template>
                </el-input-number>
              </el-form-item>
            </el-col>
          </template>
        </el-row>
        <el-row>
          <template v-if="['05','06','07','00']?.includes(basicInfoData?.baseProjSetProg)">
            <el-col :span="8">
              <el-form-item
                v-if="item.baseProjPurchaseWay==='00'"
                label="招标（采购）文件"
                :prop="`sections[${index}].purchaseFile`"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
              <el-form-item
                v-else
                label="招标（采购）文件"
                :prop="`sections[${index}].purchaseFile`"
                :rules="[{required:false,message:'请上传'}]"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                v-if="item.baseProjPurchaseWay==='00'"
                label="中标（成交）通知"
                :prop="`sections[${index}].biddingFile`"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].biddingFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].biddingFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
              <el-form-item
                v-else
                label="中标（成交）通知"
                :prop="`sections[${index}].biddingFile`"
                :rules="[{required:false,message:'请上传'}]"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].biddingFile"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].biddingFile)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="采购合同"
                :prop="`sections[${index}].purchaseContract`"
              >
                <el-upload
                  v-model:file-list="formData.sections[index].purchaseContract"
                  class="w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.sections[index].purchaseContract)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  multiple
                  :limit="10"
                >
                  <el-button type="primary" class="mr-4">上传文件</el-button>
                  <template #tip>
                    <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
                  </template>
                </el-upload>
              </el-form-item>
            </el-col>
          </template>
        </el-row>
      </template>
      <el-divider v-if="index<formData.sections?.length-1" />
    </template>
  </el-form>
  <p>
    <el-button
      type="primary"
      plain
      icon="Plus"
      class="w-full"
      @click="add"
    >添加标段</el-button>
  </p>
</template>
