|
|
@@ -1,40 +1,47 @@
|
|
|
<template>
|
|
|
- <SimpleTable :columns="columns" border>
|
|
|
+ <ele-data-table row-key="userId" :columns="columns" :data="dataList" border class="order-books">
|
|
|
<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" />
|
|
|
+ <el-image style="width: 80px; height: 100px" fit="cover" :src="row.cover" />
|
|
|
<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><el-text type="primary">{{ row.bookName }}</el-text></div>
|
|
|
+ <div><el-text>ISBN:{{ row.isbn }}</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"
|
|
|
+ <el-button size="small" color="#4f4f4f" v-if="row.bookStatus != 3"
|
|
|
+ @click="handleBlackList([row.isbn])">加入黑名单</el-button>
|
|
|
+ <el-button size="small" color="#4f4f4f" v-if="row.bookStatus == 3">已在黑名单</el-button>
|
|
|
+
|
|
|
+ <el-button size="small" type="success" v-if="row.bookStatus == 1"
|
|
|
+ @click="handleAddBookList(row)">加入回收书单</el-button>
|
|
|
+ <el-button size="small" color="#2d430a" v-if="row.bookStatus == 2">已在回收书单</el-button>
|
|
|
+
|
|
|
+ <el-button size="small" type="warning" v-if="row.settingStatus == 0"
|
|
|
@click="handleSpecifiedDiscount(row)">指定回收折扣</el-button>
|
|
|
- <el-button size="small" color="#7728f5"
|
|
|
+ <el-button size="small" color="#7728f5" v-if="row.settingStatus == 1"
|
|
|
@click="handleModifyDiscount(row)">修改回收折扣</el-button>
|
|
|
</div>
|
|
|
- <div><el-text type="danger">(已回收数量:200当前库存:75)</el-text></div>
|
|
|
+ <div><el-text type="danger">(已回收数量:{{ row.recycleNum }}当前库存:{{
|
|
|
+ row.stockNum
|
|
|
+ }})</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>
|
|
|
+ <el-text>¥ {{ row.bookPrice }}</el-text>
|
|
|
</div>
|
|
|
<div class="common-text flex">
|
|
|
<el-text>回收折扣:</el-text>
|
|
|
- <el-text>¥ 0.35折</el-text>
|
|
|
+ <el-text>¥ {{ row.recycleDiscount }}折</el-text>
|
|
|
</div>
|
|
|
<div class="common-text flex">
|
|
|
<el-text>预估金额:</el-text>
|
|
|
- <el-text>¥ 1.61</el-text>
|
|
|
+ <el-text>¥ {{ row.expectMoney }}</el-text>
|
|
|
</div>
|
|
|
<div class="common-text flex">
|
|
|
<el-text>销售价格:</el-text>
|
|
|
- <el-text>¥ 10.1</el-text>
|
|
|
+ <el-text>¥ {{ row.salePrice || '-' }}</el-text>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -51,31 +58,47 @@
|
|
|
</template>
|
|
|
<template #auditInfo="{ row }">
|
|
|
<div class="audit-info flex justify-center">
|
|
|
- <el-radio-group v-model="row.auditInfo" style="width: 120px">
|
|
|
+ <el-radio-group v-model="row.auditInfo" style="width: 120px"
|
|
|
+ :disabled="!(detail.status == 8 || detail.status == 9)">
|
|
|
<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="请输入品相极差的原因" />
|
|
|
+ <el-input v-model="row.textarea" style="width: 170px" :rows="4" type="textarea" placeholder="请输入品相极差的原因"
|
|
|
+ :disabled="!(detail.status == 8 || detail.status == 9)" />
|
|
|
</div>
|
|
|
</template>
|
|
|
- </SimpleTable>
|
|
|
- <orderSpecifiedDiscount ref="specifiedRef" />
|
|
|
- <orderModifyDiscount ref="modifyRef" />
|
|
|
- <orderBlacklist ref="blacklistRef" />
|
|
|
+ </ele-data-table>
|
|
|
+ <orderModifyDiscount ref="specifiedRef" @refresh="handleRefresh('specified')" />
|
|
|
+ <setParams ref="modifyRef" @refresh="handleRefresh('modify')" />
|
|
|
+ <orderBlacklist ref="blacklistRef" @refresh="handleRefresh('blacklist')" />
|
|
|
<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 orderModifyDiscount from '@/views/recycle/components/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 setParams from '@/views/recycle/components/set-params.vue';
|
|
|
+import request from '@/utils/request';
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ detail: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ detailVoList: []
|
|
|
+ })
|
|
|
+ }
|
|
|
+});
|
|
|
+const dataList = ref([]);
|
|
|
+watch(() => props.detail.detailVoList, (newVal) => {
|
|
|
+ dataList.value = newVal;
|
|
|
+}, { deep: true });
|
|
|
+
|
|
|
+const emit = defineEmits(['update:detail', 'refresh']);
|
|
|
|
|
|
const columns = ref([
|
|
|
{
|
|
|
@@ -88,7 +111,7 @@ const columns = ref([
|
|
|
label: '信息',
|
|
|
prop: 'baseInfo',
|
|
|
slot: 'baseInfo',
|
|
|
- minWidth: 650,
|
|
|
+ minWidth: 560,
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -108,9 +131,12 @@ const columns = ref([
|
|
|
},
|
|
|
{
|
|
|
label: '审核金额',
|
|
|
- prop: 'reviewedPayment',
|
|
|
+ prop: 'finalMoney',
|
|
|
align: 'center',
|
|
|
- minWidth: 120
|
|
|
+ minWidth: 100,
|
|
|
+ render: (row) => {
|
|
|
+ return row.finalMoney ? `¥ ${row.finalMoney}` : '待核算';
|
|
|
+ }
|
|
|
}
|
|
|
]);
|
|
|
|
|
|
@@ -135,22 +161,37 @@ const handleAddBookList = (row) => {
|
|
|
cancelButtonText: '关闭',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- console.log(row, 'row');
|
|
|
+ request.post('/book/bookRecycleInfo/addIn', {
|
|
|
+ isbnList: [row.isbn]
|
|
|
+ }).then(() => {
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ // 更新列表数据
|
|
|
+ const index = props.detail.detailVoList.findIndex(item => item.isbn === row.isbn);
|
|
|
+ if (index > -1) {
|
|
|
+ const newList = [...props.detail.detailVoList];
|
|
|
+ newList[index] = { ...newList[index], bookStatus: 2 };
|
|
|
+ dataList.value = newList;
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
};
|
|
|
+const currentRow = ref(null);
|
|
|
//修改回收折扣
|
|
|
const modifyRef = ref();
|
|
|
const handleModifyDiscount = (row) => {
|
|
|
+ currentRow.value = row;
|
|
|
modifyRef.value?.handleOpen(row);
|
|
|
};
|
|
|
//指定回收折扣
|
|
|
const specifiedRef = ref();
|
|
|
const handleSpecifiedDiscount = (row) => {
|
|
|
+ currentRow.value = row;
|
|
|
specifiedRef.value?.handleOpen(row);
|
|
|
};
|
|
|
//加入黑名单
|
|
|
const blacklistRef = ref();
|
|
|
const handleBlackList = (row) => {
|
|
|
+ currentRow.value = row;
|
|
|
blacklistRef.value?.handleOpen(row);
|
|
|
};
|
|
|
//查看回收日志
|
|
|
@@ -163,10 +204,37 @@ const salesLogRef = ref();
|
|
|
const handleSalesLog = (row) => {
|
|
|
salesLogRef.value?.handleOpen(row);
|
|
|
};
|
|
|
+
|
|
|
+const handleRefresh = (type) => {
|
|
|
+ if (!currentRow.value) return;
|
|
|
+ const index = dataList.value.findIndex(item => item.isbn === currentRow.value.isbn);
|
|
|
+ if (index > -1) {
|
|
|
+ const newList = [...dataList.value];
|
|
|
+ if (type === 'specified' || type === 'modify') {
|
|
|
+ newList[index] = { ...newList[index], settingStatus: 1 };
|
|
|
+ } else if (type === 'blacklist') {
|
|
|
+ newList[index] = { ...newList[index], bookStatus: 3 };
|
|
|
+ }
|
|
|
+ dataList.value = newList;
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
.mb-10 {
|
|
|
margin-bottom: 7px;
|
|
|
}
|
|
|
+
|
|
|
+.order-books {
|
|
|
+ .action-btns {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 10px;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ margin: 0;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|