| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!-- 编辑弹窗 -->
- <template>
- <ele-modal form :width="1080" v-model="visible" title="回收修改日志">
- <SimpleTable
- style="width: 100%"
- :columns="columns"
- border
- :fetchPage="fetchPage"
- ref="tableRef"
- pagination
- >
- <template #discount="{ row }">
- <div class="flex flex-col align-center">
- <el-text>折扣:{{ row.discount }}折</el-text>
- <el-text>价格:¥ {{ row.price }}</el-text>
- </div>
- </template>
- <template #recycleTime="{ row }">
- <div class="flex flex-col align-center">
- <el-text>开始回收时间:{{ row.createTime }}</el-text>
- <el-text>结束回收时间:{{ row.createTime }}</el-text>
- </div>
- </template>
- <template #modifyInfo="{ row }">
- <div class="flex flex-col align-center">
- <el-text>修改人:{{ row.createName }}</el-text>
- <el-text>修改时间:{{ row.createTime }}</el-text>
- </div>
- </template>
- </SimpleTable>
- <template #footer>
- <el-button @click="handleCancel">关闭</el-button>
- </template>
- </ele-modal>
- </template>
- <script setup>
- import { ref, reactive, nextTick } from 'vue';
- import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
- import SimpleTable from '@/components/CommonPage/SimpleTable.vue';
- import request from '@/utils/request';
- function fetchPage(params) {
- return request.get(
- '/book/bookRecycleInfo/discount/changeList/' + isbn.value,
- {
- params
- }
- );
- }
- /** 弹窗是否打开 */
- const visible = defineModel({ type: Boolean });
- /** 关闭弹窗 */
- const handleCancel = () => {
- visible.value = false;
- };
- /** 弹窗打开事件 */
- let isbn = ref();
- const tableRef = ref();
- const handleOpen = (row) => {
- visible.value = true;
- isbn.value = row.isbn;
- nextTick(() => {
- tableRef.value?.reload();
- });
- };
- // 1-开启回收 2-关闭回收 3-加入黑名单 4-人工暂停回收 5-移除黑名单
- let typeList = {
- 1: '开启回收',
- 2: '关闭回收',
- 3: '加入黑名单',
- 4: '人工暂停回收',
- 5: '移除黑名单'
- };
- // 表格数据
- const columns = reactive([
- {
- label: '修改后状态',
- prop: 'createBy',
- minWidth: 120,
- formatter: (row) => typeList[row.type]
- },
- {
- label: '修改后折扣',
- prop: 'discount',
- slot: 'discount',
- minWidth: 120
- },
- {
- label: '回收时间',
- prop: 'recycleTime',
- slot: 'recycleTime',
- minWidth: 200
- },
- {
- label: '修改信息',
- prop: 'modifyInfo',
- slot: 'modifyInfo',
- minWidth: 200
- }
- ]);
- defineExpose({
- handleOpen
- });
- </script>
|