Commit d0957a7f by zhangzhen

Merge branch 'master'

# Conflicts:
#	src/views/system/store/index.vue
parents e9a83b4e 93275fd5
## 开发
```bash
# 克隆项目
git clone https://gitee.com/y_project/RuoYi-Vue
# 进入项目目录
cd ruoyi-ui
# 安装依赖
npm install
......
import request from '@/utils/request'
export function allList() {
return request({
url: '/system/store/optionList',
method: 'get',
})
}
// 查询门店列表
export function listStore(query) {
return request({
......
<template>
<el-dialog
width='80%'
:visible.sync='show'
title='选择经纬度'
append-to-body
>
<section class='map-box'>
<div id='map_container_point'></div>
<div class='content'>
<div class='lng-lat'>
<span v-if='title' style='font-size: 20px;'>{{title}}</span>
<span>当前经纬度:</span>
<span style='color: #468cf0;font-size: 18px;'>{{ latlng.lng.toFixed(6) }}{{ latlng.lat.toFixed(6) }}</span>
<span>所属位置:{{ address }}</span>
</div>
<section class='list-box' v-if='list.length'>
<a-list item-layout='horizontal' :data-source='list'>
<a-list-item slot='renderItem' slot-scope='item, index'>
<div class='car-box-item cursor'>
<div class='flex-col'>
<span>{{ item.title }}</span>
<span style='color: #468cf0;'>{{ item.point.lng.toFixed(6) }}{{ item.point.lat.toFixed(6) }}</span>
</div>
<div class='flex-between'>
<span>{{ item.address }}</span>
<a-button type='primary' @click='onChoose(item)'>这里</a-button>
</div>
</div>
</a-list-item>
</a-list>
</section>
</div>
</section>
</el-dialog>
</template>
<script>
export default {
props: {
width: {
type: String,
default: '80vw'
},
height: {
type: String,
default: '500px'
},
latitude: {
default: 30.49984
},
longitude: {
default: 114.34253
}
},
data() {
return {
map: undefined,
show: false,
title:"",
address: '',
list: [],
latlng: {
lng: Number(this.longitude) ,
lat: Number(this.latitude)
}
}
},
methods: {
onShow() {
this.show = true
if (this.show) {
this.$nextTick(() => {
this.map = this.initMap({
tilt: 0,
heading: 0,
center: [this.longitude, this.latitude],
zoom: 12
})
this.onAddArrMarker()
})
}
},
onChoose(val) {
this.latlng = val.point
this.address = val.address;
this.title = val.title;
this.onAddArrMarker()
},
onCancel() {
this.show = false
},
onConfirm() {
this.show = false
this.$emit('confirm',this.latlng)
},
initMap(options) {
options = Object.assign({
tilt: 60,
heading: '选择经纬度'
}, options)
let map = new BMapGL.Map('map_container_point', {
restrictCenter: false
})
let mapType = map.getCoordType()
console.log(mapType,"地图使用的坐标类型")
map.enableKeyboard()
map.enableScrollWheelZoom()
map.enableInertialDragging()
map.enableContinuousZoom()
map.setMinZoom(5)
map.setMaxZoom(20)
map.setZoom(14)
map.setDisplayOptions(options.displayOptions || {
indoor: false,
poi: true,
skyColors: options.skyColors || [
'rgba(5, 5, 30, 0.01)',
'rgba(5, 5, 30, 1.0)'
]
})
if (options.center && options.zoom) {
let center = options.center
if (center instanceof Array) {
center = new BMapGL.Point(options.center[0], options.center[1])
}
map.centerAndZoom(center, options.zoom)
}
map.setTilt(options.tilt)
map.setHeading(options.heading)
map.addEventListener('click', (e) => {
console.log(e, 909090)
this.latlng = e.latlng
this.onAddArrMarker()
})
return map
},
onAddArrMarker() {
if (this.latlng) {
let that = this
this.map.setCenter(new BMapGL.Point(this.latlng.lng, this.latlng.lat))
let myGeo = new BMapGL.Geocoder()
myGeo.getLocation(new BMapGL.Point(this.latlng.lng, this.latlng.lat), (result) => {
if (result) {
that.address = result.address
that.list = result.surroundingPois
}
})
this.map.clearOverlays()
let point = new BMapGL.Point(this.latlng.lng, this.latlng.lat)
let marker = new BMapGL.Marker(point)
this.map.addOverlay(marker)
}
}
}
}
</script>
<style scoped lang='less'>
.map-box {
display: flex;
flex-direction: row;
width: 100%;
height: 500px;
margin: 0 auto;
.content {
display: flex;
flex-direction: column;
width: 20%;
height: 100%;
overflow: hidden;
.lng-lat {
width: 90%;
display: flex;
flex-direction: column;
margin: 0 auto;
border-bottom: 1px solid #e5e5e5;
}
}
}
#map_container_point {
width: 80%;
height: 100%;
}
.list-box {
margin-top: 12px;
width: 100%;
overflow-y: auto;
margin-left: 12px;
.car-box-item {
display: flex;
flex-direction: column;
align-items: center;
width: 96%;
margin: 0 auto;
> div {
width: 100%;
}
.flex-col {
display: flex;
flex-direction: column;
width: 100%;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
padding-right: 10px;
button{
padding: 0 4px;
}
}
}
}
</style>
......@@ -81,10 +81,11 @@
<el-table v-loading="loading" :data="recordsList" @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="所属门店" align="center" prop="storeName" />
<el-table-column label="房间名称" align="center" prop="roomName" />
<el-table-column label="开始时间" align="center" prop="startDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="保洁前照片" align="center" prop="startImage" width="100">
......@@ -94,7 +95,7 @@
</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>
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="保洁后照片" align="center" prop="endImage" width="100">
......@@ -107,6 +108,9 @@
<dict-tag :options="dict.type.clean_records_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="保洁人员" align="center" prop="cleanUser" />
<el-table-column label="联系方式" align="center" prop="phone" />
<el-table-column label="完成情况" align="center" prop="xx" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......
<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="开始时间" 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="status">
<el-select v-model="queryParams.status" placeholder="请选择保洁状态" clearable>
<el-option
v-for="dict in dict.type.clean_records_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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:records: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:records: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:records: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:records:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="微信ID" align="center" prop="openId" />
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="照片" align="center" prop="avatar" />
<el-table-column label="身份证号" align="center" prop="idCard" />
<el-table-column label="联系方式" align="center" prop="phone" />
<el-table-column label="工号" align="center" prop="code" />
<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:records:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:records: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="roomId">
<el-input v-model="form.roomId" placeholder="请输入房间ID" />
</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="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="startImage">
<image-upload v-model="form.startImage"/>
</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="endImage">
<image-upload v-model="form.endImage"/>
</el-form-item>
<el-form-item label="保洁状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.clean_records_status"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</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 { listCleanRecords, getCleanRecords, addCleanRecords, updateCleanRecords, delCleanRecords } from "@/api/system/cleanRecords";
export default {
name: "Records",
dicts: ['clean_records_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 保洁记录表格数据
recordsList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
startDate: null,
startImage: null,
endDate: null,
endImage: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
roomId: [
{ required: true, message: "房间ID不能为空", trigger: "blur" }
],
consumerId: [
{ required: true, message: "保洁人员ID不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询保洁记录列表 */
getList() {
this.loading = true;
listCleanRecords(this.queryParams).then(response => {
this.recordsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
roomId: null,
consumerId: null,
startDate: null,
startImage: null,
endDate: null,
endImage: null,
status: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: 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
getCleanRecords(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) {
updateCleanRecords(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCleanRecords(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 delCleanRecords(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/records/export', {
...this.queryParams
}, `records_${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="68px">
<el-form-item label="优惠券名称" prop="name" label-width="200">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="优惠券名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入优惠券名称"
......@@ -19,30 +19,7 @@
/>
</el-select>
</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="subPrice">
<el-input
v-model="queryParams.subPrice"
placeholder="请输入减去金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="第三方平台名称" prop="platform">
<el-input
v-model="queryParams.platform"
placeholder="请输入第三方平台名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="第三方平台类型" prop="platformType">
<el-select v-model="queryParams.platformType" placeholder="请选择第三方平台类型" clearable>
<el-option
......@@ -69,6 +46,16 @@
placeholder="请选择有效期结束">
</el-date-picker>
</el-form-item>
<el-form-item label="使用状态" prop="useStatus">
<el-select v-model="queryParams.useStatus" placeholder="请选择使用状态" clearable>
<el-option
v-for="dict in dict.type.coupon_use_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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>
......@@ -123,22 +110,18 @@
<el-table v-loading="loading" :data="couponList" @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="优惠券名称" align="center" prop="name" />
<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="name" />
<el-table-column label="手机号" align="center" prop="name" />
<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="minPrice" />
<el-table-column label="金额" align="center" prop="subPrice" />
<el-table-column label="第三方平台名称" align="center" prop="platform" />
<el-table-column label="第三方平台类型" align="center" prop="platformType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_platform_type" :value="scope.row.platformType"/>
</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>
......@@ -149,6 +132,11 @@
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="使用状态" align="center" prop="useStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.coupon_use_status" :value="scope.row.useStatus"/>
</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">
......@@ -195,18 +183,15 @@
</el-select>
</el-form-item>
<el-form-item label="时长" prop="duration">
<el-input v-model="form.duration" placeholder="请输入时长" />
<el-input-number v-model="form.duration" placeholder="请输入时长" />
</el-form-item>
<el-form-item label="满减最小可使用金额" prop="minPrice">
<el-form-item label="满金额" prop="minPrice">
<el-input v-model="form.minPrice" placeholder="请输入满减最小可使用金额" />
</el-form-item>
<el-form-item label="减去金额" prop="subPrice">
<el-form-item label="金额" prop="subPrice">
<el-input v-model="form.subPrice" placeholder="请输入减去金额" />
</el-form-item>
<el-form-item label="第三方平台名称" prop="platform">
<el-input v-model="form.platform" placeholder="请输入第三方平台名称" />
</el-form-item>
<el-form-item label="第三方平台类型(1:美团,2,大众点评)" prop="platformType">
<el-form-item label="第三方平台类型" prop="platformType">
<el-select v-model="form.platformType" placeholder="请选择第三方平台类型">
<el-option
v-for="dict in dict.type.store_platform_type"
......@@ -249,7 +234,7 @@ import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon } from "@/api
export default {
name: "Coupon",
dicts: ['store_platform_type', 'store_coupon_type'],
dicts: ['store_platform_type', 'store_coupon_type','coupon_use_status'],
data() {
return {
// 遮罩层
......@@ -279,7 +264,7 @@ export default {
duration: null,
minPrice: null,
subPrice: null,
platform: null,
useStatus: null,
platformType: null,
startDate: null,
endDate: null,
......
<template>
<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="120px">
<el-form-item label="订单类型" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>
<el-option
......@@ -19,14 +19,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<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="用户名称" prop="consumerName">
<el-input
v-model="queryParams.consumerName"
......@@ -43,14 +35,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单总价" prop="originalPrice">
<el-input
v-model="queryParams.originalPrice"
placeholder="请输入订单总价"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付方式" prop="payWays">
<el-input
v-model="queryParams.payWays"
......@@ -59,24 +43,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单实付" prop="realPrice">
<el-input
v-model="queryParams.realPrice"
placeholder="请输入订单实付"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否使用优惠券" prop="isUseCoupon">
<el-select v-model="queryParams.isUseCoupon" placeholder="请选择是否使用优惠券" clearable>
<el-option
v-for="dict in dict.type.store_is_use_coupon"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="优惠券类型" prop="couponType">
<el-select v-model="queryParams.couponType" placeholder="请选择优惠券类型" clearable>
<el-option
......@@ -95,14 +61,6 @@
@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="status">
<el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable>
<el-option
......@@ -183,35 +141,29 @@
<el-table v-loading="loading" :data="orderList" @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="订单类型" 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="serialNumber" />
<el-table-column label="用户ID" align="center" prop="consumerId" />
<el-table-column label="用户名称" align="center" prop="consumerName" />
<el-table-column label="会员昵称" align="center" prop="consumerName" />
<el-table-column label="手机号" align="center" prop="consumerName" />
<el-table-column label="消费描述" align="center" prop="description" />
<el-table-column label="订单总价" align="center" prop="originalPrice" />
<el-table-column label="应付金额" align="center" prop="originalPrice" />
<el-table-column label="支付方式" align="center" prop="payWays">
<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="realPrice" />
<el-table-column label="是否使用优惠券" align="center" prop="isUseCoupon">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_is_use_coupon" :value="scope.row.isUseCoupon"/>
</template>
</el-table-column>
<el-table-column label="优惠券类型" align="center" prop="couponType">
<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="优惠券id" align="center" prop="couponId" />
<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>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="门店" prop="storeId">
<el-input
v-model="queryParams.storeId"
placeholder="请输入门店"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属门店" prop="storeName">
<el-input
v-model="queryParams.storeName"
placeholder="请输入所属门店"
clearable
@keyup.enter.native="handleQuery"
/>
<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="name">
<el-input
......@@ -53,46 +47,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="门锁编码" prop="doorLockCode">
<el-input
v-model="queryParams.doorLockCode"
placeholder="请输入门锁编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="电控控制" prop="electricControlCode">
<el-input
v-model="queryParams.electricControlCode"
placeholder="请输入电控控制"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="门禁密码" prop="password">-->
<!-- <el-input-->
<!-- v-model="queryParams.password"-->
<!-- placeholder="请输入门禁密码"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="其他可能硬件接入参数" prop="params1">-->
<!-- <el-input-->
<!-- v-model="queryParams.params1"-->
<!-- placeholder="请输入其他可能硬件接入参数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="其他可能硬件接入参数" prop="params2">-->
<!-- <el-input-->
<!-- v-model="queryParams.params2"-->
<!-- placeholder="请输入其他可能硬件接入参数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </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>
......@@ -147,8 +101,6 @@
<el-table v-loading="loading" :data="roomList" @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="storeId" />
<el-table-column label="所属门店" align="center" prop="storeName" />
<el-table-column label="房间名称" align="center" prop="name" />
<el-table-column label="房间类型" align="center" prop="roomType">
......@@ -161,19 +113,19 @@
<image-preview :src="scope.row.images" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="房间设施" align="center" prop="facilities" />
<el-table-column label="房间详情介绍" align="center" prop="info" />
<el-table-column label="房间设施" align="center" prop="facilities" >
<template slot-scope="scope">
<div v-if="scope.row.facilities.length" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.facilities" :key="k" :options="dict.type.indoor_facilities" :value="item"/>
</div>
</template>
</el-table-column>
<el-table-column label="房间状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_room_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="房间单价" align="center" prop="price" />
<el-table-column label="门锁编码" align="center" prop="doorLockCode" />
<el-table-column label="电控控制" align="center" prop="electricControlCode" />
<el-table-column label="门禁密码" align="center" prop="password" />
<el-table-column label="其他可能硬件接入参数" align="center" prop="params1" />
<el-table-column label="其他可能硬件接入参数" align="center" prop="params2" />
<el-table-column label="房间单价" width="80" align="center" prop="price" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......@@ -204,15 +156,20 @@
/>
<!-- 添加或修改房间对话框 -->
<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="storeId">
<el-input v-model="form.storeId" placeholder="请输入门店ID" />
</el-form-item>
<el-form-item label="所属门店" prop="storeName">
<el-input v-model="form.storeName" placeholder="请输入所属门店" />
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="所属门店" prop="storeId">
<el-select v-model="form.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="name">
<el-form-item label="房间名称" prop="name" required>
<el-input v-model="form.name" placeholder="请输入房间名称" />
</el-form-item>
<el-form-item label="房间类型" prop="roomType">
......@@ -228,39 +185,22 @@
<el-form-item label="房间主图" prop="images">
<image-upload v-model="form.images"/>
</el-form-item>
<el-form-item label="房间设施(空调、外窗、沙发、茶几、、、)" prop="facilities">
<el-input v-model="form.facilities" placeholder="请输入房间设施" />
<el-form-item label="房间设施" prop="facilities">
<el-select style="width: 100%;" v-model="facilities" multiple placeholder="请选择房间设施" @change="onChange">
<el-option
v-for="dict in dict.type.indoor_facilities"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="房间详情介绍">
<editor v-model="form.info" :min-height="192"/>
</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="price">
<el-form-item label="房间单价" prop="price" required>
<el-input v-model="form.price" placeholder="请输入房间单价(默认单位:元/小时)" />
</el-form-item>
<el-form-item label="门锁编码" prop="doorLockCode">
<el-input v-model="form.doorLockCode" placeholder="请输入门锁编码" />
</el-form-item>
<el-form-item label="电控控制" prop="electricControlCode">
<el-input v-model="form.electricControlCode" placeholder="请输入电控控制" />
</el-form-item>
<el-form-item label="门禁密码" prop="password">
<el-input v-model="form.password" placeholder="请输入门禁密码(多人可设置多个)" />
</el-form-item>
<el-form-item label="其他可能硬件接入参数(备用1)" prop="params1">
<el-input v-model="form.params1" placeholder="请输入其他可能硬件接入参数(备用1)" />
</el-form-item>
<el-form-item label="其他可能硬件接入参数(备用2)" prop="params2">
<el-input v-model="form.params2" placeholder="请输入其他可能硬件接入参数(备用2)" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
......@@ -275,22 +215,25 @@
<script>
import { listRoom, getRoom, delRoom, addRoom, updateRoom } from "@/api/system/room";
import { allList } from '@/api/system/store'
export default {
name: "Room",
dicts: ['store_room_status', 'store_room_type'],
dicts: ['store_room_status', 'store_room_type','indoor_facilities'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
facilities:[],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
options: [],
// 总条数
total: 0,
// 房间表格数据
......@@ -323,23 +266,41 @@ export default {
// 表单校验
rules: {
storeId: [
{ required: true, message: "门店ID不能为空", trigger: "blur" }
{ required: true, message: "所属门店不能为空", trigger: "change" }
],
name: [
{ required: true, message: "房间名称不能为空", trigger: "blur" }
],
price: [
{ required: true, message: "房间单价(默认单位:元/小时)不能为空", trigger: "blur" }
{ required: true, message: "房间单价不能为空", trigger: "blur" }
],
}
};
},
created() {
this.onGetAllStoreList()
this.getList();
},
methods: {
onChange(e){
console.log(e)
this.form.facilities = e.join()
},
onGetAllStoreList(){
allList().then(res => {
this.options = res.data
})
},
/** 查询房间列表 */
getList() {
this.loading = true;
listRoom(this.queryParams).then(response => {
this.roomList = response.rows;
this.roomList = response.rows.map(item=>{
return {
...item,
facilities: item.facilities? item.facilities.split(","): []
}
});
this.total = response.total;
this.loading = false;
});
......@@ -351,6 +312,7 @@ export default {
},
// 表单重置
reset() {
this.facilities = []
this.form = {
id: null,
storeId: null,
......@@ -360,7 +322,7 @@ export default {
images: null,
facilities: null,
info: null,
status: null,
status: "0",
price: null,
doorLockCode: null,
electricControlCode: null,
......@@ -403,6 +365,9 @@ export default {
const id = row.id || this.ids
getRoom(id).then(response => {
this.form = response.data;
if(this.form.facilities){
this.facilities = this.form.facilities.split(",")
}
this.open = true;
this.title = "修改房间";
});
......
......@@ -95,10 +95,16 @@
<el-table v-loading="loading" :data="slotList" @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="套餐名称" align="center" prop="name" />
<el-table-column label="优惠名称" align="center" prop="name" />
<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="duration" />
<el-table-column label="总价" align="center" prop="totalPrice" />
<el-table-column label="满金额" align="center" prop="minPrice" />
<el-table-column label="金额" align="center" prop="subPrice" />
<el-table-column label="开始时间" align="center" prop="startDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
......
<template>
<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="100px">
<el-form-item label="门店名称" prop="name">
<el-input
v-model="queryParams.name"
......@@ -48,7 +48,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:store:add']"
>新增</el-button>
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -59,7 +60,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:store:edit']"
>修改</el-button>
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -70,7 +72,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:store:remove']"
>删除</el-button>
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -80,30 +83,44 @@
size="mini"
@click="handleExport"
v-hasPermi="['system:store:export']"
>导出</el-button>
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="storeList" @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="门店名称" align="center" prop="name" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="门店名称" align="center" prop="name"/>
<el-table-column label="门店类型" align="center" prop="storeType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_type" :value="scope.row.storeType"/>
</template>
</el-table-column>
<el-table-column label="门店主图" align="center" prop="images" width="100">
<el-table-column label="宣传图片" align="center" prop="images">
<template slot-scope="scope">
<image-preview :src="scope.row.images" :width="50" :height="50"/>
<div v-if="scope.row.images.length" style="display: flex;flex-direction: row;justify-content: center;width: 100%;">
<image-preview style="margin: 0 5px;" v-for="(val,i) in scope.row.images" :src="val" :key="i" :width="50"
:height="50"
/>
</div>
</template>
</el-table-column>
<el-table-column label="门店地址" align="center" prop="address" />
<el-table-column label="联系人" align="center" prop="manager" />
<el-table-column label="联系人电话" align="center" prop="phone" />
<el-table-column label="门店详情" align="center" prop="info" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="门店地址" align="center" prop="address"/>
<el-table-column label="营业时间" align="center" prop="openStartTime">
<template slot-scope="scope">
<span>{{ scope.row.openStartTime }}</span>-<span>{{ scope.row.openEndTime }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="manager"/>
<el-table-column label="联系人电话" align="center" prop="phone"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_status" :value="scope.row.status"/>
</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
......@@ -112,21 +129,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:store:edit']"
>修改</el-button>
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:store:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-user"
@click="handleCleanConsumer(scope.row)"
v-hasPermi="['system:store:edit']"
>分配保洁</el-button>
>删除
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -142,42 +154,74 @@
<!-- 添加或修改门店对话框 -->
<el-dialog :title="title" :visible.sync="open" width="55%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="门店名称" prop="name">
<el-input v-model="form.name" placeholder="请输入门店名称" />
<el-form-item label="门店名称" prop="name" required>
<el-input v-model="form.name" placeholder="请输入门店名称"/>
</el-form-item>
<el-form-item label="房间类型" prop="storeType">
<el-select v-model="form.storeType" placeholder="请选择门店类型">
<el-option
<el-form-item label="门店类型" prop="storeType">
<el-radio-group v-model="form.storeType">
<el-radio
v-for="dict in dict.type.store_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="门店主图" prop="images">
<el-form-item label="宣传图" prop="images" >
<image-upload v-model="form.images"/>
</el-form-item>
<el-form-item label="门店地址" prop="address">
<el-input v-model="form.address" placeholder="请输入门店地址" />
<el-input v-model="form.address" placeholder="请输入门店地址"/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
<el-form-item label="经度" prop="longitude" required>
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
<el-form-item label="纬度" prop="latitude" required>
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-form-item>
<el-form-item label="联系人" prop="manager">
<el-input v-model="form.manager" placeholder="请输入联系人" />
<el-input v-model="form.manager" placeholder="请输入联系人"/>
</el-form-item>
<el-form-item label="联系人电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系人电话" />
<el-input v-model="form.phone" placeholder="请输入联系人电话"/>
</el-form-item>
<el-form-item label="营业时间" prop="openStartTime">
<el-time-select
v-model="form.openStartTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '11:59'
}"
placeholder="请选择开始时间"
>
</el-time-select> -
<el-time-select
v-model="form.openEndTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '11:59'
}"
placeholder="请选择结束时间"
>
</el-time-select>
</el-form-item>
<el-form-item label="门店详情">
<editor v-model="form.info" :min-height="192"/>
</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_status"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -189,11 +233,11 @@
</template>
<script>
import { listStore, getStore, delStore, addStore, updateStore } from "@/api/system/store";
import { listStore, getStore, delStore, addStore, updateStore } from '@/api/system/store'
export default {
name: "Store",
dicts: ['store_type'],
name: 'Store',
dicts: ['store_status','store_type'],
data() {
return {
// 遮罩层
......@@ -211,7 +255,7 @@ export default {
// 门店表格数据
storeList: [],
// 弹出层标题
title: "",
title: '',
// 是否显示弹出层
open: false,
// 查询参数
......@@ -222,32 +266,49 @@ export default {
address: null,
manager: null,
phone: null,
info: null,
info: null
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{ required: true, message: "名称不能为空", trigger: "blur" }
],
address: [
{ required: true, message: "门店地址不能为空", trigger: "blur" }
],
longitude: [
{ required: true, message: "经度不能为空", trigger: "blur" }
],
latitude: [
{ required: true, message: "纬度不能为空", trigger: "blur" }
]
}
}
};
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询门店列表 */
getList() {
this.loading = true;
this.loading = true
listStore(this.queryParams).then(response => {
this.storeList = response.rows;
this.total = response.total;
this.loading = false;
});
this.storeList = response.rows.map(item => {
return {
...item,
images: item.images? item.images.split(',') : []
}
})
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
......@@ -259,83 +320,88 @@ export default {
longitude: null,
latitude: null,
manager: null,
storeType:'1',
phone: null,
info: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
status: '0',
remark: null,
openStartTime: '00:00',
storeType: "1",
openEndTime: '11:30'
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加门店";
this.reset()
this.open = true
this.title = '添加门店'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const id = row.id || this.ids
getStore(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改门店";
});
},
/** 分配用户操作 */
handleCleanConsumer: function(row) {
const storeId = row.id;
this.$router.push("/share/store-consumer/clean/" + storeId);
this.form = {
...response.data,
images: response.data.images? response.data.images.split(',') : []
}
this.open = true
this.title = '修改门店'
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
if(this.form.images && Array.isArray(this.form.images) && this.form.images.length){
this.form.images = this.form.images.join()
}
updateStore(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addStore(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除门店编号为"' + ids + '"的数据项?').then(function() {
return delStore(ids);
return delStore(ids)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
......@@ -344,5 +410,5 @@ export default {
}, `store_${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