|
|
@@ -7,22 +7,33 @@
|
|
|
:pageConfig="pageConfig"
|
|
|
:columns="columns"
|
|
|
:tools="false"
|
|
|
+ @sort-change="handleSortChange"
|
|
|
>
|
|
|
<template #toolbar>
|
|
|
- <el-radio-group @change="handleStatusChange" v-model="useStatus">
|
|
|
+ <el-radio-group @change="handleStatusChange" v-model="searchType">
|
|
|
<el-radio-button label="已加入回收书单(正在回收)" value="1" />
|
|
|
<el-radio-button label="已加入回收书单(暂停回收)" value="2" />
|
|
|
<el-radio-button label="未加入回收书单" value="3" />
|
|
|
<el-radio-button label="黑名单" value="4" />
|
|
|
- <el-radio-button label="无数据信息" value="4" />
|
|
|
+ <el-radio-button label="无数据信息" value="5" />
|
|
|
</el-radio-group>
|
|
|
|
|
|
<span class="ml-8"></span>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ v-permission="'recycle:scanLog:batchRemoveBooklist'"
|
|
|
+ @click="handleOptBooklist('remove')"
|
|
|
+ v-if="['1', '2'].includes(searchType)"
|
|
|
+ >
|
|
|
+ 移除回收书单
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
plain
|
|
|
v-permission="'recycle:scanLog:batchAddBooklist'"
|
|
|
- @click="handleOptBooklist()"
|
|
|
+ @click="handleOptBooklist('add')"
|
|
|
+ v-if="['3', '4'].includes(searchType)"
|
|
|
>
|
|
|
加入回收书单
|
|
|
</el-button>
|
|
|
@@ -30,7 +41,8 @@
|
|
|
type="warning"
|
|
|
plain
|
|
|
v-permission="'recycle:scanLog:batchRemoveBlacklist'"
|
|
|
- @click="handleOptBlacklist()"
|
|
|
+ @click="handleOptBlacklist('remove')"
|
|
|
+ v-if="searchType === '4'"
|
|
|
>
|
|
|
移除黑名单
|
|
|
</el-button>
|
|
|
@@ -38,7 +50,8 @@
|
|
|
type="danger"
|
|
|
plain
|
|
|
v-permission="'recycle:scanLog:batchAddBlacklist'"
|
|
|
- @click="handleOptBlacklist()"
|
|
|
+ @click="handleOptBlacklist('add')"
|
|
|
+ v-if="searchType !== '4'"
|
|
|
>
|
|
|
加黑名单
|
|
|
</el-button>
|
|
|
@@ -47,10 +60,37 @@
|
|
|
type="warning"
|
|
|
plain
|
|
|
v-permission="'recycle:scanLog:batchPauseRecycle'"
|
|
|
- @click="handleOptRecycle()"
|
|
|
+ @click="handleOptRecycle('pause')"
|
|
|
+ v-if="searchType === '1'"
|
|
|
>
|
|
|
暂停回收
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ v-permission="'recycle:scanLog:batchStartRecycle'"
|
|
|
+ @click="handleOptRecycle('start')"
|
|
|
+ v-if="searchType === '2'"
|
|
|
+ >
|
|
|
+ 开启回收
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ v-permission="'recycle:booklist:batchAddSocial'"
|
|
|
+ @click="handleOptType(1)"
|
|
|
+ >
|
|
|
+ 加社科库
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ v-permission="'recycle:booklist:batchAddTeach'"
|
|
|
+ @click="handleOptType(2)"
|
|
|
+ >
|
|
|
+ 加教材库
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #cover="{ row }">
|
|
|
@@ -61,14 +101,7 @@
|
|
|
/>
|
|
|
</template>
|
|
|
<template #baseInfo="{ row }">
|
|
|
- <div class="flex justify-start items-center">
|
|
|
- <div style="flex: 2">
|
|
|
- <book-info :row="row"></book-info>
|
|
|
- </div>
|
|
|
- <div style="flex: 1.5; margin-left: 15px">
|
|
|
- <book-other-info :row="row"></book-other-info>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <book-info :row="row"></book-info>
|
|
|
</template>
|
|
|
<template #stock="{ row }">
|
|
|
<book-stock :row="row"></book-stock>
|
|
|
@@ -93,26 +126,29 @@
|
|
|
[设置独立参数]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- type="warning"
|
|
|
+ type="success"
|
|
|
link
|
|
|
- v-permission="'recycle:scanLog:addBlacklist'"
|
|
|
- @click="handleOptBlacklist(row)"
|
|
|
+ v-permission="'recycle:scanLog:removeBlacklist'"
|
|
|
+ @click="handleOptBlacklist('remove', row)"
|
|
|
+ v-if="row.bookStatus == 3"
|
|
|
>
|
|
|
- [加入黑名单]
|
|
|
+ [移除黑名单]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- type="success"
|
|
|
+ type="warning"
|
|
|
link
|
|
|
- v-permission="'recycle:scanLog:removeBlacklist'"
|
|
|
- @click="handleOptBlacklist(row)"
|
|
|
+ v-permission="'recycle:scanLog:addBlacklist'"
|
|
|
+ @click="handleOptBlacklist('add', row)"
|
|
|
+ v-if="row.bookStatus == 1 || row.bookStatus == 2"
|
|
|
>
|
|
|
- [移除黑名单]
|
|
|
+ [加入黑名单]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
link
|
|
|
v-permission="'recycle:scanLog:pauseRecycle'"
|
|
|
- @click="handleOptRecycle(row)"
|
|
|
+ @click="handleOptRecycle('pause', row)"
|
|
|
+ v-if="row.recycleStatus == 1"
|
|
|
>
|
|
|
[暂停回收]
|
|
|
</el-button>
|
|
|
@@ -120,7 +156,8 @@
|
|
|
type="success"
|
|
|
link
|
|
|
v-permission="'recycle:scanLog:startRecycle'"
|
|
|
- @click="handleOptRecycle(row)"
|
|
|
+ @click="handleOptRecycle('start', row)"
|
|
|
+ v-else
|
|
|
>
|
|
|
[开启回收]
|
|
|
</el-button>
|
|
|
@@ -128,7 +165,8 @@
|
|
|
type="success"
|
|
|
link
|
|
|
v-permission="'recycle:scanLog:removeBooklist'"
|
|
|
- @click="handleOptBooklist(row)"
|
|
|
+ @click="handleOptBooklist('remove', row)"
|
|
|
+ v-if="row.bookStatus == 2"
|
|
|
>
|
|
|
[移除回收书单]
|
|
|
</el-button>
|
|
|
@@ -136,7 +174,8 @@
|
|
|
type="danger"
|
|
|
link
|
|
|
v-permission="'recycle:scanLog:addBooklist'"
|
|
|
- @click="handleOptBooklist(row)"
|
|
|
+ @click="handleOptBooklist('add', row)"
|
|
|
+ v-if="row.bookStatus == 1"
|
|
|
>
|
|
|
[加入回收书单]
|
|
|
</el-button>
|
|
|
@@ -146,6 +185,8 @@
|
|
|
<books-edit ref="editRef"></books-edit>
|
|
|
<set-params ref="paramsRef"></set-params>
|
|
|
<scan-log ref="logRef"></scan-log>
|
|
|
+ <add-discount ref="discountRef" @refresh="reload"></add-discount>
|
|
|
+ <order-blacklist ref="blacklistRef" @refresh="reload"></order-blacklist>
|
|
|
</ele-page>
|
|
|
</template>
|
|
|
|
|
|
@@ -155,18 +196,27 @@
|
|
|
import booksEdit from '@/views/data/books/components/books-edit.vue';
|
|
|
import bookSearch from '@/views/recycle/components/book-search.vue';
|
|
|
import bookInfo from '@/views/recycle/components/book-info.vue';
|
|
|
- import bookOtherInfo from '@/views/recycle/components/book-other-info.vue';
|
|
|
import bookStock from '@/views/recycle/components/book-stock.vue';
|
|
|
import setParams from '@/views/recycle/components/set-params.vue';
|
|
|
- import scanLog from './components/scan-log.vue'
|
|
|
- import { useDictData } from '@/utils/use-dict-data';
|
|
|
+ import scanLog from './components/scan-log.vue';
|
|
|
+ import addDiscount from '@/views/recycle/components/add-discount.vue';
|
|
|
+ import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
|
|
|
+ import { useBookOperation } from '@/utils/use-book-operation';
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
|
|
|
defineOptions({ name: 'scanLoglist' });
|
|
|
- const [useStatusDicts] = useDictData(['use_status']);
|
|
|
|
|
|
- const useStatus = ref('1');
|
|
|
+ const searchType = ref('1');
|
|
|
function handleStatusChange(value) {
|
|
|
- pageRef.value.reload({ useStatus: value });
|
|
|
+ pageRef.value.reload({ searchType: value });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleSortChange({ column, order }) {
|
|
|
+ // 1 扫描次数 2总回收量 3最后一次扫描时间
|
|
|
+ reload({
|
|
|
+ orderType: column.columnKey,
|
|
|
+ orderWay: order === 'ascending' ? 'asc' : 'desc'
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/** 表格列配置 */
|
|
|
@@ -190,11 +240,31 @@
|
|
|
width: 540,
|
|
|
slot: 'baseInfo'
|
|
|
},
|
|
|
- { label: '回收折扣', prop: 'discount' },
|
|
|
- { label: '预估金额', prop: 'amount' },
|
|
|
- { label: '扫描次数', prop: 'scanNum' },
|
|
|
- { label: '总回收数量', prop: 'totalRecycledAmount' },
|
|
|
- { label: '最后一次扫描时间', prop: 'lastTime' },
|
|
|
+ { label: '回收折扣', prop: 'recycleDiscount' },
|
|
|
+ { label: '预估金额', prop: 'recyclePrice' },
|
|
|
+ {
|
|
|
+ label: '扫描次数',
|
|
|
+ prop: 'scanNum',
|
|
|
+ sortable: true,
|
|
|
+ columnKey: '1',
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (row) => row?.scanNum || 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '总回收数量',
|
|
|
+ prop: 'recycleTotalNum',
|
|
|
+ sortable: true,
|
|
|
+ columnKey: '2',
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '最后一次扫描时间',
|
|
|
+ prop: 'lastScanTime',
|
|
|
+ sortable: true,
|
|
|
+ columnKey: '3',
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (row) => (row?.lastScanTime ? row?.lastScanTime : '-')
|
|
|
+ },
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
@@ -208,9 +278,13 @@
|
|
|
const pageRef = ref(null);
|
|
|
|
|
|
const pageConfig = reactive({
|
|
|
- pageUrl: '/book/bookInfo/list',
|
|
|
+ pageUrl: '/user/userScanLog/getBookScanLogList',
|
|
|
fileName: '回收书单管理',
|
|
|
- cacheKey: 'scanLoglistTable'
|
|
|
+ cacheKey: 'scanLoglistTable',
|
|
|
+ params: {
|
|
|
+ searchType: '1'
|
|
|
+ },
|
|
|
+ rowKey: 'isbn'
|
|
|
});
|
|
|
|
|
|
//刷新表格
|
|
|
@@ -223,36 +297,19 @@
|
|
|
function handleUpdateBook(row) {
|
|
|
editRef.value?.handleOpen(row);
|
|
|
}
|
|
|
- //设置参数
|
|
|
- const paramsRef = ref(null);
|
|
|
- function handleSetParams(row) {
|
|
|
- paramsRef.value?.handleOpen(row);
|
|
|
- }
|
|
|
|
|
|
- //回收书单操作
|
|
|
- function handleOptBooklist(row) {
|
|
|
- let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
- let ids = selections.map((item) => item.id).join(',');
|
|
|
- let url = `/book/bookInfo/removeById/${ids}`;
|
|
|
- let title = row ? '确认移除回收书单?' : '确认加入回收书单?';
|
|
|
- pageRef.value?.operatBatch({ title, method: 'post', url, row });
|
|
|
- }
|
|
|
- //黑名单操作
|
|
|
- function handleOptBlacklist(row) {
|
|
|
- let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
- let ids = selections.map((item) => item.id).join(',');
|
|
|
- let url = `/book/bookInfo/removeBlacklist/${ids}`;
|
|
|
- let title = row ? '确认移除黑名单?' : '确认加入黑名单?';
|
|
|
- pageRef.value?.operatBatch({ title, method: 'post', url, row });
|
|
|
- }
|
|
|
- //回收操作
|
|
|
- function handleOptRecycle(row) {
|
|
|
- let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
- let ids = selections.map((item) => item.id).join(',');
|
|
|
- let url = `/book/bookInfo/recycle/${ids}`;
|
|
|
- let title = '确认回收?';
|
|
|
- pageRef.value?.operatBatch({ title, method: 'post', url, row });
|
|
|
- }
|
|
|
+ // 使用图书操作混入
|
|
|
+ const {
|
|
|
+ blacklistRef,
|
|
|
+ discountRef,
|
|
|
+ paramsRef,
|
|
|
+ handleOptBooklist,
|
|
|
+ handleOptBlacklist,
|
|
|
+ handleAddDiscount,
|
|
|
+ handleSetParams,
|
|
|
+ handleOptType,
|
|
|
+ handleOptRecycle
|
|
|
+ } = useBookOperation(pageRef);
|
|
|
|
|
|
//查看详情
|
|
|
const logRef = ref(null);
|