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.

848 lines
24 KiB

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