Commit 83085384 authored by guoyou's avatar guoyou

会员订单管理

parent ab7acd42
...@@ -116,3 +116,22 @@ export function downloadExcel(params) { ...@@ -116,3 +116,22 @@ export function downloadExcel(params) {
responseType: 'blob' responseType: 'blob'
}); });
} }
//会员订单管理列表
export function pageList(params) {
return fetch({
url: '/api/order/orderMember/page',
method: 'post',
data: params
});
}
//会员订单管理导出
export function orderMemberExcel(params) {
return fetch({
url: '/api/order/orderMember/page',
method: 'post',
data: params,
responseType: 'blob'
});
}
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input v-model="listQuery.no" type="text" placeholder="请输入订单号"></el-input> <el-input v-model="listQuery.orderNo" type="text" placeholder="请输入订单号"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
...@@ -14,26 +14,51 @@ ...@@ -14,26 +14,51 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="状态"> <el-form-item label="用户姓名">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请选择状态"> <el-input v-model="listQuery.name" placeholder="请输入用户姓名"></el-input>
<el-option :key="null" label="无" :value="null" ></el-option> </el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="订单状态">
<el-select class="filter-item" v-model="listQuery.state" placeholder="请选择订单状态">
<el-option :key="null" label="无" :value="null"></el-option>
<el-option :key="2" label="取消" :value="2"></el-option> <el-option :key="2" label="取消" :value="2"></el-option>
<el-option :key="3" label="待付款" :value="3"></el-option> <el-option :key="3" label="待付款" :value="3"></el-option>
<el-option :key="6" label="已完成" :value="6"></el-option> <el-option :key="6" label="已完成" :value="6"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7">
<el-form-item label="创建时间">
<el-date-picker v-model="createTime" type="datetimerange" placeholder="选择时间范围"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="支付时间">
<el-date-picker v-model="aplyTime" type="datetimerange" placeholder="选择支付时间范围"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="上级手机号">
<el-input v-model="listQuery.leaderPhone" placeholder="请输入上级手机号"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="促成人手机号">
<el-input v-model="listQuery.facilitatePhone" placeholder="请输入促成人手机号"></el-input>
</el-form-item>
</el-col>
<!-- <el-col> <!-- <el-col>
<el-form-item label="时间"> <el-form-item label="时间">
<el-date-picker v-model="listQuery.startTime" type = "date" placeholder = "请输入开始时间"></el-date-picker> <el-date-picker v-model="listQuery.startTime" type = "date" placeholder = "请输入开始时间"></el-date-picker>
<span>——</span> <span>——</span>
<el-date-picker v-model="listQuery.endTime" type = "date" placeholder = "请输入结束时间"></el-date-picker> <el-date-picker v-model="listQuery.endTime" type = "date" placeholder = "请输入结束时间"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> --> </el-col>-->
<el-col :span="5"> <el-col :span="5">
<el-form-item label="会员类型"> <el-form-item label="会员类型">
<el-select class="filter-item" v-model="listQuery.memberLevel" placeholder="请选择会员类型"> <el-select class="filter-item" v-model="listQuery.level" placeholder="请选择会员类型">
<el-option :key="null" label="无" :value="undefined" ></el-option> <el-option :key="null" label="无" :value="undefined"></el-option>
<el-option :key="1" label="普通会员" :value="1"></el-option> <el-option :key="1" label="普通会员" :value="1"></el-option>
<el-option :key="2" label="黄金会员" :value="2"></el-option> <el-option :key="2" label="黄金会员" :value="2"></el-option>
<el-option :key="3" label="钻石会员" :value="3"></el-option> <el-option :key="3" label="钻石会员" :value="3"></el-option>
...@@ -42,68 +67,122 @@ ...@@ -42,68 +67,122 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<p class="num-title">数据统计</p>
<el-card class="box-card" style="margin-bottom:20px;">
<ul>
<li>
<p>{{statistics.orderNum|| '0'}}</p>
<p>订单总数(单)</p>
</li>
<li>
<p>{{statistics.totalAmount|| '0'}}</p>
<p>订单总额(元)</p>
</li>
<li>
<p>{{statistics.diamondOrderNum|| '0'}}</p>
<p>钻石订单</p>
</li>
<li>
<p>{{statistics.totalDiamondAmount|| '0'}}</p>
<p>钻石订单总额</p>
</li>
<li>
<p>{{statistics.goldOrderNum|| '0'}}</p>
<p>黄金订单</p>
</li>
<li>
<p>{{statistics.totalGoldAmount|| '0'}}</p>
<p>黄金订单总额</p>
</li>
<li>
<p>{{statistics.generalOrderNum|| '0'}}</p>
<p>普通订单</p>
</li>
<li>
<p>{{statistics.totalGeneralOrderNum ||'0'}}</p>
<p>普通订单总额</p>
</li>
</ul>
</el-card>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves icon="delete" @click="clearSearch">清除搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="delete" @click="clearSearch">清除搜索</el-button>
<el-button class="filter-item" type="primary" @click="excel">导出</el-button>
</div> </div>
<el-table :key='tableKey' :data="list" v-loading.body="listLoading"
border fit highlight-current-row <el-table
style="width: 100%"> :key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column align="center" label="ID" width="70"> <el-table-column align="center" label="ID" width="70">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.id}}</span> <span>{{scope.row.id}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="订单号"> <el-table-column align="center" label="订单号/创建订单时间" width="200px">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.no}}</span> <p>{{scope.row.orderNo}}</p>
<p>{{scope.row.creatTime}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="名称"> <el-table-column width="110" align="center" label="订单状态">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.name}}</span> <span v-if="scope.row.status == '2'">取消</span>
<span v-if="scope.row.status == '3'">待付款</span>
<span v-if="scope.row.status == '6'">已完成</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="150" align="center" label="用户名"> <el-table-column align="center" label="名称/价格" width="100px">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.telephone}}</span> <p>{{scope.row.name}}</p>
<p>{{scope.row.goodsAmount}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="110" align="center" label="商品价格"> <el-table-column width="100" align="center" label="用户名">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.goodsAmount}}</span> <span>{{scope.row.userName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="110" align="center" label="订单价格"> <el-table-column width="130" align="center" label="手机号">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.orderAmount}}</span> <span>{{scope.row.phone}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="110" align="center" label="实际价格"> <el-table-column width="130" align="center" label="上级姓名/手机号">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.realAmount}}</span> <p>{{scope.row.leaderName}}</p>
<p>{{scope.row.leaderPhone}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="110" align="center" label="状态"> <el-table-column width="130" align="center" label="促成人姓名/手机号">
<template scope="scope"> <template scope="scope">
<span v-if="scope.row.status == '2'">取消</span> <p>{{scope.row.facilitateName}}</p>
<span v-if="scope.row.status == '3'">待付款</span> <p>{{scope.row.facilitatePhone}}</p>
<span v-if="scope.row.status == '6'">已完成</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column width="150" align="center" label="手机号"> <el-table-column width="150" align="center" label="订单价格(元)">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.telephone}}</span> <span>{{scope.row.orderAmount}}</span>
</template> </template>
</el-table-column> --> </el-table-column>
<el-table-column width="180" align="center" label="创建时间"> <el-table-column width="180" align="center" label="优惠金额(元)">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.crtTime}}</span> <span>{{scope.row.couponAmount}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="180" align="center" label="更新时间"> <el-table-column width="180" align="center" label="实付金额(元)">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.updTime}}</span> <span>{{scope.row.realAmount}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="支付时间">
<template scope="scope">
<span>{{!!scope.row.payTime ? timestamp(new Date(scope.row.payTime)) : ''}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作" width="150"> <!-- <el-table-column align="center" label="操作" width="150">
...@@ -111,25 +190,31 @@ ...@@ -111,25 +190,31 @@
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">订单详情</el-button> <el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">订单详情</el-button>
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">操作</el-button> <el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">操作</el-button>
</template> </template>
</el-table-column> --> </el-table-column>-->
</el-table> </el-table>
<div v-show="!listLoading" class="pagination-container"> <div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" <el-pagination
:current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination> @current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import { pageList, orderMemberExcel } from 'api/order/rentVehicle'
page import { mapGetters } from 'vuex'
} from 'api/order/rentVehicle'; import rsCode from '../../../utils/rsCode'
import { mapGetters } from 'vuex'; // import dataFormattor from '../../../utils/dataFormattor'
import rsCode from '../../../utils/rsCode'; import { formatDate } from 'utils/dateFormattor'
export default { export default {
name: 'branchCompanyStock', name: 'branchCompanyStock',
data() { data() {
return { return {
...@@ -165,201 +250,263 @@ ...@@ -165,201 +250,263 @@
label: '确认购买' label: '确认购买'
} }
}, },
statistics: [],
list: null, list: null,
total: null, total: null,
listLoading: true, listLoading: true,
listQuery: { listQuery: {
page: 1, page: 1,
limit: 20, limit: 20,
type: 3, // type: 3,
no: undefined, orderNo: undefined,
phone:undefined, phone: undefined,
status:null, state: null,
startTime: undefined, startTime: undefined,
endTime:undefined, endTime: undefined,
memberLevel:undefined level: undefined,
leaderPhone: null,
facilitatePhone: null,
startOrderTime: null,
endOrderTime: null,
startPayTime: null,
endPayTime: null,
isExport: false,
name: null
}, },
createTime: null,
aplyTime: null,
dialogFormVisible: false, dialogFormVisible: false,
dialogStatus: '', dialogStatus: '',
btn_del: true, btn_del: true,
btn_buy: true, btn_buy: true,
btn_cancel: true, btn_cancel: true,
tableKey: 0 tableKey: 0,
query:null,
} }
}, },
created() { created() {
let t = this; let t = this
let query = localStorage.getItem("memberOrderInfo"); this.query = localStorage.getItem('memberOrderInfo')
this.listQuery.no = this.$route.query.id || null this.listQuery.orderNo = this.$route.query.id || null
if(query !="null" && query){ if (this.query != 'null' && this.query) {
let queryJson = JSON.parse(query); let queryJson = JSON.parse(this.query)
if(queryJson.page){ if (queryJson.page) {
t.listQuery.page = queryJson.page; t.listQuery.page = queryJson.page
} }
if(queryJson.limit){ if (queryJson.limit) {
t.listQuery.limit = queryJson.limit; t.listQuery.limit = queryJson.limit
} }
if(queryJson.no){ if (queryJson.orderNo) {
t.listQuery.no = queryJson.no; t.listQuery.orderNo = queryJson.orderNo
} }
if(queryJson.type){ if (queryJson.type) {
t.listQuery.type = queryJson.type; t.listQuery.type = queryJson.type
} }
// if(queryJson.startTime){ // if(queryJson.startTime){
// t.listQuery.startTime = queryJson.startTime; // t.listQuery.startTime = queryJson.startTime;
// } // }
// if(queryJson.endTime){ // if(queryJson.endTime){
// t.listQuery.endTime = queryJson.endTime; // t.listQuery.endTime = queryJson.endTime;
// } // }
if(queryJson.status){ if (queryJson.state) {
t.listQuery.status = queryJson.status; t.listQuery.state = queryJson.state
} }
if(queryJson.phone){ if (queryJson.phone) {
t.listQuery.phone = queryJson.phone; t.listQuery.phone = queryJson.phone
} }
if(queryJson.memberLevel){ if (queryJson.level) {
t.listQuery.memberLevel = queryJson.memberLevel; t.listQuery.level = queryJson.level
} }
} }
this.getList(); this.getList()
this.btn_del = this.elements['branchCompany/stockApply:btn_delete']; this.btn_del = this.elements['branchCompany/stockApply:btn_delete']
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(['elements']),
'elements'
]),
provinceRegions() { provinceRegions() {
return getSonRegionByCodes(1); return getSonRegionByCodes(1)
}, },
cityRegions() { cityRegions() {
if (!this.$utils.isInteger(this.form.addrProvince)) { if (!this.$utils.isInteger(this.form.addrProvince)) {
return null; return null
} }
return getSonRegionByCodes(this.form.addrProvince); return getSonRegionByCodes(this.form.addrProvince)
} }
}, },
methods: { methods: {
timestamp(now) {
var year=now.getFullYear();
var month=now.getMonth()+1;
var date=now.getDate();
date = date.toString().length == 1 ? '0'+ date : date;
month = month.toString().length == 1 ? '0'+ month : month;
return year+"-"+month+"-"+date
},
excel() {
this.listQuery.isExport = true
orderMemberExcel(this.listQuery).then(res => {
const content = res
const blob = new Blob([content])
const fileName = '导出信息.xlsx'
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName)
}
})
},
handleBuy(row) { handleBuy(row) {
this.$confirm('此操作将确认购买, 是否继续?', '提示', { this.$confirm('此操作将确认购买, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { buyStock(row.id).then(() => {
buyStock(row.id)
.then(() => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); })
this.getList(); this.getList()
}); })
}); })
}, },
handleCancel(row) { handleCancel(row) {
this.$confirm('此操作将放弃购买, 是否继续?', '提示', { this.$confirm('此操作将放弃购买, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { cancelApply(row.id).then(() => {
cancelApply(row.id)
.then(() => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); })
this.getList(); this.getList()
}); })
}); })
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', { this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { delObj(row.id).then(() => {
delObj(row.id)
.then(() => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '删除成功', message: '删除成功',
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); })
const index = this.list.indexOf(row); const index = this.list.indexOf(row)
this.list.splice(index, 1); this.list.splice(index, 1)
}); })
}); })
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1
this.$refs.queryForm.validate(valid => { this.$refs.queryForm.validate(valid => {
if (valid) { if (valid) {
this.getList(); this.getList()
} else { } else {
return false; return false
} }
}); })
}, },
clearSearch() { clearSearch() {
this.listQuery ={ this.listQuery = {
page: 1, page: 1,
limit: 20, limit: 20,
type: 3, type: 3,
no: undefined, orderNo: undefined,
phone:undefined, phone: undefined,
status:null, state: null,
startTime: undefined, startTime: undefined,
endTime:undefined, endTime: undefined,
memberLevel:undefined level: undefined,
} aplyTime: null,
leaderPhone: null,
facilitatePhone: null,
isExport: false,
endOrderTime: null,
startPayTime: null,
name: null
},
this.createTime = null,
this.aplyTime = null,
this.query = null,
this.getList() this.getList()
}, },
getList() { getList() {
this.listLoading = true; this.listLoading = true
console.log(this.listQuery) if (!!this.createTime && !!this.createTime[0]) {
if(this.listQuery.startTime){ this.listQuery.startOrderTime = formatDate(this.createTime[0], 'yyyy-MM-dd hh') +':00:00'
this.listQuery.startTime = this.listQuery.startTime.getTime(); this.listQuery.endOrderTime = formatDate(this.createTime[1], 'yyyy-MM-dd hh') +':00:00'
} }
if(this.listQuery.endTime){ if (!!this.aplyTime && !!this.aplyTime[0]) {
this.listQuery.endTime = this.listQuery.endTime.getTime(); this.listQuery.startPayTime = this.aplyTime[0].getTime()
this.listQuery.endPayTime = this.aplyTime[1].getTime()
} }
// if(this.listQuery.name == '1') { if (this.listQuery) {
// this.listQuery.name = "普通会员" localStorage.setItem(
// } else 'memberOrderInfo',
// if(this.listQuery.name == '2') { JSON.stringify(this.listQuery)
// this.listQuery.name = "黄金会员" )
// } else
// if(this.listQuery.name == '3') {
// this.listQuery.name = "钻石会员"
// } else {
// this.listQuery.name = null
// }
if(this.listQuery){
localStorage.setItem("memberOrderInfo", JSON.stringify(this.listQuery));
} }
page(this.listQuery) pageList(this.listQuery).then(response => {
.then(response => { console.log(response);
this.list = response.data.data; this.list = response.data.memberOrderPage.data
this.total = response.data.totalCount; this.statistics = response.data.memberOrderStatisticsBo
this.listLoading = false; this.total = response.data.memberOrderPage.totalCount
}) })
setTimeout(() => {
this.listLoading = false
}, 300)
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.listQuery.limit = val; this.listQuery.limit = val
this.getList(); this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.listQuery.page = val; this.listQuery.page = val
this.getList(); this.getList()
}
} }
} }
}
</script> </script>
<style>
.el-card__body {
overflow: hidden;
padding: 0;
width: 100%;
display: inline-block;
}
.num-title {
display: inline-block;
float: left;
margin-right: 32px;
}
.box-card li {
list-style: none;
float: left;
text-align: center;
width: 12.5%;
}
</style>
\ No newline at end of file
...@@ -416,7 +416,6 @@ ...@@ -416,7 +416,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -426,7 +425,6 @@ ...@@ -426,7 +425,6 @@
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div>
<!-- 对话框相关html元素 --> <!-- 对话框相关html元素 -->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" @close="closePop"> <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" @close="closePop">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment