活动
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ public class ActivityUnionApplyUserController {
|
||||
cnd.andEx("tissue.type", "=", type);
|
||||
cnd.andEx("tissue.state", "=", 3);
|
||||
cnd.andEx("tissue.projectTypeCode", "!=", 50004);
|
||||
cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2));
|
||||
cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2, 3));
|
||||
|
||||
if (Strings.isNotBlank(name)) {
|
||||
cnd.where().andLike("tissue.name", name);
|
||||
|
||||
+43
-3
@@ -3,6 +3,7 @@ package io.v.nutz.zhgh.activity.controller.union;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
@@ -36,6 +37,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -143,6 +145,41 @@ public class ActivityUnionManageController {
|
||||
return sysUserService.listPageMap(1, 30, sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
|
||||
public Object doSave(@Param(value = "tissue") ActivityTissue tissue){
|
||||
tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
|
||||
tissue.setState(0);
|
||||
|
||||
if (tissue.getType() == 40002) {
|
||||
tissue.setUnionId(Vi.getUnionId());
|
||||
} else if (tissue.getType() == 40003) {
|
||||
tissue.setClubId(vi.getClubId());
|
||||
}
|
||||
// 如果有商品,则设置商品活动编码和活动id
|
||||
if (Lang.isNotEmpty(tissue.getGoods())) {
|
||||
tissue.getGoods().forEach(v -> {
|
||||
v.setActivityCode(tissue.getActivityCode());
|
||||
v.setReid(tissue.getId());
|
||||
});
|
||||
}
|
||||
|
||||
activityTissueService.insertWith(tissue, "tissuePersonList");
|
||||
activitySchoolService.dao().insert(tissue.getGoods());
|
||||
|
||||
if (tissue.getIsEnrollSystem()) {
|
||||
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
|
||||
activitySchoolService.dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校工会添加
|
||||
*
|
||||
@@ -154,12 +191,14 @@ public class ActivityUnionManageController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
|
||||
public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) {
|
||||
tissue.setUserId(ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(DateUtil.getDate());
|
||||
tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
tissue.setState(1);
|
||||
} else {
|
||||
tissue.setState(3);
|
||||
tissue.setIsDisabled(true);
|
||||
tissue.setIsEnrollSystem(true);
|
||||
}
|
||||
if (tissue.getType() == 40002) {
|
||||
tissue.setUnionId(Vi.getUnionId());
|
||||
@@ -170,13 +209,14 @@ public class ActivityUnionManageController {
|
||||
v.setActivityCode(tissue.getActivityCode());
|
||||
v.setReid(tissue.getId());
|
||||
});
|
||||
tissue.getCover();
|
||||
// tissue.getCover();
|
||||
|
||||
activityTissueService.insertWith(tissue, "tissuePersonList");
|
||||
activitySchoolService.dao().insert(tissue.getGoods());
|
||||
|
||||
if (tissue.getIsEnrollSystem()) {
|
||||
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
|
||||
sysHomeActivity.setEnable(true);
|
||||
activitySchoolService.dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -67,8 +68,12 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEx("YEAR(tissue.startTime)", "=", year);
|
||||
cnd.andEx("tissue.projectTypeCode", "!=", "50004");
|
||||
cnd.andEx("YEAR(tissue.applyTime)", "=", year);
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("tissue.projectTypeCode", "!=", "50004");
|
||||
seg.or("tissue.projectTypeCode", "is", null);
|
||||
cnd.and(seg);
|
||||
// cnd.andEx("tissue.projectTypeCode", "!=", "50004");
|
||||
cnd.andEx("tissue.unionId", "=", unionId);
|
||||
cnd.andEx("tissue.type", "=", type);
|
||||
|
||||
|
||||
+11
-7
@@ -240,9 +240,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
sysRoleService.clearCache();
|
||||
|
||||
// 如果有单位异动,发送消息提醒分工会
|
||||
// if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
|
||||
// sendUnitChangeTeacher(middleTable, history);
|
||||
// }
|
||||
if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
|
||||
sendUnitChangeTeacher(middleTable, history);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
@Override
|
||||
public void sendUnitChangeTeacher(SourceChangeMiddleTable middleTable, UserHistory history) {
|
||||
// 查询出异动前的工会
|
||||
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
|
||||
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
|
||||
.setParam("unitId", history.getUnitid());
|
||||
beforeUnionSql.setCallback(Sqls.callback.map());
|
||||
dao().execute(beforeUnionSql);
|
||||
@@ -275,7 +275,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
|
||||
|
||||
// 查询出异动后的工会
|
||||
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
|
||||
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
|
||||
.setParam("unitId", middleTable.getUnitid());
|
||||
afterUnionSql.setCallback(Sqls.callback.map());
|
||||
dao().execute(afterUnionSql);
|
||||
@@ -301,7 +301,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
for (NutMap map : beforeMapList) {
|
||||
String beforeContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从您处调整至%s。特此告知,烦请知悉。祝您生活愉快!"
|
||||
.formatted(map.getString("username"), middleTable.getUsername(), afterUnionMap.getString("unionname"));
|
||||
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
|
||||
|
||||
System.out.println(beforeContent);
|
||||
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +327,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
for (NutMap map : afterMapList) {
|
||||
String afterContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从%s调整至您处。特此告知,烦请知悉。祝您生活愉快!"
|
||||
.formatted(map.getString("username"), middleTable.getUsername(), beforeUnionMap.getString("unionname"));
|
||||
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
|
||||
|
||||
System.out.println(afterContent);
|
||||
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,10 +171,10 @@
|
||||
|
||||
<el-col :lg="12" :xl="12" :xs="24">
|
||||
<el-form-item label="活动人数" prop="peopleNum">
|
||||
<el-input :disabled="[1,2].includes(formData.signUpMethod)"
|
||||
maxlength="10"
|
||||
placeholder="请填写活动人数"
|
||||
v-model="formData.peopleNum"></el-input>
|
||||
<el-input-number :disabled="[1,2].includes(formData.signUpMethod)"
|
||||
maxlength="10" style="width: 100%"
|
||||
placeholder="请填写活动人数"
|
||||
v-model="formData.peopleNum"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -246,6 +246,7 @@
|
||||
<el-form-item label="组队人数" prop="totalUserNumberLimit">
|
||||
<el-input-number :max="2000" :min="1"
|
||||
:precision="0"
|
||||
style="width: 100%"
|
||||
v-model="formData.teamNum"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
@@ -254,7 +255,7 @@
|
||||
<el-col :lg="12" :xl="12" :xs="12"
|
||||
v-if="[1,2,3].includes(formData.signUpMethod) && formData.userNumberLimit===1">
|
||||
<el-form-item label="总人数限制" prop="totalUserNumberLimit">
|
||||
<el-input-number :max="2000"
|
||||
<el-input-number :max="2000" style="width: 100%"
|
||||
:min="1" :precision="0"
|
||||
v-model="formData.totalUserNumberLimit"
|
||||
></el-input-number>
|
||||
@@ -392,6 +393,7 @@
|
||||
<el-form-item label="签到半径(m)">
|
||||
<el-input-number :max="1000"
|
||||
:min="50"
|
||||
style="width: 100%"
|
||||
:precision="0" :step="1"
|
||||
@change="rangeMeterChange"
|
||||
v-model="formData.rangeMeter"></el-input-number>
|
||||
@@ -411,16 +413,24 @@
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动内容" prop="activityContent">
|
||||
<el-input
|
||||
:rows="7"
|
||||
placeholder="请输入活动内容"
|
||||
type="textarea"
|
||||
v-model="formData.activityContent">
|
||||
</el-input>
|
||||
<el-form-item label="活动介绍" prop="activityContent" :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}">
|
||||
<text-editor v-model="formData.activityContent" ref="contentEditor"></text-editor>
|
||||
<!-- <el-input-->
|
||||
<!-- :rows="7"-->
|
||||
<!-- placeholder="请输入活动内容"-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- v-model="formData.activityContent">-->
|
||||
<!-- </el-input>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件上传" prop="otherFiles">
|
||||
<file-upload :files.sync="formData.otherFiles" card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24" v-if="formData.isEnrollSystem === false">
|
||||
<el-form-item label="活动考核内容" prop="activityExamineContent">
|
||||
<el-input
|
||||
@@ -513,7 +523,6 @@
|
||||
style="color: #3ea1ec;">附件</span>
|
||||
</el-divider>
|
||||
<el-row :gutter="40">
|
||||
|
||||
<el-col :lg="12" :xl="12" :xs="24" class="mb25">
|
||||
<el-form-item label="发票" prop="billFiles">
|
||||
<file-upload :files.sync="formData.billFiles"
|
||||
@@ -526,18 +535,7 @@
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :lg="12" :xl="12" :xs="24">
|
||||
<el-form-item label="其他" prop="otherFiles">
|
||||
<file-upload :files.sync="formData.otherFiles"
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="活动人员信息" name="3" v-if="formData.isEnrollSystem === false">
|
||||
@@ -599,8 +597,10 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<div style="padding: 20px;text-align: center;">
|
||||
<el-button @click="operation" style="width: 300px" type="primary">确 定</el-button>
|
||||
<div style="padding: 20px;text-align: right;">
|
||||
<el-button v-if="formData.id" @click="doBack" style="width: 120px">返 回</el-button>
|
||||
<el-button @click="doSave" style="width: 120px" type="primary">保 存</el-button>
|
||||
<el-button @click="operation" style="width: 120px" type="primary">提 交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -699,6 +699,21 @@
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
methods: {
|
||||
doBack() {
|
||||
this.$confirm('返回将不会保存新填写或修改的内容,确定要返回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
if (type === 40002) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/union")
|
||||
} else if (type === 40003) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/club")
|
||||
} else {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/school")
|
||||
}
|
||||
})
|
||||
},
|
||||
//应用比例设置
|
||||
applyScaleSettings() {
|
||||
this.formData.unionUserNumberLimit.forEach(v => {
|
||||
@@ -839,47 +854,56 @@
|
||||
const resp = await $.get('/platform/activity/apply/getUnionData', {activityScopeGroupId: val})
|
||||
this.formData.unionUserNumberLimit = resp.data
|
||||
},
|
||||
async doSave() {
|
||||
if (!this.formData.name) {
|
||||
this.$message.warning('请输入活动名称')
|
||||
return
|
||||
}
|
||||
|
||||
async operation() {
|
||||
if (this.formData.applyTime2 && this.formData.applyTime2.length > 0) {
|
||||
if (moment(this.formData.time[0]).valueOf() <= moment(this.formData.applyTime2[0]).valueOf()) {
|
||||
this.$notify.error({title: '错误', message: '活动时间必须晚于报名时间'});
|
||||
this.$message.warning('活动时间必须晚于报名时间')
|
||||
return
|
||||
}
|
||||
}
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
formData.type = this.pageForm.type
|
||||
formData.apply_type = 1
|
||||
const {time, applyTime2, plannedDate} = formData
|
||||
if (applyTime2 && applyTime2.length) {
|
||||
formData.applyStartTime = applyTime2[0]
|
||||
formData.applyEndTime = applyTime2[1]
|
||||
formData.applyTime2 = undefined
|
||||
}
|
||||
if (time && time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
if (plannedDate && plannedDate.length) {
|
||||
formData.startPlannedDate = formData.plannedDate[0]
|
||||
formData.endPlannedDate = formData.plannedDate[1]
|
||||
formData.plannedDate = undefined
|
||||
}
|
||||
this.$confirm('保存后可在左侧活动信息管理中重新编辑,确定要保存吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const resp = await $.post(this.actvivtyUrl + url, {tissue: JSON.stringify(formData)})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
formData.type = this.pageForm.type
|
||||
formData.apply_type = 1
|
||||
const {time, applyTime2, plannedDate} = formData
|
||||
if (applyTime2 && applyTime2.length) {
|
||||
formData.applyStartTime = applyTime2[0]
|
||||
formData.applyEndTime = applyTime2[1]
|
||||
formData.applyTime2 = undefined
|
||||
}
|
||||
if (time && time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
if (plannedDate && plannedDate.length) {
|
||||
formData.startPlannedDate = formData.plannedDate[0]
|
||||
formData.endPlannedDate = formData.plannedDate[1]
|
||||
formData.plannedDate = undefined
|
||||
}
|
||||
|
||||
const resp = await $.post(this.actvivtyUrl + "/doSave", {tissue: JSON.stringify(formData)})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
if (type === 40002) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/union")
|
||||
} else if (type === 40003) {
|
||||
@@ -887,13 +911,84 @@
|
||||
} else {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/school")
|
||||
}
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
async operation() {
|
||||
if (this.formData.applyTime2 && this.formData.applyTime2.length > 0) {
|
||||
if (moment(this.formData.time[0]).valueOf() <= moment(this.formData.applyTime2[0]).valueOf()) {
|
||||
this.$notify.error({title: '错误', message: '活动时间必须晚于报名时间'});
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
||||
this.$confirm('确定要提交吗,请确保信息填写无误哦?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
formData.type = this.pageForm.type
|
||||
formData.apply_type = 1
|
||||
const {time, applyTime2, plannedDate} = formData
|
||||
if (applyTime2 && applyTime2.length) {
|
||||
formData.applyStartTime = applyTime2[0]
|
||||
formData.applyEndTime = applyTime2[1]
|
||||
formData.applyTime2 = undefined
|
||||
}
|
||||
if (time && time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
if (plannedDate && plannedDate.length) {
|
||||
formData.startPlannedDate = formData.plannedDate[0]
|
||||
formData.endPlannedDate = formData.plannedDate[1]
|
||||
formData.plannedDate = undefined
|
||||
}
|
||||
|
||||
const resp = await $.post(this.actvivtyUrl + url, {tissue: JSON.stringify(formData)})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
if (type === 40002) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/union")
|
||||
} else if (type === 40003) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/club")
|
||||
} else {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/school")
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
this.$message.warning('存在未填写的的必填项')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
async init() {
|
||||
this.delNotesList = []
|
||||
|
||||
@@ -84,9 +84,10 @@
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='time'">
|
||||
<span>
|
||||
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
<span v-if="row.startTime && row.endTime">
|
||||
{{ moment(row.startTime).format('YYYY-MM-DD')}} - {{ moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
<span v-else>{{ '未填写' }}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='time2'">
|
||||
{{row.applyStartTime}}-{{row.applyEndTime}}
|
||||
@@ -113,10 +114,12 @@
|
||||
<span v-if="row.type==40001">校工会</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='state'">
|
||||
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}}
|
||||
<span v-if="row.state === 0" style="color: #fd835a">待提交</span>
|
||||
<span v-else-if="row.state === 1" style="color: #fd835a">待校工会审核</span>
|
||||
<span v-else-if="row.state === 2" style="color: #bc2a25">校工会审核拒绝</span>
|
||||
<span v-else-if="row.state === 3" style="color: #0e9558">审核通过</span>
|
||||
</template>
|
||||
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
@@ -133,6 +136,7 @@
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="{type:'edit',row}"
|
||||
v-if="row.state===0 || ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
:disabled="row.projectTypeCode==50004">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
|
||||
@@ -3,69 +3,66 @@
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动时间</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-input clearable placeholder="请输入活动名称"
|
||||
v-model="pageForm.name"></el-input>
|
||||
<el-input clearable placeholder="请输入活动名称" v-model="pageForm.name"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="pageData" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
<el-button @click="pageData" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="活动列表">
|
||||
<table-tool :app="this" label="活动列表"></table-tool>
|
||||
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
|
||||
v-loading="tableLoading">
|
||||
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table"
|
||||
row-key="id"
|
||||
style="width: 100%; margin-bottom: 20px"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='time'">
|
||||
<span>
|
||||
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
<span>{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='projectTypeName'">
|
||||
{{row.projectTypeName}}({{row.projectTypeCode}})
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='projectTypeName'">{{row.projectTypeName}}({{row.projectTypeCode}})</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='tussueName'">
|
||||
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
|
||||
@@ -74,65 +71,61 @@
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='countUser'">
|
||||
<el-tag type="success" v-if="row.countUser>0">已报名({{row.countUser}})
|
||||
</el-tag>
|
||||
<el-tag type="success" v-if="row.countUser>0">已报名({{row.countUser}})</el-tag>
|
||||
<el-tag type="danger" v-else>未报名</el-tag>
|
||||
</template>
|
||||
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline" width="200px">
|
||||
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button :loading="row.loading" @click="openView(row)" size="mini"
|
||||
type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button :loading="row.loading" @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<template
|
||||
v-if="moment(row.applyStartTime).valueOf()<moment().valueOf()&&moment(row.applyEndTime).valueOf()>moment().valueOf()">
|
||||
<el-button :loading="row.loading" @click="openAudit(row)"
|
||||
size="mini"
|
||||
type="primary" v-if="row.signUpMethod === 2">
|
||||
v-if="moment(row.applyStartTime).valueOf()<moment().valueOf()&&moment(row.applyEndTime).valueOf()>moment().valueOf()"
|
||||
>
|
||||
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" type="primary" v-if="row.signUpMethod === 2">
|
||||
报名
|
||||
</el-button>
|
||||
<el-button :loading="row.loading" @click="doAdd(row)" size="mini"
|
||||
type="primary"
|
||||
v-if="row.signUpMethod === 1&&row.countUser===0">
|
||||
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" type="primary" v-if="row.signUpMethod === 3">
|
||||
报名
|
||||
</el-button>
|
||||
<el-button :loading="row.loading" @click="doDelete(row)" size="mini"
|
||||
type="danger"
|
||||
v-if="row.countUser>0&&row.signUpMethod === 1">
|
||||
<el-button
|
||||
:loading="row.loading"
|
||||
@click="doAdd(row)"
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="row.signUpMethod === 1&&row.countUser===0"
|
||||
>
|
||||
报名
|
||||
</el-button>
|
||||
<el-button
|
||||
:loading="row.loading"
|
||||
@click="doDelete(row)"
|
||||
size="mini"
|
||||
type="danger"
|
||||
v-if="row.countUser>0&&row.signUpMethod === 1"
|
||||
>
|
||||
取消报名
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-transfer
|
||||
:data="leftData"
|
||||
:filter-method="filterMethod"
|
||||
:props="{key: 'id',label: 'name'}"
|
||||
:titles="['可报人员名单', '当前选择']"
|
||||
filterable
|
||||
ref="transfer"
|
||||
v-loading="tableLoading"
|
||||
v-model="rightData">
|
||||
:data="leftData"
|
||||
:filter-method="filterMethod"
|
||||
:props="{key: 'id',label: 'name'}"
|
||||
:titles="['可报人员名单', '当前选择']"
|
||||
filterable
|
||||
ref="transfer"
|
||||
v-loading="tableLoading"
|
||||
v-model="rightData"
|
||||
>
|
||||
<template #left-footer>
|
||||
<div></div>
|
||||
</template>
|
||||
@@ -141,208 +134,208 @@
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<el-table :data="escalationTableData" max-height="500px">
|
||||
<el-table-column
|
||||
align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index" width="100"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="姓名"
|
||||
prop="username"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="姓名" prop="username"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="教工号"
|
||||
prop="loginname"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="教工号" prop="loginname"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位"
|
||||
prop="unitname"
|
||||
sortable></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="单位" prop="unitname" sortable></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
sortable>
|
||||
<!--<el-table-column align="center" header-align="center" label="操作" sortable>
|
||||
<template scope="{$index,row}">
|
||||
<el-button @click="rightData.splice($index,1)" size="mini"
|
||||
type="danger">删除
|
||||
</el-button>
|
||||
<el-button @click="rightData.splice($index,1)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-row class="mt10 text-right">
|
||||
|
||||
<el-button @click="doBatchAdd" class="mt10" type="primary"
|
||||
v-loading="submitLoading">
|
||||
提交
|
||||
</el-button>
|
||||
<el-button @click="doBatchAdd" class="mt10" type="primary" v-loading="submitLoading">提交</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<tissue-info ref="info"></tissue-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
submitLoading: false,
|
||||
pageForm: {
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '活动名称'},
|
||||
{prop: 'address', label: '活动地点'},
|
||||
{prop: 'projectTypeName', label: '活动项目类型'},
|
||||
{prop: 'tussueName', label: '举办单位'},
|
||||
{prop: 'time', label: '活动日期'},
|
||||
{prop: 'applyTime', label: '创建时间', sortable: true},
|
||||
{prop: 'countUser', label: '报名人数', sortable: true}
|
||||
|
||||
{ prop: "name", label: "活动名称" },
|
||||
{ prop: "address", label: "活动地点" },
|
||||
{ prop: "projectTypeName", label: "活动项目类型" },
|
||||
{ prop: "tussueName", label: "举办单位" },
|
||||
{ prop: "time", label: "活动日期" },
|
||||
{ prop: "applyTime", label: "创建时间", sortable: true },
|
||||
{ prop: "countUser", label: "报名人数", sortable: true }
|
||||
],
|
||||
leftData: [],
|
||||
rightData: [],
|
||||
|
||||
rowData: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue?v=' + new Date().getTime()),
|
||||
"tissue-info": httpVueLoader("/components/activity/school/tissueInfo.vue?v=" + new Date().getTime())
|
||||
},
|
||||
computed: {
|
||||
escalationTableData() {
|
||||
return this.leftData.filter(v => this.rightData.includes(v.id))
|
||||
return this.leftData.filter((v) => this.rightData.includes(v.id))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
const { id } = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async doBatchAdd() {
|
||||
if (this.rightData && this.rightData.length > this.rowData.teamNum && this.rowData.signUpMethod === 3) {
|
||||
this.$message.error("该模式组队限制人数为" + this.rowData.teamNum + "人!")
|
||||
return
|
||||
}
|
||||
|
||||
this.submitLoading = true
|
||||
const {
|
||||
code,
|
||||
msg
|
||||
} = await $.get('/mobile/activity/unionActivity/doSaveUnionRegister', {
|
||||
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSaveUnionRegister", {
|
||||
activityId: this.tissueId,
|
||||
personIds: JSON.stringify(this.rightData)
|
||||
})
|
||||
if (code === 0) {
|
||||
this.notifySuccess(msg)
|
||||
this.$message.success(msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyError(msg)
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
this.submitLoading = false
|
||||
|
||||
},
|
||||
async doDelete(row) {
|
||||
const confirm = await this.$confirm('确认要取消报名吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
const confirm = await this.$confirm("确认要取消报名吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
row.loading = true
|
||||
const {
|
||||
code,
|
||||
msg
|
||||
} = await $.get('/mobile/activity/unionActivity/doSingleCancelRegister', {
|
||||
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSingleCancelRegister", {
|
||||
activityId: row.id
|
||||
})
|
||||
if (code === 0) {
|
||||
this.notifySuccess(msg)
|
||||
this.$message.success(msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyError(msg)
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
row.loading = false
|
||||
}
|
||||
},
|
||||
async doAdd(row) {
|
||||
const confirm = await this.$confirm('确认要报名吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
const confirm = await this.$confirm("确认要报名吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
row.loading = true
|
||||
const {
|
||||
code,
|
||||
msg
|
||||
} = await $.get('/mobile/activity/unionActivity/doSingleRegister', {
|
||||
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSingleRegister", {
|
||||
activityId: row.id
|
||||
})
|
||||
if (code === 0) {
|
||||
this.notifySuccess(msg)
|
||||
this.$message.success(msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyError(msg)
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
row.loading = false
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
async openAudit(row) {
|
||||
this.rowData = row
|
||||
this.tissueId = row.id
|
||||
|
||||
const flag = await getScopeUser(row.groupId)
|
||||
if (!flag) {
|
||||
this.$message.warning("您没有报名权限!")
|
||||
return
|
||||
}
|
||||
|
||||
this.tableLoading = true
|
||||
this.$refs.guava.edit()
|
||||
const {data} = await $.get('/platform/activity/applyUser/selfUnionUsers', {
|
||||
groupId: row.groupId
|
||||
const { data } = await $.get("/platform/activity/applyUser/selfUnionUsers", {
|
||||
groupId: row.groupId,
|
||||
tissueId: row.id
|
||||
})
|
||||
this.leftData = data
|
||||
|
||||
const {data: rightData} = await $.get('/platform/activity/applyUser/getReportedUser', {
|
||||
const { data: rightData } = await $.get("/platform/activity/applyUser/getReportedUser", {
|
||||
tissueId: row.id
|
||||
})
|
||||
this.leftData = data.map(user => {
|
||||
return this.getTransProp(user)
|
||||
})
|
||||
this.rightData = rightData.map(user => {
|
||||
return this.getTransProp(user)
|
||||
this.leftData = data.map((user) => {
|
||||
return this.getTransProp(user, row.signUpMethod)
|
||||
})
|
||||
// this.rightData = rightData.map((user) => {
|
||||
// return this.getTransProp(user)
|
||||
// })
|
||||
|
||||
this.rightData = rightData
|
||||
//如果是组队报名,默认添加自己
|
||||
if (rightData && rightData.length === 0 && row.signUpMethod === 3) {
|
||||
rightData.push("${@shiro.getPrincipalProperty('id')}")
|
||||
}
|
||||
|
||||
this.tableLoading = false
|
||||
},
|
||||
getTransProp(user) {
|
||||
getTransProp(user, signUpMethod) {
|
||||
return {
|
||||
id: user.id,
|
||||
username:user.username,
|
||||
loginname:user.loginname,
|
||||
sex:user.sex,
|
||||
unionname:user.unionname,
|
||||
unitname:user.unitname,
|
||||
userState:user.userState,
|
||||
username: user.username,
|
||||
loginname: user.loginname,
|
||||
sex: user.sex,
|
||||
unionname: user.unionname,
|
||||
unitname: user.unitname,
|
||||
userState: user.userState,
|
||||
name: user.username + "-" + user.loginname + "-" + user.unitname,
|
||||
//如果是组队报名,并且userId等于当前登入人禁用选项
|
||||
disabled: signUpMethod === 3 && user.id === "${@shiro.getPrincipalProperty('id')}" ? true : false
|
||||
}
|
||||
},
|
||||
filterMethod(query, item) {
|
||||
if (!query){
|
||||
if (!query) {
|
||||
return -1
|
||||
}
|
||||
return item.name.indexOf(query) > -1;
|
||||
return item.name.indexOf(query) > -1
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
sublime.showLoadingbar()
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/applyUser/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
$.post(
|
||||
"/platform/activity/applyUser/pageData",
|
||||
this.pageForm,
|
||||
(data) => {
|
||||
sublime.closeLoadingbar()
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list
|
||||
this.pageForm.totalCount = data.data.totalCount
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@@ -354,7 +347,7 @@
|
||||
<style>
|
||||
.flexible-gifts {
|
||||
display: flex;
|
||||
flex-direction: column
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flexible-gifts-item {
|
||||
@@ -387,7 +380,7 @@
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
@@ -428,4 +421,3 @@
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -159,8 +159,8 @@ layout("/layouts/platform.html"){
|
||||
const ids = this.checkUsers.map(item => item.id)
|
||||
if (isHasNewTeacher) {
|
||||
this.$confirm('勾选用户中有新入职教工,是否对新入职教职工发送入会邀请?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '是',
|
||||
cancelButtonText: '否',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
isSendMsg = true
|
||||
@@ -182,8 +182,8 @@ layout("/layouts/platform.html"){
|
||||
let isSendMsg = false;
|
||||
if (formData.changeInfosStr === '新入职') {
|
||||
this.$confirm('该职工是新入职职工,是否发送入会邀请?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '是',
|
||||
cancelButtonText: '否',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
isSendMsg = true
|
||||
|
||||
Reference in New Issue
Block a user