|
@@ -1,38 +1,41 @@
|
|
<template>
|
|
<template>
|
|
- <a-card :bordered="false">
|
|
|
|
|
|
+ <a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
|
|
|
|
+ <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-form-item label="预约类型" name="appointmentType">
|
|
|
|
+ <a-input v-model:value="searchFormState.appointmentType" placeholder="查询预约类型" allow-clear />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
|
|
|
+ <a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
|
|
|
+
|
|
|
|
+ <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizParkConfigAdd')">
|
|
|
|
+ <template #icon><plus-outlined /></template>
|
|
|
|
+ 新增
|
|
|
|
+ </a-button>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </a-card>
|
|
|
|
+ <a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
|
|
<s-table
|
|
<s-table
|
|
ref="tableRef"
|
|
ref="tableRef"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
- :alert="options.alert.show"
|
|
|
|
bordered
|
|
bordered
|
|
:row-key="(record) => record.id"
|
|
:row-key="(record) => record.id"
|
|
- :tool-config="toolConfig"
|
|
|
|
- :row-selection="options.rowSelection"
|
|
|
|
>
|
|
>
|
|
- <template #operator class="table-operator">
|
|
|
|
- <a-space>
|
|
|
|
- <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizParkConfigAdd')">
|
|
|
|
- <template #icon><plus-outlined /></template>
|
|
|
|
- 新增
|
|
|
|
- </a-button>
|
|
|
|
- <xn-batch-button
|
|
|
|
- v-if="hasPerm('bizParkConfigBatchDelete')"
|
|
|
|
- buttonName="批量删除"
|
|
|
|
- icon="DeleteOutlined"
|
|
|
|
- :selectedRowKeys="selectedRowKeys"
|
|
|
|
- @batchCallBack="deleteBatchBizParkConfig"
|
|
|
|
- />
|
|
|
|
- </a-space>
|
|
|
|
- </template>
|
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
|
|
|
+ <template #bodyCell="{ column, record, index }">
|
|
|
|
+ <template v-if="column.dataIndex === 'serial'">
|
|
|
|
+ {{ index + 1 }}
|
|
|
|
+ </template>
|
|
<template v-if="column.dataIndex === 'action'">
|
|
<template v-if="column.dataIndex === 'action'">
|
|
<a-space>
|
|
<a-space>
|
|
<a @click="formRef.onOpen(record)" v-if="hasPerm('bizParkConfigEdit')">编辑</a>
|
|
<a @click="formRef.onOpen(record)" v-if="hasPerm('bizParkConfigEdit')">编辑</a>
|
|
<a-divider type="vertical" v-if="hasPerm(['bizParkConfigEdit', 'bizParkConfigDelete'], 'and')" />
|
|
<a-divider type="vertical" v-if="hasPerm(['bizParkConfigEdit', 'bizParkConfigDelete'], 'and')" />
|
|
- <a-popconfirm title="确定要删除吗?" @confirm="deleteBizParkConfig(record)">
|
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('bizParkConfigDelete')">删除</a-button>
|
|
|
|
- </a-popconfirm>
|
|
|
|
|
|
+ <a-button type="link" danger size="small" v-if="hasPerm('bizParkConfigDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
</a-space>
|
|
</a-space>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
@@ -45,10 +48,20 @@
|
|
import { cloneDeep } from 'lodash-es'
|
|
import { cloneDeep } from 'lodash-es'
|
|
import Form from './form.vue'
|
|
import Form from './form.vue'
|
|
import bizParkConfigApi from '@/api/biz/bizParkConfigApi'
|
|
import bizParkConfigApi from '@/api/biz/bizParkConfigApi'
|
|
|
|
+
|
|
|
|
+ const searchFormState = ref({})
|
|
|
|
+ const searchFormRef = ref()
|
|
const tableRef = ref()
|
|
const tableRef = ref()
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
|
|
+ const submitLoading = ref(false)
|
|
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
const columns = [
|
|
const columns = [
|
|
|
|
+ {
|
|
|
|
+ title: '序号',
|
|
|
|
+ width: 50,
|
|
|
|
+ dataIndex: 'serial',
|
|
|
|
+ align:'center'
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '预约类型',
|
|
title: '预约类型',
|
|
dataIndex: 'appointmentType'
|
|
dataIndex: 'appointmentType'
|
|
@@ -65,6 +78,11 @@
|
|
title: '支付后停留时长',
|
|
title: '支付后停留时长',
|
|
dataIndex: 'payAfterParkTime'
|
|
dataIndex: 'payAfterParkTime'
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '创建时间',
|
|
|
|
+ dataIndex: 'createTime',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
]
|
|
]
|
|
// 操作栏通过权限判断是否显示
|
|
// 操作栏通过权限判断是否显示
|
|
if (hasPerm(['bizParkConfigEdit', 'bizParkConfigDelete'])) {
|
|
if (hasPerm(['bizParkConfigEdit', 'bizParkConfigDelete'])) {
|
|
@@ -75,24 +93,9 @@
|
|
width: 150
|
|
width: 150
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- const selectedRowKeys = ref([])
|
|
|
|
- // 列表选择配置
|
|
|
|
- const options = {
|
|
|
|
- // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
|
- alert: {
|
|
|
|
- show: true,
|
|
|
|
- clear: () => {
|
|
|
|
- selectedRowKeys.value = ref([])
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- rowSelection: {
|
|
|
|
- onChange: (selectedRowKey, selectedRows) => {
|
|
|
|
- selectedRowKeys.value = selectedRowKey
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
const loadData = (parameter) => {
|
|
const loadData = (parameter) => {
|
|
- return bizParkConfigApi.bizParkConfigPage(parameter).then((data) => {
|
|
|
|
|
|
+ const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
|
+ return bizParkConfigApi.bizParkConfigPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -102,20 +105,29 @@
|
|
tableRef.value.refresh(true)
|
|
tableRef.value.refresh(true)
|
|
}
|
|
}
|
|
// 删除
|
|
// 删除
|
|
- const deleteBizParkConfig = (record) => {
|
|
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- id: record.id
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- bizParkConfigApi.bizParkConfigDelete(params).then(() => {
|
|
|
|
- tableRef.value.refresh(true)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 批量删除
|
|
|
|
- const deleteBatchBizParkConfig = (params) => {
|
|
|
|
- bizParkConfigApi.bizParkConfigDelete(params).then(() => {
|
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
|
|
|
+ const deleteConfig = (record) => {
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
+ content: '',
|
|
|
|
+ onOk() {
|
|
|
|
+ submitLoading.value = true
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ id: record.id
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+ bizServiceCustomerApi
|
|
|
|
+ .bizServiceCustomerDelete(params)
|
|
|
|
+ .then(() => {
|
|
|
|
+ tableRef.value.refresh(true)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ submitLoading.value = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onCancel() {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|