1服务回收

chenwei
wanghousheng 10 months ago
parent 130f181872
commit 662d8ebd1c
  1. 35
      src/api/dealer/user.js
  2. 62
      src/api/server/index.js
  3. 11
      src/config/router.config.js
  4. 83
      src/views/apps/dealer/user/Index.vue
  5. 56
      src/views/apps/dealer/user/modules/EditForm.vue
  6. 247
      src/views/server/Order.vue
  7. 115
      src/views/server/modules/Dispatch.vue

@ -6,18 +6,19 @@ const api = {
fans: '/dealer.user/fans',
edit: '/dealer.user/edit',
delete: '/dealer.user/delete',
poster: '/dealer.user/poster'
poster: '/dealer.user/poster',
typeList: '/dealer.user/typeList',
}
/**
* 分销商用户列表
* @param {*} params
*/
export function list (params) {
export function list(params) {
return axios({
url: api.list,
method: 'get',
params
params,
})
}
@ -25,11 +26,11 @@ export function list (params) {
* 分销商粉丝列表
* @param {*} dealerId
*/
export function fans (dealerId, params) {
export function fans(dealerId, params) {
return axios({
url: api.fans,
method: 'get',
params: { dealerId, ...params }
params: { dealerId, ...params },
})
}
@ -37,11 +38,11 @@ export function fans (dealerId, params) {
* 分销商二维码
* @param {*} dealerId
*/
export function poster (dealerId) {
export function poster(dealerId) {
return axios({
url: api.poster,
method: 'get',
params: { dealerId }
params: { dealerId },
})
}
@ -49,11 +50,11 @@ export function poster (dealerId) {
* 编辑分销商
* @param {*} data
*/
export function edit (data) {
export function edit(data) {
return axios({
url: api.edit,
method: 'post',
data
data,
})
}
@ -61,10 +62,22 @@ export function edit (data) {
* 删除分销商
* @param {*} dealerId
*/
export function deleted (dealerId) {
export function deleted(dealerId) {
return axios({
url: api.delete,
method: 'post',
data: { dealerId }
data: { dealerId },
})
}
/**
* 分销商类别
* @param {*} data
*/
export function typeList(data) {
return axios({
url: api.typeList,
method: 'post',
data,
})
}

@ -12,6 +12,11 @@ const api = {
deleteServer: '/server/deleteServer',
serverStatus: '/server/serverStatus',
ServerDetail: '/server/ServerDetail',
orderList: '/server/orderList',
cancelOrder: '/server/cancelOrder',
getEngineer: '/dealer.user/getEngineer',
dispatchOrders: '/server/dispatchOrders',
OrderStatus: '/server/OrderStatus',
}
/**
* 服务列表记录
@ -120,3 +125,60 @@ export function deleteCategory(data) {
data: data,
})
}
/**
* 服务订单
* @param {*} data
*/
export function orderList(data) {
return axios({
url: api.orderList,
method: 'post',
data,
})
}
/**
* 服务订单
* @param {*} data
*/
export function cancelOrder(data) {
return axios({
url: api.cancelOrder,
method: 'post',
data,
})
}
/**
* 服务订单
* @param {*} data
*/
export function getEngineer(data) {
return axios({
url: api.getEngineer,
method: 'post',
data,
})
}
/**
* 派单
* @param {*} data
*/
export function dispatchOrders(data) {
return axios({
url: api.dispatchOrders,
method: 'post',
data,
})
}
/**
* 派单
* @param {*} data
*/
export function orderStatusList(data) {
return axios({
url: api.OrderStatus,
method: 'post',
data,
})
}

@ -171,15 +171,20 @@ export const asyncRouterMap = [
redirect: '/server/index',
meta: { title: '服务管理', icon: Icons.server, permission: ['/server'] },
children: [
{
path: '/server/category/index',
component: () => import(/* webpackChunkName: "server" */ '@/views/server/category/Index'),
meta: { title: '服务分类', keepAlive: false, permission: ['/server/category/index'] },
},
{
path: '/server/index',
component: () => import(/* webpackChunkName: "server" */ '@/views/server/Index'),
meta: { title: '服务列表', keepAlive: false, permission: ['/server/index'] },
},
{
path: '/server/category/index',
component: () => import(/* webpackChunkName: "server" */ '@/views/server/category/Index'),
meta: { title: '服务分类', keepAlive: false, permission: ['/server/category/index'] },
path: '/server/Order',
component: () => import(/* webpackChunkName: "server" */ '@/views/server/Order'),
meta: { title: '服务订单', keepAlive: false, permission: ['/server/order'] },
},
],
},

@ -5,7 +5,7 @@
<a-row>
<a-col class="flex flex-x-end">
<a-input-search
style="max-width: 300px; min-width: 150px;"
style="max-width: 300px; min-width: 150px"
v-model="queryParam.search"
placeholder="请输入姓名/手机号/昵称"
@search="onSearch"
@ -88,9 +88,9 @@ export default {
STable,
UserItem,
EditForm,
FansModal
FansModal,
},
data () {
data() {
return {
//
queryParam: { search: '' },
@ -98,117 +98,117 @@ export default {
columns: [
{
title: '用户ID',
dataIndex: 'user_id'
dataIndex: 'user_id',
},
{
title: '身份',
dataIndex: 'type_text',
},
{
title: '会员信息',
dataIndex: 'user',
scopedSlots: { customRender: 'user' }
scopedSlots: { customRender: 'user' },
},
{
title: '姓名/手机号',
scopedSlots: { customRender: 'contacts' }
scopedSlots: { customRender: 'contacts' },
},
{
title: '累计佣金/可提现佣金',
scopedSlots: { customRender: 'money' }
scopedSlots: { customRender: 'money' },
},
{
title: '推荐人',
scopedSlots: { customRender: 'referee' }
scopedSlots: { customRender: 'referee' },
},
{
title: '下级用户',
scopedSlots: { customRender: 'fans' }
scopedSlots: { customRender: 'fans' },
},
{
title: '成为时间',
dataIndex: 'create_time'
dataIndex: 'create_time',
},
{
title: '操作',
dataIndex: 'action',
width: '180px',
scopedSlots: { customRender: 'action' }
}
scopedSlots: { customRender: 'action' },
},
],
// Promise
loadData: param => {
return Api.list({ ...param, ...this.queryParam })
.then(response => {
return response.data.list
})
loadData: (param) => {
return Api.list({ ...param, ...this.queryParam }).then((response) => {
return response.data.list
})
},
//
visible: false,
//
isLoading: true,
//
posterUrl: ''
posterUrl: '',
}
},
created () {
},
created() {},
methods: {
// ()
handleFans (item, level = 1) {
handleFans(item, level = 1) {
this.$refs.FansModal.show(item.user_id, level)
},
//
handleEdit (item) {
handleEdit(item) {
this.$refs.EditForm.edit(item)
},
//
handleMenuClick ({ key }, item) {
handleMenuClick({ key }, item) {
const events = {
1: this.handleOrder,
2: this.handleWithdraw,
3: this.handlePoster,
4: this.handleDelete
4: this.handleDelete,
}
events[key](item)
},
//
handleOrder (item) {
handleOrder(item) {
this.$router.push({ path: '/apps/dealer/order', query: { searchType: 20, searchValue: item.user_id } })
},
//
handleWithdraw (item) {
handleWithdraw(item) {
this.$router.push({ path: '/apps/dealer/withdraw', query: { dealerId: item.user_id } })
},
//
handlePoster (item) {
handlePoster(item) {
const app = this
app.isLoading = true
app.visible = true
Api.poster(item.user_id, 'H5')
.then(result => {
.then((result) => {
app.posterUrl = result.data.imageUrl
})
.finally(() => app.isLoading = false)
.finally(() => (app.isLoading = false))
},
//
handleDelete (item) {
handleDelete(item) {
const app = this
const modal = app.$confirm({
title: '您确定要删除该记录吗?',
content: '删除后不可恢复',
onOk () {
onOk() {
return Api.deleted(item.user_id)
.then(result => {
.then((result) => {
app.$message.success(result.message, 1.5)
app.handleRefresh()
})
.finally(result => modal.destroy())
}
.finally((result) => modal.destroy())
},
})
},
@ -216,16 +216,15 @@ export default {
* 刷新列表
* @param Boolean bool 强制刷新到第一页
*/
handleRefresh (bool = false) {
handleRefresh(bool = false) {
this.$refs.table.refresh(bool)
},
//
onSearch () {
onSearch() {
this.handleRefresh(true)
}
}
},
},
}
</script>
@ -239,4 +238,4 @@ export default {
max-width: 100%;
}
}
</style>
</style>

@ -16,6 +16,14 @@
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['mobile', { rules: [{ required: true }] }]" />
</a-form-item>
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-decorator="['type', { rules: [{ required: true, message: '请选择身份' }] }]">
<a-select-option :value="0">选择身份</a-select-option>
<a-select-option v-for="(item, index) in typeList" :key="index" :value="item.value">{{
item.name
}}</a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
@ -26,7 +34,7 @@ import pick from 'lodash.pick'
import * as Api from '@/api/dealer/user'
export default {
data () {
data() {
return {
//
title: '编辑分销商',
@ -41,34 +49,49 @@ export default {
//
form: this.$form.createForm(this),
//
record: {}
record: {},
//
typeList: [],
}
},
methods: {
//
edit (record) {
edit(record) {
//
this.visible = true
//
this.record = record
//
this.setFieldsValue()
//
this.getTypeList()
},
//
setFieldsValue () {
const { record, form: { setFieldsValue } } = this
setFieldsValue() {
const {
record,
form: { setFieldsValue },
} = this
this.$nextTick(() => {
setFieldsValue(pick(record, ['real_name', 'mobile']))
setFieldsValue(pick(record, ['real_name', 'mobile', 'type']))
})
},
//
getTypeList() {
Api.typeList()
.then((result) => {
this.typeList = result.data.list
})
.finally()
},
//
handleSubmit (e) {
handleSubmit(e) {
e.preventDefault()
//
const { form: { validateFields } } = this
const {
form: { validateFields },
} = this
validateFields((errors, values) => {
// api
!errors && this.onFormSubmit(values)
@ -76,16 +99,16 @@ export default {
},
//
handleCancel () {
handleCancel() {
this.visible = false
this.form.resetFields()
},
// api
onFormSubmit (values) {
onFormSubmit(values) {
this.confirmLoading = true
Api.edit({ dealerId: this.record.user_id, form: values })
.then(result => {
.then((result) => {
//
this.$message.success(result.message, 1.5)
//
@ -93,9 +116,8 @@ export default {
//
this.$emit('handleSubmit', values)
})
.finally(() => this.confirmLoading = false)
}
}
.finally(() => (this.confirmLoading = false))
},
},
}
</script>

@ -0,0 +1,247 @@
<template>
<a-card :bordered="false">
<div class="card-title">{{ $route.meta.title }}</div>
<div class="table-operator">
<!-- 搜索板块 -->
<a-row class="row-item-search">
<a-form class="search-form" layout="inline">
<a-form-item label="服务名称">
<a-input v-model="queryParam.server_name" placeholder="请输入服务名称" />
</a-form-item>
<a-form-item label="用户手机号">
<a-input v-model="queryParam.user_mobile" placeholder="请输入用户手机号" />
</a-form-item>
<a-form-item label="订单号">
<a-input v-model="queryParam.order_no" placeholder="请输入订单号" />
</a-form-item>
<a-form-item class="search-btn">
<a-button type="primary" icon="search" @click="handleSearch">搜索</a-button>
</a-form-item>
</a-form>
</a-row>
<!-- 操作板块 -->
<div class="row-item-tab clearfix">
<div class="tab-list fl-l">
<a-radio-group :defaultValue="queryParam.order_status" @change="handleTabs">
<a-radio-button value="0">全部</a-radio-button>
<a-radio-button v-for="(items, index) in orderStatusList" :key="index" :value="items.value">{{
items.name
}}</a-radio-button>
</a-radio-group>
</div>
</div>
</div>
<s-table
ref="table"
rowKey="order_id"
:loading="isLoading"
:columns="columns"
:data="loadData"
:rowSelection="rowSelection"
:pageSize="15"
>
<!-- 服务图片 -->
<span slot="server_image" slot-scope="text, item">
<a title="点击查看原图" :href="item.server_image" target="_blank">
<img width="50" height="50" :src="item.server_image" alt="服务图片" />
</a>
</span>
<!-- 操作项 -->
<span slot="action" slot-scope="text, item">
<template>
<a
v-if="item.order_status == 20"
v-action:edit
style="margin-right: 8px"
@click="handleDispatch(item.order_id)"
>派单</a
>
<a v-if="item.order_status == 10 || item.order_status == 20" @click="handleCancel(item.order_id)">取消</a>
</template>
</span>
</s-table>
<dispatch ref="dispatchRef" @handleSubmit="handleRefresh" />
</a-card>
</template>
<script>
import * as Api from '@/api/server'
import { ContentHeader, STable } from '@/components'
import Dispatch from './modules/Dispatch'
//
const columns = [
{
title: '订单号',
dataIndex: 'order_no',
},
{
title: '订单价格',
dataIndex: 'total_price',
},
{
title: '优惠金额',
dataIndex: 'coupon_money',
},
{
title: '支付金额',
dataIndex: 'pay_price',
},
{
title: '订单状态',
dataIndex: 'order_status_text',
},
{
title: '用户手机号',
dataIndex: 'user_mobile',
},
{
title: '工程师手机号',
dataIndex: 'dealer_mobile',
},
{
title: '服务名称',
dataIndex: 'server_name',
},
{
title: '服务图片',
dataIndex: 'server_image',
scopedSlots: { customRender: 'server_image' },
},
{
title: '下单时间',
width: '180px',
dataIndex: 'create_time',
},
{
title: '操作',
dataIndex: 'action',
width: '150px',
fixed: 'right',
scopedSlots: { customRender: 'action' },
},
]
export default {
name: 'Index',
components: {
ContentHeader,
STable,
Dispatch,
},
data() {
return {
//
searchForm: this.$form.createForm(this),
//
categoryList: [],
//
orderStatusList: [],
//
queryParam: {
order_status: '0',
server_name: '',
category_id: '',
page: 1,
},
//
isLoading: false,
//
columns,
//
selectedRowKeys: [],
// Promise
loadData: (param) => {
const requestParameters = Object.assign({}, param, this.queryParam)
return Api.orderList(requestParameters).then((response) => {
return response.data.list
})
},
}
},
created() {
//
if (this.$route.query.order_status) {
this.queryParam.order_status = this.$route.query.order_status
}
this.getOrderStatusList()
},
computed: {
rowSelection() {
return {
selectedRowKeys: this.selectedRowKeys,
onChange: this.onSelectChange,
}
},
},
methods: {
//
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
},
// tab
handleTabs(e) {
this.queryParam.order_status = e.target.value
this.handleRefresh(true)
},
//
handleSearch(e) {
this.handleRefresh(true)
},
//
handleReset() {
this.searchForm.resetFields()
},
//
handleCancel(orderId) {
const app = this
const modal = this.$confirm({
title: '您确定要取消该订单吗?',
content: '',
onOk() {
return Api.cancelOrder({ orderId })
.then((result) => {
app.$message.success(result.message, 1.5)
app.handleRefresh()
})
.finally((result) => modal.destroy())
},
})
},
//
getOrderStatusList() {
this.isLoading = true
Api.orderStatusList()
.then((result) => {
this.orderStatusList = result.data.list
})
.finally(() => (this.isLoading = false))
},
//
handleDispatch(order_id) {
this.$refs.dispatchRef.add(order_id)
},
/**
* 刷新列表
* @param Boolean bool 强制刷新到第一页
*/
handleRefresh(bool = false) {
this.selectedRowKeys = []
this.$refs.table.refresh(bool)
},
},
}
</script>
<style lang="less" scoped>
.ant-card-body {
padding: 22px 29px 25px;
}
// tab
.tab-list {
margin-right: 20px;
}
</style>

@ -0,0 +1,115 @@
<template>
<a-modal
title="派单"
:width="400"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:destroyOnClose="true"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item label="服务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
v-decorator="['dealer_id', { initialValue: 0, rules: [{ required: true, message: '请选择服务人员' }] }]"
>
<a-select-option :value="0">选择服务人员</a-select-option>
<a-select-option v-for="(item, index) in engineerList" :key="index" :value="item.user_id"
>{{ item.real_name }}<span v-if="item.mobile">({{ item.mobile }}) </span></a-select-option
>
</a-select>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import * as Api from '@/api/server'
export default {
components: {},
props: {
//
},
data() {
return {
engineerList: [],
//
title: '',
//
labelCol: {
span: 7,
},
order_id: '',
//
wrapperCol: {
span: 13,
},
// modal()
visible: false,
// modal() loading
confirmLoading: false,
//
form: this.$form.createForm(this),
}
},
methods: {
//
add(order_id) {
//
this.getEngineerList()
this.order_id = order_id
this.visible = true
},
//
getEngineerList() {
this.isLoading = true
Api.getEngineer()
.then((result) => {
this.engineerList = result.data.list
})
.finally(() => (this.isLoading = false))
},
//
handleSubmit(e) {
e.preventDefault()
//
const {
form: { validateFields },
} = this
validateFields((errors, values) => {
// api
if (!errors) {
values.order_id = this.order_id
this.onFormSubmit(values)
}
})
},
//
handleCancel() {
this.visible = false
this.form.resetFields()
},
// api
onFormSubmit(values) {
this.confirmLoading = true
Api.dispatchOrders({ form: values })
.then((result) => {
//
this.$message.success(result.message, 1.5)
//
this.handleCancel()
//
this.$emit('handleSubmit', values)
})
.finally((result) => {
this.confirmLoading = false
})
},
},
}
</script>
Loading…
Cancel
Save