| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <template>
- <div class="refund-item">
- <!-- Header -->
- <div class="refund-header">
- <el-checkbox v-model="item.checked" style="margin-right:12px" />
- <el-tag type="success" size="small" class="mr-2" effect="plain">
- {{ getRefundTypeText(item.refundType) }}
- </el-tag>
- <span class="mr-4 text-black-600">退款编号: {{ item.refundOrderId }}</span>
- <span class="mr-4 text-black-600">原订单编号: {{ item.originOrderId }}</span>
- <span class="mr-4 text-black-600">申请时间: {{ item.createTime }}</span>
- <span class="mr-4 text-black-600" v-if="item.cancelStatus == 2">
- <el-tag type="info" size="small">已撤销</el-tag>
- </span>
- </div>
- <!-- Body -->
- <div class="refund-body">
- <!-- Product Info (Flex 3) -->
- <div class="col-product-wrapper">
- <div v-for="(product, idx) in item.detailList" :key="idx" class="product-row">
- <div class="product-info">
- <el-image :src="product.cover" class="product-img" fit="cover" />
- <div class="product-detail">
- <div class="product-title">{{ product.bookName }}</div>
- <div class="product-isbn">
- ISBN: <span class="link">{{ product.isbn }}</span>
- <el-icon class="cursor-pointer ml-1" @click="handleCopy(product.isbn)">
- <CopyDocument />
- </el-icon>
- </div>
- <div class="product-price">
- <span class="mr-2">退回数量: {{ product.refundNum }}</span>
- <span>单价: ¥ {{ product.price }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Refund Amount (Flex 1) -->
- <div class="col-merged col-amount">
- <div class="amount">申请: ¥ {{ item.refundMoney }}</div>
- <div class="final-amount text-green-500" v-if="item.refundMoneyFinal">实退: ¥ {{ item.refundMoneyFinal }}</div>
- <div class="money-status text-xs text-gray-400 mt-1">
- {{ getMoneyStatusText(item.moneyStatus) }}
- </div>
- </div>
- <!-- Buyer (Flex 1) -->
- <div class="col-merged col-buyer">
- <div class="buyer-info">
- <el-avatar :size="30" :src="item.avatar" />
- <div class="buyer-name">{{ item.userNick }}</div>
- <div class="buyer-id text-xs text-gray-400">ID: {{ item.userId }}</div>
- </div>
- </div>
- <!-- Reason (Flex 1) -->
- <div class="col-merged col-reason">
- <div class="font-bold">{{ item.refundReason }}</div>
- <div class="text-xs text-gray-500 mt-1">货物状态: {{ getShopStatusText(item.shopStatus) }}</div>
- </div>
- <!-- Logistics (Flex 1.5) -->
- <div class="col-merged col-logistics">
- <div class="logistics-row">
- <span class="font-bold">{{ getSendTypeText(item.sendType) }}</span>
- </div>
- <div class="logistics-row" v-if="item.expressName">
- <span>{{ item.expressName }}</span>
- </div>
- <div class="logistics-row" v-if="item.waybillCode">
- <span>{{ item.waybillCode }}</span>
- <el-icon class="cursor-pointer ml-1" @click="handleCopy(item.waybillCode)">
- <CopyDocument />
- </el-icon>
- </div>
- <div class="logistics-row" v-if="item.pickupCode">
- <span>取件码: {{ item.pickupCode }}</span>
- </div>
- </div>
- <!-- Status (Flex 1) -->
- <div class="col-merged col-status">
- <div class="text-red-500 font-bold mb-1">{{ getStatusText(item.status) }}</div>
- <el-button link type="primary" size="small" @click="$emit('view-detail', item)">[查看详情]</el-button>
- </div>
- <!-- Action (Flex 1) -->
- <div class="col-merged col-action">
- <div class="action-btn text-green-500" @click="$emit('push-sms', item)">[推送短信]</div>
- <div class="action-btn text-orange-500" @click="$emit('send-packet', item)">[发红包]</div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { CopyDocument } from '@element-plus/icons-vue';
- import { EleMessage } from 'ele-admin-plus/es';
- import { useClipboard } from '@vueuse/core';
- const props = defineProps({
- item: {
- type: Object,
- required: true
- }
- });
- defineEmits(['push-sms', 'send-packet', 'view-detail']);
- const { copy } = useClipboard();
- const handleCopy = async (text) => {
- try {
- await copy(text);
- EleMessage.success('复制成功');
- } catch (e) {
- EleMessage.error('复制失败');
- }
- };
- const getRefundTypeText = (type) => {
- const map = {
- '0': '极速退款',
- '1': '退货退款',
- '2': '仅退款'
- };
- return map[type] || type;
- };
- const getStatusText = (status) => {
- const map = {
- '1': '申请退款',
- '2': '审核通过',
- '3': '审核驳回',
- '4': '超时关闭',
- '5': '卖家已发货',
- '6': '已完成'
- };
- return map[status] || status;
- };
- const getShopStatusText = (status) => {
- const map = {
- '1': '未收到货',
- '2': '已收到货'
- };
- return map[status] || '-';
- };
- const getSendTypeText = (type) => {
- const map = {
- '1': '上门取件',
- '2': '寄件点自寄',
- '3': '自行寄回'
- };
- return map[type] || '-';
- };
- const getMoneyStatusText = (status) => {
- const map = {
- '1': '未退还',
- '2': '已退还',
- '3': '已到账'
- };
- return map[status] || '未退还';
- };
- </script>
- <style lang="scss" scoped>
- .refund-item {
- border: 1px solid #ebeef5;
- margin-bottom: 15px;
- background: #fff;
- .refund-header {
- background-color: #f5f7fa;
- padding: 8px 15px;
- font-size: 13px;
- display: flex;
- align-items: center;
- border-bottom: 1px solid #ebeef5;
- }
- .refund-body {
- display: flex;
- align-items: stretch;
- .col-product-wrapper {
- flex: 3;
- display: flex;
- flex-direction: column;
- border-right: 1px solid #ebeef5;
- .product-row {
- display: flex;
- padding: 15px;
- border-bottom: 1px solid #ebeef5;
- &:last-child {
- border-bottom: none;
- }
- .product-info {
- display: flex;
- width: 100%;
- .product-img {
- width: 80px;
- height: 80px;
- margin-right: 15px;
- border-radius: 4px;
- border: 1px solid #eee;
- }
- .product-detail {
- font-size: 13px;
- flex: 1;
- .product-title {
- font-weight: 500;
- margin-bottom: 5px;
- color: #333;
- }
- .product-isbn {
- color: #666;
- margin-bottom: 3px;
- font-size: 12px;
- .link {
- color: #409eff;
- }
- }
- .product-price {
- margin-top: 5px;
- color: #333;
- }
- }
- }
- }
- }
- .col-merged {
- border-right: 1px solid #ebeef5;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 10px;
- text-align: center;
- font-size: 13px;
- &:last-child {
- border-right: none;
- }
- &.col-amount { flex: 1; }
- &.col-buyer { flex: 1; }
- &.col-reason { flex: 1; }
- &.col-logistics {
- flex: 1.5;
- align-items: flex-start;
- padding-left: 15px;
- .logistics-row {
- display: flex;
- align-items: center;
- margin-bottom: 4px;
- color: #666;
- font-size: 12px;
- }
- }
- &.col-status { flex: 1; }
- &.col-action { flex: 1; }
- }
- }
- .action-btn {
- cursor: pointer;
- margin-bottom: 5px;
- font-size: 13px;
- &:hover {
- opacity: 0.8;
- }
- }
- }
- </style>
|