This commit is contained in:
faiz 2024-07-12 15:58:47 +08:00
parent 5510f68a74
commit 8d1171ce96
2 changed files with 29 additions and 3 deletions

View File

@ -20,6 +20,12 @@ export function extractStatusApi(id, data) {
export function exportInancialRecordApi(data) { export function exportInancialRecordApi(data) {
return request.get(`financial_record/mer_export`, data) return request.get(`financial_record/mer_export`, data)
} }
/**
* @description 下载订单
*/
export function exportmerDetailExportApi(data) {
return request.get(`financial_record/mer_detail_export`, data)
}
/** /**
* @description 充值记录 -- 列表 * @description 充值记录 -- 列表
*/ */

View File

@ -67,6 +67,11 @@
label="邮费金额" label="邮费金额"
min-width="150" min-width="150"
/> />
<el-table-column
prop="refund_amount"
label="退款金额"
min-width="150"
/>
<el-table-column <el-table-column
prop="amount" prop="amount"
label="可提现金额" label="可提现金额"
@ -77,6 +82,7 @@
<router-link :to="{path: roterPre + '/accounts/billDetails/' + scope.row.mer_id}"> <router-link :to="{path: roterPre + '/accounts/billDetails/' + scope.row.mer_id}">
<el-button type="text" size="small" >账单详情</el-button> <el-button type="text" size="small" >账单详情</el-button>
</router-link> </router-link>
<el-button type="text" size="small" @click="exports('download',scope.row.mer_id,scope.row.date)">下载</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -98,7 +104,7 @@
<script> <script>
import { merchantBillList,exportInancialRecordApi } from '@/api/accounts' import { merchantBillList,exportInancialRecordApi,exportmerDetailExportApi } from '@/api/accounts'
import { merSelectApi } from "@/api/product"; import { merSelectApi } from "@/api/product";
import { roterPre } from '@/settings' import { roterPre } from '@/settings'
import createWorkBook from '@/utils/newToExcel.js' import createWorkBook from '@/utils/newToExcel.js'
@ -155,7 +161,13 @@ export default {
this.$message.error(res.message); this.$message.error(res.message);
}); });
}, },
async exports() { async exports(type,id,date) {
let params = {
mer_id: id,
page:1,
limit:500,
date
}
const excelData = JSON.parse(JSON.stringify(this.tableForm)); let data = [] const excelData = JSON.parse(JSON.stringify(this.tableForm)); let data = []
excelData.page = 1 excelData.page = 1
excelData.limit = 200 excelData.limit = 200
@ -163,7 +175,7 @@ export default {
let pageCount = 1 let pageCount = 1
let lebData = {} let lebData = {}
for (let i = 0; i < pageCount; i++) { for (let i = 0; i < pageCount; i++) {
lebData = await this.downOrderData(excelData) lebData = type=='download'?await this.exportmerDetailExportApi(params):await this.downOrderData(excelData)
pageCount = Math.ceil(lebData.count / excelData.limit) pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) { if (lebData.export.length) {
data = data.concat(lebData.export) data = data.concat(lebData.export)
@ -181,6 +193,14 @@ export default {
}) })
}) })
}, },
/** 下载订单 */
exportmerDetailExportApi(excelData) {
return new Promise((resolve, reject) => {
exportmerDetailExportApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
// //
getList(num) { getList(num) {
this.listLoading = true this.listLoading = true