Переглянути джерело

股份分红记录-增加导出

sunxbiao 1 рік тому
батько
коміт
3621331f84
1 змінених файлів з 16 додано та 33 видалено
  1. 16 33
      src/views/accounts/caiwutongji/stock/index.vue

+ 16 - 33
src/views/accounts/caiwutongji/stock/index.vue

@@ -37,6 +37,9 @@
37
             </el-button>
37
             </el-button>
38
             <el-button type="primary" size="small" @click="getList(1)" style="width: 100px; margin-top: 20px;">查询
38
             <el-button type="primary" size="small" @click="getList(1)" style="width: 100px; margin-top: 20px;">查询
39
             </el-button>
39
             </el-button>
40
+            <el-button size="mini" type="primary" style="width: 100px; margin-top: 20px;" @click="exportSearchResult">
41
+              导出
42
+            </el-button>
40
           </div>
43
           </div>
41
         </div>
44
         </div>
42
       </div>
45
       </div>
@@ -58,33 +61,14 @@
58
       </div>
61
       </div>
59
 
62
 
60
       <el-table :data="tableData.data" style="width: 100%" size="mini" class="table" highlight-current-row>
63
       <el-table :data="tableData.data" style="width: 100%" size="mini" class="table" highlight-current-row>
61
-
62
-
63
         <el-table-column label="ID" prop="id" min-width="30"/>
64
         <el-table-column label="ID" prop="id" min-width="30"/>
64
-<!--        <el-table-column label="用户名称" prop="real_name" min-width="50"/>-->
65
         <el-table-column label="用户昵称" prop="nickname"  min-width="80" />
65
         <el-table-column label="用户昵称" prop="nickname"  min-width="80" />
66
         <el-table-column label="用户账号(手机号)" prop="account"  min-width="80" />
66
         <el-table-column label="用户账号(手机号)" prop="account"  min-width="80" />
67
-
68
-<!--        <el-table-column label="用户姓名" prop="nickname" min-width="50"/>-->
69
         <el-table-column label="份数" prop="pack" min-width="50"/>
67
         <el-table-column label="份数" prop="pack" min-width="50"/>
70
         <el-table-column label="本次佣金" prop="getcomm" min-width="70"/>
68
         <el-table-column label="本次佣金" prop="getcomm" min-width="70"/>
71
         <el-table-column label="累计佣金" prop="allgetcomm" min-width="80"/>
69
         <el-table-column label="累计佣金" prop="allgetcomm" min-width="80"/>
72
-        <el-table-column
73
-            prop="create_time"
74
-            label="创建时间"
75
-            min-width="100"
76
-        />
77
-        <el-table-column
78
-            prop="update_time"
79
-            label="更新时间"
80
-            min-width="100"
81
-        />
82
-        <!-- <el-table-column label="PV变动" prop="status"  min-width="130">
83
-          <template slot-scope="scope">
84
-            <span v-if="scope.row.pm == 1">增加</span>
85
-            <span v-if="scope.row.pm == 2">扣减</span>
86
-          </template>
87
-        </el-table-column> -->
70
+        <el-table-column label="创建时间" prop="create_time" min-width="100"/>
71
+        <el-table-column prop="update_time" label="更新时间" min-width="100"/>
88
         <el-table-column label="操作" min-width="100" fixed="right" align="center">
72
         <el-table-column label="操作" min-width="100" fixed="right" align="center">
89
           <template slot-scope="scope">
73
           <template slot-scope="scope">
90
             <el-button type="text" size="small" @click="onEdit(scope.row.id)">编辑</el-button>
74
             <el-button type="text" size="small" @click="onEdit(scope.row.id)">编辑</el-button>
@@ -249,18 +233,17 @@ export default {
249
       }
233
       }
250
       this.getList();
234
       this.getList();
251
     },
235
     },
252
-    // exportSearchResult() {
253
-    //   this.tableFrom.is_excel = 1;
254
-    //   getPvCountApi(this.tableFrom).then(res => {
255
-    //     console.log(res.data)
256
-    //     console.log(res.data.path)
257
-    //     this.tableFrom.is_excel = 0;
258
-    //     this.$message.success('导出成功')
259
-    //     window.open(res.data.path)
260
-    //   }).catch((res) => {
261
-    //     this.$message.error('导出失败');
262
-    //   })
263
-    // },
236
+    exportSearchResult() {
237
+      this.tableFrom.is_excel = 1;
238
+      getStockListApi(this.tableFrom).then(res => {
239
+        this.tableFrom.is_excel = 0;
240
+        this.$message.success('导出成功')
241
+        window.open(res.data.path)
242
+      }).catch(() => {
243
+        this.tableFrom.is_excel = 0;
244
+        this.$message.error('导出失败');
245
+      })
246
+    },
264
 
247
 
265
 
248
 
266
     // 表格某一行添加特定的样式
249
     // 表格某一行添加特定的样式