| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <div class="app-container">
- <el-form :model="queryForm" inline size="small">
- <el-form-item label="点位类型">
- <el-select v-model="queryForm.dataType" placeholder="请选择" clearable @change="onDataTypeChange">
- <el-option label="场馆" value="VENUE"/>
- <el-option label="景区" value="SCENERY"/>
- <el-option label="度假村" value="HOLIDAY_VILLAGE"/>
- <el-option label="酒店" value="HOTEL"/>
- <el-option label="民宿" value="HOME_STAY"/>
- <el-option label="旅行社" value="TOURIST"/>
- </el-select>
- </el-form-item>
- <el-form-item label="点位分布">
- <select-base-bz-data v-model="queryForm.bzId" :multiple="false" :data-type="queryForm.dataType" :disabled="disabledSelectBz"/>
- </el-form-item>
- <el-form-item label="时间维度">
- <el-date-picker
- v-model="queryForm.serviceBeginTime"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </el-form>
- <el-row class="action-bar-container" type="flex" justify="end">
- <el-button type="primary" size="small" @click.native="fetchData">查询</el-button>
- <el-button-group>
- <el-button v-permission="['bz.passenger.equipment.add']" size="small" @click.native="$refs.dialogForm.open({})">
- 新建
- </el-button>
- </el-button-group>
- </el-row>
- <el-card
- v-for="item in pageData.records"
- :key="item.id"
- :style="{ padding: '0px',float:'left',margin:'0 10px 10px 0' }"
- shadow="hover"
- >
- <img :src="item.litpic" class="image" style="width: 200px;height: 150px;" :alt="item.brief">
- <div style="font-size: 14px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;width:200px ">
- {{ item.brief }}
- </div>
- <div class="clearfix">
- <el-row :gutter="16">
- <el-col :span="12">
- <p>
- {{ item.inPeopleCount || 0 }}
- <span style="color: gray;font-size: 12px;display: block">流入数量</span>
- </p>
- </el-col>
- <el-col :span="12">
- <p>
- {{ item.outPeopleCount || 0 }}
- <span style="color: gray;font-size: 12px;display: block">流出数量</span>
- </p>
- </el-col>
- </el-row>
- </div>
- <div class="clearfix action-btns">
- <el-button v-permission="['bz.passenger.equipment.edit']" type="text" href="javascript:;" @click="$refs.dialogForm.open(item)">编辑</el-button>
- <el-button v-permission="['bz.passenger.equipment.delete']" type="text" href="javascript:;" @click="deleteByIds([item.id])">删除</el-button>
- <el-button type="text" href="javascript:;">详情</el-button>
- </div>
- </el-card>
- <div style="clear: both"/>
- <el-pagination
- class="pagination-container"
- background
- layout="prev, pager, next"
- :total="pageData.total"
- :page-size="pageData.pageSize"
- @current-change="paginationChange"
- />
- <dialog-form ref="dialogForm" @ok="fetchData"/>
- </div>
- </template>
- <style type="text/css">
- .action-btns {
- text-align: right;
- }
- </style>
- <script>
- import { deleteByIds, findPage } from '@/api/bz/equipment'
- import { dateTimeFormatter } from '@/utils/formater'
- import DialogForm from './DialogForm'
- import SelectBaseBzData from '@/components/SelectBaseBzData'
- export default {
- components: { DialogForm, SelectBaseBzData },
- data() {
- return {
- queryForm: {},
- isLoading: true,
- pageData: {
- records: []
- },
- currentPage: 1,
- multipleSelection: []
- }
- },
- computed: {
- disabledSelectBz: function() {
- return !this.queryForm || !this.queryForm.dataType || this.queryForm.dataType === ''
- }
- },
- created() {
- this.fetchData()
- },
- methods: {
- dateTimeFormatter,
- onDataTypeChange() {
- this.queryForm.bzId = ''
- },
- selectionChange(val) {
- const temp = []
- val.forEach(o => {
- temp.push(o.id)
- })
- this.multipleSelection = temp
- },
- deleteByIds(ids) {
- this.$confirm('确认要删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleteByIds(ids).then(() => {
- this.fetchData()
- })
- })
- },
- paginationChange(val) {
- this.currentPage = val
- this.fetchData()
- },
- fetchData() {
- this.isLoading = true
- findPage({ ...this.queryForm, current: this.currentPage })
- .then((response) => {
- this.pageData = response
- })
- .finally(() => (this.isLoading = false))
- }
- }
- }
- </script>
|