|
|
@@ -1,101 +1,102 @@
|
|
|
<template>
|
|
|
- <ele-page flex-table>
|
|
|
- <page-search @search="reload"></page-search>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <page-search @search="reload"></page-search>
|
|
|
|
|
|
- <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
- <template #toolbar>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- :icon="PlusOutlined"
|
|
|
- v-permission="'recycle:remindArea:add'"
|
|
|
- @click="handleUpdate()"
|
|
|
- >
|
|
|
- 新增
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- :icon="DeleteOutlined"
|
|
|
- v-permission="'recycle:remindArea:batchDelete'"
|
|
|
- @click="handleBatchDelete()"
|
|
|
- >
|
|
|
- 批量删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
+ <template #toolbar>
|
|
|
+ <el-button type="primary" plain :icon="PlusOutlined" v-permission="'recycle:remindArea:add'"
|
|
|
+ @click="handleAdd()">
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" plain :icon="DeleteOutlined" v-permission="'recycle:remindArea:batchDelete'"
|
|
|
+ @click="handleBatchDelete()">
|
|
|
+ 批量删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #action="{ row }">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-permission="'recycle:remindArea:delete'"
|
|
|
- @click="handleBatchDelete(row)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </common-table>
|
|
|
+ <template #cover="{ row }">
|
|
|
+ <el-image :src="row.bookInfo?.cover" style="width: 70px; height: 90px" fit="cover" />
|
|
|
+ </template>
|
|
|
|
|
|
- <page-edit ref="editRef" @success="reload()"></page-edit>
|
|
|
- </ele-page>
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-button type="danger" link v-permission="'recycle:remindArea:delete'"
|
|
|
+ @click="handleDelete(row)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </common-table>
|
|
|
+
|
|
|
+ <page-edit ref="editRef" @success="reload()"></page-edit>
|
|
|
+ </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 } from '@/components/icons';
|
|
|
- import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
- import pageSearch from './components/page-search.vue';
|
|
|
- import pageEdit from './components/page-edit.vue';
|
|
|
- import { useDictData } from '@/utils/use-dict-data';
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
- import request from '@/utils/request';
|
|
|
+import { ref, reactive,getCurrentInstance } from 'vue';
|
|
|
+import { PlusOutlined, DeleteOutlined } from '@/components/icons';
|
|
|
+import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
+import pageSearch from './components/page-search.vue';
|
|
|
+import pageEdit from './components/page-edit.vue';
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
|
|
|
- defineOptions({ name: 'remindBooks' });
|
|
|
- const [schoolLevelDicts] = useDictData(['school_level']);
|
|
|
+defineOptions({ name: 'remindBooks' });
|
|
|
|
|
|
- /** 表格列配置 */
|
|
|
- const columns = ref([
|
|
|
+/** 表格列配置 */
|
|
|
+const columns = ref([
|
|
|
{ type: 'selection', columnKey: 'selection', width: 50, fixed: 'left' },
|
|
|
- { label: '图片', prop: 'picture', width: 140 },
|
|
|
- { label: 'isbn', prop: 'schoolName' },
|
|
|
- { label: '书名', prop: 'provinceName' },
|
|
|
- { label: '作者', prop: 'provinceName' },
|
|
|
- { label: '出版社', prop: 'provinceName' },
|
|
|
- { label: '出版时间', prop: 'provinceName' },
|
|
|
- { label: '定价', prop: 'provinceName' },
|
|
|
- { label: '需提醒仓库', prop: 'cityName' },
|
|
|
- { label: '添加时间', prop: 'createTime' },
|
|
|
- { columnKey: 'action', label: '操作', width: 120, slot: 'action' }
|
|
|
- ]);
|
|
|
+ { label: '图片', prop: 'cover', width: 100, slot: 'cover' },
|
|
|
+ { label: 'isbn', prop: 'isbn' },
|
|
|
+ { label: '书名', prop: 'bookInfo.bookName' },
|
|
|
+ { label: '作者', prop: 'bookInfo.author' },
|
|
|
+ { label: '出版社', prop: 'bookInfo.publish' },
|
|
|
+ { label: '出版时间', prop: 'bookInfo.pubDate' },
|
|
|
+ { label: '定价', prop: 'bookInfo.price', width: 100 },
|
|
|
+ { label: '需提醒仓库', prop: 'godownName', width: 120 },
|
|
|
+ { label: '添加时间', prop: 'createTime', width: 160 },
|
|
|
+ { columnKey: 'action', label: '操作', width: 80, slot: 'action', fixed: 'right' }
|
|
|
+]);
|
|
|
|
|
|
- let router = useRouter();
|
|
|
- /** 页面组件实例 */
|
|
|
- const pageRef = ref(null);
|
|
|
+/** 页面组件实例 */
|
|
|
+const pageRef = ref(null);
|
|
|
|
|
|
- const pageConfig = reactive({
|
|
|
- pageUrl: '/baseinfo/schoolInfo/list',
|
|
|
- exportUrl: '/baseinfo/schoolInfo/export',
|
|
|
+const pageConfig = reactive({
|
|
|
+ pageUrl: '/book/checkWarn/getBookPageList',
|
|
|
+ exportUrl: '',
|
|
|
fileName: '审核提醒书籍',
|
|
|
cacheKey: 'remindBooksTable'
|
|
|
- });
|
|
|
+});
|
|
|
|
|
|
- //刷新表格
|
|
|
- function reload(where) {
|
|
|
+//刷新表格
|
|
|
+function reload(where) {
|
|
|
+ delete where.time;
|
|
|
pageRef.value?.reload(where);
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
- //批量删除
|
|
|
- function handleBatchDelete(row) {
|
|
|
+//批量删除
|
|
|
+function handleBatchDelete(row) {
|
|
|
let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
- let ids = selections.map((item) => item.id).join(',');
|
|
|
- let url = `/baseinfo/schoolInfo/removeById/${ids}`;
|
|
|
+ let ids = selections.map((item) => item.id);
|
|
|
+ let url = `/book/checkWarn/deleteBookCheck`;
|
|
|
pageRef.value?.operatBatch({
|
|
|
- title: '确认删除?',
|
|
|
- method: 'post',
|
|
|
- url,
|
|
|
- row
|
|
|
+ title: '确认删除?',
|
|
|
+ method: 'post',
|
|
|
+ url,
|
|
|
+ row,
|
|
|
+ data: {
|
|
|
+ idList: ids
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//删除
|
|
|
+function handleDelete(row) {
|
|
|
+ pageRef.value?.messageBoxConfirm({
|
|
|
+ message: '确认删除?',
|
|
|
+ fetch: () => proxy.$http.post(`/book/checkWarn/deleteBookCheck`, { idList: [row.id] })
|
|
|
});
|
|
|
- }
|
|
|
+}
|
|
|
+//新增
|
|
|
+const editRef = ref(null);
|
|
|
+function handleAdd() {
|
|
|
+ editRef.value?.handleOpen();
|
|
|
+}
|
|
|
</script>
|
|
|
+
|