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

修改bug

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