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.

730 lines
23 KiB

7 months ago
7 months ago
7 months ago
4 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
4 months ago
7 months ago
2 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
5 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
4 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 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 { useAdminStore } from "@/store/index.js"
  9. import { storeToRefs } from "pinia"
  10. import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js"
  11. const adminStore = useAdminStore()
  12. const { adminData, menuTree, flag } = storeToRefs(adminStore)
  13. // 国际化
  14. import { useI18n } from 'vue-i18n'
  15. const { t } = useI18n()
  16. //新增复选框员工数据
  17. // const showEmployeeData = ref(false)
  18. // 监听全局flag状态变化
  19. watch(flag, (newFlag, oldFlag) => {
  20. // 当flag状态改变时,重新发送请求
  21. if (newFlag !== oldFlag) {
  22. console.log('员工数据flag状态改变,重新加载数据', newFlag)
  23. get()
  24. }
  25. })
  26. // 标记当前激活的时间范围按钮
  27. const activeTimeRange = ref('')
  28. const defaultTime = [
  29. new Date(2000, 1, 1, 0, 0, 0),
  30. new Date(2000, 2, 1, 23, 59, 59),
  31. ]
  32. // 日期选择器变化时清除按钮激活状态
  33. const handleDatePickerChange = () => {
  34. activeTimeRange.value = ''
  35. }
  36. // 定义ref 变量来存储合计数据
  37. const totalPermanentGold = ref(0)
  38. const totalFreeGold = ref(0)
  39. const totalTaskGold = ref(0)
  40. const totalGoldTotal = ref(0)
  41. // 变量
  42. // 精网号去空格,处理 goldDetail 中的 jwcode
  43. const trimJwCode = () => {
  44. if (goldDetail.value.jwcode) {
  45. goldDetail.value.jwcode = goldDetail.value.jwcode.replace(/\s/g, '');
  46. }
  47. }
  48. //定义平台信息的加载状态
  49. const isLoadingPlatform = ref(false)
  50. // 平台信息
  51. const platform = ref([])
  52. //获取平台信息的函数
  53. const getPlatform = async () => {
  54. isLoadingPlatform.value = true;
  55. try {
  56. const result = await API({
  57. url: '/general/platform',
  58. method: 'post',
  59. })
  60. if (Array.isArray(result.data)) {
  61. platform.value = result.data.map(item => ({ value: item, label: item }));
  62. } else {
  63. console.error('平台信息格式错误', result)
  64. ElMessage.error(t('elmessage.payPlatformError'))
  65. }
  66. } catch (error) {
  67. console.error('获取平台信息失败:', error);
  68. ElMessage.error(t('elmessage.payPlatformError'))
  69. } finally {
  70. isLoadingPlatform.value = false
  71. }
  72. }
  73. // 数量更新类型选项
  74. const type = [
  75. {
  76. value: '0',
  77. label: t('clientCount.type.recharge')
  78. },
  79. {
  80. value: '1',
  81. label: t('clientCount.type.consume')
  82. },
  83. {
  84. value: '2',
  85. label: t('clientCount.type.refund')
  86. }
  87. ]
  88. // 定义加载状态,获取地区数据
  89. // 定义加载状态,获取地区数据
  90. const isLoadingmarket = ref(false);
  91. const markets = ref([])
  92. // 充值明细表格
  93. const tableData = ref([])
  94. // 各金币字段变量
  95. // const sumGoldTotal = ref(0)
  96. const permanentGold = ref(0)
  97. //const freeGold = ref(0)
  98. const taskGold = ref(0)
  99. // 搜索===========================================
  100. //分页总条目
  101. const total = ref(100)
  102. // 搜索对象时间
  103. const getTime = ref([])
  104. // 搜索goldDetail
  105. const goldDetail = ref({
  106. markets: [],
  107. })
  108. // 搜索对象
  109. const getObj = ref({
  110. pageNum: 1,
  111. pageSize: 50
  112. })
  113. // 开启条件筛选导出excel
  114. // const getPutEX = ref(false)
  115. // 方法
  116. // 搜索===========================================================================
  117. // 搜索方法
  118. const get = async function (val) {
  119. if (!findMenuById(menuTree.value, permissionMapping.gold_coin_customer_bill)) {
  120. ElMessage.error(t('elmessage.noPermission'))
  121. return
  122. }
  123. try {
  124. // 搜索参数页码赋值
  125. if (typeof val === 'number') {
  126. getObj.value.pageNum = val
  127. }
  128. if (getTime.value && getTime.value.length === 2) {//检查是否同时选择了开始时间和结束时间,如果不是则置空
  129. goldDetail.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss');
  130. goldDetail.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss');
  131. } else {
  132. goldDetail.value.startTime = ''
  133. goldDetail.value.endTime = ''
  134. }
  135. // 添加排序字段和排序方式到请求参数
  136. goldDetail.value.sortField = sortField.value
  137. goldDetail.value.sortOrder = sortOrder.value
  138. console.log('搜索参数', getObj.value)
  139. console.log('jwcode 类型:', typeof goldDetail.value.jwcode);
  140. console.log('jwcode 值:', goldDetail.value.jwcode);
  141. const requestData = { ...getObj.value, goldDetail: { ...goldDetail.value } };
  142. console.log('最终请求参数', JSON.stringify(requestData, null, 2)); // 打印格式化后的请求参数
  143. // 检查markets数组中是否包含'总部'或'研发部'
  144. console.log('goldDetail.value.markets:', goldDetail.value.markets)
  145. // if (goldDetail.value.markets.includes('9') || goldDetail.value.markets.includes('9999')) {
  146. // goldDetail.value.markets = [];
  147. // }
  148. if (goldDetail.value.jwcode) {
  149. // 纯数字
  150. const numberRegex = /^\d{1,9}$/;
  151. // 检查是否不是数字
  152. if (!numberRegex.test(goldDetail.value.jwcode)) {
  153. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  154. // 上面提示过了
  155. return
  156. }
  157. }
  158. const result = await API({
  159. url: '/goldDetail/getGoldDetail',
  160. method: 'post',
  161. data: { ...getObj.value, goldDetail: { ...goldDetail.value,
  162. // flag: showEmployeeData.value ? 0 : 1
  163. flag: flag.value
  164. } }
  165. })
  166. console.log('响应数据', result)
  167. tableData.value = result.data.list
  168. total.value = result.data.total
  169. const totalResult = await API({
  170. url: '/goldDetail/getTotal',
  171. method: 'post',
  172. data: {
  173. goldDetail: { ...goldDetail.value,
  174. // flag: showEmployeeData.value ? 0 : 1
  175. flag: flag.value
  176. },
  177. /* jwcode: goldDetail.value.jwcode || '',
  178. payPlatform: goldDetail.value.payPlatform || '',
  179. type: goldDetail.value.type || '',
  180. market: goldDetail.value.market || '',
  181. startTime: goldDetail.value.startTime || '',
  182. endTime: goldDetail.value.endTime || ''*/
  183. }
  184. })
  185. if (totalResult.code === 200) {
  186. const data = totalResult.data
  187. totalPermanentGold.value = data.permanentGolds
  188. totalFreeGold.value = data.freeGolds
  189. totalTaskGold.value = data.taskGolds
  190. totalGoldTotal.value = data.sumGolds
  191. } else if (totalResult.code === 0) {
  192. // 将表格数据设置为空数组
  193. tableData.value = []
  194. totalPermanentGold.value = 0
  195. totalFreeGold.value = 0
  196. totalTaskGold.value = 0
  197. totalGoldTotal.value = 0
  198. } else {
  199. ElMessage.error(t('elmessage.getTotalFailed'))
  200. }
  201. } catch (error) {
  202. console.log('请求失败', error)
  203. }
  204. }
  205. // 重置
  206. const reset = function () {
  207. goldDetail.value = {}
  208. goldDetail.value.markets = []
  209. selectedMarketPath.value = []
  210. delete sortField.value
  211. delete sortOrder.value
  212. getTime.value = []
  213. activeTimeRange.value = '' // 清除激活状态
  214. //重置页码
  215. getObj.value.pageNum = 1
  216. search()
  217. }
  218. // 搜索,点击查询按钮后触发
  219. const search = function () {
  220. trimJwCode();
  221. getObj.value.pageNum = 1
  222. get()
  223. }
  224. // 今天
  225. const getToday = function () {
  226. const today = dayjs()
  227. const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss')
  228. const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss')
  229. getTime.value = [startTime, endTime]
  230. activeTimeRange.value = 'today' // 标记当前激活状态
  231. search()
  232. }
  233. // 昨天
  234. const getYesterday = function () {
  235. const today = dayjs()
  236. const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
  237. const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss')
  238. getTime.value = [startTime, endTime]
  239. activeTimeRange.value = 'yesterday' // 标记当前激活状态
  240. search()
  241. }
  242. // 近7天
  243. const get7Days = function () {
  244. const today = dayjs()
  245. const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
  246. const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss')
  247. getTime.value = [startTime, endTime]
  248. activeTimeRange.value = '7days' // 标记当前激活状态
  249. search()
  250. }
  251. // 计算每行免费金币6月+12月的方法
  252. const calculateFreeGold = (row) => {
  253. const freeJune = row.freeJune || 0;
  254. const freeDecember = row.freeDecember || 0;
  255. return (freeJune + freeDecember);
  256. }
  257. // 新增排序字段和排序方式
  258. const sortField = ref('')
  259. const sortOrder = ref('')
  260. // 处理排序事件
  261. const handleSortChange = (column) => {
  262. if (column.prop === 'sumGold') {//新增金币总数字段排序
  263. sortField.value = 'sum_gold'
  264. } else if (column.prop === 'permanentGold') {
  265. sortField.value = 'permanent_gold'
  266. } else if (column.prop === 'taskGold') {
  267. sortField.value = 'task_gold'
  268. } else if (column.prop === 'freeGold') {
  269. sortField.value = 'freeGold'
  270. } else if (column.prop === 'auditTime') {//删除了更新时间的creatTime
  271. sortField.value = 'audit_time'
  272. }
  273. sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC'
  274. //get()要写在handleSortChange方法里面,不然会导致排序失效
  275. get()
  276. }
  277. const exportExcel = async function () {
  278. const params = {
  279. goldDetail: {
  280. jwcode: goldDetail.value.jwcode || '',
  281. payPlatform: goldDetail.value.payPlatform || '',
  282. type: goldDetail.value.type || '',
  283. markets: goldDetail.value.markets || [],
  284. startTime: goldDetail.value.startTime || '',
  285. endTime: goldDetail.value.endTime || '',
  286. sortField: goldDetail.value.sortField || '',
  287. sortOrder: goldDetail.value.sortOrder || '',
  288. // flag: showEmployeeData.value ? 0 : 1 // 新增 flag 参数
  289. flag: flag.value
  290. },
  291. }
  292. const res = await API({ url: '/goldDetail/export', data: params })
  293. if (res.code === 200) {
  294. ElMessage.success(t('elmessage.exportSuccess'))
  295. }
  296. }
  297. const handlePageSizeChange = function (val) {
  298. getObj.value.pageSize = val
  299. get()
  300. }
  301. const handleCurrentChange = function (val) {
  302. getObj.value.pageNum = val
  303. get()
  304. }
  305. // 挂载
  306. onMounted(async function () {
  307. await get()
  308. await getMarket()
  309. await getPlatform() // 调用获取平台信息的函数
  310. })
  311. const exportListVisible = ref(false)
  312. // 打开导出列表弹窗
  313. const openExportList = () => {
  314. getExportList()
  315. exportListVisible.value = true
  316. }
  317. // 导出列表数据
  318. const exportList = ref([])
  319. // 导出列表加载状态
  320. const exportListLoading = ref(false)
  321. // 获取导出列表
  322. const getExportList = async () => {
  323. exportListLoading.value = true
  324. try {
  325. const result = await API({ url: '/export/export' })
  326. if (result.code === 200) {
  327. const filteredData = result.data.filter(item => {
  328. return item.type === 0; //0表示客户明细
  329. });
  330. exportList.value = filteredData
  331. } else {
  332. ElMessage.error(result.msg || t('elmessage.getExportListError'))
  333. }
  334. } catch (error) {
  335. console.error('获取导出列表出错:', error)
  336. ElMessage.error(t('elmessage.getExportListError'))
  337. } finally {
  338. exportListLoading.value = false
  339. }
  340. }
  341. // 下载导出文件
  342. const downloadExportFile = (item) => {
  343. if (item.state === 2) {
  344. const link = document.createElement('a')
  345. link.href = item.url
  346. link.download = item.fileName
  347. link.click()
  348. } else {
  349. ElMessage.warning(t('elmessage.exportingInProgress'))
  350. }
  351. }
  352. //根据状态返回对应的标签类型
  353. const getTagType = (state) => {
  354. switch (state) {
  355. case 0:
  356. return 'info';
  357. case 1:
  358. return 'primary';
  359. case 2:
  360. return 'success';
  361. case 3:
  362. return 'danger';
  363. default:
  364. return 'info';
  365. }
  366. }
  367. //根据状态返回对应的标签文案
  368. const getTagText = (state) => {
  369. switch (state) {
  370. case 0:
  371. return t('elmessage.pendingExecution');
  372. case 1:
  373. return t('elmessage.executing');
  374. case 2:
  375. return t('elmessage.executed');
  376. case 3:
  377. return t('elmessage.errorExecution');
  378. default:
  379. return t('elmessage.unknownStatus');
  380. }
  381. }
  382. // 存储地区选择变化
  383. const selectedMarketPath = ref([])
  384. const handleMarketChange = (value) => {
  385. if (value && value.length > 0) {
  386. const lastValue = value[value.length - 1];
  387. // 确保返回值是数组,如果不是则包装成数组
  388. const marketValue = reverseMarketMapping[lastValue];
  389. goldDetail.value.markets = Array.isArray(marketValue) ? marketValue : [marketValue];
  390. } else {
  391. // 保持[""]格式
  392. goldDetail.value.markets = [];
  393. }
  394. };
  395. // 获取地区,修改为级联下拉框
  396. const getMarket = async function () {
  397. try {
  398. // 发送POST请求
  399. const result = await API({
  400. url: '/market/selectMarket',
  401. });
  402. // 将响应结果存储到响应式数据中
  403. console.log('请求成功', result)
  404. // 递归转换树形结构为级联选择器需要的格式(跳过第一级节点)
  405. const transformTree = (nodes) => {
  406. // 直接处理第一级节点的子节点
  407. const allChildren = nodes.flatMap(node => node.children || []);
  408. return allChildren.map(child => {
  409. const grandchildren = child.children && child.children.length
  410. ? transformTree([child]) // 递归处理子节点
  411. : null;
  412. return {
  413. value: child.name,
  414. label: child.name,
  415. children: grandchildren
  416. };
  417. });
  418. };
  419. // 存储地区信息
  420. markets.value = transformTree(result.data)
  421. console.log('转换后的地区树==============', markets.value)
  422. } catch (error) {
  423. console.log('请求失败', error)
  424. }
  425. }
  426. const format3 = (num) => {
  427. // 每三位添加逗号
  428. return num.toLocaleString('en-US')
  429. }
  430. </script>
  431. <template>
  432. <div>
  433. <el-card class="card1" style="margin-bottom: 0.5vh;">
  434. <el-col style="margin-bottom: 1vh">
  435. <div class="select">
  436. <div class="selectRow">
  437. <el-text class="text" size="large">{{ $t('common.jwcode') }}</el-text>
  438. <el-input class="selectContent" v-model="goldDetail.jwcode" :placeholder="$t('common.jwcodePlaceholder')" clearable />
  439. </div>
  440. <div class="selectRow">
  441. <el-text class="text" size="large">{{ $t('common.payPlatform') }}</el-text>
  442. <el-select class="selectContent" v-model="goldDetail.payPlatform" :placeholder="$t('common.payPlatformPlaceholder')" style="width: 10vw;"
  443. clearable :loading="isLoadingPlatform">
  444. <el-option v-for="item in platform" :key="item.id" :label="item.label" :value="item.value" />
  445. </el-select>
  446. </div>
  447. <div class="selectRow">
  448. <el-text class="textB" size="large">{{ $t('common.updateType') }}</el-text>
  449. <el-select v-model="goldDetail.type" :placeholder="$t('common.updateTypePlaceholder')" clearable>
  450. <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value" />
  451. </el-select>
  452. </div>
  453. <div class="selectRow">
  454. <el-text size="large">{{ $t('common.market') }}</el-text>
  455. <el-cascader class="selectContent" v-model="selectedMarketPath" :options="markets" :placeholder="$t('common.marketPlaceholder')"
  456. style="width:10vw" clearable @change="handleMarketChange" />
  457. </div>
  458. <!-- <div>
  459. <el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
  460. </div> -->
  461. </div>
  462. </el-col>
  463. <el-col>
  464. <div class="select">
  465. <div class="selectRow" style="width: 35vw">
  466. <el-text class="text" size="large">{{ $t('common.updateTime') }}</el-text>
  467. <el-date-picker class="selectContent" v-model="getTime" type="datetimerange" :range-separator="$t('common.to')"
  468. :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" style="width: 14.2vw" @change="handleDatePickerChange"
  469. :default-time="defaultTime" :disabled-date="disabledDate" />
  470. <el-button @click="getToday()" style="margin-left: 0.3vw"
  471. :type="activeTimeRange === 'today' ? 'primary' : ''">
  472. {{ $t('common.today') }}
  473. </el-button>
  474. <el-button @click="getYesterday()" style="margin-left: 0.3vw"
  475. :type="activeTimeRange === 'yesterday' ? 'primary' : ''">
  476. {{ $t('common.yesterday') }}
  477. </el-button>
  478. <el-button @click="get7Days()" style="margin-left: 0.3vw"
  479. :type="activeTimeRange === '7days' ? 'primary' : ''">
  480. {{ $t('common.last7Days') }}
  481. </el-button>
  482. </div>
  483. <div class="selectRow" style="justify-content: flex-start;">
  484. <el-button type="primary" @click="search()">{{ $t('common.search') }}</el-button>
  485. <el-button type="primary" @click="exportExcel">{{ $t('common.exportExcel') }}</el-button>
  486. <el-button type="primary" @click="openExportList">{{ $t('common.viewExportList') }}</el-button>
  487. <el-button type="success" @click="reset()">{{ $t('common.reset') }}</el-button>
  488. </div>
  489. </div>
  490. </el-col>
  491. </el-card>
  492. <el-card class="card2">
  493. <div class="goldStatistics">
  494. {{ $t('common.netGoldChange') }}{{ format3(totalGoldTotal || 0) }}&nbsp;&nbsp;&nbsp;&nbsp;
  495. {{ $t('common.permanentGold') }}{{ format3(totalPermanentGold || 0) }}&nbsp;&nbsp;&nbsp;&nbsp;
  496. {{ $t('common.freeGold') }}{{ format3(totalFreeGold || 0) }}&nbsp;&nbsp;&nbsp;&nbsp;
  497. {{ $t('common.taskGold') }}{{ format3(totalTaskGold || 0) }}&nbsp;&nbsp;
  498. <a style="color:#b1b1b1; font-size: small;">{{ $t('common.netGoldChangeTip') }}</a>
  499. </div>
  500. <div style="height: 65vh; ">
  501. <el-table :data="tableData" style="height: 65vh" @sort-change="handleSortChange" :row-style="{ height: '50px' }">
  502. <el-table-column type="index" :label="$t('common_list.id')" width="80px" fixed="left">
  503. <template #default="scope">
  504. <span>{{
  505. scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
  506. }}</span>
  507. </template>
  508. </el-table-column>
  509. <el-table-column fixed="left" prop="name" :label="$t('common_list.name')" width="150" show-overflow-tooltip />
  510. <el-table-column fixed="left" prop="jwcode" :label="$t('common_list.jwcode')" width="120" />
  511. <el-table-column prop="market" :label="$t('common_list.market')" width="120" />
  512. <el-table-column prop="payPlatform" :label="$t('common_list.payPlatform')" width="140" />
  513. <el-table-column prop="type" :label="$t('common_list.type')" width="130">
  514. <template #default="scope">
  515. <span v-if="scope.row.type === 0">{{ $t('clientCount.recharge') }}</span>
  516. <span v-if="scope.row.type === 1">{{ $t('clientCount.consume') }}</span>
  517. <span v-if="scope.row.type === 2">{{ $t('clientCount.refund') }}</span>
  518. <span v-if="scope.row.type === 3">{{ $t('clientCount.other') }}</span>
  519. </template>
  520. </el-table-column>
  521. <el-table-column prop="sumGold" sortable="custom" :label="$t('common_list.Gold')" width="110">
  522. <template #default="scope">
  523. <span>{{ (scope.row.sumGold || 0) }}</span>
  524. </template>
  525. </el-table-column>
  526. <el-table-column prop="permanentGold" sortable="custom" :label="$t('common_list.permanentGold')" width="130">
  527. <template #default="scope">
  528. <span>{{ (scope.row.permanentGold || 0) }}</span>
  529. </template>
  530. </el-table-column>
  531. <el-table-column prop="freeGold" sortable="custom" :label="$t('common_list.freeGold')" width="130">
  532. <template #default="scope">
  533. <span>{{ (calculateFreeGold(scope.row) || 0) }}</span>
  534. </template>
  535. </el-table-column>
  536. <el-table-column prop="taskGold" sortable="custom" :label="$t('common_list.taskGold')" width="130">
  537. <template #default="scope">
  538. <span>{{ (scope.row.taskGold || 0) }}</span>
  539. </template>
  540. </el-table-column>
  541. <el-table-column prop="adminName" :label="$t('common_list.submitter')" width="110" />
  542. <el-table-column prop="auditTime" sortable="custom" :label="$t('common_list.updateTime')" width="210" show-overflow-tooltip>
  543. <template #default="scope">
  544. <span>{{
  545. moment(scope.row.auditTime).format('YYYY-MM-DD HH:mm:ss')
  546. }}</span>
  547. </template>
  548. </el-table-column>
  549. </el-table>
  550. </div>
  551. <!-- 此处分页 -->
  552. <div class="pagination" >
  553. <el-pagination background :current-page="getObj.pageNum" :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
  554. layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
  555. @current-change="handleCurrentChange"></el-pagination>
  556. </div>
  557. </el-card>
  558. <!-- 导出列表弹窗 -->
  559. <el-dialog v-model="exportListVisible" :title="$t('common_export.exportList')" width="80%">
  560. <el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
  561. <el-table-column prop="fileName" :label="$t('common_export.fileName')" />
  562. <el-table-column prop="state" :label="$t('common_export.status')">
  563. <template #default="scope">
  564. <el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
  565. {{ getTagText(scope.row.state) }}
  566. </el-tag>
  567. </template>
  568. </el-table-column>
  569. <el-table-column prop="createTime" :label="$t('common_export.createTime')">
  570. <template #default="scope">
  571. {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
  572. </template>
  573. </el-table-column>
  574. <el-table-column :label="$t('common_export.operation')">
  575. <template #default="scope">
  576. <el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
  577. :disabled="scope.row.state !== 2">
  578. {{ $t('common_export.download') }}
  579. </el-button>
  580. </template>
  581. </el-table-column>
  582. </el-table>
  583. <template #footer>
  584. <div class="dialog-footer">
  585. <el-button text @click="exportListVisible = false">
  586. {{ $t('common_export.close') }}
  587. </el-button>
  588. </div>
  589. </template>
  590. </el-dialog>
  591. </div>
  592. </template>
  593. <style scoped lang="scss">
  594. .pagination {
  595. display: flex;
  596. margin-top: 1vh;
  597. }
  598. // 搜索的卡片样式
  599. .card1 {
  600. background: #F3FAFE;
  601. }
  602. // 表单的卡片样式
  603. .card2 {
  604. background: #E7F4FD;
  605. }
  606. // 新币总数等等
  607. .goldStatistics {
  608. margin-left: 1vw;
  609. margin-bottom: 1vh;
  610. color: #000000;
  611. font-family: "PingFang SC";
  612. font-size: 16px;
  613. font-style: normal;
  614. font-weight: 700;
  615. line-height: 20px;
  616. }
  617. // 表头背景等
  618. :deep(.el-table__header-wrapper),
  619. :deep(.el-table__body-wrapper),
  620. :deep(.el-table__cell),
  621. /* 表格 */
  622. :deep(.el-table__body td) {
  623. background-color: #F3FAFE !important;
  624. }
  625. /* 表头 */
  626. :deep(.el-table__header th) {
  627. background-color: #F3FAFE !important;
  628. }
  629. /* 鼠标悬停 */
  630. :deep(.el-table__row:hover > .el-table__cell) {
  631. background-color: #E5EBFE !important;
  632. }
  633. .dialog-footer {
  634. display: flex;
  635. justify-content: flex-end;
  636. }
  637. /** 搜索的样式 */
  638. .select {
  639. display: flex;
  640. .selectRow {
  641. width: 17vw;
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. padding: 0 0.5vw;
  646. .text {
  647. width: 5vw;
  648. font-size: 15px;
  649. }
  650. .textB {
  651. width: 9vw;
  652. font-size: 15px;
  653. }
  654. .selectContent {
  655. flex: 1;
  656. }
  657. }
  658. }
  659. </style>