Bladeren bron

指定图书和独立参数设置

Alex 11 maanden geleden
bovenliggende
commit
0e829ed487

+ 10 - 0
src/views/recycle/booklist/index.vue

@@ -107,6 +107,7 @@
 
         <books-edit ref="editRef"></books-edit>
         <set-params ref="paramsRef" @refresh="reload"></set-params>
+        <add-discount ref="discountRef" @refresh="reload"></add-discount>
     </ele-page>
 </template>
 
@@ -119,6 +120,7 @@ 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 addDiscount from '@/views/recycle/components/add-discount.vue';
 import { useDictData } from '@/utils/use-dict-data';
 
 defineOptions({ name: 'recycleBooklist' });
@@ -346,7 +348,15 @@ function handleOptType(type) {
     });
 }
 //指定折扣
+const discountRef = ref(null);
 function handleAddDiscount() {
+    let selections = pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
 
+    const isbnList = selections.map((item) => item.isbn);
+    discountRef.value?.handleOpen({ isbnList });
 }
 </script>

+ 75 - 0
src/views/recycle/components/add-discount.vue

@@ -0,0 +1,75 @@
+<!-- 指定折扣弹窗 -->
+<template>
+    <ele-modal form :width="440" v-model="visible" title="指定折扣加回收书单" @open="handleOpen">
+        <SimpleForm :items="items" labelWidth="0" ref="formRef" :initKeys="form"></SimpleForm>
+        <template #footer>
+            <el-button @click="handleCancel">取消</el-button>
+            <el-button type="primary" @click="handleSumbit">确定</el-button>
+        </template>
+    </ele-modal>
+</template>
+
+<script setup>
+import { ref, reactive, nextTick } from 'vue';
+import SimpleForm from '@/components/CommonPage/SimpleForm.vue';
+import validators from '@/utils/validators';
+import request from '@/utils/request';
+
+/** 弹窗是否打开 */
+const visible = defineModel({ type: Boolean });
+
+/** 关闭弹窗 */
+const handleCancel = () => {
+    visible.value = false;
+    nextTick(() => {
+        formRef.value?.resetForm();
+    });
+};
+
+const form = ref({
+    isbnList: [],
+    recycleDiscount: ''
+});
+
+/** 弹窗打开事件 */
+const handleOpen = (data) => {
+    visible.value = true;
+    nextTick(() => {
+        if (data?.isbnList) {
+            form.value.isbnList = data.isbnList;
+            formRef.value?.setData(form.value);
+        }
+    });
+};
+
+const items = reactive([
+    {
+        label: '',
+        prop: 'recycleDiscount',
+        type: 'input',
+        required: true,
+        props: {
+            placeholder: '请输入折扣',
+        },
+        rules: [validators.decimalRange]
+    }
+]);
+
+const formRef = ref();
+
+const emit = defineEmits(['refresh']);
+const handleSumbit = () => {
+    formRef.value?.submitForm().then((data) => {
+        data.isbnList = form.value.isbnList;
+        request.post('/book/bookRecycleInfo/setAndIn', data).then(() => {
+            visible.value = false;
+            ElMessage.success('设置成功');
+            emit('refresh');
+        });
+    });
+};
+
+defineExpose({
+    handleOpen
+});
+</script> 

+ 5 - 1
src/views/recycle/components/book-info.vue

@@ -12,7 +12,7 @@
       <el-text>ISBN:</el-text>
       <el-text>{{ row.isbn }}</el-text>
     </div>
-    <div class="common-text">
+    <div class="common-text" v-if="showFormat">
       <el-text>分类:</el-text>
       <el-text>{{ row.cateName || '-' }}</el-text>
     </div>
@@ -35,6 +35,10 @@
     row: {
       type: Object,
       default: () => {}
+    },
+    showFormat: {
+      type: Boolean,
+      default: true
     }
   });
 

+ 9 - 1
src/views/recycle/components/book-other-info.vue

@@ -4,10 +4,14 @@
             <el-text>定价:</el-text>
             <el-text>¥ {{ row.price }}</el-text>
         </div>
-        <div class="common-text">
+        <div class="common-text" v-if="!showFormat">
             <el-text>开本尺寸:</el-text>
             <el-text>{{ row.bookFormat }}</el-text>
         </div>
+        <div class="common-text" v-else>
+            <el-text>回收折扣:</el-text>
+            <el-text>{{ row.recycleDiscount }}折</el-text>
+        </div>
         <div class="common-text">
             <el-text>回收状态:</el-text>
             <el-text>{{ row.recyleStatus == 1 ? '正在回收' : '暂停回收' }}</el-text>
@@ -27,6 +31,10 @@ const props = defineProps({
     row: {
         type: Object,
         default: () => { }
+    },
+    showFormat: {
+        type: Boolean,
+        default: false
     }
 });
 </script>

+ 81 - 0
src/views/recycle/components/modify-discount.vue

@@ -0,0 +1,81 @@
+<!-- 修改回收折扣弹窗 -->
+<template>
+    <ele-modal form :width="460" v-model="visible" title="修改回收折扣" @open="handleOpen">
+        <SimpleForm :items="items" labelWidth="100px" ref="formRef" :initKeys="form"></SimpleForm>
+        <template #footer>
+            <el-button @click="handleCancel">关闭</el-button>
+            <el-button type="primary" @click="handleSumbit">确定</el-button>
+        </template>
+    </ele-modal>
+</template>
+
+<script setup>
+import { ref, reactive, nextTick } from 'vue';
+import SimpleForm from '@/components/CommonPage/SimpleForm.vue';
+import validators from '@/utils/validators';
+import request from '@/utils/request';
+
+/** 弹窗是否打开 */
+const visible = defineModel({ type: Boolean });
+
+/** 关闭弹窗 */
+const handleCancel = () => {
+    visible.value = false;
+    nextTick(() => {
+        formRef.value?.resetForm();
+    });
+};
+
+const form = ref({
+    isbn: '',
+    recycleDiscount: ''
+});
+
+/** 弹窗打开事件 */
+const handleOpen = (data) => {
+    visible.value = true;
+    nextTick(() => {
+        if (data?.isbn) {
+            form.value.isbn = data.isbn;
+            getParams(data.isbn);
+        }
+    });
+};
+
+//根据isbn获取参数
+const getParams = (isbn) => {
+    request.get(`/book/bookRecycleInfo/getSepSet/${isbn}`).then((res) => {
+        let data = res.data.data;
+        form.value.recycleDiscount = data.recycleDiscount;
+        formRef.value?.setData(form.value);
+    });
+};
+
+const items = reactive([
+    {
+        label: '回收折扣',
+        prop: 'recycleDiscount',
+        type: 'input',
+        required: true,
+        rules: [validators.decimalRange]
+    }
+]);
+
+const formRef = ref();
+
+const emit = defineEmits(['refresh']);
+const handleSumbit = () => {
+    formRef.value?.submitForm().then((data) => {
+        data.isbn = form.value.isbn;
+        request.post('/book/bookRecycleInfo/updateDiscount', data).then(() => {
+            visible.value = false;
+            ElMessage.success('修改成功');
+            emit('refresh');
+        });
+    });
+};
+
+defineExpose({
+    handleOpen
+});
+</script> 

+ 81 - 0
src/views/recycle/components/modify-max-recycle.vue

@@ -0,0 +1,81 @@
+<!-- 修改最大回收量弹窗 -->
+<template>
+    <ele-modal form :width="460" v-model="visible" title="修改最大回收量" @open="handleOpen">
+        <SimpleForm :items="items" labelWidth="120px" ref="formRef" :initKeys="form"></SimpleForm>
+        <template #footer>
+            <el-button @click="handleCancel">关闭</el-button>
+            <el-button type="primary" @click="handleSumbit">确定</el-button>
+        </template>
+    </ele-modal>
+</template>
+
+<script setup>
+import { ref, reactive, nextTick } from 'vue';
+import SimpleForm from '@/components/CommonPage/SimpleForm.vue';
+import validators from '@/utils/validators';
+import request from '@/utils/request';
+
+/** 弹窗是否打开 */
+const visible = defineModel({ type: Boolean });
+
+/** 关闭弹窗 */
+const handleCancel = () => {
+    visible.value = false;
+    nextTick(() => {
+        formRef.value?.resetForm();
+    });
+};
+
+const form = ref({
+    isbn: '',
+    recycleMax: ''
+});
+
+/** 弹窗打开事件 */
+const handleOpen = (data) => {
+    visible.value = true;
+    nextTick(() => {
+        if (data?.isbn) {
+            form.value.isbn = data.isbn;
+            getParams(data.isbn);
+        }
+    });
+};
+
+//根据isbn获取参数
+const getParams = (isbn) => {
+    request.get(`/book/bookRecycleInfo/getSepSet/${isbn}`).then((res) => {
+        let data = res.data.data;
+        form.value.recycleMax = data.recycleMax;
+        formRef.value?.setData(form.value);
+    });
+};
+
+const items = reactive([
+    {
+        label: '最大回收数量',
+        prop: 'recycleMax',
+        type: 'input',
+        required: true,
+        rules: [validators.nonNegativeInteger]
+    }
+]);
+
+const formRef = ref();
+
+const emit = defineEmits(['refresh']);
+const handleSumbit = () => {
+    formRef.value?.submitForm().then((data) => {
+        data.isbn = form.value.isbn;
+        request.post('/book/bookRecycleInfo/updateRecycleMax', data).then(() => {
+            visible.value = false;
+            ElMessage.success('修改成功');
+            emit('refresh');
+        });
+    });
+};
+
+defineExpose({
+    handleOpen
+});
+</script> 

+ 81 - 0
src/views/recycle/components/modify-order-recycle.vue

@@ -0,0 +1,81 @@
+<!-- 修改订单回收量弹窗 -->
+<template>
+    <ele-modal form :width="460" v-model="visible" title="修改订单回收量" @open="handleOpen">
+        <SimpleForm :items="items" labelWidth="140px" ref="formRef" :initKeys="form"></SimpleForm>
+        <template #footer>
+            <el-button @click="handleCancel">关闭</el-button>
+            <el-button type="primary" @click="handleSumbit">确定</el-button>
+        </template>
+    </ele-modal>
+</template>
+
+<script setup>
+import { ref, reactive, nextTick } from 'vue';
+import SimpleForm from '@/components/CommonPage/SimpleForm.vue';
+import validators from '@/utils/validators';
+import request from '@/utils/request';
+
+/** 弹窗是否打开 */
+const visible = defineModel({ type: Boolean });
+
+/** 关闭弹窗 */
+const handleCancel = () => {
+    visible.value = false;
+    nextTick(() => {
+        formRef.value?.resetForm();
+    });
+};
+
+const form = ref({
+    isbn: '',
+    recycleMaxPerOrder: ''
+});
+
+/** 弹窗打开事件 */
+const handleOpen = (data) => {
+    visible.value = true;
+    nextTick(() => {
+        if (data?.isbn) {
+            form.value.isbn = data.isbn;
+            getParams(data.isbn);
+        }
+    });
+};
+
+//根据isbn获取参数
+const getParams = (isbn) => {
+    request.get(`/book/bookRecycleInfo/getSepSet/${isbn}`).then((res) => {
+        let data = res.data.data;
+        form.value.recycleMaxPerOrder = data.recycleMaxPerOrder;
+        formRef.value?.setData(form.value);
+    });
+};
+
+const items = reactive([
+    {
+        label: '单个订单回收数量',
+        prop: 'recycleMaxPerOrder',
+        type: 'input',
+        required: true,
+        rules: [validators.nonNegativeInteger]
+    }
+]);
+
+const formRef = ref();
+
+const emit = defineEmits(['refresh']);
+const handleSumbit = () => {
+    formRef.value?.submitForm().then((data) => {
+        data.isbn = form.value.isbn;
+        request.post('/book/bookRecycleInfo/updateRecyclePerMax', data).then(() => {
+            visible.value = false;
+            ElMessage.success('修改成功');
+            emit('refresh');
+        });
+    });
+};
+
+defineExpose({
+    handleOpen
+});
+</script> 

+ 409 - 28
src/views/recycle/independentParameter/index.vue

@@ -1,33 +1,414 @@
 <template>
-  <ele-page flex-table>
-    <ele-card flex-table>
-      <div class="common-section mb-4">
-        <div class="common-title mb-4">已加入回收书单全局参数设置</div>
-        <has-add-recycle-booklist :settings="settings" />
-      </div>
-    </ele-card>
-  </ele-page>
+    <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="searchType">
+                    <el-radio-button label="全部" value="0" />
+                    <el-radio-button label="已加入回收书单(正在回收)" value="1" />
+                    <el-radio-button label="已加入回收书单(暂停回收)" value="2" />
+                </el-radio-group>
+
+                <span class="ml-8"></span>
+                <el-button type="danger" plain v-permission="'recycle:specifiedBooks:batchAddBlacklist'"
+                    @click="handleOptBlacklist()">
+                    加黑名单
+                </el-button>
+                <el-button type="warning" plain v-permission="'recycle:specifiedBooks:batchPauseRecycle'"
+                    @click="handleOptRecycle(null, 2)">
+                    暂停回收
+                </el-button>
+                <el-button type="warning" plain v-permission="'recycle:specifiedBooks:batchStartRecycle'"
+                    @click="handleOptRecycle(null, 1)">
+                    开启回收
+                </el-button>
+                <el-button type="success" plain v-permission="'recycle:specifiedBooks:batchAddSocial'"
+                    @click="handleOptType(1)">
+                    加社科库
+                </el-button>
+                <el-button type="primary" plain v-permission="'recycle:specifiedBooks:batchAddTeach'"
+                    @click="handleOptType(2)">
+                    加教材库
+                </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" @edit="handleUpdateBook" :showFormat="false"></book-info>
+                    </div>
+                    <div style="flex: 1.5; margin-left: 15px">
+                        <book-other-info :row="row" showFormat></book-other-info>
+                    </div>
+                </div>
+            </template>
+            <template #stock="{ row }">
+                <book-stock :row="row"></book-stock>
+            </template>
+            <template #view="{ row }">
+                <div class="flex justify-start items-center flex-wrap book-btns">
+                    <el-button color="#951d1d" @click="handleViewUrl(row, 'kw')">
+                        查看孔网
+                    </el-button>
+                    <el-button color="#e99d42" @click="handleRecycleLog(row)">
+                        回收日志
+                    </el-button>
+                    <el-button color="#f27606" @click="handleViewUrl(row, 'tb')">
+                        查看淘宝
+                    </el-button>
+                    <el-button color="#0f7dc7" @click="handleSalesLog(row)">
+                        售价日志
+                    </el-button>
+                    <el-button color="#399420" @click="handleViewUrl(row, 'db')">
+                        查看豆瓣
+                    </el-button>
+                    <el-button color="#a4adb3" @click="handleViewUrl(row, 'dd')">
+                        查看当当
+                    </el-button>
+                </div>
+            </template>
+
+            <template #action="{ row }">
+                <div class="flex justify-start items-center flex-wrap  book-btns">
+                    <el-button color="#7728f5" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyDiscount(row)">
+                        修改回收折扣
+                    </el-button>
+                    <el-button color="#333333" v-permission="'recycle:specifiedBooks:addBlacklist'"
+                        @click="handleOptBlacklist(row)">
+                        加入黑名单
+                    </el-button>
+                    <el-button color="#3ab54a" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyMaxRecycle(row)">
+                        修改最大回收量
+                    </el-button>
+                    <el-button color="#bd3124" v-permission="'recycle:specifiedBooks:pauseRecycle'"
+                        @click="handleOptRecycle(row, 2)" v-if="row.recycleStatus == 1">
+                        暂停回收
+                    </el-button>
+                    <el-button color="#bd3124" v-permission="'recycle:specifiedBooks:startRecycle'"
+                        @click="handleOptRecycle(row, 1)" v-else>
+                        开启回收
+                    </el-button>
+                    <el-button color="#e99d42" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyOrderRecycle(row)">
+                        修改订单回收量
+                    </el-button>
+                    <el-button color="#4095e5" v-permission="'recycle:booklist:removeBooklist'"
+                        @click="handleOptBooklist(row)">
+                        移除回收书单
+                    </el-button>
+                </div>
+            </template>
+        </common-table>
+
+        <books-edit ref="editRef"></books-edit>
+        <set-params ref="paramsRef" @refresh="reload"></set-params>
+        <add-discount ref="discountRef" @refresh="reload"></add-discount>
+        <orderRecycleLog ref="recycleLogRef" />
+        <orderSalesLog ref="salesLogRef" />
+        <modifyOrderRecycle ref="orderRecycleRef" @refresh="reload" />
+        <modifyMaxRecycle ref="maxRecycleRef" @refresh="reload" />
+        <modifyDiscount ref="modifyDiscountRef" @refresh="reload" />
+    </ele-page>
 </template>
 
 <script setup>
-  import { getCurrentInstance, ref } from 'vue';
-  import hasAddRecycleBooklist from '@/views/recycle/globalParameter/components/has-add-recycle-booklist.vue';
-
-  let { proxy } = getCurrentInstance();
-
-  defineOptions({ name: 'independentParameter' });
-
-  //获取当前设置
-  const settings = ref({})
-  function getSettings() {
-      proxy.$http.get('/recycle/manage/overall/get').then((res) => {
-          if(res.data.code === 200){
-              settings.value = res.data.data
-          }else{
-              ElMessage.error(res.data.msg)
-          }
-      });
-  }
-
-  getSettings()
+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 addDiscount from '@/views/recycle/components/add-discount.vue';
+import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
+import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
+import modifyOrderRecycle from '@/views/recycle/components/modify-order-recycle.vue';
+import modifyMaxRecycle from '@/views/recycle/components/modify-max-recycle.vue';
+import modifyDiscount from '@/views/recycle/components/modify-discount.vue';
+
+defineOptions({ name: 'independentParameter' });
+
+const searchType = ref('0');
+function handleStatusChange(value) {
+    pageRef.value.reload({ searchType: 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: 500,
+        slot: 'baseInfo'
+    },
+    {
+        label: '回收价格',
+        prop: 'recyclePrice',
+        sortable: true,
+        columnKey: 'recyclePrice',
+        minWidth: 100
+    },
+    {
+        label: '最大回收量',
+        minWidth: 120,
+        prop: 'recycleMax',
+        sortable: true,
+        columnKey: 'recycleMax'
+    },
+    {
+        label: '当前剩余回收量',
+        minWidth: 140,
+        prop: 'restRecycleNum',
+        sortable: true,
+        columnKey: 'restRecycleNum'
+    },
+    {
+        label: '销量',
+        prop: 'salesNum',
+        sortable: true,
+        columnKey: 'salesNum'
+    },
+    {
+        label: '查看',
+        prop: 'view',
+        slot: 'view',
+        width: 234,
+        fixed: 'right'
+    },
+    {
+        columnKey: 'action',
+        label: '操作',
+        width: 234,
+        slot: 'action',
+        fixed: 'right'
+    }
+]);
+
+/** 页面组件实例 */
+const pageRef = ref(null);
+
+const pageConfig = reactive({
+    pageUrl: '/book/bookRecycleInfo/sepSet/pageList',
+    fileName: '独立参数设置',
+    cacheKey: 'independentParameterTable',
+    rowKey: 'isbn'
+});
+
+//刷新表格
+function reload(where) {
+    pageRef.value?.reload(where);
+}
+
+//编辑
+const editRef = ref(null);
+function handleUpdateBook(row) {
+    let params = {
+        id: row.bookId
+    };
+    editRef.value?.handleOpen(params);
+}
+
+//设置参数
+const paramsRef = ref(null);
+function handleSetParams(row) {
+    paramsRef.value?.handleOpen(row);
+}
+
+//黑名单操作
+function handleOptBlacklist(row) {
+    let selections = row ? [row] : pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const isBlacklist = row ? row.bookStatus === '3' : selections[0].bookStatus === '3';
+
+    const url = isBlacklist
+        ? '/book/bookRecycleInfo/removeBlackList'
+        : '/book/bookRecycleInfo/addBlackList';
+
+    const title = isBlacklist ? '确认移除黑名单?' : '确认加入黑名单?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        success: () => {
+            reload();
+        }
+    });
+}
+
+//回收操作
+function handleOptRecycle(row, status) {
+    let selections = row ? [row] : pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const isStop = status === 2;
+
+    const url = isStop
+        ? '/book/bookRecycleInfo/stopRecycle'
+        : '/book/bookRecycleInfo/openRecycle';
+
+    const title = isStop ? '确认暂停回收?' : '确认开启回收?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        success: () => {
+            reload();
+        }
+    });
+}
+
+//类型操作
+function handleOptType(type) {
+    let selections = pageRef.value?.getSelections();
+    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();
+        }
+    });
+}
+
+//指定折扣
+const discountRef = ref(null);
+function handleAddDiscount() {
+    let selections = pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    discountRef.value?.handleOpen({ isbnList });
+}
+
+//查看当当、淘宝、豆瓣链接
+const handleViewUrl = (row, type) => {
+    let url = '';
+    if (type == 'dd') {
+        url = `https://search.dangdang.com/?key=${row.isbn}&act=input`;
+    } else if (type == 'tb') {
+        url = `https://s.taobao.com/search?page=1&q=${row.isbn}&sort=sale-desc&tab=all`;
+    } else if (type == 'db') {
+        url = `https://search.douban.com/book/subject_search?search_text=${row.isbn}`;
+    } else if (type == 'kw') {
+        url = `https://search.kongfz.com/product_result/?key=${row.isbn}&status=0&_stpmt=eyJzZWFyY2hfdHlwZSI6ImFjdGl2ZSJ9`;
+    }
+    window.open(url, '_blank');
+};
+
+//查看回收日志
+const recycleLogRef = ref();
+const handleRecycleLog = (row) => {
+    recycleLogRef.value?.handleOpen(row);
+};
+
+//移除回收书单操作
+function handleOptBooklist(row) {
+    let selections = row ? [row] : pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const url = '/book/bookRecycleInfo/removeOut';
+    const title = '确认移除回收书单?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        success: () => {
+            reload();
+        }
+    });
+}
+
+//查看售价日志
+const salesLogRef = ref();
+const handleSalesLog = (row) => {
+    salesLogRef.value?.handleOpen(row);
+};
+
+//修改订单回收量
+const orderRecycleRef = ref();
+const handleModifyOrderRecycle = (row) => {
+    orderRecycleRef.value?.handleOpen(row);
+};
+
+//修改最大回收量
+const maxRecycleRef = ref();
+const handleModifyMaxRecycle = (row) => {
+    maxRecycleRef.value?.handleOpen(row);
+};
+
+//修改回收折扣
+const modifyDiscountRef = ref();
+const handleModifyDiscount = (row) => {
+    modifyDiscountRef.value?.handleOpen(row);
+};
 </script>
+<style lang="scss" scoped>
+.book-btns {
+    gap: 6px;
+
+    .el-button {
+        min-width: 100px;
+        font-size: 12px;
+        color: #ffffff;
+        padding: 4px 6px;
+        margin-right: 0;
+    }
+}
+</style>

+ 380 - 303
src/views/recycle/specifiedBooks/index.vue

@@ -1,336 +1,413 @@
 <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-group>
-
-        <span class="ml-8"></span>
-        <el-button
-          type="success"
-          plain
-          v-permission="'recycle:specifiedBooks:batchRemoveBooklist'"
-          @click="handleOptBooklist()"
-        >
-          移除回收书单
-        </el-button>
-        <el-button
-          type="danger"
-          plain
-          v-permission="'recycle:specifiedBooks:batchAddBooklist'"
-          @click="handleOptBooklist()"
-        >
-          加入回收书单
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          v-permission="'recycle:specifiedBooks:batchRemoveBlacklist'"
-          @click="handleOptBlacklist()"
-        >
-          批量移除黑名单
-        </el-button>
-        <el-button
-          type="danger"
-          plain
-          v-permission="'recycle:specifiedBooks:batchAddBlacklist'"
-          @click="handleOptBlacklist()"
-        >
-          批量加黑名单
-        </el-button>
-
-        <el-button
-          type="warning"
-          plain
-          v-permission="'recycle:specifiedBooks:batchPauseRecycle'"
-          @click="handleOptRecycle()"
-        >
-          暂停回收
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          v-permission="'recycle:specifiedBooks:batchStartRecycle'"
-          @click="handleOptRecycle()"
-        >
-          开启回收
-        </el-button>
-        <el-button
-          type="primary"
-          plain
-          v-permission="'recycle:specifiedBooks:batchAddDiscount'"
-          @click="handleAddDiscount()"
-        >
-          指定折扣加回收书单
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          v-permission="'recycle:specifiedBooks:batchAddSocial'"
-          @click="handleOptType(1)"
-        >
-          加社科库
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          v-permission="'recycle:specifiedBooks:batchAddTeach'"
-          @click="handleOptType(2)"
-        >
-          加教材库
-        </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:specifiedBooks:updateBook'"
-          @click="handleUpdateBook(row)"
-        >
-          [编辑]
-        </el-button>
-        <el-button
-          color="#192bbe"
-          plain
-          link
-          v-permission="'recycle:specifiedBooks:setParams'"
-          @click="handleSetParams(row)"
-        >
-          [设置独立参数]
-        </el-button>
-        <el-button
-          type="warning"
-          link
-          v-permission="'recycle:specifiedBooks:addBlacklist'"
-          @click="handleOptBlacklist(row)"
-        >
-          [加入黑名单]
-        </el-button>
-        <el-button
-          type="success"
-          link
-          v-permission="'recycle:specifiedBooks:removeBlacklist'"
-          @click="handleOptBlacklist(row)"
-        >
-          [移除黑名单]
-        </el-button>
-        <el-button
-          type="danger"
-          link
-          v-permission="'recycle:specifiedBooks:pauseRecycle'"
-          @click="handleOptRecycle(row)"
-        >
-          [暂停回收]
-        </el-button>
-        <el-button
-          type="success"
-          link
-          v-permission="'recycle:specifiedBooks:startRecycle'"
-          @click="handleOptRecycle(row)"
-        >
-          [开启回收]
-        </el-button>
-        <el-button
-          type="success"
-          link
-          v-permission="'recycle:specifiedBooks:removeBooklist'"
-          @click="handleOptBooklist(row)"
-        >
-          [移除回收书单]
-        </el-button>
-        <el-button
-          type="danger"
-          link
-          v-permission="'recycle:specifiedBooks:addBooklist'"
-          @click="handleOptBooklist(row)"
-        >
-          [加入回收书单]
-        </el-button>
-      </template>
-    </common-table>
-
-    <books-edit ref="editRef"></books-edit>
-    <set-params ref="paramsRef"></set-params>
-  </ele-page>
+    <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="searchType">
+                    <el-radio-button label="全部" value="0" />
+                    <el-radio-button label="已加入回收书单(正在回收)" value="1" />
+                    <el-radio-button label="已加入回收书单(暂停回收)" value="2" />
+                </el-radio-group>
+
+                <span class="ml-8"></span>
+                <el-button type="danger" plain v-permission="'recycle:specifiedBooks:batchAddBlacklist'"
+                    @click="handleOptBlacklist()">
+                    加黑名单
+                </el-button>
+                <el-button type="warning" plain v-permission="'recycle:specifiedBooks:batchPauseRecycle'"
+                    @click="handleOptRecycle(null, 2)">
+                    暂停回收
+                </el-button>
+                <el-button type="warning" plain v-permission="'recycle:specifiedBooks:batchStartRecycle'"
+                    @click="handleOptRecycle(null, 1)">
+                    开启回收
+                </el-button>
+                <el-button type="success" plain v-permission="'recycle:specifiedBooks:batchAddSocial'"
+                    @click="handleOptType(1)">
+                    加社科库
+                </el-button>
+                <el-button type="primary" plain v-permission="'recycle:specifiedBooks:batchAddTeach'"
+                    @click="handleOptType(2)">
+                    加教材库
+                </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" @edit="handleUpdateBook" :showFormat="false"></book-info>
+                    </div>
+                    <div style="flex: 1.5; margin-left: 15px">
+                        <book-other-info :row="row" showFormat></book-other-info>
+                    </div>
+                </div>
+            </template>
+            <template #stock="{ row }">
+                <book-stock :row="row"></book-stock>
+            </template>
+            <template #view="{ row }">
+                <div class="flex justify-start items-center flex-wrap book-btns">
+                    <el-button color="#951d1d" @click="handleViewUrl(row, 'kw')">
+                        查看孔网
+                    </el-button>
+                    <el-button color="#e99d42" @click="handleRecycleLog(row)">
+                        回收日志
+                    </el-button>
+                    <el-button color="#f27606" @click="handleViewUrl(row, 'tb')">
+                        查看淘宝
+                    </el-button>
+                    <el-button color="#0f7dc7" @click="handleSalesLog(row)">
+                        售价日志
+                    </el-button>
+                    <el-button color="#399420" @click="handleViewUrl(row, 'db')">
+                        查看豆瓣
+                    </el-button>
+                    <el-button color="#a4adb3" @click="handleViewUrl(row, 'dd')">
+                        查看当当
+                    </el-button>
+                </div>
+            </template>
+
+            <template #action="{ row }">
+                <div class="flex justify-start items-center flex-wrap  book-btns">
+                    <el-button color="#7728f5" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyDiscount(row)">
+                        修改回收折扣
+                    </el-button>
+                    <el-button color="#333333" v-permission="'recycle:specifiedBooks:addBlacklist'"
+                        @click="handleOptBlacklist(row)">
+                        加入黑名单
+                    </el-button>
+                    <el-button color="#3ab54a" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyMaxRecycle(row)">
+                        修改最大回收量
+                    </el-button>
+                    <el-button color="#bd3124" v-permission="'recycle:specifiedBooks:pauseRecycle'"
+                        @click="handleOptRecycle(row, 2)" v-if="row.recycleStatus == 1">
+                        暂停回收
+                    </el-button>
+                    <el-button color="#bd3124" v-permission="'recycle:specifiedBooks:startRecycle'"
+                        @click="handleOptRecycle(row, 1)" v-else>
+                        开启回收
+                    </el-button>
+                    <el-button color="#e99d42" v-permission="'recycle:specifiedBooks:updateBook'"
+                        @click="handleModifyOrderRecycle(row)">
+                        修改订单回收量
+                    </el-button>
+                    <el-button color="#4095e5" v-permission="'recycle:booklist:removeBooklist'"
+                        @click="handleOptBooklist(row)">
+                        移除回收书单
+                    </el-button>
+                </div>
+            </template>
+        </common-table>
+
+        <books-edit ref="editRef"></books-edit>
+        <set-params ref="paramsRef" @refresh="reload"></set-params>
+        <add-discount ref="discountRef" @refresh="reload"></add-discount>
+        <orderRecycleLog ref="recycleLogRef" />
+        <orderSalesLog ref="salesLogRef" />
+        <modifyOrderRecycle ref="orderRecycleRef" @refresh="reload" />
+        <modifyMaxRecycle ref="maxRecycleRef" @refresh="reload" />
+        <modifyDiscount ref="modifyDiscountRef" @refresh="reload" />
+    </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 { useDictData } from '@/utils/use-dict-data';
-
-  defineOptions({ name: 'specifiedBookslist' });
-  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'
-    },
+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 addDiscount from '@/views/recycle/components/add-discount.vue';
+import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
+import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
+import modifyOrderRecycle from '@/views/recycle/components/modify-order-recycle.vue';
+import modifyMaxRecycle from '@/views/recycle/components/modify-max-recycle.vue';
+import modifyDiscount from '@/views/recycle/components/modify-discount.vue';
+
+defineOptions({ name: 'specifiedBookslist' });
+
+const searchType = ref('0');
+function handleStatusChange(value) {
+    pageRef.value.reload({ searchType: value });
+}
+
+/** 表格列配置 */
+const columns = ref([
     {
-      label: '图片',
-      prop: 'cover',
-      width: 120,
-      slot: 'cover'
+        type: 'selection',
+        columnKey: 'selection',
+        width: 50,
+        align: 'center',
+        fixed: 'left'
     },
     {
-      label: '信息',
-      prop: 'baseInfo',
-      width: 540,
-      slot: 'baseInfo'
+        label: '图片',
+        prop: 'cover',
+        width: 120,
+        slot: 'cover'
     },
     {
-      label: '回收折扣',
-      prop: 'discount',
-      sortable: true,
-      columnKey: 'discount'
+        label: '信息',
+        prop: 'baseInfo',
+        width: 500,
+        slot: 'baseInfo'
     },
-    { label: '回收价格', prop: 'price', sortable: true, columnKey: 'price' },
     {
-      label: '最大回收量',
-      prop: 'maxRecycledAmount',
-      sortable: true,
-      columnKey: 'maxRecycledAmount'
+        label: '回收价格',
+        prop: 'recyclePrice',
+        sortable: true,
+        columnKey: 'recyclePrice',
+        minWidth: 100
     },
     {
-      label: '总回收数量',
-      prop: 'totalRecycledAmount',
-      sortable: true,
-      columnKey: 'totalRecycledAmount'
+        label: '最大回收量',
+        minWidth: 120,
+        prop: 'recycleMax',
+        sortable: true,
+        columnKey: 'recycleMax'
     },
     {
-      label: '当前剩余回收量',
-      prop: 'remainingRecycledAmount',
-      sortable: true,
-      columnKey: 'remainingRecycledAmount'
+        label: '当前剩余回收量',
+        minWidth: 140,
+        prop: 'restRecycleNum',
+        sortable: true,
+        columnKey: 'restRecycleNum'
     },
     {
-      label: '销量',
-      prop: 'salesVolume',
-      sortable: true,
-      columnKey: 'salesVolume'
+        label: '销量',
+        prop: 'salesNum',
+        sortable: true,
+        columnKey: 'salesNum'
     },
     {
-      label: '库存',
-      prop: 'stock',
-      sortable: true,
-      columnKey: 'stock',
-      slot: 'stock'
+        label: '查看',
+        prop: 'view',
+        slot: 'view',
+        width: 234,
+        fixed: 'right'
     },
     {
-      columnKey: 'action',
-      label: '操作',
-      width: 150,
-      slot: 'action',
-      fixed: 'right'
+        columnKey: 'action',
+        label: '操作',
+        width: 234,
+        slot: 'action',
+        fixed: 'right'
     }
-  ]);
+]);
 
-  /** 页面组件实例 */
-  const pageRef = ref(null);
+/** 页面组件实例 */
+const pageRef = ref(null);
 
-  const pageConfig = reactive({
-    pageUrl: '/book/bookInfo/list',
+const pageConfig = reactive({
+    pageUrl: '/book/bookRecycleInfo/designate/pageList',
     fileName: '指定图书管理',
-    cacheKey: 'specifiedBookslistTable'
-  });
+    cacheKey: 'specifiedBookslistTable',
+    rowKey: 'isbn'
+});
 
-  //刷新表格
-  function reload(where) {
+//刷新表格
+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) {
+}
+
+//编辑
+const editRef = ref(null);
+function handleUpdateBook(row) {
+    let params = {
+        id: row.bookId
+    };
+    editRef.value?.handleOpen(params);
+}
+
+//设置参数
+const paramsRef = ref(null);
+function handleSetParams(row) {
     paramsRef.value?.handleOpen(row);
-  }
+}
 
-  //回收书单操作
-  function handleOptBooklist(row) {
+//黑名单操作
+function handleOptBlacklist(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) {
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const isBlacklist = row ? row.bookStatus === '3' : selections[0].bookStatus === '3';
+
+    const url = isBlacklist
+        ? '/book/bookRecycleInfo/removeBlackList'
+        : '/book/bookRecycleInfo/addBlackList';
+
+    const title = isBlacklist ? '确认移除黑名单?' : '确认加入黑名单?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        success: () => {
+            reload();
+        }
+    });
+}
+
+//回收操作
+function handleOptRecycle(row, status) {
     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 handleOptType(type) {
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const isStop = status === 2;
+
+    const url = isStop
+        ? '/book/bookRecycleInfo/stopRecycle'
+        : '/book/bookRecycleInfo/openRecycle';
+
+    const title = isStop ? '确认暂停回收?' : '确认开启回收?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        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 });
-  }
-  //指定折扣
-  function handleAddDiscount(){
-    
-  }
+    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();
+        }
+    });
+}
+
+//指定折扣
+const discountRef = ref(null);
+function handleAddDiscount() {
+    let selections = pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    discountRef.value?.handleOpen({ isbnList });
+}
+
+//查看当当、淘宝、豆瓣链接
+const handleViewUrl = (row, type) => {
+    let url = '';
+    if (type == 'dd') {
+        url = `https://search.dangdang.com/?key=${row.isbn}&act=input`;
+    } else if (type == 'tb') {
+        url = `https://s.taobao.com/search?page=1&q=${row.isbn}&sort=sale-desc&tab=all`;
+    } else if (type == 'db') {
+        url = `https://search.douban.com/book/subject_search?search_text=${row.isbn}`;
+    } else if (type == 'kw') {
+        url = `https://search.kongfz.com/product_result/?key=${row.isbn}&status=0&_stpmt=eyJzZWFyY2hfdHlwZSI6ImFjdGl2ZSJ9`;
+    }
+    window.open(url, '_blank');
+};
+
+//查看回收日志
+const recycleLogRef = ref();
+const handleRecycleLog = (row) => {
+    recycleLogRef.value?.handleOpen(row);
+};
+
+//移除回收书单操作
+function handleOptBooklist(row) {
+    let selections = row ? [row] : pageRef.value?.getSelections();
+    if (!selections || selections.length === 0) {
+        ElMessage.warning('请选择要操作的图书');
+        return;
+    }
+
+    const isbnList = selections.map((item) => item.isbn);
+    const url = '/book/bookRecycleInfo/removeOut';
+    const title = '确认移除回收书单?';
+
+    pageRef.value?.operatBatch({
+        title,
+        method: 'post',
+        url,
+        data: { isbnList },
+        row,
+        success: () => {
+            reload();
+        }
+    });
+}
+
+//查看售价日志
+const salesLogRef = ref();
+const handleSalesLog = (row) => {
+    salesLogRef.value?.handleOpen(row);
+};
+
+//修改订单回收量
+const orderRecycleRef = ref();
+const handleModifyOrderRecycle = (row) => {
+    orderRecycleRef.value?.handleOpen(row);
+};
+
+//修改最大回收量
+const maxRecycleRef = ref();
+const handleModifyMaxRecycle = (row) => {
+    maxRecycleRef.value?.handleOpen(row);
+};
+
+//修改回收折扣
+const modifyDiscountRef = ref();
+const handleModifyDiscount = (row) => {
+    modifyDiscountRef.value?.handleOpen(row);
+};
 </script>
+<style lang="scss" scoped>
+.book-btns {
+    gap: 6px;
+    .el-button {
+        min-width: 100px;
+        font-size: 12px;
+        color: #ffffff;
+        padding: 4px 6px;
+        margin-right: 0;
+    }
+}
+</style>

+ 135 - 179
src/views/recycleOrder/detail/order-book-list.vue

@@ -1,216 +1,172 @@
 <template>
-  <SimpleTable :columns="columns" border>
-    <template #baseInfo="{ row }">
-      <div class="base-info flex justify-between">
-        <div class="base-info-left flex flex-1">
-          <el-image
-            style="width: 80px; height: 100px"
-            fit="cover"
-            src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
-          />
-          <div class="base-info-left-con flex flex-col items-start ml-3">
-            <div><el-text type="primary">作物栽培</el-text></div>
-            <div><el-text>ISBN:9787109261839</el-text></div>
-            <div class="base-info-btns flex">
-              <el-button
-                size="small"
-                color="#4f4f4f"
-                @click="handleBlackList(row)"
-                >加入黑名单</el-button
-              >
-              <el-button
-                size="small"
-                type="success"
-                @click="handleAddBookList(row)"
-                >加入回收书单</el-button
-              >
-              <el-button
-                size="small"
-                type="warning"
-                @click="handleSpecifiedDiscount(row)"
-                >指定回收折扣</el-button
-              >
-              <el-button
-                size="small"
-                color="#7728f5"
-                @click="handleModifyDiscount(row)"
-                >修改回收折扣</el-button
-              >
+    <SimpleTable :columns="columns" border>
+        <template #baseInfo="{ row }">
+            <div class="base-info flex justify-between">
+                <div class="base-info-left flex flex-1">
+                    <el-image style="width: 80px; height: 100px" fit="cover"
+                        src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
+                    <div class="base-info-left-con flex flex-col items-start ml-3">
+                        <div><el-text type="primary">作物栽培</el-text></div>
+                        <div><el-text>ISBN:9787109261839</el-text></div>
+                        <div class="base-info-btns flex">
+                            <el-button size="small" color="#4f4f4f" @click="handleBlackList(row)">加入黑名单</el-button>
+                            <el-button size="small" type="success" @click="handleAddBookList(row)">加入回收书单</el-button>
+                            <el-button size="small" type="warning"
+                                @click="handleSpecifiedDiscount(row)">指定回收折扣</el-button>
+                            <el-button size="small" color="#7728f5"
+                                @click="handleModifyDiscount(row)">修改回收折扣</el-button>
+                        </div>
+                        <div><el-text type="danger">(已回收数量:200当前库存:75)</el-text></div>
+                    </div>
+                </div>
+                <div class="base-info-right w-36 shrink-0">
+                    <div class="common-text flex">
+                        <el-text>定  价:</el-text>
+                        <el-text>¥ 46</el-text>
+                    </div>
+                    <div class="common-text flex">
+                        <el-text>回收折扣:</el-text>
+                        <el-text>¥ 0.35折</el-text>
+                    </div>
+                    <div class="common-text flex">
+                        <el-text>预估金额:</el-text>
+                        <el-text>¥ 1.61</el-text>
+                    </div>
+                    <div class="common-text flex">
+                        <el-text>销售价格:</el-text>
+                        <el-text>¥ 10.1</el-text>
+                    </div>
+                </div>
             </div>
-            <div
-              ><el-text type="danger"
-                >(已回收数量:200当前库存:75)</el-text
-              ></div
-            >
-          </div>
-        </div>
-        <div class="base-info-right w-36 shrink-0">
-          <div class="common-text flex">
-            <el-text>定  价:</el-text>
-            <el-text>¥ 46</el-text>
-          </div>
-          <div class="common-text flex">
-            <el-text>回收折扣:</el-text>
-            <el-text>¥ 0.35折</el-text>
-          </div>
-          <div class="common-text flex">
-            <el-text>预估金额:</el-text>
-            <el-text>¥ 1.61</el-text>
-          </div>
-          <div class="common-text flex">
-            <el-text>销售价格:</el-text>
-            <el-text>¥ 10.1</el-text>
-          </div>
-        </div>
-      </div>
-    </template>
-    <template #action="{ row }">
-      <div class="action-btns">
-        <el-button class="mb-10" color="#4f4f4f" @click="">审核图片</el-button>
-        <el-button
-          class="mb-10"
-          color="#a4adb3"
-          @click="handleViewUrl(row, 'dd')"
-          >查看当当</el-button
-        >
-        <el-button class="mb-10" color="#e99d42" @click="handleRecycleLog(row)"
-          >回收日志</el-button
-        >
-        <el-button
-          class="mb-10"
-          color="#f27606"
-          @click="handleViewUrl(row, 'tb')"
-          >查看淘宝</el-button
-        >
-        <el-button color="#0f7dc7" @click="handleSalesLog(row)">售价日志</el-button>
-        <el-button color="#399420" @click="handleViewUrl(row, 'db')"
-          >查看豆瓣</el-button
-        >
-      </div>
-    </template>
-    <template #auditInfo="{ row }">
-      <div class="audit-info flex justify-center">
-        <el-radio-group v-model="row.auditInfo" style="width: 120px">
-          <el-radio :value="1">品相良好</el-radio>
-          <el-radio :value="2">品相一般</el-radio>
-          <el-radio :value="3">品相极差</el-radio>
-        </el-radio-group>
-        <el-input
-          v-model="row.textarea"
-          style="width: 170px"
-          :rows="4"
-          type="textarea"
-          placeholder="请输入品相极差的原因"
-        />
-      </div>
-    </template>
-  </SimpleTable>
-  <orderSpecifiedDiscount ref="specifiedRef" />
-  <orderModifyDiscount ref="modifyRef" />
-  <orderBlacklist ref="blacklistRef" />
-  <orderRecycleLog ref="recycleLogRef" />
-  <orderSalesLog ref="salesLogRef" />
+        </template>
+        <template #action="{ row }">
+            <div class="action-btns">
+                <el-button class="mb-10" color="#4f4f4f" @click="">审核图片</el-button>
+                <el-button class="mb-10" color="#a4adb3" @click="handleViewUrl(row, 'dd')">查看当当</el-button>
+                <el-button class="mb-10" color="#e99d42" @click="handleRecycleLog(row)">回收日志</el-button>
+                <el-button class="mb-10" color="#f27606" @click="handleViewUrl(row, 'tb')">查看淘宝</el-button>
+                <el-button color="#0f7dc7" @click="handleSalesLog(row)">售价日志</el-button>
+                <el-button color="#399420" @click="handleViewUrl(row, 'db')">查看豆瓣</el-button>
+            </div>
+        </template>
+        <template #auditInfo="{ row }">
+            <div class="audit-info flex justify-center">
+                <el-radio-group v-model="row.auditInfo" style="width: 120px">
+                    <el-radio :value="1">品相良好</el-radio>
+                    <el-radio :value="2">品相一般</el-radio>
+                    <el-radio :value="3">品相极差</el-radio>
+                </el-radio-group>
+                <el-input v-model="row.textarea" style="width: 170px" :rows="4" type="textarea"
+                    placeholder="请输入品相极差的原因" />
+            </div>
+        </template>
+    </SimpleTable>
+    <orderSpecifiedDiscount ref="specifiedRef" />
+    <orderModifyDiscount ref="modifyRef" />
+    <orderBlacklist ref="blacklistRef" />
+    <orderRecycleLog ref="recycleLogRef" />
+    <orderSalesLog ref="salesLogRef" />
 </template>
 
 <script setup>
-  import { ref, reactive } from 'vue';
-  import SimpleTable from '@/components/CommonPage/SimpleTable.vue';
-  import orderSpecifiedDiscount from '@/views/recycleOrder/detail/order-specified-discount.vue';
-  import orderModifyDiscount from '@/views/recycleOrder/detail/order-modify-discount.vue';
-  import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
-  import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
-  import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
+import { ref, reactive } from 'vue';
+import SimpleTable from '@/components/CommonPage/SimpleTable.vue';
+import orderSpecifiedDiscount from '@/views/recycleOrder/detail/order-specified-discount.vue';
+import orderModifyDiscount from '@/views/recycleOrder/detail/order-modify-discount.vue';
+import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
+import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
+import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
 
-  const columns = ref([
+const columns = ref([
     {
-      type: 'index',
-      columnKey: 'index',
-      width: 60,
-      align: 'center'
+        type: 'index',
+        columnKey: 'index',
+        width: 60,
+        align: 'center'
     },
     {
-      label: '信息',
-      prop: 'baseInfo',
-      slot: 'baseInfo',
-      minWidth: 650,
-      align: 'center'
+        label: '信息',
+        prop: 'baseInfo',
+        slot: 'baseInfo',
+        minWidth: 650,
+        align: 'center'
     },
     {
-      label: '操作',
-      prop: 'action',
-      slot: 'action',
-      width: 220,
-      align: 'center'
+        label: '操作',
+        prop: 'action',
+        slot: 'action',
+        width: 220,
+        align: 'center'
     },
     { label: '数量', prop: 'number', minWidth: 90, align: 'center' },
     {
-      label: '审核信息',
-      prop: 'auditInfo',
-      slot: 'auditInfo',
-      align: 'center',
-      minWidth: 317
+        label: '审核信息',
+        prop: 'auditInfo',
+        slot: 'auditInfo',
+        align: 'center',
+        minWidth: 317
     },
     {
-      label: '审核金额',
-      prop: 'reviewedPayment',
-      align: 'center',
-      minWidth: 120
+        label: '审核金额',
+        prop: 'reviewedPayment',
+        align: 'center',
+        minWidth: 120
     }
-  ]);
+]);
 
-  //查看当当、淘宝、豆瓣链接
-  const handleViewUrl = (row, type) => {
+//查看当当、淘宝、豆瓣链接
+const handleViewUrl = (row, type) => {
     let url = '';
     if (type == 'dd') {
-      url = 'https://search.dangdang.com/?key=9787310027446&act=input';
+        url = `https://search.dangdang.com/?key=${row.isbn}&act=input`;
     } else if (type == 'tb') {
-      url =
-        'https://s.taobao.com/search?page=1&q=9787310027446&sort=sale-desc&tab=all';
+        url = `https://s.taobao.com/search?page=1&q=${row.isbn}&sort=sale-desc&tab=all`;
     } else if (type == 'db') {
-      url =
-        'https://search.douban.com/book/subject_search?search_text=9787310027446';
+        url = `https://search.douban.com/book/subject_search?search_text=${row.isbn}`;
+    } else if (type == 'kw') {
+        url = `https://search.kongfz.com/product_result/?key=${row.isbn}&status=0&_stpmt=eyJzZWFyY2hfdHlwZSI6ImFjdGl2ZSJ9`;
     }
     window.open(url, '_blank');
-  };
-  //加入回收书单
-  const handleAddBookList = (row) => {
+};
+//加入回收书单
+const handleAddBookList = (row) => {
     ElMessageBox.confirm('确认加入回收书单?', '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '关闭',
-      type: 'warning'
+        confirmButtonText: '确定',
+        cancelButtonText: '关闭',
+        type: 'warning'
     }).then(() => {
-      console.log(row, 'row');
+        console.log(row, 'row');
     });
-  };
-  //修改回收折扣
-  const modifyRef = ref();
-  const handleModifyDiscount = (row) => {
+};
+//修改回收折扣
+const modifyRef = ref();
+const handleModifyDiscount = (row) => {
     modifyRef.value?.handleOpen(row);
-  };
-  //指定回收折扣
-  const specifiedRef = ref();
-  const handleSpecifiedDiscount = (row) => {
+};
+//指定回收折扣
+const specifiedRef = ref();
+const handleSpecifiedDiscount = (row) => {
     specifiedRef.value?.handleOpen(row);
-  };
-  //加入黑名单
-  const blacklistRef = ref();
-  const handleBlackList = (row) => {
+};
+//加入黑名单
+const blacklistRef = ref();
+const handleBlackList = (row) => {
     blacklistRef.value?.handleOpen(row);
-  };
-  //查看回收日志
-  const recycleLogRef = ref();
-  const handleRecycleLog = (row) => {
+};
+//查看回收日志
+const recycleLogRef = ref();
+const handleRecycleLog = (row) => {
     recycleLogRef.value?.handleOpen(row);
-  };
-  //查看售价日志
-  const salesLogRef = ref();
-  const handleSalesLog = (row) => {
+};
+//查看售价日志
+const salesLogRef = ref();
+const handleSalesLog = (row) => {
     salesLogRef.value?.handleOpen(row);
-  };
+};
 </script>
 
 <style lang="scss">
-  .mb-10 {
+.mb-10 {
     margin-bottom: 7px;
-  }
+}
 </style>