order-recycle-log.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!-- 编辑弹窗 -->
  2. <template>
  3. <ele-modal form :width="1080" v-model="visible" title="回收修改日志">
  4. <SimpleTable
  5. style="width: 100%"
  6. :columns="columns"
  7. border
  8. :fetchPage="fetchPage"
  9. ref="tableRef"
  10. pagination
  11. >
  12. <template #discount="{ row }">
  13. <div class="flex flex-col align-center">
  14. <el-text>折扣:{{ row.discount }}折</el-text>
  15. <el-text>价格:¥ {{ row.price }}</el-text>
  16. </div>
  17. </template>
  18. <template #recycleTime="{ row }">
  19. <div class="flex flex-col align-center">
  20. <el-text>开始回收时间:{{ row.createTime }}</el-text>
  21. <el-text>结束回收时间:{{ row.createTime }}</el-text>
  22. </div>
  23. </template>
  24. <template #modifyInfo="{ row }">
  25. <div class="flex flex-col align-center">
  26. <el-text>修改人:{{ row.createName }}</el-text>
  27. <el-text>修改时间:{{ row.createTime }}</el-text>
  28. </div>
  29. </template>
  30. </SimpleTable>
  31. <template #footer>
  32. <el-button @click="handleCancel">关闭</el-button>
  33. </template>
  34. </ele-modal>
  35. </template>
  36. <script setup>
  37. import { ref, reactive, nextTick } from 'vue';
  38. import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
  39. import SimpleTable from '@/components/CommonPage/SimpleTable.vue';
  40. import request from '@/utils/request';
  41. function fetchPage(params) {
  42. return request.get(
  43. '/book/bookRecycleInfo/discount/changeList/' + isbn.value,
  44. {
  45. params
  46. }
  47. );
  48. }
  49. /** 弹窗是否打开 */
  50. const visible = defineModel({ type: Boolean });
  51. /** 关闭弹窗 */
  52. const handleCancel = () => {
  53. visible.value = false;
  54. };
  55. /** 弹窗打开事件 */
  56. let isbn = ref();
  57. const tableRef = ref();
  58. const handleOpen = (row) => {
  59. visible.value = true;
  60. isbn.value = row.isbn;
  61. nextTick(() => {
  62. tableRef.value?.reload();
  63. });
  64. };
  65. // 1-开启回收 2-关闭回收 3-加入黑名单 4-人工暂停回收 5-移除黑名单
  66. let typeList = {
  67. 1: '开启回收',
  68. 2: '关闭回收',
  69. 3: '加入黑名单',
  70. 4: '人工暂停回收',
  71. 5: '移除黑名单'
  72. };
  73. // 表格数据
  74. const columns = reactive([
  75. {
  76. label: '修改后状态',
  77. prop: 'createBy',
  78. minWidth: 120,
  79. formatter: (row) => typeList[row.type]
  80. },
  81. {
  82. label: '修改后折扣',
  83. prop: 'discount',
  84. slot: 'discount',
  85. minWidth: 120
  86. },
  87. {
  88. label: '回收时间',
  89. prop: 'recycleTime',
  90. slot: 'recycleTime',
  91. minWidth: 200
  92. },
  93. {
  94. label: '修改信息',
  95. prop: 'modifyInfo',
  96. slot: 'modifyInfo',
  97. minWidth: 200
  98. }
  99. ]);
  100. defineExpose({
  101. handleOpen
  102. });
  103. </script>