|
|
@@ -1,264 +1,209 @@
|
|
|
<template>
|
|
|
- <ele-page flex-table>
|
|
|
- <!-- 搜索表单 -->
|
|
|
- <return-search @search="reload" />
|
|
|
- <ele-card :body-style="{ paddingTop: '8px' }" flex-table>
|
|
|
- <!-- 表格 -->
|
|
|
- <ele-pro-table
|
|
|
- ref="tableRef"
|
|
|
- row-key="postId"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- v-model:selections="selections"
|
|
|
- highlight-current-row
|
|
|
- :export-config="{ fileName: '需退回订单' }"
|
|
|
- cache-key="needReturnedTable"
|
|
|
- :tools="false"
|
|
|
- >
|
|
|
- <template #status="{ row }">
|
|
|
- <dict-data
|
|
|
- code="sys_normal_disable"
|
|
|
- type="tag"
|
|
|
- :model-value="row.status"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #isPush="{ row }">
|
|
|
- <dict-data code="is_push" type="tag" :model-value="row.status" />
|
|
|
- </template>
|
|
|
- <template #isFirstOrder="{ row }">
|
|
|
- <dict-data
|
|
|
- code="is_first_order"
|
|
|
- type="tag"
|
|
|
- :model-value="row.status"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #orderNumber="{ row }">
|
|
|
- <order-number :row="row" isReturn></order-number>
|
|
|
- </template>
|
|
|
- <template #customer="{ row }">
|
|
|
- <order-customer :row="row" isReturn></order-customer>
|
|
|
- </template>
|
|
|
- <template #amount="{ row }">
|
|
|
- <div class="common-text flex flex-col">
|
|
|
- <el-text>余额:</el-text>
|
|
|
- <el-text>邮费:¥ 0 </el-text>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #remarks="{ row }">
|
|
|
- <el-popover trigger="hover" width="240px">
|
|
|
- <template #reference>
|
|
|
- <el-button
|
|
|
- :icon="Flag"
|
|
|
- link
|
|
|
- style="font-size: 20px"
|
|
|
- @click="handleRemarks(row)"
|
|
|
- >
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <orderTimeline
|
|
|
- :records="activities"
|
|
|
- title="备注历史记录"
|
|
|
- ></orderTimeline>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <!-- 搜索表单 -->
|
|
|
+ <return-search @search="reload" />
|
|
|
+ <ele-card :body-style="{ paddingTop: '8px' }" flex-table>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <ele-pro-table ref="tableRef" row-key="postId" :columns="columns" :datasource="datasource"
|
|
|
+ :show-overflow-tooltip="true" v-model:selections="selections" highlight-current-row
|
|
|
+ :export-config="{ fileName: '需退回订单' }" cache-key="needReturnedTable" :tools="false">
|
|
|
+ <template #status="{ row }">
|
|
|
+ <dict-data code="refund_status" type="text" :model-value="row.status" />
|
|
|
+ </template>
|
|
|
+ <template #isPush="{ row }">
|
|
|
+ <el-tag type="success" v-if="row.checkStatus == 1">已推送</el-tag>
|
|
|
+ <el-tag type="danger" v-else>未推送</el-tag>
|
|
|
+ </template>
|
|
|
+ <template #isFirstOrder="{ row }">
|
|
|
+ <dict-data code="is_first_order" type="tag" :model-value="row.firstOrder" />
|
|
|
+ </template>
|
|
|
+ <template #orderNumber="{ row }">
|
|
|
+ <order-number :row="row" isReturn></order-number>
|
|
|
+ </template>
|
|
|
+ <template #customer="{ row }">
|
|
|
+ <refund-customer :row="row"></refund-customer>
|
|
|
+ </template>
|
|
|
+ <template #amount="{ row }">
|
|
|
+ <div class="common-text flex flex-col">
|
|
|
+ <el-text>余额</el-text>
|
|
|
+ <el-text>邮费:¥ {{ row.expressMoney || '0' }} </el-text>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #remarks="{ row }">
|
|
|
+ <el-popover trigger="hover" width="240px" @show="handleShowPopover(row)" @hide="showOrderId = ''">
|
|
|
+ <template #reference>
|
|
|
+ <el-icon style="cursor: pointer" :size="24" :color="row.remarkLabel || '#777777'"
|
|
|
+ @click="handleRemarks(row)">
|
|
|
+ <Flag />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ <orderTimeline :orderId="showOrderId" title="备注历史记录"></orderTimeline>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #action="{ row }">
|
|
|
- <div>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-permission="'recycleOrder:needReturned:detail'"
|
|
|
- @click="toOrderDetail(row)"
|
|
|
- >
|
|
|
- [订单详情]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- color="#7728f5"
|
|
|
- link
|
|
|
- plain
|
|
|
- v-permission="'recycleOrder:needReturned:manualDelivery'"
|
|
|
- @click="handleManualDelivery(row)"
|
|
|
- >
|
|
|
- [手工发货]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-permission="'recycleOrder:needReturned:cancel'"
|
|
|
- @click="cancelOrder(row)"
|
|
|
- >
|
|
|
- [取消订单]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- link
|
|
|
- v-permission="'recycleOrder:needReturned:log'"
|
|
|
- @click="openOrderLog(row)"
|
|
|
- >
|
|
|
- [订单日志]
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- </ele-card>
|
|
|
+ <template #action="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-button type="success" link v-permission="'recycleOrder:needReturned:detail'"
|
|
|
+ @click="toOrderDetail(row)">
|
|
|
+ [订单详情]
|
|
|
+ </el-button>
|
|
|
+ <el-button color="#7728f5" link plain v-permission="'recycleOrder:needReturned:manualDelivery'"
|
|
|
+ @click="handleManualDelivery(row)">
|
|
|
+ [手工发货]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-permission="'recycleOrder:needReturned:cancel'"
|
|
|
+ @click="cancelOrder(row)">
|
|
|
+ [取消订单]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" link v-permission="'recycleOrder:needReturned:log'"
|
|
|
+ @click="openOrderLog(row)">
|
|
|
+ [订单日志]
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </ele-card>
|
|
|
|
|
|
- <slot></slot>
|
|
|
- <orderRemarks ref="remarksRef" />
|
|
|
- <orderLog ref="logRef" />
|
|
|
- </ele-page>
|
|
|
+ <slot></slot>
|
|
|
+ <orderRemarks ref="remarksRef" />
|
|
|
+ <orderLog ref="logRef" />
|
|
|
+ </ele-page>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, getCurrentInstance } from 'vue';
|
|
|
- import { ElMessageBox } from 'element-plus/es';
|
|
|
- import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
|
|
|
- import returnSearch from './return-search.vue';
|
|
|
- import OrderNumber from '@/views/recycleOrder/components/order-number.vue';
|
|
|
- import OrderCustomer from '@/views/recycleOrder/components/order-customer.vue';
|
|
|
- import { useDictData } from '@/utils/use-dict-data';
|
|
|
- import orderRemarks from '@/views/recycleOrder/components/order-remarks.vue';
|
|
|
- import orderTimeline from '@/views/recycleOrder/components/order-timeline.vue';
|
|
|
- import orderLog from '@/views/recycleOrder/components/order-log.vue'
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
- let router = useRouter();
|
|
|
+import { ref, getCurrentInstance } from 'vue';
|
|
|
+import { ElMessageBox } from 'element-plus/es';
|
|
|
+import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
|
|
|
+import returnSearch from './return-search.vue';
|
|
|
+import OrderNumber from '@/views/recycleOrder/components/order-number.vue';
|
|
|
+import RefundCustomer from '@/views/recycleOrder/components/refund-customer.vue';
|
|
|
+import { useDictData } from '@/utils/use-dict-data';
|
|
|
+import orderRemarks from '@/views/recycleOrder/components/order-remarks.vue';
|
|
|
+import orderTimeline from '@/views/recycleOrder/components/order-timeline.vue';
|
|
|
+import orderLog from '@/views/recycleOrder/components/order-log.vue'
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+let router = useRouter();
|
|
|
|
|
|
- let props = defineProps({
|
|
|
+let props = defineProps({
|
|
|
pageConfig: {
|
|
|
- type: Object,
|
|
|
- default: () => ({
|
|
|
- cacheKey: 'recycleOrderTable',
|
|
|
- fileName: '需退回订单'
|
|
|
- })
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ cacheKey: 'recycleOrderTable',
|
|
|
+ fileName: '需退回订单'
|
|
|
+ })
|
|
|
},
|
|
|
- pageUrl: { type: String, default: '/system/post/list' },
|
|
|
+ pageUrl: { type: String, default: '/order/orderInfo/refund/pageList' },
|
|
|
exportUrl: { type: String, default: '/system/post/export' }
|
|
|
- });
|
|
|
- let { proxy } = getCurrentInstance();
|
|
|
- /** 字典数据 */
|
|
|
- const [statusDicts] = useDictData(['sys_normal_disable']);
|
|
|
+});
|
|
|
+let { proxy } = getCurrentInstance();
|
|
|
+/** 字典数据 */
|
|
|
+const [statusDicts] = useDictData(['sys_normal_disable']);
|
|
|
|
|
|
- /** 表格实例 */
|
|
|
- const tableRef = ref(null);
|
|
|
+/** 表格实例 */
|
|
|
+const tableRef = ref(null);
|
|
|
|
|
|
- /** 表格列配置 */
|
|
|
- const columns = ref([
|
|
|
+/** 表格列配置 */
|
|
|
+const columns = ref([
|
|
|
{
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- width: 50,
|
|
|
- align: 'center',
|
|
|
- fixed: 'left'
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
},
|
|
|
- { label: '单号', prop: 'orderNumber', slot: 'orderNumber', minWidth: 180 },
|
|
|
- { label: '客户', prop: 'customer', slot: 'customer', minWidth: 380 },
|
|
|
- { label: '金额', prop: 'amount', slot: 'amount', minWidth: 100 },
|
|
|
- { label: '是否推送', prop: 'isPush', slot: 'isPush' },
|
|
|
+ { label: '单号', prop: 'refundOrderId', slot: 'orderNumber', minWidth: 180 },
|
|
|
+ { label: '客户', prop: 'userNick', slot: 'customer', minWidth: 380 },
|
|
|
+ { label: '金额', prop: 'balanceMoney', slot: 'amount', minWidth: 100 },
|
|
|
+ { label: '是否推送', prop: 'plat', slot: 'isPush' },
|
|
|
{
|
|
|
- label: '订单状态',
|
|
|
- prop: 'status',
|
|
|
- slot: 'status',
|
|
|
- formatter: (row) =>
|
|
|
- statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
|
|
|
+ label: '订单状态',
|
|
|
+ prop: 'status',
|
|
|
+ slot: 'status',
|
|
|
+ formatter: (row) =>
|
|
|
+ statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
|
|
|
},
|
|
|
{
|
|
|
- label: '入库状态',
|
|
|
- prop: 'status',
|
|
|
- slot: 'status',
|
|
|
- formatter: (row) =>
|
|
|
- statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
|
|
|
+ label: '入库状态',
|
|
|
+ prop: 'status',
|
|
|
+ formatter: (row) => row.stockStatus == 1 ? '已入库' : '-'
|
|
|
},
|
|
|
- { label: '是否首单', prop: 'isFirstOrder', slot: 'isFirstOrder' },
|
|
|
- { label: '备注', prop: 'remarks', slot: 'remarks' },
|
|
|
+ { label: '是否首单', prop: 'firstOrder', slot: 'isFirstOrder' },
|
|
|
+ { label: '备注', prop: 'remarkLabel', slot: 'remarks' },
|
|
|
{
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 120,
|
|
|
- align: 'center',
|
|
|
- slot: 'action',
|
|
|
- hideInPrint: true,
|
|
|
- hideInExport: true
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'action',
|
|
|
+ hideInPrint: true,
|
|
|
+ hideInExport: true
|
|
|
}
|
|
|
- ]);
|
|
|
+]);
|
|
|
|
|
|
- /** 表格选中数据 */
|
|
|
- const selections = ref([]);
|
|
|
+/** 表格选中数据 */
|
|
|
+const selections = ref([]);
|
|
|
|
|
|
- /** 当前编辑数据 */
|
|
|
- const current = ref(null);
|
|
|
+/** 当前编辑数据 */
|
|
|
+const current = ref(null);
|
|
|
|
|
|
- /** 是否显示编辑弹窗 */
|
|
|
- const showEdit = ref(false);
|
|
|
+/** 是否显示编辑弹窗 */
|
|
|
+const showEdit = ref(false);
|
|
|
|
|
|
- async function queryPage(params) {
|
|
|
+async function queryPage(params) {
|
|
|
const res = await proxy.$http.get(props.pageUrl, { params });
|
|
|
if (res.data.code === 200) {
|
|
|
- return res.data;
|
|
|
+ return res.data;
|
|
|
}
|
|
|
return Promise.reject(new Error(res.data.msg));
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
- /** 表格数据源 */
|
|
|
- const datasource = ({ pages, where, orders }) => {
|
|
|
+/** 表格数据源 */
|
|
|
+const datasource = ({ pages, where, orders }) => {
|
|
|
return queryPage({ ...where, ...orders, ...pages });
|
|
|
- };
|
|
|
+};
|
|
|
|
|
|
- /** 搜索 */
|
|
|
- const reload = (where) => {
|
|
|
+/** 搜索 */
|
|
|
+const reload = (where) => {
|
|
|
tableRef.value?.reload?.({ page: 1, where });
|
|
|
- };
|
|
|
+};
|
|
|
|
|
|
- //订单详情
|
|
|
- function toOrderDetail(row) {
|
|
|
+//订单详情
|
|
|
+function toOrderDetail(row) {
|
|
|
router.push({ path: '/recycleOrder/detail', query: { id: row.postId } });
|
|
|
- }
|
|
|
- function messageBoxConfirm({ message, url, row }) {
|
|
|
+}
|
|
|
+function messageBoxConfirm({ message, url, row }) {
|
|
|
ElMessageBox.confirm(message, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '关闭',
|
|
|
- type: 'warning'
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '关闭',
|
|
|
+ type: 'warning'
|
|
|
}).then(() => {
|
|
|
- console.log(row, 'row');
|
|
|
+ console.log(row, 'row');
|
|
|
});
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
- //取消订单
|
|
|
- function cancelOrder(row) {
|
|
|
+//取消订单
|
|
|
+function cancelOrder(row) {
|
|
|
messageBoxConfirm({ message: '确认取消?', url: '', row });
|
|
|
- }
|
|
|
- //人工发货
|
|
|
- function handleManualDelivery(row) {
|
|
|
+}
|
|
|
+//人工发货
|
|
|
+function handleManualDelivery(row) {
|
|
|
messageBoxConfirm({ message: '确认人工发货?', url: '', row });
|
|
|
- }
|
|
|
- //订单日志
|
|
|
- const logRef = ref(null);
|
|
|
- const openOrderLog = (row) => {
|
|
|
+}
|
|
|
+//订单日志
|
|
|
+const logRef = ref(null);
|
|
|
+const openOrderLog = (row) => {
|
|
|
logRef.value?.handleOpen(row);
|
|
|
- };
|
|
|
+};
|
|
|
|
|
|
- //修改备注
|
|
|
- const remarksRef = ref(null);
|
|
|
- function handleRemarks(row) {
|
|
|
+//修改备注
|
|
|
+const remarksRef = ref(null);
|
|
|
+function handleRemarks(row) {
|
|
|
remarksRef.value?.handleOpen(row);
|
|
|
- }
|
|
|
- const activities = [
|
|
|
- {
|
|
|
- content: 'Event start',
|
|
|
- timestamp: '2018-04-15',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
- },
|
|
|
- {
|
|
|
- content: 'Approved',
|
|
|
- timestamp: '2018-04-13',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
- },
|
|
|
- {
|
|
|
- content: 'Success',
|
|
|
- timestamp: '2018-04-11',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
- }
|
|
|
- ];
|
|
|
+}
|
|
|
+
|
|
|
+//备注弹窗显示
|
|
|
+const showOrderId = ref();
|
|
|
+function handleShowPopover(row) {
|
|
|
+ showOrderId.value = row.originOrderId;
|
|
|
+}
|
|
|
</script>
|