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.

725 lines
24 KiB

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