|
@@ -0,0 +1,262 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ele-page flex-table>
|
|
|
|
|
+ <book-search @search="reload"></book-search>
|
|
|
|
|
+
|
|
|
|
|
+ <common-table
|
|
|
|
|
+ ref="pageRef"
|
|
|
|
|
+ :pageConfig="pageConfig"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :tools="false"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #toolbar>
|
|
|
|
|
+ <el-radio-group @change="handleStatusChange" v-model="useStatus">
|
|
|
|
|
+ <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-group>
|
|
|
|
|
+
|
|
|
|
|
+ <span class="ml-8"></span>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ v-permission="'recycle:scanLog:batchAddBooklist'"
|
|
|
|
|
+ @click="handleOptBooklist()"
|
|
|
|
|
+ >
|
|
|
|
|
+ 加入回收书单
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ plain
|
|
|
|
|
+ v-permission="'recycle:scanLog:batchRemoveBlacklist'"
|
|
|
|
|
+ @click="handleOptBlacklist()"
|
|
|
|
|
+ >
|
|
|
|
|
+ 移除黑名单
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ plain
|
|
|
|
|
+ v-permission="'recycle:scanLog:batchAddBlacklist'"
|
|
|
|
|
+ @click="handleOptBlacklist()"
|
|
|
|
|
+ >
|
|
|
|
|
+ 加黑名单
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ plain
|
|
|
|
|
+ v-permission="'recycle:scanLog:batchPauseRecycle'"
|
|
|
|
|
+ @click="handleOptRecycle()"
|
|
|
|
|
+ >
|
|
|
|
|
+ 暂停回收
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #cover="{ row }">
|
|
|
|
|
+ <el-image
|
|
|
|
|
+ style="width: 90px; height: 120px; border-radius: 4px"
|
|
|
|
|
+ fit="cover"
|
|
|
|
|
+ :src="row.cover"
|
|
|
|
|
+ />
|
|
|
|
|
+ </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>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #stock="{ row }">
|
|
|
|
|
+ <book-stock :row="row"></book-stock>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #action="{ row }">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:viewLog'"
|
|
|
|
|
+ @click="handleViewLog(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [查看详情]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ color="#192bbe"
|
|
|
|
|
+ plain
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:setParams'"
|
|
|
|
|
+ @click="handleSetParams(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [设置独立参数]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:addBlacklist'"
|
|
|
|
|
+ @click="handleOptBlacklist(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [加入黑名单]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:removeBlacklist'"
|
|
|
|
|
+ @click="handleOptBlacklist(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [移除黑名单]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:pauseRecycle'"
|
|
|
|
|
+ @click="handleOptRecycle(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [暂停回收]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:startRecycle'"
|
|
|
|
|
+ @click="handleOptRecycle(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [开启回收]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:removeBooklist'"
|
|
|
|
|
+ @click="handleOptBooklist(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [移除回收书单]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ link
|
|
|
|
|
+ v-permission="'recycle:scanLog:addBooklist'"
|
|
|
|
|
+ @click="handleOptBooklist(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ [加入回收书单]
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </common-table>
|
|
|
|
|
+
|
|
|
|
|
+ <books-edit ref="editRef"></books-edit>
|
|
|
|
|
+ <set-params ref="paramsRef"></set-params>
|
|
|
|
|
+ <scan-log ref="logRef"></scan-log>
|
|
|
|
|
+ </ele-page>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup>
|
|
|
|
|
+ import { ref, reactive } from 'vue';
|
|
|
|
|
+ import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
|
|
+ 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';
|
|
|
|
|
+
|
|
|
|
|
+ defineOptions({ name: 'scanLoglist' });
|
|
|
|
|
+ const [useStatusDicts] = useDictData(['use_status']);
|
|
|
|
|
+
|
|
|
|
|
+ const useStatus = ref('1');
|
|
|
|
|
+ function handleStatusChange(value) {
|
|
|
|
|
+ pageRef.value.reload({ useStatus: value });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** 表格列配置 */
|
|
|
|
|
+ const columns = ref([
|
|
|
|
|
+ {
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ width: 50,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '图片',
|
|
|
|
|
+ prop: 'cover',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ slot: 'cover'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '信息',
|
|
|
|
|
+ prop: 'baseInfo',
|
|
|
|
|
+ width: 540,
|
|
|
|
|
+ slot: 'baseInfo'
|
|
|
|
|
+ },
|
|
|
|
|
+ { label: '回收折扣', prop: 'discount' },
|
|
|
|
|
+ { label: '预估金额', prop: 'amount' },
|
|
|
|
|
+ { label: '扫描次数', prop: 'scanNum' },
|
|
|
|
|
+ { label: '总回收数量', prop: 'totalRecycledAmount' },
|
|
|
|
|
+ { label: '最后一次扫描时间', prop: 'lastTime' },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ fixed: 'right'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ /** 页面组件实例 */
|
|
|
|
|
+ const pageRef = ref(null);
|
|
|
|
|
+
|
|
|
|
|
+ const pageConfig = reactive({
|
|
|
|
|
+ pageUrl: '/book/bookInfo/list',
|
|
|
|
|
+ fileName: '回收书单管理',
|
|
|
|
|
+ cacheKey: 'scanLoglistTable'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //刷新表格
|
|
|
|
|
+ function reload(where) {
|
|
|
|
|
+ pageRef.value?.reload(where);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //编辑
|
|
|
|
|
+ const editRef = ref(null);
|
|
|
|
|
+ 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 logRef = ref(null);
|
|
|
|
|
+ function handleViewLog(row) {
|
|
|
|
|
+ logRef.value?.handleOpen(row);
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|