|
|
@@ -0,0 +1,223 @@
|
|
|
+<template>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <books-search @search="reload"></books-search>
|
|
|
+
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
+ <template #toolbar>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ :icon="PlusOutlined"
|
|
|
+ v-permission="'data:books:add'"
|
|
|
+ @click="handleBatchDelete"
|
|
|
+ >
|
|
|
+ 新增图书
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ :icon="DeleteOutlined"
|
|
|
+ v-permission="'data:books:batchDelete'"
|
|
|
+ @click="handleBatchDelete"
|
|
|
+ >
|
|
|
+ 批量删除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ v-permission="'data:books:import'"
|
|
|
+ @click="handleBatchDelete"
|
|
|
+ >
|
|
|
+ 导入EXCEL
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ v-permission="'data:books:export'"
|
|
|
+ @click="handleBatchDelete"
|
|
|
+ :icon="DownloadOutlined"
|
|
|
+ >
|
|
|
+ 导出图书明细
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template #picture="{ row }">
|
|
|
+ <el-image
|
|
|
+ style="width: 80px; height: 100px"
|
|
|
+ fit="cover"
|
|
|
+ src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #baseInfo="{ row }">
|
|
|
+ <div class="base-info flex flex-col items-start">
|
|
|
+ <div class="common-text">
|
|
|
+ <el-text>书 名:</el-text>
|
|
|
+ <el-text type="success">行政法与行政诉讼法(第六版)</el-text>
|
|
|
+ </div>
|
|
|
+ <div class="common-text">
|
|
|
+ <el-text>条 码:</el-text>
|
|
|
+ <el-text>9787301257975</el-text>
|
|
|
+ </div>
|
|
|
+ <div class="common-text">
|
|
|
+ <el-text>作 者:</el-text>
|
|
|
+ <el-text>姜明安</el-text>
|
|
|
+ </div>
|
|
|
+ <div class="common-text">
|
|
|
+ <el-text>出版社:</el-text>
|
|
|
+ <el-text>北京大学出版社</el-text>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #action="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ v-permission="'data:books:changeLogs'"
|
|
|
+ @click="handleApplyForOrderRestore(row)"
|
|
|
+ >
|
|
|
+ 变动记录
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ v-permission="'data:books:update'"
|
|
|
+ @click="toOrderDetail(row)"
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </common-table>
|
|
|
+ </ele-page>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import { ref, reactive } from 'vue';
|
|
|
+ import { ElMessageBox } from 'element-plus/es';
|
|
|
+ import { EleMessage } from 'ele-admin-plus/es';
|
|
|
+ import {
|
|
|
+ PlusOutlined,
|
|
|
+ DeleteOutlined,
|
|
|
+ DownloadOutlined
|
|
|
+ } from '@/components/icons';
|
|
|
+ import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
+ import booksEdit from '@/views/data/books/components/books-edit.vue';
|
|
|
+ import booksSearch from '@/views/data/books/components/books-search.vue';
|
|
|
+ import { useDictData } from '@/utils/use-dict-data';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+
|
|
|
+ defineOptions({ name: 'recycleOrderCancelled' });
|
|
|
+
|
|
|
+ /** 表格列配置 */
|
|
|
+ const columns = ref([
|
|
|
+ {
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '图片',
|
|
|
+ prop: 'picture',
|
|
|
+ slot: 'picture',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '基础信息',
|
|
|
+ prop: 'baseInfo',
|
|
|
+ slot: 'baseInfo',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 300
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '定价',
|
|
|
+ prop: 'price',
|
|
|
+ formatter: (row) => '¥30',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ { label: '出版时间', prop: 'createTime', align: 'center', minWidth: 120 },
|
|
|
+ {
|
|
|
+ label: '分类标签',
|
|
|
+ prop: 'tag',
|
|
|
+ formatter: (row) => '教材',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '人工核实',
|
|
|
+ prop: 'peo',
|
|
|
+ formatter: (row) => '是',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 180,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'action'
|
|
|
+ }
|
|
|
+ ]);
|
|
|
+
|
|
|
+ let router = useRouter();
|
|
|
+ /** 页面组件实例 */
|
|
|
+ const pageRef = ref(null);
|
|
|
+
|
|
|
+ const pageConfig = reactive({
|
|
|
+ pageUrl: '',
|
|
|
+ exportUrl: '',
|
|
|
+ fileName: '图书基础数据',
|
|
|
+ cacheKey: 'books-base-data'
|
|
|
+ });
|
|
|
+
|
|
|
+ //刷新表格
|
|
|
+ function reload() {
|
|
|
+ pageRef.value?.reload();
|
|
|
+ }
|
|
|
+
|
|
|
+ //批量删除
|
|
|
+ function handleBatchDelete() {
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title: '确认删除?',
|
|
|
+ url: '/recycleOrder/batchAudit'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //订单详情
|
|
|
+ function toOrderDetail(row) {
|
|
|
+ router.push({ path: '/recycleOrder/detail', query: { id: row.postId } });
|
|
|
+ }
|
|
|
+
|
|
|
+ //订单日志
|
|
|
+ const orderLogRef = ref(null);
|
|
|
+ function openOrderLog(row) {
|
|
|
+ orderLogRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //用户绑定标签
|
|
|
+ const userTagRef = ref(null);
|
|
|
+ function openEditUserTag(row) {
|
|
|
+ userTagRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+
|
|
|
+ function messageBoxConfirm({ message, url, row }) {
|
|
|
+ ElMessageBox.confirm(message, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '关闭',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ console.log(row, 'row');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //申请恢复订单
|
|
|
+ function handleApplyForOrderRestore(row) {
|
|
|
+ messageBoxConfirm({
|
|
|
+ message: '确认申请恢复订单?',
|
|
|
+ url: `/recycleOrder/applyForOrderRestore/${row.postId}`,
|
|
|
+ row
|
|
|
+ });
|
|
|
+ }
|
|
|
+</script>
|