|
|
@@ -9,16 +9,16 @@
|
|
|
:tools="false"
|
|
|
>
|
|
|
<template #toolbar>
|
|
|
- <el-radio-group @change="handleStatusChange" v-model="useStatus">
|
|
|
- <el-radio-button label="库存收满预警" value="0" />
|
|
|
- <el-radio-button label="库存已收满" value="1" />
|
|
|
+ <el-radio-group @change="handleStatusChange" v-model="history">
|
|
|
+ <el-radio-button label="库存收满预警" value="1" />
|
|
|
+ <el-radio-button label="库存已收满" value="0" />
|
|
|
</el-radio-group>
|
|
|
|
|
|
<span class="ml-8"></span>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchAddBooklist'"
|
|
|
+ v-permission="'recycle:inventoryAlert:batchAddBooklist'"
|
|
|
@click="handleOptBooklist()"
|
|
|
>
|
|
|
加入回收书单
|
|
|
@@ -26,16 +26,24 @@
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchRemoveBlacklist'"
|
|
|
- @click="handleOptBlacklist()"
|
|
|
+ v-permission="'recycle:inventoryAlert:batchRemoveBlacklist'"
|
|
|
+ @click="handleOptBlacklist('remove')"
|
|
|
>
|
|
|
移除黑名单
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ v-permission="'recycle:inventoryAlert:batchAddSocial'"
|
|
|
+ @click="handleOptType(1)"
|
|
|
+ >
|
|
|
+ 加社科库
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchAddBlacklist'"
|
|
|
- @click="handleOptBlacklist()"
|
|
|
+ v-permission="'recycle:inventoryAlert:batchAddBlacklist'"
|
|
|
+ @click="handleOptBlacklist('add')"
|
|
|
>
|
|
|
加黑名单
|
|
|
</el-button>
|
|
|
@@ -43,36 +51,19 @@
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchPauseRecycle'"
|
|
|
+ v-permission="'recycle:inventoryAlert:batchPauseRecycle'"
|
|
|
@click="handleOptRecycle()"
|
|
|
>
|
|
|
暂停回收
|
|
|
</el-button>
|
|
|
-
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchAddSocial'"
|
|
|
- @click="handleOptType(1)"
|
|
|
- >
|
|
|
- 加社科库
|
|
|
- </el-button>
|
|
|
<el-button
|
|
|
color="#192bbe"
|
|
|
plain
|
|
|
- v-permission="'recycle:stockFullAlert:batchAddTeach'"
|
|
|
+ v-permission="'recycle:inventoryAlert:batchAddTeach'"
|
|
|
@click="handleOptType(2)"
|
|
|
>
|
|
|
加教材库
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- v-permission="'recycle:stockFullAlert:exprot'"
|
|
|
- @click="handleExportExcel()"
|
|
|
- >
|
|
|
- 导出Excel
|
|
|
- </el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #cover="{ row }">
|
|
|
@@ -85,10 +76,7 @@
|
|
|
<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>
|
|
|
+ <book-info :row="row" :showFormat="false"></book-info>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -97,57 +85,65 @@
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
link
|
|
|
- v-permission="'recycle:stockFullAlert:delete'"
|
|
|
- @click="handleDelete(row)"
|
|
|
+ v-permission="'recycle:inventoryAlert:setParams'"
|
|
|
+ @click="handleSetParams(row)"
|
|
|
+ v-if="row.recycleStatus == 1"
|
|
|
>
|
|
|
- [删除]
|
|
|
+ [设置独立参数]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
link
|
|
|
- v-permission="'recycle:stockFullAlert:deal'"
|
|
|
- @click="handleDelete(row)"
|
|
|
+ v-else
|
|
|
+ v-permission="'recycle:inventoryAlert:addDiscount'"
|
|
|
+ @click="handleAddDiscount(row)"
|
|
|
>
|
|
|
- [去处理]
|
|
|
+ [指定折扣加回收书单]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
link
|
|
|
- v-permission="'recycle:stockFullAlert:dealLog'"
|
|
|
- @click="handleDelete(row)"
|
|
|
+ v-permission="'recycle:inventoryAlert:recycleLog'"
|
|
|
+ @click="handleRecycleLog(row)"
|
|
|
>
|
|
|
- [处理日志]
|
|
|
+ [回收日志]
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
link
|
|
|
- v-permission="'recycle:stockFullAlert:remind'"
|
|
|
- @click="handleModifyType(row)"
|
|
|
+ v-permission="'recycle:inventoryAlert:remind'"
|
|
|
+ @click="handleRemind(row)"
|
|
|
>
|
|
|
[一个月后提醒]
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</common-table>
|
|
|
+
|
|
|
+ <orderRecycleLog ref="recycleLogRef" />
|
|
|
+ <setParams ref="setParamsRef" @refresh="reload" />
|
|
|
+ <addDiscount ref="addDiscountRef" @refresh="reload" />
|
|
|
+ <orderBlacklist ref="blacklistRef" @refresh="reload" />
|
|
|
</ele-page>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, reactive } from 'vue';
|
|
|
+ import { ref, reactive, getCurrentInstance } from 'vue';
|
|
|
import CommonTable from '@/components/CommonPage/CommonTable.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 { useDictData } from '@/utils/use-dict-data';
|
|
|
+ import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
|
|
|
+ import setParams from '@/views/recycle/components/set-params.vue';
|
|
|
+ import addDiscount from '@/views/recycle/components/add-discount.vue';
|
|
|
+ import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
|
|
|
+
|
|
|
+ const { proxy } = getCurrentInstance();
|
|
|
|
|
|
defineOptions({ name: 'stockFullAlert' });
|
|
|
- const [useStatusDicts, bookTagDicts] = useDictData([
|
|
|
- 'use_status',
|
|
|
- 'book_tag_ku'
|
|
|
- ]);
|
|
|
|
|
|
- const useStatus = ref('0');
|
|
|
+ const history = ref('1');
|
|
|
function handleStatusChange(value) {
|
|
|
- pageRef.value.reload({ useStatus: value });
|
|
|
+ pageRef.value.reload({ history: value });
|
|
|
}
|
|
|
|
|
|
/** 表格列配置 */
|
|
|
@@ -171,16 +167,16 @@
|
|
|
width: 540,
|
|
|
slot: 'baseInfo'
|
|
|
},
|
|
|
- { label: '回收折扣', prop: 'discount' },
|
|
|
- { label: '预估金额', prop: 'price' },
|
|
|
- { label: '最大回收量', prop: 'maxRecycledAmount' },
|
|
|
- { label: '当前剩余回收量', prop: 'remainingRecycledAmount' },
|
|
|
- { label: '预警次数', prop: 'alertNum' },
|
|
|
- { label: '销量', prop: 'salesVolume' },
|
|
|
+ { label: '回收折扣', prop: 'recycleDiscount' },
|
|
|
+ { label: '预估金额', prop: 'recyclePrice' },
|
|
|
+ { label: '最大回收量', prop: 'recycleMax' },
|
|
|
+ { label: '当前剩余回收量', prop: 'restRecycleNum' },
|
|
|
+ { label: '预警次数', prop: 'alarmNum' },
|
|
|
+ { label: '销量', prop: 'salesNum', formatter: (row) => row.salesNum || 0 },
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
- width: 120,
|
|
|
+ width: 160,
|
|
|
slot: 'action',
|
|
|
fixed: 'right'
|
|
|
}
|
|
|
@@ -190,10 +186,14 @@
|
|
|
const pageRef = ref(null);
|
|
|
|
|
|
const pageConfig = reactive({
|
|
|
- pageUrl: '/book/bookInfo/list',
|
|
|
- exportUrl: '/book/bookInfo/export',
|
|
|
- fileName: '库存收满预警',
|
|
|
- cacheKey: 'stockFullAlertTable'
|
|
|
+ pageUrl: '/book/stockAlarm/pagelist',
|
|
|
+ fileName: '图书收满预警',
|
|
|
+ cacheKey: 'stockFullAlertTable',
|
|
|
+ params: {
|
|
|
+ alarmType: '1',
|
|
|
+ delStatus: '1',
|
|
|
+ history: '1'
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
//刷新表格
|
|
|
@@ -201,51 +201,118 @@
|
|
|
pageRef.value?.reload(where);
|
|
|
}
|
|
|
|
|
|
- //导出excel
|
|
|
- function handleExportExcel() {
|
|
|
- pageRef.value?.exportData('库存收满预警');
|
|
|
+ //回收日志
|
|
|
+ const recycleLogRef = ref(null);
|
|
|
+ function handleRecycleLog(row) {
|
|
|
+ recycleLogRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+ //设置独立参数
|
|
|
+ const setParamsRef = ref(null);
|
|
|
+ function handleSetParams(row) {
|
|
|
+ setParamsRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+ //指定折扣加回收书单
|
|
|
+ const addDiscountRef = ref(null);
|
|
|
+ function handleAddDiscount(row) {
|
|
|
+ addDiscountRef.value?.handleOpen({ isbnList: [row.isbn] });
|
|
|
}
|
|
|
|
|
|
//回收书单操作
|
|
|
- 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 handleOptBooklist() {
|
|
|
+ let selections = pageRef.value?.getSelections();
|
|
|
+ if (!selections || selections.length === 0) {
|
|
|
+ ElMessage.warning('请选择要操作的图书');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const isbnList = selections.map((item) => item.isbn);
|
|
|
+
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title: '确认加入回收书单?',
|
|
|
+ method: 'post',
|
|
|
+ url: '/book/bookRecycleInfo/addIn',
|
|
|
+ data: { isbnList },
|
|
|
+ success: () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
//黑名单操作
|
|
|
- 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 });
|
|
|
+ const blacklistRef = ref(null);
|
|
|
+ function handleOptBlacklist(type) {
|
|
|
+ let selections = pageRef.value?.getSelections();
|
|
|
+ if (!selections || selections.length === 0) {
|
|
|
+ ElMessage.warning('请选择要操作的图书');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const isbnList = selections.map((item) => item.isbn);
|
|
|
+
|
|
|
+ if (type == 'remove') {
|
|
|
+ // 移除黑名单
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title: '确认移除黑名单?',
|
|
|
+ method: 'post',
|
|
|
+ url: '/book/bookRecycleInfo/removeBlackList',
|
|
|
+ data: { isbnList },
|
|
|
+ success: () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 加入黑名单,打开选择原因弹窗
|
|
|
+ blacklistRef.value?.handleOpen(isbnList);
|
|
|
+ }
|
|
|
}
|
|
|
//回收操作
|
|
|
- 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 });
|
|
|
+ function handleOptRecycle() {
|
|
|
+ let selections = pageRef.value?.getSelections();
|
|
|
+ if (!selections || selections.length === 0) {
|
|
|
+ ElMessage.warning('请选择要操作的图书');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const isbnList = selections.map((item) => item.isbn);
|
|
|
+
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title: '确认暂停回收?',
|
|
|
+ method: 'post',
|
|
|
+ url: '/book/bookRecycleInfo/stopRecycle',
|
|
|
+ data: { isbnList },
|
|
|
+ success: () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
//类型操作
|
|
|
function handleOptType(type) {
|
|
|
let selections = pageRef.value?.getSelections();
|
|
|
- let ids = selections.map((item) => item.id).join(',');
|
|
|
- let url = `/book/bookInfo/changeType/${ids}`;
|
|
|
- let title = type == 1 ? '确认加社科库?' : '确认加教材库?';
|
|
|
- pageRef.value?.operatBatch({ title, method: 'post', url, row });
|
|
|
+ if (!selections || selections.length === 0) {
|
|
|
+ ElMessage.warning('请选择要操作的图书');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const isbnList = selections.map((item) => item.isbn);
|
|
|
+ const url =
|
|
|
+ type == 1
|
|
|
+ ? '/book/bookRecycleInfo/changeBookTag2'
|
|
|
+ : '/book/bookRecycleInfo/changeBookTag1';
|
|
|
+ const title = type == 1 ? '确认加社科库?' : '确认加教材库?';
|
|
|
+
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title,
|
|
|
+ method: 'post',
|
|
|
+ url,
|
|
|
+ data: { isbnList },
|
|
|
+ success: () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- //删除
|
|
|
- function handleDelete(row) {
|
|
|
+ //一个月后提醒
|
|
|
+ function handleRemind(row) {
|
|
|
pageRef.value?.messageBoxConfirm({
|
|
|
- message: '确定删除吗?',
|
|
|
- fetch: () => request.get('/common/exportrecord/deleteRecord?id=' + row.id)
|
|
|
+ message: '确定一个月后提醒吗?',
|
|
|
+ fetch: () =>
|
|
|
+ proxy.$http.post('/book/stockAlarm/setAlarmTime', { id: row.id })
|
|
|
});
|
|
|
}
|
|
|
- //修改类型
|
|
|
- function handleModifyType(row) {}
|
|
|
</script>
|