Commit 480fa6aa by 吕明尚

更改订单管理页面

parent 350c911d
...@@ -56,3 +56,10 @@ export function oauthToken(code) { ...@@ -56,3 +56,10 @@ export function oauthToken(code) {
method: 'get' method: 'get'
}) })
} }
export function queryCouponList() {
return request({
url: '/system/consumerCoupon/query',
method: 'get'
})
}
...@@ -67,3 +67,10 @@ export function deleteRoomDevice(data) { ...@@ -67,3 +67,10 @@ export function deleteRoomDevice(data) {
data: data data: data
}) })
} }
export function queryRoom() {
return request({
url: '/system/room/query',
method: 'get'
})
}
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="所属门店" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择所属门店">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单类型" prop="orderType"> <el-form-item label="订单类型" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable> <el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>
<el-option <el-option
...@@ -11,9 +21,9 @@ ...@@ -11,9 +21,9 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="订单流水号" prop="serialNumber"> <el-form-item label="订单流水号" prop="orderNo">
<el-input <el-input
v-model="queryParams.serialNumber" v-model="queryParams.orderNo"
placeholder="请输入订单流水号" placeholder="请输入订单流水号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
...@@ -27,32 +37,26 @@ ...@@ -27,32 +37,26 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="消费描述" prop="description"> <el-form-item label="支付方式" prop="payType">
<el-input <el-select v-model="queryParams.payType" placeholder="请选择订单类型" clearable>
v-model="queryParams.description"
placeholder="请输入消费描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付方式" prop="payWays">
<el-input
v-model="queryParams.payWays"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠券类型" prop="couponType">
<el-select v-model="queryParams.couponType" placeholder="请选择优惠券类型" clearable>
<el-option <el-option
v-for="dict in dict.type.store_coupon_type" v-for="dict in dict.type.store_pay_ways"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="优惠券类型" prop="couponType">-->
<!-- <el-select v-model="queryParams.couponType" placeholder="请选择优惠券类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.store_coupon_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="优惠券名称" prop="couponName"> <el-form-item label="优惠券名称" prop="couponName">
<el-input <el-input
v-model="queryParams.couponName" v-model="queryParams.couponName"
...@@ -94,27 +98,27 @@ ...@@ -94,27 +98,27 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-hasPermi="['system:order:add']" <!-- v-hasPermi="['system:order:add']"-->
>新增</el-button> <!-- >新增</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="success" <!-- type="success"-->
plain <!-- plain-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
size="mini" <!-- size="mini"-->
:disabled="single" <!-- :disabled="single"-->
@click="handleUpdate" <!-- @click="handleUpdate"-->
v-hasPermi="['system:order:edit']" <!-- v-hasPermi="['system:order:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
...@@ -149,56 +153,93 @@ ...@@ -149,56 +153,93 @@
</el-table-column> </el-table-column>
<el-table-column label="会员昵称" align="center" prop="consumerName" /> <el-table-column label="会员昵称" align="center" prop="consumerName" />
<el-table-column label="手机号" align="center" prop="consumerPhone" /> <el-table-column label="手机号" align="center" prop="consumerPhone" />
<el-table-column label="门店ID" align="center" prop="storeId" /> <el-table-column label="门店名称" align="center" prop="storeId" >
<el-table-column label="房间ID" align="center" prop="roomId" /> <template slot-scope="scope">
<el-table-column label="套餐ID" align="center" prop="packId" /> <span v-for="item in options" v-if="scope.row.storeId === item.id">{{item.name}}</span>
</template>
</el-table-column>
<el-table-column label="房间名称" align="center" prop="roomId" >
<template slot-scope="scope">
<span v-for="item in roomList" v-if="scope.row.roomId === item.id">{{item.name}}</span>
</template>
</el-table-column>
<el-table-column label="套餐名称" align="center" prop="packId" >
<template slot-scope="scope">
<span v-for="item in packList" v-if="scope.row.packId === item.id">{{item.name}}</span>
</template>
</el-table-column>
<el-table-column label="套餐金额" align="center" prop="packPrice" /> <el-table-column label="套餐金额" align="center" prop="packPrice" />
<el-table-column label="优惠券id" align="center" prop="couponId" /> <el-table-column label="优惠券名称" align="center" prop="couponId" >
<el-table-column label="优惠券金额" align="center" prop="couponPrice" /> <template slot-scope="scope">
<el-table-column label="预约开始时间" align="center" prop="preStartDate" width="180"> <span v-for="item in couponList" v-if="scope.row.couponId === item.id">{{item.name}}</span>
</template>
</el-table-column>
<el-table-column label="优惠券金额" align="center" prop="couponPrice" >
<!--先判断couponPrice是否为空,为空,遍历couponList,获取值-->
<template slot-scope="scope">
<span v-if="scope.row.couponPrice === null">
<span v-for="item in couponList" v-if="scope.row.couponId === item.id">{{item.subPrice}}</span>
</span>
<span v-else>{{scope.row.couponPrice}}</span>
</template>
</el-table-column>
<el-table-column label="预约开始时间" align="center" prop="preStartDate" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.preStartDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.preStartDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预约结束时间" align="center" prop="preEndDate" width="180"> <el-table-column label="预约结束时间" align="center" prop="preEndDate" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.preEndDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.preEndDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开始时间" align="center" prop="startDate" width="180"> <el-table-column label="开始时间" align="center" prop="startDate" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" align="center" prop="endDate" width="180"> <el-table-column label="结束时间" align="center" prop="endDate" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单总价" align="center" prop="totalPrice" /> <el-table-column label="订单总价" align="center" prop="totalPrice" />
<el-table-column label="实际支付金额" align="center" prop="payPrice" /> <el-table-column label="实际支付金额" align="center" prop="payPrice" />
<el-table-column label="支付时间" align="center" prop="payTime" /> <el-table-column label="支付时间" align="center" prop="payTime" width="150" >
<el-table-column label="订单时长(H)" align="center" prop="timeLong" >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.timeLong, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="订单时长(H)" align="center" prop="timeLong"/>
<el-table-column label="支付类型" align="center" prop="payType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.store_pay_ways" :value="scope.row.payType"/>
</template>
</el-table-column>
<el-table-column label="支付状态" align="center" prop="payStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="支付类型" align="center" prop="payType" />
<el-table-column label="支付状态" align="center" prop="payStatus" />
<el-table-column label="订单状态" align="center" prop="status"> <el-table-column label="订单状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.store_order_status" :value="scope.row.status"/> <dict-tag :options="dict.type.store_order_status" :value="scope.row.status"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="下单时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
@click="handleUpdate(scope.row)" <!-- @click="handleUpdate(scope.row)"-->
v-hasPermi="['system:order:edit']" <!-- v-hasPermi="['system:order:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -332,16 +373,24 @@ ...@@ -332,16 +373,24 @@
<script> <script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order"; import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
import {allList} from "@/api/system/store";
import {queryRoom} from "@/api/system/room";
import {query} from "@/api/system/pack";
import {queryCouponList} from "@/api/system/consumerCoupon";
export default { export default {
name: "Order", name: "Order",
dicts: ['store_order_type', 'store_coupon_type', 'store_is_use_coupon', 'store_order_status'], dicts: ['store_order_type', 'store_coupon_type', 'store_is_use_coupon', 'store_order_status','store_pay_ways','order_pay_status'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
options: [],
roomList: [],
packList: [],
couponList: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -376,7 +425,9 @@ export default { ...@@ -376,7 +425,9 @@ export default {
startDate: null, startDate: null,
endDate: null, endDate: null,
preStartDate: null, preStartDate: null,
preEndDate: null preEndDate: null,
orderNo: null,
storeId: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -407,9 +458,33 @@ export default { ...@@ -407,9 +458,33 @@ export default {
}; };
}, },
created() { created() {
this.onGetRoomList();
this.getList(); this.getList();
this.onGetAllStoreList();
this.onGetPackList();
this.onGetCouponList();
}, },
methods: { methods: {
onGetAllStoreList(){
allList().then(res => {
this.options = res.data
})
},
onGetCouponList(){
queryCouponList().then(res => {
this.couponList = res.data
})
},
onGetRoomList(){
queryRoom().then(res => {
this.roomList = res.data
})
},
onGetPackList(){
query().then(res => {
this.packList = res.data
})
},
/** 查询订单列表 */ /** 查询订单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
...@@ -108,8 +108,7 @@ ...@@ -108,8 +108,7 @@
<el-table-column label="套餐结束时段" align="center" prop="packaEndPeriod" /> <el-table-column label="套餐结束时段" align="center" prop="packaEndPeriod" />
<el-table-column label="是否首次下单可用" align="center" prop="firstOrderAvailable" > <el-table-column label="是否首次下单可用" align="center" prop="firstOrderAvailable" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.firstOrderAvailable==1"></span> <dict-tag :options="dict.type.store_is_use_coupon" :value="scope.row.firstOrderAvailable"/>
<span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
...@@ -160,10 +159,13 @@ ...@@ -160,10 +159,13 @@
<el-input v-model="form.packaEndPeriod" placeholder="请输入套餐结束时段" /> <el-input v-model="form.packaEndPeriod" placeholder="请输入套餐结束时段" />
</el-form-item> </el-form-item>
<el-form-item label="是否首次下单可用" prop="firstOrderAvailable"> <el-form-item label="是否首次下单可用" prop="firstOrderAvailable">
<el-select v-model="form.firstOrderAvailable" placeholder="请选择是否首次下单可用" clearable> <el-radio-group v-model="form.firstOrderAvailable">
<el-option label="是" value="1" /> <el-radio
<el-option label="否" value="0" /> v-for="dict in dict.type.store_is_use_coupon"
</el-select> :key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
...@@ -184,6 +186,7 @@ import {getRoom, getRoomPack} from "@/api/system/room"; ...@@ -184,6 +186,7 @@ import {getRoom, getRoomPack} from "@/api/system/room";
let roomPackList = []; let roomPackList = [];
export default { export default {
name: "Pack", name: "Pack",
dicts: [ 'store_is_use_coupon'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
......
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