|
|
@@ -1,434 +1,391 @@
|
|
|
<template>
|
|
|
- <ele-page flex-table>
|
|
|
- <!-- 搜索表单 -->
|
|
|
- <order-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: pageConfig.fileName }"
|
|
|
- :cache-key="pageConfig.cacheKey"
|
|
|
- >
|
|
|
- <template #toolbar>
|
|
|
- <slot name="toolbar"></slot>
|
|
|
- </template>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <!-- 搜索表单 -->
|
|
|
+ <order-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: pageConfig.fileName }" :cache-key="pageConfig.cacheKey">
|
|
|
+ <template #toolbar>
|
|
|
+ <slot name="toolbar"></slot>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #status="{ row }">
|
|
|
- <dict-data
|
|
|
- code="sys_normal_disable"
|
|
|
- type="tag"
|
|
|
- :model-value="row.status"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #orderNumber="{ row }">
|
|
|
- <order-number :row="row"></order-number>
|
|
|
- </template>
|
|
|
- <template #customer="{ row }">
|
|
|
- <order-customer :row="row"></order-customer>
|
|
|
- </template>
|
|
|
- <template #amount="{ row }">
|
|
|
- <order-amount :row="row"></order-amount>
|
|
|
- </template>
|
|
|
- <template #time="{ row }">
|
|
|
- <order-time :row="row"></order-time>
|
|
|
- </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>
|
|
|
+ <template #status="{ row }">
|
|
|
+ <el-tag type="danger" v-if="row.cancelStatus == 1">已取消</el-tag>
|
|
|
+ <dict-data v-else code="order_status" type="tag" :model-value="row.status" />
|
|
|
+ </template>
|
|
|
+ <template #orderNumber="{ row }">
|
|
|
+ <order-number :row="row"></order-number>
|
|
|
+ </template>
|
|
|
+ <template #customer="{ row }">
|
|
|
+ <order-customer :row="row"></order-customer>
|
|
|
+ </template>
|
|
|
+ <template #amount="{ row }">
|
|
|
+ <order-amount :row="row"></order-amount>
|
|
|
+ </template>
|
|
|
+ <template #time="{ row }">
|
|
|
+ <order-time :row="row"></order-time>
|
|
|
+ </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>
|
|
|
|
|
|
- <template #action="{ row }">
|
|
|
- <div>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-permission="usePermission('detail')"
|
|
|
- @click="toOrderDetail(row)"
|
|
|
- >
|
|
|
- [订单详情]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- link
|
|
|
- v-permission="usePermission('log')"
|
|
|
- @click="openOrderLog(row)"
|
|
|
- >
|
|
|
- [订单日志]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="row.status == 2"
|
|
|
- v-permission="usePermission('audit')"
|
|
|
- @click="cancelOrder(row)"
|
|
|
- >
|
|
|
- [初步审核]
|
|
|
- </el-button>
|
|
|
- <!-- 3 已初审-带上门取件 5已揽件-待签收 6已签收-待确认到货 -->
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="[3, 5, 6].includes(row.status)"
|
|
|
- v-permission="usePermission('cancel')"
|
|
|
- @click="cancelOrder(row)"
|
|
|
- >
|
|
|
- [取消订单]
|
|
|
- </el-button>
|
|
|
- <!-- 3 已初审-带上门取件 5已揽件-待签收 6已签收-待确认到货 8待回收审核 9审核未提交 10待付款 -->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- v-if="[3, 5, 6, 8, 9, 10].includes(row.status)"
|
|
|
- v-permission="usePermission('fallback')"
|
|
|
- @click="fallbackOrder(row)"
|
|
|
- >
|
|
|
- [回退状态]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="row.status == 3"
|
|
|
- v-permission="usePermission('materialPickup')"
|
|
|
- @click="materialPickup(row)"
|
|
|
- >
|
|
|
- [物流揽件]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="row.status == 5"
|
|
|
- v-permission="usePermission('receive')"
|
|
|
- @click="materialPickup(row)"
|
|
|
- >
|
|
|
- [物流签收]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="row.status == 6"
|
|
|
- v-permission="usePermission('confirmReceipt')"
|
|
|
- @click="materialPickup(row)"
|
|
|
- >
|
|
|
- [确认收货]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="[8, 9].includes(row.status)"
|
|
|
- v-permission="usePermission('arrivalAudit')"
|
|
|
- @click="handleArrivalAudit(row)"
|
|
|
- >
|
|
|
- [到货审核]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="[8, 9, 10, 11].includes(row.status)"
|
|
|
- v-permission="usePermission('auditScreenshot')"
|
|
|
- @click="handleAuditScreenshot(row)"
|
|
|
- >
|
|
|
- [审核截图]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="row.status == 10"
|
|
|
- v-permission="usePermission('payment')"
|
|
|
- @click="handleBatchPayment(row)"
|
|
|
- >
|
|
|
- [支付书款]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="row.status == 11"
|
|
|
- v-permission="usePermission('afterSalesPayment')"
|
|
|
- @click="handleAfterSalesPayment(row)"
|
|
|
- >
|
|
|
- [售后补款]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- link
|
|
|
- v-permission="usePermission('userTag')"
|
|
|
- @click="openEditUserTag(row)"
|
|
|
- >
|
|
|
- [用户标签]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="row.status == 2"
|
|
|
- v-permission="usePermission('modifyAddress')"
|
|
|
- @click="cancelOrder(row)"
|
|
|
- >
|
|
|
- [修改地址]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- link
|
|
|
- v-if="[8, 9, 10, 11].includes(row.status)"
|
|
|
- v-permission="usePermission('sendSMS')"
|
|
|
- @click="handleSendSMS(row)"
|
|
|
- >
|
|
|
- [推送短信]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- link
|
|
|
- v-if="[8, 9, 10].includes(row.status)"
|
|
|
- v-permission="usePermission('smsLog')"
|
|
|
- @click="handleSmsLog(row)"
|
|
|
- >
|
|
|
- [短信记录]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- color="#7728f5"
|
|
|
- link
|
|
|
- plain
|
|
|
- v-if="row.status == 11"
|
|
|
- v-permission="usePermission('applyForOrderClaim')"
|
|
|
- @click="applyForOrderClaim(row)"
|
|
|
- >
|
|
|
- [申请订单理赔]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- color="#7728f5"
|
|
|
- link
|
|
|
- plain
|
|
|
- v-if="[7].includes(row.status)"
|
|
|
- v-permission="usePermission('applyForOrderRestore')"
|
|
|
- @click="handleApplyForOrderRestore(row)"
|
|
|
- >
|
|
|
- [申请恢复订单]
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="[5, 6].includes(row.status)"
|
|
|
- v-permission="usePermission('interception')"
|
|
|
- @click="applyForInterception(row)"
|
|
|
- >
|
|
|
- [申请拦截退回]
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- </ele-card>
|
|
|
+ <template #action="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-button type="success" link v-permission="usePermission('detail')"
|
|
|
+ @click="toOrderDetail(row)">
|
|
|
+ [订单详情]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" link v-permission="usePermission('log')" @click="openOrderLog(row)">
|
|
|
+ [订单日志]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-if="row.status == 2" v-permission="usePermission('audit')"
|
|
|
+ @click="handleFirstCheck(row)">
|
|
|
+ [初步审核]
|
|
|
+ </el-button>
|
|
|
+ <!-- 3 已初审-带上门取件 5已揽件-待签收 6已签收-待确认到货 -->
|
|
|
+ <el-button type="danger" link v-if="[3, 5, 6].includes(row.status)"
|
|
|
+ v-permission="usePermission('cancel')" @click="cancelOrder(row)">
|
|
|
+ [取消订单]
|
|
|
+ </el-button>
|
|
|
+ <!-- 3 已初审-带上门取件 5已揽件-待签收 6已签收-待确认到货 8待回收审核 9审核未提交 10待付款 -->
|
|
|
+ <el-button type="primary" link v-if="[3, 5, 6, 8, 9, 10].includes(row.status)"
|
|
|
+ v-permission="usePermission('fallback')" @click="fallbackOrder(row)">
|
|
|
+ [回退状态]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="row.status == 3"
|
|
|
+ v-permission="usePermission('materialPickup')" @click="materialPickup(row)">
|
|
|
+ [物流揽件]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="row.status == 5" v-permission="usePermission('receive')"
|
|
|
+ @click="materialPickup(row)">
|
|
|
+ [物流签收]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="row.status == 6"
|
|
|
+ v-permission="usePermission('confirmReceipt')" @click="materialPickup(row)">
|
|
|
+ [确认收货]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="[8, 9].includes(row.status)"
|
|
|
+ v-permission="usePermission('arrivalAudit')" @click="handleArrivalAudit(row)">
|
|
|
+ [到货审核]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-if="[8, 9, 10, 11].includes(row.status)"
|
|
|
+ v-permission="usePermission('auditScreenshot')" @click="handleAuditScreenshot(row)">
|
|
|
+ [审核截图]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-if="row.status == 10" v-permission="usePermission('payment')"
|
|
|
+ @click="handleBatchPayment(row)">
|
|
|
+ [支付书款]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-if="row.status == 11"
|
|
|
+ v-permission="usePermission('afterSalesPayment')" @click="handleAfterSalesPayment(row)">
|
|
|
+ [售后补款]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" link v-permission="usePermission('userTag')"
|
|
|
+ @click="openEditUserTag(row)">
|
|
|
+ [用户标签]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="row.status == 2"
|
|
|
+ v-permission="usePermission('modifyAddress')" @click="handleModifyAddress(row)">
|
|
|
+ [修改地址]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" link v-if="[8, 9, 10, 11].includes(row.status)"
|
|
|
+ v-permission="usePermission('sendSMS')" @click="handleSendSMS(row)">
|
|
|
+ [推送短信]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="info" link v-if="[8, 9, 10].includes(row.status)"
|
|
|
+ v-permission="usePermission('smsLog')" @click="handleSmsLog(row)">
|
|
|
+ [短信记录]
|
|
|
+ </el-button>
|
|
|
+ <el-button color="#7728f5" link plain v-if="row.status == 11"
|
|
|
+ v-permission="usePermission('applyForOrderClaim')" @click="applyForOrderClaim(row)">
|
|
|
+ [申请订单理赔]
|
|
|
+ </el-button>
|
|
|
+ <el-button color="#7728f5" link plain v-if="row.cancelStatus == 1"
|
|
|
+ v-permission="usePermission('applyForOrderRestore')"
|
|
|
+ @click="handleApplyForOrderRestore(row)">
|
|
|
+ [申请恢复订单]
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" link v-if="[5, 6].includes(row.status)"
|
|
|
+ v-permission="usePermission('interception')" @click="applyForInterception(row)">
|
|
|
+ [申请拦截退回]
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </ele-card>
|
|
|
|
|
|
- <slot></slot>
|
|
|
- <orderRemarks ref="remarksRef" />
|
|
|
- </ele-page>
|
|
|
+ <slot></slot>
|
|
|
+ <!-- 备注 -->
|
|
|
+ <orderRemarks ref="remarksRef" />
|
|
|
+ <!-- 初审 -->
|
|
|
+ <firstCheckModal ref="firstCheckRef" />
|
|
|
+ <!-- 修改地址 -->
|
|
|
+ <modifyAddress ref="modifyAddressRef" />
|
|
|
+ <!-- 订单日志 -->
|
|
|
+ <orderLog ref="orderLogRef" />
|
|
|
+ <!-- 用户标签 -->
|
|
|
+ <userBindTag ref="userTagRef" />
|
|
|
+ <!-- 用户详情 -->
|
|
|
+ <orderDetail ref="orderDetailRef" />
|
|
|
+ </ele-page>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, getCurrentInstance } from 'vue';
|
|
|
- import { ElMessageBox } from 'element-plus/es';
|
|
|
- import { EleMessage } from 'ele-admin-plus/es';
|
|
|
- import { DownloadOutlined } from '@/components/icons';
|
|
|
- import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
|
|
|
- import OrderSearch from '../components/order-search.vue';
|
|
|
- import OrderNumber from '@/views/recycleOrder/components/order-number.vue';
|
|
|
- import OrderCustomer from '@/views/recycleOrder/components/order-customer.vue';
|
|
|
- import OrderAmount from '@/views/recycleOrder/components/order-amount.vue';
|
|
|
- import OrderTime from '@/views/recycleOrder/components/order-time.vue';
|
|
|
- import { useDictData } from '@/utils/use-dict-data';
|
|
|
- import { download, toFormData, checkDownloadRes } from '@/utils/common';
|
|
|
- import orderRemarks from '@/views/recycleOrder/components/order-remarks.vue';
|
|
|
- import orderTimeline from '@/views/recycleOrder/components/order-timeline.vue';
|
|
|
+import { ref, getCurrentInstance } from 'vue';
|
|
|
+import { ElMessageBox } from 'element-plus/es';
|
|
|
+import { EleMessage } from 'ele-admin-plus/es';
|
|
|
+import { DownloadOutlined } from '@/components/icons';
|
|
|
+import { Flag, ChatDotSquare } from '@element-plus/icons-vue';
|
|
|
+import OrderSearch from '../components/order-search.vue';
|
|
|
+import OrderNumber from '@/views/recycleOrder/components/order-number.vue';
|
|
|
+import OrderCustomer from '@/views/recycleOrder/components/order-customer.vue';
|
|
|
+import OrderAmount from '@/views/recycleOrder/components/order-amount.vue';
|
|
|
+import OrderTime from '@/views/recycleOrder/components/order-time.vue';
|
|
|
+import { useDictData } from '@/utils/use-dict-data';
|
|
|
+import { download, toFormData, checkDownloadRes } from '@/utils/common';
|
|
|
+import orderRemarks from '@/views/recycleOrder/components/order-remarks.vue';
|
|
|
+import orderTimeline from '@/views/recycleOrder/components/order-timeline.vue';
|
|
|
+import firstCheckModal from '@/views/recycleOrder/components/first-check-modal.vue';
|
|
|
+import modifyAddress from '@/views/recycleOrder/components/modify-address.vue';
|
|
|
+//订单日志
|
|
|
+import orderLog from '@/views/recycleOrder/components/order-log.vue';
|
|
|
+//用户标签
|
|
|
+import userBindTag from '@/views/recycleOrder/components/user-bind-tag.vue';
|
|
|
+//用户详情
|
|
|
+import orderDetail from '@/views/recycleOrder/components/order-detail.vue';
|
|
|
|
|
|
- let props = defineProps({
|
|
|
+
|
|
|
+let props = defineProps({
|
|
|
pageConfig: {
|
|
|
- type: Object,
|
|
|
- default: () => ({
|
|
|
- cacheKey: 'recycleOrderTable',
|
|
|
- fileName: '回收订单查询'
|
|
|
- })
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ cacheKey: 'recycleOrderTable',
|
|
|
+ pageUrl: '/order/orderInfo/pageList',
|
|
|
+ fileName: '回收订单查询',
|
|
|
+ exportUrl: '/order/orderInfo/export',
|
|
|
+ where: {}
|
|
|
+ })
|
|
|
},
|
|
|
- pageUrl: { type: String, default: '/system/post/list' },
|
|
|
exportUrl: { type: String, default: '/system/post/export' },
|
|
|
permissionKey: { type: String, default: 'search' }
|
|
|
- });
|
|
|
- const usePermission = computed(() => (opts) => {
|
|
|
+});
|
|
|
+const usePermission = computed(() => (opts) => {
|
|
|
return `recycleOrder:${props.permissionKey}:${opts}`;
|
|
|
- });
|
|
|
+});
|
|
|
|
|
|
- let { proxy } = getCurrentInstance();
|
|
|
- /** 字典数据 */
|
|
|
- const [statusDicts] = useDictData(['sys_normal_disable']);
|
|
|
+let { proxy } = getCurrentInstance();
|
|
|
+/** 字典数据 */
|
|
|
+const [statusDicts] = useDictData(['order_status']);
|
|
|
|
|
|
- /** 表格实例 */
|
|
|
- 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: 'orderNumber', slot: 'orderNumber', minWidth: 230 },
|
|
|
{ label: '客户', prop: 'customer', slot: 'customer', minWidth: 360 },
|
|
|
{ label: '金额', prop: 'amount', slot: 'amount', minWidth: 160 },
|
|
|
{
|
|
|
- label: '状态',
|
|
|
- prop: 'status',
|
|
|
- slot: 'status',
|
|
|
- formatter: (row) =>
|
|
|
- statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ slot: 'status',
|
|
|
+ width: '140'
|
|
|
},
|
|
|
{ label: '时间', prop: 'time', slot: 'time', minWidth: 200 },
|
|
|
{ label: '备注', prop: 'remarks', slot: 'remarks' },
|
|
|
{
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 180,
|
|
|
- align: 'center',
|
|
|
- slot: 'action',
|
|
|
- hideInPrint: true,
|
|
|
- hideInExport: true
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 180,
|
|
|
+ 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) {
|
|
|
- const res = await proxy.$http.get(props.pageUrl, { params });
|
|
|
+async function queryPage(params) {
|
|
|
+ if (!props.pageConfig.pageUrl) return EleMessage.error('未配置页面请求URL');
|
|
|
+ const res = await proxy.$http.get(props.pageConfig.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 }) => {
|
|
|
- return queryPage({ ...where, ...orders, ...pages });
|
|
|
- };
|
|
|
+/** 表格数据源 */
|
|
|
+const datasource = ({ pages, where, orders }) => {
|
|
|
+ let initParams = props.pageConfig?.where || {};
|
|
|
+ return queryPage({
|
|
|
+ ...where,
|
|
|
+ ...orders,
|
|
|
+ ...pages,
|
|
|
+ ...initParams
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
- /** 搜索 */
|
|
|
- const reload = (where) => {
|
|
|
+/** 搜索 */
|
|
|
+const reload = (where) => {
|
|
|
tableRef.value?.reload?.({ page: 1, where });
|
|
|
- };
|
|
|
+};
|
|
|
|
|
|
- /** 批量操作 */
|
|
|
- const operatBatch = ({ row, url, title }) => {
|
|
|
+/** 批量操作 */
|
|
|
+const operatBatch = ({ row, url, title }) => {
|
|
|
const rows = row == null ? selections.value : [row];
|
|
|
if (!rows.length) {
|
|
|
- EleMessage.error('请至少选择一条数据');
|
|
|
- return;
|
|
|
+ EleMessage.error('请至少选择一条数据');
|
|
|
+ return;
|
|
|
}
|
|
|
title = title || '是否确认当前操作?';
|
|
|
ElMessageBox.confirm(title, '提示', {
|
|
|
- type: 'warning',
|
|
|
- draggable: true
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- const loading = EleMessage.loading({
|
|
|
- message: '请求中..',
|
|
|
- plain: true
|
|
|
- });
|
|
|
+ .then(() => {
|
|
|
+ const loading = EleMessage.loading({
|
|
|
+ message: '请求中..',
|
|
|
+ plain: true
|
|
|
+ });
|
|
|
|
|
|
- proxy.$http
|
|
|
- .delete(url)
|
|
|
- .then(() => {
|
|
|
- loading.close();
|
|
|
- EleMessage.success('操作成功');
|
|
|
- reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- EleMessage.error(e.message);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- };
|
|
|
+ proxy.$http
|
|
|
+ .delete(url)
|
|
|
+ .then(() => {
|
|
|
+ loading.close();
|
|
|
+ EleMessage.success('操作成功');
|
|
|
+ reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ EleMessage.error(e.message);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+};
|
|
|
|
|
|
- /// 导出数据
|
|
|
- async function exportPage(params, name) {
|
|
|
+/// 导出数据
|
|
|
+async function exportPage(params, name) {
|
|
|
+ if (!props.pageConfig.exportUrl)
|
|
|
+ return EleMessage.error('未配置导出的URL!');
|
|
|
const res = await proxy.$http({
|
|
|
- url: props.exportUrl,
|
|
|
- method: 'POST',
|
|
|
- data: toFormData(params),
|
|
|
- responseType: 'blob'
|
|
|
+ url: props.pageConfig.exportUrl,
|
|
|
+ method: 'POST',
|
|
|
+ data: toFormData(params),
|
|
|
+ responseType: 'blob'
|
|
|
});
|
|
|
await checkDownloadRes(res);
|
|
|
download(
|
|
|
- res.data,
|
|
|
- name ? `${name}_${Date.now()}.xlsx` : `post_${Date.now()}.xlsx`
|
|
|
+ res.data,
|
|
|
+ name ? `${name}_${Date.now()}.xlsx` : `post_${Date.now()}.xlsx`
|
|
|
);
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
- /** 导出数据 */
|
|
|
- const exportData = (name) => {
|
|
|
+//导出数据 进导出记录
|
|
|
+function exportRecord(params, name) {
|
|
|
+ if (!props.pageConfig.exportUrl)
|
|
|
+ return EleMessage.error('未配置导出的URL!');
|
|
|
+ return proxy.$http({
|
|
|
+ url: props.pageConfig.exportUrl,
|
|
|
+ method: 'POST',
|
|
|
+ data: params
|
|
|
+ }); // 导出记录
|
|
|
+}
|
|
|
+
|
|
|
+/** 导出数据 */
|
|
|
+const exportData = (name) => {
|
|
|
const loading = EleMessage.loading({
|
|
|
- message: '请求中..',
|
|
|
- plain: true
|
|
|
+ message: '请求中..',
|
|
|
+ plain: true
|
|
|
});
|
|
|
tableRef.value?.fetch?.(({ where, orders }) => {
|
|
|
- exportPage({ ...where, ...orders }, name)
|
|
|
- .then(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- EleMessage.error(e.message);
|
|
|
- });
|
|
|
+ exportRecord({ ...where, ...orders }, name)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ EleMessage.success('操作成功,请前往导出记录下载');
|
|
|
+ }
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ EleMessage.error(e.message);
|
|
|
+ });
|
|
|
});
|
|
|
- };
|
|
|
+};
|
|
|
|
|
|
- //修改备注
|
|
|
- const remarksRef = ref(null);
|
|
|
- function handleRemarks(row) {
|
|
|
+//修改备注
|
|
|
+const remarksRef = ref(null);
|
|
|
+function handleRemarks(row) {
|
|
|
remarksRef.value?.handleOpen(row);
|
|
|
- }
|
|
|
- const activities = [
|
|
|
+}
|
|
|
+const activities = [
|
|
|
{
|
|
|
- content: 'Event start',
|
|
|
- timestamp: '2018-04-15',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
+ content: 'Event start',
|
|
|
+ timestamp: '2018-04-15',
|
|
|
+ color: '#0bbd87',
|
|
|
+ icon: ChatDotSquare
|
|
|
},
|
|
|
{
|
|
|
- content: 'Approved',
|
|
|
- timestamp: '2018-04-13',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
+ content: 'Approved',
|
|
|
+ timestamp: '2018-04-13',
|
|
|
+ color: '#0bbd87',
|
|
|
+ icon: ChatDotSquare
|
|
|
},
|
|
|
{
|
|
|
- content: 'Success',
|
|
|
- timestamp: '2018-04-11',
|
|
|
- color: '#0bbd87',
|
|
|
- icon: ChatDotSquare
|
|
|
+ content: 'Success',
|
|
|
+ timestamp: '2018-04-11',
|
|
|
+ color: '#0bbd87',
|
|
|
+ icon: ChatDotSquare
|
|
|
}
|
|
|
- ];
|
|
|
+];
|
|
|
+
|
|
|
+//用户详情
|
|
|
+const orderDetailRef = ref(null);
|
|
|
+function toOrderDetail(row) {
|
|
|
+ orderDetailRef.value?.handleOpen(row);
|
|
|
+}
|
|
|
+//初审
|
|
|
+const firstCheckRef = ref(null);
|
|
|
+function handleFirstCheck(row) {
|
|
|
+ firstCheckRef.value?.handleOpen(row);
|
|
|
+}
|
|
|
+//修改地址
|
|
|
+const modifyAddressRef = ref(null);
|
|
|
+function handleModifyAddress(row) {
|
|
|
+ modifyAddressRef.value?.handleOpen(row);
|
|
|
+}
|
|
|
+//订单日志
|
|
|
+const orderLogRef = ref(null);
|
|
|
+function openOrderLog(row) {
|
|
|
+ orderLogRef.value?.handleOpen(row);
|
|
|
+}
|
|
|
+//用户标签
|
|
|
+const userTagRef = ref(null);
|
|
|
+function openEditUserTag(row) {
|
|
|
+ userTagRef.value?.handleOpen(row);
|
|
|
+}
|
|
|
|
|
|
- defineExpose({ reload, exportData, operatBatch });
|
|
|
+defineExpose({ reload, exportData, operatBatch });
|
|
|
</script>
|