Browse Source

公证处入账明细-增加导出

sunxbiao 1 year ago
parent
commit
c4218397d1
1 changed files with 40 additions and 17 deletions
  1. 40 17
      src/views/accounts/caiwuOperate/income/index.vue

+ 40 - 17
src/views/accounts/caiwuOperate/income/index.vue

@@ -65,6 +65,7 @@
65 65
       </div>
66 66
       <div class="mb15">
67 67
         <el-button size="mini" type="primary" class="mr10" @click="moneyToBankAll">批量发起入账</el-button>
68
+        <el-button size="mini" type="primary" class="mr10" @click="exportSearchResult">导出</el-button>
68 69
       </div>
69 70
 
70 71
       <el-table
@@ -90,7 +91,7 @@
90 91
             <span v-if="scope.row.order_type==7">唯品会</span>
91 92
             <span v-if="scope.row.order_type==8">抖音</span>
92 93
         </template> -->
93
-        </el-table-column>
94
+<!--        </el-table-column>-->
94 95
 <!--        订单类型 1-线下支付  2-线上支付 3-拼多多 4-京东 5-苏宁 6-淘宝 7-唯品会 8-抖音-->
95 96
         <!-- <el-table-column prop="out_trade_no" label="订单号" min-width="100" /> -->
96 97
 
@@ -164,7 +165,7 @@
164 165
   } from '@/api/merchant'
165 166
   import { fromList } from '@/libs/constants.js'
166 167
   import { roterPre } from '@/settings'
167
-  import Cookies from 'js-cookie'
168
+  // import Cookies from 'js-cookie'
168 169
   import cardsData from '@/components/cards/index'
169 170
   export default {
170 171
     name: 'MerchantGzcLogs',
@@ -247,16 +248,30 @@
247 248
             this.$message.error(res.message)
248 249
           })
249 250
       },
250
-      onLogo(id) {
251
-        merchantLoginApi(id)
252
-          .then((res) => {
253
-            Cookies.set('merchantToken', res.data.token)
254
-            window.open(SettingMer.httpUrl + res.data.url)
255
-          })
256
-          .catch((res) => {
257
-            this.$message.error(res.message)
258
-          })
251
+      // 导出
252
+      exportSearchResult() {
253
+        this.tableFrom.is_excel = 1;
254
+        this.getList()
255
+        // getYongJinCountApi(this.tableFrom).then(res => {
256
+        //   console.log( res.data)
257
+        //   console.log( res.data.path)
258
+        //   this.tableFrom.is_excel = 0;
259
+        //   this.$message.success('导出成功')
260
+        //   window.open( res.data.path)
261
+        // }).catch((res) => {
262
+        //   this.$message.error('导出失败');
263
+        // })
259 264
       },
265
+      // onLogo(id) {
266
+      //   merchantLoginApi(id)
267
+      //     .then((res) => {
268
+      //       Cookies.set('merchantToken', res.data.token)
269
+      //       window.open(SettingMer.httpUrl + res.data.url)
270
+      //     })
271
+      //     .catch((res) => {
272
+      //       this.$message.error(res.message)
273
+      //     })
274
+      // },
260 275
       // 选择时间
261 276
       selectChange(tab) {
262 277
         this.tableFrom.date = tab
@@ -273,14 +288,22 @@
273 288
       },
274 289
       // 列表
275 290
       getList(num) {
276
-        this.listLoading = true
277
-        this.tableFrom.page = num || this.tableFrom.page
291
+        if (this.tableFrom.is_excel !== 1) {
292
+          this.listLoading = true
293
+          this.tableFrom.page = num || this.tableFrom.page
294
+        }
278 295
         GzcLogsListApi(this.tableFrom)
279 296
           .then((res) => {
280
-            this.tableData.data = res.data.list
281
-            this.tableData.total = res.data.count
282
-            this.cardLists = res.data.stat
283
-            this.listLoading = false
297
+            if (this.tableFrom.is_excel === 1) {
298
+              this.tableFrom.is_excel = 0;
299
+              this.$message.success('导出成功')
300
+              window.open( res.data.path)
301
+            } else {
302
+              this.tableData.data = res.data.list
303
+              this.tableData.total = res.data.count
304
+              this.cardLists = res.data.stat
305
+              this.listLoading = false
306
+            }
284 307
           })
285 308
           .catch((res) => {
286 309
             this.listLoading = false