Commit e8ec346e by 吕明尚

根据测试用例进行修改

parent 3cf931f4
<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="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="创建时间" prop="startDate"> <el-form-item label="所属门店" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择所属门店" @change="onGetRoomListByStoreId">
<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="roomId">
<el-select v-model="queryParams.roomId" placeholder="请选择所属房间" clearable>
<el-option
v-for="item in rooms"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.createTime" v-model="queryParams.createTime"
type="date" type="date"
...@@ -190,6 +211,8 @@ ...@@ -190,6 +211,8 @@
<script> <script>
import { listCleanRecords, getCleanRecords, addCleanRecords, updateCleanRecords, delCleanRecords } from "@/api/system/cleanRecords"; import { listCleanRecords, getCleanRecords, addCleanRecords, updateCleanRecords, delCleanRecords } from "@/api/system/cleanRecords";
import {allList} from "@/api/system/store";
import {queryRoom} from "@/api/system/room";
export default { export default {
name: "Records", name: "Records",
...@@ -210,6 +233,8 @@ export default { ...@@ -210,6 +233,8 @@ export default {
total: 0, total: 0,
// 保洁记录表格数据 // 保洁记录表格数据
recordsList: [], recordsList: [],
options: [],
rooms: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -222,6 +247,8 @@ export default { ...@@ -222,6 +247,8 @@ export default {
endDate: null, endDate: null,
createTime: null, createTime: null,
status: null, status: null,
storeId: null,
roomId: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -238,8 +265,14 @@ export default { ...@@ -238,8 +265,14 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.onGetAllStoreList();
}, },
methods: { methods: {
onGetAllStoreList() {
allList().then(res => {
this.options = res.data
})
},
/** 查询保洁记录列表 */ /** 查询保洁记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -281,6 +314,7 @@ export default { ...@@ -281,6 +314,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.rooms = [];
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -340,6 +374,12 @@ export default { ...@@ -340,6 +374,12 @@ export default {
this.download('system/records/export', { this.download('system/records/export', {
...this.queryParams ...this.queryParams
}, `records_${new Date().getTime()}.xlsx`) }, `records_${new Date().getTime()}.xlsx`)
},
onGetRoomListByStoreId(id) {
this.queryParams.roomId = null;
queryRoom().then(res => {
this.rooms = res.data.filter(item => item.storeId === id)
})
} }
} }
}; };
......
...@@ -31,7 +31,24 @@ ...@@ -31,7 +31,24 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="充值余额" prop="amount">--> <el-form-item label="充值余额" prop="amount">
<el-input
v-model="queryParams.amount"
placeholder="请输入充值余额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="赠送余额" prop="freeAmount">
<el-input
v-model="queryParams.freeAmount"
placeholder="请输入赠送余额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="充值余额" prop="amount">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.amount"--> <!-- v-model="queryParams.amount"-->
<!-- placeholder="请输入充值余额"--> <!-- placeholder="请输入充值余额"-->
......
...@@ -98,6 +98,18 @@ ...@@ -98,6 +98,18 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="预约时间">
<el-date-picker
v-model="preDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:default-time="['00:00:00', '23:59:59']">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="开始时间" prop="startDate">--> <!-- <el-form-item label="开始时间" prop="startDate">-->
<!-- <el-date-picker clearable--> <!-- <el-date-picker clearable-->
<!-- v-model="queryParams.startDate"--> <!-- v-model="queryParams.startDate"-->
...@@ -439,6 +451,7 @@ export default { ...@@ -439,6 +451,7 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
dateValue: null, dateValue: null,
preDate: null,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -536,6 +549,14 @@ export default { ...@@ -536,6 +549,14 @@ export default {
this.queryParams.startDate = null; this.queryParams.startDate = null;
this.queryParams.endDate = null; this.queryParams.endDate = null;
} }
if (this.preDate && this.preDate.length > 0) {
this.queryParams.preStartDate = this.preDate[0];
this.queryParams.preEndDate = this.preDate[1];
} else {
this.queryParams.preStartDate = null;
this.queryParams.preEndDate = null;
}
this.loading = true; this.loading = true;
listOrder(this.queryParams).then(response => { listOrder(this.queryParams).then(response => {
this.orderList = response.rows; this.orderList = response.rows;
...@@ -591,6 +612,7 @@ export default { ...@@ -591,6 +612,7 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.dateValue = null; this.dateValue = null;
this.handleQuery(); this.handleQuery();
this.rooms = [];
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
......
...@@ -282,6 +282,17 @@ export default { ...@@ -282,6 +282,17 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
//判断时长为数字,不得为负数,字符串
if (this.queryParams.duration != null) {
if (isNaN(this.queryParams.duration)) {
this.$modal.msgError("时长必须为数字");
return;
}
if (this.queryParams.duration < 0) {
this.$modal.msgError("时长不得为负数");
return;
}
}
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
...@@ -336,10 +347,11 @@ export default { ...@@ -336,10 +347,11 @@ export default {
handleDelete(row) { handleDelete(row) {
getRoomPack(row.id).then(response => { getRoomPack(row.id).then(response => {
let roomnNameStr = `是否确认删除${row.name}的数据?` let roomnNameStr = `是否确认删除${row.name}的数据?`
if(response.data.length>0){ // if(response.data.length>0){
let str = response.data.map(item=>item.roomName).join("、") // let str = response.data.map(item=>item.roomName).join("、")
roomnNameStr = `是否确认删除${row.name}数据及其关联的房间${str}下的绑定套餐?` // roomnNameStr = `是否确认删除${row.name}数据及其关联的房间${str}下的绑定套餐?`
} // }
this.$modal.confirm(roomnNameStr).then((result) =>{ this.$modal.confirm(roomnNameStr).then((result) =>{
return delPack(row.id); return delPack(row.id);
}).then(() => { }).then(() => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属门店" prop="storeId"> <el-form-item label="所属门店" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择所属门店"> <el-select v-model="queryParams.storeId" placeholder="请选择所属门店" clearable>
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.id" :key="item.id"
...@@ -215,6 +215,16 @@ ...@@ -215,6 +215,16 @@
<el-form-item label="房间单价" prop="price" required> <el-form-item label="房间单价" prop="price" required>
<el-input v-model="form.price" placeholder="请输入房间单价(默认单位:元/小时)" /> <el-input v-model="form.price" placeholder="请输入房间单价(默认单位:元/小时)" />
</el-form-item> </el-form-item>
<el-form-item label="房间状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.store_room_status"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="套餐" prop="packIds"> <el-form-item label="套餐" prop="packIds">
<div style="display: flex;flex-direction: row;align-items: center;width: 100%;"> <div style="display: flex;flex-direction: row;align-items: center;width: 100%;">
<el-select style="width: 100%;" v-model="packIds" multiple placeholder="套餐" @change="onChangePackId"> <el-select style="width: 100%;" v-model="packIds" multiple placeholder="套餐" @change="onChangePackId">
...@@ -459,6 +469,13 @@ export default { ...@@ -459,6 +469,13 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
//校验查询price条件是否为数字,可以是负数,可以为正常小数,不能是字符串
if (this.queryParams.price) {
if (!/^-?\d+(\.\d+)?$/.test(this.queryParams.price)) {
this.$modal.msgError("房间单价只能为数字");
return;
}
}
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
...@@ -490,6 +507,7 @@ export default { ...@@ -490,6 +507,7 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getRoom(id).then(response => { getRoom(id).then(response => {
this.form = response.data; this.form = response.data;
this.form.status = response.data.status.toString();
if(this.form.facilities){ if(this.form.facilities){
this.facilities = this.form.facilities.split(",") this.facilities = this.form.facilities.split(",")
} }
...@@ -529,6 +547,11 @@ export default { ...@@ -529,6 +547,11 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
// //判断状态是否为占用
if (row.status === 1) {
this.$modal.msgError("该房间已被占用,不能删除");
return;
}
this.$modal.confirm('是否确认删除房间编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除房间编号为"' + ids + '"的数据项?').then(function() {
return delRoom(ids); return delRoom(ids);
}).then(() => { }).then(() => {
......
...@@ -35,8 +35,8 @@ module.exports = { ...@@ -35,8 +35,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8882`, target: `http://localhost:8882`,
target: "http://192.168.43.21:8882", // target: "http://192.168.43.21:8882",
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
......
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