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.

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