commit
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in activityGroupList"
|
||||
:label="item.groupName"
|
||||
:label="formatGroupDisplayName(item)"
|
||||
:value="item.groupId"
|
||||
:key="item.groupId"
|
||||
></el-option>
|
||||
@@ -257,11 +257,19 @@ module.exports = {
|
||||
clearImportDialog() {
|
||||
this.importDialogVisible = false
|
||||
},
|
||||
formatGroupDisplayName(group) {
|
||||
if (Number(group.groupType) === 2) {
|
||||
return group.groupName + "(SQL条件)"
|
||||
}
|
||||
return group.groupName + "(人员结果)"
|
||||
},
|
||||
viewGroupName() {
|
||||
if (this.pageForm?.groupId) {
|
||||
if (this.pageForm.groupId) {
|
||||
const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
|
||||
this.currentGroupName = group.groupName + "人员"
|
||||
return
|
||||
if (group) {
|
||||
this.currentGroupName = this.formatGroupDisplayName(group) + "人员"
|
||||
return
|
||||
}
|
||||
}
|
||||
this.currentGroupName = "全部人员"
|
||||
},
|
||||
@@ -288,6 +296,7 @@ module.exports = {
|
||||
this.$emit("group_change")
|
||||
} else {
|
||||
}
|
||||
return
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
@@ -301,17 +310,19 @@ module.exports = {
|
||||
},
|
||||
async getActivityGroup(id) {
|
||||
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
||||
this.activityGroupList = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.activityGroupList = resp.data || []
|
||||
if (this.activityGroupList.length > 0) {
|
||||
if (id) {
|
||||
if (this.activityGroupList.some((v) => v.groupId === id)) {
|
||||
this.$set(this.pageForm, "groupId", id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
|
||||
this.$set(this.pageForm, "groupId", this.activityGroupList[0].groupId)
|
||||
}
|
||||
} else {
|
||||
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
|
||||
this.$set(this.pageForm, "groupId", this.activityGroupList[0].groupId)
|
||||
}
|
||||
} else {
|
||||
this.$set(this.pageForm, "groupId", null)
|
||||
}
|
||||
await this.doSearch()
|
||||
},
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
导入XLSX设置分组
|
||||
</el-button>
|
||||
<el-button @click="doExportUser" size="medium" type="primary" icon="el-icon-download">导出查询人员</el-button>
|
||||
<el-button @click="setDialogVisible = true" size="medium" type="primary">设置为活动人员</el-button>
|
||||
<el-button @click="openSetDialog" size="medium" type="primary">设置为活动人员</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" border ref="userTable" stripe>
|
||||
<el-table-column label="序号" type="index" width="80">
|
||||
@@ -336,25 +336,32 @@
|
||||
:close-on-click-modal="false">
|
||||
<el-form :model="formData" :rules="rules" label-width="100px" ref="setForm">
|
||||
<el-form-item label="添加方式" prop="setGroupType">
|
||||
<el-radio-group size="small" v-model="formData.setGroupType">
|
||||
<el-radio-group size="small" v-model="formData.setGroupType" @change="handleSetGroupModeChange">
|
||||
<el-radio :label="1">添加至原有分组</el-radio>
|
||||
<el-radio :label="2">添加到新分组</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="保存方式" prop="groupType">
|
||||
<el-radio-group size="small" v-model="formData.groupType" @change="handleGroupTypeChange">
|
||||
<el-radio :label="1">保存人员结果</el-radio>
|
||||
<el-radio :label="2">保存SQL条件</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-row v-if="formData.setGroupType === 1">
|
||||
<el-form-item label="原有分组" prop="setGroupId">
|
||||
<el-radio-group size="small" v-model="formData.setGroupId">
|
||||
<el-radio
|
||||
:disabled="item.groupId != pageForm.activityGroupId"
|
||||
:label="item.groupId"
|
||||
:key="item.groupId"
|
||||
border
|
||||
v-for="item in activityGroupList"
|
||||
v-for="item in sameTypeGroupList"
|
||||
>
|
||||
{{ item.groupName }}
|
||||
{{ formatGroupDisplayName(item) }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="form-tip" v-if="sameTypeGroupList.length === 0">当前还没有同类型分组,请先创建新分组。</div>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-if="formData.setGroupType === 2">
|
||||
@@ -391,9 +398,12 @@ module.exports = {
|
||||
clubOptions: [],
|
||||
settingLoading: false,
|
||||
setDialogVisible: false,
|
||||
setGroupType: null,
|
||||
setGroupId: null,
|
||||
setGroupName: null,
|
||||
formData: {
|
||||
setGroupType: 2,
|
||||
setGroupId: null,
|
||||
setGroupName: "",
|
||||
groupType: 1
|
||||
},
|
||||
personTypeOptions: [],
|
||||
userStateOptions: [],
|
||||
activityGroupList: [],
|
||||
@@ -460,6 +470,7 @@ module.exports = {
|
||||
],
|
||||
rules: {
|
||||
setGroupType: [{required: true, message: "请选择添加方式", trigger: ["blur", "change"]}],
|
||||
groupType: [{required: true, message: "请选择保存方式", trigger: ["blur", "change"]}],
|
||||
setGroupId: [{required: true, message: "请选择分组", trigger: ["blur", "change"]}],
|
||||
setGroupName: [{required: true, message: "请输入分组名称", trigger: ["blur", "change"]}]
|
||||
},
|
||||
@@ -487,6 +498,9 @@ module.exports = {
|
||||
},
|
||||
unionid() {
|
||||
return this.roleData.unionid
|
||||
},
|
||||
sameTypeGroupList() {
|
||||
return this.activityGroupList.filter((item) => Number(item.groupType) === Number(this.formData.groupType))
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -494,6 +508,44 @@ module.exports = {
|
||||
"activity-import-user": httpVueLoader("/components/module/activity/ActivityImportUser.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
getDefaultFormData() {
|
||||
return {
|
||||
setGroupType: 2,
|
||||
setGroupId: null,
|
||||
setGroupName: "",
|
||||
groupType: 1
|
||||
}
|
||||
},
|
||||
openSetDialog() {
|
||||
this.formData = this.getDefaultFormData()
|
||||
this.setDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.setForm) {
|
||||
this.$refs.setForm.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSetGroupModeChange() {
|
||||
if (this.formData.setGroupType === 1) {
|
||||
this.formData.setGroupName = ""
|
||||
if (!this.sameTypeGroupList.some((item) => item.groupId === this.formData.setGroupId)) {
|
||||
this.formData.setGroupId = null
|
||||
}
|
||||
return
|
||||
}
|
||||
this.formData.setGroupId = null
|
||||
},
|
||||
handleGroupTypeChange() {
|
||||
if (!this.sameTypeGroupList.some((item) => item.groupId === this.formData.setGroupId)) {
|
||||
this.formData.setGroupId = null
|
||||
}
|
||||
},
|
||||
formatGroupDisplayName(group) {
|
||||
if (Number(group.groupType) === 2) {
|
||||
return group.groupName + "(SQL条件)"
|
||||
}
|
||||
return group.groupName + "(人员结果)"
|
||||
},
|
||||
listSession() {
|
||||
this.$axios.post("/platform/teacherCongress/common/listSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
@@ -595,7 +647,7 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.tableData.length === 0) {
|
||||
if (this.formData.groupType !== 2 && this.tableData.length === 0) {
|
||||
this.$message.warning("请先指定筛选条件!")
|
||||
return
|
||||
}
|
||||
@@ -625,11 +677,7 @@ module.exports = {
|
||||
await this.getActivityGroup()
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
this.formData = {
|
||||
setGroupType: null,
|
||||
setGroupId: null,
|
||||
setGroupName: null
|
||||
}
|
||||
this.formData = this.getDefaultFormData()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
@@ -640,12 +688,12 @@ module.exports = {
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
||||
this.activityGroupList = resp.data
|
||||
this.activityGroupList = resp.data || []
|
||||
this.activityGroupList2 = []
|
||||
resp.data.forEach((v) => {
|
||||
this.activityGroupList.forEach((v) => {
|
||||
this.activityGroupList2.push({
|
||||
groupId: v.groupId,
|
||||
groupName: v.groupName + "范围之外人员"
|
||||
groupName: this.formatGroupDisplayName(v) + "范围之外人员"
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -748,4 +796,11 @@ module.exports = {
|
||||
.reverseCheckBox {
|
||||
margin: 0 10px 0 0 !important;
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -144,10 +144,20 @@ layout("/layouts/platform.html"){
|
||||
this.onView(row)
|
||||
return
|
||||
}
|
||||
this.infoVisible = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.courseListRef.onOpen(row)
|
||||
// 先校验年度同活动类型报名次数,避免进入课程页后才提示不可报名。
|
||||
this.$axios.post("/platform/trainSignUp/apply/validateYearTrainTypeSignUp", {activityId: row.id}).then((res) => {
|
||||
if (res.code !== 0) {
|
||||
this.$alert(res.msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
type: "warning"
|
||||
})
|
||||
return
|
||||
}
|
||||
this.infoVisible = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.courseListRef.onOpen(row)
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -24,6 +24,10 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="申请列表">
|
||||
<el-button type="primary" plain size="small" @click="openAnnualLimit">
|
||||
<i class="ti-settings"></i>
|
||||
年度次数配置
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新增类型
|
||||
@@ -75,6 +79,9 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
openAnnualLimit() {
|
||||
window.location.href = '/platform/trainSignUp/annualLimit'
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.initData()
|
||||
|
||||
@@ -131,7 +131,18 @@ layout("/layouts/platform_h5.html"){
|
||||
this.onView(row)
|
||||
return
|
||||
}
|
||||
this.$pjaxReplace('/platform/trainSignUp/apply/list/h5?id=' + row.id)
|
||||
// 先校验年度同活动类型报名次数,避免进入课程页后才提示不可报名。
|
||||
this.$axios.post('/platform/trainSignUp/apply/validateYearTrainTypeSignUp', {activityId: row.id}).then((res) => {
|
||||
if (res.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$pjaxReplace('/platform/trainSignUp/apply/list/h5?id=' + row.id)
|
||||
})
|
||||
},
|
||||
fetchOne() {
|
||||
this.$axios.post('/platform/trainSignUp/manage/findOne', {id: this.id}).then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user