fix:修改页面bug
This commit is contained in:
parent
e71013676d
commit
325fc0e926
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-tabs v-model:activeKey="activeKey" @change="onTabChange" style="width: 100%; margin-top: 10px;">
|
<a-tabs v-model:activeKey="activeKey" @change="onTabChange" style="width: 100%; margin-top: 10px">
|
||||||
<a-tab-pane key="" tab="全部"></a-tab-pane>
|
<a-tab-pane key="" tab="全部"></a-tab-pane>
|
||||||
<a-tab-pane key="0" tab="待处理" force-render></a-tab-pane>
|
<a-tab-pane key="0" tab="待处理" force-render></a-tab-pane>
|
||||||
<a-tab-pane key="1" tab="处理中"></a-tab-pane>
|
<a-tab-pane key="1" tab="处理中"></a-tab-pane>
|
||||||
@ -12,7 +12,10 @@
|
|||||||
<a-row :gutter="8">
|
<a-row :gutter="8">
|
||||||
<a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
|
<a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
|
||||||
<a-form-item label="反馈时间">
|
<a-form-item label="反馈时间">
|
||||||
<a-range-picker v-model:value="queryform.backTime" :placeholder="['反馈时间起','反馈时间止']" />
|
<a-range-picker
|
||||||
|
v-model:value="queryform.backTime"
|
||||||
|
:placeholder="['反馈时间起', '反馈时间止']"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="12" :md="12" :sm="24" :xs="24">
|
<a-col :xl="6" :lg="12" :md="12" :sm="24" :xs="24">
|
||||||
@ -28,10 +31,7 @@
|
|||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<a-spin
|
<a-spin :spinning="spinning" :tip="tipContent">
|
||||||
:spinning="spinning"
|
|
||||||
:tip="tipContent"
|
|
||||||
>
|
|
||||||
<a-table
|
<a-table
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
@ -46,7 +46,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'dealState'">
|
<template v-if="column.key === 'dealState'">
|
||||||
{{ record.dealState == '0' ? '未处理' : record.dealState == '1' ? '处理中' : record.dealState == '2' ? '已处理' : '' }}
|
{{
|
||||||
|
record.dealState == '0'
|
||||||
|
? '未处理'
|
||||||
|
: record.dealState == '1'
|
||||||
|
? '处理中'
|
||||||
|
: record.dealState == '2'
|
||||||
|
? '已处理'
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space v-if="record.dealState == '0'">
|
<a-space v-if="record.dealState == '0'">
|
||||||
@ -71,54 +79,51 @@
|
|||||||
>
|
>
|
||||||
<BackSiteForm ref="formModel"></BackSiteForm>
|
<BackSiteForm ref="formModel"></BackSiteForm>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||||
import { callOrder } from '@/apis/call.js'
|
import { callOrder } from '@/apis/call.js'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
import config from '@/utils/config.js'
|
import config from '@/utils/config.js'
|
||||||
import { dataFormat } from '@/utils/tools'
|
import { dataFormat } from '@/utils/tools'
|
||||||
import { getCache } from '@/utils/authority';
|
import { getCache } from '@/utils/authority'
|
||||||
import BackSiteForm from '@/views/form/backsite/BackSiteForm.vue'
|
import BackSiteForm from '@/views/form/backsite/BackSiteForm.vue'
|
||||||
const activeKey = ref('');
|
const activeKey = ref('')
|
||||||
|
|
||||||
const open = ref(false);
|
const open = ref(false)
|
||||||
const openTitle = ref('处理停车点申请');
|
const openTitle = ref('处理停车点申请')
|
||||||
const formModel = ref(null);
|
const formModel = ref(null)
|
||||||
|
|
||||||
const spinning = ref(false);
|
const spinning = ref(false)
|
||||||
const tipContent = ref("加载中...");
|
const tipContent = ref('加载中...')
|
||||||
// 表格行数据
|
// 表格行数据
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([])
|
||||||
const data = ref([])
|
const data = ref([])
|
||||||
// 查询相关
|
// 查询相关
|
||||||
const queryform = ref({
|
const queryform = ref({
|
||||||
regionId: '',
|
regionId: '',
|
||||||
state: '',
|
state: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
backTime: [
|
backTime: ['', ''],
|
||||||
'',
|
|
||||||
''
|
|
||||||
],
|
|
||||||
pageParam: {
|
pageParam: {
|
||||||
pageNum: config.pageParam.pageNum,
|
pageNum: config.pageParam.pageNum,
|
||||||
pageSize: config.pageParam.pageSize
|
pageSize: config.pageParam.pageSize
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//对于每页数据的管理
|
//对于每页数据的管理
|
||||||
let pagination = reactive({
|
let pagination = reactive({
|
||||||
total: dataSource.value.length,
|
total: dataSource.value.length,
|
||||||
current: queryform.value.pageParam.pageNum,
|
current: queryform.value.pageParam.pageNum,
|
||||||
pageSize: queryform.value.pageParam.pageSize,
|
pageSize: queryform.value.pageParam.pageSize,
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSizeOptions: config.pageParam.pageSizeOptions,
|
pageSizeOptions: config.pageParam.pageSizeOptions,
|
||||||
showQuickJumper: true
|
showQuickJumper: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
key: 'index',
|
key: 'index',
|
||||||
@ -192,28 +197,28 @@ import { getCache } from '@/utils/authority';
|
|||||||
width: 320,
|
width: 320,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
//获取用户列表数据并格式化字段
|
//获取用户列表数据并格式化字段
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
getData();
|
getData()
|
||||||
})
|
})
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
spinning.value = true;
|
spinning.value = true
|
||||||
let queryparams = queryform.value;
|
let queryparams = queryform.value
|
||||||
if (queryparams.backTime && queryparams.backTime[0] != '') {
|
if (queryparams.backTime && queryparams.backTime[0] != '') {
|
||||||
queryparams.startTime = dataFormat(queryparams.backTime[0], 'yyyy-MM-dd HH:mm:ss');
|
queryparams.startTime = dataFormat(queryparams.backTime[0], 'yyyy-MM-dd HH:mm:ss')
|
||||||
}
|
}
|
||||||
if (queryparams.backTime && queryparams.backTime[1]!= '') {
|
if (queryparams.backTime && queryparams.backTime[1] != '') {
|
||||||
queryparams.endTime = dataFormat(queryparams.backTime[1], 'yyyy-MM-dd HH:mm:ss');
|
queryparams.endTime = dataFormat(queryparams.backTime[1], 'yyyy-MM-dd HH:mm:ss')
|
||||||
}
|
}
|
||||||
delete queryparams.backTime;
|
delete queryparams.backTime
|
||||||
//获取默认区域
|
//获取默认区域
|
||||||
const userdefultoperation = getCache('ebike-userdefultoperation');
|
const userdefultoperation = getCache('ebike-userdefultoperation')
|
||||||
queryparams.regionId = userdefultoperation.regionId;
|
queryparams.regionId = userdefultoperation?.regionId
|
||||||
const res = await callOrder("/ebikeUserBacksite/page", queryparams);
|
const res = await callOrder('/ebikeUserBacksite/page', queryparams)
|
||||||
spinning.value = false;
|
spinning.value = false
|
||||||
if (res.code != 200) {
|
if (res.code != 200) {
|
||||||
message.error(res.message)
|
message.error(res.message)
|
||||||
dataSource.value = []
|
dataSource.value = []
|
||||||
@ -228,53 +233,53 @@ import { getCache } from '@/utils/authority';
|
|||||||
})
|
})
|
||||||
dataSource.value = data.value
|
dataSource.value = data.value
|
||||||
pagination.total = res.data.totalRow
|
pagination.total = res.data.totalRow
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对每页数据显示的交互
|
// 对每页数据显示的交互
|
||||||
let handleTableChange = (pagina) => {
|
let handleTableChange = (pagina) => {
|
||||||
pagination.current = pagina.current
|
pagination.current = pagina.current
|
||||||
pagination.pageSize = pagina.pageSize
|
pagination.pageSize = pagina.pageSize
|
||||||
queryform.value.pageParam.pageNum = pagina.current
|
queryform.value.pageParam.pageNum = pagina.current
|
||||||
queryform.value.pageParam.pageSize = pagina.pageSize
|
queryform.value.pageParam.pageSize = pagina.pageSize
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = () => {
|
const search = () => {
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onTabChange = (key) => {
|
const onTabChange = (key) => {
|
||||||
activeKey.value = key;
|
activeKey.value = key
|
||||||
queryform.value.state = key;
|
queryform.value.state = key
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDeal = async (record) => {
|
const handleDeal = async (record) => {
|
||||||
open.value = true;
|
open.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (formModel.value) {
|
if (formModel.value) {
|
||||||
formModel.value.openForm({ ...record });
|
formModel.value.openForm({ ...record })
|
||||||
} else {
|
} else {
|
||||||
console.log('formModel is not ready yet');
|
console.log('formModel is not ready yet')
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理停车点申请modal确定
|
* 处理停车点申请modal确定
|
||||||
*/
|
*/
|
||||||
const handleOkModal = () => {
|
const handleOkModal = () => {
|
||||||
formModel.value.formSave(bres => {
|
formModel.value.formSave((bres) => {
|
||||||
open.value = false;
|
open.value = false
|
||||||
if(bres){
|
if (bres) {
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCancelModal = () => {
|
const handleCancelModal = () => {
|
||||||
formModel.value.resetAll(bres => {
|
formModel.value.resetAll((bres) => {
|
||||||
if(bres) open.value = false;
|
if (bres) open.value = false
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user