2024-02-23 16:52:51 +08:00
|
|
|
<template>
|
|
|
|
<a-card :bordered="false">
|
|
|
|
<div class="table-page-search-wrapper">
|
|
|
|
<a-form layout="inline">
|
|
|
|
<a-row :gutter="48">
|
2024-03-05 17:23:01 +08:00
|
|
|
<a-col :md="5" :sm="15">
|
|
|
|
<a-form-item label="关键词">
|
|
|
|
<a-input placeholder="请输入关键词" v-model="queryParam.meetingName" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-02-23 16:52:51 +08:00
|
|
|
<a-col :md="5" :sm="15">
|
|
|
|
<a-form-item label="类型">
|
2024-03-05 17:23:01 +08:00
|
|
|
<a-select v-model="queryParam.type" placeholder="请选择类型">
|
|
|
|
<a-select-option v-for="(item,index) in typeList" :key="item.id" :value="item.typeName">
|
|
|
|
{{ item.typeName }}
|
|
|
|
</a-select-option>
|
|
|
|
|
|
|
|
</a-select>
|
2024-02-23 16:52:51 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="5" :sm="15">
|
2024-03-05 17:23:01 +08:00
|
|
|
<a-form-item label="排列形状">
|
|
|
|
<a-select v-model="queryParam.shape" placeholder="请选择排列形状">
|
|
|
|
<a-select-option v-for="(item,index) in shapeList" :key="item.id" :value="item.shape">
|
|
|
|
{{ item.shape }}
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
2024-02-23 16:52:51 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-03-05 17:23:01 +08:00
|
|
|
<a-col :md="5" :sm="15">
|
2024-02-23 16:52:51 +08:00
|
|
|
<a-form-item label="容纳人数">
|
2024-03-05 17:23:01 +08:00
|
|
|
<a-select v-model="queryParam.status" placeholder="请选择类型">
|
|
|
|
<a-select-option v-for="(item,index) in capacityList" :key="item.id" :value="item.capacityNum">
|
|
|
|
{{ item.capacityNum }}
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
2024-02-23 16:52:51 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button>
|
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</div>
|
|
|
|
<div class="table-operator">
|
|
|
|
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button>
|
|
|
|
<a-dropdown v-if="removeEnable && selectedRowKeys.length > 0">
|
|
|
|
<a-button type="danger" icon="delete" @click="delByIds(selectedRowKeys)">删除</a-button>
|
|
|
|
</a-dropdown>
|
|
|
|
</div>
|
|
|
|
<s-table
|
|
|
|
size="default"
|
|
|
|
ref="table"
|
|
|
|
rowKey="id"
|
|
|
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
|
:columns="columns"
|
|
|
|
:data="loadData"
|
|
|
|
>
|
2024-03-05 17:23:01 +08:00
|
|
|
<span slot="type" slot-scope="text">
|
|
|
|
{{ text | typeFilter }}
|
|
|
|
</span>
|
|
|
|
<span slot="item" slot-scope="text,record">
|
|
|
|
<a @click="handleItemTable(record)">1</a>
|
|
|
|
</span>
|
2024-02-23 16:52:51 +08:00
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a>
|
|
|
|
<a-divider type="vertical" />
|
|
|
|
<a v-if="removeEnable" @click="delByIds([record.id])">删除</a>
|
|
|
|
</span>
|
|
|
|
</s-table>
|
|
|
|
<roomContent-modal ref="modal" @ok="handleOk" />
|
2024-03-05 17:23:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
<a-modal v-model="visible" title="会议设备" width="1000px" @ok='itemHandleOk()'>
|
|
|
|
<div class="table-page-search-wrapper">
|
|
|
|
<a-form layout="inline">
|
|
|
|
<a-row :gutter="48">
|
|
|
|
<a-col :md="8" :sm="15">
|
|
|
|
<a-form-item label="关键词">
|
|
|
|
<a-input placeholder="请输入关键词" v-model="itemQueryParam.itemName" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="8" :sm="30">
|
|
|
|
<a-form-item label="服务类型">
|
|
|
|
<a-select v-model="itemQueryParam.itemType" placeholder="请选择服务类型">
|
|
|
|
<a-select-option value="1">
|
|
|
|
免费服务
|
|
|
|
</a-select-option>
|
|
|
|
<a-select-option value="2">
|
|
|
|
增值服务
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
|
<!-- 查询有问题-->
|
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
<a-button style="margin-left: 8px" @click="() => (itemQueryParam = {})">重置</a-button>
|
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</div>
|
|
|
|
<div class="table-operator">
|
|
|
|
</div>
|
|
|
|
<s-table
|
|
|
|
size="default"
|
|
|
|
ref="table"
|
|
|
|
rowKey="id"
|
|
|
|
:rowSelection="{ selectedRowKeys: selectedItemRowKeys, onChange: onItemSelectChange }"
|
|
|
|
:columns="itemColumns"
|
|
|
|
:data="itemLoadData"
|
|
|
|
>
|
|
|
|
<span slot="serveType" slot-scope="text">
|
|
|
|
{{ text | serveTypeFilter }}
|
|
|
|
</span>
|
|
|
|
<!-- <span slot="action" slot-scope="text, record">-->
|
|
|
|
<!-- <a v-if="editEnabel" @click="handleEdit(record)">编辑</a>-->
|
|
|
|
<!-- <a-divider type="vertical" />-->
|
|
|
|
<!-- <a v-if="removeEnable" @click="delByIds([record.id])">删除</a>-->
|
|
|
|
<!-- </span>-->
|
|
|
|
</s-table>
|
|
|
|
</a-modal>
|
2024-02-23 16:52:51 +08:00
|
|
|
</a-card>
|
2024-03-05 17:23:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-23 16:52:51 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { STable } from '@/components'
|
|
|
|
|
2024-03-05 17:23:01 +08:00
|
|
|
import { getRoomContentList,delRoomContent,selectSearchInfoByType,selectSearchInfoByShape,selectSearchInfoByCapacity } from '@/api/admin/meeting/roomContent'
|
|
|
|
import { getRoomServeList } from '@/api/admin/meeting/roomServe'
|
2024-02-23 16:52:51 +08:00
|
|
|
import RoomContentModal from './modules/RoomContentModal.vue'
|
|
|
|
import { checkPermission } from '@/utils/permissions'
|
2024-03-05 17:23:01 +08:00
|
|
|
import { getDictArray } from '@/utils/dict'
|
2024-02-23 16:52:51 +08:00
|
|
|
|
2024-03-05 17:23:01 +08:00
|
|
|
const typeMap = {}
|
|
|
|
const serveTypeMap = {}
|
2024-02-23 16:52:51 +08:00
|
|
|
export default {
|
|
|
|
name: 'TableList',
|
|
|
|
components: {
|
|
|
|
STable,
|
|
|
|
RoomContentModal
|
|
|
|
},
|
2024-03-05 17:23:01 +08:00
|
|
|
data () {
|
2024-02-23 16:52:51 +08:00
|
|
|
return {
|
|
|
|
labelCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 5 },
|
|
|
|
},
|
|
|
|
wrapperCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 16 },
|
|
|
|
},
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
mdl: {},
|
2024-03-05 17:23:01 +08:00
|
|
|
visible: false,
|
|
|
|
typeMap,
|
2024-02-23 16:52:51 +08:00
|
|
|
// 高级搜索 展开/关闭
|
|
|
|
advanced: false,
|
|
|
|
// 查询参数
|
|
|
|
queryParam: {},
|
2024-03-05 17:23:01 +08:00
|
|
|
itemQueryParam:{},
|
|
|
|
capacityList: [],
|
|
|
|
shapeList: [],
|
|
|
|
typeList:[],
|
|
|
|
serveTypeMap,
|
|
|
|
itemColumns: [
|
2024-02-23 16:52:51 +08:00
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '服务名称',
|
|
|
|
dataIndex: 'serveName'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '服务类型',
|
|
|
|
dataIndex: 'serveType',
|
|
|
|
scopedSlots: { customRender: 'serveType' }
|
2024-02-23 16:52:51 +08:00
|
|
|
},
|
2024-03-05 17:23:01 +08:00
|
|
|
{
|
|
|
|
title: '金额',
|
|
|
|
dataIndex: 'money'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
// 表头
|
|
|
|
columns: [
|
2024-02-23 16:52:51 +08:00
|
|
|
{
|
|
|
|
title: '名称',
|
|
|
|
dataIndex: 'meetingName'
|
|
|
|
},
|
2024-03-05 17:23:01 +08:00
|
|
|
{
|
|
|
|
title: '类型',
|
|
|
|
dataIndex: 'typeName',
|
|
|
|
scopedSlots: { customRender: 'typeName' }
|
|
|
|
},
|
2024-02-23 16:52:51 +08:00
|
|
|
{
|
|
|
|
title: '容纳人数',
|
|
|
|
dataIndex: 'capacityNum'
|
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '排列形状',
|
|
|
|
dataIndex: 'shape'
|
2024-02-23 16:52:51 +08:00
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '会议设备',
|
|
|
|
dataIndex: 'item',
|
|
|
|
scopedSlots: { customRender: 'item' }
|
2024-02-23 16:52:51 +08:00
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '关联服务',
|
2024-02-23 16:52:51 +08:00
|
|
|
dataIndex: 'money'
|
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '金额',
|
|
|
|
dataIndex: 'money'
|
2024-02-23 16:52:51 +08:00
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:23:01 +08:00
|
|
|
title: '负责人',
|
|
|
|
dataIndex: 'createBy'
|
2024-02-23 16:52:51 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '操作',
|
|
|
|
width: '200px',
|
|
|
|
dataIndex: 'action',
|
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
|
},
|
|
|
|
],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
|
loadData: (parameter) => {
|
|
|
|
return getRoomContentList(Object.assign(parameter, this.queryParam))
|
|
|
|
},
|
2024-03-05 17:23:01 +08:00
|
|
|
itemLoadData:(parameter) => {
|
|
|
|
return getRoomServeList(Object.assign(parameter, this.itemQueryParam))
|
|
|
|
},
|
2024-02-23 16:52:51 +08:00
|
|
|
selectedRowKeys: [],
|
|
|
|
selectedRows: [],
|
2024-03-05 17:23:01 +08:00
|
|
|
|
|
|
|
selectedItemRowKeys: [],
|
|
|
|
selectedItemRows: [],
|
2024-02-23 16:52:51 +08:00
|
|
|
addEnable: checkPermission('meeting:roomContent:add'),
|
|
|
|
editEnabel: checkPermission('meeting:roomContent:edit'),
|
|
|
|
removeEnable: checkPermission('meeting:roomContent:remove'),
|
|
|
|
}
|
|
|
|
},
|
2024-03-05 17:23:01 +08:00
|
|
|
filters: {
|
|
|
|
typeFilter (Type) {
|
|
|
|
return typeMap[Type].text
|
|
|
|
},
|
|
|
|
serveTypeFilter (serveType) {
|
|
|
|
return serveTypeMap[serveType].text
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async created () {
|
|
|
|
const TypeData = await getDictArray('meeting_type')
|
|
|
|
TypeData.map(d => {
|
|
|
|
typeMap[d.dictValue] = { text: d.dictLabel }
|
|
|
|
})
|
|
|
|
const serveTypeData = await getDictArray('serve_type')
|
|
|
|
serveTypeData.map(d => {
|
|
|
|
serveTypeMap[d.dictValue] = { text: d.dictLabel }
|
|
|
|
})
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.selectSearchInfoByType()
|
|
|
|
this.selectSearchInfoByShape()
|
|
|
|
this.selectSearchInfoByCapacity()
|
|
|
|
},
|
2024-02-23 16:52:51 +08:00
|
|
|
methods: {
|
2024-03-05 17:23:01 +08:00
|
|
|
itemHandleOk(){
|
|
|
|
// 新增 物品跟会议室关联
|
|
|
|
},
|
|
|
|
onItemSelectChange(selectedRowKeys, selectedRows){
|
|
|
|
this.selectedItemRowKeys = selectedRowKeys
|
|
|
|
this.selectedItemRows = selectedRows
|
|
|
|
console.log(this.selectedItemRowKeys)
|
|
|
|
},
|
|
|
|
handleItemTable () {
|
|
|
|
this.visible = true
|
|
|
|
},
|
|
|
|
// 获取查询条件
|
|
|
|
selectSearchInfoByType () {
|
|
|
|
selectSearchInfoByType().then((res) => {
|
|
|
|
this.typeList = res.roomContents
|
|
|
|
})
|
|
|
|
},
|
|
|
|
selectSearchInfoByShape () {
|
|
|
|
selectSearchInfoByShape().then((res) => {
|
|
|
|
this.shapeList = res.roomContents
|
|
|
|
})
|
|
|
|
},
|
|
|
|
selectSearchInfoByCapacity () {
|
|
|
|
selectSearchInfoByCapacity().then((res) => {
|
|
|
|
this.capacityList = res.roomContents
|
|
|
|
})
|
|
|
|
},
|
2024-02-23 16:52:51 +08:00
|
|
|
onSelectChange(selectedRowKeys, selectedRows) {
|
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
|
this.selectedRows = selectedRows
|
|
|
|
},
|
|
|
|
handleAdd() {
|
|
|
|
this.$refs.modal.add()
|
|
|
|
},
|
|
|
|
handleEdit(record) {
|
|
|
|
this.$refs.modal.edit(record)
|
|
|
|
},
|
|
|
|
handleOk() {
|
|
|
|
this.$refs.table.refresh(true)
|
|
|
|
console.log('handleSaveOk')
|
|
|
|
},
|
|
|
|
delByIds(ids) {
|
|
|
|
delRoomContent({ ids: ids.join(',') }).then((res) => {
|
|
|
|
if (res.code === 0) {
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
this.handleOk()
|
|
|
|
} else {
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
}
|
|
|
|
this.selectedRowKeys = []
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
/*
|
|
|
|
'selectedRows': function (selectedRows) {
|
|
|
|
this.needTotalList = this.needTotalList.map(item => {
|
|
|
|
return {
|
|
|
|
...item,
|
|
|
|
total: selectedRows.reduce( (sum, val) => {
|
|
|
|
return sum + val[item.dataIndex]
|
|
|
|
}, 0)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|