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.

815 lines
26 KiB

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