提交 5b10c26a authored 作者: lidongxu's avatar lidongxu

feat(finance): 直播间分类-达人可以下载全部达人下属数据

同上
上级 cc88680b
import request from '@/utils/request' import request from '@/utils/request'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { saveAs } from 'file-saver';
/** /**
...@@ -113,3 +114,32 @@ export const getFinanceSubListAPI = (data) => { ...@@ -113,3 +114,32 @@ export const getFinanceSubListAPI = (data) => {
}) })
} }
/**
* 下载达人数据表格
*/
export const downloadFinanceListAPI = async (data) => {
const jsonString = JSON.stringify({
zbjQdType: data.zbjQdType,
flavor: data.flavorErp,
specName: data.specNameErp,
zbjQdTypeAll: false,
flavorErpAll: data.flavorErpAll,
specNameErpAll: data.specNameErpAll,
series: data.seriesPrdMap.map(o => o[0]),
goodsName: data.seriesPrdMap.map(o => o[1]),
startDate: parseTime(data.date[0], `{y}-{m}-{d}`),
endDate: parseTime(data.date[1], `{y}-{m}-{d}`),
subType: 0, // 代表直播间的展开数据
});
const res = await request({
url: '/bi/finance/cost/export',
method: 'POST',
responseType: 'blob',
data: jsonString
})
// 保存文件到本地
saveAs(res, '财务分析-达人数据.xlsx');
}
...@@ -21,7 +21,7 @@ const service = axios.create({ ...@@ -21,7 +21,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: import.meta.env.VITE_APP_BASE_API, baseURL: import.meta.env.VITE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 90000
}) })
// request拦截器 // request拦截器
......
...@@ -162,11 +162,15 @@ ...@@ -162,11 +162,15 @@
</template> </template>
<el-table-column label="操作" <el-table-column label="操作"
width="120"> width="250">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="primary" <el-button type="primary"
link link
@click="rowClick(scope.row)">订单详情</el-button> @click="rowClick(scope.row)">订单详情</el-button>
<el-button type="primary"
v-if="scope.row.zbjQdType === '达人'"
link
@click="downAllExpert(scope.row)">下载全部达人</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -213,7 +217,7 @@ ...@@ -213,7 +217,7 @@
</template> </template>
<script setup> <script setup>
import { getBrandListAPI, getTasteListAPI, getSpecListAPI, getSeriesListAPI, getProductListAPI, getFinanceListAPI, getFinanceDetailAPI, getFinanceSubListAPI } from '@/api' import { getBrandListAPI, getTasteListAPI, getSpecListAPI, getSeriesListAPI, getProductListAPI, getFinanceListAPI, getFinanceDetailAPI, getFinanceSubListAPI, downloadFinanceListAPI } from '@/api'
import { useDatePickerOptions } from '@/hooks' import { useDatePickerOptions } from '@/hooks'
import { formatNumberWithUnit, parseTime } from '@/utils' import { formatNumberWithUnit, parseTime } from '@/utils'
...@@ -489,6 +493,13 @@ const getSubList = async () => { ...@@ -489,6 +493,13 @@ const getSubList = async () => {
expandTotal.value = res.data.total expandTotal.value = res.data.total
expandLoading.value = false expandLoading.value = false
} }
const downAllExpert = async (row) => {
const res = await downloadFinanceListAPI({
...queryParams.value,
zbjQdType: [row.zbjQdType],
})
console.log(res)
}
const handleMouseDown = (event) => { const handleMouseDown = (event) => {
if (event.button === 1) { // 1 表示鼠标中键 if (event.button === 1) { // 1 表示鼠标中键
...@@ -535,9 +546,6 @@ const handleMouseDown = (event) => { ...@@ -535,9 +546,6 @@ const handleMouseDown = (event) => {
// immediate: true // immediate: true
// }) // })
// 展开行
// 详情数据 // 详情数据
const detailList = ref([]) const detailList = ref([])
const detailColumns = ref([ const detailColumns = ref([
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论