Commit 34fbc487478dae46a7a50e89f042f61334582223

Authored by wuxw
1 parent 1c380d6d

完成预约功能

src/api/community/communitySpaceConfirmApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询核销订单列表
  4 +export function listCommunitySpaceConfirmOrder(params) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/communitySpace.listCommunitySpaceConfirmOrder',
  8 + method: 'get',
  9 + params
  10 + }).then(response => {
  11 + const res = response.data
  12 + if (res.code === 0) {
  13 + resolve({
  14 + data: res.data,
  15 + total: res.total
  16 + })
  17 + } else {
  18 + reject(new Error(res.msg || '获取核销列表失败'))
  19 + }
  20 + }).catch(error => {
  21 + reject(error)
  22 + })
  23 + })
  24 +}
  25 +
  26 +// 核销场地订单
  27 +export function saveCommunitySpaceConfirmOrder(data) {
  28 + return new Promise((resolve, reject) => {
  29 + request({
  30 + url: '/communitySpace.saveCommunitySpaceConfirmOrder',
  31 + method: 'post',
  32 + data
  33 + }).then(response => {
  34 + const res = response.data
  35 + if (res.code === 0) {
  36 + resolve(res)
  37 + } else {
  38 + reject(new Error(res.msg || '核销操作失败'))
  39 + }
  40 + }).catch(error => {
  41 + reject(error)
  42 + })
  43 + })
  44 +}
0 \ No newline at end of file 45 \ No newline at end of file
src/api/community/communitySpaceManageApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 查询场馆列表
  5 +export function listCommunityVenue(params) {
  6 + return new Promise((resolve, reject) => {
  7 + params.communityId = getCommunityId()
  8 + request({
  9 + url: '/communityVenue.listCommunityVenue',
  10 + method: 'get',
  11 + params
  12 + }).then(response => {
  13 + const res = response.data
  14 +
  15 + resolve(res)
  16 +
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 添加场馆
  24 +export function saveCommunityVenue(data) {
  25 + return new Promise((resolve, reject) => {
  26 + data.communityId = getCommunityId()
  27 + request({
  28 + url: '/communityVenue.saveCommunityVenue',
  29 + method: 'post',
  30 + data
  31 + }).then(response => {
  32 + const res = response.data
  33 + if (res.code === 0) {
  34 + resolve(res)
  35 + } else {
  36 + reject(new Error(res.msg || '添加场馆失败'))
  37 + }
  38 + }).catch(error => {
  39 + reject(error)
  40 + })
  41 + })
  42 +}
  43 +
  44 +// 修改场馆
  45 +export function updateCommunityVenue(data) {
  46 + return new Promise((resolve, reject) => {
  47 + data.communityId = getCommunityId()
  48 + request({
  49 + url: '/communityVenue.updateCommunityVenue',
  50 + method: 'post',
  51 + data
  52 + }).then(response => {
  53 + const res = response.data
  54 + if (res.code === 0) {
  55 + resolve(res)
  56 + } else {
  57 + reject(new Error(res.msg || '修改场馆失败'))
  58 + }
  59 + }).catch(error => {
  60 + reject(error)
  61 + })
  62 + })
  63 +}
  64 +
  65 +// 删除场馆
  66 +export function deleteCommunityVenue(venueId) {
  67 + return new Promise((resolve, reject) => {
  68 + const data = {
  69 + venueId,
  70 + communityId: getCommunityId()
  71 + }
  72 + request({
  73 + url: '/communityVenue.deleteCommunityVenue',
  74 + method: 'post',
  75 + data
  76 + }).then(response => {
  77 + const res = response.data
  78 + if (res.code === 0) {
  79 + resolve(res)
  80 + } else {
  81 + reject(new Error(res.msg || '删除场馆失败'))
  82 + }
  83 + }).catch(error => {
  84 + reject(error)
  85 + })
  86 + })
  87 +}
  88 +
  89 +// 查询场地列表
  90 +export function listCommunitySpace(params) {
  91 + return new Promise((resolve, reject) => {
  92 + params.communityId = getCommunityId()
  93 + request({
  94 + url: '/communitySpace.listCommunitySpace',
  95 + method: 'get',
  96 + params
  97 + }).then(response => {
  98 + const res = response.data
  99 + if (res.code === 0) {
  100 + resolve(res)
  101 + } else {
  102 + reject(new Error(res.msg || '获取场地列表失败'))
  103 + }
  104 + }).catch(error => {
  105 + reject(error)
  106 + })
  107 + })
  108 +}
  109 +
  110 +// 添加场地
  111 +export function saveCommunitySpace(data) {
  112 + return new Promise((resolve, reject) => {
  113 + data.communityId = getCommunityId()
  114 + request({
  115 + url: '/communitySpace.saveCommunitySpace',
  116 + method: 'post',
  117 + data
  118 + }).then(response => {
  119 + const res = response.data
  120 + if (res.code === 0) {
  121 + resolve(res)
  122 + } else {
  123 + reject(new Error(res.msg || '添加场地失败'))
  124 + }
  125 + }).catch(error => {
  126 + reject(error)
  127 + })
  128 + })
  129 +}
  130 +
  131 +// 修改场地
  132 +export function updateCommunitySpace(data) {
  133 + return new Promise((resolve, reject) => {
  134 + data.communityId = getCommunityId()
  135 + request({
  136 + url: '/communitySpace.updateCommunitySpace',
  137 + method: 'post',
  138 + data
  139 + }).then(response => {
  140 + const res = response.data
  141 + if (res.code === 0) {
  142 + resolve(res)
  143 + } else {
  144 + reject(new Error(res.msg || '修改场地失败'))
  145 + }
  146 + }).catch(error => {
  147 + reject(error)
  148 + })
  149 + })
  150 +}
  151 +
  152 +// 删除场地
  153 +export function deleteCommunitySpace(spaceId) {
  154 + return new Promise((resolve, reject) => {
  155 + const data = {
  156 + spaceId,
  157 + communityId: getCommunityId()
  158 + }
  159 + request({
  160 + url: '/communitySpace.deleteCommunitySpace',
  161 + method: 'post',
  162 + data
  163 + }).then(response => {
  164 + const res = response.data
  165 + if (res.code === 0) {
  166 + resolve(res)
  167 + } else {
  168 + reject(new Error(res.msg || '删除场地失败'))
  169 + }
  170 + }).catch(error => {
  171 + reject(error)
  172 + })
  173 + })
  174 +}
  175 +
  176 +// 更新开放时间
  177 +export function updateCommunitySpaceOpenTime(data) {
  178 + return new Promise((resolve, reject) => {
  179 + data.communityId = getCommunityId()
  180 + request({
  181 + url: '/communitySpaceOpenTime.updateCommunitySpaceOpenTime',
  182 + method: 'post',
  183 + data
  184 + }).then(response => {
  185 + const res = response.data
  186 + if (res.code === 0) {
  187 + resolve(res)
  188 + } else {
  189 + reject(new Error(res.msg || '更新开放时间失败'))
  190 + }
  191 + }).catch(error => {
  192 + reject(error)
  193 + })
  194 + })
  195 +}
0 \ No newline at end of file 196 \ No newline at end of file
src/api/community/communitySpacePersonManageApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询预约订单列表
  4 +export function listCommunitySpacePerson(params) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/communitySpace.listCommunitySpacePerson',
  8 + method: 'get',
  9 + params
  10 + }).then(response => {
  11 + const res = response.data
  12 + if (res.code === 0) {
  13 + resolve(res)
  14 + } else {
  15 + reject(new Error(res.msg || '获取预约订单列表失败'))
  16 + }
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 删除预约订单
  24 +export function deleteCommunitySpacePerson(data) {
  25 + return new Promise((resolve, reject) => {
  26 + request({
  27 + url: '/communitySpace.deleteCommunitySpacePerson',
  28 + method: 'post',
  29 + data
  30 + }).then(response => {
  31 + const res = response.data
  32 + if (res.code === 0) {
  33 + resolve(res)
  34 + } else {
  35 + reject(new Error(res.msg || '删除预约订单失败'))
  36 + }
  37 + }).catch(error => {
  38 + reject(error)
  39 + })
  40 + })
  41 +}
  42 +
  43 +// 查询场地列表
  44 +export function listCommunitySpace(params) {
  45 + return new Promise((resolve, reject) => {
  46 + request({
  47 + url: '/communitySpace.listCommunitySpace',
  48 + method: 'get',
  49 + params
  50 + }).then(response => {
  51 + const res = response.data
  52 + if (res.code === 0) {
  53 + resolve(res)
  54 + } else {
  55 + reject(new Error(res.msg || '获取场地列表失败'))
  56 + }
  57 + }).catch(error => {
  58 + reject(error)
  59 + })
  60 + })
  61 +}
0 \ No newline at end of file 62 \ No newline at end of file
src/api/community/reportCommunitySpaceApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 获取场馆列表
  4 +export function listCommunityVenue(params) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/communityVenue.listCommunityVenue',
  8 + method: 'get',
  9 + params
  10 + }).then(response => {
  11 + const res = response.data
  12 + if (res.code === 0) {
  13 + resolve(res.data)
  14 + } else {
  15 + reject(new Error(res.msg || '获取场馆列表失败'))
  16 + }
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 获取场地列表
  24 +export function listCommunitySpace(params) {
  25 + return new Promise((resolve, reject) => {
  26 + request({
  27 + url: '/communitySpace.listCommunitySpace',
  28 + method: 'get',
  29 + params
  30 + }).then(response => {
  31 + const res = response.data
  32 + if (res.code === 0) {
  33 + resolve(res.data)
  34 + } else {
  35 + reject(new Error(res.msg || '获取场地列表失败'))
  36 + }
  37 + }).catch(error => {
  38 + reject(error)
  39 + })
  40 + })
  41 +}
  42 +
  43 +// 获取场地预约记录
  44 +export function listCommunitySpacePerson(params) {
  45 + return new Promise((resolve, reject) => {
  46 + request({
  47 + url: '/communitySpace.listCommunitySpacePerson',
  48 + method: 'get',
  49 + params
  50 + }).then(response => {
  51 + const res = response.data
  52 + if (res.code === 0) {
  53 + resolve(res.data)
  54 + } else {
  55 + reject(new Error(res.msg || '获取场地预约记录失败'))
  56 + }
  57 + }).catch(error => {
  58 + reject(error)
  59 + })
  60 + })
  61 +}
  62 +
  63 +// 保存场地预约
  64 +export function saveCommunitySpacePerson(data) {
  65 + return new Promise((resolve, reject) => {
  66 + request({
  67 + url: '/communitySpace.saveCommunitySpacePerson',
  68 + method: 'post',
  69 + data
  70 + }).then(response => {
  71 + const res = response.data
  72 + if (res.code === 0) {
  73 + resolve(res)
  74 + } else {
  75 + reject(new Error(res.msg || '保存场地预约失败'))
  76 + }
  77 + }).catch(error => {
  78 + reject(error)
  79 + })
  80 + })
  81 +}
0 \ No newline at end of file 82 \ No newline at end of file
src/components/community/AddCommunitySpace.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('communitySpaceManage.addSpace')" :visible.sync="visible" width="50%" @close="resetForm">
  3 + <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  4 + <el-form-item :label="$t('communitySpaceManage.name')" prop="name">
  5 + <el-input v-model="form.name" :placeholder="$t('communitySpaceManage.selectSpace')" />
  6 + </el-form-item>
  7 +
  8 + <el-form-item :label="$t('communitySpaceManage.feeMoney')" prop="feeMoney">
  9 + <el-input v-model="form.feeMoney" :placeholder="$t('communitySpaceManage.selectSpace')" />
  10 + </el-form-item>
  11 +
  12 + <el-form-item :label="$t('communitySpaceManage.adminName')" prop="adminName">
  13 + <el-input v-model="form.adminName" :placeholder="$t('communitySpaceManage.selectSpace')" />
  14 + </el-form-item>
  15 +
  16 + <el-form-item :label="$t('communitySpaceManage.tel')" prop="tel">
  17 + <el-input v-model="form.tel" :placeholder="$t('communitySpaceManage.selectSpace')" />
  18 + </el-form-item>
  19 +
  20 + <el-form-item :label="$t('communitySpaceManage.state')" prop="state">
  21 + <el-select v-model="form.state" style="width:100%">
  22 + <el-option :label="$t('communitySpaceManage.status1001')" value="1001" />
  23 + <el-option :label="$t('communitySpaceManage.status2002')" value="2002" />
  24 + </el-select>
  25 + </el-form-item>
  26 + </el-form>
  27 +
  28 + <div slot="footer" class="dialog-footer">
  29 + <el-button @click="visible = false">
  30 + {{ $t('communitySpaceManage.cancel') }}
  31 + </el-button>
  32 + <el-button type="primary" @click="submitForm">
  33 + {{ $t('communitySpaceManage.save') }}
  34 + </el-button>
  35 + </div>
  36 + </el-dialog>
  37 +</template>
  38 +
  39 +<script>
  40 +import { saveCommunitySpace } from '@/api/community/communitySpaceManageApi'
  41 +
  42 +export default {
  43 + name: 'AddCommunitySpace',
  44 + data() {
  45 + return {
  46 + visible: false,
  47 + form: {
  48 + venueId: '',
  49 + name: '',
  50 + feeMoney: '',
  51 + startTime: '00:00',
  52 + endTime: '23:59',
  53 + adminName: '',
  54 + tel: '',
  55 + state: '1001'
  56 + },
  57 + rules: {
  58 + name: [
  59 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  60 + ],
  61 + feeMoney: [
  62 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  63 + ],
  64 + adminName: [
  65 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  66 + ],
  67 + tel: [
  68 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  69 + ],
  70 + state: [
  71 + { required: true, message: this.$t('communitySpaceManage.selectStatus'), trigger: 'change' }
  72 + ]
  73 + }
  74 + }
  75 + },
  76 + methods: {
  77 + open(venueId) {
  78 + this.form.venueId = venueId
  79 + this.visible = true
  80 + },
  81 +
  82 + resetForm() {
  83 + this.$refs.form.resetFields()
  84 + },
  85 +
  86 + submitForm() {
  87 + this.$refs.form.validate(async valid => {
  88 + if (valid) {
  89 + try {
  90 + await saveCommunitySpace(this.form)
  91 + this.$message.success(this.$t('common.success'))
  92 + this.visible = false
  93 + this.$emit('success')
  94 + } catch (error) {
  95 + console.error('添加场地失败:', error)
  96 + }
  97 + }
  98 + })
  99 + }
  100 + }
  101 +}
  102 +</script>
0 \ No newline at end of file 103 \ No newline at end of file
src/components/community/AddCommunityVenue.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.add') + $t('communitySpaceManage.venue')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="resetForm"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  9 + <el-form-item :label="$t('communitySpaceManage.venueName')" prop="name">
  10 + <el-input v-model="form.name" />
  11 + </el-form-item>
  12 +
  13 + <el-form-item :label="$t('communitySpaceManage.startTime')" prop="startTime">
  14 + <el-time-picker
  15 + v-model="form.startTime"
  16 + value-format="HH:mm"
  17 + placeholder="选择时间"
  18 + style="width:100%"
  19 + />
  20 + </el-form-item>
  21 +
  22 + <el-form-item :label="$t('communitySpaceManage.endTime')" prop="endTime">
  23 + <el-time-picker
  24 + v-model="form.endTime"
  25 + value-format="HH:mm"
  26 + placeholder="选择时间"
  27 + style="width:100%"
  28 + />
  29 + </el-form-item>
  30 +
  31 + <el-form-item :label="$t('communitySpaceManage.description')" prop="remark">
  32 + <el-input type="textarea" v-model="form.remark" />
  33 + </el-form-item>
  34 + </el-form>
  35 +
  36 + <div slot="footer" class="dialog-footer">
  37 + <el-button @click="visible = false">
  38 + {{ $t('communitySpaceManage.cancel') }}
  39 + </el-button>
  40 + <el-button type="primary" @click="submitForm">
  41 + {{ $t('communitySpaceManage.save') }}
  42 + </el-button>
  43 + </div>
  44 + </el-dialog>
  45 +</template>
  46 +
  47 +<script>
  48 +import { saveCommunityVenue } from '@/api/community/communitySpaceManageApi'
  49 +
  50 +export default {
  51 + name: 'AddCommunityVenue',
  52 + data() {
  53 + return {
  54 + visible: false,
  55 + form: {
  56 + name: '',
  57 + startTime: '08:00',
  58 + endTime: '22:00',
  59 + remark: ''
  60 + },
  61 + rules: {
  62 + name: [
  63 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'blur' }
  64 + ],
  65 + startTime: [
  66 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'change' }
  67 + ],
  68 + endTime: [
  69 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'change' }
  70 + ],
  71 + remark: [
  72 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'blur' }
  73 + ]
  74 + }
  75 + }
  76 + },
  77 + methods: {
  78 + open() {
  79 + this.visible = true
  80 + },
  81 +
  82 + resetForm() {
  83 + this.$refs.form.resetFields()
  84 + this.form.startTime = '08:00'
  85 + this.form.endTime = '22:00'
  86 + },
  87 +
  88 + submitForm() {
  89 + this.$refs.form.validate(async valid => {
  90 + if (valid) {
  91 + try {
  92 + await saveCommunityVenue(this.form)
  93 + this.$message.success(this.$t('common.success'))
  94 + this.visible = false
  95 + this.$emit('success')
  96 + } catch (error) {
  97 + console.error('添加场馆失败:', error)
  98 + }
  99 + }
  100 + })
  101 + }
  102 + }
  103 +}
  104 +</script>
0 \ No newline at end of file 105 \ No newline at end of file
src/components/community/DeleteCommunitySpace.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.confirmDelete')"
  4 + :visible.sync="visible"
  5 + width="30%"
  6 + >
  7 + <p>{{ $t('communitySpaceManage.confirmDeleteSpace') }}</p>
  8 + <div slot="footer" class="dialog-footer">
  9 + <el-button @click="visible = false">
  10 + {{ $t('communitySpaceManage.cancel') }}
  11 + </el-button>
  12 + <el-button type="danger" @click="confirmDelete">
  13 + {{ $t('communitySpaceManage.confirmDelete') }}
  14 + </el-button>
  15 + </div>
  16 + </el-dialog>
  17 +</template>
  18 +
  19 +<script>
  20 +import { deleteCommunitySpace } from '@/api/community/communitySpaceManageApi'
  21 +
  22 +export default {
  23 + name: 'DeleteCommunitySpace',
  24 + data() {
  25 + return {
  26 + visible: false,
  27 + spaceId: ''
  28 + }
  29 + },
  30 + methods: {
  31 + open(space) {
  32 + this.spaceId = space.spaceId
  33 + this.visible = true
  34 + },
  35 +
  36 + async confirmDelete() {
  37 + try {
  38 + await deleteCommunitySpace(this.spaceId)
  39 + this.$message.success(this.$t('common.success'))
  40 + this.visible = false
  41 + this.$emit('success')
  42 + } catch (error) {
  43 + console.error('删除场地失败:', error)
  44 + }
  45 + }
  46 + }
  47 +}
  48 +</script>
0 \ No newline at end of file 49 \ No newline at end of file
src/components/community/DeleteCommunityVenue.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.confirmDelete')"
  4 + :visible.sync="visible"
  5 + width="30%"
  6 + >
  7 + <p>{{ $t('communitySpaceManage.confirmDeleteVenue') }}</p>
  8 + <div slot="footer" class="dialog-footer">
  9 + <el-button @click="visible = false">
  10 + {{ $t('communitySpaceManage.cancel') }}
  11 + </el-button>
  12 + <el-button type="danger" @click="confirmDelete">
  13 + {{ $t('communitySpaceManage.confirmDelete') }}
  14 + </el-button>
  15 + </div>
  16 + </el-dialog>
  17 +</template>
  18 +
  19 +<script>
  20 +import { deleteCommunityVenue } from '@/api/community/communitySpaceManageApi'
  21 +
  22 +export default {
  23 + name: 'DeleteCommunityVenue',
  24 + data() {
  25 + return {
  26 + visible: false,
  27 + venueId: ''
  28 + }
  29 + },
  30 + methods: {
  31 + open(venue) {
  32 + this.venueId = venue.venueId
  33 + this.visible = true
  34 + },
  35 +
  36 + async confirmDelete() {
  37 + try {
  38 + await deleteCommunityVenue(this.venueId)
  39 + this.$message.success(this.$t('common.success'))
  40 + this.visible = false
  41 + this.$emit('success')
  42 + } catch (error) {
  43 + console.error('删除场馆失败:', error)
  44 + }
  45 + }
  46 + }
  47 +}
  48 +</script>
0 \ No newline at end of file 49 \ No newline at end of file
src/components/community/EditCommunitySpace.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.edit')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="resetForm"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  9 + <el-form-item :label="$t('communitySpaceManage.name')" prop="name">
  10 + <el-input v-model="form.name" />
  11 + </el-form-item>
  12 +
  13 + <el-form-item :label="$t('communitySpaceManage.feeMoney')" prop="feeMoney">
  14 + <el-input v-model="form.feeMoney" />
  15 + </el-form-item>
  16 +
  17 + <el-form-item :label="$t('communitySpaceManage.adminName')" prop="adminName">
  18 + <el-input v-model="form.adminName" />
  19 + </el-form-item>
  20 +
  21 + <el-form-item :label="$t('communitySpaceManage.tel')" prop="tel">
  22 + <el-input v-model="form.tel" />
  23 + </el-form-item>
  24 +
  25 + <el-form-item :label="$t('communitySpaceManage.state')" prop="state">
  26 + <el-select v-model="form.state" style="width:100%">
  27 + <el-option
  28 + :label="$t('communitySpaceManage.status1001')"
  29 + value="1001"
  30 + />
  31 + <el-option
  32 + :label="$t('communitySpaceManage.status2002')"
  33 + value="2002"
  34 + />
  35 + </el-select>
  36 + </el-form-item>
  37 + </el-form>
  38 +
  39 + <div slot="footer" class="dialog-footer">
  40 + <el-button @click="visible = false">
  41 + {{ $t('communitySpaceManage.cancel') }}
  42 + </el-button>
  43 + <el-button type="primary" @click="submitForm">
  44 + {{ $t('communitySpaceManage.save') }}
  45 + </el-button>
  46 + </div>
  47 + </el-dialog>
  48 +</template>
  49 +
  50 +<script>
  51 +import { updateCommunitySpace } from '@/api/community/communitySpaceManageApi'
  52 +
  53 +export default {
  54 + name: 'EditCommunitySpace',
  55 + data() {
  56 + return {
  57 + visible: false,
  58 + form: {
  59 + spaceId: '',
  60 + name: '',
  61 + feeMoney: '',
  62 + adminName: '',
  63 + tel: '',
  64 + state: '1001'
  65 + },
  66 + rules: {
  67 + name: [
  68 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  69 + ],
  70 + feeMoney: [
  71 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  72 + ],
  73 + adminName: [
  74 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  75 + ],
  76 + tel: [
  77 + { required: true, message: this.$t('communitySpaceManage.selectSpace'), trigger: 'blur' }
  78 + ],
  79 + state: [
  80 + { required: true, message: this.$t('communitySpaceManage.selectStatus'), trigger: 'change' }
  81 + ]
  82 + }
  83 + }
  84 + },
  85 + methods: {
  86 + open(space) {
  87 + this.form = { ...space }
  88 + this.visible = true
  89 + },
  90 +
  91 + resetForm() {
  92 + this.$refs.form.resetFields()
  93 + },
  94 +
  95 + submitForm() {
  96 + this.$refs.form.validate(async valid => {
  97 + if (valid) {
  98 + try {
  99 + await updateCommunitySpace(this.form)
  100 + this.$message.success(this.$t('common.success'))
  101 + this.visible = false
  102 + this.$emit('success')
  103 + } catch (error) {
  104 + console.error('修改场地失败:', error)
  105 + }
  106 + }
  107 + })
  108 + }
  109 + }
  110 +}
  111 +</script>
0 \ No newline at end of file 112 \ No newline at end of file
src/components/community/EditCommunitySpaceOpenTime.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.openTimeTitle')"
  4 + :visible.sync="visible"
  5 + width="70%"
  6 + >
  7 + <el-row :gutter="20">
  8 + <el-col :span="6" v-for="(item, index) in openTimes" :key="index">
  9 + <div class="time-item">
  10 + <span>{{ item.hours }}{{ $t('common.hour') }}</span>
  11 + <el-select v-model="item.isOpen" @change="updateOpenTime(item)" style="width:100%">
  12 + <el-option
  13 + :label="$t('communitySpaceManage.status1001')"
  14 + value="Y"
  15 + />
  16 + <el-option
  17 + :label="$t('communitySpaceManage.status2002')"
  18 + value="N"
  19 + />
  20 + </el-select>
  21 + </div>
  22 + </el-col>
  23 + </el-row>
  24 +
  25 + <div slot="footer" class="dialog-footer">
  26 + <el-button @click="visible = false">
  27 + {{ $t('communitySpaceManage.cancel') }}
  28 + </el-button>
  29 + </div>
  30 + </el-dialog>
  31 +</template>
  32 +
  33 +<script>
  34 +import { updateCommunitySpaceOpenTime } from '@/api/community/communitySpaceManageApi'
  35 +
  36 +export default {
  37 + name: 'EditCommunitySpaceOpenTime',
  38 + data() {
  39 + return {
  40 + visible: false,
  41 + openTimes: []
  42 + }
  43 + },
  44 + methods: {
  45 + open(space) {
  46 + this.openTimes = space.openTimes || []
  47 + this.visible = true
  48 + },
  49 +
  50 + async updateOpenTime(item) {
  51 + try {
  52 + await updateCommunitySpaceOpenTime(item)
  53 + this.$message.success(this.$t('common.success'))
  54 + } catch (error) {
  55 + console.error('更新开放时间失败:', error)
  56 + }
  57 + }
  58 + }
  59 +}
  60 +</script>
  61 +
  62 +<style scoped>
  63 +.time-item {
  64 + margin-bottom: 15px;
  65 + padding: 10px;
  66 + border: 1px solid #eee;
  67 + border-radius: 4px;
  68 +}
  69 +.time-item span {
  70 + display: block;
  71 + margin-bottom: 5px;
  72 + font-weight: bold;
  73 +}
  74 +</style>
0 \ No newline at end of file 75 \ No newline at end of file
src/components/community/EditCommunityVenue.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('communitySpaceManage.edit') + $t('communitySpaceManage.venue')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="resetForm"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  9 + <el-form-item :label="$t('communitySpaceManage.venueName')" prop="name">
  10 + <el-input v-model="form.name" />
  11 + </el-form-item>
  12 +
  13 + <el-form-item :label="$t('communitySpaceManage.startTime')" prop="startTime">
  14 + <el-time-picker
  15 + v-model="form.startTime"
  16 + value-format="HH:mm"
  17 + placeholder="选择时间"
  18 + style="width:100%"
  19 + />
  20 + </el-form-item>
  21 +
  22 + <el-form-item :label="$t('communitySpaceManage.endTime')" prop="endTime">
  23 + <el-time-picker
  24 + v-model="form.endTime"
  25 + value-format="HH:mm"
  26 + placeholder="选择时间"
  27 + style="width:100%"
  28 + />
  29 + </el-form-item>
  30 +
  31 + <el-form-item :label="$t('communitySpaceManage.description')" prop="remark">
  32 + <el-input type="textarea" v-model="form.remark" />
  33 + </el-form-item>
  34 + </el-form>
  35 +
  36 + <div slot="footer" class="dialog-footer">
  37 + <el-button @click="visible = false">
  38 + {{ $t('communitySpaceManage.cancel') }}
  39 + </el-button>
  40 + <el-button type="primary" @click="submitForm">
  41 + {{ $t('communitySpaceManage.save') }}
  42 + </el-button>
  43 + </div>
  44 + </el-dialog>
  45 +</template>
  46 +
  47 +<script>
  48 +import { updateCommunityVenue } from '@/api/community/communitySpaceManageApi'
  49 +
  50 +export default {
  51 + name: 'EditCommunityVenue',
  52 + data() {
  53 + return {
  54 + visible: false,
  55 + form: {
  56 + venueId: '',
  57 + name: '',
  58 + startTime: '',
  59 + endTime: '',
  60 + remark: ''
  61 + },
  62 + rules: {
  63 + name: [
  64 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'blur' }
  65 + ],
  66 + startTime: [
  67 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'change' }
  68 + ],
  69 + endTime: [
  70 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'change' }
  71 + ],
  72 + remark: [
  73 + { required: true, message: this.$t('communitySpaceManage.selectVenue'), trigger: 'blur' }
  74 + ]
  75 + }
  76 + }
  77 + },
  78 + methods: {
  79 + open(venue) {
  80 + this.form = { ...venue }
  81 + this.visible = true
  82 + },
  83 +
  84 + resetForm() {
  85 + this.$refs.form.resetFields()
  86 + },
  87 +
  88 + submitForm() {
  89 + this.$refs.form.validate(async valid => {
  90 + if (valid) {
  91 + try {
  92 + await updateCommunityVenue(this.form)
  93 + this.$message.success(this.$t('common.success'))
  94 + this.visible = false
  95 + this.$emit('success')
  96 + } catch (error) {
  97 + console.error('修改场馆失败:', error)
  98 + }
  99 + }
  100 + })
  101 + }
  102 + }
  103 +}
  104 +</script>
0 \ No newline at end of file 105 \ No newline at end of file
src/components/community/addCommunitySpacePerson.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('addCommunitySpacePerson.title')" :visible.sync="visible" width="800px" @close="closeDialog">
  3 + <el-form ref="form" :model="formData" :rules="rules" label-width="120px">
  4 + <el-row>
  5 + <el-col :span="12">
  6 + <el-form-item :label="$t('addCommunitySpacePerson.personName')" prop="personName">
  7 + <el-input v-model="formData.personName" :placeholder="$t('addCommunitySpacePerson.requiredPersonName')" />
  8 + </el-form-item>
  9 + </el-col>
  10 + <el-col :span="12">
  11 + <el-form-item :label="$t('addCommunitySpacePerson.personTel')" prop="personTel">
  12 + <el-input v-model="formData.personTel" :placeholder="$t('addCommunitySpacePerson.requiredPersonTel')" />
  13 + </el-form-item>
  14 + </el-col>
  15 + </el-row>
  16 +
  17 + <el-row>
  18 + <el-col :span="12">
  19 + <el-form-item :label="$t('addCommunitySpacePerson.receivableAmount')" prop="receivableAmount">
  20 + <el-input v-model="formData.receivableAmount"
  21 + :placeholder="$t('addCommunitySpacePerson.requiredReceivableAmount')" />
  22 + </el-form-item>
  23 + </el-col>
  24 + <el-col :span="12">
  25 + <el-form-item :label="$t('addCommunitySpacePerson.receivedAmount')" prop="receivedAmount">
  26 + <el-input v-model="formData.receivedAmount"
  27 + :placeholder="$t('addCommunitySpacePerson.requiredReceivedAmount')" />
  28 + </el-form-item>
  29 + </el-col>
  30 + </el-row>
  31 +
  32 + <el-row>
  33 + <el-col :span="12">
  34 + <el-form-item :label="$t('addCommunitySpacePerson.payWay')" prop="payWay">
  35 + <el-select v-model="formData.payWay" :placeholder="$t('addCommunitySpacePerson.selectPayWay')"
  36 + style="width:100%">
  37 + <el-option v-for="item in payOptions" :key="item.value" :label="item.label" :value="item.value" />
  38 + </el-select>
  39 + </el-form-item>
  40 + </el-col>
  41 + <el-col :span="12">
  42 + <el-form-item :label="$t('addCommunitySpacePerson.appointmentTime')" prop="appointmentTime">
  43 + <el-input v-model="formData.appointmentTime" disabled
  44 + :placeholder="$t('addCommunitySpacePerson.requiredAppointmentTime')" />
  45 + </el-form-item>
  46 + </el-col>
  47 + </el-row>
  48 +
  49 + <el-row>
  50 + <el-col :span="24">
  51 + <el-form-item :label="$t('addCommunitySpacePerson.remark')" prop="remark">
  52 + <el-input v-model="formData.remark" type="textarea"
  53 + :placeholder="$t('addCommunitySpacePerson.requiredRemark')" :rows="3" />
  54 + </el-form-item>
  55 + </el-col>
  56 + </el-row>
  57 + </el-form>
  58 +
  59 + <div slot="footer" class="dialog-footer">
  60 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  61 + <el-button type="primary" @click="handleSubmit">{{ $t('common.save') }}</el-button>
  62 + </div>
  63 + </el-dialog>
  64 +</template>
  65 +
  66 +<script>
  67 +import { saveCommunitySpacePerson } from '@/api/community/reportCommunitySpaceApi'
  68 +import { getCommunityId } from '@/api/community/communityApi'
  69 +import { dateFormat } from '@/utils/dateUtil'
  70 +
  71 +
  72 +export default {
  73 + name: 'AddCommunitySpacePerson',
  74 + props: {
  75 + communityId: {
  76 + type: String,
  77 + default: () => getCommunityId()
  78 + }
  79 + },
  80 + data() {
  81 + return {
  82 + visible: false,
  83 + formData: {
  84 + spaceId: '',
  85 + personName: '',
  86 + personTel: '',
  87 + appointmentTime: '',
  88 + receivableAmount: '',
  89 + receivedAmount: '',
  90 + payWay: '',
  91 + remark: '',
  92 + openTime: '',
  93 + communityId: this.communityId,
  94 + state: 'S'
  95 + },
  96 + rules: {
  97 + personName: [
  98 + { required: true, message: this.$t('addCommunitySpacePerson.requiredPersonName'), trigger: 'blur' },
  99 + { max: 64, message: this.$t('addCommunitySpacePerson.maxPersonName'), trigger: 'blur' }
  100 + ],
  101 + personTel: [
  102 + { required: true, message: this.$t('addCommunitySpacePerson.requiredPersonTel'), trigger: 'blur' },
  103 + { max: 11, message: this.$t('addCommunitySpacePerson.maxPersonTel'), trigger: 'blur' }
  104 + ],
  105 + appointmentTime: [
  106 + { required: true, message: this.$t('addCommunitySpacePerson.requiredAppointmentTime'), trigger: 'blur' }
  107 + ],
  108 + receivableAmount: [
  109 + { required: true, message: this.$t('addCommunitySpacePerson.requiredReceivableAmount'), trigger: 'blur' },
  110 + { max: 10, message: this.$t('addCommunitySpacePerson.maxReceivableAmount'), trigger: 'blur' }
  111 + ],
  112 + receivedAmount: [
  113 + { required: true, message: this.$t('addCommunitySpacePerson.requiredReceivedAmount'), trigger: 'blur' },
  114 + { max: 10, message: this.$t('addCommunitySpacePerson.maxReceivedAmount'), trigger: 'blur' }
  115 + ],
  116 + payWay: [
  117 + { required: true, message: this.$t('addCommunitySpacePerson.requiredPayWay'), trigger: 'change' }
  118 + ],
  119 + remark: [
  120 + { required: true, message: this.$t('addCommunitySpacePerson.requiredRemark'), trigger: 'blur' },
  121 + { max: 512, message: this.$t('addCommunitySpacePerson.maxRemark'), trigger: 'blur' }
  122 + ]
  123 + },
  124 + payOptions: [
  125 + { value: '1', label: this.$t('addCommunitySpacePerson.cash') },
  126 + { value: '2', label: this.$t('addCommunitySpacePerson.wechat') },
  127 + { value: '3', label: this.$t('addCommunitySpacePerson.alipay') }
  128 + ]
  129 + }
  130 + },
  131 + methods: {
  132 + open(data) {
  133 + this.resetForm()
  134 + Object.assign(this.formData, data)
  135 + this.formData.appointmentTime = dateFormat(this.formData.appointmentTime) + ` ${this.formData.openTime}:00`
  136 + this.visible = true
  137 + },
  138 + closeDialog() {
  139 + this.$refs.form.resetFields()
  140 + },
  141 + resetForm() {
  142 + this.formData = {
  143 + spaceId: '',
  144 + personName: '',
  145 + personTel: '',
  146 + appointmentTime: '',
  147 + receivableAmount: '',
  148 + receivedAmount: '',
  149 + payWay: '',
  150 + remark: '',
  151 + openTime: '',
  152 + communityId: this.communityId,
  153 + state: 'S'
  154 + }
  155 + },
  156 + handleSubmit() {
  157 + this.$refs.form.validate(valid => {
  158 + if (valid) {
  159 + this.saveData()
  160 + }
  161 + })
  162 + },
  163 + async saveData() {
  164 + try {
  165 + await saveCommunitySpacePerson(this.formData)
  166 + this.$message.success(this.$t('common.saveSuccess'))
  167 + this.visible = false
  168 + this.$emit('success')
  169 + } catch (error) {
  170 + this.$message.error(error.message || this.$t('common.saveFailed'))
  171 + }
  172 + }
  173 + }
  174 +}
  175 +</script>
0 \ No newline at end of file 176 \ No newline at end of file
src/components/community/deleteCommunitySpacePerson.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('deleteCommunitySpacePerson.confirmTitle')"
  4 + :visible.sync="visible"
  5 + width="30%"
  6 + @close="close"
  7 + >
  8 + <div>
  9 + <p>{{ $t('deleteCommunitySpacePerson.confirmContent') }}</p>
  10 + </div>
  11 + <span slot="footer" class="dialog-footer">
  12 + <el-button @click="close">{{ $t('deleteCommunitySpacePerson.cancel') }}</el-button>
  13 + <el-button type="primary" @click="deleteCommunitySpacePerson">{{ $t('deleteCommunitySpacePerson.confirmCancel') }}</el-button>
  14 + </span>
  15 + </el-dialog>
  16 +</template>
  17 +
  18 +<script>
  19 +import { deleteCommunitySpacePerson } from '@/api/community/communitySpacePersonManageApi'
  20 +import { getCommunityId } from '@/api/community/communityApi'
  21 +
  22 +export default {
  23 + name: 'DeleteCommunitySpacePerson',
  24 + data() {
  25 + return {
  26 + visible: false,
  27 + deleteData: {}
  28 + }
  29 + },
  30 + methods: {
  31 + open(data) {
  32 + this.deleteData = { ...data }
  33 + this.visible = true
  34 + },
  35 + close() {
  36 + this.visible = false
  37 + },
  38 + async deleteCommunitySpacePerson() {
  39 + try {
  40 + const communityId = getCommunityId()
  41 + const data = {
  42 + ...this.deleteData,
  43 + communityId
  44 + }
  45 + await deleteCommunitySpacePerson(data)
  46 + this.$emit('success')
  47 + this.$message.success(this.$t('common.deleteSuccess'))
  48 + this.close()
  49 + } catch (error) {
  50 + this.$message.error(error.message || this.$t('common.deleteFailed'))
  51 + }
  52 + }
  53 + }
  54 +}
  55 +</script>
0 \ No newline at end of file 56 \ No newline at end of file
src/i18n/commonLang.js
@@ -41,6 +41,7 @@ export const messages = { @@ -41,6 +41,7 @@ export const messages = {
41 disabled: 'Disabled', 41 disabled: 'Disabled',
42 import: 'Import', 42 import: 'Import',
43 remark: 'Remark', 43 remark: 'Remark',
  44 + hour:'hour',
44 } 45 }
45 }, 46 },
46 zh: { 47 zh: {
@@ -85,6 +86,7 @@ export const messages = { @@ -85,6 +86,7 @@ export const messages = {
85 disabled: '禁用', 86 disabled: '禁用',
86 import: '导入', 87 import: '导入',
87 remark: '备注', 88 remark: '备注',
  89 + hour:'时',
88 } 90 }
89 } 91 }
90 } 92 }
91 \ No newline at end of file 93 \ No newline at end of file
src/i18n/index.js
@@ -131,6 +131,10 @@ import { messages as listOwnerMessages } from &#39;../views/owner/listOwnerLang&#39; @@ -131,6 +131,10 @@ import { messages as listOwnerMessages } from &#39;../views/owner/listOwnerLang&#39;
131 import { messages as auditAuthOwnerMessages } from '../views/owner/auditAuthOwnerLang' 131 import { messages as auditAuthOwnerMessages } from '../views/owner/auditAuthOwnerLang'
132 import { messages as accountManageMessages } from '../views/account/accountManageLang' 132 import { messages as accountManageMessages } from '../views/account/accountManageLang'
133 import { messages as accountDetailManageMessages } from '../views/account/accountDetailManageLang' 133 import { messages as accountDetailManageMessages } from '../views/account/accountDetailManageLang'
  134 +import { messages as communitySpaceManageMessages } from '../views/community/communitySpaceManageLang'
  135 +import { messages as reportCommunitySpaceMessages } from '../views/community/reportCommunitySpaceLang'
  136 +import { messages as communitySpacePersonManageMessages } from '../views/community/communitySpacePersonManageLang'
  137 +import { messages as communitySpaceConfirmMessages } from '../views/community/communitySpaceConfirmLang'
134 138
135 Vue.use(VueI18n) 139 Vue.use(VueI18n)
136 140
@@ -266,6 +270,10 @@ const messages = { @@ -266,6 +270,10 @@ const messages = {
266 ...auditAuthOwnerMessages.en, 270 ...auditAuthOwnerMessages.en,
267 ...accountManageMessages.en, 271 ...accountManageMessages.en,
268 ...accountDetailManageMessages.en, 272 ...accountDetailManageMessages.en,
  273 + ...communitySpaceManageMessages.en,
  274 + ...reportCommunitySpaceMessages.en,
  275 + ...communitySpacePersonManageMessages.en,
  276 + ...communitySpaceConfirmMessages.en,
269 }, 277 },
270 zh: { 278 zh: {
271 ...loginMessages.zh, 279 ...loginMessages.zh,
@@ -397,6 +405,10 @@ const messages = { @@ -397,6 +405,10 @@ const messages = {
397 ...auditAuthOwnerMessages.zh, 405 ...auditAuthOwnerMessages.zh,
398 ...accountManageMessages.zh, 406 ...accountManageMessages.zh,
399 ...accountDetailManageMessages.zh, 407 ...accountDetailManageMessages.zh,
  408 + ...communitySpaceManageMessages.zh,
  409 + ...reportCommunitySpaceMessages.zh,
  410 + ...communitySpacePersonManageMessages.zh,
  411 + ...communitySpaceConfirmMessages.zh,
400 } 412 }
401 } 413 }
402 414
src/router/index.js
@@ -646,7 +646,26 @@ const routes = [ @@ -646,7 +646,26 @@ const routes = [
646 name: '/views/account/accountDetailManage', 646 name: '/views/account/accountDetailManage',
647 component: () => import('@/views/account/accountDetailManageList.vue') 647 component: () => import('@/views/account/accountDetailManageList.vue')
648 }, 648 },
649 - 649 + {
  650 + path: '/pages/property/communitySpaceManage',
  651 + name: '/pages/property/communitySpaceManage',
  652 + component: () => import('@/views/community/communitySpaceManageList.vue')
  653 + },
  654 + {
  655 + path: '/pages/property/reportCommunitySpace',
  656 + name: '/pages/property/reportCommunitySpace',
  657 + component: () => import('@/views/community/reportCommunitySpaceList.vue')
  658 + },
  659 + {
  660 + path:'/pages/property/communitySpacePersonManage',
  661 + name:'/pages/property/communitySpacePersonManage',
  662 + component: () => import('@/views/community/communitySpacePersonManageList.vue')
  663 + },
  664 + {
  665 + path:'/pages/property/communitySpaceConfirm',
  666 + name:'/pages/property/communitySpaceConfirm',
  667 + component: () => import('@/views/community/communitySpaceConfirmList.vue')
  668 + },
650 // 其他子路由可以在这里添加 669 // 其他子路由可以在这里添加
651 ] 670 ]
652 }, 671 },
src/views/community/communitySpaceConfirmLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + communitySpaceConfirm: {
  4 + writeOff: 'Write Off',
  5 + writeOffPlaceholder: 'Please scan with barcode scanner to write off',
  6 + writeOffResult: 'Write Off Result',
  7 + writeOffTime: 'Write Off Time',
  8 + space: 'Space',
  9 + appointmentDate: 'Appointment Date',
  10 + appointmentHours: 'Appointment Hours',
  11 + appointmentPerson: 'Appointment Person',
  12 + appointmentPhone: 'Appointment Phone',
  13 + searchCondition: 'Search Conditions',
  14 + search: 'Search',
  15 + reset: 'Reset',
  16 + writeOffOrder: 'Write Off Order',
  17 + venue: 'Venue',
  18 + appointmentTime: 'Appointment Time',
  19 + remark: 'Remark',
  20 + personNamePlaceholder: 'Enter appointment person name',
  21 + personTelPlaceholder: 'Enter appointment phone',
  22 + appointmentTimePlaceholder: 'Select appointment time',
  23 + scanTip: 'Please scan barcode first',
  24 + writeOffSuccess: 'Write off successful',
  25 + writeOffFailed: 'Write off failed'
  26 + }
  27 + },
  28 + zh: {
  29 + communitySpaceConfirm: {
  30 + writeOff: '核销',
  31 + writeOffPlaceholder: '请扫码枪扫码核销',
  32 + writeOffResult: '核销结果',
  33 + writeOffTime: '核销时间',
  34 + space: '场地',
  35 + appointmentDate: '预约日期',
  36 + appointmentHours: '预约小时',
  37 + appointmentPerson: '预约人',
  38 + appointmentPhone: '预约电话',
  39 + searchCondition: '查询条件',
  40 + search: '查询',
  41 + reset: '重置',
  42 + writeOffOrder: '核销订单',
  43 + venue: '场馆',
  44 + appointmentTime: '预约时间',
  45 + remark: '备注',
  46 + personNamePlaceholder: '请输入预约人',
  47 + personTelPlaceholder: '请输入预约电话',
  48 + appointmentTimePlaceholder: '请选择预约时间',
  49 + scanTip: '请先扫码',
  50 + writeOffSuccess: '核销成功',
  51 + writeOffFailed: '核销失败'
  52 + }
  53 + }
  54 +}
0 \ No newline at end of file 55 \ No newline at end of file
src/views/community/communitySpaceConfirmList.vue 0 → 100644
  1 +<template>
  2 + <div class="community-space-confirm-container">
  3 + <el-row :gutter="20">
  4 + <el-col :span="6">
  5 + <el-card class="write-off-card">
  6 + <el-row :gutter="10" class="mb-10">
  7 + <el-col :span="18">
  8 + <el-input
  9 + v-model="communitySpaceConfirmInfo.timeId"
  10 + :placeholder="$t('communitySpaceConfirm.writeOffPlaceholder')"
  11 + @keyup.enter.native="confirmCommunitySpace"
  12 + clearable
  13 + />
  14 + </el-col>
  15 + <el-col :span="6">
  16 + <el-button
  17 + type="primary"
  18 + @click="confirmCommunitySpace"
  19 + class="full-width-btn"
  20 + >
  21 + {{ $t('communitySpaceConfirm.writeOff') }}
  22 + </el-button>
  23 + </el-col>
  24 + </el-row>
  25 +
  26 + <div class="result-card">
  27 + <div class="result-item">
  28 + <span class="label">{{ $t('communitySpaceConfirm.writeOffResult') }}:</span>
  29 + <span>{{ communitySpaceConfirmInfo.order.remark || '-' }}</span>
  30 + </div>
  31 + <div class="result-item">
  32 + <span class="label">{{ $t('communitySpaceConfirm.writeOffTime') }}:</span>
  33 + <span>{{ communitySpaceConfirmInfo.order.createTime || '-' }}</span>
  34 + </div>
  35 + <div class="result-item">
  36 + <span class="label">{{ $t('communitySpaceConfirm.space') }}:</span>
  37 + <span>{{ communitySpaceConfirmInfo.order.spaceName || '-' }}</span>
  38 + </div>
  39 + <div class="result-item">
  40 + <span class="label">{{ $t('communitySpaceConfirm.appointmentDate') }}:</span>
  41 + <span>{{ communitySpaceConfirmInfo.order.appointmentTime || '-' }}</span>
  42 + </div>
  43 + <div class="result-item">
  44 + <span class="label">{{ $t('communitySpaceConfirm.appointmentHours') }}:</span>
  45 + <span>{{ communitySpaceConfirmInfo.order.hours || '-' }}</span>
  46 + </div>
  47 + <div class="result-item">
  48 + <span class="label">{{ $t('communitySpaceConfirm.appointmentPerson') }}:</span>
  49 + <span>{{ communitySpaceConfirmInfo.order.personName || '-' }}</span>
  50 + </div>
  51 + <div class="result-item">
  52 + <span class="label">{{ $t('communitySpaceConfirm.appointmentPhone') }}:</span>
  53 + <span>{{ communitySpaceConfirmInfo.order.personTel || '-' }}</span>
  54 + </div>
  55 + </div>
  56 + </el-card>
  57 + </el-col>
  58 +
  59 + <el-col :span="18">
  60 + <el-card class="search-card">
  61 + <div slot="header" class="clearfix">
  62 + <span>{{ $t('communitySpaceConfirm.searchCondition') }}</span>
  63 + </div>
  64 + <el-row :gutter="20">
  65 + <el-col :span="6">
  66 + <el-input
  67 + v-model="communitySpaceConfirmInfo.conditions.personName"
  68 + :placeholder="$t('communitySpaceConfirm.personNamePlaceholder')"
  69 + clearable
  70 + />
  71 + </el-col>
  72 + <el-col :span="6">
  73 + <el-input
  74 + v-model="communitySpaceConfirmInfo.conditions.personTel"
  75 + :placeholder="$t('communitySpaceConfirm.personTelPlaceholder')"
  76 + clearable
  77 + />
  78 + </el-col>
  79 + <el-col :span="6">
  80 + <el-date-picker
  81 + v-model="communitySpaceConfirmInfo.conditions.appointmentTime"
  82 + type="datetime"
  83 + :placeholder="$t('communitySpaceConfirm.appointmentTimePlaceholder')"
  84 + value-format="yyyy-MM-dd HH:mm:ss"
  85 + class="full-width"
  86 + />
  87 + </el-col>
  88 + <el-col :span="6">
  89 + <el-button type="primary" @click="queryCommunitySpaceConfirm">
  90 + <i class="el-icon-search"></i>
  91 + {{ $t('communitySpaceConfirm.search') }}
  92 + </el-button>
  93 + <el-button @click="resetCommunitySpaceConfirm">
  94 + <i class="el-icon-refresh"></i>
  95 + {{ $t('communitySpaceConfirm.reset') }}
  96 + </el-button>
  97 + </el-col>
  98 + </el-row>
  99 + </el-card>
  100 +
  101 + <el-card class="table-card">
  102 + <el-table
  103 + :data="communitySpaceConfirmInfo.orders"
  104 + border
  105 + style="width: 100%"
  106 + v-loading="loading"
  107 + >
  108 + <el-table-column
  109 + prop="orderId"
  110 + :label="$t('communitySpaceConfirm.writeOffOrder')"
  111 + align="center"
  112 + />
  113 + <el-table-column
  114 + prop="venueName"
  115 + :label="$t('communitySpaceConfirm.venue')"
  116 + align="center"
  117 + />
  118 + <el-table-column
  119 + prop="spaceName"
  120 + :label="$t('communitySpaceConfirm.space')"
  121 + align="center"
  122 + />
  123 + <el-table-column
  124 + prop="appointmentTime"
  125 + :label="$t('communitySpaceConfirm.appointmentDate')"
  126 + align="center"
  127 + />
  128 + <el-table-column
  129 + prop="hours"
  130 + :label="$t('communitySpaceConfirm.appointmentTime')"
  131 + align="center"
  132 + />
  133 + <el-table-column
  134 + prop="personName"
  135 + :label="$t('communitySpaceConfirm.appointmentPerson')"
  136 + align="center"
  137 + />
  138 + <el-table-column
  139 + prop="personTel"
  140 + :label="$t('communitySpaceConfirm.appointmentPhone')"
  141 + align="center"
  142 + />
  143 + <el-table-column
  144 + prop="createTime"
  145 + :label="$t('communitySpaceConfirm.writeOffTime')"
  146 + align="center"
  147 + />
  148 + <el-table-column
  149 + prop="remark"
  150 + :label="$t('communitySpaceConfirm.remark')"
  151 + align="center"
  152 + />
  153 + </el-table>
  154 +
  155 + <el-pagination
  156 + class="mt-20"
  157 + :current-page="pagination.current"
  158 + :page-sizes="[10, 20, 30, 50]"
  159 + :page-size="pagination.size"
  160 + layout="total, sizes, prev, pager, next, jumper"
  161 + :total="pagination.total"
  162 + @size-change="handleSizeChange"
  163 + @current-change="handleCurrentChange"
  164 + />
  165 + </el-card>
  166 + </el-col>
  167 + </el-row>
  168 + </div>
  169 +</template>
  170 +
  171 +<script>
  172 +import {
  173 + listCommunitySpaceConfirmOrder,
  174 + saveCommunitySpaceConfirmOrder
  175 +} from '@/api/community/communitySpaceConfirmApi'
  176 +import { getCommunityId } from '@/api/community/communityApi'
  177 +
  178 +export default {
  179 + name: 'CommunitySpaceConfirmList',
  180 + data() {
  181 + return {
  182 + loading: false,
  183 + communitySpaceConfirmInfo: {
  184 + orders: [],
  185 + order: {
  186 + remark: '',
  187 + appointmentTime: '',
  188 + createTime: '',
  189 + hours: '',
  190 + spaceName: '',
  191 + personName: '',
  192 + personTel: '',
  193 + },
  194 + timeId: '',
  195 + conditions: {
  196 + spaceId: '',
  197 + personName: '',
  198 + personTel: '',
  199 + appointmentTime: '',
  200 + communityId: ''
  201 + }
  202 + },
  203 + pagination: {
  204 + current: 1,
  205 + size: 10,
  206 + total: 0
  207 + }
  208 + }
  209 + },
  210 + created() {
  211 + this.communitySpaceConfirmInfo.conditions.communityId = getCommunityId()
  212 + this.listCommunitySpaceConfirms()
  213 + },
  214 + methods: {
  215 + async listCommunitySpaceConfirms() {
  216 + this.loading = true
  217 + try {
  218 + const params = {
  219 + ...this.communitySpaceConfirmInfo.conditions,
  220 + page: this.pagination.current,
  221 + row: this.pagination.size
  222 + }
  223 +
  224 + const { data, total } = await listCommunitySpaceConfirmOrder(params)
  225 + this.communitySpaceConfirmInfo.orders = data || []
  226 + this.pagination.total = total
  227 + } catch (error) {
  228 + console.error('获取核销列表失败:', error)
  229 + } finally {
  230 + this.loading = false
  231 + }
  232 + },
  233 + async confirmCommunitySpace() {
  234 + if (!this.communitySpaceConfirmInfo.timeId) {
  235 + this.$message.warning(this.$t('communitySpaceConfirm.scanTip'))
  236 + return
  237 + }
  238 +
  239 + try {
  240 + const data = {
  241 + timeId: this.communitySpaceConfirmInfo.timeId,
  242 + communityId: this.communitySpaceConfirmInfo.conditions.communityId
  243 + }
  244 +
  245 + const result = await saveCommunitySpaceConfirmOrder(data)
  246 + if (result.code === 0) {
  247 + this.$message.success(this.$t('communitySpaceConfirm.writeOffSuccess'))
  248 + this.communitySpaceConfirmInfo.timeId = ''
  249 +
  250 + // 更新核销结果
  251 + if (result.data && result.data.length > 0) {
  252 + this.communitySpaceConfirmInfo.order = {
  253 + ...result.data[0],
  254 + remark: result.data[0].remark || this.$t('communitySpaceConfirm.writeOffSuccess')
  255 + }
  256 + }
  257 +
  258 + // 刷新列表
  259 + this.pagination.current = 1
  260 + this.listCommunitySpaceConfirms()
  261 + } else {
  262 + this.$message.error(result.msg)
  263 + }
  264 + } catch (error) {
  265 + console.error('核销失败:', error)
  266 + this.$message.error(this.$t('communitySpaceConfirm.writeOffFailed'))
  267 + }
  268 + },
  269 + queryCommunitySpaceConfirm() {
  270 + this.pagination.current = 1
  271 + this.listCommunitySpaceConfirms()
  272 + },
  273 + resetCommunitySpaceConfirm() {
  274 + this.communitySpaceConfirmInfo.conditions.personName = ''
  275 + this.communitySpaceConfirmInfo.conditions.personTel = ''
  276 + this.communitySpaceConfirmInfo.conditions.appointmentTime = ''
  277 + this.queryCommunitySpaceConfirm()
  278 + },
  279 + handleSizeChange(size) {
  280 + this.pagination.size = size
  281 + this.listCommunitySpaceConfirms()
  282 + },
  283 + handleCurrentChange(current) {
  284 + this.pagination.current = current
  285 + this.listCommunitySpaceConfirms()
  286 + }
  287 + }
  288 +}
  289 +</script>
  290 +
  291 +<style lang="scss" scoped>
  292 +.community-space-confirm-container {
  293 + padding: 20px;
  294 +
  295 + .write-off-card, .search-card, .table-card {
  296 + margin-bottom: 20px;
  297 + }
  298 +
  299 + .result-card {
  300 + margin-top: 15px;
  301 +
  302 + .result-item {
  303 + display: flex;
  304 + justify-content: space-between;
  305 + margin-bottom: 10px;
  306 + font-size: 14px;
  307 +
  308 + .label {
  309 + font-weight: bold;
  310 + color: #606266;
  311 + }
  312 + }
  313 + }
  314 +
  315 + .full-width {
  316 + width: 100%;
  317 + }
  318 +
  319 + .full-width-btn {
  320 + width: 100%;
  321 + }
  322 +
  323 + .mb-10 {
  324 + margin-bottom: 10px;
  325 + }
  326 +
  327 + .mt-20 {
  328 + margin-top: 20px;
  329 + }
  330 +}
  331 +</style>
0 \ No newline at end of file 332 \ No newline at end of file
src/views/community/communitySpaceManageLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + communitySpaceManage: {
  4 + add: 'Add',
  5 + edit: 'Edit',
  6 + delete: 'Delete',
  7 + venue: 'Venue',
  8 + spaceId: 'ID',
  9 + name: 'Name',
  10 + startTime: 'Opening Time',
  11 + endTime: 'Closing Time',
  12 + feeMoney: 'Hourly Fee',
  13 + adminName: 'Manager',
  14 + tel: 'Manager Phone',
  15 + state: 'Status',
  16 + operation: 'Operation',
  17 + openTime: 'Open Time',
  18 + query: 'Search',
  19 + reset: 'Reset',
  20 + addSpace: 'Add Space',
  21 + document: 'Document',
  22 + venueName: 'Venue Name',
  23 + description: 'Description',
  24 + confirmDelete: 'Confirm Delete',
  25 + cancel: 'Cancel',
  26 + save: 'Save',
  27 + selectStatus: 'Select Status',
  28 + selectVenue: 'Select Venue',
  29 + selectSpace: 'Select Space',
  30 + status1001: 'Available',
  31 + status2002: 'Unavailable',
  32 + confirmDeleteSpace: 'Confirm to delete space?',
  33 + confirmDeleteVenue: 'Confirm to delete venue?',
  34 + openTimeTitle: 'Opening Hours',
  35 + venueInfo: 'Venue Information',
  36 + spaceInfo: 'Space Information'
  37 + }
  38 + },
  39 + zh: {
  40 + communitySpaceManage: {
  41 + add: '添加',
  42 + edit: '修改',
  43 + delete: '删除',
  44 + venue: '场馆',
  45 + spaceId: '编号',
  46 + name: '名称',
  47 + startTime: '开场时间',
  48 + endTime: '关场时间',
  49 + feeMoney: '每小时费用',
  50 + adminName: '管理员',
  51 + tel: '管理员电话',
  52 + state: '状态',
  53 + operation: '操作',
  54 + openTime: '开放时间',
  55 + query: '查询',
  56 + reset: '重置',
  57 + addSpace: '添加场地',
  58 + document: '文档',
  59 + venueName: '场馆名称',
  60 + description: '描述',
  61 + confirmDelete: '确认删除',
  62 + cancel: '取消',
  63 + save: '保存',
  64 + selectStatus: '请选择状态',
  65 + selectVenue: '请选择场馆',
  66 + selectSpace: '请选择场地',
  67 + status1001: '可预约',
  68 + status2002: '不可预约',
  69 + confirmDeleteSpace: '确定删除场地?',
  70 + confirmDeleteVenue: '确定删除场馆?',
  71 + openTimeTitle: '开放时间',
  72 + venueInfo: '场馆信息',
  73 + spaceInfo: '场地信息'
  74 + }
  75 + }
  76 +}
0 \ No newline at end of file 77 \ No newline at end of file
src/views/community/communitySpaceManageList.vue 0 → 100644
  1 +<template>
  2 + <div class="community-space-manage">
  3 + <el-row :gutter="20">
  4 + <el-col :span="4">
  5 + <el-card class="venue-list">
  6 + <div class="button-group">
  7 + <el-button type="primary" size="small" @click="openAddVenueModal">
  8 + {{ $t('communitySpaceManage.add') }}
  9 + </el-button>
  10 + <el-button type="primary" size="small" @click="openEditVenueModal">
  11 + {{ $t('communitySpaceManage.edit') }}
  12 + </el-button>
  13 + <el-button type="danger" size="small" @click="openDeleteVenueModal">
  14 + {{ $t('communitySpaceManage.delete') }}
  15 + </el-button>
  16 + </div>
  17 + <el-scrollbar class="venue-scrollbar">
  18 + <ul class="venue-items">
  19 + <li v-for="(item, index) in venues" :key="index" :class="{ 'active': conditions.venueId === item.venueId }"
  20 + @click="selectVenue(item)">
  21 + {{ item.name }}
  22 + </li>
  23 + </ul>
  24 + </el-scrollbar>
  25 + </el-card>
  26 + </el-col>
  27 + <el-col :span="20">
  28 + <el-card>
  29 + <div slot="header" class="clearfix text-left">
  30 + <span>{{ $t('communitySpaceManage.query') }}</span>
  31 + </div>
  32 + <el-form :inline="true" :model="conditions" class="search-form">
  33 + <el-form-item :label="$t('communitySpaceManage.spaceId')">
  34 + <el-input v-model="conditions.spaceId" :placeholder="$t('communitySpaceManage.selectSpace')"></el-input>
  35 + </el-form-item>
  36 + <el-form-item :label="$t('communitySpaceManage.name')">
  37 + <el-input v-model="conditions.name" :placeholder="$t('communitySpaceManage.selectSpace')"></el-input>
  38 + </el-form-item>
  39 + <el-form-item :label="$t('communitySpaceManage.state')">
  40 + <el-select v-model="conditions.state" :placeholder="$t('communitySpaceManage.selectStatus')"
  41 + style="width:100%">
  42 + <el-option :label="$t('communitySpaceManage.selectStatus')" value=""></el-option>
  43 + <el-option :label="$t('communitySpaceManage.status1001')" value="1001"></el-option>
  44 + <el-option :label="$t('communitySpaceManage.status2002')" value="2002"></el-option>
  45 + </el-select>
  46 + </el-form-item>
  47 + <el-form-item>
  48 + <el-button type="primary" @click="querySpaces">
  49 + <i class="el-icon-search"></i>
  50 + {{ $t('communitySpaceManage.query') }}
  51 + </el-button>
  52 + <el-button @click="resetConditions">
  53 + <i class="el-icon-refresh"></i>
  54 + {{ $t('communitySpaceManage.reset') }}
  55 + </el-button>
  56 + </el-form-item>
  57 + </el-form>
  58 + </el-card>
  59 +
  60 + <el-card style="margin-top: 20px;">
  61 + <div slot="header" class="clearfix flex justify-between">
  62 + <span>{{ $t('communitySpaceManage.spaceInfo') }}</span>
  63 + <div style="float: right;">
  64 + <el-button type="primary" size="small" @click="openAddSpaceModal">
  65 + <i class="el-icon-plus"></i>
  66 + {{ $t('communitySpaceManage.addSpace') }}
  67 + </el-button>
  68 + </div>
  69 + </div>
  70 + <el-table :data="spaces" border style="width: 100%">
  71 + <el-table-column prop="spaceId" :label="$t('communitySpaceManage.spaceId')" align="center" />
  72 + <el-table-column prop="name" :label="$t('communitySpaceManage.name')" align="center" />
  73 + <el-table-column prop="startTime" :label="$t('communitySpaceManage.startTime')" align="center" />
  74 + <el-table-column prop="endTime" :label="$t('communitySpaceManage.endTime')" align="center" />
  75 + <el-table-column prop="feeMoney" :label="$t('communitySpaceManage.feeMoney')" align="center" />
  76 + <el-table-column prop="adminName" :label="$t('communitySpaceManage.adminName')" align="center" />
  77 + <el-table-column prop="tel" :label="$t('communitySpaceManage.tel')" align="center" />
  78 + <el-table-column prop="state" :label="$t('communitySpaceManage.state')" align="center">
  79 + <template slot-scope="scope">
  80 + {{ scope.row.state === '1001' ? $t('communitySpaceManage.status1001') :
  81 + $t('communitySpaceManage.status2002') }}
  82 + </template>
  83 + </el-table-column>
  84 + <el-table-column :label="$t('communitySpaceManage.operation')" align="center" width="300">
  85 + <template slot-scope="scope">
  86 + <el-button size="mini" @click="openEditOpenTime(scope.row)">
  87 + {{ $t('communitySpaceManage.openTime') }}
  88 + </el-button>
  89 + <el-button size="mini" type="primary" @click="openEditSpaceModal(scope.row)">
  90 + {{ $t('communitySpaceManage.edit') }}
  91 + </el-button>
  92 + <el-button size="mini" type="danger" @click="openDeleteSpaceModal(scope.row)">
  93 + {{ $t('communitySpaceManage.delete') }}
  94 + </el-button>
  95 + </template>
  96 + </el-table-column>
  97 + </el-table>
  98 + <el-pagination style="margin-top: 20px;" @size-change="handleSizeChange" @current-change="handlePageChange"
  99 + :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
  100 + layout="total, sizes, prev, pager, next, jumper" :total="total">
  101 + </el-pagination>
  102 + </el-card>
  103 + </el-col>
  104 + </el-row>
  105 +
  106 + <!-- 子组件 -->
  107 + <add-community-space ref="addSpaceModal" @success="listSpaces" />
  108 + <edit-community-space ref="editSpaceModal" @success="listSpaces" />
  109 + <edit-community-space-open-time ref="editOpenTimeModal" />
  110 + <delete-community-space ref="deleteSpaceModal" @success="listSpaces" />
  111 + <add-community-venue ref="addVenueModal" @success="listVenues" />
  112 + <edit-community-venue ref="editVenueModal" @success="listVenues" />
  113 + <delete-community-venue ref="deleteVenueModal" @success="listVenues" />
  114 + </div>
  115 +</template>
  116 +
  117 +<script>
  118 +import { listCommunityVenue, listCommunitySpace } from '@/api/community/communitySpaceManageApi'
  119 +import AddCommunitySpace from '@/components/community/AddCommunitySpace'
  120 +import EditCommunitySpace from '@/components/community/EditCommunitySpace'
  121 +import EditCommunitySpaceOpenTime from '@/components/community/EditCommunitySpaceOpenTime'
  122 +import DeleteCommunitySpace from '@/components/community/DeleteCommunitySpace'
  123 +import AddCommunityVenue from '@/components/community/AddCommunityVenue'
  124 +import EditCommunityVenue from '@/components/community/EditCommunityVenue'
  125 +import DeleteCommunityVenue from '@/components/community/DeleteCommunityVenue'
  126 +
  127 +export default {
  128 + name: 'CommunitySpaceManage',
  129 + components: {
  130 + AddCommunitySpace,
  131 + EditCommunitySpace,
  132 + EditCommunitySpaceOpenTime,
  133 + DeleteCommunitySpace,
  134 + AddCommunityVenue,
  135 + EditCommunityVenue,
  136 + DeleteCommunityVenue
  137 + },
  138 + data() {
  139 + return {
  140 + venues: [],
  141 + spaces: [],
  142 + conditions: {
  143 + spaceId: '',
  144 + name: '',
  145 + state: '',
  146 + venueId: '',
  147 + page: 1,
  148 + row: 10
  149 + },
  150 + page: {
  151 + current: 1,
  152 + size: 10,
  153 + total: 0
  154 + }
  155 + }
  156 + },
  157 + computed: {
  158 + total() {
  159 + return this.page.total
  160 + }
  161 + },
  162 + created() {
  163 + this.listVenues()
  164 + },
  165 + methods: {
  166 + async listVenues() {
  167 + try {
  168 + const res = await listCommunityVenue({
  169 + page: 1,
  170 + row: 100
  171 + })
  172 + this.venues = res.data
  173 + if (this.venues.length > 0) {
  174 + this.selectVenue(this.venues[0])
  175 + }
  176 + } catch (error) {
  177 + console.error('获取场馆列表失败:', error)
  178 + }
  179 + },
  180 +
  181 + async listSpaces() {
  182 + try {
  183 + const res = await listCommunitySpace(this.conditions)
  184 + this.spaces = res.data
  185 + this.page.total = res.total
  186 + } catch (error) {
  187 + console.error('获取场地列表失败:', error)
  188 + }
  189 + },
  190 +
  191 + selectVenue(venue) {
  192 + this.conditions.venueId = venue.venueId
  193 + this.listSpaces()
  194 + },
  195 +
  196 + querySpaces() {
  197 + this.conditions.page = 1
  198 + this.listSpaces()
  199 + },
  200 +
  201 + resetConditions() {
  202 + this.conditions.spaceId = ''
  203 + this.conditions.name = ''
  204 + this.conditions.state = ''
  205 + this.querySpaces()
  206 + },
  207 +
  208 + handlePageChange(page) {
  209 + this.conditions.page = page
  210 + this.listSpaces()
  211 + },
  212 +
  213 + handleSizeChange(size) {
  214 + this.conditions.row = size
  215 + this.listSpaces()
  216 + },
  217 +
  218 + openAddSpaceModal() {
  219 + if (!this.conditions.venueId) {
  220 + this.$message.warning(this.$t('communitySpaceManage.selectVenue'))
  221 + return
  222 + }
  223 + this.$refs.addSpaceModal.open(this.conditions.venueId)
  224 + },
  225 +
  226 + openEditSpaceModal(space) {
  227 + this.$refs.editSpaceModal.open(space)
  228 + },
  229 +
  230 + openEditOpenTime(space) {
  231 + this.$refs.editOpenTimeModal.open(space)
  232 + },
  233 +
  234 + openDeleteSpaceModal(space) {
  235 + this.$refs.deleteSpaceModal.open(space)
  236 + },
  237 +
  238 + openAddVenueModal() {
  239 + this.$refs.addVenueModal.open()
  240 + },
  241 +
  242 + openEditVenueModal() {
  243 + if (!this.conditions.venueId) {
  244 + this.$message.warning(this.$t('communitySpaceManage.selectVenue'))
  245 + return
  246 + }
  247 + const venue = this.venues.find(v => v.venueId === this.conditions.venueId)
  248 + if (venue) {
  249 + this.$refs.editVenueModal.open(venue)
  250 + }
  251 + },
  252 +
  253 + openDeleteVenueModal() {
  254 + if (!this.conditions.venueId) {
  255 + this.$message.warning(this.$t('communitySpaceManage.selectVenue'))
  256 + return
  257 + }
  258 + const venue = this.venues.find(v => v.venueId === this.conditions.venueId)
  259 + if (venue) {
  260 + this.$refs.deleteVenueModal.open(venue)
  261 + }
  262 + }
  263 + }
  264 +}
  265 +</script>
  266 +
  267 +<style scoped>
  268 +.venue-list {
  269 + height: 100%;
  270 +}
  271 +
  272 +.button-group {
  273 + margin-bottom: 15px;
  274 +}
  275 +
  276 +.venue-scrollbar {
  277 + height: calc(100vh - 200px);
  278 +}
  279 +
  280 +.venue-items {
  281 + list-style: none;
  282 + padding: 0;
  283 + margin: 0;
  284 +}
  285 +
  286 +.venue-items li {
  287 + padding: 12px 15px;
  288 + border-bottom: 1px solid #eee;
  289 + cursor: pointer;
  290 + transition: all 0.3s;
  291 +}
  292 +
  293 +.venue-items li:hover {
  294 + background-color: #f5f7fa;
  295 +}
  296 +
  297 +.venue-items li.active {
  298 + background-color: #ecf5ff;
  299 + color: #409eff;
  300 + font-weight: bold;
  301 +}
  302 +
  303 +.search-form {
  304 + display: flex;
  305 + flex-wrap: wrap;
  306 +}
  307 +</style>
0 \ No newline at end of file 308 \ No newline at end of file
src/views/community/communitySpacePersonManageLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + communitySpacePersonManage: {
  4 + searchConditions: 'Search Conditions',
  5 + more: 'More',
  6 + hide: 'Hide',
  7 + appointmentTimePlaceholder: 'Please select appointment time',
  8 + appointmentPersonPlaceholder: 'Please select appointment person',
  9 + appointmentTelPlaceholder: 'Please select appointment phone',
  10 + search: 'Search',
  11 + reset: 'Reset',
  12 + statePlaceholder: 'Please select state',
  13 + spacePlaceholder: 'Please select appointment space',
  14 + appointmentOrder: 'Appointment Order',
  15 + orderId: 'Order ID',
  16 + venue: 'Venue',
  17 + space: 'Space',
  18 + appointmentPerson: 'Appointment Person',
  19 + appointmentTel: 'Appointment Phone',
  20 + appointmentDate: 'Appointment Date',
  21 + appointmentTime: 'Appointment Time',
  22 + receivableAmount: 'Receivable Amount',
  23 + receivedAmount: 'Received Amount',
  24 + payWay: 'Payment Method',
  25 + state: 'State',
  26 + createTime: 'Create Time',
  27 + remark: 'Remark',
  28 + operation: 'Operation',
  29 + cancelAppointment: 'Cancel Appointment',
  30 + stateOptions: {
  31 + S: 'Appointment Success',
  32 + F: 'Appointment Failed',
  33 + W: 'Pending Review',
  34 + P: 'Pending Payment'
  35 + }
  36 + },
  37 + deleteCommunitySpacePerson: {
  38 + confirmTitle: 'Please confirm your operation!',
  39 + confirmContent: 'Confirm to cancel the site reservation? If it is an online reservation, it will be automatically refunded to the reservation account',
  40 + cancel: 'Cancel',
  41 + confirmCancel: 'Confirm Cancel'
  42 + },
  43 + common: {
  44 + total: 'Total'
  45 + }
  46 + },
  47 + zh: {
  48 + communitySpacePersonManage: {
  49 + searchConditions: '查询条件',
  50 + more: '更多',
  51 + hide: '隐藏',
  52 + appointmentTimePlaceholder: '请选择预约时间',
  53 + appointmentPersonPlaceholder: '请选择预约人',
  54 + appointmentTelPlaceholder: '请选择预约电话',
  55 + search: '查询',
  56 + reset: '重置',
  57 + statePlaceholder: '请选择状态',
  58 + spacePlaceholder: '请选择预约场地',
  59 + appointmentOrder: '预约订单',
  60 + orderId: '订单编号',
  61 + venue: '场馆',
  62 + space: '场地',
  63 + appointmentPerson: '预约人',
  64 + appointmentTel: '预约电话',
  65 + appointmentDate: '预约日期',
  66 + appointmentTime: '预约时间',
  67 + receivableAmount: '应收金额',
  68 + receivedAmount: '实收金额',
  69 + payWay: '支付方式',
  70 + state: '状态',
  71 + createTime: '创建时间',
  72 + remark: '备注',
  73 + operation: '操作',
  74 + cancelAppointment: '取消预约',
  75 + stateOptions: {
  76 + S: '预约成功',
  77 + F: '预约失败',
  78 + W: '待审核',
  79 + P: '待支付'
  80 + }
  81 + },
  82 + deleteCommunitySpacePerson: {
  83 + confirmTitle: '请确认您的操作!',
  84 + confirmContent: '确定取消场地预约,如果是线上预约,自动会退款到预约人账户',
  85 + cancel: '点错了',
  86 + confirmCancel: '确认取消'
  87 + },
  88 + common: {
  89 + total: '共'
  90 + }
  91 + }
  92 +}
0 \ No newline at end of file 93 \ No newline at end of file
src/views/community/communitySpacePersonManageList.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <!-- 查询条件 -->
  4 + <el-card class="box-card">
  5 + <div slot="header" class=" flex justify-between">
  6 + <span>{{ $t('communitySpacePersonManage.searchConditions') }}</span>
  7 + <el-button type="text" style="float: right; padding: 3px 0" @click="moreCondition = !moreCondition">{{
  8 + moreCondition ? $t('communitySpacePersonManage.hide') : $t('communitySpacePersonManage.more') }}</el-button>
  9 + </div>
  10 + <el-row :gutter="20">
  11 + <el-col :span="6">
  12 + <el-date-picker v-model="conditions.appointmentTime" type="datetime"
  13 + :placeholder="$t('communitySpacePersonManage.appointmentTimePlaceholder')" style="width:100%;"
  14 + value-format="yyyy-MM-dd HH:mm:ss" />
  15 + </el-col>
  16 + <el-col :span="6">
  17 + <el-input v-model="conditions.personName"
  18 + :placeholder="$t('communitySpacePersonManage.appointmentPersonPlaceholder')" clearable />
  19 + </el-col>
  20 + <el-col :span="6">
  21 + <el-input v-model="conditions.personTel"
  22 + :placeholder="$t('communitySpacePersonManage.appointmentTelPlaceholder')" clearable />
  23 + </el-col>
  24 + <el-col :span="6">
  25 + <el-button type="primary" @click="_queryCommunitySpacePersonMethod">{{ $t('communitySpacePersonManage.search')
  26 + }}</el-button>
  27 + <el-button @click="_resetCommunitySpacePersonMethod">{{ $t('communitySpacePersonManage.reset') }}</el-button>
  28 + </el-col>
  29 + </el-row>
  30 + <el-row v-show="moreCondition" :gutter="20" style="margin-top: 20px;">
  31 + <el-col :span="6">
  32 + <el-select v-model="conditions.state" :placeholder="$t('communitySpacePersonManage.statePlaceholder')" clearable
  33 + style="width:100%;">
  34 + <el-option v-for="(value, key) in stateOptions" :key="key" :label="value" :value="key" />
  35 + </el-select>
  36 + </el-col>
  37 + <el-col :span="6">
  38 + <el-select v-model="conditions.spaceId" :placeholder="$t('communitySpacePersonManage.spacePlaceholder')"
  39 + clearable style="width:100%;">
  40 + <el-option v-for="item in spaces" :key="item.spaceId" :label="item.name" :value="item.spaceId" />
  41 + </el-select>
  42 + </el-col>
  43 + </el-row>
  44 + </el-card>
  45 +
  46 + <!-- 预约订单列表 -->
  47 + <el-card class="box-card" style="margin-top:20px;">
  48 + <div slot="header" class="flex justify-between">
  49 + <span>{{ $t('communitySpacePersonManage.appointmentOrder') }}</span>
  50 + </div>
  51 + <el-table v-loading="loading" :data="communitySpacePersons" border style="width: 100%">
  52 + <el-table-column prop="cspId" :label="$t('communitySpacePersonManage.orderId')" align="center" />
  53 + <el-table-column prop="venueName" :label="$t('communitySpacePersonManage.venue')" align="center" />
  54 + <el-table-column prop="spaceName" :label="$t('communitySpacePersonManage.space')" align="center" />
  55 + <el-table-column prop="personName" :label="$t('communitySpacePersonManage.appointmentPerson')" align="center" />
  56 + <el-table-column prop="personTel" :label="$t('communitySpacePersonManage.appointmentTel')" align="center" />
  57 + <el-table-column prop="appointmentTime" :label="$t('communitySpacePersonManage.appointmentDate')"
  58 + align="center" />
  59 + <el-table-column :label="$t('communitySpacePersonManage.appointmentTime')" align="center">
  60 + <template slot-scope="scope">
  61 + <div v-for="(time, index) in scope.row.times" :key="index">
  62 + <span> {{ formatTimes(scope.row.times) }}</span>
  63 + </div>
  64 + </template>
  65 + </el-table-column>
  66 + <el-table-column prop="receivableAmount" :label="$t('communitySpacePersonManage.receivableAmount')"
  67 + align="center" />
  68 + <el-table-column prop="receivedAmount" :label="$t('communitySpacePersonManage.receivedAmount')" align="center" />
  69 + <el-table-column prop="payWayName" :label="$t('communitySpacePersonManage.payWay')" align="center" />
  70 + <el-table-column prop="stateName" :label="$t('communitySpacePersonManage.state')" align="center" />
  71 + <el-table-column prop="createTime" :label="$t('communitySpacePersonManage.createTime')" align="center" />
  72 + <el-table-column prop="remark" :label="$t('communitySpacePersonManage.remark')" align="center" />
  73 + <el-table-column :label="$t('communitySpacePersonManage.operation')" align="center" width="150">
  74 + <template slot-scope="scope">
  75 + <el-button v-if="scope.row.state === 'S'" type="text" size="small"
  76 + @click="_openDeleteCommunitySpacePersonModel(scope.row)">
  77 + {{ $t('communitySpacePersonManage.cancelAppointment') }}
  78 + </el-button>
  79 + </template>
  80 + </el-table-column>
  81 + </el-table>
  82 + <el-pagination :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
  83 + layout="total, sizes, prev, pager, next, jumper" :total="page.total" @size-change="handleSizeChange"
  84 + @current-change="handleCurrentChange" />
  85 + </el-card>
  86 +
  87 + <!-- 删除确认对话框 -->
  88 + <delete-community-space-person ref="deleteDialog" @success="handleSuccess" />
  89 + </div>
  90 +</template>
  91 +
  92 +<script>
  93 +import DeleteCommunitySpacePerson from '@/components/community/deleteCommunitySpacePerson'
  94 +import { listCommunitySpacePerson, listCommunitySpace } from '@/api/community/communitySpacePersonManageApi'
  95 +import { getCommunityId } from '@/api/community/communityApi'
  96 +
  97 +export default {
  98 + name: 'CommunitySpacePersonManageList',
  99 + components: {
  100 + DeleteCommunitySpacePerson
  101 + },
  102 + data() {
  103 + return {
  104 + loading: false,
  105 + moreCondition: false,
  106 + conditions: {
  107 + spaceId: '',
  108 + personName: '',
  109 + personTel: '',
  110 + appointmentTime: '',
  111 + state: '',
  112 + communityId: ''
  113 + },
  114 + communitySpacePersons: [],
  115 + spaces: [],
  116 + page: {
  117 + current: 1,
  118 + size: 10,
  119 + total: 0
  120 + },
  121 + stateOptions: {
  122 + 'S': this.$t('communitySpacePersonManage.stateOptions.S'),
  123 + 'F': this.$t('communitySpacePersonManage.stateOptions.F'),
  124 + 'W': this.$t('communitySpacePersonManage.stateOptions.W'),
  125 + 'P': this.$t('communitySpacePersonManage.stateOptions.P')
  126 + }
  127 + }
  128 + },
  129 + created() {
  130 + this.conditions.communityId = getCommunityId()
  131 + this._listCommunitySpacePersonCommunitySpaces()
  132 + this._listCommunitySpacePersons(this.page.current, this.page.size)
  133 + },
  134 + methods: {
  135 + // 获取预约订单列表
  136 + async _listCommunitySpacePersons(page, size) {
  137 + this.loading = true
  138 + try {
  139 + const params = {
  140 + ...this.conditions,
  141 + page,
  142 + row: size
  143 + }
  144 + const res = await listCommunitySpacePerson(params )
  145 + this.communitySpacePersons = res.data
  146 + this.page.total = res.total
  147 + this.page.current = page
  148 + } catch (error) {
  149 + this.$message.error(error.message || this.$t('common.fetchError'))
  150 + } finally {
  151 + this.loading = false
  152 + }
  153 + },
  154 + // 获取场地列表
  155 + async _listCommunitySpacePersonCommunitySpaces() {
  156 + try {
  157 + const params = {
  158 + page: 1,
  159 + row: 100,
  160 + communityId: this.conditions.communityId
  161 + }
  162 + const res = await listCommunitySpace( params )
  163 + this.spaces = res.data
  164 + } catch (error) {
  165 + this.$message.error(error.message || this.$t('common.fetchError'))
  166 + }
  167 + },
  168 + // 查询
  169 + _queryCommunitySpacePersonMethod() {
  170 + this.page.current = 1
  171 + this._listCommunitySpacePersons(this.page.current, this.page.size)
  172 + },
  173 + // 重置
  174 + _resetCommunitySpacePersonMethod() {
  175 + this.conditions = {
  176 + spaceId: '',
  177 + personName: '',
  178 + personTel: '',
  179 + appointmentTime: '',
  180 + state: '',
  181 + communityId: this.conditions.communityId
  182 + }
  183 + this._queryCommunitySpacePersonMethod()
  184 + },
  185 + // 打开删除确认模态框
  186 + _openDeleteCommunitySpacePersonModel(row) {
  187 + this.$refs.deleteDialog.open(row)
  188 + },
  189 + // 删除成功后刷新列表
  190 + handleSuccess() {
  191 + this._listCommunitySpacePersons(this.page.current, this.page.size)
  192 + },
  193 + // 分页大小改变
  194 + handleSizeChange(val) {
  195 + this.page.size = val
  196 + this._listCommunitySpacePersons(this.page.current, val)
  197 + },
  198 + // 当前页改变
  199 + handleCurrentChange(val) {
  200 + this.page.current = val
  201 + this._listCommunitySpacePersons(val, this.page.size)
  202 + },
  203 + formatTimes(times) {
  204 + return times.map(t => t.hours).join(', ');
  205 + }
  206 + }
  207 +}
  208 +</script>
  209 +
  210 +<style lang="scss" scoped>
  211 +.app-container {
  212 + padding: 20px;
  213 +}
  214 +
  215 +.clearfix:before,
  216 +.clearfix:after {
  217 + display: table;
  218 + content: "";
  219 +}
  220 +
  221 +.clearfix:after {
  222 + clear: both;
  223 +}
  224 +
  225 +.box-card {
  226 + margin-bottom: 20px;
  227 +}
  228 +
  229 +.el-row {
  230 + margin-bottom: 10px;
  231 +}
  232 +</style>
0 \ No newline at end of file 233 \ No newline at end of file
src/views/community/reportCommunitySpaceLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + reportCommunitySpace: {
  4 + selectMonth: 'Select month',
  5 + appointmentTime: 'Appointment Time',
  6 + noSpace: 'No space set',
  7 + available: 'Available',
  8 + notAvailable: 'Not available'
  9 + },
  10 + addCommunitySpacePerson: {
  11 + title: 'Venue Reservation',
  12 + personName: 'Reserver Name',
  13 + personTel: 'Reserver Phone',
  14 + receivableAmount: 'Receivable Amount',
  15 + receivedAmount: 'Received Amount',
  16 + payWay: 'Payment Method',
  17 + appointmentTime: 'Appointment Time',
  18 + remark: 'Remark',
  19 + requiredPersonName: 'Required, please enter reserver name',
  20 + requiredPersonTel: 'Required, please enter reserver phone',
  21 + requiredReceivableAmount: 'Required, please enter receivable amount',
  22 + requiredReceivedAmount: 'Required, please enter received amount',
  23 + selectPayWay: 'Please select payment method',
  24 + requiredAppointmentTime: 'Required, please enter appointment time',
  25 + requiredRemark: 'Required, please enter remark',
  26 + maxPersonName: 'Reserver name cannot exceed 64 characters',
  27 + maxPersonTel: 'Reserver phone cannot exceed 11 characters',
  28 + maxReceivableAmount: 'Receivable amount cannot exceed 10 characters',
  29 + maxReceivedAmount: 'Received amount cannot exceed 10 characters',
  30 + maxRemark: 'Remark cannot exceed 512 characters',
  31 + cash: 'Cash',
  32 + wechat: 'WeChat',
  33 + alipay: 'Alipay',
  34 + requiredPayWay: 'Please select payment method'
  35 + }
  36 + },
  37 + zh: {
  38 + reportCommunitySpace: {
  39 + selectMonth: '请选择月份',
  40 + appointmentTime: '预约时间',
  41 + noSpace: '未设置场地',
  42 + available: '可预约',
  43 + notAvailable: '不可预约'
  44 + },
  45 + addCommunitySpacePerson: {
  46 + title: '场地预约',
  47 + personName: '预约人',
  48 + personTel: '预约电话',
  49 + receivableAmount: '应收金额',
  50 + receivedAmount: '实收金额',
  51 + payWay: '支付方式',
  52 + appointmentTime: '预约时间',
  53 + remark: '备注',
  54 + requiredPersonName: '必填,请填写预约人',
  55 + requiredPersonTel: '必填,请填写预约电话',
  56 + requiredReceivableAmount: '必填,请填写应收金额',
  57 + requiredReceivedAmount: '必填,请填写实收金额',
  58 + selectPayWay: '请选择支付方式',
  59 + requiredAppointmentTime: '必填,请填写预约时间',
  60 + requiredRemark: '必填,请填写备注',
  61 + maxPersonName: '预约人不能超过64个字符',
  62 + maxPersonTel: '预约电话不能超过11个字符',
  63 + maxReceivableAmount: '应收金额不能超过10个字符',
  64 + maxReceivedAmount: '实收金额不能超过10个字符',
  65 + maxRemark: '备注不能超过512个字符',
  66 + cash: '现金',
  67 + wechat: '微信',
  68 + alipay: '支付宝',
  69 + requiredPayWay: '请选择支付方式'
  70 + }
  71 + }
  72 +}
src/views/community/reportCommunitySpaceList.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row :gutter="20">
  4 + <el-col :span="4">
  5 + <el-card class="box-card">
  6 + <div class="filter-container">
  7 + <el-date-picker v-model="queryParams.appointmentTime" type="month"
  8 + :placeholder="$t('reportCommunitySpace.selectMonth')" value-format="yyyy-MM" @change="fetchData" />
  9 + </div>
  10 + <el-scrollbar class="venue-scrollbar">
  11 + <ul class="venue-items">
  12 + <li v-for="(item, index) in venues" :key="index" :class="{ 'active': queryParams.venueId === item.venueId }"
  13 + @click="selectVenue(item)">
  14 + {{ item.name }}
  15 + </li>
  16 + </ul>
  17 + </el-scrollbar>
  18 + </el-card>
  19 + </el-col>
  20 +
  21 + <el-col :span="20">
  22 + <el-card class="box-card">
  23 + <el-table :data="tableData" border style="width: 100%">
  24 + <el-table-column prop="time" :label="$t('reportCommunitySpace.appointmentTime')" width="100" align="center" />
  25 + <template v-if="communitySpaces.length > 0">
  26 + <el-table-column v-for="space in communitySpaces" :key="space.spaceId" :label="space.name" align="center">
  27 + <template slot-scope="{ $index }">
  28 + <div v-if="getSpaceStatus($index, space) === 'available'">
  29 + <el-button type="text" @click="openAddModal(space.spaceId, $index)">
  30 + {{ $t('reportCommunitySpace.available') }}
  31 + </el-button>
  32 + </div>
  33 + <div v-else>
  34 + {{ getSpaceStatus($index, space) }}
  35 + </div>
  36 + </template>
  37 + </el-table-column>
  38 + </template>
  39 + <el-table-column v-else :label="$t('reportCommunitySpace.noSpace')" align="center" />
  40 + </el-table>
  41 + </el-card>
  42 + </el-col>
  43 + </el-row>
  44 +
  45 + <add-community-space-person ref="addPersonDialog" @success="fetchData" />
  46 + </div>
  47 +</template>
  48 +
  49 +<script>
  50 +import { listCommunityVenue, listCommunitySpace, listCommunitySpacePerson } from '@/api/community/reportCommunitySpaceApi'
  51 +import AddCommunitySpacePerson from '@/components/community/addCommunitySpacePerson'
  52 +import { getCommunityId } from '@/api/community/communityApi'
  53 +import { getDateYYYYMMDD } from '@/utils/dateUtil'
  54 +
  55 +export default {
  56 + name: 'ReportCommunitySpaceList',
  57 + components: { AddCommunitySpacePerson },
  58 + data() {
  59 + return {
  60 + queryParams: {
  61 + venueId: '',
  62 + appointmentTime: getDateYYYYMMDD(),
  63 + communityId: getCommunityId()
  64 + },
  65 + venues: [],
  66 + communitySpaces: [],
  67 + spacePersons: [],
  68 + tableData: Array.from({ length: 24 }, (_, i) => ({ time: `${i}` }))
  69 + }
  70 + },
  71 + created() {
  72 + this.fetchVenues()
  73 + },
  74 + methods: {
  75 + selectVenue(venue) {
  76 + this.queryParams.venueId = venue.venueId
  77 + this.fetchData()
  78 + },
  79 + async fetchVenues() {
  80 + try {
  81 + const params = {
  82 + page: 1,
  83 + row: 100,
  84 + communityId: this.queryParams.communityId
  85 + }
  86 + this.venues = await listCommunityVenue(params)
  87 + if (this.venues.length > 0) {
  88 + this.queryParams.venueId = this.venues[0].venueId
  89 + this.fetchData()
  90 + }
  91 + } catch (error) {
  92 + this.$message.error(this.$t('common.fetchFailed'))
  93 + }
  94 + },
  95 + async fetchData() {
  96 + if (!this.queryParams.venueId) return
  97 +
  98 + try {
  99 + // 获取场地列表
  100 + const spaceParams = {
  101 + page: 1,
  102 + row: 100,
  103 + venueId: this.queryParams.venueId,
  104 + communityId: this.queryParams.communityId
  105 + }
  106 + this.communitySpaces = await listCommunitySpace(spaceParams)
  107 +
  108 + // 获取预约记录
  109 + const personParams = {
  110 + page: 1,
  111 + row: 100,
  112 + venueId: this.queryParams.venueId,
  113 + appointmentTime: this.queryParams.appointmentTime,
  114 + communityId: this.queryParams.communityId,
  115 + state: 'S'
  116 + }
  117 + this.spacePersons = await listCommunitySpacePerson(personParams)
  118 + } catch (error) {
  119 + this.$message.error(this.$t('common.fetchFailed'))
  120 + }
  121 + },
  122 + getSpaceStatus(hour, space) {
  123 + // 检查场地是否在该小时不可用
  124 + const openTime = space.openTimes.find(t => t.hours == hour)
  125 + if (openTime && openTime.isOpen === 'N') {
  126 + return this.$t('reportCommunitySpace.notAvailable')
  127 + }
  128 +
  129 + // 检查是否有预约
  130 + const person = this.spacePersons.find(p => p.spaceId === space.spaceId)
  131 + if (person) {
  132 + const timeSlot = person.times.find(t => t.hours == hour)
  133 + if (timeSlot) {
  134 + return `${person.personName} > ${person.personTel}`
  135 + }
  136 + }
  137 +
  138 + return 'available'
  139 + },
  140 + openAddModal(spaceId, hour) {
  141 + const data = {
  142 + spaceId: spaceId,
  143 + hours: hour,
  144 + appointmentTime: this.queryParams.appointmentTime,
  145 + openTime: hour
  146 + }
  147 + this.$refs.addPersonDialog.open(data)
  148 + }
  149 + }
  150 +}
  151 +</script>
  152 +
  153 +<style lang="scss" scoped>
  154 +.app-container {
  155 + padding: 20px;
  156 +}
  157 +
  158 +.box-card {
  159 + margin-bottom: 20px;
  160 +}
  161 +
  162 +.filter-container {
  163 + margin-bottom: 20px;
  164 +}
  165 +
  166 +.venue-list {
  167 + max-height: calc(100vh - 200px);
  168 + overflow-y: auto;
  169 +}
  170 +
  171 +.venue-items {
  172 + list-style: none;
  173 + padding: 0;
  174 + margin: 0;
  175 +}
  176 +
  177 +.venue-items li {
  178 + padding: 12px 15px;
  179 + border-bottom: 1px solid #eee;
  180 + cursor: pointer;
  181 + transition: all 0.3s;
  182 +}
  183 +
  184 +.venue-items li:hover {
  185 + background-color: #f5f7fa;
  186 +}
  187 +
  188 +.venue-items li.active {
  189 + background-color: #ecf5ff;
  190 + color: #409eff;
  191 + font-weight: bold;
  192 +}
  193 +
  194 +.venue-radio {
  195 + margin-bottom: 10px;
  196 + padding: 10px;
  197 + border-radius: 4px;
  198 + background: #f5f7fa;
  199 +
  200 + &:hover {
  201 + background: #e4e7ed;
  202 + }
  203 +
  204 + ::v-deep .el-radio__label {
  205 + padding-left: 10px;
  206 + }
  207 +}
  208 +</style>
0 \ No newline at end of file 209 \ No newline at end of file