Ver código fonte

fix 修改 bug

ylong 3 meses atrás
pai
commit
7cb8f9ef9b

+ 145 - 0
src/views/recycle/components/price-search.vue

@@ -0,0 +1,145 @@
+<!-- 搜索表单 -->
+<template>
+    <ele-card :body-style="{ paddingBottom: '8px' }">
+        <ProSearch :items="formItems" ref="searchRef" @search="search" :initKeys="initKeys" />
+    </ele-card>
+</template>
+
+<script setup>
+import { reactive, ref, defineEmits } from 'vue';
+import ProSearch from '@/components/CommonPage/ProSearch2.vue';
+
+const props = defineProps({
+    isBookTag: {
+        type: Boolean,
+        default: false
+    }
+});
+
+let { proxy } = getCurrentInstance();
+const emit = defineEmits(['search']);
+
+const formItems = reactive([
+    { type: 'input', label: '书名', prop: 'bookName' },
+    { type: 'input', label: 'ISBN', prop: 'isbn' },
+    { type: 'input', label: '作者', prop: 'author' },
+    { type: 'input', label: '出版社', prop: 'publish' },
+    {
+        type: 'daterange',
+        label: '出版时间',
+        prop: 'pubDate',
+        keys: ['pubDateStart', 'pubDateEnd'],
+        props: {
+            format: 'YYYY-MM-DD',
+            valueFormat: 'YYYY-MM-DD',
+            onChange: (val) => {
+                searchRef.value?.setData({
+                    pubDateStart: val && val.length > 0 ? val[0] : '',
+                    pubDateEnd: val && val.length > 0 ? val[1] : ''
+                });
+            }
+        }
+    },
+    {
+        type: 'inputNumberRange',
+        label: '定价',
+        prop: 'price',
+        keys: ['minPrice', 'maxPrice'],
+        props: {
+            label: '定价',
+            onChange: (val) => {
+                searchRef.value?.setData({
+                    minPrice: val.min,
+                    maxPrice: val.max
+                });
+            }
+        }
+    },
+    {
+        type: 'inputNumberRange',
+        label: '回收折扣',
+        prop: 'discount',
+        keys: ['minDiscount', 'maxDiscount'],
+        props: {
+            minAttrs: { min: 0 },
+            maxAttrs: { max: 10 },
+            label: '回收折扣',
+            onChange: (val) => {
+                searchRef.value?.setData({
+                    minDiscount: val.min,
+                    maxDiscount: val.max
+                });
+            }
+        }
+    },
+    {
+        type: 'dictSelect',
+        label: '图书类型',
+        prop: 'bookTag',
+        props: {
+            code: 'book_tag'
+        },
+        vIf: () => {
+            return props.isBookTag;
+        }
+        // 1教材 2社科 3中小学 4其他 5全部
+    },
+    {
+        type: 'select',
+        label: '默认参数',
+        prop: 'defaultType',
+        props: {
+            multiple: true,
+            clearable: true,
+            collapseTags: true
+        },
+        options: [
+            { label: '最大回收数量', value: 1 },
+            { label: '单个订单回收数量', value: 2 },
+            { label: '回收折扣', value: 3 }
+        ]
+    },
+    {
+        type: 'select',
+        label: '回收类型',
+        prop: 'searchType',
+        options: [
+            { label: '全部', value: 0 },
+            { label: ' 已加入回收书单(正在回收)', value: 1 },
+            { label: '已加入回收书单(暂停回收)', value: 2 },
+            { label: '未加入回收书单', value: 3 },
+            { label: '黑名单', value: 4 },
+            { label: '未加入回收书单(手动暂停)', value: 5 },
+        ]
+    },
+    { type: 'input', label: '操作员', prop: 'checkUser' },
+]);
+
+const initKeys = reactive({
+    bookName: '',
+    isbn: '',
+    author: '',
+    publish: '',
+    pubDateStart: '',
+    pubDateEnd: '',
+    minPrice: void 0,
+    maxPrice: void 0,
+    minDiscount: void 0,
+    maxDiscount: void 0,
+    globalInDiscount: void 0,
+    globalNotInDiscount: void 0,
+    searchType: 0,
+    defaultType: []
+});
+
+const searchRef = ref(null);
+/** 搜索 */
+const search = (data) => {
+    let params = JSON.parse(JSON.stringify(data));
+    delete params.price;
+    delete params.discount;
+    delete params.pubDate;
+    params.defaultType = params.defaultType.join(',');
+    emit('search', params);
+};
+</script>

+ 1 - 1
src/views/recycle/fallbackLog/components/book-search.vue

@@ -22,7 +22,7 @@
         { type: 'input', label: 'ISBN', prop: 'isbn' },
         { type: 'input', label: '作者', prop: 'author' },
         { type: 'input', label: '出版社', prop: 'publish' },
-        { type: 'input', label: '推送人', prop: 'feedbackUserName' },
+        { type: 'input', label: '员工姓名', prop: 'feedbackUserName' },
         {
             type: 'inputNumberRange',
             label: '定价',

+ 1 - 1
src/views/recycle/fallbackLog/index.vue

@@ -101,7 +101,7 @@
         },
         { label: '图片', prop: 'cover', width: 120, slot: 'cover' },
         { label: '信息', prop: 'baseInfo', slot: 'baseInfo', minWidth: 500 },
-        { label: '反馈人', prop: 'feedbackUserName', width: 100 },
+        { label: '推送人', prop: 'feedbackUserName', width: 100 },
         { label: '反馈内容', prop: 'feedbackContent', minWidth: 200 },
         {
             label: '处理状态',

+ 141 - 168
src/views/recycle/inventory/index.vue

@@ -4,43 +4,22 @@
 
         <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
             <template #toolbar>
-                <el-button
-                    type="primary"
-                    plain
-                    :icon="PlusOutlined"
-                    v-permission="'recycle:inventory:add'"
-                    @click="handleUpdate()"
-                >
+                <el-button type="primary" plain :icon="PlusOutlined" v-permission="'recycle:inventory:add'"
+                    @click="handleUpdate()">
                     新增图书商品
                 </el-button>
-                <el-button
-                    type="primary"
-                    plain
-                    v-permission="'recycle:inventory:import'"
-                    @click="handleImportExcel"
-                    :icon="UploadOutlined"
-                >
+                <el-button type="primary" plain v-permission="'recycle:inventory:import'" @click="handleImportExcel"
+                    :icon="UploadOutlined">
                     批量导入
                 </el-button>
-                <el-button
-                    type="success"
-                    plain
-                    v-permission="'recycle:inventory:checkNew'"
-                    @click="handleCheckNew"
-                    :icon="CloudUploadOutlined"
-                >
+                <el-button type="success" plain v-permission="'recycle:inventory:checkNew'" @click="handleCheckNew"
+                    :icon="CloudUploadOutlined">
                     检测上新
                 </el-button>
             </template>
             <template #cover="{ row }">
-                <el-image
-                    style="width: 80px; height: 100px"
-                    fit="cover"
-                    :src="row?.bookInfo?.cover"
-                    :preview-src-list="[row?.bookInfo?.cover]"
-                    :initial-index="0"
-                    preview-teleported
-                />
+                <el-image style="width: 80px; height: 100px" fit="cover" :src="row?.bookInfo?.cover"
+                    :preview-src-list="[row?.bookInfo?.cover]" :initial-index="0" preview-teleported />
             </template>
 
             <template #baseInfo="{ row }">
@@ -53,28 +32,15 @@
 
             <template #action="{ row }">
                 <div>
-                    <el-button
-                        type="success"
-                        link
-                        v-permission="'recycle:inventory:update'"
-                        @click="handleUpdate(row)"
-                    >
+                    <el-button type="success" link v-permission="'recycle:inventory:update'" @click="handleUpdate(row)">
                         [编辑]
                     </el-button>
-                    <el-button
-                        type="danger"
-                        link
-                        v-permission="'recycle:inventory:recycleDetail'"
-                        @click="handleRecycleDetail(row)"
-                    >
+                    <el-button type="danger" link v-permission="'recycle:inventory:recycleDetail'"
+                        @click="handleRecycleDetail(row)">
                         [回收明细]
                     </el-button>
-                    <el-button
-                        type="warning"
-                        link
-                        v-permission="'recycle:inventory:saleDetail'"
-                        @click="handleSaleDetail(row)"
-                    >
+                    <el-button type="warning" link v-permission="'recycle:inventory:saleDetail'"
+                        @click="handleSaleDetail(row)">
                         [销售明细]
                     </el-button>
                 </div>
@@ -89,127 +55,134 @@
 </template>
 
 <script setup>
-    import { ref, reactive } from 'vue';
-    import {
-        PlusOutlined,
-        UploadOutlined,
-        CloudUploadOutlined
-    } from '@/components/icons';
-    import { ElMessage } from 'element-plus';
-    import pageSearch from './components/page-search.vue';
-    import CommonTable from '@/components/CommonPage/CommonTable.vue';
-    import booksEdit from '@/views/data/books/components/books-edit.vue';
-    import booksImport from '@/views/data/books/components/books-import.vue';
-    import bookBaseInfo from './components/book-base-info.vue';
-    import bookCheckNew from './components/book-check-new.vue';
-    import bookStock from './components/book-stock.vue';
-    import recycleDetail from './components/recycle-detail.vue';
-    import saleDetail from './components/sale-detail.vue';
-    import { useDictData } from '@/utils/use-dict-data';
-
-    defineOptions({ name: 'RecycleOrderCancelled' });
-
-    const [perCheckDicts] = useDictData(['is_common_yes']);
-
-    /** 表格列配置 */
-    const columns = ref([
-        {
-            type: 'selection',
-            columnKey: 'selection',
-            width: 50,
-            align: 'center',
-            fixed: 'left'
-        },
-        {
-            label: '图片',
-            prop: 'cover',
-            slot: 'cover',
-            align: 'center'
-        },
-        {
-            label: '基础信息',
-            prop: 'baseInfo',
-            slot: 'baseInfo',
-            align: 'center',
-            minWidth: 320
-        },
-        {
-            label: '商品类型',
-            prop: 'goodsType',
-            formatter: (row) => '图书商品',
-            align: 'center'
-        },
-        {
-            label: '售价',
-            prop: 'salePrice',
-            align: 'center',
-            minWidth: 100,
-            formatter: (row) => '¥' + (row?.salePrice ? row.salePrice : 0)
-        },
-        {
-            label: '库存',
-            prop: 'stock',
-            align: 'center',
-            minWidth: 100,
-            slot: 'stock'
-        },
-        {
-            label: '销量',
-            prop: 'salesNum',
-            align: 'center',
-            minWidth: 100,
-            formatter: (row) => row.salesNum || 0
-        },
-        {
-            columnKey: 'action',
-            label: '操作',
-            width: 200,
-            align: 'center',
-            slot: 'action'
-        }
-    ]);
-
-    /** 页面组件实例 */
-    const pageRef = ref(null);
-
-    const pageConfig = reactive({
-        pageUrl: '/book/stock/pagelist',
-        fileName: '库存数据',
-        cacheKey: 'books-stock-data'
-    });
-
-    //导入
-    const showImport = ref(false);
-    function handleImportExcel() {
-        showImport.value = true;
+import { ref, reactive } from 'vue';
+import {
+    PlusOutlined,
+    UploadOutlined,
+    CloudUploadOutlined
+} from '@/components/icons';
+import { ElMessage } from 'element-plus';
+import pageSearch from './components/page-search.vue';
+import CommonTable from '@/components/CommonPage/CommonTable.vue';
+import booksEdit from '@/views/data/books/components/books-edit.vue';
+import booksImport from '@/views/data/books/components/books-import.vue';
+import bookBaseInfo from './components/book-base-info.vue';
+import bookCheckNew from './components/book-check-new.vue';
+import bookStock from './components/book-stock.vue';
+import recycleDetail from './components/recycle-detail.vue';
+import saleDetail from './components/sale-detail.vue';
+import { useDictData } from '@/utils/use-dict-data';
+
+defineOptions({ name: 'RecycleOrderCancelled' });
+
+const [perCheckDicts] = useDictData(['is_common_yes']);
+
+/** 表格列配置 */
+const columns = ref([
+    {
+        type: 'selection',
+        columnKey: 'selection',
+        width: 50,
+        align: 'center',
+        fixed: 'left'
+    },
+    {
+        label: '图片',
+        prop: 'cover',
+        slot: 'cover',
+        align: 'center'
+    },
+    {
+        label: '基础信息',
+        prop: 'baseInfo',
+        slot: 'baseInfo',
+        align: 'center',
+        minWidth: 320
+    },
+    {
+        label: '商品类型',
+        prop: 'goodsType',
+        formatter: (row) => '图书商品',
+        align: 'center'
+    },
+    {
+        label: '售价',
+        prop: 'productPrice',
+        align: 'center',
+        minWidth: 100,
+        formatter: (row) => '¥' + (row?.salePrice ? row.salePrice : 0)
+    },
+    {
+        label: '库存',
+        prop: 'stock',
+        align: 'center',
+        minWidth: 100,
+        slot: 'stock'
+    },
+    {
+        label: '销量',
+        prop: 'salesNum',
+        align: 'center',
+        minWidth: 100,
+        formatter: (row) => row.salesNum || 0
+    },
+    {
+        columnKey: 'action',
+        label: '操作',
+        width: 120,
+        align: 'center',
+        slot: 'action',
+        fixed: 'right'
     }
-
-    //刷新表格
-    function reload(where) {
-        pageRef.value?.reload(where);
-    }
-
-    //新增编辑图书
-    const editRef = ref(null);
-    function handleUpdate(row) {
-        editRef.value?.handleOpen(row);
-    }
-
-    //检测上新
-    const checkNewRef = ref(null);
-    function handleCheckNew() {
-        checkNewRef.value?.handleOpen();
-    }
-
-    //回收明细
-    const recycleDetailRef = ref(null);
-    function handleRecycleDetail(row) {
-        recycleDetailRef.value?.handleOpen(row);
-    }
-
-    //销售明细
-    const saleDetailRef = ref(null);
-    function handleSaleDetail(row) {
-        saleDetailRef.value?.handleOpen(row);
+]);
+
+/** 页面组件实例 */
+const pageRef = ref(null);
+
+const pageConfig = reactive({
+    pageUrl: '/book/stock/pagelist',
+    fileName: '库存数据',
+    cacheKey: 'books-stock-data'
+});
+
+//导入
+const showImport = ref(false);
+function handleImportExcel() {
+    showImport.value = true;
+}
+
+//刷新表格
+function reload(where) {
+    pageRef.value?.reload(where);
+}
+
+//新增编辑图书
+const editRef = ref(null);
+function handleUpdate(row) {
+    if (!row.bookInfo) {
+        ElMessage.warning('缺少图书信息');
+        return;
     }
+    row.id = row.bookInfo.id
+    editRef.value?.handleOpen(row);
+}
+
+//检测上新
+const checkNewRef = ref(null);
+function handleCheckNew() {
+    checkNewRef.value?.handleOpen();
+}
+
+//回收明细
+const recycleDetailRef = ref(null);
+function handleRecycleDetail(row) {
+    recycleDetailRef.value?.handleOpen(row);
+}
+
+//销售明细
+const saleDetailRef = ref(null);
+function handleSaleDetail(row) {
+    return ElMessage.warning('功能暂未开放');
+    saleDetailRef.value?.handleOpen(row);
+}
 </script>

+ 3 - 3
src/views/recycle/inventoryAlert/index.vue

@@ -10,8 +10,8 @@
         >
             <template #toolbar>
                 <el-radio-group @change="handleStatusChange" v-model="history">
-                    <el-radio-button label="库存预警" value="1" />
-                    <el-radio-button label="历史库存预警" value="0" />
+                    <el-radio-button label="库存预警" value="0" />
+                    <el-radio-button label="历史库存预警" value="1" />
                 </el-radio-group>
 
                 <span class="ml-8"></span>
@@ -155,7 +155,7 @@
     const { proxy } = getCurrentInstance();
     defineOptions({ name: 'InventoryAlert' });
 
-    const history = ref('1');
+    const history = ref('0');
     function handleStatusChange(value) {
         pageRef.value.reload({ history: value });
     }

+ 10 - 8
src/views/recycle/priceAlert/index.vue

@@ -1,6 +1,6 @@
 <template>
     <ele-page flex-table>
-        <book-search @search="reload" :isBookTag="true" />
+        <price-search @search="reload" :isBookTag="true" />
 
         <common-table
             ref="pageRef"
@@ -173,7 +173,7 @@
 <script setup>
     import { ref, reactive, getCurrentInstance } from 'vue';
     import CommonTable from '@/components/CommonPage/CommonTable.vue';
-    import bookSearch from '@/views/recycle/components/book-search.vue';
+    import priceSearch from '@/views/recycle/components/price-search.vue';
     import bookStatInfo from '@/views/recycle/components/book-stat-info.vue';
     import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
     import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
@@ -219,13 +219,15 @@
         {
             label: '售价',
             prop: 'productPrice',
-            formatter: (row) => (row.productPrice ? '¥' + row.productPrice : 0)
+            formatter: (row) => (row.productPrice ? '¥' + row.productPrice : 0),
+            sortable: true,
+            columnKey: '1'
         },
-        { label: '最大回收量', prop: 'recycleMax', minWidth: 100, sortable: true, columnKey: '6' },
-        { label: '剩余回收量', prop: 'restRecycleNum', minWidth: 100, sortable: true, columnKey: '7' },
-        { label: '最近预警时间', prop: 'lastScanTime', minWidth: 120, sortable: true, columnKey: '3' },
-        { label: '预警次数', prop: 'alarmNum', minWidth: 90 },
-        { label: '销量', prop: 'salesNum', minWidth: 90, sortable: true, columnKey: '8' },
+        { label: '最大回收量', prop: 'recycleMax', minWidth: 120, sortable: true, columnKey: '4' },
+        { label: '剩余回收量', prop: 'restRecycleNum', minWidth: 120, sortable: true, columnKey: '5' },
+        { label: '最近预警时间', prop: 'lastScanTime', minWidth: 140, sortable: true, columnKey: '2' },
+        { label: '预警次数', prop: 'alarmNum', minWidth: 110, sortable: true, columnKey: '3' },
+        { label: '销量', prop: 'salesNum', minWidth: 90, sortable: true, columnKey: '6' },
         {
             columnKey: 'view',
             label: '查看',

+ 14 - 1
src/views/recycle/remindBooks/index.vue

@@ -22,6 +22,15 @@
                 >
                     批量删除
                 </el-button>
+                <el-button
+                    type="primary"
+                    plain
+                    :icon="ExportOutlined"
+                    v-permission="'recycle:remindBooks:export'"
+                    @click="handleExport()"
+                >
+                    导出
+                </el-button>
             </template>
 
             <template #cover="{ row }">
@@ -87,7 +96,7 @@
 
     const pageConfig = reactive({
         pageUrl: '/book/checkWarn/getBookPageList',
-        exportUrl: '',
+        exportUrl: '/book/checkWarn/getBookPageExplain',
         fileName: '审核提醒书籍',
         cacheKey: 'remindBooksTable'
     });
@@ -130,4 +139,8 @@
     function handleAdd() {
         editRef.value?.handleOpen();
     }
+
+    function handleExport() {
+        pageRef.value?.exportData('审核提醒书籍', 'POST');
+    }
 </script>

+ 6 - 6
src/views/recycle/stockFullAlert/index.vue

@@ -181,7 +181,7 @@
 <script setup>
     import { ref, reactive, getCurrentInstance } from 'vue';
     import CommonTable from '@/components/CommonPage/CommonTable.vue';
-    import bookSearch from '@/views/recycle/components/book-search.vue';
+    import bookSearch from '@/views/recycle/components/price-search.vue';
     import bookStatInfo from '@/views/recycle/components/book-stat-info.vue';
     import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
     import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
@@ -224,11 +224,11 @@
             slot: 'baseInfo'
         },
         { label: '回收折扣', prop: 'recycleDiscount' },
-        { label: '预估金额', prop: 'recyclePrice' },
-        { label: '最大回收量', prop: 'recycleMax', minWidth: 100 },
-        { label: '当前剩余回收量', prop: 'restRecycleNum', minWidth: 100 },
-        { label: '预警次数', prop: 'alarmNum', minWidth: 90 },
-        { label: '销量', prop: 'salesNum', minWidth: 90 },
+        { label: '预估金额', prop: 'recyclePrice', minWidth: 100 },
+        { label: '最大回收量', prop: 'recycleMax', minWidth: 100, sortable: true, columnKey: '4' },
+        { label: '当前剩余回收量', prop: 'restRecycleNum', minWidth: 100, sortable: true, columnKey: '5' },
+        { label: '预警次数', prop: 'alarmNum', minWidth: 90, sortable: true, columnKey: '3' },
+        { label: '销量', prop: 'salesNum', minWidth: 90, sortable: true, columnKey: '6' },
         {
             columnKey: 'view',
             label: '查看',

+ 1 - 1
src/views/recycle/workbench/index.vue

@@ -310,7 +310,7 @@
         fileName: '扫码工作台',
         cacheKey: 'workbenchTable',
         params: {
-            searchType: '1'
+            searchType: '0'
         },
         rowKey: 'isbn'
     });

+ 1 - 1
src/views/recycleOrder/detail/order-sales-log.vue

@@ -82,7 +82,7 @@
         { label: 'ISBN', prop: 'bookIsbn', align: 'center',},
         { label: '操作人', prop: 'userName', align: 'center',},
         { label: '操作时间', prop: 'changeTime', align: 'center' },
-        { label: '修改价格', prop: 'changePrice', align: 'center' }
+        { label: '修改价格', prop: 'changeInfo', align: 'center' }
     ]);
 
     defineExpose({