|
|
@ -25,44 +25,17 @@ const adminData = ref({}) |
|
|
// 充值明细表格 |
|
|
// 充值明细表格 |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
|
// 搜索articleVideo 表单 |
|
|
|
|
|
const beanConsumeArticle = ref({ |
|
|
|
|
|
|
|
|
// 搜索表单 |
|
|
|
|
|
const beanCart = ref({ |
|
|
jwcode: null, |
|
|
jwcode: null, |
|
|
dept: "", |
|
|
dept: "", |
|
|
type: "", |
|
|
|
|
|
payMode: "", |
|
|
|
|
|
articleId: "", |
|
|
|
|
|
articleName: "", |
|
|
|
|
|
author: "", |
|
|
|
|
|
|
|
|
goodsName: "", |
|
|
|
|
|
channelName: "", |
|
|
|
|
|
liveName: "", |
|
|
startTime: '', |
|
|
startTime: '', |
|
|
endTime: '', |
|
|
endTime: '', |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
// 频道列表 |
|
|
|
|
|
const channels = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
// 抽离类型选项到响应式数组 |
|
|
|
|
|
const consumeTypes = ref([ |
|
|
|
|
|
{ label: '打赏', value: 9 }, |
|
|
|
|
|
{ label: '打赏', value: 10 }, |
|
|
|
|
|
{ label: '付费购买', value: 11 }, |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
// 处理 payMode 选择变化 |
|
|
|
|
|
const handlePayModeChange = (value) => { |
|
|
|
|
|
beanConsumeArticle.value.payMode = value; |
|
|
|
|
|
// 触发搜索 |
|
|
|
|
|
ConsumeSelectBy(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//------------------------ |
|
|
|
|
|
|
|
|
|
|
|
// 标记当前激活的时间范围按钮 |
|
|
|
|
|
const activeTimeRange = ref('') |
|
|
|
|
|
// 日期选择器变化时清除按钮激活状态 |
|
|
|
|
|
const handleDatePickerChange = () => { |
|
|
|
|
|
activeTimeRange.value = '' |
|
|
|
|
|
} |
|
|
|
|
|
// 搜索对象 |
|
|
// 搜索对象 |
|
|
const getObj = ref({ |
|
|
const getObj = ref({ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
@ -73,21 +46,32 @@ const getObj = ref({ |
|
|
const total = ref(100) |
|
|
const total = ref(100) |
|
|
|
|
|
|
|
|
// 搜索对象时间 |
|
|
// 搜索对象时间 |
|
|
const getTime = ref({ |
|
|
|
|
|
startTime: '', |
|
|
|
|
|
endTime: '' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
const getTime = ref({}) |
|
|
|
|
|
|
|
|
// 搜索地区列表 |
|
|
// 搜索地区列表 |
|
|
const dept = ref([]) |
|
|
const dept = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增排序字段和排序方式 |
|
|
|
|
|
const sortField = ref('') |
|
|
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
|
|
|
|
|
|
// 合计数 |
|
|
|
|
|
const permanentBean = ref(0) |
|
|
|
|
|
const freeBean = ref(0) |
|
|
|
|
|
const totalNum = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
====================方法================================= |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
// 获取地区列表的方法 |
|
|
// 获取地区列表的方法 |
|
|
const getDept = async function () { |
|
|
const getDept = async function () { |
|
|
try { |
|
|
try { |
|
|
// 发送请求获取地区列表 |
|
|
// 发送请求获取地区列表 |
|
|
const result = await request({ |
|
|
const result = await request({ |
|
|
// url: '/general/dept', |
|
|
|
|
|
|
|
|
|
|
|
url: '/beanConsume/getDept', // todo 换成实际接口地址 |
|
|
|
|
|
|
|
|
url: '/beanConsume/getDept', // 地区实际接口地址 |
|
|
data: { account: adminData.value.account } |
|
|
data: { account: adminData.value.account } |
|
|
}) |
|
|
}) |
|
|
console.log('请求地区列表成功', result) |
|
|
console.log('请求地区列表成功', result) |
|
|
@ -103,27 +87,28 @@ const getDept = async function () { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// // 频道模糊查询方法 |
|
|
|
|
|
// const filterChannel = (query) => { |
|
|
|
|
|
// if (query) { |
|
|
|
|
|
// return channels.value.filter(item => item.toLowerCase().includes(query.toLowerCase())); |
|
|
|
|
|
// } |
|
|
|
|
|
// return channels.value; |
|
|
|
|
|
// }; |
|
|
|
|
|
|
|
|
|
|
|
// 新增排序字段和排序方式 |
|
|
|
|
|
const sortField = ref('') |
|
|
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
|
|
|
|
|
|
// 合计数 |
|
|
|
|
|
const permanentBean = ref(0) |
|
|
|
|
|
const freeBean = ref(0) |
|
|
|
|
|
const totalNum = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 频道列表 |
|
|
|
|
|
const channels = ref([]) |
|
|
|
|
|
// 获取频道列表的方法 |
|
|
|
|
|
const getChannel = async function () { |
|
|
|
|
|
try { |
|
|
|
|
|
const result = await request({ |
|
|
|
|
|
url: '/beanConsume/getLiveChannel', // todo 换成实际接口地址 |
|
|
|
|
|
data: { account: adminData.value.account } |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('请求频道列表成功', result) |
|
|
|
|
|
// 存储频道数据 |
|
|
|
|
|
channels.value = result.data |
|
|
|
|
|
console.log('频道数据', channels.value) |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求频道列表失败', error) |
|
|
|
|
|
ElMessage({ |
|
|
|
|
|
type: 'error', |
|
|
|
|
|
message: '获取频道列表失败,请稍后重试' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
====================方法================================= |
|
|
|
|
|
*/ |
|
|
|
|
|
// 获取登录用户信息 |
|
|
// 获取登录用户信息 |
|
|
const getAdminData = async function () { |
|
|
const getAdminData = async function () { |
|
|
try { |
|
|
try { |
|
|
@ -139,10 +124,9 @@ const getAdminData = async function () { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ConsumeSelectBy = async function (val) { |
|
|
|
|
|
|
|
|
// 搜索方法 |
|
|
|
|
|
const searchCart = async function () { |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
// 搜索参数页码赋值 |
|
|
// 搜索参数页码赋值 |
|
|
if (typeof val === 'number') { |
|
|
if (typeof val === 'number') { |
|
|
getObj.value.pageNum = val |
|
|
getObj.value.pageNum = val |
|
|
@ -151,19 +135,16 @@ const ConsumeSelectBy = async function (val) { |
|
|
|
|
|
|
|
|
if (getTime.value != null) { |
|
|
if (getTime.value != null) { |
|
|
if (getTime.value.startTime != '' && getTime.value.endTime != '') { |
|
|
if (getTime.value.startTime != '' && getTime.value.endTime != '') { |
|
|
beanConsumeArticle.value.startTime = formatTime(getTime.value[0]) |
|
|
|
|
|
beanConsumeArticle.value.endTime = formatTime(getTime.value[1]) |
|
|
|
|
|
|
|
|
beanCart.value.startTime = formatTime(getTime.value[0]) |
|
|
|
|
|
beanCart.value.endTime = formatTime(getTime.value[1]) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
beanConsumeArticle.value.startTime = '' |
|
|
|
|
|
beanConsumeArticle.value.endTime = '' |
|
|
|
|
|
|
|
|
beanCart.value.startTime = '' |
|
|
|
|
|
beanCart.value.endTime = '' |
|
|
} |
|
|
} |
|
|
beanConsumeArticle.value.sortField = sortField.value |
|
|
|
|
|
beanConsumeArticle.value.sortOrder = sortOrder.value |
|
|
|
|
|
|
|
|
beanCart.value.sortField = sortField.value |
|
|
|
|
|
beanCart.value.sortOrder = sortOrder.value |
|
|
|
|
|
|
|
|
console.log('搜索参数_时间', beanConsumeArticle.value.startTime) |
|
|
|
|
|
console.log('搜索参数1', getObj.value) |
|
|
|
|
|
console.log('搜索参数2', beanConsumeArticle.value) |
|
|
|
|
|
|
|
|
|
|
|
// 发送POST请求 |
|
|
// 发送POST请求 |
|
|
const result = await request({ |
|
|
const result = await request({ |
|
|
@ -171,210 +152,134 @@ const ConsumeSelectBy = async function (val) { |
|
|
data: { |
|
|
data: { |
|
|
pageNum: getObj.value.pageNum, |
|
|
pageNum: getObj.value.pageNum, |
|
|
pageSize: getObj.value.pageSize, |
|
|
pageSize: getObj.value.pageSize, |
|
|
beanConsumeArticle: { |
|
|
|
|
|
...beanConsumeArticle.value, |
|
|
|
|
|
jwcode: beanConsumeArticle.value.jwcode, |
|
|
|
|
|
dept: beanConsumeArticle.value.dept, |
|
|
|
|
|
payMode: beanConsumeArticle.value.payMode, |
|
|
|
|
|
articleId: beanConsumeArticle.value.articleId, |
|
|
|
|
|
articleName: beanConsumeArticle.value.articleName, |
|
|
|
|
|
author: beanConsumeArticle.value.author, |
|
|
|
|
|
startTime: beanConsumeArticle.value.startTime, |
|
|
|
|
|
endTime: beanConsumeArticle.value.endTime, |
|
|
|
|
|
sortField: beanConsumeArticle.value.sortField, |
|
|
|
|
|
sortOrder: beanConsumeArticle.value.sortOrder, |
|
|
|
|
|
|
|
|
beanCart: { |
|
|
|
|
|
...beanCart.value, |
|
|
|
|
|
sortField: sortField.value, |
|
|
|
|
|
sortOrder: sortOrder.value, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
console.log('请求成功4', sortField) |
|
|
|
|
|
console.log('接口响应结果', result); // 打印接口响应结果 |
|
|
|
|
|
if (result.code === 200 && result.data && result.data.list) { |
|
|
|
|
|
// 过滤返回的数据,确保 type 值符合 payMode 规则 |
|
|
|
|
|
const filteredList = result.data.list.filter(item => { |
|
|
|
|
|
if (beanConsumeArticle.value.payMode === '0') { |
|
|
|
|
|
return [9, 10].includes(Number(item.type)); |
|
|
|
|
|
} else if (beanConsumeArticle.value.payMode === '1') { |
|
|
|
|
|
return Number(item.type) === 11; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
}); |
|
|
|
|
|
tableData.value = filteredList; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 合计数的接口 |
|
|
// 合计数的接口 |
|
|
// 复制一份 beanConsumeArticle.value 并设置固定的 payType 值 8是文章的 |
|
|
|
|
|
const sumConsumeParams = { |
|
|
const sumConsumeParams = { |
|
|
payType: 8, // 固定传入 payType 值 8 |
|
|
|
|
|
beanConsumeArticle: { |
|
|
|
|
|
...beanConsumeArticle.value, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
beanCart: { |
|
|
|
|
|
...beanCart.value, |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 发送 POST 请求获取合计数 |
|
|
// 发送 POST 请求获取合计数 |
|
|
const resultTotalGold = await request({ |
|
|
const resultTotalGold = await request({ |
|
|
url: '/beanConsume/sumConsumeGold', |
|
|
url: '/beanConsume/sumConsumeGold', |
|
|
data: sumConsumeParams |
|
|
data: sumConsumeParams |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
console.log("总计", resultTotalGold); |
|
|
|
|
|
|
|
|
console.log("总计", resultTotalGold) |
|
|
|
|
|
|
|
|
const data = resultTotalGold.data || resultTotalGold; |
|
|
|
|
|
console.log('请求成功3', resultTotalGold.data) |
|
|
|
|
|
console.log('permanentBean3', data.permanentBean) |
|
|
|
|
|
|
|
|
const data = resultTotalGold.data || resultTotalGold |
|
|
// 返回字段为 permanentBean、freeBean、totalNum |
|
|
// 返回字段为 permanentBean、freeBean、totalNum |
|
|
permanentBean.value = Number(data.permanentBean) || 0; |
|
|
|
|
|
freeBean.value = Number(data.freeBean) || 0; |
|
|
|
|
|
totalNum.value = Number(data.totalNum) || 0; |
|
|
|
|
|
|
|
|
permanentBean.value = Number(data.permanentBean) || 0 |
|
|
|
|
|
freeBean.value = Number(data.freeBean) || 0 |
|
|
|
|
|
totalNum.value = Number(data.totalNum) || 0 |
|
|
|
|
|
|
|
|
// 存储分页总数 |
|
|
// 存储分页总数 |
|
|
total.value = result.data.total |
|
|
total.value = result.data.total |
|
|
console.log('total', total.value) |
|
|
console.log('total', total.value) |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log('请求失败', error) |
|
|
console.log('请求失败', error) |
|
|
|
|
|
ElMessage({ |
|
|
|
|
|
type: 'error', |
|
|
|
|
|
message: '搜索失败,请稍后重试' |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 搜索 |
|
|
|
|
|
|
|
|
|
|
|
const search = function () { |
|
|
const search = function () { |
|
|
getObj.value.pageNum = 1 |
|
|
getObj.value.pageNum = 1 |
|
|
if (beanConsumeArticle.value.jwcode) { |
|
|
|
|
|
|
|
|
if (beanConsumeLive.value.jwcode) { |
|
|
const numRef = /^\d{1,9}$/; |
|
|
const numRef = /^\d{1,9}$/; |
|
|
if (!numRef.test(beanConsumeArticle.value.jwcode)) { |
|
|
|
|
|
|
|
|
if (!numRef.test(beanConsumeLive.value.jwcode)) { |
|
|
ElMessage.error('请检查精网号格式') |
|
|
ElMessage.error('请检查精网号格式') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (beanConsumeArticle.value.articleId) { |
|
|
|
|
|
const numRef = /^\d{1,9}$/; |
|
|
|
|
|
if (!numRef.test(beanConsumeArticle.value.articleId)) { |
|
|
|
|
|
ElMessage.error('请检查文章ID格式') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
searchCart() |
|
|
} |
|
|
} |
|
|
ConsumeSelectBy() |
|
|
|
|
|
} |
|
|
|
|
|
// 重置 |
|
|
|
|
|
const reset = function () { |
|
|
|
|
|
console.log('文章/视频的重置') |
|
|
|
|
|
|
|
|
|
|
|
beanConsumeArticle.value.jwcode = null |
|
|
|
|
|
beanConsumeArticle.value.dept = '' |
|
|
|
|
|
beanConsumeArticle.value.type = '' |
|
|
|
|
|
beanConsumeArticle.value.payMode = '' |
|
|
|
|
|
beanConsumeArticle.value.articleId = '' |
|
|
|
|
|
beanConsumeArticle.value.articleName = '' |
|
|
|
|
|
beanConsumeArticle.value.author = '' |
|
|
|
|
|
|
|
|
|
|
|
beanConsumeArticle.value.startTime = '' |
|
|
|
|
|
beanConsumeArticle.value.endTime = '' |
|
|
|
|
|
|
|
|
// 重置 |
|
|
|
|
|
const reset = function () { |
|
|
|
|
|
console.log('重置搜索条件') |
|
|
|
|
|
|
|
|
|
|
|
beanCart.value = { |
|
|
|
|
|
jwcode: null, |
|
|
|
|
|
dept: "", |
|
|
|
|
|
goodsName: "", |
|
|
|
|
|
channelName: "", |
|
|
|
|
|
liveName: "", |
|
|
|
|
|
startTime: '', |
|
|
|
|
|
endTime: '', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
sortField.value = '' |
|
|
sortField.value = '' |
|
|
sortOrder.value = '' |
|
|
sortOrder.value = '' |
|
|
getTime.value = {} |
|
|
getTime.value = {} |
|
|
activeTimeRange.value = '' // 清除激活状态 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 点完重置后,重新请求数据 |
|
|
|
|
|
ConsumeSelectBy() |
|
|
|
|
|
console.log(' beanConsumeArticle', beanConsumeArticle.value) |
|
|
|
|
|
} |
|
|
|
|
|
// 今天 |
|
|
|
|
|
const getToday = function () { |
|
|
|
|
|
const today = dayjs() |
|
|
|
|
|
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
|
|
console.log('getTime', getTime.value) |
|
|
|
|
|
activeTimeRange.value = 'today' // 标记当前激活状态 |
|
|
|
|
|
|
|
|
|
|
|
ConsumeSelectBy() |
|
|
|
|
|
|
|
|
// 重置后重新请求数据 |
|
|
|
|
|
searchCart() |
|
|
} |
|
|
} |
|
|
// 昨天 |
|
|
|
|
|
const getYesterday = function () { |
|
|
|
|
|
const today = dayjs() |
|
|
|
|
|
const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
|
|
console.log('getTime', getTime.value) |
|
|
|
|
|
activeTimeRange.value = 'yesterday' // 标记当前激活状态 |
|
|
|
|
|
|
|
|
|
|
|
ConsumeSelectBy() |
|
|
|
|
|
|
|
|
// 处理日期选择 |
|
|
|
|
|
const handleDatePickerChange = (value) => { |
|
|
|
|
|
if (value && value.length === 2) { |
|
|
|
|
|
beanCart.value.startTime = formatTime(value[0]) |
|
|
|
|
|
beanCart.value.endTime = formatTime(value[1]) |
|
|
|
|
|
} else { |
|
|
|
|
|
beanCart.value.startTime = '' |
|
|
|
|
|
beanCart.value.endTime = '' |
|
|
} |
|
|
} |
|
|
// 近7天 |
|
|
|
|
|
const get7Days = function () { |
|
|
|
|
|
const today = dayjs() |
|
|
|
|
|
const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
|
|
console.log('getTime', getTime.value) |
|
|
|
|
|
activeTimeRange.value = '7days' // 标记当前激活状态 |
|
|
|
|
|
|
|
|
|
|
|
ConsumeSelectBy() |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理排序事件 |
|
|
// 处理排序事件 |
|
|
const handleSortChange = (column) => { |
|
|
const handleSortChange = (column) => { |
|
|
console.log('排序字段:', column.prop) |
|
|
console.log('排序字段:', column.prop) |
|
|
console.log('排序方式:', column.order) |
|
|
console.log('排序方式:', column.order) |
|
|
if (column.prop === 'beanNum') { |
|
|
|
|
|
sortField.value = 'beanNum' |
|
|
|
|
|
} else if (column.prop === 'consumeTime') { |
|
|
|
|
|
sortField.value = 'consumeTime' |
|
|
|
|
|
} else if (column.prop === 'buyBean') { |
|
|
|
|
|
sortField.value = 'buyBean' |
|
|
|
|
|
} else if (column.prop === 'freeBean') { |
|
|
|
|
|
sortField.value = 'freeBean' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 只允许指定字段排序 |
|
|
|
|
|
const allowedSortFields = ['beanNum', 'consumeTime'] |
|
|
|
|
|
if (allowedSortFields.includes(column.prop)) { |
|
|
|
|
|
sortField.value = column.prop |
|
|
sortOrder.value = column.order === 'ascending' ? 'DESC' : 'ASC' |
|
|
sortOrder.value = column.order === 'ascending' ? 'DESC' : 'ASC' |
|
|
ConsumeSelectBy() |
|
|
|
|
|
|
|
|
searchCart() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handlePageSizeChange = function (val) { |
|
|
const handlePageSizeChange = function (val) { |
|
|
getObj.value.pageSize = val |
|
|
getObj.value.pageSize = val |
|
|
ConsumeSelectBy() |
|
|
|
|
|
|
|
|
searchCart() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleCurrentChange = function (val) { |
|
|
const handleCurrentChange = function (val) { |
|
|
getObj.value.pageNum = val |
|
|
getObj.value.pageNum = val |
|
|
ConsumeSelectBy() |
|
|
|
|
|
|
|
|
searchCart() |
|
|
} |
|
|
} |
|
|
/* |
|
|
|
|
|
====================计算属性================================= |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// 计算总金币数 |
|
|
|
|
|
// const totalBean = computed(() => permanentBean.value + freeBean.value) |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
====================监听================================= |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
====================挂载================================= |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
const format3 = (num) => { |
|
|
const format3 = (num) => { |
|
|
// 每三位添加逗号 |
|
|
// 每三位添加逗号 |
|
|
return num.toLocaleString('en-US') |
|
|
return num.toLocaleString('en-US') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(async function () { |
|
|
onMounted(async function () { |
|
|
await getAdminData() |
|
|
await getAdminData() |
|
|
await ConsumeSelectBy() |
|
|
|
|
|
|
|
|
|
|
|
await getDept() |
|
|
await getDept() |
|
|
|
|
|
|
|
|
|
|
|
await getChannel() |
|
|
|
|
|
await searchCart() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const exportExcel = async function () { |
|
|
const exportExcel = async function () { |
|
|
const params = { //需要修改 |
|
|
|
|
|
|
|
|
const params = { |
|
|
...getObj.value, |
|
|
...getObj.value, |
|
|
"beanConsumeArticle": { |
|
|
|
|
|
...beanConsumeArticle.value, |
|
|
|
|
|
|
|
|
"beanCart": { |
|
|
|
|
|
...beanCart.value, |
|
|
sortField: sortField.value, |
|
|
sortField: sortField.value, |
|
|
sortOrder: sortOrder.value, |
|
|
sortOrder: sortOrder.value, |
|
|
}, |
|
|
}, |
|
|
@ -384,7 +289,10 @@ const exportExcel = async function () { |
|
|
ElMessage.success('导出成功') |
|
|
ElMessage.success('导出成功') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const exportListVisible = ref(false) |
|
|
const exportListVisible = ref(false) |
|
|
|
|
|
const exportList = ref([]) |
|
|
|
|
|
const exportListLoading = ref(false) |
|
|
|
|
|
|
|
|
// 打开导出列表弹窗 |
|
|
// 打开导出列表弹窗 |
|
|
const openExportList = () => { |
|
|
const openExportList = () => { |
|
|
@ -392,20 +300,13 @@ const openExportList = () => { |
|
|
exportListVisible.value = true |
|
|
exportListVisible.value = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 导出列表数据 |
|
|
|
|
|
const exportList = ref([]) |
|
|
|
|
|
// 导出列表加载状态 |
|
|
|
|
|
const exportListLoading = ref(false) |
|
|
|
|
|
// 获取导出列表 |
|
|
// 获取导出列表 |
|
|
const getExportList = async () => { |
|
|
const getExportList = async () => { |
|
|
exportListLoading.value = true |
|
|
exportListLoading.value = true |
|
|
try { |
|
|
try { |
|
|
const result = await API({ url: '/export/export' }) |
|
|
const result = await API({ url: '/export/export' }) |
|
|
if (result.code === 200) { |
|
|
if (result.code === 200) { |
|
|
const filteredData = result.data.filter(item => { |
|
|
|
|
|
return item.type === 8; //8表示文章/视频 |
|
|
|
|
|
}); |
|
|
|
|
|
exportList.value = filteredData |
|
|
|
|
|
|
|
|
ElMessage.success('导出成功') |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error(result.msg || '获取导出列表失败') |
|
|
ElMessage.error(result.msg || '获取导出列表失败') |
|
|
} |
|
|
} |
|
|
@ -416,6 +317,7 @@ const getExportList = async () => { |
|
|
exportListLoading.value = false |
|
|
exportListLoading.value = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 下载导出文件 |
|
|
// 下载导出文件 |
|
|
const downloadExportFile = (item) => { |
|
|
const downloadExportFile = (item) => { |
|
|
if (item.state === 2) { |
|
|
if (item.state === 2) { |
|
|
@ -427,34 +329,36 @@ const downloadExportFile = (item) => { |
|
|
ElMessage.warning('文件还在导出中,请稍后再试') |
|
|
ElMessage.warning('文件还在导出中,请稍后再试') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//根据状态返回对应的标签类型 |
|
|
//根据状态返回对应的标签类型 |
|
|
const getTagType = (state) => { |
|
|
const getTagType = (state) => { |
|
|
switch (state) { |
|
|
switch (state) { |
|
|
case 0: |
|
|
case 0: |
|
|
return 'info'; |
|
|
|
|
|
|
|
|
return 'info' |
|
|
case 1: |
|
|
case 1: |
|
|
return 'primary'; |
|
|
|
|
|
|
|
|
return 'primary' |
|
|
case 2: |
|
|
case 2: |
|
|
return 'success'; |
|
|
|
|
|
|
|
|
return 'success' |
|
|
case 3: |
|
|
case 3: |
|
|
return 'danger'; |
|
|
|
|
|
|
|
|
return 'danger' |
|
|
default: |
|
|
default: |
|
|
return 'info'; |
|
|
|
|
|
|
|
|
return 'info' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//根据状态返回对应的标签文案 |
|
|
//根据状态返回对应的标签文案 |
|
|
const getTagText = (state) => { |
|
|
const getTagText = (state) => { |
|
|
switch (state) { |
|
|
switch (state) { |
|
|
case 0: |
|
|
case 0: |
|
|
return '待执行'; |
|
|
|
|
|
|
|
|
return '待执行' |
|
|
case 1: |
|
|
case 1: |
|
|
return '执行中'; |
|
|
|
|
|
|
|
|
return '执行中' |
|
|
case 2: |
|
|
case 2: |
|
|
return '执行完成'; |
|
|
|
|
|
|
|
|
return '执行完成' |
|
|
case 3: |
|
|
case 3: |
|
|
return '执行出错'; |
|
|
|
|
|
|
|
|
return '执行出错' |
|
|
default: |
|
|
default: |
|
|
return '未知状态'; |
|
|
|
|
|
|
|
|
return '未知状态' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -465,31 +369,28 @@ const getTagText = (state) => { |
|
|
<div class="select"> |
|
|
<div class="select"> |
|
|
<div class="selectRow"> |
|
|
<div class="selectRow"> |
|
|
<el-text class="text" size="large">精网号:</el-text> |
|
|
<el-text class="text" size="large">精网号:</el-text> |
|
|
<el-input class="selectContent" v-model="beanConsumeArticle.jwcode" placeholder="请输入精网号" clearable /> |
|
|
|
|
|
|
|
|
<el-input class="selectContent" v-model="beanCart.jwcode" placeholder="请输入精网号" clearable /> |
|
|
</div> |
|
|
</div> |
|
|
<div class="selectRow"> |
|
|
<div class="selectRow"> |
|
|
<el-text class="text" size="large">所属地区:</el-text> |
|
|
<el-text class="text" size="large">所属地区:</el-text> |
|
|
<el-select class="selectContent" v-model="beanConsumeArticle.dept" placeholder="请选择地区" clearable> |
|
|
|
|
|
|
|
|
<el-select class="selectContent" v-model="beanCart.dept" placeholder="请选择地区" clearable> |
|
|
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" /> |
|
|
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
<div class="selectRow"> |
|
|
<div class="selectRow"> |
|
|
<el-text class="text" size="large">商品名称:</el-text> |
|
|
<el-text class="text" size="large">商品名称:</el-text> |
|
|
<el-select class="selectContent" style="width: 20px" v-model="beanConsumeArticle.payMode" placeholder="请选择类型" |
|
|
|
|
|
clearable @change="handlePayModeChange"> |
|
|
|
|
|
<el-option label="打赏" value="0" /> |
|
|
|
|
|
<el-option label="付费购买" value="1" /> |
|
|
|
|
|
<el-option label="其他" value="2" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
<el-input class="selectContent" v-model="beanCart.goodsName" placeholder="请输入商品名称" clearable /> |
|
|
</div> |
|
|
</div> |
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">频道名称:</el-text> |
|
|
|
|
|
<el-select class="selectContent" placeholder="请选择频道" clearable filterable> |
|
|
|
|
|
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item" /> |
|
|
|
|
|
|
|
|
<div class="selectRow" style="width: 12vw;"> |
|
|
|
|
|
<el-text class="textB" size="large">频道:</el-text> |
|
|
|
|
|
<el-select class="selectContent" v-model="beanCart.channelName" placeholder="请选择频道" clearable |
|
|
|
|
|
filterable allow-create default-first-option> |
|
|
|
|
|
<el-option v-for="(item, index) in channels" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:label="item" |
|
|
|
|
|
:value="item" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
|
|
|
@ -497,31 +398,34 @@ const getTagText = (state) => { |
|
|
<div class="select"> |
|
|
<div class="select"> |
|
|
<div class="selectRow" style="width: 33vw;"> |
|
|
<div class="selectRow" style="width: 33vw;"> |
|
|
<el-text class="text" size="large">下单时间:</el-text> |
|
|
<el-text class="text" size="large">下单时间:</el-text> |
|
|
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator="至" |
|
|
|
|
|
start-placeholder="起始时间" end-placeholder="结束时间" style="width:25vw" @change="handleDatePickerChange" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime" /> |
|
|
|
|
|
<div v-if="false"> |
|
|
|
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今</el-button> |
|
|
|
|
|
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''">昨</el-button> |
|
|
|
|
|
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
class="selectContent" |
|
|
|
|
|
v-model="getTime" |
|
|
|
|
|
type="datetimerange" |
|
|
|
|
|
range-separator="至" |
|
|
|
|
|
start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
|
style="width:25vw" |
|
|
|
|
|
@change="handleDatePickerChange" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="selectRow"> |
|
|
<div class="selectRow"> |
|
|
<el-text class="text" size="large">直播间名称:</el-text> |
|
|
<el-text class="text" size="large">直播间名称:</el-text> |
|
|
<el-input class="selectContent" placeholder="请输入直播间" clearable /> |
|
|
|
|
|
|
|
|
<el-input class="selectContent" v-model="beanCart.liveName" placeholder="请输入直播间名称" clearable /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col> |
|
|
<el-col> |
|
|
<div class="selectButton"> |
|
|
<div class="selectButton"> |
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
|
|
|
<el-button type="primary" @click="exportExcel()">导出Excel</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="search">查询</el-button> |
|
|
|
|
|
<el-button type="primary" @click="exportExcel">导出Excel</el-button> |
|
|
<el-button type="primary" @click="openExportList">查看导出列表</el-button> |
|
|
<el-button type="primary" @click="openExportList">查看导出列表</el-button> |
|
|
<el-button type="success" @click="reset()">重置</el-button> |
|
|
|
|
|
|
|
|
<el-button type="success" @click="reset">重置</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-card> |
|
|
</el-card> |
|
|
|
|
|
|
|
|
<el-card class="card2"> |
|
|
<el-card class="card2"> |
|
|
<div class="goldStatistics"> |
|
|
<div class="goldStatistics"> |
|
|
金豆总数:{{ format3(Math.abs(permanentBean + freeBean)) }} |
|
|
金豆总数:{{ format3(Math.abs(permanentBean + freeBean)) }} |
|
|
@ -529,8 +433,13 @@ const getTagText = (state) => { |
|
|
免费金豆数:{{ format3(Math.abs(freeBean)) }} |
|
|
免费金豆数:{{ format3(Math.abs(freeBean)) }} |
|
|
</div> |
|
|
</div> |
|
|
<div style="overflow-y: auto"> |
|
|
<div style="overflow-y: auto"> |
|
|
<el-table :data="tableData" style="width: 82vw" height="64vh" @sort-change="handleSortChange" |
|
|
|
|
|
:row-style="{ height: '50px' }"> |
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="tableData" |
|
|
|
|
|
style="width: 82vw" |
|
|
|
|
|
height="64vh" |
|
|
|
|
|
@sort-change="handleSortChange" |
|
|
|
|
|
:row-style="{ height: '50px' }" |
|
|
|
|
|
> |
|
|
<el-table-column type="index" label="序号" width="110px" fixed="left"> |
|
|
<el-table-column type="index" label="序号" width="110px" fixed="left"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<span>{{ |
|
|
<span>{{ |
|
|
@ -543,10 +452,10 @@ const getTagText = (state) => { |
|
|
<!-- 固定精网号列 --> |
|
|
<!-- 固定精网号列 --> |
|
|
<el-table-column prop="jwcode" label="精网号" width="140px" fixed="left" /> |
|
|
<el-table-column prop="jwcode" label="精网号" width="140px" fixed="left" /> |
|
|
<el-table-column prop="dept" label="地区" width="140px" /> |
|
|
<el-table-column prop="dept" label="地区" width="140px" /> |
|
|
<el-table-column prop="type" label="商品名称" width="160px"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="goodsName" label="商品名称" width="160px"/> |
|
|
<el-table-column prop="beanNum" label="金币数量" sortable="custom" width="140px" /> |
|
|
<el-table-column prop="beanNum" label="金币数量" sortable="custom" width="140px" /> |
|
|
<el-table-column prop="buyBean" label="频道名称" width="160px" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="freeBean" label="直播间名称" width="160px" show-overflow-tooltip /> |
|
|
|
|
|
|
|
|
<el-table-column prop="channelName" label="频道名称" width="160px" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="liveName" label="直播间名称" width="160px" show-overflow-tooltip /> |
|
|
<el-table-column prop="consumeTime" label="下单时间" sortable="custom" width="180px"> |
|
|
<el-table-column prop="consumeTime" label="下单时间" sortable="custom" width="180px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
{{ formatTime(scope.row.consumeTime) }} |
|
|
{{ formatTime(scope.row.consumeTime) }} |
|
|
@ -557,9 +466,15 @@ const getTagText = (state) => { |
|
|
|
|
|
|
|
|
<!-- 分页 --> |
|
|
<!-- 分页 --> |
|
|
<div class="pagination"> |
|
|
<div class="pagination"> |
|
|
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]" |
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange" |
|
|
|
|
|
@current-change="handleCurrentChange"></el-pagination> |
|
|
|
|
|
|
|
|
<el-pagination |
|
|
|
|
|
background |
|
|
|
|
|
:page-size="getObj.pageSize" |
|
|
|
|
|
:page-sizes="[5, 10, 20, 50, 100]" |
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
|
:total="total" |
|
|
|
|
|
@size-change="handlePageSizeChange" |
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
></el-pagination> |
|
|
</div> |
|
|
</div> |
|
|
</el-card> |
|
|
</el-card> |
|
|
|
|
|
|
|
|
@ -581,8 +496,7 @@ const getTagText = (state) => { |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="操作"> |
|
|
<el-table-column label="操作"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)" |
|
|
|
|
|
:disabled="scope.row.state !== 2"> |
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)" :disabled="scope.row.state !== 2"> |
|
|
下载 |
|
|
下载 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
@ -663,10 +577,6 @@ const getTagText = (state) => { |
|
|
width: 5vw; |
|
|
width: 5vw; |
|
|
font-size: 15px; |
|
|
font-size: 15px; |
|
|
} |
|
|
} |
|
|
.textB { |
|
|
|
|
|
width: 7vw; |
|
|
|
|
|
font-size: 15px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.selectContent { |
|
|
.selectContent { |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
|