From 478bb3126fa8772d5e5139542fafb8d0d2eeeb66 Mon Sep 17 00:00:00 2001 From: fanfan Date: Sun, 18 Aug 2024 20:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/UserItem/UserItem.vue | 3 +- src/views/order/Index.vue | 150 ++++++++++++--------- 2 files changed, 86 insertions(+), 67 deletions(-) diff --git a/src/components/Table/UserItem/UserItem.vue b/src/components/Table/UserItem/UserItem.vue index 55f0202..8ebb393 100644 --- a/src/components/Table/UserItem/UserItem.vue +++ b/src/components/Table/UserItem/UserItem.vue @@ -14,8 +14,7 @@

名 称:{{ user.nick_name }}

手机号:{{ user.mobile }}

- - +

归属地:{{ JSON.parse(user.homelocation).prov }} {{ JSON.parse(user.homelocation).city }}

diff --git a/src/views/order/Index.vue b/src/views/order/Index.vue index e1f4986..bb48990 100644 --- a/src/views/order/Index.vue +++ b/src/views/order/Index.vue @@ -85,8 +85,16 @@ {{ item.create_time }} 订单号:{{ item.order_no }} - - {{ item.merchant.shop_name }} +
+ + {{ + item.merchant.shop_name + }} +
@@ -99,7 +107,7 @@ title: goodsItm.goods_name, goodsProps: goodsItm.goods_props, isCheck: goodsItm.is_check, - source:1 + source: 1, }" /> @@ -161,46 +169,56 @@ v-if="$auth('/order/detail')" :to="{ path: '/order/detail', query: { orderId: item.order_id } }" target="_blank" - >详情详情 发货发货 自提核销自提核销 审核取消审核取消 + 删除 - 删除 复制
@@ -252,7 +270,7 @@ import { OrderSourceEnum, OrderStatusEnum, PayStatusEnum, - ReceiptStatusEnum + ReceiptStatusEnum, } from '@/common/enum/order' import { PaymentMethodEnum } from '@/common/enum/payment' import { DeliveryForm, ExtractForm, CancelForm } from './modules' @@ -263,45 +281,45 @@ const columns = [ title: '商品信息', align: 'center', dataIndex: 'goods', - scopedSlots: { customRender: 'goods' } + scopedSlots: { customRender: 'goods' }, }, { title: '单价/数量', align: 'center', - scopedSlots: { customRender: 'unit_price' } + scopedSlots: { customRender: 'unit_price' }, }, { title: '实付款', align: 'center', dataIndex: 'pay_price', - scopedSlots: { customRender: 'pay_price' } + scopedSlots: { customRender: 'pay_price' }, }, { title: '买家', dataIndex: 'user', - scopedSlots: { customRender: 'user' } + scopedSlots: { customRender: 'user' }, }, { title: '支付方式', dataIndex: 'pay_method', - scopedSlots: { customRender: 'pay_method' } + scopedSlots: { customRender: 'pay_method' }, }, { title: '配送方式', dataIndex: 'delivery_type', - scopedSlots: { customRender: 'delivery_type' } + scopedSlots: { customRender: 'delivery_type' }, }, { title: '交易状态', dataIndex: 'status', - scopedSlots: { customRender: 'status' } + scopedSlots: { customRender: 'status' }, }, { title: '操作', dataIndex: 'action', width: '180px', - scopedSlots: { customRender: 'action' } - } + scopedSlots: { customRender: 'action' }, + }, ] // 搜索关键词类型枚举 @@ -310,7 +328,7 @@ const SearchTypeEnum = [ { name: '会员昵称', value: 20 }, { name: '会员ID', value: 30 }, { name: '收货人姓名', value: 40 }, - { name: '收货人电话', value: 50 } + { name: '收货人电话', value: 50 }, ] export default { @@ -321,9 +339,9 @@ export default { UserItem, DeliveryForm, ExtractForm, - CancelForm + CancelForm, }, - data () { + data() { return { // 订单类型 dataType: this.getDataType(), @@ -344,10 +362,10 @@ export default { pageSizeOptions: ['15', '30', '50', '100', '200', '300', '400', '500'], showTotal: (total) => `共 ${total} 条记录`, // 显示总数 // 自提门店列表 - shopList: [] + shopList: [], } }, - beforeCreate () { + beforeCreate() { // 批量给当前实例赋值 assignment(this, { inArray, @@ -359,7 +377,7 @@ export default { ReceiptStatusEnum, PaymentMethodEnum, SearchTypeEnum, - simpleImage: Empty.PRESENTED_IMAGE_SIMPLE + simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, }) }, computed: { @@ -367,16 +385,18 @@ export default { return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0 }, storeVersion() { - return window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0 - } + return window.localStorage.getItem('storeInfo') + ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version + : 0 + }, }, watch: { // 监听路由变化 - $route () { + $route() { this.init() - } + }, }, - created () { + created() { // 初始化页面 this.init() // 获取门店列表 @@ -384,7 +404,7 @@ export default { }, methods: { // 初始化页面 - init () { + init() { this.dataType = this.getDataType() this.searchForm.resetFields() this.queryParam = {} @@ -392,16 +412,16 @@ export default { }, // 获取门店列表 - getShopList () { + getShopList() { ShopApi.all().then((result) => (this.shopList = result.data.list)) }, // 获取当前标签 - getDataType () { + getDataType() { return this.$route.path.split('/')[3].replace('-', '_') }, - async copyText (text) { + async copyText(text) { try { const textToCopy = text await navigator.clipboard.writeText(textToCopy) @@ -411,7 +431,7 @@ export default { } }, // 获取列表数据 - getList () { + getList() { const { dataType, queryParam, page } = this this.isLoading = true return Api.list({ dataType, ...queryParam, page, pageSize: this.pageSizes }) @@ -422,13 +442,13 @@ export default { }, // 渲染订单状态标签颜色 - renderOrderStatusColor (orderStatus) { + renderOrderStatusColor(orderStatus) { const { OrderStatusEnum } = this const ColorEnum = { [OrderStatusEnum.NORMAL.value]: '', [OrderStatusEnum.CANCELLED.value]: 'red', [OrderStatusEnum.APPLY_CANCEL.value]: 'red', - [OrderStatusEnum.COMPLETED.value]: 'green' + [OrderStatusEnum.COMPLETED.value]: 'green', } return ColorEnum[orderStatus] }, @@ -437,13 +457,13 @@ export default { * 刷新列表 * @param Boolean bool 强制刷新到第一页 */ - handleRefresh (bool = false) { + handleRefresh(bool = false) { bool && (this.page = 1) this.getList() }, // 确认搜索 - handleSearch (e) { + handleSearch(e) { e.preventDefault() this.searchForm.validateFields((error, values) => { if (!error) { @@ -454,53 +474,53 @@ export default { }, // 重置搜索表单 - handleReset () { + handleReset() { this.searchForm.resetFields() }, // 翻页事件 - onChangePage (current, size) { + onChangePage(current, size) { this.page = current this.pageSizes = size this.handleRefresh() }, - handleSizeChange (current, size) { + handleSizeChange(current, size) { this.page = current this.pageSizes = size this.handleRefresh() }, // 删除记录 - handleDelete (item) { + handleDelete(item) { const app = this const modal = app.$confirm({ title: '您确定要删除该订单记录吗?', content: '删除后不可恢复,请谨慎操作', - onOk () { + onOk() { return EventApi.deleted(item.order_id) .then((result) => { app.$message.success(result.message, 1.5) app.handleRefresh() }) .finally((result) => modal.destroy()) - } + }, }) }, // 订单发货 - handleDelivery (record) { + handleDelivery(record) { this.$refs.DeliveryForm.show(record) }, // 自提核销 - handleExtract (record) { + handleExtract(record) { this.$refs.ExtractForm.show(record) }, // 审核取消订单 - handleCancel (record) { + handleCancel(record) { this.$refs.CancelForm.show(record) - } - } + }, + }, }