<template>
  <div>
    <!-- <el-button type="success" size="small">导 入</el-button> -->
    <importFile ref="file" accept=".xlsx" :folderid="folderid" :bindData="{ownertable:'sat_orderclueuploadbill',ownerid:'',usetype:'default'}" @onSuccess="uploadOrderclueuploadbillByExcel">
      <a class="error-link" v-if="errorurl" :href="errorurl" slot="errorFile">下载错误数据</a>
    </importFile>
  </div>
</template>

<script>
import importFile from './importFile'
export default {
  components:{
    importFile
  },
  data () {
    return {
      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
      errorurl:null
    }
  },
  methods:{
    async uploadOrderclueuploadbillByExcel (id) {
      let res = await this.$api.requested({
        "id": 20230114142503,
        "content": {
          "attachmentid":id[0]
        }
      })
      this.tool.showMessage(res,() => {
        this.$refs.file.dialogUploadVisible = false
        this.$refs.file.clearFiles()
        this.$emit('onSuccess')
      })
    },
  }
}

</script>
<style>
</style>
<style scoped>
.error-link{
  display: block;
  line-height: 30px;
}
</style>