Commit fdf73390 by 吕明尚

增加退款订单页面,增加优惠卷领取记录页面

parent d2f99cce
import request from '@/utils/request'
// 查询优惠券领取记录列表
export function listConsumerCoupon(query) {
return request({
url: '/system/consumerCoupon/list',
method: 'get',
params: query
})
}
// 查询优惠券领取记录详细
export function getConsumerCoupon(id) {
return request({
url: '/system/consumerCoupon/' + id,
method: 'get'
})
}
// 新增优惠券领取记录
export function addConsumerCoupon(data) {
return request({
url: '/system/consumerCoupon',
method: 'post',
data: data
})
}
// 修改优惠券领取记录
export function updateConsumerCoupon(data) {
return request({
url: '/system/consumerCoupon',
method: 'put',
data: data
})
}
// 删除优惠券领取记录
export function delConsumerCoupon(id) {
return request({
url: '/system/consumerCoupon/' + id,
method: 'delete'
})
}
...@@ -9,6 +9,15 @@ export function listOrder(query) { ...@@ -9,6 +9,15 @@ export function listOrder(query) {
}) })
} }
// 查询订单列表
export function queryOrder(query) {
return request({
url: '/system/order/query',
method: 'get',
params: query
})
}
// 查询订单详细 // 查询订单详细
export function getOrder(id) { export function getOrder(id) {
return request({ return request({
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户ID" prop="consumerId">
<el-input
v-model="queryParams.consumerId"
placeholder="请输入用户ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠券ID" prop="couponId">
<el-input
v-model="queryParams.couponId"
placeholder="请输入优惠券ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠券编码" prop="couponCode">
<el-input
v-model="queryParams.couponCode"
placeholder="请输入优惠券编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠券名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入优惠券名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠开始" prop="couponTimeStart">
<el-input
v-model="queryParams.couponTimeStart"
placeholder="请输入优惠开始"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="优惠结束" prop="couponTimeEnd">
<el-input
v-model="queryParams.couponTimeEnd"
placeholder="请输入优惠结束"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="折扣最大时长" prop="maxDuration">
<el-input
v-model="queryParams.maxDuration"
placeholder="请输入折扣最大时长"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="时长" prop="duration">
<el-input
v-model="queryParams.duration"
placeholder="请输入时长"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="门槛金额" prop="minPrice">
<el-input
v-model="queryParams.minPrice"
placeholder="请输入门槛金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="减去金额" prop="subPrice">
<el-input
v-model="queryParams.subPrice"
placeholder="请输入减去金额(满减券单位:元,折扣为系数)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable
v-model="queryParams.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期开始">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期结束" prop="endDate">
<el-date-picker clearable
v-model="queryParams.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期结束">
</el-date-picker>
</el-form-item>
<el-form-item label="使用时间" prop="useDate">
<el-date-picker clearable
v-model="queryParams.useDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择使用时间">
</el-date-picker>
</el-form-item>
<el-form-item label="删除状态" prop="isDelete">
<el-input
v-model="queryParams.isDelete"
placeholder="请输入删除状态(0:未删除,1:已删除)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新者" prop="deleteBy">
<el-input
v-model="queryParams.deleteBy"
placeholder="请输入更新者"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新时间" prop="deleteTime">
<el-date-picker clearable
v-model="queryParams.deleteTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:consumerCoupon:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:consumerCoupon:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:consumerCoupon:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:consumerCoupon:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="consumerCouponList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="用户ID" align="center" prop="consumerId" />
<el-table-column label="优惠券ID" align="center" prop="couponId" />
<el-table-column label="优惠券编码" align="center" prop="couponCode" />
<el-table-column label="优惠券名称" align="center" prop="name" />
<el-table-column label="优惠房型" align="center" prop="roomType" />
<el-table-column label="优惠开始" align="center" prop="couponTimeStart" />
<el-table-column label="优惠结束" align="center" prop="couponTimeEnd" />
<el-table-column label="优惠券类型" align="center" prop="couponType" />
<el-table-column label="折扣最大时长" align="center" prop="maxDuration" />
<el-table-column label="时长" align="center" prop="duration" />
<el-table-column label="门槛金额" align="center" prop="minPrice" />
<el-table-column label="减去金额" align="center" prop="subPrice" />
<el-table-column label="优惠券来源" align="center" prop="sourceType" />
<el-table-column label="平台类型" align="center" prop="platformType" />
<el-table-column label="有效期开始" align="center" prop="startDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效期结束" align="center" prop="endDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="使用时间" align="center" prop="useDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.useDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="使用状态" align="center" prop="useStatus" />
<el-table-column label="删除状态" align="center" prop="isDelete" />
<el-table-column label="更新者" align="center" prop="deleteBy" />
<el-table-column label="更新时间" align="center" prop="deleteTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.deleteTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:consumerCoupon:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:consumerCoupon:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改优惠券领取记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID" />
</el-form-item>
<el-form-item label="优惠券ID" prop="couponId">
<el-input v-model="form.couponId" placeholder="请输入优惠券ID" />
</el-form-item>
<el-form-item label="优惠券编码" prop="couponCode">
<el-input v-model="form.couponCode" placeholder="请输入优惠券编码" />
</el-form-item>
<el-form-item label="优惠券名称" prop="name">
<el-input v-model="form.name" placeholder="请输入优惠券名称" />
</el-form-item>
<el-form-item label="优惠开始" prop="couponTimeStart">
<el-input v-model="form.couponTimeStart" placeholder="请输入优惠开始" />
</el-form-item>
<el-form-item label="优惠结束" prop="couponTimeEnd">
<el-input v-model="form.couponTimeEnd" placeholder="请输入优惠结束" />
</el-form-item>
<el-form-item label="折扣最大时长" prop="maxDuration">
<el-input v-model="form.maxDuration" placeholder="请输入折扣最大时长" />
</el-form-item>
<el-form-item label="时长" prop="duration">
<el-input v-model="form.duration" placeholder="请输入时长" />
</el-form-item>
<el-form-item label="门槛金额" prop="minPrice">
<el-input v-model="form.minPrice" placeholder="请输入门槛金额" />
</el-form-item>
<el-form-item label="减去金额(满减券单位:元,折扣为系数)" prop="subPrice">
<el-input v-model="form.subPrice" placeholder="请输入减去金额(满减券单位:元,折扣为系数)" />
</el-form-item>
<el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable
v-model="form.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期开始">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期结束" prop="endDate">
<el-date-picker clearable
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期结束">
</el-date-picker>
</el-form-item>
<el-form-item label="使用时间" prop="useDate">
<el-date-picker clearable
v-model="form.useDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择使用时间">
</el-date-picker>
</el-form-item>
<el-form-item label="删除状态(0:未删除,1:已删除)" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入删除状态(0:未删除,1:已删除)" />
</el-form-item>
<el-form-item label="更新者" prop="deleteBy">
<el-input v-model="form.deleteBy" placeholder="请输入更新者" />
</el-form-item>
<el-form-item label="更新时间" prop="deleteTime">
<el-date-picker clearable
v-model="form.deleteTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listConsumerCoupon, getConsumerCoupon, delConsumerCoupon, addConsumerCoupon, updateConsumerCoupon } from "@/api/system/consumerCoupon";
export default {
name: "ConsumerCoupon",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 优惠券领取记录表格数据
consumerCouponList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
consumerId: null,
couponId: null,
couponCode: null,
name: null,
roomType: null,
couponTimeStart: null,
couponTimeEnd: null,
couponType: null,
maxDuration: null,
duration: null,
minPrice: null,
subPrice: null,
sourceType: null,
platformType: null,
startDate: null,
endDate: null,
useDate: null,
useStatus: null,
isDelete: null,
deleteBy: null,
deleteTime: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
consumerId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
couponCode: [
{ required: true, message: "优惠券编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询优惠券领取记录列表 */
getList() {
this.loading = true;
listConsumerCoupon(this.queryParams).then(response => {
this.consumerCouponList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
consumerId: null,
couponId: null,
couponCode: null,
name: null,
roomType: null,
couponTimeStart: null,
couponTimeEnd: null,
couponType: null,
maxDuration: null,
duration: null,
minPrice: null,
subPrice: null,
sourceType: null,
platformType: null,
startDate: null,
endDate: null,
useDate: null,
useStatus: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deleteBy: null,
deleteTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加优惠券领取记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getConsumerCoupon(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改优惠券领取记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateConsumerCoupon(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addConsumerCoupon(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除优惠券领取记录编号为"' + ids + '"的数据项?').then(function() {
return delConsumerCoupon(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/consumerCoupon/export', {
...this.queryParams
}, `consumerCoupon_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<!-- <el-form-item label="订单类型" prop="orderType">-->
<!-- <el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.store_order_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单流水号" prop="serialNumber">-->
<!-- <el-input-->
<!-- v-model="queryParams.serialNumber"-->
<!-- placeholder="请输入订单流水号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="用户名称" prop="consumerName">-->
<!-- <el-input-->
<!-- v-model="queryParams.consumerName"-->
<!-- placeholder="请输入用户名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="消费描述" prop="description">-->
<!-- <el-input-->
<!-- 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-->
<!-- 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-input-->
<!-- v-model="queryParams.couponName"-->
<!-- placeholder="请输入优惠券名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单状态" prop="status">-->
<!-- <el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.store_order_status"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="startDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.startDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择开始时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束时间" prop="endDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.endDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择结束时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:order:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:order:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:order:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:order:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="订单编号" align="center" prop="orderNo" />
<el-table-column label="商户订单号" align="center" prop="outTradeNo" />
<el-table-column label="订单类型" align="center" prop="orderType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/>
</template>
</el-table-column>
<el-table-column label="支付类型" align="center" prop="payType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_pay_ways" :value="scope.row.payWays"/>
</template>
</el-table-column>
<el-table-column label="支付状态" align="center" prop="payStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_pay_ways" :value="scope.row.payWays"/>
</template>
</el-table-column>
<el-table-column label="门店ID" align="center" prop="storeId" />
<el-table-column label="房间ID" align="center" prop="roomId" />
<el-table-column label="会员昵称" align="center" prop="consumerName" />
<el-table-column label="手机号" align="center" prop="consumerPhone" />
<el-table-column label="套餐金额" align="center" prop="packPrice" />
<el-table-column label="优惠券金额" align="center" prop="couponPrice" />
<el-table-column label="订单总价" align="center" prop="totalPrice" />
<el-table-column label="实际支付金额" align="center" prop="payPrice" />
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="订单时长" align="center" prop="timeLong" />
<el-table-column label="退款说明" align="center" prop="refundReason" />
<el-table-column label="退款时间" align="center" prop="refundReasonTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.refundReasonTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="退款金额" align="center" prop="refundPrice" />
<!-- <el-table-column label="消费描述" align="center" prop="description" />-->
<!-- <el-table-column label="应付金额" align="center" prop="originalPrice" />-->
<!-- <el-table-column label="实付金额" align="center" prop="realPrice" />-->
<!-- <el-table-column label="优惠类型" align="center" prop="couponType">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="优惠额度" align="center" prop="realPrice" />-->
<!-- <el-table-column label="优惠券名称" align="center" prop="couponName" />-->
<!-- <el-table-column label="订单状态" align="center" prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.store_order_status" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="开始时间" align="center" prop="startDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="结束时间" align="center" prop="endDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="备注" align="center" prop="remark" />
<!-- <el-table-column label="预约开始时间" align="center" prop="preStartDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.preStartDate, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="预约结束时间" align="center" prop="preEndDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.preEndDate, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"
width="100"
fixed="right"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.refundStatus == '1'"
size="mini"
type="text"
icon="el-icon-s-check"
@click="onAudio(scope.row)"
>审批
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改订单对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!-- <el-form-item label="订单类型(0:订房订单,1:续房订单,2:充值订单)" prop="orderType">-->
<!-- <el-select v-model="form.orderType" placeholder="请选择订单类型(0:订房订单,1:续房订单,2:充值订单)">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.store_order_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="parseInt(dict.value)"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单流水号" prop="serialNumber">-->
<!-- <el-input v-model="form.serialNumber" placeholder="请输入订单流水号" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="用户ID" prop="consumerId">-->
<!-- <el-input v-model="form.consumerId" placeholder="请输入用户ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="用户名称" prop="consumerName">-->
<!-- <el-input v-model="form.consumerName" placeholder="请输入用户名称" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="消费描述(例:中包/4小时59套餐)" prop="description">-->
<!-- <el-input v-model="form.description" placeholder="请输入消费描述(例:中包/4小时59套餐)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单总价" prop="originalPrice">-->
<!-- <el-input v-model="form.originalPrice" placeholder="请输入订单总价" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="1.余额支付,2:微信支付" prop="payWays">-->
<!-- <el-input v-model="form.payWays" placeholder="请输入1.余额支付,2:微信支付" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单实付" prop="realPrice">-->
<!-- <el-input v-model="form.realPrice" placeholder="请输入订单实付" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否使用优惠券(0:否,1:是)" prop="isUseCoupon">-->
<!-- <el-radio-group v-model="form.isUseCoupon">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.store_is_use_coupon"-->
<!-- :key="dict.value"-->
<!-- :label="parseInt(dict.value)"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="优惠券类型" prop="couponType">-->
<!-- <el-select v-model="form.couponType" placeholder="请选择优惠券类型">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.store_coupon_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="优惠券名称" prop="couponName">-->
<!-- <el-input v-model="form.couponName" placeholder="请输入优惠券名称" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="优惠券id" prop="couponId">-->
<!-- <el-input v-model="form.couponId" placeholder="请输入优惠券id" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中,4:审核中,5:已退费)" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.store_order_status"-->
<!-- :key="dict.value"-->
<!-- :label="parseInt(dict.value)"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="startDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.startDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择开始时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束时间" prop="endDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.endDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择结束时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预约开始时间" prop="preStartDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.preStartDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择预约开始时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预约结束时间" prop="preEndDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.preEndDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择预约结束时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<el-dialog
title="提示"
:visible.sync="audioShow"
width="30%"
destroy-on-close
:before-close="handleClose">
<el-form ref="form" :model="audioForm" :rules="rules" label-width="80px">
<el-form-item label="退款说明" maxlength="40px">
<el-input v-model="audioForm.refundReason" maxlength="40px"/>
</el-form-item>
<el-form-item label="退款时间" >
<div class="block">
<el-date-picker
v-model="audioForm.refundReasonTime"
type="datetime"
:disabled="true"
placeholder="选择日期时间">
</el-date-picker>
</div>
<!-- <el-input v-model="audioForm.refundReasonTime" :disabled="true"/>-->
</el-form-item>
<el-form-item label="退款金额" >
<el-input v-model="audioForm.refundPrice" :disabled="true" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="onToAudio(0)"> </el-button>
<el-button type="primary" @click="onToAudio(2)"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {listOrder, getOrder, delOrder, addOrder, updateOrder, queryOrder} from "@/api/system/order";
import {allList} from "@/api/system/store";
export default {
name: "Order",
dicts: ['store_order_type', 'store_coupon_type', 'store_is_use_coupon', 'store_order_status'],
data() {
return {
audioForm: {
id: "",
refundReason: "",
refundReasonTime: "",
refundPrice: null,
refundStatus: 1
},
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 订单表格数据
orderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
audioShow: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
orderType: null,
serialNumber: null,
consumerId: null,
consumerName: null,
description: null,
originalPrice: null,
payWays: null,
realPrice: null,
isUseCoupon: null,
couponType: null,
couponName: null,
couponId: null,
status: null,
startDate: null,
endDate: null,
preStartDate: null,
preEndDate: null
},
// 表单参数
form: {},
// 表单校验
rules: {
orderType: [
{ required: true, message: "订单类型(0:订房订单,1:续房订单,2:充值订单)不能为空", trigger: "change" }
],
serialNumber: [
{ required: true, message: "订单流水号不能为空", trigger: "blur" }
],
consumerId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
originalPrice: [
{ required: true, message: "订单总价不能为空", trigger: "blur" }
],
payWays: [
{ required: true, message: "1.余额支付,2:微信支付不能为空", trigger: "blur" }
],
realPrice: [
{ required: true, message: "订单实付不能为空", trigger: "blur" }
],
isUseCoupon: [
{ required: true, message: "是否使用优惠券(0:否,1:是)不能为空", trigger: "change" }
],
}
};
},
created() {
this.getList();
},
methods: {
onAudio(row) {
if(row.refundStatus!=1){
this.$modal.msgWarning("审批状态未是审批中")
return
}
this.audioForm.id = row.id
this.audioForm.refundReason = row.refundReason
this.audioForm.refundReasonTime = row.refundReasonTime
this.audioForm.refundPrice = row.refundPrice
this.audioShow = true;
},
onToAudio(status) {
this.audioForm.refundStatus =status
this.onAudioComfirm()
},
onAudioComfirm(){
if(this.audioForm.refundStatus == 0 && !this.audioForm.refundReason.length){
this.$modal.msgWarning("请输入退款说明")
return
}
this.$modal.confirm(this.audioForm.refundStatus=="0"?"请确认驳回审核?":"请确认通过审核?").then((result) =>{
console.log(result,1111)
if(result === "confirm"){
updateOrder(this.audioForm).then(res =>{
if (res.code ){
this.$modal.msgSuccess("操作成功")
this.handleClose()
this.getList()
}else{
this.$modal.msgWarning("操作失败")
}
}).catch(err=>{
this.$modal.msgWarning("操作失败")
})
}
})
},
handleClose(data) {
this.open = false;
this.audioShow = false
},
/** 查询订单列表 */
getList() {
this.loading = true;
queryOrder(this.queryParams).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
orderType: null,
serialNumber: null,
consumerId: null,
consumerName: null,
description: null,
originalPrice: null,
payWays: null,
realPrice: null,
isUseCoupon: null,
couponType: null,
couponName: null,
couponId: null,
status: null,
startDate: null,
endDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
preStartDate: null,
preEndDate: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加订单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getOrder(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除订单编号为"' + ids + '"的数据项?').then(function() {
return delOrder(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/order/export', {
...this.queryParams
}, `order_${new Date().getTime()}.xlsx`)
}
}
};
</script>
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