You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

805 lines
25 KiB

3 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
3 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
2 months ago
  1. <script setup>
  2. import { onMounted, ref, watch } from 'vue'
  3. import { ElMessage } from 'element-plus'
  4. import moment from 'moment'
  5. import API from '@/util/http.js'
  6. import { reverseMarketMapping } from '@/utils/marketMap.js';
  7. import dayjs from "dayjs";
  8. import { storeToRefs } from 'pinia'
  9. import { useAdminStore } from '@/store/index.js'
  10. const adminStore = useAdminStore()
  11. const { flag } = storeToRefs(adminStore)
  12. //新增员工数数据复选框,默认不勾选
  13. // const showEmployeeData = ref(false)
  14. // 监听全局flag状态变化
  15. watch(flag, (newFlag, oldFlag) => {
  16. if(newFlag !== oldFlag) {
  17. get()
  18. }
  19. })
  20. const trimJwCode = () => {
  21. if (rechargeUser.value.jwcode) {
  22. rechargeUser.value.jwcode = rechargeUser.value.jwcode.replace(/\s/g, '');
  23. }
  24. }
  25. //这是获取用户信息的接口
  26. const adminData = ref({})
  27. const getAdminData = async function () {
  28. try {
  29. const result = await API({ url: '/admin/userinfo', data: {} })
  30. adminData.value = result
  31. rechargeUser.value.adminId = adminData.value.id
  32. console.log('请求成功', result)
  33. console.log('用户信息', adminData.value)
  34. } catch (error) {
  35. console.log('请求失败', error)
  36. }
  37. }
  38. const defaultTime = [
  39. new Date(2000, 1, 1, 0, 0, 0),
  40. new Date(2000, 2, 1, 23, 59, 59),
  41. ]
  42. // 变量
  43. // 充值明细表格
  44. const tableData = ref([])
  45. // 标记当前激活的时间范围按钮
  46. const activeTimeRange = ref('')
  47. // 日期选择器变化时清除按钮激活状态
  48. const handleDatePickerChange = () => {
  49. activeTimeRange.value = ''
  50. }
  51. // 搜索===========================================
  52. // 搜索recharge
  53. const rechargeUser = ref({
  54. adminId: adminData.value.id,
  55. market: "",
  56. })
  57. /*//处理地区选择变化
  58. const handleMarketChange = (value) => {
  59. if (Array.isArray(value) && value.length > 0) {
  60. const ids = new Set();
  61. value.forEach(path => {
  62. const lastName = path[path.length - 1];
  63. const id = reverseMarketMapping[lastName];
  64. if (id) ids.add(Number(id));
  65. });
  66. // 添加额外处理:如果一个父节点下所有子节点都被选中,则把父节点也加入
  67. const getAllLeafNames = (nodes) => {
  68. const leafNames = [];
  69. const traverse = (node, parentName = null) => {
  70. if (!node.children || node.children.length === 0) {
  71. leafNames.push({ name: node.label, parent: parentName });
  72. } else {
  73. node.children.forEach(child => traverse(child, node.label));
  74. }
  75. };
  76. nodes.forEach(node => traverse(node));
  77. return leafNames;
  78. };
  79. const leafNameMap = getAllLeafNames(market.value); // 所有叶子节点和对应父级名称
  80. // 构建一个 { parentName: [childName1, childName2, ...] } 的结构
  81. const parentToChildren = {};
  82. leafNameMap.forEach(({ name, parent }) => {
  83. if (!parentToChildren[parent]) parentToChildren[parent] = [];
  84. parentToChildren[parent].push(name);
  85. });
  86. // 构建当前被选中的叶子节点
  87. const selectedLeafNames = value.map(path => path[path.length - 1]);
  88. // 如果 parent 下所有子节点都选中了,就把 parent 加进来
  89. Object.entries(parentToChildren).forEach(([parent, children]) => {
  90. const allChildrenSelected = children.every(child => selectedLeafNames.includes(child));
  91. if (allChildrenSelected && reverseMarketMapping[parent]) {
  92. ids.add(Number(reverseMarketMapping[parent]));
  93. }
  94. });
  95. // 修改:将数组转换为单个字符串(取第一个ID)
  96. const idArray = Array.from(ids);
  97. rechargeUser.value.market= idArray.length > 0 ? idArray[0].toString() : "";
  98. } else {
  99. rechargeUser.value.market = "";
  100. }
  101. console.log('最终映射后的 market IDs:', rechargeUser.value.market);
  102. };*/
  103. // 存储地区选择变化
  104. const selectedMarketPath = ref("")
  105. const handleMarketChange = (value) => {
  106. if (value && value.length > 0) {
  107. const lastValue = value[value.length - 1]
  108. rechargeUser.value.market = reverseMarketMapping[lastValue]
  109. } else {
  110. rechargeUser.value.market = ''
  111. }
  112. }
  113. /*// 处理地区选择变化单选场景
  114. const handleMarketChange = (value) => {
  115. // 重置为默认空值
  116. rechargeUser.value.market = "";
  117. // 检查是否有有效的选择值
  118. if (Array.isArray(value) && value.length > 0) {
  119. // 对于单选,value数组中通常只有一个路径
  120. const selectedPath = value[0];
  121. if (Array.isArray(selectedPath) && selectedPath.length > 0) {
  122. // 获取选中项的最后一级名称
  123. const lastName = selectedPath[selectedPath.length - 1];
  124. // 查找对应的ID
  125. const id = reverseMarketMapping[lastName];
  126. // 如果找到有效ID,转换为字符串格式
  127. if (id) {
  128. rechargeUser.value.market = String(id);
  129. }
  130. }
  131. }
  132. console.log('最终选中的 market ID:', rechargeUser.value.market);
  133. };*/
  134. // 搜索对象
  135. const getObj = ref({
  136. pageNum: 1,
  137. pageSize: 50
  138. })
  139. //分页总条目
  140. const total = ref(100)
  141. // 搜索对象时间
  142. const getTime = ref([])
  143. // 搜索活动列表
  144. const activity = ref([])
  145. // 所有信息
  146. const allData = ref([])
  147. // 搜索地区列表
  148. const market = ref("")
  149. //时间格式化
  150. const formatTime = (val) => val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : ''
  151. // 初始化 money 和 permanentGold 和 freeGold
  152. const money = ref(0)
  153. const permanentGold = ref(0)
  154. const freeGold = ref(0)
  155. // 定义响应式变量存储金币合计数
  156. const permanentGolds = ref(0)
  157. const freeGolds = ref(0)
  158. //无法选择的时间
  159. const disabledDate = (time) => {
  160. const limitDate = new Date(2025, 0, 1);
  161. return time.getTime() < limitDate.getTime();
  162. }
  163. // 支付方式选项
  164. const payModel = [
  165. {
  166. value: '微信',
  167. label: '微信'
  168. },
  169. {
  170. value: '支付宝',
  171. label: '支付宝'
  172. },
  173. {
  174. value: '银联',
  175. label: '银联'
  176. },
  177. {
  178. value: '信用卡',
  179. label: '信用卡'
  180. },
  181. {
  182. value: '借记卡',
  183. label: '借记卡'
  184. },
  185. {
  186. value: '现金充值',
  187. label: '现金充值'
  188. }
  189. ]
  190. // 删除==========================================================
  191. // 删除对象
  192. const delObj = ref({})
  193. // 获取活动名称
  194. const getActivity = async function () {
  195. try {
  196. // 发送POST请求
  197. const result = await API({ url: '/general/activity', data: {} })
  198. // 将响应结果存储到响应式数据中
  199. console.log('请求成功', result)
  200. // 检查返回的数据是否为数组
  201. if (Array.isArray(result.data)) {
  202. // 将字符串数组转换为 { value, label } 格式
  203. activity.value = result.data.map(item => ({ value: item, label: item }));
  204. } else {
  205. console.error('活动数据格式错误', result)
  206. ElMessage.error('活动数据格式错误,请联系管理员')
  207. }
  208. console.log('activity', activity.value)
  209. } catch (error) {
  210. console.log('请求失败', error)
  211. // 在这里可以处理错误逻辑,比如显示错误提示等
  212. }
  213. }
  214. const marketsTree = ref("")
  215. // 获取地区,修改为级联下拉框
  216. const getArea = async function () {
  217. try {
  218. // 发送POST请求
  219. const result = await API({
  220. url: '/market/selectMarket',
  221. });
  222. // 将响应结果存储到响应式数据中
  223. console.log('请求成功', result)
  224. // 递归转换树形结构为级联选择器需要的格式(跳过第一级节点)
  225. const transformTree = (nodes) => {
  226. // 直接处理第一级节点的子节点
  227. const allChildren = nodes.flatMap(node => node.children || []);
  228. return allChildren.map(child => {
  229. const grandchildren = child.children && child.children.length
  230. ? transformTree([child]) // 递归处理子节点
  231. : null;
  232. return {
  233. value: child.name,
  234. label: child.name,
  235. children: grandchildren
  236. };
  237. });
  238. };
  239. // 存储地区信息
  240. market.value = transformTree(result.data)
  241. console.log('转换后的地区树==============', market.value)
  242. } catch (error) {
  243. console.log('请求失败', error)
  244. }
  245. }
  246. //定义充值方式的加载状态
  247. const isLoadingPlatform = ref(false)
  248. // 充值平台
  249. const platform = ref([])
  250. //获取充值方式的函数
  251. const getPlatform = async () => {
  252. isLoadingPlatform.value = true;
  253. try {
  254. const result = await API({
  255. url: '/general/platform',
  256. method: 'post',
  257. data: {}// 这里添加参数
  258. })
  259. // 假设后端返回的是字符串数组,转换为 { value, label } 格式
  260. if (Array.isArray(result.data)) {
  261. platform.value = result.data.map(item => ({ value: item, label: item }));
  262. } else {
  263. console.error('充值方式格式错误', result)
  264. ElMessage.error('充值方式格式错误,请联系管理员')
  265. }
  266. } catch (error) {
  267. console.error('获取充值方式失败:', error);
  268. ElMessage.error('获取充值方式失败,请稍后重试');
  269. } finally {
  270. isLoadingPlatform.value = false
  271. }
  272. }
  273. // 搜索===========================================================================
  274. // 搜索方法
  275. const get = async function (val) {
  276. try {
  277. // 搜索参数页码赋值
  278. if (typeof val === 'number') {
  279. getObj.value.pageNum = val
  280. }
  281. // 搜索参数时间赋值
  282. if (getTime.value != null) {
  283. if (getTime.value.startTime != '' && getTime.value.endTime != '') {
  284. rechargeUser.value.startTime = formatTime(getTime.value[0])
  285. rechargeUser.value.endTime = formatTime(getTime.value[1])
  286. }
  287. } else {
  288. rechargeUser.value.startTime = ''
  289. rechargeUser.value.endTime = ''
  290. }
  291. // 搜索参数赋值
  292. rechargeUser.value.sortField = sortField.value
  293. rechargeUser.value.sortOrder = sortOrder.value
  294. console.log('搜索参数', getObj.value)
  295. // 发送POST请求
  296. // if (rechargeUser.value.market === '9' || rechargeUser.value.market === '9999') {
  297. // rechargeUser.value.market = '';
  298. // }
  299. if (rechargeUser.value.jwcode) {
  300. // 纯数字
  301. const numberRegex = /^\d{1,9}$/;
  302. // 检查是否不是数字
  303. if (!numberRegex.test(rechargeUser.value.jwcode)) {
  304. ElMessage.error('请检查精网号格式')
  305. // 上面提示过了
  306. return
  307. }
  308. }
  309. const result = await API({
  310. url: '/recharge/selectBy',
  311. data: {
  312. ...getObj.value,
  313. rechargeUser: { ...rechargeUser.value, flag: flag.value }//新增flag参数
  314. }
  315. })
  316. // 复制一份 rechargeUser.value 并移除排序字段和排序方式
  317. const detailWithoutSort = ref({
  318. ...rechargeUser.value,
  319. sortField: undefined,
  320. sortOrder: undefined,
  321. flag: flag.value // 新增 flag 参数
  322. })
  323. const resultTotalGold = await API({
  324. url: '/recharge/statsGold',
  325. data: {
  326. ...detailWithoutSort.value
  327. }
  328. })
  329. if (resultTotalGold.code === 200 && resultTotalGold.data) {
  330. const data = resultTotalGold.data
  331. console.log('获取到的金币数据:', data)
  332. permanentGolds.value = (Number(data.permanentGolds) || 0)
  333. freeGolds.value = (Number(data.freeGolds) || 0)
  334. }
  335. // 将响应结果存储到响应式数据中
  336. console.log('请求成功', result)
  337. // 存储表格数据
  338. tableData.value = result.data.list
  339. // 处理表格中的充值金额、永久金币和免费金币数据,除以 100
  340. tableData.value = tableData.value.map(item => ({
  341. ...item,
  342. // 处理永久金币
  343. permanentGold: (Number(item.permanentGold) || 0),
  344. // 处理免费金币
  345. freeGold: (Number(item.freeGold) || 0),
  346. // 处理充值金额
  347. money: (Number(item.money) || 0)
  348. }))
  349. console.log('tableData', tableData.value)
  350. // 存储分页总数
  351. total.value = result.data.total
  352. console.log('total', total.value)
  353. } catch (error) {
  354. console.log('请求失败', error)
  355. // 在这里可以处理错误逻辑,比如显示错误提示等
  356. }
  357. }
  358. // 搜索
  359. const search = function () {
  360. trimJwCode()
  361. getObj.value.pageNum = 1
  362. get()
  363. }
  364. // 重置
  365. const reset = function () {
  366. delete rechargeUser.value.jwcode
  367. delete rechargeUser.value.activity
  368. delete rechargeUser.value.payPlatform
  369. rechargeUser.value.market = ""
  370. selectedMarketPath.value = "" // 重置地区选择路径
  371. delete rechargeUser.value.startTime
  372. delete rechargeUser.value.endTime
  373. delete sortField.value
  374. delete sortOrder.value
  375. getTime.value = {}
  376. activeTimeRange.value = '' // 清除激活状态
  377. // 重置页码
  378. getObj.value.pageNum = 1
  379. get()
  380. }
  381. // 今天
  382. const getToday = function () {
  383. const today = dayjs()
  384. const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss')
  385. const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss')
  386. getTime.value = [startTime, endTime]
  387. console.log('getTime', getTime.value)
  388. activeTimeRange.value = 'today' // 标记当前激活状态
  389. get()
  390. }
  391. const handlePageSizeChange = function (val) {
  392. getObj.value.pageSize = val
  393. get()
  394. }
  395. const handleCurrentChange = function (val) {
  396. getObj.value.pageNum = val
  397. get()
  398. }
  399. // 昨天
  400. const getYesterday = function () {
  401. const today = dayjs()
  402. const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
  403. const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss')
  404. getTime.value = [startTime, endTime]
  405. console.log('getTime', getTime.value)
  406. activeTimeRange.value = 'yesterday' // 标记当前激活状态
  407. get()
  408. }
  409. // 近7天
  410. const get7Days = function () {
  411. const today = dayjs()
  412. const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
  413. const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss')
  414. getTime.value = [startTime, endTime]
  415. console.log('getTime', getTime.value)
  416. activeTimeRange.value = '7days' // 标记当前激活状态
  417. get()
  418. }
  419. const format3 = (num) => {
  420. // 每三位添加逗号
  421. return num.toLocaleString('en-US')
  422. }
  423. // 挂载
  424. onMounted(async function () {
  425. await get()
  426. await getActivity()
  427. await getAdminData()
  428. await getArea()
  429. await getPlatform()
  430. })
  431. // 新增排序字段和排序方式
  432. const sortField = ref()
  433. const sortOrder = ref()
  434. // 处理排序事件
  435. const handleSortChange = (column) => {
  436. console.log('排序字段:', column.prop)
  437. console.log('排序方式:', column.order)
  438. if (column.prop === 'money') {
  439. sortField.value = 'money'
  440. } else if (column.prop === 'freeGold') {
  441. sortField.value = 'freeGold'
  442. } else if (column.prop === 'auditTime') {
  443. sortField.value = 'auditTime'
  444. } else if (column.prop === 'createTime') {
  445. sortField.value = 'createTime'
  446. } else if (column.prop === 'permanentGold') {
  447. sortField.value = 'permanentGold'
  448. }
  449. sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC'
  450. console.log('传递给后端的排序字段:', sortField.value)
  451. console.log('传递给后端的排序方式:', sortOrder.value)
  452. get()
  453. }
  454. const exportExcel = async function () {
  455. const params = {
  456. rechargeUser: {
  457. ...rechargeUser.value,
  458. flag: flag.value
  459. },
  460. page: getObj.value.pageNum,
  461. size: total.value
  462. }
  463. try {
  464. const res = await API({ url: '/export/exportRecharge', data: params })
  465. if (res.code === 200) {
  466. ElMessage.success('导出成功')
  467. } else {
  468. ElMessage.error(res.message || '导出失败,请稍后重试')
  469. }
  470. } catch (error) {
  471. console.log('请求失败', error)
  472. ElMessage.error('导出失败,请稍后重试')
  473. }
  474. }
  475. const exportListVisible = ref(false)
  476. // 打开导出列表弹窗
  477. const openExportList = () => {
  478. getExportList()
  479. exportListVisible.value = true
  480. }
  481. // 导出列表数据
  482. const exportList = ref([])
  483. // 导出列表加载状态
  484. const exportListLoading = ref(false)
  485. // 获取导出列表
  486. const getExportList = async () => {
  487. exportListLoading.value = true
  488. try {
  489. const result = await API({ url: '/export/export' })
  490. if (result.code === 200) {
  491. const filteredData = result.data.filter(item => {
  492. return item.type === 2; //2表示金币充值列表
  493. });
  494. exportList.value = filteredData
  495. } else {
  496. ElMessage.error(result.msg || '获取导出列表失败')
  497. }
  498. } catch (error) {
  499. console.error('获取导出列表出错:', error)
  500. ElMessage.error('获取导出列表失败,请稍后重试')
  501. } finally {
  502. exportListLoading.value = false
  503. }
  504. }
  505. // 下载导出文件
  506. const downloadExportFile = (item) => {
  507. if (item.state === 2) {
  508. const link = document.createElement('a')
  509. link.href = item.url
  510. link.download = item.fileName
  511. link.click()
  512. } else {
  513. ElMessage.warning('文件还在导出中,请稍后再试')
  514. }
  515. }
  516. //根据状态返回对应的标签类型
  517. const getTagType = (state) => {
  518. switch (state) {
  519. case 0:
  520. return 'info';
  521. case 1:
  522. return 'primary';
  523. case 2:
  524. return 'success';
  525. case 3:
  526. return 'danger';
  527. default:
  528. return 'info';
  529. }
  530. }
  531. //根据状态返回对应的标签文案
  532. const getTagText = (state) => {
  533. switch (state) {
  534. case 0:
  535. return '待执行';
  536. case 1:
  537. return '执行中';
  538. case 2:
  539. return '执行完成';
  540. case 3:
  541. return '执行出错';
  542. default:
  543. return '未知状态';
  544. }
  545. }
  546. </script>
  547. <template>
  548. <el-card class="card1" style="margin-bottom: 0.5vh">
  549. <el-col style="margin-bottom: 1vh">
  550. <div class="select">
  551. <div class="selectRow">
  552. <el-text class="text" size="large">精网号</el-text>
  553. <el-input class="selectContent" v-model="rechargeUser.jwcode" placeholder="请输入精网号" clearable />
  554. </div>
  555. <div class="selectRow">
  556. <el-text class="text" size="large">活动名称</el-text>
  557. <el-select class="selectContent" v-model="rechargeUser.activity" placeholder="请选择活动名称" clearable>
  558. <el-option v-for="item in activity" :key="item.value" :label="item.label" :value="item.value" />
  559. </el-select>
  560. </div>
  561. <div class="selectRow" style="width: 15vw;">
  562. <el-text class="text" size="large">所属地区</el-text>
  563. <el-cascader class="selectContent" v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区"
  564. clearable @change="handleMarketChange" />
  565. </div>
  566. <div class="selectRow" style="width: 15vw;">
  567. <el-text class="text" size="large">充值平台</el-text>
  568. <el-select class="selectContent" v-model="rechargeUser.payPlatform" placeholder="请选择充值平台" clearable>
  569. <el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value" />
  570. </el-select>
  571. </div>
  572. <!-- <el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox> -->
  573. </div>
  574. </el-col>
  575. <el-col>
  576. <div class="select">
  577. <div class="selectRow" style="width: 36vw;">
  578. <el-text class="text" size="large">充值时间</el-text>
  579. <el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
  580. start-placeholder="起始时间" end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
  581. @change="handleDatePickerChange" :default-time="defaultTime" :disabled-date="disabledDate" />
  582. <div v-if="false">
  583. <el-button @click="getToday()" style="margin-left: 1vw"
  584. :type="activeTimeRange === 'today' ? 'primary' : ''">
  585. </el-button>
  586. <el-button @click="getYesterday()" style="margin-left: 1vw"
  587. :type="activeTimeRange === 'yesterday' ? 'primary' : ''">
  588. </el-button>
  589. <el-button @click="get7Days()" style="margin-left: 1vw"
  590. :type="activeTimeRange === '7days' ? 'primary' : ''">
  591. 近7天
  592. </el-button>
  593. </div>
  594. </div>
  595. <div class="selectRow" style="justify-content: flex-start;">
  596. <el-button type="primary" @click="search()">查询</el-button>
  597. <el-button type="primary" @click="exportExcel()">导出Excel</el-button>
  598. <el-button type="primary" @click="openExportList">查看导出列表</el-button>
  599. <el-button type="success" @click="reset()">重置</el-button>
  600. </div>
  601. </div>
  602. </el-col>
  603. </el-card>
  604. <el-card class="card2">
  605. <div class="goldStatistics">
  606. 充值新币{{ format3(permanentGolds) }}新币&nbsp;&nbsp;&nbsp;&nbsp;
  607. 总金币数{{ format3(permanentGolds + freeGolds) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
  608. 永久金币{{ format3(permanentGolds) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
  609. 免费金币{{ format3(freeGolds) }}金币
  610. </div>
  611. <!-- 设置表格容器的高度和滚动样式 -->
  612. <div style="height: 66vh;">
  613. <el-table :data="tableData" height="66vh" @sort-change="handleSortChange">
  614. <el-table-column type="index" label="序号" width="80px" fixed="left">
  615. <template #default="scope">
  616. <span>{{
  617. scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
  618. }}</span>
  619. </template>
  620. </el-table-column>
  621. <el-table-column fixed="left" prop="name" label="姓名" width="150px" />
  622. <el-table-column fixed="left" prop="jwcode" label="精网号" width="110px" />
  623. <el-table-column prop="market" label="所属地区" width="100px" />
  624. <el-table-column prop="activity" label="活动名称" width="110px" show-overflow-tooltip />
  625. <el-table-column prop="rateName" label="货币名称" width="110px" />
  626. <el-table-column prop="money" sortable="custom" label="充值金额" width="110px" />
  627. <el-table-column prop="permanentGold" label="永久金币" sortable="custom" width="110px" />
  628. <el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px" />
  629. <el-table-column prop="payPlatform" label="充值平台" width="110px" />
  630. <el-table-column prop="payModel" label="支付方式" width="100px" />
  631. <el-table-column prop="remark" label="备注" width="150px" show-overflow-tooltip />
  632. <el-table-column prop="isRefund" label="订单状态" width="200px" show-overflow-tooltip>
  633. <template #default="scope">
  634. <span v-if="scope.row.isRefund == 0">正常</span>
  635. <span v-else-if="scope.row.isRefund == 1">已退款</span>
  636. <span v-else>未知状态</span>
  637. </template>
  638. </el-table-column>
  639. <el-table-column prop="adminName" label="提交人" width="100px" />
  640. <el-table-column prop="auditTime" sortable label="充值时间" width="200px">
  641. <template #default="scope">
  642. {{ moment(scope.row.auditTime).format('YYYY-MM-DD HH:mm:ss') }}
  643. </template>
  644. </el-table-column>
  645. </el-table>
  646. </div>
  647. <!-- 分页 -->
  648. <div style="margin-top: 1vh">
  649. <el-pagination background :current-page="getObj.pageNum" :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
  650. layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
  651. @current-change="handleCurrentChange"></el-pagination>
  652. </div>
  653. </el-card>
  654. <!-- 导出弹窗 -->
  655. <el-dialog v-model="exportListVisible" title="导出列表" width="80%">
  656. <el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
  657. <el-table-column prop="fileName" label="文件名" />
  658. <el-table-column prop="state" label="状态">
  659. <template #default="scope">
  660. <el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
  661. {{ getTagText(scope.row.state) }}
  662. </el-tag>
  663. </template>
  664. </el-table-column>
  665. <el-table-column prop="createTime" label="创建时间">
  666. <template #default="scope">
  667. {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
  668. </template>
  669. </el-table-column>
  670. <el-table-column label="操作">
  671. <template #default="scope">
  672. <el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
  673. :disabled="scope.row.state !== 2">
  674. 下载
  675. </el-button>
  676. </template>
  677. </el-table-column>
  678. </el-table>
  679. <template #footer>
  680. <div class="dialog-footer">
  681. <el-button text @click="exportListVisible = false">关闭</el-button>
  682. </div>
  683. </template>
  684. </el-dialog>
  685. </template>
  686. <style scoped lang="scss">
  687. // 搜索的卡片样式
  688. .card1 {
  689. background: #F3FAFE;
  690. }
  691. // 表单的卡片样式
  692. .card2 {
  693. background: #E7F4FD;
  694. }
  695. // 新币总数等等
  696. .goldStatistics {
  697. margin-left: 1vw;
  698. margin-bottom: 1vh;
  699. color: #000000;
  700. font-family: "PingFang SC";
  701. font-size: 16px;
  702. font-style: normal;
  703. font-weight: 700;
  704. line-height: 20px;
  705. }
  706. // 表头背景等
  707. :deep(.el-table__header-wrapper),
  708. :deep(.el-table__body-wrapper),
  709. :deep(.el-table__cell),
  710. /* 表格 */
  711. :deep(.el-table__body td) {
  712. background-color: #F3FAFE !important;
  713. }
  714. /* 表头 */
  715. :deep(.el-table__header th) {
  716. background-color: #F3FAFE !important;
  717. }
  718. /* 鼠标悬停 */
  719. :deep(.el-table__row:hover > .el-table__cell) {
  720. background-color: #E5EBFE !important;
  721. }
  722. /** 上面搜索的布局 **/
  723. .select {
  724. display: flex;
  725. .selectRow {
  726. width: 17vw;
  727. display: flex;
  728. align-items: center;
  729. justify-content: center;
  730. padding: 0 0.5vw;
  731. .text {
  732. width: 5vw;
  733. font-size: 15px;
  734. }
  735. .selectContent {
  736. flex: 1;
  737. }
  738. }
  739. }
  740. </style>