Commit f9d43c5e authored by 罗林杰's avatar 罗林杰

修改bug

parent 6151a097
......@@ -203,9 +203,9 @@
/>
</el-select>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-form-item label="姓名:" prop="memNickName">
<el-input
v-model.trim="queryParams1.name"
v-model.trim="queryParams1.memNickName"
placeholder="请输入姓名"
clearable
:maxlength="500"
......@@ -231,52 +231,24 @@
>{{ commonField.resetName }}</el-button>
</el-form-item>
</el-form>
<div v-if="queryParams1.status ==='1'" class="app-container1">
<div class="app-container">
<el-table :data="gridData" height="300px">
<el-table-column align="center" prop="id" label="序号" min-width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column property="name" label="姓名" min-width="120" :header-cell-style="{ display: 'none' }" />
<el-table-column property="createDate" label="报名日期" min-width="150" />
<el-table-column property="phone" label="联系方式" min-width="220" />
<el-table-column property="applicationFee" label="缴费" min-width="120">
<el-table-column property="memNickName" label="姓名" min-width="120" />
<el-table-column property="createDate" label="报名日期" min-width="150">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="100">
<template slot-scope="scope">
<el-button
v-has-permi="hasDetailPerm"
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleViewGridData(scope.row)"
>查看</el-button>
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total1>0"
:key="pageKey"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
@pagination="loadData1"
/>
</div>
<div v-if="queryParams1.status ==='2'" class="app-container1">
<el-table :data="gridData1" height="300px">
<el-table-column align="center" prop="id" label="序号" min-width="55px">
<el-table-column property="phone" label="联系方式" min-width="220">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
<span>{{ scope.row.phone ? scope.row.phone : '*******' }}</span>
</template>
</el-table-column>
<el-table-column property="name" label="姓名" min-width="120" />
<el-table-column property="createDate" label="报名日期" min-width="150" />
<el-table-column property="phone" label="联系方式" min-width="220" />
<el-table-column property="applicationFee" label="缴费" min-width="120">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
......@@ -295,9 +267,9 @@
</el-table-column>
</el-table>
<pagination
v-show="total2>0"
v-show="total1>0"
:key="pageKey"
:total="total2"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
@pagination="loadData1"
......@@ -318,6 +290,7 @@ import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsApplication } from '@/api/contentManagement/application'
import { yesOrNo } from '@/utils/allPageData'
import { getOssUrl } from '@/api/contentManagement/opmArticle'
import { getPrivateInfo } from '@/api/contentManagement/memInfo'
export default {
name: 'Index',
// components: {
......@@ -357,7 +330,6 @@ export default {
gridAllData: [],
// 报名人数
gridData: [],
gridData1: [],
lineindex: 0,
teacode: '',
......@@ -421,13 +393,13 @@ export default {
queryParams1: {
page: 1,
rows: 10,
flag: '',
status: '1'
status: '1',
activityId: '',
memNickName: ''
},
// pagination
total: 0,
total1: 0,
total2: 0,
actionUrl: '',
filelist: [],
bussid: [],
......@@ -519,51 +491,23 @@ export default {
}
},
loadData1() {
const _this = this
_this.fullscreenLoading = true
// 过滤 gridData
const filteredGridData = this.gridData.filter(item => {
return (
(!this.queryParams1.status || item.status === this.queryParams1.status) &&
(!this.queryParams1.name || item.name.includes(this.queryParams1.name))
)
listCmsApplication(this.queryParams1).then(response => {
this.gridData = response.data
this.total1 = response.total
})
// 过滤 gridData1
const filteredGridData1 = this.gridData1.filter(item => {
return (
(!this.queryParams1.status || item.status === this.queryParams1.status) &&
(!this.queryParams1.name || item.name.includes(this.queryParams1.name))
)
})
// 更新过滤后的数据
this.gridData = filteredGridData
this.gridData1 = filteredGridData1
// 更新分页总数
this.total1 = this.gridData.length
this.total2 = this.gridData1.length
_this.fullscreenLoading = false
},
resetQuery1() {
this.queryParams1 = {
page: 1,
rows: 10,
status: '1'
}
// 重置表单
this.$refs.queryForm.resetFields()
// 恢复原始数据
this.gridData = [...this.originalGridData] // 记得在加载数据时保存原始数据
this.gridData1 = [...this.originalGridData1] // 记得在加载数据时保存原始数据
// 更新分页总数
this.total1 = this.gridData.length
this.total2 = this.gridData1.length
this.queryParams1.page = 1
this.queryParams1.rows = 10
this.queryParams1.status = '1'
this.queryParams1.memNickName = ''
this.loadData1()
},
handleViewGridData(row) {
getPrivateInfo(row.memberId).then(res => {
row.phone = res.data.memPhone
})
},
/** 查询活动管理列表 */
loadData() {
this.loading = true
......@@ -589,44 +533,9 @@ export default {
status: '1'
}
this.title = '报名人数'
const activityId = row.businessId
const applicationCount = row.applicationCount || 0
this.queryParams1.activityId = row.businessId
// 调用后端接口查询与该活动对应的子表数据
this.fetchSubTableData(activityId)
// 显示报名人数
this.applicationCount = applicationCount
},
/** 查询子表数据 */
fetchSubTableData(activityId) {
// 将 activityId 传递给后端,查询子表数据
listCmsApplication({ activityId: activityId })
.then(response => {
const data = response.data || []
// 清空原始数据(如果有需要的话)
this.gridData = []
this.gridData1 = []
// 保存原始数据
this.originalGridData = []
this.originalGridData1 = []
// 根据 status 将数据分类
data.forEach(item => {
if (item.status === '1' && item.activityId === activityId) {
this.gridData.push(item)
this.originalGridData.push(item) // 保存原始数据
this.total1 = this.gridData.length
} else if (item.status === '2' && item.activityId === activityId) {
this.gridData1.push(item)
this.originalGridData1.push(item) // 保存原始数据
this.total2 = this.gridData1.length
}
})
})
.catch(error => {
console.error('获取子表数据失败:', error)
})
},
handleViewGridData() {
this.loadData1()
},
// 修改状态
handleStatusChange(row) {
......@@ -741,14 +650,5 @@ export default {
height: 45px;
}
}
app-container1{
font-size: 18px;
padding: 0;
::v-deep .el-table td:nth-child(2) .cell {
margin: 10px;
height: 25px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment