<template>
  <div class="contract-content">
    <el-form class="rule-form" label-width="150px" label-position="left">
      <div class="info-title">合同清单</div>
      <div class="form-upload-box" :key="'downstreamDetailList' +index + 5">
          <div class="form-upload-name form-required" style="width: 150px;">
            上传附件：
          </div>
          <cy-upload 
            ref="contractCheckListFileList" 
            :file-data="deatailsInfo.contractCheckListFileList" 
            :upload-params="uploadParams" 
            :disabled="disabled"
            :upload-from-status="true"
           >
           </cy-upload>
        </div>
    </el-form>
  </div>
</template>

<script>
module.exports = {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    deatailsInfo: {
      type: Object,
      default: () => {
          return {
            contractCheckListFileList: []
          }
      }
    }
  },
  data() {
    return {
      uploadParams: {
        mouldName: 'FinancialCustomer',
      }
    }
  },
  methods: {
    getSubmit() {
      return new Promise((resolve, reject) => {
        if(this.$refs.contractCheckListFileList.getFileLists.length) {
          const fileIdList = this.$refs.contractCheckListFileList.getFileLists
          resolve({ contractChecklistFileIds: fileIdList.map(item => item.id) })
        }else {
          reject(this.$message.warning('请上传合同清单附件后提交'))
        }
      })

    }
  },
}
</script>
