fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!--
 * @Author: wuyue
 * @Date: 2023-01-19 11:08:17
 * @LastEditTime: 2023-02-06 17:40:06
 * @LastEditors: wuyue
 * @Descripttion:
 * @version:
-->
<template>
  <el-dialog
    v-if="tipDialogVisible"
    :visible.sync="tipDialogVisible"
    title="上传结果"
    :close-on-click-modal="false"
    :modal-append-to-body="false"
  >
    <div class="tip-text-size" style="margin-bottom: 10px">
      成功保存{{ tableTotal - tipTableData.length }}条,失败{{
        tipTableData.length
      }}条
    </div>
    <tablePagination :tableData="tipTableData" :showOperatBtn="false">
      <el-table-column label="商品主编码" prop="spuNum"> </el-table-column>
      <el-table-column label="商品名称" prop="spuName"> </el-table-column>
      <el-table-column label="收货人" prop="contactName"> </el-table-column>
      <el-table-column label="联系方式" prop="contactPhone"> </el-table-column>
      <el-table-column label="失败原因" prop="message"> </el-table-column>
    </tablePagination>
    <div slot="footer" class="buttonPosition dialog-footer">
      <el-button
        size="mini"
        icon="el-icon-download"
        type="primary"
        :loading="errListloading"
        @click="exportData"
        >导出失败数据</el-button
      >
      <el-button size="mini" @click="tipDialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>
 
<script>
import { downloadFile } from '@/utils/downloadFile'
import tablePagination from '@/views/blindBoxActivity/components/tablePagination.vue'
 
export default {
  props: ['tipTableData', 'tableTotal', 'visible', 'excelId'],
  components: { tablePagination },
  data() {
    return {
      tipDialogVisible: false,
      errListloading: false
    }
  },
  created() {
    this.tipDialogVisible = this.visible
  },
  methods: {
    /**
     * 导出
     */
    async exportData() {
      this.errListloading = true
      const config = {
        url: `awl-order-service/order/v2/export/manualOrderCreateErrorMsg?excelId=${this.excelId}`,
        fileName: '手工建单失败数据',
        type: '.xlsx'
      }
      const res = await downloadFile(config)
      if (res) {
        this.errListloading = false
      } else {
        this.errListloading = false
      }
    }
  }
};
</script>
 
<style>
.tip-text-size {
  font-size: 18px;
}
</style>