fanfan 9 months ago
commit 48950b4051
  1. 2
      src/components/Table/UserItem/UserItem.vue
  2. 118
      src/views/order/Index.vue
  3. 15
      src/views/order/modules/CancelForm.vue
  4. 64
      src/views/user/Index.vue

@ -8,7 +8,7 @@
:src="user.avatar_url || user.avatar.preview_url"
alt="会员头像"
/>
<img v-else src="~@/assets/img/default-avatar.png" alt="会员头像" />
<!-- <img v-else src="~@/assets/img/default-avatar.png" alt="会员头像" /> -->
</a-tooltip>
</div>
<div class="in-right flex flex-dir-column flex-x-center">

@ -157,44 +157,44 @@
v-if="$auth('/order/detail')"
:to="{ path: '/order/detail', query: { orderId: item.order_id } }"
target="_blank"
>详情</router-link
>详情</router-link
>
<a
v-action:deliver
v-if="
item.pay_status == PayStatusEnum.SUCCESS.value &&
inArray(item.delivery_type, [
DeliveryTypeEnum.EXPRESS.value,
DeliveryTypeEnum.NOTHING.value,
]) &&
item.delivery_status != DeliveryStatusEnum.DELIVERED.value &&
!inArray(item.order_status, [
OrderStatusEnum.CANCELLED.value,
OrderStatusEnum.APPLY_CANCEL.value,
])
inArray(item.delivery_type, [
DeliveryTypeEnum.EXPRESS.value,
DeliveryTypeEnum.NOTHING.value,
]) &&
item.delivery_status != DeliveryStatusEnum.DELIVERED.value &&
!inArray(item.order_status, [
OrderStatusEnum.CANCELLED.value,
OrderStatusEnum.APPLY_CANCEL.value,
])
"
@click="handleDelivery(item)"
>发货</a
>发货</a
>
<a
v-action:extract
v-if="
item.pay_status == PayStatusEnum.SUCCESS.value &&
item.delivery_type == DeliveryTypeEnum.EXTRACT.value &&
item.delivery_status != DeliveryStatusEnum.DELIVERED.value &&
!inArray(item.order_status, [
OrderStatusEnum.CANCELLED.value,
OrderStatusEnum.APPLY_CANCEL.value,
])
item.delivery_type == DeliveryTypeEnum.EXTRACT.value &&
item.delivery_status != DeliveryStatusEnum.DELIVERED.value &&
!inArray(item.order_status, [
OrderStatusEnum.CANCELLED.value,
OrderStatusEnum.APPLY_CANCEL.value,
])
"
@click="handleExtract(item)"
>自提核销</a
>自提核销</a
>
<a
v-action:cancel
v-if="item.order_status == OrderStatusEnum.APPLY_CANCEL.value"
@click="handleCancel(item)"
>审核取消</a
>审核取消</a
>
<a v-action:delete @click="handleDelete(item)">删除</a>
<a @click="copyText(item.copy_text)">复制</a>
@ -248,7 +248,7 @@ import {
OrderSourceEnum,
OrderStatusEnum,
PayStatusEnum,
ReceiptStatusEnum,
ReceiptStatusEnum
} from '@/common/enum/order'
import { PaymentMethodEnum } from '@/common/enum/payment'
import { DeliveryForm, ExtractForm, CancelForm } from './modules'
@ -259,45 +259,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' }
}
]
//
@ -306,7 +306,7 @@ const SearchTypeEnum = [
{ name: '会员昵称', value: 20 },
{ name: '会员ID', value: 30 },
{ name: '收货人姓名', value: 40 },
{ name: '收货人电话', value: 50 },
{ name: '收货人电话', value: 50 }
]
export default {
@ -317,9 +317,9 @@ export default {
UserItem,
DeliveryForm,
ExtractForm,
CancelForm,
CancelForm
},
data() {
data () {
return {
//
dataType: this.getDataType(),
@ -337,13 +337,13 @@ export default {
textToCopy: '',
//
orderList: { data: [], total: 0 },
pageSizeOptions: ['15', '30', '50', '100','200','300','400','500'],
pageSizeOptions: ['15', '30', '50', '100', '200', '300', '400', '500'],
showTotal: (total) => `${total} 条记录`, //
//
shopList: [],
shopList: []
}
},
beforeCreate() {
beforeCreate () {
//
assignment(this, {
inArray,
@ -355,16 +355,16 @@ export default {
ReceiptStatusEnum,
PaymentMethodEnum,
SearchTypeEnum,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE
})
},
watch: {
//
$route() {
$route () {
this.init()
},
}
},
created() {
created () {
//
this.init()
//
@ -372,7 +372,7 @@ export default {
},
methods: {
//
init() {
init () {
this.dataType = this.getDataType()
this.searchForm.resetFields()
this.queryParam = {}
@ -380,16 +380,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)
@ -399,7 +399,7 @@ export default {
}
},
//
getList() {
getList () {
const { dataType, queryParam, page } = this
this.isLoading = true
return Api.list({ dataType, ...queryParam, page, pageSize: this.pageSizes })
@ -410,13 +410,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]
},
@ -425,13 +425,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) {
@ -442,53 +442,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)
},
},
}
}
}
</script>
<style lang="less" scoped>

@ -20,11 +20,14 @@
:wrapperCol="wrapperCol"
extra="同意后将退回付款金额并关闭订单"
>
<a-radio-group v-decorator="['status', { initialValue: 1, rules: [{ required: true }] }]">
<a-radio-group v-decorator="['status', { initialValue: 1, rules: [{ required: true }] }]" @change="handleStatus">
<a-radio :value="1">同意</a-radio>
<a-radio :value="0">拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="拒绝原因" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="refuse_show">
<a-textarea placeholder="拒绝原因" :rows="2" v-decorator="['remark', { initialValue: '', rules: [{ required: true,message: '拒绝原因不能为空' }] }]"/>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
@ -36,6 +39,7 @@ import * as Api from '@/api/order/event'
export default {
data () {
return {
refuse_show: false,
//
title: '审核取消订单',
//
@ -63,7 +67,14 @@ export default {
//
this.record = record
},
handleStatus (e) {
if (e.target.value === 0) {
this.form.setFieldsValue({ refuse_text: '' })
this.refuse_show = true
} else {
this.refuse_show = false
}
},
//
handleSubmit (e) {
e.preventDefault()

@ -25,7 +25,12 @@
</a-form>
</a-row>
</div>
<s-table ref="table" rowKey="user_id" :loading="isLoading" :columns="columns" :data="loadData"
<s-table
ref="table"
rowKey="user_id"
:loading="isLoading"
:columns="columns"
:data="loadData"
:pagination="pagination">
<!-- 会员头像 -->
<span slot="avatar_url" slot-scope="text">
@ -62,6 +67,10 @@
<span slot="platform" class="platform" slot-scope="text">
<platform-icon :name="text" :showTips="true" :iconSize="17" />
</span>
<!-- 邀请信息 -->
<span slot="invite_user" slot-scope="text">
<UserItem :user="text" />
</span>
<!-- 操作 -->
<span class="actions" slot="action" slot-scope="item">
<a v-if="$module('market-recharge')" v-action:recharge @click="handleRecharge(item)" title="会员充值">充值</a>
@ -75,6 +84,7 @@
</template>
<script>
import { UserItem } from '@/components/Table'
import { filterModules } from '@/core/app'
import * as Api from '@/api/user'
import * as GradeApi from '@/api/user/grade'
@ -86,20 +96,25 @@ import { GradeForm, RechargeForm } from './modules'
const columns = filterModules([
{
title: '会员ID',
dataIndex: 'user_id',
dataIndex: 'user_id'
},
{
title: '会员头像',
dataIndex: 'avatar_url',
scopedSlots: { customRender: 'avatar_url' },
scopedSlots: { customRender: 'avatar_url' }
},
{
title: '昵称/手机号',
scopedSlots: { customRender: 'main_info' },
scopedSlots: { customRender: 'main_info' }
},
{
title: '邀请人',
dataIndex: 'invite_user',
scopedSlots: { customRender: 'invite_user' }
},
{
title: '会员身份',
dataIndex: 'user_type_text',
dataIndex: 'user_type_text'
},
/* {
title: '会员等级',
@ -110,28 +125,28 @@ const columns = filterModules([
{
title: '余额/积分',
dataIndex: 'balance',
scopedSlots: { customRender: 'balance' },
scopedSlots: { customRender: 'balance' }
},
{
title: '实际消费金额',
dataIndex: 'expend_money',
scopedSlots: { customRender: 'expend_money' },
scopedSlots: { customRender: 'expend_money' }
},
{
title: '注册来源',
dataIndex: 'platform',
scopedSlots: { customRender: 'platform' },
scopedSlots: { customRender: 'platform' }
},
{
title: '注册时间',
dataIndex: 'create_time',
dataIndex: 'create_time'
},
{
title: '操作',
// dataIndex: 'action',
width: '180px',
scopedSlots: { customRender: 'action' },
},
scopedSlots: { customRender: 'action' }
}
])
export default {
@ -141,8 +156,9 @@ export default {
GradeForm,
RechargeForm,
PlatformIcon,
UserItem
},
data() {
data () {
return {
//
searchForm: this.$form.createForm(this),
@ -157,50 +173,50 @@ export default {
return Api.list({ ...param, ...this.queryParam }).then((response) => response.data.list)
},
//
gradeList: [],
gradeList: []
}
},
created() {
created () {
//
this.getGradeList()
},
methods: {
//
getGradeList() {
getGradeList () {
GradeApi.all().then((result) => {
this.gradeList = result.data.list
})
},
//
handleGrade(item) {
handleGrade (item) {
this.$refs.GradeForm.handle(item)
},
//
handleRecharge(item) {
handleRecharge (item) {
this.$refs.RechargeForm.handle(item)
},
//
handleDelete(item) {
handleDelete (item) {
const app = this
const modal = this.$confirm({
title: '您确定要删除该记录吗?',
content: '删除后不可恢复',
onOk() {
onOk () {
return Api.deleted({ userId: item.user_id })
.then((result) => {
app.$message.success(result.message, 1.5)
app.handleRefresh()
})
.finally((result) => modal.destroy())
},
}
})
},
//
handleSearch(e) {
handleSearch (e) {
e.preventDefault()
this.searchForm.validateFields((error, values) => {
if (!error) {
@ -214,10 +230,10 @@ export default {
* 刷新列表
* @param Boolean bool 强制刷新到第一页
*/
handleRefresh(bool = false) {
handleRefresh (bool = false) {
this.$refs.table.refresh(bool)
},
},
}
}
}
</script>

Loading…
Cancel
Save