commit
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -133,7 +133,8 @@
|
||||
删除{{ currentGroupName }}
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize" @sort-change="pageOrder">
|
||||
<el-table ref="userTable" v-loading="tableLoading" element-loading-text="正在查询,请稍候..."
|
||||
:data="tableData" stripe border :size="tableSize" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" type="index" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }}</span>
|
||||
@@ -334,12 +335,19 @@ module.exports = {
|
||||
const {data} = await $.post("/platform/activity/basic/scope/getRolesAndUnion")
|
||||
this.roleData = data
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await $.post("/platform/activity/basic/user/pageData", this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
pageData() {
|
||||
// 分页查询期间展示加载状态,避免慢查询时用户误以为页面无响应。
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/basic/user/pageData", this.pageForm)
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
})
|
||||
.always(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
|
||||
@@ -360,13 +360,15 @@
|
||||
v-for="item in sameTypeGroupList"
|
||||
:key="item.groupId"
|
||||
:label="item.groupId"
|
||||
:disabled="!isSelectedActivityGroup(item)"
|
||||
border
|
||||
class="existing-group-radio"
|
||||
>
|
||||
{{ formatGroupDisplayName(item) }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<div v-if="sameTypeGroupList.length === 0" class="form-tip">当前还没有同类型分组,请先创建新分组。</div>
|
||||
<div v-if="!selectedActivityGroup" class="form-tip">请先在筛选条件中选择活动组别。</div>
|
||||
<div v-else class="form-tip">仅允许添加至当前选择的活动组别:{{ formatGroupDisplayName(selectedActivityGroup) }}</div>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
@@ -499,6 +501,9 @@ module.exports = {
|
||||
unionid() {
|
||||
return this.roleData.unionid
|
||||
},
|
||||
selectedActivityGroup() {
|
||||
return this.activityGroupList.find((item) => Number(item.groupId) === Number(this.pageForm.activityGroupId))
|
||||
},
|
||||
sameTypeGroupList() {
|
||||
return this.activityGroupList.filter((item) => Number(item.groupType) === Number(this.formData.groupType))
|
||||
}
|
||||
@@ -549,7 +554,11 @@ module.exports = {
|
||||
handleSetGroupModeChange() {
|
||||
if (this.formData.setGroupType === 1) {
|
||||
this.formData.setGroupName = ""
|
||||
if (!this.sameTypeGroupList.some((item) => item.groupId === this.formData.setGroupId)) {
|
||||
if (this.selectedActivityGroup) {
|
||||
// 原有分组只能使用当前筛选的活动组别,保存方式需与该分组类型一致。
|
||||
this.formData.groupType = Number(this.selectedActivityGroup.groupType)
|
||||
this.formData.setGroupId = this.selectedActivityGroup.groupId
|
||||
} else {
|
||||
this.formData.setGroupId = null
|
||||
}
|
||||
return
|
||||
@@ -557,10 +566,18 @@ module.exports = {
|
||||
this.formData.setGroupId = null
|
||||
},
|
||||
handleGroupTypeChange() {
|
||||
if (this.formData.setGroupType === 1 && this.selectedActivityGroup) {
|
||||
this.formData.groupType = Number(this.selectedActivityGroup.groupType)
|
||||
this.formData.setGroupId = this.selectedActivityGroup.groupId
|
||||
return
|
||||
}
|
||||
if (!this.sameTypeGroupList.some((item) => item.groupId === this.formData.setGroupId)) {
|
||||
this.formData.setGroupId = null
|
||||
}
|
||||
},
|
||||
isSelectedActivityGroup(group) {
|
||||
return this.selectedActivityGroup && Number(group.groupId) === Number(this.selectedActivityGroup.groupId)
|
||||
},
|
||||
handleActivityGroupChange(val) {
|
||||
this.pageForm.memberTypes = val ? [] : ["工会会员"]
|
||||
this.doSearch()
|
||||
|
||||
@@ -207,7 +207,8 @@
|
||||
|
||||
<el-table-column v-if="!is_view" label="操作" width="100px">
|
||||
<template v-slot="{row,$index}">
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
|
||||
<!-- 新建行没有 id 时允许删除;已保存行仍按 canDelete 控制删除权限。 -->
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
|
||||
@click="nr.bzs.splice($index,1)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user