importClue.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="container normal-panel normal-margin">
  3. <!-- <el-button type="success" size="small">导 入</el-button> -->
  4. <importFile accept=".xlsx" :folderid="folderid" :bindData="{ownertable:'sat_orderclueuploadbill',ownerid:'',usetype:'default'}" @onSuccess="uploadOrderclueuploadbillByExcel">
  5. <a class="error-link" v-if="errorurl" :href="errorurl" slot="errorFile">下载错误数据</a>
  6. </importFile>
  7. </div>
  8. </template>
  9. <script>
  10. import importFile from '@/components/import/importFile.vue'
  11. export default {
  12. components:{
  13. importFile
  14. },
  15. data () {
  16. return {
  17. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  18. errorurl:null
  19. }
  20. },
  21. methods:{
  22. async uploadOrderclueuploadbillByExcel (data,type,moduleType) {
  23. let res
  24. if(moduleType == 'module1') {
  25. res = await this.$api.requested({
  26. "classname": "webmanage.saletool.orderclue.orderclue",
  27. "method": "uploadOrderclueuploadbillByExcel",
  28. "content": {
  29. "cluetype":type,
  30. "attachmentid":data.data.attachmentids[0]
  31. }
  32. })
  33. } else {
  34. res = await this.$api.requested({
  35. "classname": "webmanage.saletool.orderclue.orderclue",
  36. "method": "uploadOrderclueuploadbillByExcelAndPlatform",
  37. "content": {
  38. "cluetype":type,
  39. "attachmentid":data.data.attachmentids[0]
  40. }
  41. })
  42. }
  43. if (res.msg !== '成功') {
  44. this.errorurl = res.msg
  45. window.open(res.msg,'_self')
  46. } else {
  47. this.errorurl = null
  48. }
  49. this.tool.showMessage(res,()=>{
  50. this.$emit('onSuccess')
  51. })
  52. },
  53. }
  54. }
  55. </script>
  56. <style>
  57. </style>
  58. <style scoped>
  59. .error-link{
  60. display: block;
  61. line-height: 30px;
  62. }
  63. </style>