Просмотр исходного кода

联创分红记录-增加导出

sunxbiao 1 год назад
Родитель
Сommit
1a76d29b42
1 измененных файлов с 17 добавлено и 31 удалено
  1. 17 31
      src/views/accounts/caiwutongji/originator/index.vue

+ 17 - 31
src/views/accounts/caiwutongji/originator/index.vue

@@ -47,6 +47,9 @@
47 47
             </el-button>
48 48
             <el-button type="primary" size="small" @click="getList(1)" style="width: 100px; margin-top: 20px;">查询
49 49
             </el-button>
50
+            <el-button size="mini" type="primary" style="width: 100px; margin-top: 20px;" @click="exportSearchResult">
51
+              导出
52
+            </el-button>
50 53
           </div>
51 54
         </div>
52 55
       </div>
@@ -64,30 +67,15 @@
64 67
       </div>
65 68
 
66 69
       <el-table :data="tableData.data" style="width: 100%" size="mini" class="table" highlight-current-row>
67
-
68
-
69 70
         <el-table-column label="ID" prop="id" min-width="30"/>
70
-<!--        <el-table-column label="用户名称" prop="real_name" min-width="50"/>-->
71 71
         <el-table-column label="用户昵称" prop="nickname"  min-width="80" />
72 72
         <el-table-column label="用户账号(手机号)" prop="account"  min-width="80" />
73
-
74
-<!--        <el-table-column label="用户姓名" prop="nickname" min-width="50"/>-->
75 73
         <el-table-column label="联创等级" prop="title" min-width="50"/>
76 74
         <el-table-column label="联创缴纳金额" prop="number" min-width="50"/>
77 75
         <el-table-column label="本次联创分红总金额" prop="all_record" min-width="80"/>
78 76
         <el-table-column label="当前等级分红总金额" prop="all_amount" min-width="90"/>
79 77
         <el-table-column label="获得分红金额" prop="money" min-width="70"/>
80
-        <el-table-column
81
-            prop="create_time"
82
-            label="创建时间"
83
-            min-width="150"
84
-        />
85
-        <!-- <el-table-column label="PV变动" prop="status"  min-width="130">
86
-          <template slot-scope="scope">
87
-            <span v-if="scope.row.pm == 1">增加</span>
88
-            <span v-if="scope.row.pm == 2">扣减</span>
89
-          </template>
90
-        </el-table-column> -->
78
+        <el-table-column label="创建时间" prop="create_time" min-width="150"/>
91 79
       </el-table>
92 80
       <div class="block">
93 81
         <el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page"
@@ -223,24 +211,22 @@ export default {
223 211
         page: 1,
224 212
         limit: 20,
225 213
         type: "",
226
-        pm: ""
214
+        pm: "",
215
+        is_excel: 0
227 216
       }
228 217
       this.getList();
229 218
     },
230
-    // exportSearchResult() {
231
-    //   this.tableFrom.is_excel = 1;
232
-    //   getPvCountApi(this.tableFrom).then(res => {
233
-    //     console.log(res.data)
234
-    //     console.log(res.data.path)
235
-    //     this.tableFrom.is_excel = 0;
236
-    //     this.$message.success('导出成功')
237
-    //     window.open(res.data.path)
238
-    //   }).catch((res) => {
239
-    //     this.$message.error('导出失败');
240
-    //   })
241
-    // },
242
-
243
-
219
+    exportSearchResult() {
220
+      this.tableFrom.is_excel = 1;
221
+      getOriginatorListApi(this.tableFrom).then(res => {
222
+        this.$message.success('导出成功')
223
+        window.open(res.data.path)
224
+        this.tableFrom.is_excel = 0;
225
+      }).catch(() => {
226
+        this.$message.error('导出失败');
227
+        this.tableFrom.is_excel = 0;
228
+      })
229
+    },
244 230
     // 表格某一行添加特定的样式
245 231
     addTdClass(val) {
246 232
       if (val.row.status > 0 && val.row.paid === 1) {