fix:修改页面bug

This commit is contained in:
5g0Wp7Zy 2025-07-02 09:20:52 +08:00
parent e71013676d
commit 325fc0e926

View File

@ -1,5 +1,5 @@
<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="0" tab="待处理" force-render></a-tab-pane>
<a-tab-pane key="1" tab="处理中"></a-tab-pane>
@ -12,7 +12,10 @@
<a-row :gutter="8">
<a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
<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-col>
<a-col :xl="6" :lg="12" :md="12" :sm="24" :xs="24">
@ -28,10 +31,7 @@
</a-row>
</a-form>
<!-- 表格 -->
<a-spin
:spinning="spinning"
:tip="tipContent"
>
<a-spin :spinning="spinning" :tip="tipContent">
<a-table
:pagination="pagination"
@change="handleTableChange"
@ -46,7 +46,15 @@
</template>
<template #bodyCell="{ column, record }">
<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 v-if="column.key === 'action'">
<a-space v-if="record.dealState == '0'">
@ -71,54 +79,51 @@
>
<BackSiteForm ref="formModel"></BackSiteForm>
</a-modal>
</template>
<script setup>
import { ref, reactive, onMounted, nextTick } from 'vue';
import { callOrder } from '@/apis/call.js'
import { message } from 'ant-design-vue'
import config from '@/utils/config.js'
import { dataFormat } from '@/utils/tools'
import { getCache } from '@/utils/authority';
import BackSiteForm from '@/views/form/backsite/BackSiteForm.vue'
const activeKey = ref('');
</template>
<script setup>
import { ref, reactive, onMounted, nextTick } from 'vue'
import { callOrder } from '@/apis/call.js'
import { message } from 'ant-design-vue'
import config from '@/utils/config.js'
import { dataFormat } from '@/utils/tools'
import { getCache } from '@/utils/authority'
import BackSiteForm from '@/views/form/backsite/BackSiteForm.vue'
const activeKey = ref('')
const open = ref(false);
const openTitle = ref('处理停车点申请');
const formModel = ref(null);
const open = ref(false)
const openTitle = ref('处理停车点申请')
const formModel = ref(null)
const spinning = ref(false);
const tipContent = ref("加载中...");
//
const dataSource = ref([]);
const data = ref([])
//
const queryform = ref({
const spinning = ref(false)
const tipContent = ref('加载中...')
//
const dataSource = ref([])
const data = ref([])
//
const queryform = ref({
regionId: '',
state: '',
startTime: '',
endTime: '',
backTime: [
'',
''
],
backTime: ['', ''],
pageParam: {
pageNum: config.pageParam.pageNum,
pageSize: config.pageParam.pageSize
}
})
})
//
let pagination = reactive({
//
let pagination = reactive({
total: dataSource.value.length,
current: queryform.value.pageParam.pageNum,
pageSize: queryform.value.pageParam.pageSize,
showSizeChanger: true,
pageSizeOptions: config.pageParam.pageSizeOptions,
showQuickJumper: true
})
})
//
const columns = ref([
//
const columns = ref([
{
title: '序号',
key: 'index',
@ -192,28 +197,28 @@ import { getCache } from '@/utils/authority';
width: 320,
align: 'center'
}
])
])
//
onMounted(async () => {
getData();
})
//
onMounted(async () => {
getData()
})
const getData = async () => {
spinning.value = true;
let queryparams = queryform.value;
const getData = async () => {
spinning.value = true
let queryparams = queryform.value
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]!= '') {
queryparams.endTime = dataFormat(queryparams.backTime[1], 'yyyy-MM-dd HH:mm:ss');
if (queryparams.backTime && queryparams.backTime[1] != '') {
queryparams.endTime = dataFormat(queryparams.backTime[1], 'yyyy-MM-dd HH:mm:ss')
}
delete queryparams.backTime;
delete queryparams.backTime
//
const userdefultoperation = getCache('ebike-userdefultoperation');
queryparams.regionId = userdefultoperation.regionId;
const res = await callOrder("/ebikeUserBacksite/page", queryparams);
spinning.value = false;
const userdefultoperation = getCache('ebike-userdefultoperation')
queryparams.regionId = userdefultoperation?.regionId
const res = await callOrder('/ebikeUserBacksite/page', queryparams)
spinning.value = false
if (res.code != 200) {
message.error(res.message)
dataSource.value = []
@ -228,53 +233,53 @@ import { getCache } from '@/utils/authority';
})
dataSource.value = data.value
pagination.total = res.data.totalRow
}
}
//
let handleTableChange = (pagina) => {
//
let handleTableChange = (pagina) => {
pagination.current = pagina.current
pagination.pageSize = pagina.pageSize
queryform.value.pageParam.pageNum = pagina.current
queryform.value.pageParam.pageSize = pagina.pageSize
getData()
}
}
const search = () => {
const search = () => {
getData()
}
}
const onTabChange = (key) => {
activeKey.value = key;
queryform.value.state = key;
const onTabChange = (key) => {
activeKey.value = key
queryform.value.state = key
getData()
}
}
const handleDeal = async (record) => {
open.value = true;
const handleDeal = async (record) => {
open.value = true
nextTick(() => {
if (formModel.value) {
formModel.value.openForm({ ...record });
formModel.value.openForm({ ...record })
} else {
console.log('formModel is not ready yet');
}
});
console.log('formModel is not ready yet')
}
})
}
/**
/**
* 处理停车点申请modal确定
*/
const handleOkModal = () => {
formModel.value.formSave(bres => {
open.value = false;
if(bres){
const handleOkModal = () => {
formModel.value.formSave((bres) => {
open.value = false
if (bres) {
getData()
}
});
}
})
}
const handleCancelModal = () => {
formModel.value.resetAll(bres => {
if(bres) open.value = false;
});
}
</script>
const handleCancelModal = () => {
formModel.value.resetAll((bres) => {
if (bres) open.value = false
})
}
</script>