111
This commit is contained in:
parent
6d5c289044
commit
28cba33af0
|
@ -12,7 +12,7 @@ export function listEquipment(query) {
|
|||
// 查询设施详细
|
||||
export function getEquipment(equipmentId) {
|
||||
return request({
|
||||
url: '/system/hallEqu/' + equipmentId,
|
||||
url: '/system/room/' + equipmentId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export function getEquipment(equipmentId) {
|
|||
// 新增设施
|
||||
export function addEquipment(data) {
|
||||
return request({
|
||||
url: '/system/hallEqu',
|
||||
url: '/system/room',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -29,7 +29,7 @@ export function addEquipment(data) {
|
|||
// 修改设施
|
||||
export function updateEquipment(data) {
|
||||
return request({
|
||||
url: '/system/hallEqu',
|
||||
url: '/system/room',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
@ -38,7 +38,7 @@ export function updateEquipment(data) {
|
|||
// 删除设施
|
||||
export function delEquipment(equipmentId) {
|
||||
return request({
|
||||
url: '/system/hallEqu/' + equipmentId,
|
||||
url: '/system/room/' + equipmentId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ export function getRefund(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 新增退款
|
||||
export function addRefund(data) {
|
||||
// 退款
|
||||
export function refund(data) {
|
||||
return request({
|
||||
url: '/system/refund',
|
||||
method: 'post',
|
||||
|
|
87
src/views/system/order/components/RefundDialog.vue
Normal file
87
src/views/system/order/components/RefundDialog.vue
Normal file
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<!-- 退款 -->
|
||||
<el-dialog :visible.sync="showRefund" title="退款" width="400px" @open="onOpen">
|
||||
<el-form :model="form" :rules="rules">
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input-number v-model="form.amount" placeholder="请输入退款金额" /> 元
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitRefund" :loading="loading">确 定</el-button>
|
||||
<el-button @click="showRefund = false" >取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { refund } from '@/api/system/refund'
|
||||
|
||||
export default {
|
||||
name: "RefundDialog",
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
payId: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
amount: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showRefund: {
|
||||
get() {
|
||||
return this.show;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:show', val);
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
form: {},
|
||||
// 表单
|
||||
rules: {
|
||||
amount: [
|
||||
{ required: true, type: 'number', message: "退款金额不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.reset();
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
payId: this.payId,
|
||||
amount: this.amount,
|
||||
}
|
||||
},
|
||||
submitRefund() {
|
||||
this.loading = true;
|
||||
console.log("111111111111111-----{}",JSON.stringify(this.form))
|
||||
refund(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("操作成功");
|
||||
this.showRefund = false;
|
||||
this.$emit('success');
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -118,49 +118,32 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
v-has-permi="['system:room:query']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-card"
|
||||
@click="handleRefund(scope.row)"
|
||||
v-has-permi="['system:room:refund']"
|
||||
>退款</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
@click="handleClose(scope.row)"
|
||||
v-has-permi="['system:room:close']"
|
||||
>结束订单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">-->
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<!-- <el-table-column label="订单号" width="150" align="center" prop="orderNo" />-->
|
||||
<!-- <el-table-column label="用户" align="center" prop="userName" />-->
|
||||
<!-- <el-table-column label="支付单号" width="150" align="center" prop="outTradeNo" />-->
|
||||
<!--<!– <el-table-column label="手机号" align="center" prop="phone" />–>-->
|
||||
<!-- <el-table-column label="支付时间" align="center" prop="payTime" width="90">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="支付方式" align="center" prop="payType">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.ss_pay_type" :value="scope.row.payType"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="支付状态" align="center" prop="paid">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.et_order_pay_status" :value="scope.row.paid"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="类型" align="center" prop="type">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.ss_order_type" :value="scope.row.type"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="订单总金额" align="center" prop="totalFee" />-->
|
||||
<!-- <el-table-column label="实际支付金额" align="center" prop="payFee" />-->
|
||||
<!-- <el-table-column label="订单时长" align="center" prop="duration" />-->
|
||||
<!-- <el-table-column label="状态" align="center" prop="status">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.ss_order_status" :value="scope.row.status"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="手续费" align="center" prop="handlingCharge" />-->
|
||||
<!-- <el-table-column label="服务费" align="center" prop="platformServiceFee" />-->
|
||||
<!-- <el-table-column label="支付渠道" align="center" prop="channelName" />-->
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
|
@ -249,6 +232,9 @@
|
|||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--退款对话框-->
|
||||
<refund-dialog :show.sync="showRefund" :pay-id="row.payId" :amount="row.payFee" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -256,6 +242,7 @@
|
|||
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import {parseTime} from "../../../utils/ruoyi";
|
||||
import RefundDialog from "@/views/system/order/components/RefundDialog.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -265,6 +252,7 @@ const defaultSort = {
|
|||
export default {
|
||||
name: "Order",
|
||||
mixins: [$showColumns],
|
||||
components: { RefundDialog},
|
||||
dicts: ['ss_order_status', 'ss_pay_type', 'rl_distribution_mode', 'rl_rental_unit','ss_order_type','et_order_pay_status'],
|
||||
data() {
|
||||
return {
|
||||
|
@ -272,19 +260,28 @@ export default {
|
|||
columns: [
|
||||
{key: 'orderNo', visible: true, label: '订单号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'userName', visible: true, label: '用户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'storeName', visible: true, label: '店铺', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'room', visible: true, label: '房间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'equ', visible: true, label: '设施', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'outTradeNo', visible: true, label: '支付单号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'payTime', visible: true, label: '支付时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'payType', visible: true, label: '支付方式', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'payId', visible: true, label: '支付id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'paid', visible: true, label: '支付状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'channelName', visible: true, label: '支付渠道', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'totalFee', visible: true, label: '订单总金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'payFee', visible: true, label: '实际支付金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'refund', visible: true, label: '退款', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'duration', visible: true, label: '订单时长', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'time', visible: true, label: '预约时间()', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'rule', visible: true, label: '套餐', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'handlingCharge', visible: true, label: '手续费', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'platformServiceFee', visible: true, label: '服务费', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'channelName', visible: true, label: '支付渠道', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
row: {},
|
||||
showRefund: false,
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
|
@ -369,6 +366,29 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleClose(row) {
|
||||
this.$confirm(`确定结束订单【${row.billNo}】吗?`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// closeBill({billId: row.billId, totalEle: null}).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.$message.success("操作成功");
|
||||
// this.getList();
|
||||
// }
|
||||
// })
|
||||
})
|
||||
},
|
||||
// 查看详情
|
||||
handleView(row) {
|
||||
this.$router.push(`/system/order/${row.orderId}`)
|
||||
},
|
||||
// 处理退款
|
||||
handleRefund(row) {
|
||||
this.row = row;
|
||||
this.showRefund = true;
|
||||
},
|
||||
parseTime,
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable @change="handleQuery">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ss_room_type"
|
||||
:key="dict.value"
|
||||
|
@ -112,6 +112,9 @@
|
|||
<template v-else-if="column.key === 'type'">
|
||||
<dict-tag :options="dict.type.ss_room_type" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'type2'">
|
||||
<dict-tag :options="dict.type.ss_room_type2" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'tags'">
|
||||
<dict-tag :options="dict.type.ss_room_tags" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
|
@ -121,6 +124,11 @@
|
|||
<template v-else-if="column.key === 'status'">
|
||||
<dict-tag :options="dict.type.ss_room_status" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'feeRules'">
|
||||
<el-tooltip placement="top" :content="getFeeRulesExplain(d.row[column.key])">
|
||||
<span>{{ getFeeRulesExplain(d.row[column.key]) }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
|
@ -185,7 +193,12 @@
|
|||
<image-upload v-model="form.picture"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tags">
|
||||
<el-select v-model="form.tags" placeholder="请选择标签">
|
||||
<el-select
|
||||
v-model="form.tags"
|
||||
placeholder="请选择标签"
|
||||
clearable
|
||||
multiple
|
||||
style="width: auto; min-width: 240px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ss_room_tags"
|
||||
:key="dict.value"
|
||||
|
@ -194,9 +207,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specification">
|
||||
<el-input v-model="form.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -220,16 +231,17 @@ const defaultSort = {
|
|||
export default {
|
||||
name: "Room",
|
||||
mixins: [$showColumns],
|
||||
dicts: ['ss_room_type', 'ss_room_status','ss_room_tags'],
|
||||
dicts: ['ss_room_type', 'ss_room_type2', 'ss_room_status','ss_room_tags'],
|
||||
data() {
|
||||
return {
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'storeName', visible: true, label: '店铺', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'roomId', visible: true, label: '房间id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'roomName', visible: true, label: '房间名', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'storeName', visible: true, label: '店铺', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'picture', visible: true, label: '图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'feeRules', visible: true, label: '套餐', minWidth: null, sortable: false, overflow: true, align: 'center', width: null},
|
||||
{key: 'tags', visible: true, label: '标签', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
|
@ -264,9 +276,10 @@ export default {
|
|||
roomName: null,
|
||||
storeName: null,
|
||||
storeId: null,
|
||||
type: null,
|
||||
type: undefined,
|
||||
type2: "1",
|
||||
picture: null,
|
||||
tags: null,
|
||||
tags: [],
|
||||
specification: null,
|
||||
status: null,
|
||||
},
|
||||
|
@ -283,6 +296,9 @@ export default {
|
|||
type: [
|
||||
{ required: true, message: "类型不能为空", trigger: "blur" }
|
||||
],
|
||||
// type2: [
|
||||
// { required: true, message: "类型2不能为空", trigger: "blur" }
|
||||
// ],
|
||||
tags: [
|
||||
{ required: true, message: "标签不能为空", trigger: "change" }
|
||||
],
|
||||
|
@ -331,8 +347,9 @@ export default {
|
|||
roomName: undefined,
|
||||
storeId: undefined,
|
||||
type: undefined,
|
||||
type2: undefined,
|
||||
picture: undefined,
|
||||
tags: undefined,
|
||||
tags: [],
|
||||
specification: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
@ -340,11 +357,16 @@ export default {
|
|||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
if (Array.isArray(this.queryParams.tags) && this.queryParams.tags.length > 0) {
|
||||
this.queryParams.tags = this.queryParams.tags.join(',');
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.type = undefined;
|
||||
this.queryParams.tags = [];
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
|
@ -404,7 +426,68 @@ export default {
|
|||
this.download('system/room/export', {
|
||||
...this.queryParams
|
||||
}, `room_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
/** 获取套餐说明文字 */
|
||||
getFeeRulesExplain(feeRules) {
|
||||
if (!feeRules || !Array.isArray(feeRules)) {
|
||||
return '-';
|
||||
}
|
||||
return feeRules.map(rule => rule.explain).filter(Boolean).join(',');
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-select {
|
||||
:deep(.el-select__tags) {
|
||||
flex-wrap: wrap;
|
||||
// 标签换行显示
|
||||
.el-tag {
|
||||
margin: 2px;
|
||||
// 确保标签文字完整显示
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
// 输入框高度自适应
|
||||
:deep(.el-input__inner) {
|
||||
height: auto;
|
||||
min-height: 32px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
// 下拉选项样式优化
|
||||
.el-select-dropdown__item {
|
||||
padding: 0 10px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// 表单项样式优化
|
||||
.el-form-item {
|
||||
margin-bottom: 18px;
|
||||
|
||||
// 标签选择器容器自适应
|
||||
.el-select {
|
||||
width: auto;
|
||||
min-width: 240px;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
:deep(.el-tooltip__trigger) {
|
||||
display: inline-block;
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue
Block a user